#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 dtoi(double);
int ftoi(float);
double itod(int);
double itof(int);
int /*<<< orphan*/ printf(char *, double, ...);
int /*<<< orphan*/ testParseConsts();
int /*<<< orphan*/ testVars(float, float, double, double);
int main() {
  testParseConsts();
  printf("int: %d float: %g double: %g\n", 1, 2.2f, 3.3);
  printf(" ftoi(1.4f)=%d\n", ftoi(1.4f));
  printf(" dtoi(2.4)=%d\n", dtoi(2.4));
  printf(" itof(3)=%g\n", itof(3));
  printf(" itod(4)=%g\n", itod(4));
  testVars(1.0f, 2.0f, 3.0, 4.0);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1030 <testParseConsts@plt>
lea    0xeb3(%rip),%rdi
movsd  0xe93(%rip),%xmm0
movsd  0xe93(%rip),%xmm1
movsd  0xe93(%rip),%xmm2
mov    $0x3,%al
call   1040 <printf@plt>
movss  0xe54(%rip),%xmm0
call   1070 <ftoi@plt>
cvtsi2sd %eax,%xmm0
lea    0xe9a(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movsd  0xe4d(%rip),%xmm0
call   1060 <dtoi@plt>
cvtsi2sd %eax,%xmm0
lea    0xe8b(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    $0x3,%edi
call   1080 <itof@plt>
lea    0xe82(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    $0x4,%edi
call   1090 <itod@plt>
lea    0xe77(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movss  0xdde(%rip),%xmm0
movss  0xdda(%rip),%xmm1
movsd  0xdde(%rip),%xmm2
movsd  0xdde(%rip),%xmm3
call   1050 <testVars@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
xor    %eax,%eax
call   1030 <testParseConsts@plt>
lea    0xebd(%rip),%rdi
movsd  0xe79(%rip),%xmm0
movsd  0xe79(%rip),%xmm1
movsd  0xe79(%rip),%xmm2
mov    $0x3,%al
call   1040 <printf@plt>
movss  0xe8a(%rip),%xmm0
call   1070 <ftoi@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
lea    0xea1(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movsd  0xe50(%rip),%xmm0
call   1060 <dtoi@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
lea    0xe8f(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    $0x3,%edi
call   1080 <itof@plt>
lea    0xe86(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
mov    $0x4,%edi
call   1090 <itod@plt>
lea    0xe7b(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movss  0xe1a(%rip),%xmm0
movss  0xe16(%rip),%xmm1
movsd  0xdf6(%rip),%xmm2
movsd  0xdf6(%rip),%xmm3
call   1050 <testVars@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [30 x i8] c"int: %d float: %g double: %g\0A\00"
@.str.1 = [16 x i8] c" ftoi(1.4f)=%d\0A\00"
@.str.2 = [15 x i8] c" dtoi(2.4)=%d\0A\00"
@.str.3 = [13 x i8] c" itof(3)=%g\0A\00"
@.str.4 = [13 x i8] c" itod(4)=%g\0A\00"
define i32 @main() {
%1 = alloca i32
store i32 0, i32* %1
%2 = call i32 (...) @testParseConsts()
%3 = call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), double 1.000000e+00, double 0x40019999A0000000, double 3.300000e+00)
%4 = call i32 @ftoi(float 0x3FF6666660000000)
%5 = sitofp i32 %4 to double
%6 = call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), double %5)
%7 = call i32 @dtoi(double 2.400000e+00)
%8 = sitofp i32 %7 to double
%9 = call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), double %8)
%10 = call double @itof(i32 3)
%11 = call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), double %10)
%12 = call double @itod(i32 4)
%13 = call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0), double %12)
%14 = call i32 @testVars(float 1.000000e+00, float 2.000000e+00, double 3.000000e+00, double 4.000000e+00)
ret i32 0
}

LLVM IR (-O2):
@.str = [30 x i8] c"int: %d float: %g double: %g\0A\00"
@.str.1 = [16 x i8] c" ftoi(1.4f)=%d\0A\00"
@.str.2 = [15 x i8] c" dtoi(2.4)=%d\0A\00"
@.str.3 = [13 x i8] c" itof(3)=%g\0A\00"
@.str.4 = [13 x i8] c" itod(4)=%g\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @testParseConsts()
%2 = tail call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str, i64 0, i64 0), double 1.000000e+00, double 0x40019999A0000000, double 3.300000e+00)
%3 = tail call i32 @ftoi(float 0x3FF6666660000000)
%4 = sitofp i32 %3 to double
%5 = tail call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0), double %4)
%6 = tail call i32 @dtoi(double 2.400000e+00)
%7 = sitofp i32 %6 to double
%8 = tail call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0), double %7)
%9 = tail call double @itof(i32 3)
%10 = tail call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), double %9)
%11 = tail call double @itod(i32 4)
%12 = tail call i32 (i8*, double, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0), double %11)
%13 = tail call i32 @testVars(float 1.000000e+00, float 2.000000e+00, double 3.000000e+00, double 4.000000e+00)
ret i32 0
}