For electromagnet interference (EMI) optimization issues, different hardware-level techniques have been proposed. This paper focuses on an EMI optimization technique via a software-level technique. We propose a novel estimation and optimization tool for reducing conducted EMI at specified frequency by compiler technology. This study is not a research on compiler technique but an adaption of computer science-domain technology to EMI optimization research. The proposed tool can accept C language syntax and generate many versions of assembly programs. These assembly programs perform the same functionality defined by the input C program but with different conducted EMI behaviors when they are executed. The proposed tool can estimate, select, and generate the assembly program with the least amount of conducted EMI released during its execution. The experiment results show that the proposed tool can analyze test C-programs and generate lower EMI assembly programs. Currently, compared to a commercial compiler, the proposed technique can decrease conducted EMI by 2-5 dB at any specified frequency.Index Terms-Electromagnetic analysis, electromagnetic interference (EMI), electromagnetic measurements.