int main(void) {
  printf("%llu\n", unsigned_add(10, 10));
  printf("%lld\n", signed_add(10, 10));
  printf("%g\n", float_add(10, 10));
  printf("%g\n", double_add(10, 10));
  char test_str[100] = "     20";
  printf("%s\n", ptr_int_add(test_str, 5));
  printf("%s\n", int_ptr_add(5, test_str));
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    $0xa,%esi
mov    %esi,%edi
mov    $0x0,%al
call   1090 <unsigned_add@plt>
mov    %eax,%esi
lea    0xe61(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    $0xa,%esi
mov    %esi,%edi
mov    $0x0,%al
call   1080 <signed_add@plt>
mov    %eax,%esi
lea    0xe49(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    $0xa,%esi
mov    %esi,%edi
mov    $0x0,%al
call   1040 <float_add@plt>
mov    %eax,%esi
lea    0xe31(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    $0xa,%esi
mov    %esi,%edi
mov    $0x0,%al
call   1050 <double_add@plt>
mov    %eax,%esi
lea    0xe13(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    -0x70(%rbp),%rdi
lea    0xe15(%rip),%rsi
mov    $0x64,%edx
call   1070 <memcpy@plt>
lea    -0x70(%rbp),%rdi
mov    $0x5,%esi
mov    $0x0,%al
call   10a0 <ptr_int_add@plt>
mov    %eax,%esi
lea    0xde2(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    -0x70(%rbp),%rsi
mov    $0x5,%edi
mov    $0x0,%al
call   1030 <int_ptr_add@plt>
mov    %eax,%esi
lea    0xdc2(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
sub    $0x68,%rsp
mov    $0xa,%edi
mov    $0xa,%esi
xor    %eax,%eax
call   1080 <unsigned_add@plt>
lea    0xe71(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1060 <printf@plt>
mov    $0xa,%edi
mov    $0xa,%esi
xor    %eax,%eax
call   1070 <signed_add@plt>
lea    0xe56(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1060 <printf@plt>
mov    $0xa,%edi
mov    $0xa,%esi
xor    %eax,%eax
call   1040 <float_add@plt>
lea    0xe3b(%rip),%rbx
mov    %rbx,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1060 <printf@plt>
mov    $0xa,%edi
mov    $0xa,%esi
xor    %eax,%eax
call   1050 <double_add@plt>
mov    %rbx,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1060 <printf@plt>
movaps 0xe6f(%rip),%xmm0
movaps %xmm0,0x50(%rsp)
movaps 0xe53(%rip),%xmm0
movaps %xmm0,0x40(%rsp)
movaps 0xe37(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
movaps 0xe1b(%rip),%xmm0
movaps %xmm0,0x20(%rsp)
movaps 0xdff(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
movaps 0xde3(%rip),%xmm0
movaps %xmm0,(%rsp)
movl   $0x0,0x60(%rsp)
mov    %rsp,%r14
mov    %r14,%rdi
mov    $0x5,%esi
xor    %eax,%eax
call   1090 <ptr_int_add@plt>
lea    0xdae(%rip),%rbx
mov    %rbx,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1060 <printf@plt>
mov    $0x5,%edi
mov    %r14,%rsi
xor    %eax,%eax
call   1030 <int_ptr_add@plt>
mov    %rbx,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1060 <printf@plt>
xor    %eax,%eax
add    $0x68,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [6 x i8] c"%llu\0A\00"
@.str.1 = [6 x i8] c"%lld\0A\00"
@.str.2 = [4 x i8] c"%g\0A\00"
@__const.main.test_str = [100 x i8] c" 20\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@.str.3 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = call i32 (i32, i32, ...) bitcast (i32 (...)* @unsigned_add to i32 (i32, i32, ...)*)(i32 10, i32 10)
%3 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = call i32 (i32, i32, ...) bitcast (i32 (...)* @signed_add to i32 (i32, i32, ...)*)(i32 10, i32 10)
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 %4)
%6 = call i32 (i32, i32, ...) bitcast (i32 (...)* @float_add to i32 (i32, i32, ...)*)(i32 10, i32 10)
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %6)
%8 = call i32 (i32, i32, ...) bitcast (i32 (...)* @double_add to i32 (i32, i32, ...)*)(i32 10, i32 10)
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %8)
%10 = bitcast [100 x i8]* %1 to i8*
%11 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%12 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @ptr_int_add to i32 (i8*, i32, ...)*)(i8* %11, i32 5)
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %12)
%14 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%15 = call i32 (i32, i8*, ...) bitcast (i32 (...)* @int_ptr_add to i32 (i32, i8*, ...)*)(i32 5, i8* %14)
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %15)
ret i32 0
}

LLVM IR (-O2):
@.str = [6 x i8] c"%llu\0A\00"
@.str.1 = [6 x i8] c"%lld\0A\00"
@.str.2 = [4 x i8] c"%g\0A\00"
@__const.main.test_str = [100 x i8] c" 20\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@.str.3 = [4 x i8] c"%s\0A\00"
define i32 @main() {
%1 = alloca [100 x i8]
%2 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @unsigned_add to i32 (i32, i32, ...)*)(i32 10, i32 10)
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %2)
%4 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @signed_add to i32 (i32, i32, ...)*)(i32 10, i32 10)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32 %4)
%6 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @float_add to i32 (i32, i32, ...)*)(i32 10, i32 10)
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %6)
%8 = tail call i32 (i32, i32, ...) bitcast (i32 (...)* @double_add to i32 (i32, i32, ...)*)(i32 10, i32 10)
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i32 %8)
%10 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%11 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @ptr_int_add to i32 (i8*, i32, ...)*)(i8* %10, i32 5)
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %11)
%13 = call i32 (i32, i8*, ...) bitcast (i32 (...)* @int_ptr_add to i32 (i32, i8*, ...)*)(i32 5, i8* %10)
%14 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i32 %13)
ret i32 0
}