int main(void) {
  int a = 1, b = 2;
  float c = 1.1, h = 2.2;
  char d = 'd', e = 'e';
  char f[] = "hello", i[] = "world";
  printf("aaa \n");
  printf("test %c, %f \n", d, c);
  printf("test %c, %5f \n", e, h);
  printf("test %c, %i, %7f \n", e, b, h);
  printf("test %37d, %c, %i, %5f \n", sum(1, b), sumc(d, 'd'), a, sumf(1.0, h));
  printf("test %37d, %c, %i, %5f, %7s \n", a, sumc(d, e), b, h, f);
  printf("%c%s%f%i%d%f%i%c%s \n", 'h', sums(f, f), c, b, a, sumf(c, h),
         sum(a, b), d, sums("hello", i));
  printf("%s\n", i);
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
movss  0xe97(%rip),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  0xe86(%rip),%xmm0
movss  %xmm0,-0x14(%rbp)
movb   $0x64,-0x15(%rbp)
movb   $0x65,-0x16(%rbp)
mov    0xe7b(%rip),%eax
mov    %eax,-0x1c(%rbp)
mov    0xe75(%rip),%ax
mov    %ax,-0x18(%rbp)
mov    0xe6d(%rip),%eax
mov    %eax,-0x22(%rbp)
mov    0xe67(%rip),%ax
mov    %ax,-0x1e(%rbp)
lea    0xe5e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movsbl -0x15(%rbp),%esi
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe49(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movsbl -0x16(%rbp),%esi
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe3c(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movsbl -0x16(%rbp),%esi
mov    -0xc(%rbp),%edx
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe2d(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%esi
mov    $0x1,%edi
mov    $0x0,%al
call   1060 <sum@plt>
mov    %eax,-0x54(%rbp)
movsbl -0x15(%rbp),%edi
mov    $0x64,%esi
mov    $0x0,%al
call   1040 <sumc@plt>
mov    %eax,-0x50(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x4c(%rbp)
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xdab(%rip),%xmm0
mov    $0x2,%al
call   1070 <sumf@plt>
mov    -0x54(%rbp),%esi
mov    -0x50(%rbp),%edx
mov    -0x4c(%rbp),%ecx
mov    %eax,%r8d
lea    0xde3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0x48(%rbp)
movsbl -0x15(%rbp),%edi
movsbl -0x16(%rbp),%esi
mov    $0x0,%al
call   1040 <sumc@plt>
mov    -0x48(%rbp),%esi
mov    %eax,%edx
mov    -0xc(%rbp),%ecx
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    -0x1c(%rbp),%r8
lea    0xdc4(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
lea    -0x1c(%rbp),%rdi
lea    -0x1c(%rbp),%rsi
mov    $0x0,%al
call   1050 <sums@plt>
mov    %eax,-0x44(%rbp)
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,-0x40(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x38(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x34(%rbp)
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x14(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
mov    $0x2,%al
call   1070 <sumf@plt>
mov    %eax,-0x30(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    $0x0,%al
call   1060 <sum@plt>
mov    %eax,-0x2c(%rbp)
movsbl -0x15(%rbp),%eax
mov    %eax,-0x28(%rbp)
lea    -0x22(%rbp),%rsi
lea    0xcf8(%rip),%rdi
mov    $0x0,%al
call   1050 <sums@plt>
mov    -0x44(%rbp),%edx
movsd  -0x40(%rbp),%xmm0
mov    -0x38(%rbp),%ecx
mov    -0x34(%rbp),%r8d
mov    -0x30(%rbp),%r9d
mov    -0x2c(%rbp),%r11d
mov    -0x28(%rbp),%r10d
lea    0xd48(%rip),%rdi
mov    $0x68,%esi
mov    %r11d,(%rsp)
mov    %r10d,0x8(%rsp)
mov    %eax,0x10(%rsp)
mov    $0x1,%al
call   1030 <printf@plt>
lea    -0x22(%rbp),%rsi
lea    0xd39(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x1,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
movw   $0x6f,0x14(%rsp)
movl   $0x6c6c6568,0x10(%rsp)
6c
lea    0xf16(%rip),%r14
movw   $0x64,0xc(%rsp)
movl   $0x6c726f77,0x8(%rsp)
6c
lea    0xf06(%rip),%rdi
call   1030 <puts@plt>
lea    0xe78(%rip),%rdi
movsd  0xe52(%rip),%xmm0
mov    $0x64,%esi
mov    $0x1,%al
call   1040 <printf@plt>
lea    0xe6b(%rip),%rdi
movsd  0xe3f(%rip),%xmm0
mov    $0x65,%esi
mov    $0x1,%al
call   1040 <printf@plt>
lea    0xe5f(%rip),%rdi
mov    $0x65,%esi
mov    $0x2,%edx
movsd  0xe1a(%rip),%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
mov    $0x1,%edi
mov    $0x2,%esi
xor    %eax,%eax
call   1070 <sum@plt>
mov    %eax,%ebp
mov    $0x64,%edi
mov    $0x64,%esi
xor    %eax,%eax
call   1050 <sumc@plt>
mov    %eax,%ebx
movsd  0xded(%rip),%xmm0
movsd  0xddd(%rip),%xmm1
mov    $0x2,%al
call   1080 <sumf@plt>
lea    0xe15(%rip),%rdi
mov    %ebp,%esi
mov    %ebx,%edx
mov    $0x1,%ecx
mov    %eax,%r8d
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x64,%edi
mov    $0x65,%esi
xor    %eax,%eax
call   1050 <sumc@plt>
lea    0xe03(%rip),%rdi
lea    0x10(%rsp),%rbx
mov    $0x1,%esi
mov    %eax,%edx
mov    $0x2,%ecx
movsd  0xd8b(%rip),%xmm0
mov    %rbx,%r8
mov    $0x1,%al
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1060 <sums@plt>
mov    %eax,%r15d
movsd  0xd61(%rip),%xmm0
movsd  0xd61(%rip),%xmm1
mov    $0x2,%al
call   1080 <sumf@plt>
mov    %eax,%ebp
mov    $0x1,%edi
mov    $0x2,%esi
xor    %eax,%eax
call   1070 <sum@plt>
mov    %eax,%r13d
lea    0x8(%rsp),%r12
mov    %r14,%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1060 <sums@plt>
mov    %eax,%ebx
sub    $0x8,%rsp
lea    0xda2(%rip),%rdi
mov    $0x68,%esi
mov    %r15d,%edx
movsd  0xd0d(%rip),%xmm0
mov    $0x2,%ecx
mov    $0x1,%r8d
mov    %ebp,%r9d
mov    $0x1,%al
push   %rbx
push   $0x64
push   %r13
call   1040 <printf@plt>
add    $0x20,%rsp
mov    %r12,%rdi
call   1030 <puts@plt>
mov    $0x1,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@__const.main.f = [6 x i8] c"hello\00"
@__const.main.i = [6 x i8] c"world\00"
@.str = [6 x i8] c"aaa \0A\00"
@.str.1 = [14 x i8] c"test %c, %f \0A\00"
@.str.2 = [15 x i8] c"test %c, %5f \0A\00"
@.str.3 = [19 x i8] c"test %c, %i, %7f \0A\00"
@.str.4 = [25 x i8] c"test %37d, %c, %i, %5f \0A\00"
@.str.5 = [30 x i8] c"test %37d, %c, %i, %5f, %7s \0A\00"
@.str.6 = [21 x i8] c"%c%s%f%i%d%f%i%c%s \0A\00"
@.str.7 = [6 x i8] c"hello\00"
@.str.8 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca float
%5 = alloca float
%6 = alloca i8
%7 = alloca i8
%8 = alloca [6 x i8]
%9 = alloca [6 x i8]
store i32 0, i32* %1
store i32 1, i32* %2
store i32 2, i32* %3
store float 0x3FF19999A0000000, float* %4
store float 0x40019999A0000000, float* %5
store i8 100, i8* %6
store i8 101, i8* %7
%10 = bitcast [6 x i8]* %8 to i8*
%11 = bitcast [6 x i8]* %9 to i8*
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%13 = load i8, i8* %6
%14 = sext i8 %13 to i32
%15 = load float, float* %4
%16 = fpext float %15 to double
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 %14, double %16)
%18 = load i8, i8* %7
%19 = sext i8 %18 to i32
%20 = load float, float* %5
%21 = fpext float %20 to double
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i32 %19, double %21)
%23 = load i8, i8* %7
%24 = sext i8 %23 to i32
%25 = load i32, i32* %3
%26 = load float, float* %5
%27 = fpext float %26 to double
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0), i32 %24, i32 %25, double %27)
%29 = load i32, i32* %3
%30 = call i32 (i32, i32, ...) bitcast (i32 (...)* @sum to i32 (i32, i32, ...)*)(i32 1, i32 %29)
%31 = load i8, i8* %6
%32 = sext i8 %31 to i32
%33 = call i32 (i32, i32, ...) bitcast (i32 (...)* @sumc to i32 (i32, i32, ...)*)(i32 %32, i32 100)
%34 = load i32, i32* %2
%35 = load float, float* %5
%36 = fpext float %35 to double
%37 = call i32 (double, double, ...) bitcast (i32 (...)* @sumf to i32 (double, double, ...)*)(double 1.000000e+00, double %36)
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.4, i64 0, i64 0), i32 %30, i32 %33, i32 %34, i32 %37)
%39 = load i32, i32* %2
%40 = load i8, i8* %6
%41 = sext i8 %40 to i32
%42 = load i8, i8* %7
%43 = sext i8 %42 to i32
%44 = call i32 (i32, i32, ...) bitcast (i32 (...)* @sumc to i32 (i32, i32, ...)*)(i32 %41, i32 %43)
%45 = load i32, i32* %3
%46 = load float, float* %5
%47 = fpext float %46 to double
%48 = getelementptr inbounds [6 x i8], [6 x i8]* %8, i64 0, i64 0
%49 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.5, i64 0, i64 0), i32 %39, i32 %44, i32 %45, double %47, i8* %48)
%50 = getelementptr inbounds [6 x i8], [6 x i8]* %8, i64 0, i64 0
%51 = getelementptr inbounds [6 x i8], [6 x i8]* %8, i64 0, i64 0
%52 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @sums to i32 (i8*, i8*, ...)*)(i8* %50, i8* %51)
%53 = load float, float* %4
%54 = fpext float %53 to double
%55 = load i32, i32* %3
%56 = load i32, i32* %2
%57 = load float, float* %4
%58 = fpext float %57 to double
%59 = load float, float* %5
%60 = fpext float %59 to double
%61 = call i32 (double, double, ...) bitcast (i32 (...)* @sumf to i32 (double, double, ...)*)(double %58, double %60)
%62 = load i32, i32* %2
%63 = load i32, i32* %3
%64 = call i32 (i32, i32, ...) bitcast (i32 (...)* @sum to i32 (i32, i32, ...)*)(i32 %62, i32 %63)
%65 = load i8, i8* %6
%66 = sext i8 %65 to i32
%67 = getelementptr inbounds [6 x i8], [6 x i8]* %9, i64 0, i64 0
%68 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @sums to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0), i8* %67)
%69 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.6, i64 0, i64 0), i32 104, i32 %52, double %54, i32 %55, i32 %56, i32 %61, i32 %64, i32 %66, i32 %68)
%70 = getelementptr inbounds [6 x i8], [6 x i8]* %9, i64 0, i64 0
%71 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0), i8* %70)
ret i32 1
}

