#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 convert(long long);
int /*<<< orphan*/ exit(int);
double floorf(double);
int /*<<< orphan*/ printf(char *, double, double);
int main(int argc, char *argv[]) {
  long long l = 10;
  double f;
  double check = 10.0;
  f = convert(l);
  printf("convert: %lld => %f\n", l, f);
  if (f != check)
    exit(1);
  f = 1234.67;
  check = 1234.0;
  printf("floorf(%f) = %f\n", f, floorf(f));
  if (floorf(f) != check)
    exit(1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0xa,-0x18(%rbp)
movsd  0xe9a(%rip),%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <convert@plt>
movsd  %xmm0,-0x20(%rbp)
cvtsi2sdq -0x18(%rbp),%xmm0
movsd  -0x20(%rbp),%xmm1
lea    0xe8d(%rip),%rdi
call   1040 <printf@plt>
movsd  -0x20(%rbp),%xmm0
ucomisd -0x28(%rbp),%xmm0
jne    11ab <main+0x6b>
jp     11ab <main+0x6b>
jmp    11b5 <main+0x75>
mov    $0x1,%edi
call   1060 <exit@plt>
movsd  0xe53(%rip),%xmm0
movsd  %xmm0,-0x20(%rbp)
movsd  0xe3e(%rip),%xmm0
movsd  %xmm0,-0x28(%rbp)
movsd  -0x20(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x20(%rbp),%xmm0
call   1050 <floorf@plt>
movaps %xmm0,%xmm1
movsd  -0x30(%rbp),%xmm0
lea    0xe3b(%rip),%rdi
call   1040 <printf@plt>
movsd  -0x20(%rbp),%xmm0
call   1050 <floorf@plt>
ucomisd -0x28(%rbp),%xmm0
jne    1217 <main+0xd7>
jp     1217 <main+0xd7>
jmp    1221 <main+0xe1>
mov    $0x1,%edi
call   1060 <exit@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
mov    $0xa,%edi
call   1030 <convert@plt>
movaps %xmm0,%xmm1
movsd  %xmm0,(%rsp)
lea    0xebe(%rip),%rdi
movsd  0xe9e(%rip),%xmm0
call   1040 <printf@plt>
movsd  (%rsp),%xmm0
ucomisd 0xe8c(%rip),%xmm0
jne    11b2 <main+0x72>
jp     11b2 <main+0x72>
movsd  0xe88(%rip),%xmm0
call   1050 <floorf@plt>
lea    0xea1(%rip),%rdi
movsd  0xe7c(%rip),%xmm1
movsd  0xe6c(%rip),%xmm0
call   1040 <printf@plt>
movsd  0xe5f(%rip),%xmm0
call   1050 <floorf@plt>
xor    %eax,%eax
pop    %rcx
ret
mov    $0x1,%edi
call   1060 <exit@plt>

LLVM IR (-O0):
@.str = [21 x i8] c"convert: %lld => %f\0A\00"
@.str.1 = [17 x i8] c"floorf(%f) = %f\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i64
%7 = alloca double
%8 = alloca double
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i64 10, i64* %6
store double 1.000000e+01, double* %8
%9 = load i64, i64* %6
%10 = call double @convert(i64 %9)
store double %10, double* %7
%11 = load i64, i64* %6
%12 = sitofp i64 %11 to double
%13 = load double, double* %7
%14 = call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), double %12, double %13)
%15 = load double, double* %7
%16 = load double, double* %8
%17 = fcmp une double %15, %16
br i1 %17, label %18, label %20
18: ; preds = %2
%19 = call i32 @exit(i32 1)
unreachable
20: ; preds = %2
store double 1.234670e+03, double* %7
store double 1.234000e+03, double* %8
%21 = load double, double* %7
%22 = load double, double* %7
%23 = call double @floorf(double %22)
%24 = call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), double %21, double %23)
%25 = load double, double* %7
%26 = call double @floorf(double %25)
%27 = load double, double* %8
%28 = fcmp une double %26, %27
br i1 %28, label %29, label %31
29: ; preds = %20
%30 = call i32 @exit(i32 1)
unreachable
31: ; preds = %20
ret i32 0
}

LLVM IR (-O2):
@.str = [21 x i8] c"convert: %lld => %f\0A\00"
@.str.1 = [17 x i8] c"floorf(%f) = %f\0A\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = tail call double @convert(i64 10)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str, i64 0, i64 0), double 1.000000e+01, double %3)
%5 = fcmp une double %3, 1.000000e+01
br i1 %5, label %6, label %8
6: ; preds = %2
%7 = tail call i32 @exit(i32 1)
unreachable
8: ; preds = %2
%9 = tail call double @floorf(double 1.234670e+03)
%10 = tail call i32 @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), double 1.234670e+03, double 1.234000e+03)
%11 = tail call double @floorf(double 1.234670e+03)
ret i32 0
}