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, a);
  printf("test %c, %5f \n", h, h);
  printf("test %c, %i, %7f \n", e, e, h);
  printf("test %37d, %c, %i, %5f \n", sumc(d, e), sumc(d, 'd'), a,
         sumf(1.0, h));
  printf("test %37d, %c, %i, %5f, %7s \n", a, sum(1, b), b, h, f);
  printf("%c%s%f%i%d%f%i%c%s \n", 'h', sumf(c, h), b, b, h, sums(f, f),
         sum(a, b), f, sums("hello", i));
  printf("%s\n", i);
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x1,-0x8(%rbp)
movl   $0x2,-0xc(%rbp)
movss  0xe94(%rip),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  0xe83(%rip),%xmm0
movss  %xmm0,-0x14(%rbp)
movb   $0x64,-0x15(%rbp)
movb   $0x65,-0x16(%rbp)
lea    0xe77(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xe73(%rip),%eax
mov    %eax,-0x26(%rbp)
mov    0xe6d(%rip),%ax
mov    %ax,-0x22(%rbp)
lea    0xe64(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movsbl -0x15(%rbp),%esi
mov    -0x8(%rbp),%edx
lea    0xe55(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x14(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
lea    0xe43(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
movsbl -0x16(%rbp),%esi
movsbl -0x16(%rbp),%edx
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe33(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movsbl -0x15(%rbp),%edi
movsbl -0x16(%rbp),%esi
mov    $0x0,%al
call   1040 <sumc@plt>
mov    %eax,-0x5c(%rbp)
movsbl -0x15(%rbp),%edi
mov    $0x64,%esi
mov    $0x0,%al
call   1040 <sumc@plt>
mov    %eax,-0x58(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x54(%rbp)
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xdb1(%rip),%xmm0
mov    $0x2,%al
call   1070 <sumf@plt>
mov    -0x5c(%rbp),%esi
mov    -0x58(%rbp),%edx
mov    -0x54(%rbp),%ecx
mov    %eax,%r8d
lea    0xde9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0x50(%rbp)
mov    -0xc(%rbp),%esi
mov    $0x1,%edi
mov    $0x0,%al
call   1060 <sum@plt>
mov    -0x50(%rbp),%esi
mov    %eax,%edx
mov    -0xc(%rbp),%ecx
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    -0x20(%rbp),%r8
lea    0xdca(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movss  -0x14(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
mov    $0x2,%al
call   1070 <sumf@plt>
mov    %eax,-0x4c(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x48(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x44(%rbp)
movss  -0x14(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  %xmm0,-0x40(%rbp)
mov    -0x20(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    $0x0,%al
call   1050 <sums@plt>
mov    %eax,-0x38(%rbp)
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    $0x0,%al
call   1060 <sum@plt>
mov    %eax,-0x34(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x30(%rbp)
lea    -0x26(%rbp),%rsi
lea    0xcfd(%rip),%rdi
mov    $0x0,%al
call   1050 <sums@plt>
mov    -0x4c(%rbp),%edx
mov    -0x48(%rbp),%ecx
mov    -0x44(%rbp),%r8d
movsd  -0x40(%rbp),%xmm0
mov    -0x38(%rbp),%r9d
mov    -0x34(%rbp),%r11d
mov    -0x30(%rbp),%r10
lea    0xd4d(%rip),%rdi
mov    $0x68,%esi
mov    %r11d,(%rsp)
mov    %r10,0x8(%rsp)
mov    %eax,0x10(%rsp)
mov    $0x1,%al
call   1030 <printf@plt>
lea    -0x26(%rbp),%rsi
lea    0xd3e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    $0x1,%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
movw   $0x64,0x4(%rsp)
movl   $0x6c726f77,(%rsp)
lea    0xf20(%rip),%rdi
call   1030 <puts@plt>
lea    0xe98(%rip),%rdi
mov    $0x64,%esi
mov    $0x1,%edx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe8e(%rip),%rdi
movsd  0xe54(%rip),%xmm0
movaps %xmm0,%xmm1
mov    $0x2,%al
call   1040 <printf@plt>
lea    0xe84(%rip),%rdi
mov    $0x65,%esi
mov    $0x65,%edx
movsd  0xe31(%rip),%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
mov    $0x64,%edi
mov    $0x65,%esi
xor    %eax,%eax
call   1050 <sumc@plt>
mov    %eax,%ebx
mov    $0x64,%edi
mov    $0x64,%esi
xor    %eax,%eax
call   1050 <sumc@plt>
mov    %eax,%ebp
movsd  0xe04(%rip),%xmm0
movsd  0xdf4(%rip),%xmm1
mov    $0x2,%al
call   1080 <sumf@plt>
lea    0xe3a(%rip),%rdi
mov    %ebx,%esi
mov    %ebp,%edx
mov    $0x1,%ecx
mov    %eax,%r8d
xor    %eax,%eax
call   1040 <printf@plt>
mov    $0x1,%edi
mov    $0x2,%esi
xor    %eax,%eax
call   1070 <sum@plt>
lea    0xe28(%rip),%rdi
lea    0xdcc(%rip),%r15
mov    $0x1,%esi
mov    %eax,%edx
mov    $0x2,%ecx
movsd  0xda0(%rip),%xmm0
mov    %r15,%r8
mov    $0x1,%al
call   1040 <printf@plt>
movsd  0xd9e(%rip),%xmm0
movsd  0xd86(%rip),%xmm1
mov    $0x2,%al
call   1080 <sumf@plt>
mov    %eax,%r14d
mov    %r15,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   1060 <sums@plt>
mov    %eax,%ebp
mov    $0x1,%edi
mov    $0x2,%esi
xor    %eax,%eax
call   1070 <sum@plt>
mov    %eax,%r13d
mov    %rsp,%r12
mov    %r15,%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1060 <sums@plt>
mov    %eax,%ebx
sub    $0x8,%rsp
lea    0xdc7(%rip),%rdi
mov    $0x68,%esi
mov    %r14d,%edx
mov    $0x2,%ecx
mov    $0x2,%r8d
movsd  0xd21(%rip),%xmm0
mov    %ebp,%r9d
mov    $0x1,%al
push   %rbx
push   %r15
push   %r13
call   1040 <printf@plt>
add    $0x20,%rsp
mov    %r12,%rdi
call   1030 <puts@plt>
mov    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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