#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 */
double fd(double);
double ff(double);
int fi(int);
double fl(int);
int /*<<< orphan*/ fv();
int /*<<< orphan*/ printf(char *, double);
int main(void) {
  printf("%d\n", fi(42));
  printf("%lld\n", fl(42));
  printf("%f\n", ff(42.5));
  printf("%f\n", fd(42.25));
  fv();
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x2a,%edi
call   1080 <fi@plt>
cvtsi2sd %eax,%xmm0
lea    0xe8c(%rip),%rdi
call   1070 <printf@plt>
mov    $0x2a,%edi
call   1030 <fl@plt>
lea    0xe7a(%rip),%rdi
call   1070 <printf@plt>
movsd  0xe61(%rip),%xmm0
call   1040 <ff@plt>
lea    0xe67(%rip),%rdi
call   1070 <printf@plt>
movsd  0xe40(%rip),%xmm0
call   1050 <fd@plt>
lea    0xe4e(%rip),%rdi
call   1070 <printf@plt>
mov    $0x0,%al
call   1060 <fv@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0x2a,%edi
call   1080 <fi@plt>
cvtsi2sd %eax,%xmm0
lea    0xe9a(%rip),%rdi
call   1070 <printf@plt>
mov    $0x2a,%edi
call   1030 <fl@plt>
lea    0xe88(%rip),%rdi
call   1070 <printf@plt>
movsd  0xe67(%rip),%xmm0
call   1040 <ff@plt>
lea    0xe75(%rip),%rbx
mov    %rbx,%rdi
call   1070 <printf@plt>
movsd  0xe53(%rip),%xmm0
call   1050 <fd@plt>
mov    %rbx,%rdi
call   1070 <printf@plt>
xor    %eax,%eax
call   1060 <fv@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [6 x i8] c"%lld\0A\00"
@.str.2 = [4 x i8] c"%f\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 @fi(i32 42)
%3 = sitofp i32 %2 to double
%4 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %3)
%5 = call double @fl(i32 42)
%6 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), double %5)
%7 = call double @ff(double 4.250000e+01)
%8 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), double %7)
%9 = call double @fd(double 4.225000e+01)
%10 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), double %9)
%11 = call i32 (...) @fv()
ret i32 0
}

LLVM IR (-O2):
@.str = [4 x i8] c"%d\0A\00"
@.str.1 = [6 x i8] c"%lld\0A\00"
@.str.2 = [4 x i8] c"%f\0A\00"
define i32 @main() {
%1 = tail call i32 @fi(i32 42)
%2 = sitofp i32 %1 to double
%3 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), double %2)
%4 = tail call double @fl(i32 42)
%5 = tail call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), double %4)
%6 = tail call double @ff(double 4.250000e+01)
%7 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), double %6)
%8 = tail call double @fd(double 4.225000e+01)
%9 = tail call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), double %8)
%10 = tail call i32 (...) @fv()
ret i32 0
}