int main(void) {
  printf("datatypes compiled!");
  int integerVar = 100;
  float floatVar = 331.79;
  double doubleVar = 8.44e+11;
  char charVar = 'W';
  _Bool boolVar = 0;
  printf("integerVar = %i\n", integerVar);
  printf("floatVar = %f\n", floatVar);
  printf("doubleVar = %e\n", doubleVar);
  printf("doubleVar = %g\n", doubleVar);
  printf("boolVar = %i\n", boolVar);
  printf("charVar = %c\n", charVar);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xee6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x64,-0x8(%rbp)
movss  0xecc(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
movsd  0xeb7(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
movb   $0x57,-0x19(%rbp)
movb   $0x0,-0x1a(%rbp)
mov    -0x8(%rbp),%esi
lea    0xec0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xeba(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movsd  -0x18(%rbp),%xmm0
lea    0xeb6(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movsd  -0x18(%rbp),%xmm0
lea    0xeb3(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
mov    -0x1a(%rbp),%al
and    $0x1,%al
movzbl %al,%esi
lea    0xead(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movsbl -0x19(%rbp),%esi
lea    0xea9(%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
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xefe(%rip),%rdi
mov    $0x64,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xefc(%rip),%rdi
movsd  0xebf(%rip),%xmm0
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xef5(%rip),%rdi
movsd  0xeb1(%rip),%xmm0
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xeef(%rip),%rdi
movsd  0xe9b(%rip),%xmm0
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xee9(%rip),%rdi
xor    %esi,%esi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xee7(%rip),%rdi
mov    $0x57,%esi
xor    %eax,%eax
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [20 x i8] c"datatypes compiled!\00"
@.str.1 = [17 x i8] c"integerVar = %i\0A\00"
@.str.2 = [15 x i8] c"floatVar = %f\0A\00"
@.str.3 = [16 x i8] c"doubleVar = %e\0A\00"
@.str.4 = [16 x i8] c"doubleVar = %g\0A\00"
@.str.5 = [14 x i8] c"boolVar = %i\0A\00"
@.str.6 = [14 x i8] c"charVar = %c\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
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
store i32 100, i32* %2
store float 0x4074BCA3E0000000, float* %3
store double 8.440000e+11, double* %4
store i8 87, i8* %5
store i8 0, i8* %6
%8 = load i32, i32* %2
%9 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 %8)
%10 = load float, float* %3
%11 = fpext float %10 to double
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), double %11)
%13 = load double, double* %4
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.3, i64 0, i64 0), double %13)
%15 = load double, double* %4
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0), double %15)
%17 = load i8, i8* %6
%18 = trunc i8 %17 to i1
%19 = zext i1 %18 to i32
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.5, i64 0, i64 0), i32 %19)
%21 = load i8, i8* %5
%22 = sext i8 %21 to i32
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.6, i64 0, i64 0), i32 %22)
ret i32 0
}

LLVM IR (-O2):
@.str = [20 x i8] c"datatypes compiled!\00"
@.str.1 = [17 x i8] c"integerVar = %i\0A\00"
@.str.2 = [15 x i8] c"floatVar = %f\0A\00"
@.str.3 = [16 x i8] c"doubleVar = %e\0A\00"
@.str.4 = [16 x i8] c"doubleVar = %g\0A\00"
@.str.5 = [14 x i8] c"boolVar = %i\0A\00"
@.str.6 = [14 x i8] c"charVar = %c\0A\00"
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 100)
%3 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), double 0x4074BCA3E0000000)
%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.440000e+11)
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0), double 8.440000e+11)
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.5, i64 0, i64 0), i32 0)
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.6, i64 0, i64 0), i32 87)
ret i32 0
}