#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int log10(double);
double pow(double, int);
int /*<<< orphan*/ printf(char *, double);
int main() {
  int freq = 1000;
  double a = 1.562339 * pow(freq, 4);
  double b = pow(freq, 2) + pow(107.65265, 2);
  double c = pow(freq, 2) + pow(737.86223, 2);
  double d = 2.242881 * pow(10, 16) * pow(freq, 4);
  double e = pow(freq, 2) + pow(20.598997, 2);
  double f = pow(freq, 2) + pow(12194.22, 2);
  double aa = 10 * log10(a / (b * c));
  double bb = 10 * log10(d / (pow(e, 2) * pow(f, 2)));
  double WA = aa + bb;
  printf("freq = %dHz\n", freq);
  printf("a = %f\n", a);
  printf("b = %f\n", b);
  printf("c = %f\n", c);
  printf("d = %f\n", d);
  printf("e = %f\n", e);
  printf("f = %f\n", f);
  printf("aa = %f\n", aa);
  printf("bb = %f\n", bb);
  printf("WA = %f\n", WA);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x3e8,-0x8(%rbp)
cvtsi2sdl -0x8(%rbp),%xmm0
mov    $0x4,%edi
call   1040 <pow@plt>
movaps %xmm0,%xmm1
movsd  0xecd(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x10(%rbp)
cvtsi2sdl -0x8(%rbp),%xmm0
mov    $0x2,%edi
call   1040 <pow@plt>
movsd  %xmm0,-0x88(%rbp)
ff
movsd  0xe9d(%rip),%xmm0
mov    $0x2,%edi
call   1040 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x88(%rbp),%xmm0
ff
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x18(%rbp)
cvtsi2sdl -0x8(%rbp),%xmm0
mov    $0x2,%edi
call   1040 <pow@plt>
movsd  %xmm0,-0x80(%rbp)
movsd  0xe5b(%rip),%xmm0
mov    $0x2,%edi
call   1040 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x80(%rbp),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xe30(%rip),%xmm0
mov    $0x10,%edi
call   1040 <pow@plt>
movaps %xmm0,%xmm1
movsd  0xe13(%rip),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x78(%rbp)
cvtsi2sdl -0x8(%rbp),%xmm0
mov    $0x4,%edi
call   1040 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x78(%rbp),%xmm0
mulsd  %xmm1,%xmm0
movsd  %xmm0,-0x28(%rbp)
cvtsi2sdl -0x8(%rbp),%xmm0
mov    $0x2,%edi
call   1040 <pow@plt>
movsd  %xmm0,-0x70(%rbp)
movsd  0xdc6(%rip),%xmm0
mov    $0x2,%edi
call   1040 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x70(%rbp),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
cvtsi2sdl -0x8(%rbp),%xmm0
mov    $0x2,%edi
call   1040 <pow@plt>
movsd  %xmm0,-0x68(%rbp)
movsd  0xd87(%rip),%xmm0
mov    $0x2,%edi
call   1040 <pow@plt>
movaps %xmm0,%xmm1
movsd  -0x68(%rbp),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x38(%rbp)
movsd  -0x10(%rbp),%xmm0
movsd  -0x18(%rbp),%xmm1
mulsd  -0x20(%rbp),%xmm1
divsd  %xmm1,%xmm0
call   1050 <log10@plt>
imul   $0xa,%eax,%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x28(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x30(%rbp),%xmm0
mov    $0x2,%edi
call   1040 <pow@plt>
movsd  %xmm0,-0x60(%rbp)
movsd  -0x38(%rbp),%xmm0
mov    $0x2,%edi
call   1040 <pow@plt>
movsd  -0x60(%rbp),%xmm1
movaps %xmm0,%xmm2
movsd  -0x58(%rbp),%xmm0
mulsd  %xmm2,%xmm1
divsd  %xmm1,%xmm0
call   1050 <log10@plt>
imul   $0xa,%eax,%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  -0x40(%rbp),%xmm0
addsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0x50(%rbp)
cvtsi2sdl -0x8(%rbp),%xmm0
lea    0xd12(%rip),%rdi
call   1030 <printf@plt>
movsd  -0x10(%rbp),%xmm0
lea    0xd2f(%rip),%rdi
call   1030 <printf@plt>
movsd  -0x18(%rbp),%xmm0
lea    0xd27(%rip),%rdi
call   1030 <printf@plt>
movsd  -0x20(%rbp),%xmm0
lea    0xcec(%rip),%rdi
call   1030 <printf@plt>
movsd  -0x28(%rbp),%xmm0
lea    0xce3(%rip),%rdi
call   1030 <printf@plt>
movsd  -0x30(%rbp),%xmm0
lea    0xcda(%rip),%rdi
call   1030 <printf@plt>
movsd  -0x38(%rbp),%xmm0
lea    0xcd1(%rip),%rdi
call   1030 <printf@plt>
movsd  -0x40(%rbp),%xmm0
lea    0xcc8(%rip),%rdi
call   1030 <printf@plt>
movsd  -0x48(%rbp),%xmm0
lea    0xcc0(%rip),%rdi
call   1030 <printf@plt>
movsd  -0x50(%rbp),%xmm0
lea    0xcb8(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
sub    $0x48,%rsp
movsd  0xec4(%rip),%xmm0
mov    $0x4,%edi
call   1040 <pow@plt>
mulsd  0xeba(%rip),%xmm0
movsd  %xmm0,0x38(%rsp)
movsd  0xea4(%rip),%xmm0
mov    $0x2,%edi
call   1040 <pow@plt>
movsd  %xmm0,0x20(%rsp)
movsd  0xe9c(%rip),%xmm0
mov    $0x2,%edi
call   1040 <pow@plt>
addsd  0x20(%rsp),%xmm0
movsd  %xmm0,0x20(%rsp)
movsd  0xe6e(%rip),%xmm0
mov    $0x2,%edi
call   1040 <pow@plt>
movsd  %xmm0,0x18(%rsp)
movsd  0xe6e(%rip),%xmm0
mov    $0x2,%edi
call   1040 <pow@plt>
addsd  0x18(%rsp),%xmm0
movsd  %xmm0,0x18(%rsp)
movsd  0xe58(%rip),%xmm0
mov    $0x10,%edi
call   1040 <pow@plt>
mulsd  0xe4e(%rip),%xmm0
movsd  %xmm0,0x10(%rsp)
movsd  0xe18(%rip),%xmm0
mov    $0x4,%edi
call   1040 <pow@plt>
mulsd  0x10(%rsp),%xmm0
movsd  %xmm0,0x10(%rsp)
movsd  0xdfa(%rip),%xmm0
mov    $0x2,%edi
call   1040 <pow@plt>
movsd  %xmm0,0x8(%rsp)
movsd  0xe12(%rip),%xmm0
mov    $0x2,%edi
call   1040 <pow@plt>
addsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0xdc4(%rip),%xmm0
mov    $0x2,%edi
call   1040 <pow@plt>
movsd  %xmm0,(%rsp)
movsd  0xde5(%rip),%xmm0
mov    $0x2,%edi
call   1040 <pow@plt>
addsd  (%rsp),%xmm0
movsd  %xmm0,(%rsp)
movsd  0x20(%rsp),%xmm1
mulsd  0x18(%rsp),%xmm1
movsd  0x38(%rsp),%xmm0
divsd  %xmm1,%xmm0
call   1050 <log10@plt>
add    %eax,%eax
lea    (%rax,%rax,4),%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
movsd  %xmm0,0x30(%rsp)
movsd  0x8(%rsp),%xmm0
mov    $0x2,%edi
call   1040 <pow@plt>
movsd  %xmm0,0x28(%rsp)
movsd  (%rsp),%xmm0
mov    $0x2,%edi
call   1040 <pow@plt>
mulsd  0x28(%rsp),%xmm0
movsd  0x10(%rsp),%xmm1
divsd  %xmm0,%xmm1
movapd %xmm1,%xmm0
call   1050 <log10@plt>
add    %eax,%eax
lea    (%rax,%rax,4),%eax
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
movsd  %xmm1,0x40(%rsp)
movsd  0x30(%rsp),%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,0x28(%rsp)
lea    0xd45(%rip),%rdi
movsd  0xcfd(%rip),%xmm0
call   1030 <printf@plt>
lea    0xd5f(%rip),%rdi
movsd  0x38(%rsp),%xmm0
call   1030 <printf@plt>
lea    0xd56(%rip),%rdi
movsd  0x20(%rsp),%xmm0
call   1030 <printf@plt>
lea    0xd1a(%rip),%rdi
movsd  0x18(%rsp),%xmm0
call   1030 <printf@plt>
lea    0xd10(%rip),%rdi
movsd  0x10(%rsp),%xmm0
call   1030 <printf@plt>
lea    0xd06(%rip),%rdi
movsd  0x8(%rsp),%xmm0
call   1030 <printf@plt>
lea    0xcfc(%rip),%rdi
movsd  (%rsp),%xmm0
call   1030 <printf@plt>
lea    0xcf3(%rip),%rdi
movsd  0x30(%rsp),%xmm0
call   1030 <printf@plt>
lea    0xcea(%rip),%rdi
movsd  0x40(%rsp),%xmm0
call   1030 <printf@plt>
lea    0xce1(%rip),%rdi
movsd  0x28(%rsp),%xmm0
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x48,%rsp
ret

LLVM IR (-O0):
@.str = [13 x i8] c"freq = %dHz\0A\00"
@.str.1 = [8 x i8] c"a = %f\0A\00"
@.str.2 = [8 x i8] c"b = %f\0A\00"
@.str.3 = [8 x i8] c"c = %f\0A\00"
@.str.4 = [8 x i8] c"d = %f\0A\00"
@.str.5 = [8 x i8] c"e = %f\0A\00"
@.str.6 = [8 x i8] c"f = %f\0A\00"
@.str.7 = [9 x i8] c"aa = %f\0A\00"
@.str.8 = [9 x i8] c"bb = %f\0A\00"
@.str.9 = [9 x i8] c"WA = %f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca double
%4 = alloca double
%5 = alloca double
%6 = alloca double
%7 = alloca double
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
store i32 0, i32* %1
store i32 1000, i32* %2
%12 = load i32, i32* %2
%13 = sitofp i32 %12 to double
%14 = call double @pow(double %13, i32 4)
%15 = fmul double 0x3FF8FF572DE43ED9, %14
store double %15, double* %3
%16 = load i32, i32* %2
%17 = sitofp i32 %16 to double
%18 = call double @pow(double %17, i32 2)
%19 = call double @pow(double 0x405AE9C504816F00, i32 2)
%20 = fadd double %18, %19
store double %20, double* %4
%21 = load i32, i32* %2
%22 = sitofp i32 %21 to double
%23 = call double @pow(double %22, i32 2)
%24 = call double @pow(double 0x40870EE5D8D79D0A, i32 2)
%25 = fadd double %23, %24
store double %25, double* %5
%26 = call double @pow(double 1.000000e+01, i32 16)
%27 = fmul double 0x4001F16B97FE8EE7, %26
%28 = load i32, i32* %2
%29 = sitofp i32 %28 to double
%30 = call double @pow(double %29, i32 4)
%31 = fmul double %27, %30
store double %31, double* %6
%32 = load i32, i32* %2
%33 = sitofp i32 %32 to double
%34 = call double @pow(double %33, i32 2)
%35 = call double @pow(double 0x40349957DE0D66F1, i32 2)
%36 = fadd double %34, %35
store double %36, double* %7
%37 = load i32, i32* %2
%38 = sitofp i32 %37 to double
%39 = call double @pow(double %38, i32 2)
%40 = call double @pow(double 0x40C7D11C28F5C28F, i32 2)
%41 = fadd double %39, %40
store double %41, double* %8
%42 = load double, double* %3
%43 = load double, double* %4
%44 = load double, double* %5
%45 = fmul double %43, %44
%46 = fdiv double %42, %45
%47 = call i32 @log10(double %46)
%48 = mul nsw i32 10, %47
%49 = sitofp i32 %48 to double
store double %49, double* %9
%50 = load double, double* %6
%51 = load double, double* %7
%52 = call double @pow(double %51, i32 2)
%53 = load double, double* %8
%54 = call double @pow(double %53, i32 2)
%55 = fmul double %52, %54
%56 = fdiv double %50, %55
%57 = call i32 @log10(double %56)
%58 = mul nsw i32 10, %57
%59 = sitofp i32 %58 to double
store double %59, double* %10
%60 = load double, double* %9
%61 = load double, double* %10
%62 = fadd double %60, %61
store double %62, double* %11
%63 = load i32, i32* %2
%64 = sitofp i32 %63 to double
%65 = call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), double %64)
%66 = load double, double* %3
%67 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), double %66)
%68 = load double, double* %4
%69 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), double %68)
%70 = load double, double* %5
%71 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), double %70)
%72 = load double, double* %6
%73 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), double %72)
%74 = load double, double* %7
%75 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0), double %74)
%76 = load double, double* %8
%77 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i64 0, i64 0), double %76)
%78 = load double, double* %9
%79 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.7, i64 0, i64 0), double %78)
%80 = load double, double* %10
%81 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.8, i64 0, i64 0), double %80)
%82 = load double, double* %11
%83 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.9, i64 0, i64 0), double %82)
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"freq = %dHz\0A\00"
@.str.1 = [8 x i8] c"a = %f\0A\00"
@.str.2 = [8 x i8] c"b = %f\0A\00"
@.str.3 = [8 x i8] c"c = %f\0A\00"
@.str.4 = [8 x i8] c"d = %f\0A\00"
@.str.5 = [8 x i8] c"e = %f\0A\00"
@.str.6 = [8 x i8] c"f = %f\0A\00"
@.str.7 = [9 x i8] c"aa = %f\0A\00"
@.str.8 = [9 x i8] c"bb = %f\0A\00"
@.str.9 = [9 x i8] c"WA = %f\0A\00"
define i32 @main() {
%1 = tail call double @pow(double 1.000000e+03, i32 4)
%2 = fmul double %1, 0x3FF8FF572DE43ED9
%3 = tail call double @pow(double 1.000000e+03, i32 2)
%4 = tail call double @pow(double 0x405AE9C504816F00, i32 2)
%5 = fadd double %3, %4
%6 = tail call double @pow(double 1.000000e+03, i32 2)
%7 = tail call double @pow(double 0x40870EE5D8D79D0A, i32 2)
%8 = fadd double %6, %7
%9 = tail call double @pow(double 1.000000e+01, i32 16)
%10 = fmul double %9, 0x4001F16B97FE8EE7
%11 = tail call double @pow(double 1.000000e+03, i32 4)
%12 = fmul double %10, %11
%13 = tail call double @pow(double 1.000000e+03, i32 2)
%14 = tail call double @pow(double 0x40349957DE0D66F1, i32 2)
%15 = fadd double %13, %14
%16 = tail call double @pow(double 1.000000e+03, i32 2)
%17 = tail call double @pow(double 0x40C7D11C28F5C28F, i32 2)
%18 = fadd double %16, %17
%19 = fmul double %5, %8
%20 = fdiv double %2, %19
%21 = tail call i32 @log10(double %20)
%22 = mul nsw i32 %21, 10
%23 = sitofp i32 %22 to double
%24 = tail call double @pow(double %15, i32 2)
%25 = tail call double @pow(double %18, i32 2)
%26 = fmul double %24, %25
%27 = fdiv double %12, %26
%28 = tail call i32 @log10(double %27)
%29 = mul nsw i32 %28, 10
%30 = sitofp i32 %29 to double
%31 = fadd double %23, %30
%32 = tail call i32 @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), double 1.000000e+03)
%33 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), double %2)
%34 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), double %5)
%35 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), double %8)
%36 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0), double %12)
%37 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0), double %15)
%38 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.6, i64 0, i64 0), double %18)
%39 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.7, i64 0, i64 0), double %23)
%40 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.8, i64 0, i64 0), double %30)
%41 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.9, i64 0, i64 0), double %31)
ret i32 0
}