int main(int argc, char *argv[]) {
  int i = 20;
  long l = 100000;
  float f = 12.456;
  double d = 123.044444;
  printf("\n%d", i);
  printf("\n%ld", l);
  printf("\n%f", f);
  printf("\n%lf\n\n", d);
  half(&i, 'i');
  half(&l, 'l');
  half(&d, 'd');
  half(&f, 'f');
  printf("\n%d", i);
  printf("\n%ld", l);
  printf("\n%f", f);
  printf("\n%lf\n", d);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x14,-0x14(%rbp)
movq   $0x186a0,-0x20(%rbp)
movss  0xebb(%rip),%xmm0
movss  %xmm0,-0x24(%rbp)
movsd  0xea6(%rip),%xmm0
movsd  %xmm0,-0x30(%rbp)
mov    -0x14(%rbp),%esi
lea    0xea3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x20(%rbp),%rsi
lea    0xe95(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movss  -0x24(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe83(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movsd  -0x30(%rbp),%xmm0
lea    0xe74(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
lea    -0x14(%rbp),%rdi
mov    $0x69,%esi
mov    $0x0,%al
call   1040 <half@plt>
lea    -0x20(%rbp),%rdi
mov    $0x6c,%esi
mov    $0x0,%al
call   1040 <half@plt>
lea    -0x30(%rbp),%rdi
mov    $0x64,%esi
mov    $0x0,%al
call   1040 <half@plt>
lea    -0x24(%rbp),%rdi
mov    $0x66,%esi
mov    $0x0,%al
call   1040 <half@plt>
mov    -0x14(%rbp),%esi
lea    0xe16(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x20(%rbp),%rsi
lea    0xe08(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movss  -0x24(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xdf6(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movsd  -0x30(%rbp),%xmm0
lea    0xdee(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x20,%rsp
movl   $0x14,0xc(%rsp)
movq   $0x186a0,0x18(%rsp)
movl   $0x41474bc7,0x8(%rsp)
41
movabs $0x405ec2d82ba5a038,%rax
c2 5e 40
mov    %rax,0x10(%rsp)
lea    0xeb8(%rip),%r14
mov    %r14,%rdi
mov    $0x14,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xea6(%rip),%rbx
mov    $0x186a0,%esi
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xe95(%rip),%r15
movsd  0xe74(%rip),%xmm0
mov    %r15,%rdi
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xe80(%rip),%rdi
movsd  0xe63(%rip),%xmm0
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xc(%rsp),%rdi
mov    $0x69,%esi
xor    %eax,%eax
call   1040 <half@plt>
lea    0x18(%rsp),%rdi
mov    $0x6c,%esi
xor    %eax,%eax
call   1040 <half@plt>
lea    0x10(%rsp),%rdi
mov    $0x64,%esi
xor    %eax,%eax
call   1040 <half@plt>
lea    0x8(%rsp),%rdi
mov    $0x66,%esi
xor    %eax,%eax
call   1040 <half@plt>
mov    0xc(%rsp),%esi
mov    %r14,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x18(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
movss  0x8(%rsp),%xmm0
cvtss2sd %xmm0,%xmm0
mov    %r15,%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movsd  0x10(%rsp),%xmm0
lea    0xdf6(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [4 x i8] c"\0A%d\00"
@.str.1 = [5 x i8] c"\0A%ld\00"
@.str.2 = [4 x i8] c"\0A%f\00"
@.str.3 = [7 x i8] c"\0A%lf\0A\0A\00"
@.str.4 = [6 x i8] c"\0A%lf\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i64
%8 = alloca float
%9 = alloca double
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 20, i32* %6
store i64 100000, i64* %7
store float 0x4028E978E0000000, float* %8
store double 0x405EC2D82BA5A038, double* %9
%10 = load i32, i32* %6
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %10)
%12 = load i64, i64* %7
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i64 %12)
%14 = load float, float* %8
%15 = fpext float %14 to double
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), double %15)
%17 = load double, double* %9
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), double %17)
%19 = call i32 (i32*, i32, ...) bitcast (i32 (...)* @half to i32 (i32*, i32, ...)*)(i32* %6, i32 105)
%20 = call i32 (i64*, i32, ...) bitcast (i32 (...)* @half to i32 (i64*, i32, ...)*)(i64* %7, i32 108)
%21 = call i32 (double*, i32, ...) bitcast (i32 (...)* @half to i32 (double*, i32, ...)*)(double* %9, i32 100)
%22 = call i32 (float*, i32, ...) bitcast (i32 (...)* @half to i32 (float*, i32, ...)*)(float* %8, i32 102)
%23 = load i32, i32* %6
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %23)
%25 = load i64, i64* %7
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i64 %25)
%27 = load float, float* %8
%28 = fpext float %27 to double
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), double %28)
%30 = load double, double* %9
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), double %30)
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"\0A%d\00"
@.str.1 = [5 x i8] c"\0A%ld\00"
@.str.2 = [4 x i8] c"\0A%f\00"
@.str.3 = [7 x i8] c"\0A%lf\0A\0A\00"
@.str.4 = [6 x i8] c"\0A%lf\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i32
%4 = alloca i64
%5 = alloca float
%6 = alloca double
%7 = bitcast i32* %3 to i8*
store i32 20, i32* %3
%8 = bitcast i64* %4 to i8*
store i64 100000, i64* %4
%9 = bitcast float* %5 to i8*
store float 0x4028E978E0000000, float* %5
%10 = bitcast double* %6 to i8*
store double 0x405EC2D82BA5A038, double* %6
%11 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 20)
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i64 100000)
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), double 0x4028E978E0000000)
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0), double 0x405EC2D82BA5A038)
%15 = call i32 (i32*, i32, ...) bitcast (i32 (...)* @half to i32 (i32*, i32, ...)*)(i32* %3, i32 105)
%16 = call i32 (i64*, i32, ...) bitcast (i32 (...)* @half to i32 (i64*, i32, ...)*)(i64* %4, i32 108)
%17 = call i32 (double*, i32, ...) bitcast (i32 (...)* @half to i32 (double*, i32, ...)*)(double* %6, i32 100)
%18 = call i32 (float*, i32, ...) bitcast (i32 (...)* @half to i32 (float*, i32, ...)*)(float* %5, i32 102)
%19 = load i32, i32* %3
%20 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i32 %19)
%21 = load i64, i64* %4
%22 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i64 %21)
%23 = load float, float* %5
%24 = fpext float %23 to double
%25 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), double %24)
%26 = load double, double* %6
%27 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), double %26)
ret i32 0
}