int main(void) {
  int intVar = 321;
  float floatVar = 1.123;
  double doubleVar = 8.22e+11;
  char charVar = 'S';
  _Bool boolVar = 1;
  printf("intVar = %i\n", intVar);
  printf("floatVar = %f\n", floatVar);
  printf("doubleVar = %e\n", doubleVar);
  printf("doubleVar = %g\n", doubleVar);
  printf("charVar = %c\n", charVar);
  printf("boolVar = %i\n", boolVar);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x141,-0x8(%rbp)
movss  0xeda(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
movsd  0xec5(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movb   $0x53,-0x19(%rbp)
movb   $0x1,-0x1a(%rbp)
mov    -0x8(%rbp),%esi
lea    0xeba(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xeb0(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movsd  -0x18(%rbp),%xmm0
lea    0xeac(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movsd  -0x18(%rbp),%xmm0
lea    0xea9(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movsbl -0x19(%rbp),%esi
lea    0xea7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x1a(%rbp),%al
and    $0x1,%al
movzbl %al,%esi
lea    0xe9f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xef8(%rip),%rdi
mov    $0x141,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xef2(%rip),%rdi
movsd  0xecd(%rip),%xmm0
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xeeb(%rip),%rdi
movsd  0xebf(%rip),%xmm0
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xee5(%rip),%rdi
movsd  0xea9(%rip),%xmm0
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xedf(%rip),%rdi
mov    $0x53,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeda(%rip),%rdi
mov    $0x1,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [13 x i8] c"intVar = %i\0A\00"
@.str.1 = [15 x i8] c"floatVar = %f\0A\00"
@.str.2 = [16 x i8] c"doubleVar = %e\0A\00"
@.str.3 = [16 x i8] c"doubleVar = %g\0A\00"
@.str.4 = [14 x i8] c"charVar = %c\0A\00"
@.str.5 = [14 x i8] c"boolVar = %i\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca float
%4 = alloca double
%5 = alloca i8
%6 = alloca i8
store i32 0, i32* %1
store i32 321, i32* %2
store float 0x3FF1F7CEE0000000, float* %3
store double 8.220000e+11, double* %4
store i8 83, i8* %5
store i8 1, i8* %6
%7 = load i32, i32* %2
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 %7)
%9 = load float, float* %3
%10 = fpext float %9 to double
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), double %10)
%12 = load double, double* %4
%13 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), double %12)
%14 = load double, double* %4
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), double %14)
%16 = load i8, i8* %5
%17 = sext i8 %16 to i32
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0), i32 %17)
%19 = load i8, i8* %6
%20 = trunc i8 %19 to i1
%21 = zext i1 %20 to i32
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.5, i64 0, i64 0), i32 %21)
ret i32 0
}

LLVM IR (-O2):
@.str = [13 x i8] c"intVar = %i\0A\00"
@.str.1 = [15 x i8] c"floatVar = %f\0A\00"
@.str.2 = [16 x i8] c"doubleVar = %e\0A\00"
@.str.3 = [16 x i8] c"doubleVar = %g\0A\00"
@.str.4 = [14 x i8] c"charVar = %c\0A\00"
@.str.5 = [14 x i8] c"boolVar = %i\0A\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i32 321)
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.1, i64 0, i64 0), double 0x3FF1F7CEE0000000)
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0), double 8.220000e+11)
%4 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), double 8.220000e+11)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.4, i64 0, i64 0), i32 83)
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.5, i64 0, i64 0), i32 1)
ret i32 0
}