#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 */
typedef int /*<<< orphan*/ _linestr;

/* Variables and functions */
int BUFSIZ;
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ snprintf(char *, int, char *, char const *, long);
int /*<<< orphan*/ stdout;
void _test_double_less_than_or_equal(const char *file, long line,
                                     const char *desc, double val,
                                     double max_expected) {
  do {
    const char *_exprstr = (val <= max_expected) ? "PASS" : "FAIL";
    char _linestr[BUFSIZ];
    if (!(val <= max_expected)) {
      snprintf(_linestr, sizeof(_linestr), " (%s:%ld)", file, line);
    } else {
      _linestr[0] = 0;
    }
    if ("<%f" == 0) {
      printf("\tValue: "
             "%f"
             "\n"
             "[%s] %s%s\n",
             val, _exprstr, desc, _linestr);
    } else {
      printf("\tActual: "
             "%f"
             "\n"
             "\tExpected: "
             "<%f"
             "\n"
             "[%s] %s%s\n",
             val, max_expected, _exprstr, desc, _linestr);
    }
    if (!(val <= max_expected)) {
      printf("\t%s:%ld\n", file, line);
    }
    fflush(stdout);
  } while (0);
  ;
}


x86 assembly (clang, -O0):
<_test_double_less_than_or_equal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movsd  %xmm0,-0x20(%rbp)
movsd  %xmm1,-0x28(%rbp)
movsd  -0x20(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm0
ucomisd %xmm1,%xmm0
lea    0xe9d(%rip),%rcx
lea    0xe9b(%rip),%rax
cmovae %rcx,%rax
mov    %rax,-0x30(%rbp)
mov    0x2e67(%rip),%rax
mov    (%rax),%eax
mov    %rax,-0x50(%rbp)
mov    %rsp,%rcx
mov    %rcx,-0x38(%rbp)
mov    %rax,%rdx
add    $0xf,%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x48(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x40(%rbp)
movsd  -0x20(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jae    11d9 <_test_double_less_than_or_equal+0xa9>
mov    -0x48(%rbp),%rdi
mov    -0x50(%rbp),%rax
mov    %eax,%esi
mov    -0x8(%rbp),%rcx
mov    -0x10(%rbp),%r8
lea    0xe3b(%rip),%rdx
call   1040 <snprintf@plt>
jmp    11e0 <_test_double_less_than_or_equal+0xb0>
mov    -0x48(%rbp),%rax
movb   $0x0,(%rax)
mov    -0x48(%rbp),%rcx
movsd  -0x20(%rbp),%xmm0
movsd  -0x28(%rbp),%xmm1
mov    -0x30(%rbp),%rsi
mov    -0x18(%rbp),%rdx
lea    0xe17(%rip),%rdi
mov    $0x2,%al
call   1030 <printf@plt>
movsd  -0x20(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jae    122e <_test_double_less_than_or_equal+0xfe>
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%rdx
lea    0xe13(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    0x2da3(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
mov    -0x38(%rbp),%rax
mov    %rax,%rsp
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_test_double_less_than_or_equal>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rdx,%r15
mov    %rsi,%r14
mov    0x2e92(%rip),%rax
mov    (%rax),%esi
mov    %rsp,%rbx
lea    0xf(%rsi),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rbx
mov    %rbx,%rsp
ucomisd %xmm0,%xmm1
lea    0xe94(%rip),%rax
lea    0xe92(%rip),%r13
cmovae %rax,%r13
jb     1195 <_test_double_less_than_or_equal+0x65>
movb   $0x0,(%rbx)
lea    0xe91(%rip),%rdi
mov    %r13,%rsi
mov    %r15,%rdx
mov    %rbx,%rcx
mov    $0x2,%al
call   1030 <printf@plt>
jmp    11ec <_test_double_less_than_or_equal+0xbc>
mov    %rdi,%r12
lea    0xe6b(%rip),%rdx
mov    %rbx,%rdi
mov    %r12,%rcx
mov    %r14,%r8
movsd  %xmm1,-0x38(%rbp)
movsd  %xmm0,-0x30(%rbp)
call   1040 <snprintf@plt>
lea    0xe56(%rip),%rdi
movsd  -0x30(%rbp),%xmm0
movsd  -0x38(%rbp),%xmm1
mov    %r13,%rsi
mov    %r15,%rdx
mov    %rbx,%rcx
mov    $0x2,%al
call   1030 <printf@plt>
lea    0xe5b(%rip),%rdi
mov    %r12,%rsi
mov    %r14,%rdx
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x2de5(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [5 x i8] c"PASS\00"
@.str.1 = [5 x i8] c"FAIL\00"
@BUFSIZ = global i32 0
@.str.2 = [10 x i8] c" (%s:%ld)\00"
@.str.3 = [38 x i8] c"\09Actual: %f\0A\09Expected: <%f\0A[%s] %s%s\0A\00"
@.str.4 = [9 x i8] c"\09%s:%ld\0A\00"
@stdout = global i32 0
define void @_test_double_less_than_or_equal(i8* %0, i64 %1, i8* %2, double %3, double %4) {
%6 = alloca i8*
%7 = alloca i64
%8 = alloca i8*
%9 = alloca double
%10 = alloca double
%11 = alloca i8*
%12 = alloca i8*
%13 = alloca i64
store i8* %0, i8** %6
store i64 %1, i64* %7
store i8* %2, i8** %8
store double %3, double* %9
store double %4, double* %10
br label %14
14: ; preds = %5
%15 = load double, double* %9
%16 = load double, double* %10
%17 = fcmp ole double %15, %16
%18 = zext i1 %17 to i64
%19 = select i1 %17, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0)
store i8* %19, i8** %11
%20 = load i32, i32* @BUFSIZ
%21 = zext i32 %20 to i64
%22 = call i8* @llvm.stacksave()
store i8* %22, i8** %12
%23 = alloca i8, i64 %21
store i64 %21, i64* %13
%24 = load double, double* %9
%25 = load double, double* %10
%26 = fcmp ole double %24, %25
br i1 %26, label %32, label %27
27: ; preds = %14
%28 = trunc i64 %21 to i32
%29 = load i8*, i8** %6
%30 = load i64, i64* %7
%31 = call i32 @snprintf(i8* %23, i32 %28, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i8* %29, i64 %30)
br label %34
32: ; preds = %14
%33 = getelementptr inbounds i8, i8* %23, i64 0
store i8 0, i8* %33
br label %34
34: ; preds = %32, %27
%35 = load double, double* %9
%36 = load double, double* %10
%37 = load i8*, i8** %11
%38 = load i8*, i8** %8
%39 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.3, i64 0, i64 0), double %35, double %36, i8* %37, i8* %38, i8* %23)
%40 = load double, double* %9
%41 = load double, double* %10
%42 = fcmp ole double %40, %41
br i1 %42, label %47, label %43
43: ; preds = %34
%44 = load i8*, i8** %6
%45 = load i64, i64* %7
%46 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), i8* %44, i64 %45)
br label %47
47: ; preds = %43, %34
%48 = load i32, i32* @stdout
%49 = call i32 @fflush(i32 %48)
%50 = load i8*, i8** %12
br label %51
51: ; preds = %47
ret void
}

LLVM IR (-O2):
@.str = [5 x i8] c"PASS\00"
@.str.1 = [5 x i8] c"FAIL\00"
@BUFSIZ = global i32 0
@.str.2 = [10 x i8] c" (%s:%ld)\00"
@.str.3 = [38 x i8] c"\09Actual: %f\0A\09Expected: <%f\0A[%s] %s%s\0A\00"
@.str.4 = [9 x i8] c"\09%s:%ld\0A\00"
@stdout = global i32 0
define void @_test_double_less_than_or_equal(i8* %0, i64 %1, i8* %2, double %3, double %4) {
%6 = fcmp ole double %3, %4
%7 = select i1 %6, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0)
%8 = load i32, i32* @BUFSIZ
%9 = zext i32 %8 to i64
%10 = alloca i8, i64 %9
br i1 %6, label %11, label %13
11: ; preds = %5
store i8 0, i8* %10
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.3, i64 0, i64 0), double %3, double %4, i8* %7, i8* %2, i8* %10)
br label %17
13: ; preds = %5
%14 = call i32 @snprintf(i8* %10, i32 %8, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i8* %0, i64 %1)
%15 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.3, i64 0, i64 0), double %3, double %4, i8* %7, i8* %2, i8* %10)
%16 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), i8* %0, i64 %1)
br label %17
17: ; preds = %11, %13
%18 = load i32, i32* @stdout
%19 = call i32 @fflush(i32 %18)
ret void
}