#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(void) {
  float a, b;
  float x, f = 5.75;
  double y;
  printf("conv_f=%d,f=%f\n", (int)f, f);
  x = 33333.33333;
  b = 33333.33333333333333;
  printf("x=%f\ny=%f\n", x, y);
  a = 123456.789e5;
  b = a + 20;
  printf("a=%f\n", a);
  printf("b=%f\n", b);
  printf("c=%f\n", 1.0 / 3 * 3);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
movss  0xeed(%rip),%xmm0
movss  %xmm0,-0x14(%rbp)
cvttss2si -0x14(%rbp),%eax
cvtsi2sd %eax,%xmm0
movss  -0x14(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
lea    0xed3(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
movss  0xebc(%rip),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  0xeaf(%rip),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0x10(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  -0x20(%rbp),%xmm1
lea    0xead(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
movss  0xe82(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  0xe71(%rip),%xmm0
addss  -0x8(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe82(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe71(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xe69(%rip),%rdi
movsd  0xe22(%rip),%xmm0
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xf10(%rip),%rdi
movsd  0xee0(%rip),%xmm0
movsd  0xee0(%rip),%xmm1
mov    $0x2,%al
call   1030 <printf@plt>
lea    0xf02(%rip),%rdi
movsd  0xed2(%rip),%xmm0
mov    $0x2,%al
call   1030 <printf@plt>
lea    0xef7(%rip),%rdi
movsd  0xec4(%rip),%xmm0
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xee7(%rip),%rdi
movsd  0xeae(%rip),%xmm0
mov    $0x1,%al
call   1030 <printf@plt>
lea    0xed7(%rip),%rdi
movsd  0xea0(%rip),%xmm0
mov    $0x1,%al
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [16 x i8] c"conv_f=%d,f=%f\0A\00"
@.str.1 = [11 x i8] c"x=%f\0Ay=%f\0A\00"
@.str.2 = [6 x i8] c"a=%f\0A\00"
@.str.3 = [6 x i8] c"b=%f\0A\00"
@.str.4 = [6 x i8] c"c=%f\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
%4 = alloca float
%5 = alloca float
%6 = alloca double
store i32 0, i32* %1
store float 5.750000e+00, float* %5
%7 = load float, float* %5
%8 = fptosi float %7 to i32
%9 = sitofp i32 %8 to double
%10 = load float, float* %5
%11 = fpext float %10 to double
%12 = call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), double %9, double %11)
store float 0x40E046AAA0000000, float* %4
store float 0x40E046AAA0000000, float* %3
%13 = load float, float* %4
%14 = fpext float %13 to double
%15 = load double, double* %6
%16 = call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), double %14, double %15)
store float 0x4206FEE0E0000000, float* %2
%17 = load float, float* %2
%18 = fadd float %17, 2.000000e+01
store float %18, float* %3
%19 = load float, float* %2
%20 = fpext float %19 to double
%21 = call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), double %20)
%22 = load float, float* %3
%23 = fpext float %22 to double
%24 = call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), double %23)
%25 = call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), double 1.000000e+00)
ret i32 0
}

LLVM IR (-O2):
@.str = [16 x i8] c"conv_f=%d,f=%f\0A\00"
@.str.1 = [11 x i8] c"x=%f\0Ay=%f\0A\00"
@.str.2 = [6 x i8] c"a=%f\0A\00"
@.str.3 = [6 x i8] c"b=%f\0A\00"
@.str.4 = [6 x i8] c"c=%f\0A\00"
define i32 @main() {
%1 = tail call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), double 5.000000e+00, double 5.750000e+00)
%2 = tail call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0), double 0x40E046AAA0000000, double undef)
%3 = tail call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), double 0x4206FEE0E0000000)
%4 = tail call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), double 0x4206FEE0E0000000)
%5 = tail call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), double 1.000000e+00)
ret i32 0
}