#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *, double);
int main(void) {
  char c;
  short int i;
  short i2;
  long x;
  long int x2;
  float f;
  double d;
  printf("char variable c = %c\n", c);
  printf("int variable i = %i\n", i);
  printf("long variable x = %i\n", x);
  printf("float variable f = %f\n", f);
  printf("double variable d = %f\n", d);
  getchar();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
movsbl -0x5(%rbp),%eax
cvtsi2sd %eax,%xmm0
lea    0xec2(%rip),%rdi
call   1030 <printf@plt>
movswl -0x8(%rbp),%eax
cvtsi2sd %eax,%xmm0
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
cvtsi2sdq -0x18(%rbp),%xmm0
lea    0xec7(%rip),%rdi
call   1030 <printf@plt>
movss  -0x24(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xec8(%rip),%rdi
call   1030 <printf@plt>
movsd  -0x30(%rbp),%xmm0
lea    0xece(%rip),%rdi
call   1030 <printf@plt>
mov    $0x0,%al
call   1040 <getchar@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xed8(%rip),%rdi
xorps  %xmm0,%xmm0
call   1030 <printf@plt>
lea    0xedf(%rip),%rdi
xorps  %xmm0,%xmm0
call   1030 <printf@plt>
lea    0xee5(%rip),%rdi
xorps  %xmm0,%xmm0
call   1030 <printf@plt>
lea    0xeec(%rip),%rdi
call   1030 <printf@plt>
lea    0xef7(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [22 x i8] c"char variable c = %c\0A\00"
@.str.1 = [21 x i8] c"int variable i = %i\0A\00"
@.str.2 = [22 x i8] c"long variable x = %i\0A\00"
@.str.3 = [23 x i8] c"float variable f = %f\0A\00"
@.str.4 = [24 x i8] c"double variable d = %f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca i16
%4 = alloca i16
%5 = alloca i64
%6 = alloca i64
%7 = alloca float
%8 = alloca double
store i32 0, i32* %1
%9 = load i8, i8* %2
%10 = sitofp i8 %9 to double
%11 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), double %10)
%12 = load i16, i16* %3
%13 = sitofp i16 %12 to double
%14 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), double %13)
%15 = load i64, i64* %5
%16 = sitofp i64 %15 to double
%17 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0), double %16)
%18 = load float, float* %7
%19 = fpext float %18 to double
%20 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0), double %19)
%21 = load double, double* %8
%22 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.4, i64 0, i64 0), double %21)
%23 = call i32 (...) @getchar()
ret i32 0
}

LLVM IR (-O2):
@.str = [22 x i8] c"char variable c = %c\0A\00"
@.str.1 = [21 x i8] c"int variable i = %i\0A\00"
@.str.2 = [22 x i8] c"long variable x = %i\0A\00"
@.str.3 = [23 x i8] c"float variable f = %f\0A\00"
@.str.4 = [24 x i8] c"double variable d = %f\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), double 0.000000e+00)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), double 0.000000e+00)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0), double 0.000000e+00)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0), double undef)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.4, i64 0, i64 0), double undef)
%6 = tail call i32 (...) @getchar()
ret i32 0
}