#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*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ stdout;
int /*<<< orphan*/ test_1();
int /*<<< orphan*/ test_2();
int /*<<< orphan*/ test_3();
int /*<<< orphan*/ test_4();
main() {
  float dist = 0.3010;
  printf("dist is %G\n", dist);
  if (dist < 1.0) {
    printf("PASS: %s\n", "float compare");
    ;
  } else {
    printf("FAIL: %s\n", "float compare");
    ;
  }
  test_1();
  test_2();
  test_3();
  test_4();
  fflush(stdout);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movss  0xe91(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe80(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xe5c(%rip),%xmm0
ucomisd %xmm1,%xmm0
jbe    11c8 <main+0x68>
lea    0xe63(%rip),%rdi
lea    0xe66(%rip),%rsi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    11dd <main+0x7d>
lea    0xe61(%rip),%rdi
lea    0xe4c(%rip),%rsi
mov    $0x0,%al
call   1040 <printf@plt>
mov    $0x0,%al
call   1030 <test_1@plt>
mov    $0x0,%al
call   1050 <test_2@plt>
mov    $0x0,%al
call   1080 <test_3@plt>
mov    $0x0,%al
call   1060 <test_4@plt>
mov    0x2de0(%rip),%rax
mov    (%rax),%edi
call   1070 <fflush@plt>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rax
lea    0xea0(%rip),%rdi
movsd  0xe90(%rip),%xmm0
mov    $0x1,%al
call   1040 <printf@plt>
lea    0xe96(%rip),%rdi
lea    0xe99(%rip),%rsi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
call   1030 <test_1@plt>
xor    %eax,%eax
call   1050 <test_2@plt>
xor    %eax,%eax
call   1080 <test_3@plt>
xor    %eax,%eax
call   1060 <test_4@plt>
mov    0x2e31(%rip),%rax
mov    (%rax),%edi
call   1070 <fflush@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@.str = [12 x i8] c"dist is %G\0A\00"
@.str.1 = [10 x i8] c"PASS: %s\0A\00"
@.str.2 = [14 x i8] c"float compare\00"
@.str.3 = [10 x i8] c"FAIL: %s\0A\00"
@stdout = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca float
store i32 0, i32* %1
store float 0x3FD3439580000000, float* %2
%3 = load float, float* %2
%4 = fpext float %3 to double
%5 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), double %4)
%6 = load float, float* %2
%7 = fpext float %6 to double
%8 = fcmp olt double %7, 1.000000e+00
br i1 %8, label %9, label %11
9: ; preds = %0
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
br label %13
11: ; preds = %0
%12 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
br label %13
13: ; preds = %11, %9
%14 = call i32 (...) @test_1()
%15 = call i32 (...) @test_2()
%16 = call i32 (...) @test_3()
%17 = call i32 (...) @test_4()
%18 = load i32, i32* @stdout
%19 = call i32 @fflush(i32 %18)
%20 = load i32, i32* %1
ret i32 %20
}

LLVM IR (-O2):
@.str = [12 x i8] c"dist is %G\0A\00"
@.str.1 = [10 x i8] c"PASS: %s\0A\00"
@.str.2 = [14 x i8] c"float compare\00"
@stdout = global i32 0
define i32 @main() {
%1 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), double 0x3FD3439580000000)
%2 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
%3 = tail call i32 (...) @test_1()
%4 = tail call i32 (...) @test_2()
%5 = tail call i32 (...) @test_3()
%6 = tail call i32 (...) @test_4()
%7 = load i32, i32* @stdout
%8 = tail call i32 @fflush(i32 %7)
ret i32 0
}