#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 *, float);
int main(void) {
  int i = 12.34;
  double d = 1.2345678988888;
  float f = 1.2345678988888;
  printf("i=%d\n", i);
  printf("i=%f\n", i);
  printf("d=%d\n", d);
  printf("d=%d\n", (int)d);
  printf("d=%.15f\n", d);
  printf("f=%f\n", f);
  printf("f=%.15f\n", f);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0xc,-0x8(%rbp)
movsd  0xeda(%rip),%xmm0
movsd  %xmm0,-0x10(%rbp)
movss  0xec5(%rip),%xmm0
movss  %xmm0,-0x14(%rbp)
cvtsi2ssl -0x8(%rbp),%xmm0
lea    0xec4(%rip),%rdi
call   1030 <printf@plt>
cvtsi2ssl -0x8(%rbp),%xmm0
lea    0xeb9(%rip),%rdi
call   1030 <printf@plt>
movsd  -0x10(%rbp),%xmm0
cvtsd2ss %xmm0,%xmm0
lea    0xeaa(%rip),%rdi
call   1030 <printf@plt>
cvttsd2si -0x10(%rbp),%eax
cvtsi2ss %eax,%xmm0
lea    0xe95(%rip),%rdi
call   1030 <printf@plt>
movsd  -0x10(%rbp),%xmm0
cvtsd2ss %xmm0,%xmm0
lea    0xe86(%rip),%rdi
call   1030 <printf@plt>
movss  -0x14(%rbp),%xmm0
lea    0xe7e(%rip),%rdi
call   1030 <printf@plt>
movss  -0x14(%rbp),%xmm0
lea    0xe73(%rip),%rdi
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
lea    0xef4(%rip),%rdi
movss  0xee0(%rip),%xmm0
call   1030 <printf@plt>
lea    0xee6(%rip),%rdi
movss  0xecc(%rip),%xmm0
call   1030 <printf@plt>
lea    0xed8(%rip),%rbx
movss  0xebc(%rip),%xmm0
mov    %rbx,%rdi
call   1030 <printf@plt>
movss  0xeb0(%rip),%xmm0
mov    %rbx,%rdi
call   1030 <printf@plt>
lea    0xeb7(%rip),%rdi
movss  0xe95(%rip),%xmm0
call   1030 <printf@plt>
lea    0xeac(%rip),%rdi
movss  0xe81(%rip),%xmm0
call   1030 <printf@plt>
lea    0xe9e(%rip),%rdi
movss  0xe6d(%rip),%xmm0
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@.str = [6 x i8] c"i=%d\0A\00"
@.str.1 = [6 x i8] c"i=%f\0A\00"
@.str.2 = [6 x i8] c"d=%d\0A\00"
@.str.3 = [9 x i8] c"d=%.15f\0A\00"
@.str.4 = [6 x i8] c"f=%f\0A\00"
@.str.5 = [9 x i8] c"f=%.15f\0A\00"
define i32 @main() {
%1 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), float 1.200000e+01)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), float 1.200000e+01)
%3 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), float 0x3FF3C0CA40000000)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), float 1.000000e+00)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), float 0x3FF3C0CA40000000)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), float 0x3FF3C0CA40000000)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0), float 0x3FF3C0CA40000000)
ret i32 0
}