LLVM IR (-O2):
@__const.main.i = [6 x i8] c"world\00"
@.str.1 = [14 x i8] c"test %c, %f \0A\00"
@.str.2 = [15 x i8] c"test %c, %5f \0A\00"
@.str.3 = [19 x i8] c"test %c, %i, %7f \0A\00"
@.str.4 = [25 x i8] c"test %37d, %c, %i, %5f \0A\00"
@.str.5 = [30 x i8] c"test %37d, %c, %i, %5f, %7s \0A\00"
@.str.6 = [21 x i8] c"%c%s%f%i%d%f%i%c%s \0A\00"
@.str.7 = [6 x i8] c"hello\00"
@str = [5 x i8] c"aaa \00"
define i32 @main() {
%1 = alloca [6 x i8]
%2 = alloca [6 x i8]
%3 = getelementptr inbounds [6 x i8], [6 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [6 x i8], [6 x i8]* %2, i64 0, i64 0
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @str, i64 0, i64 0))
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 100, double 0x3FF19999A0000000)
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), i32 101, double 0x40019999A0000000)
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.3, i64 0, i64 0), i32 101, i32 2, double 0x40019999A0000000)
%9 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @sum to i32 (i32, i32, ...)*)(i32 1, i32 2)
%10 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @sumc to i32 (i32, i32, ...)*)(i32 100, i32 100)
%11 = tail call i32 (double, double, ...) bitcast (i32 (...)* @sumf to i32 (double, double, ...)*)(double 1.000000e+00, double 0x40019999A0000000)
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.4, i64 0, i64 0), i32 %9, i32 %10, i32 1, i32 %11)
%13 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @sumc to i32 (i32, i32, ...)*)(i32 100, i32 101)
%14 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.5, i64 0, i64 0), i32 1, i32 %13, i32 2, double 0x40019999A0000000, i8* %3)
%15 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @sums to i32 (i8*, i8*, ...)*)(i8* %3, i8* %3)
%16 = call i32 (double, double, ...) bitcast (i32 (...)* @sumf to i32 (double, double, ...)*)(double 0x3FF19999A0000000, double 0x40019999A0000000)
%17 = call i32 (i32, i32, ...) bitcast (i32 (...)* @sum to i32 (i32, i32, ...)*)(i32 1, i32 2)
%18 = call i32 (i8*, i8*, ...) bitcast (i32 (...)* @sums to i32 (i8*, i8*, ...)*)(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.7, i64 0, i64 0), i8* %4)
%19 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.6, i64 0, i64 0), i32 104, i32 %15, double 0x3FF19999A0000000, i32 2, i32 1, i32 %16, i32 %17, i32 100, i32 %18)
%20 = call i32 @puts(i8* %4)
ret i32 1
}