int main(void) {
  int a = 5;
  float x = 3.1415926, y = 0.86;
  printf("SQUARE(%i) = %i\n", a, ((a) * (a)));
  printf("SQUARE(%f) = %f\n", x, ((x) * (x)));
  printf("SUM(%f, %f) = %f\n", x, y, ((x) + (y)));
  printf("SUM(%i, %f) = %f\n", a, x, ((a) + (x)));
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x5,-0x8(%rbp)
movss  0xed6(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  0xec5(%rip),%xmm0
movss  %xmm0,-0x10(%rbp)
mov    -0x8(%rbp),%esi
mov    -0x8(%rbp),%edx
imul   -0x8(%rbp),%edx
lea    0xeb7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0xc(%rbp),%xmm1
mulss  -0xc(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
lea    0xea3(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x10(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
movss  -0xc(%rbp),%xmm2
addss  -0x10(%rbp),%xmm2
cvtss2sd %xmm2,%xmm2
lea    0xe86(%rip),%rdi
mov    $0x3,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%esi
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
cvtsi2ssl -0x8(%rbp),%xmm1
addss  -0xc(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
lea    0xe70(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xf10(%rip),%rdi
mov    $0x5,%esi
mov    $0x19,%edx
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xf09(%rip),%rdi
movsd  0xec8(%rip),%xmm0
movsd  0xec8(%rip),%xmm1
mov    $0x2,%al
call   1030 <printf@plt>
lea    0xefc(%rip),%rdi
movsd  0xeba(%rip),%xmm1
movsd  0xeba(%rip),%xmm2
movsd  0xe9a(%rip),%xmm0
mov    $0x3,%al
call   1030 <printf@plt>
lea    0xee8(%rip),%rdi
movsd  0xea4(%rip),%xmm1
mov    $0x5,%esi
movsd  0xe77(%rip),%xmm0
mov    $0x2,%al
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [17 x i8] c"SQUARE(%i) = %i\0A\00"
@.str.1 = [17 x i8] c"SQUARE(%f) = %f\0A\00"
@.str.2 = [18 x i8] c"SUM(%f, %f) = %f\0A\00"
@.str.3 = [18 x i8] c"SUM(%i, %f) = %f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca float
%4 = alloca float
store i32 0, i32* %1
store i32 5, i32* %2
store float 0x400921FB40000000, float* %3
store float 0x3FEB851EC0000000, float* %4
%5 = load i32, i32* %2
%6 = load i32, i32* %2
%7 = load i32, i32* %2
%8 = mul nsw i32 %6, %7
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %8)
%10 = load float, float* %3
%11 = fpext float %10 to double
%12 = load float, float* %3
%13 = load float, float* %3
%14 = fmul float %12, %13
%15 = fpext float %14 to double
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), double %11, double %15)
%17 = load float, float* %3
%18 = fpext float %17 to double
%19 = load float, float* %4
%20 = fpext float %19 to double
%21 = load float, float* %3
%22 = load float, float* %4
%23 = fadd float %21, %22
%24 = fpext float %23 to double
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), double %18, double %20, double %24)
%26 = load i32, i32* %2
%27 = load float, float* %3
%28 = fpext float %27 to double
%29 = load i32, i32* %2
%30 = sitofp i32 %29 to float
%31 = load float, float* %3
%32 = fadd float %30, %31
%33 = fpext float %32 to double
%34 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0), i32 %26, double %28, double %33)
ret i32 0
}

LLVM IR (-O2):
@.str = [17 x i8] c"SQUARE(%i) = %i\0A\00"
@.str.1 = [17 x i8] c"SQUARE(%f) = %f\0A\00"
@.str.2 = [18 x i8] c"SUM(%f, %f) = %f\0A\00"
@.str.3 = [18 x i8] c"SUM(%i, %f) = %f\0A\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i32 5, i32 25)
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), double 0x400921FB40000000, double 0x4023BD3CA0000000)
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), double 0x400921FB40000000, double 0x3FEB851EC0000000, double 0x401001A180000000)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.3, i64 0, i64 0), i32 5, double 0x400921FB40000000, double 0x4020487EC0000000)
ret i32 0
}