#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*/ printf(char *, double);
int main() {
  char c;
  int i;
  long x;
  float f;
  double d;
  printf("char variable c = %c\n", c);
  printf("int variable i = %i\n", i);
  printf("long variable x = %ld\n", x);
  printf("float variable f = %f\n", f);
  printf("double variable d = %f\n", d);
  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    0xed2(%rip),%rdi
call   1030 <printf@plt>
cvtsi2sdl -0xc(%rbp),%xmm0
lea    0xed7(%rip),%rdi
call   1030 <printf@plt>
cvtsi2sdq -0x18(%rbp),%xmm0
lea    0xeda(%rip),%rdi
call   1030 <printf@plt>
movss  -0x1c(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xedc(%rip),%rdi
call   1030 <printf@plt>
movsd  -0x28(%rbp),%xmm0
lea    0xee2(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xee8(%rip),%rdi
xorps  %xmm0,%xmm0
call   1030 <printf@plt>
lea    0xeef(%rip),%rdi
xorps  %xmm0,%xmm0
call   1030 <printf@plt>
lea    0xef5(%rip),%rdi
xorps  %xmm0,%xmm0
call   1030 <printf@plt>
lea    0xefd(%rip),%rdi
call   1030 <printf@plt>
lea    0xf08(%rip),%rdi
call   1030 <printf@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 = [23 x i8] c"long variable x = %ld\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 i32
%4 = alloca i64
%5 = alloca float
%6 = alloca double
store i32 0, i32* %1
%7 = load i8, i8* %2
%8 = sitofp i8 %7 to double
%9 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0), double %8)
%10 = load i32, i32* %3
%11 = sitofp i32 %10 to double
%12 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0), double %11)
%13 = load i64, i64* %4
%14 = sitofp i64 %13 to double
%15 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.2, i64 0, i64 0), double %14)
%16 = load float, float* %5
%17 = fpext float %16 to double
%18 = call i32 @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0), double %17)
%19 = load double, double* %6
%20 = call i32 @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.4, i64 0, i64 0), double %19)
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 = [23 x i8] c"long variable x = %ld\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 ([23 x i8], [23 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)
ret i32 0
}