#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*/ addFailure(char *, long, char const *);
int /*<<< orphan*/ sprintf(char *, char *, unsigned int, float, float, float,
                           float);
int assertImplementationFloat_loop(unsigned int loop_cnt, float expected,
                                   float actual, float deviation, long line,
                                   const char *file) {
  char buffer[128];
  float dif, percent;
  dif = expected - actual;
  if (dif < 0)
    dif = -dif;
  if (expected != 0) {
    percent = dif / expected;
    if (percent < 0)
      percent = -percent;
  } else
    percent = dif;
  if (percent < deviation)
    return 0;
  sprintf(buffer,
          "loop_cnt: %d ... exp: %.4f ... was: %.4f ... dif: %f ... deviation: "
          "%f%%",
          loop_cnt, expected, actual, dif, percent);
  addFailure(buffer, line, file);
  return 1;
}


x86 assembly (clang, -O0):
<assertImplementationFloat_loop>:
push   %rbp
mov    %rsp,%rbp
sub    $0xc0,%rsp
mov    %edi,-0x8(%rbp)
movss  %xmm0,-0xc(%rbp)
movss  %xmm1,-0x10(%rbp)
movss  %xmm2,-0x14(%rbp)
mov    %rsi,-0x20(%rbp)
mov    %rdx,-0x28(%rbp)
movss  -0xc(%rbp),%xmm0
subss  -0x10(%rbp),%xmm0
movss  %xmm0,-0xb4(%rbp)
ff
xorps  %xmm0,%xmm0
ucomiss -0xb4(%rbp),%xmm0
jbe    1184 <assertImplementationFloat_loop+0x64>
movss  -0xb4(%rbp),%xmm0
ff
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  %xmm0,-0xb4(%rbp)
ff
movss  -0xc(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jne    11a0 <assertImplementationFloat_loop+0x80>
jp     11a0 <assertImplementationFloat_loop+0x80>
jmp    11e7 <assertImplementationFloat_loop+0xc7>
movss  -0xb4(%rbp),%xmm0
ff
divss  -0xc(%rbp),%xmm0
movss  %xmm0,-0xb8(%rbp)
ff
xorps  %xmm0,%xmm0
ucomiss -0xb8(%rbp),%xmm0
jbe    11e2 <assertImplementationFloat_loop+0xc2>
movss  -0xb8(%rbp),%xmm0
ff
movd   %xmm0,%eax
xor    $0x80000000,%eax
movd   %eax,%xmm0
movss  %xmm0,-0xb8(%rbp)
ff
jmp    11f7 <assertImplementationFloat_loop+0xd7>
movss  -0xb4(%rbp),%xmm0
ff
movss  %xmm0,-0xb8(%rbp)
ff
movss  -0xb8(%rbp),%xmm1
ff
movss  -0x14(%rbp),%xmm0
ucomiss %xmm1,%xmm0
jbe    1219 <assertImplementationFloat_loop+0xf9>
movl   $0x0,-0x4(%rbp)
jmp    1264 <assertImplementationFloat_loop+0x144>
lea    -0xb0(%rbp),%rdi
mov    -0x8(%rbp),%edx
movss  -0xc(%rbp),%xmm0
movss  -0x10(%rbp),%xmm1
movss  -0xb4(%rbp),%xmm2
ff
movss  -0xb8(%rbp),%xmm3
ff
lea    0xdbc(%rip),%rsi
call   1040 <sprintf@plt>
lea    -0xb0(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x28(%rbp),%rdx
call   1030 <addFailure@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xc0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<assertImplementationFloat_loop>:
push   %r15
push   %r14
push   %rbx
sub    $0x80,%rsp
mov    %rdx,%r14
mov    %rsi,%r15
mov    %edi,%edx
movaps %xmm0,%xmm4
subss  %xmm1,%xmm4
movaps 0xebe(%rip),%xmm6
xorps  %xmm4,%xmm6
xorps  %xmm5,%xmm5
movaps %xmm4,%xmm3
cmpltss %xmm5,%xmm3
andps  %xmm3,%xmm6
andnps %xmm4,%xmm3
orps   %xmm6,%xmm3
movaps %xmm3,%xmm4
ucomiss %xmm5,%xmm0
jne    1163 <assertImplementationFloat_loop+0x43>
jnp    1173 <assertImplementationFloat_loop+0x53>
divss  %xmm0,%xmm3
ucomiss %xmm3,%xmm5
jbe    1173 <assertImplementationFloat_loop+0x53>
xorps  0xe8d(%rip),%xmm3
xor    %eax,%eax
ucomiss %xmm3,%xmm2
ja     11a2 <assertImplementationFloat_loop+0x82>
lea    0xe8f(%rip),%rsi
mov    %rsp,%rbx
mov    %rbx,%rdi
movaps %xmm4,%xmm2
call   1040 <sprintf@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
call   1030 <addFailure@plt>
mov    $0x1,%eax
add    $0x80,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [73 x i8] c"loop_cnt: %d ... exp: %.4f ... was: %.4f ... dif: %f ... deviation: %f%%\00"
define i32 @assertImplementationFloat_loop(i32 %0, float %1, float %2, float %3, i64 %4, i8* %5) {
%7 = alloca i32
%8 = alloca i32
%9 = alloca float
%10 = alloca float
%11 = alloca float
%12 = alloca i64
%13 = alloca i8*
%14 = alloca [128 x i8]
%15 = alloca float
%16 = alloca float
store i32 %0, i32* %8
store float %1, float* %9
store float %2, float* %10
store float %3, float* %11
store i64 %4, i64* %12
store i8* %5, i8** %13
%17 = load float, float* %9
%18 = load float, float* %10
%19 = fsub float %17, %18
store float %19, float* %15
%20 = load float, float* %15
%21 = fcmp olt float %20, 0.000000e+00
br i1 %21, label %22, label %25
22: ; preds = %6
%23 = load float, float* %15
%24 = fneg float %23
store float %24, float* %15
br label %25
25: ; preds = %22, %6
%26 = load float, float* %9
%27 = fcmp une float %26, 0.000000e+00
br i1 %27, label %28, label %38
28: ; preds = %25
%29 = load float, float* %15
%30 = load float, float* %9
%31 = fdiv float %29, %30
store float %31, float* %16
%32 = load float, float* %16
%33 = fcmp olt float %32, 0.000000e+00
br i1 %33, label %34, label %37
34: ; preds = %28
%35 = load float, float* %16
%36 = fneg float %35
store float %36, float* %16
br label %37
37: ; preds = %34, %28
br label %40
38: ; preds = %25
%39 = load float, float* %15
store float %39, float* %16
br label %40
40: ; preds = %38, %37
%41 = load float, float* %16
%42 = load float, float* %11
%43 = fcmp olt float %41, %42
br i1 %43, label %44, label %45
44: ; preds = %40
store i32 0, i32* %7
br label %57
45: ; preds = %40
%46 = getelementptr inbounds [128 x i8], [128 x i8]* %14, i64 0, i64 0
%47 = load i32, i32* %8
%48 = load float, float* %9
%49 = load float, float* %10
%50 = load float, float* %15
%51 = load float, float* %16
%52 = call i32 @sprintf(i8* %46, i8* getelementptr inbounds ([73 x i8], [73 x i8]* @.str, i64 0, i64 0), i32 %47, float %48, float %49, float %50, float %51)
%53 = getelementptr inbounds [128 x i8], [128 x i8]* %14, i64 0, i64 0
%54 = load i64, i64* %12
%55 = load i8*, i8** %13
%56 = call i32 @addFailure(i8* %53, i64 %54, i8* %55)
store i32 1, i32* %7
br label %57
57: ; preds = %45, %44
%58 = load i32, i32* %7
ret i32 %58
}

LLVM IR (-O2):
@.str = [73 x i8] c"loop_cnt: %d ... exp: %.4f ... was: %.4f ... dif: %f ... deviation: %f%%\00"
define i32 @assertImplementationFloat_loop(i32 %0, float %1, float %2, float %3, i64 %4, i8* %5) {
%7 = alloca [128 x i8]
%8 = getelementptr inbounds [128 x i8], [128 x i8]* %7, i64 0, i64 0
%9 = fsub float %1, %2
%10 = fcmp olt float %9, 0.000000e+00
%11 = fneg float %9
%12 = select i1 %10, float %11, float %9
%13 = fcmp une float %1, 0.000000e+00
br i1 %13, label %14, label %19
14: ; preds = %6
%15 = fdiv float %12, %1
%16 = fcmp olt float %15, 0.000000e+00
br i1 %16, label %17, label %19
17: ; preds = %14
%18 = fneg float %15
br label %19
19: ; preds = %6, %14, %17
%20 = phi float [ %18, %17 ], [ %15, %14 ], [ %12, %6 ]
%21 = fcmp olt float %20, %3
br i1 %21, label %25, label %22
22: ; preds = %19
%23 = call i32 @sprintf(i8* %8, i8* dereferenceable(1) getelementptr inbounds ([73 x i8], [73 x i8]* @.str, i64 0, i64 0), i32 %0, float %1, float %2, float %12, float %20)
%24 = call i32 @addFailure(i8* %8, i64 %4, i8* %5)
br label %25
25: ; preds = %19, %22
%26 = phi i32 [ 1, %22 ], [ 0, %19 ]
ret i32 %26
}