#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 uint32_t;

/* Variables and functions */
unsigned int UINT32_C(int);
int bits(int, int, int);
int float_as_uint(float);
float uint_as_float(int);
float fflr_circuit(float f) {
  uint32_t fu = float_as_uint(f);
  unsigned int len, len_raw;
  uint32_t x_mask, incr;
  uint32_t f_masked, f_incr;
  uint32_t f_out;
  len_raw = bits(fu, 30, 23) - 0x7F;
  len = bits(len_raw, 8, 8) == 1   ? 0
        : bits(len_raw, 7, 5) != 0 ? 31
                                   : bits(len_raw, 4, 0);
  x_mask = UINT32_C(0x007FFFFF) >> len;
  incr = (x_mask << 1) ^ 1 ^ x_mask;
  f_masked = bits(fu, 30, 0) & ~x_mask;
  f_incr = f_masked + incr;
  f_out = (bits(fu, 31, 31) == 0 || bits(fu, 30, 0) == f_masked) ? f_masked
                                                                 : f_incr;
  uint32_t ret = (bits(fu, 31, 31) == 0 || bits(fu, 30, 23) == 0) &&
                         bits(len_raw, 8, 8) == 1
                     ? bits(fu, 31, 31) << 31 | 0x00 << 23 | bits(f_out, 22, 0)
                 : bits(fu, 31, 31) == 1 && bits(len_raw, 8, 8) == 1
                     ? bits(fu, 31, 31) << 31 | 0x7F << 23 | bits(f_out, 22, 0)
                     : bits(fu, 31, 31) << 31 | f_out;
  return uint_as_float(ret);
}


x86 assembly (clang, -O0):
<fflr_circuit>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movss  %xmm0,-0x4(%rbp)
movss  -0x4(%rbp),%xmm0
call   1030 <float_as_uint@plt>
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%edi
mov    $0x1e,%esi
mov    $0x17,%edx
call   1050 <bits@plt>
sub    $0x7f,%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%edi
mov    $0x8,%edx
mov    %edx,%esi
call   1050 <bits@plt>
cmp    $0x1,%eax
jne    1194 <fflr_circuit+0x54>
xor    %eax,%eax
mov    %eax,-0x2c(%rbp)
jmp    11d4 <fflr_circuit+0x94>
mov    -0x10(%rbp),%edi
mov    $0x7,%esi
mov    $0x5,%edx
call   1050 <bits@plt>
cmp    $0x0,%eax
je     11bc <fflr_circuit+0x7c>
mov    $0x1f,%eax
mov    %eax,-0x30(%rbp)
jmp    11ce <fflr_circuit+0x8e>
mov    -0x10(%rbp),%edi
mov    $0x4,%esi
xor    %edx,%edx
call   1050 <bits@plt>
mov    %eax,-0x30(%rbp)
mov    -0x30(%rbp),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
mov    %eax,-0xc(%rbp)
mov    $0x7fffff,%edi
call   1060 <UINT32_C@plt>
mov    -0xc(%rbp),%ecx
shr    %cl,%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
shl    $0x1,%eax
xor    $0x1,%eax
xor    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%edi
mov    $0x1e,%esi
xor    %edx,%edx
call   1050 <bits@plt>
mov    -0x14(%rbp),%ecx
xor    $0xffffffff,%ecx
and    %ecx,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    -0x18(%rbp),%eax
mov    %eax,-0x20(%rbp)
mov    -0x8(%rbp),%edi
mov    $0x1f,%edx
mov    %edx,%esi
call   1050 <bits@plt>
cmp    $0x0,%eax
je     124e <fflr_circuit+0x10e>
mov    -0x8(%rbp),%edi
mov    $0x1e,%esi
xor    %edx,%edx
call   1050 <bits@plt>
cmp    -0x1c(%rbp),%eax
jne    1259 <fflr_circuit+0x119>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x34(%rbp)
jmp    125f <fflr_circuit+0x11f>
mov    -0x20(%rbp),%eax
mov    %eax,-0x34(%rbp)
mov    -0x34(%rbp),%eax
mov    %eax,-0x24(%rbp)
mov    -0x8(%rbp),%edi
mov    $0x1f,%edx
mov    %edx,%esi
call   1050 <bits@plt>
cmp    $0x0,%eax
je     1298 <fflr_circuit+0x158>
mov    -0x8(%rbp),%edi
mov    $0x1e,%esi
mov    $0x17,%edx
call   1050 <bits@plt>
cmp    $0x0,%eax
jne    12e6 <fflr_circuit+0x1a6>
mov    -0x10(%rbp),%edi
mov    $0x8,%edx
mov    %edx,%esi
call   1050 <bits@plt>
cmp    $0x1,%eax
jne    12e6 <fflr_circuit+0x1a6>
mov    -0x8(%rbp),%edi
mov    $0x1f,%edx
mov    %edx,%esi
call   1050 <bits@plt>
shl    $0x1f,%eax
or     $0x0,%eax
mov    %eax,-0x3c(%rbp)
mov    -0x24(%rbp),%edi
mov    $0x16,%esi
xor    %edx,%edx
call   1050 <bits@plt>
mov    %eax,%ecx
mov    -0x3c(%rbp),%eax
or     %ecx,%eax
mov    %eax,-0x38(%rbp)
jmp    136c <fflr_circuit+0x22c>
mov    -0x8(%rbp),%edi
mov    $0x1f,%edx
mov    %edx,%esi
call   1050 <bits@plt>
cmp    $0x1,%eax
jne    134e <fflr_circuit+0x20e>
mov    -0x10(%rbp),%edi
mov    $0x8,%edx
mov    %edx,%esi
call   1050 <bits@plt>
cmp    $0x1,%eax
jne    134e <fflr_circuit+0x20e>
mov    -0x8(%rbp),%edi
mov    $0x1f,%edx
mov    %edx,%esi
call   1050 <bits@plt>
shl    $0x1f,%eax
or     $0x3f800000,%eax
mov    %eax,-0x44(%rbp)
mov    -0x24(%rbp),%edi
mov    $0x16,%esi
xor    %edx,%edx
call   1050 <bits@plt>
mov    %eax,%ecx
mov    -0x44(%rbp),%eax
or     %ecx,%eax
mov    %eax,-0x40(%rbp)
jmp    1366 <fflr_circuit+0x226>
mov    -0x8(%rbp),%edi
mov    $0x1f,%edx
mov    %edx,%esi
call   1050 <bits@plt>
shl    $0x1f,%eax
or     -0x24(%rbp),%eax
mov    %eax,-0x40(%rbp)
mov    -0x40(%rbp),%eax
mov    %eax,-0x38(%rbp)
mov    -0x38(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0x28(%rbp),%edi
call   1040 <uint_as_float@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fflr_circuit>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
call   1030 <float_as_uint@plt>
mov    %eax,%r15d
mov    %eax,%edi
mov    $0x1e,%esi
mov    $0x17,%edx
call   1050 <bits@plt>
mov    %eax,%r14d
add    $0xffffff81,%r14d
mov    %r14d,%edi
mov    $0x8,%esi
mov    $0x8,%edx
call   1050 <bits@plt>
xor    %ebp,%ebp
cmp    $0x1,%eax
je     11b0 <fflr_circuit+0x70>
mov    %r14d,%edi
mov    $0x7,%esi
mov    $0x5,%edx
call   1050 <bits@plt>
mov    $0x1f,%ebp
test   %eax,%eax
jne    11b0 <fflr_circuit+0x70>
mov    %r14d,%edi
mov    $0x4,%esi
xor    %edx,%edx
call   1050 <bits@plt>
mov    %eax,%ebp
mov    $0x7fffff,%edi
call   1060 <UINT32_C@plt>
mov    %eax,%ebx
mov    %ebp,%ecx
shr    %cl,%ebx
xor    %r12d,%r12d
mov    %r15d,%edi
mov    $0x1e,%esi
xor    %edx,%edx
call   1050 <bits@plt>
mov    %ebx,%r13d
not    %r13d
and    %eax,%r13d
mov    %r15d,%edi
mov    $0x1f,%esi
mov    $0x1f,%edx
call   1050 <bits@plt>
test   %eax,%eax
je     1212 <fflr_circuit+0xd2>
lea    (%rbx,%rbx,1),%ebp
add    $0x1,%ebp
xor    %ebx,%ebp
mov    %r15d,%edi
mov    $0x1e,%esi
xor    %edx,%edx
call   1050 <bits@plt>
cmp    %r13d,%eax
cmove  %r12d,%ebp
add    %ebp,%r13d
mov    %r15d,%edi
mov    $0x1f,%esi
mov    $0x1f,%edx
call   1050 <bits@plt>
test   %eax,%eax
je     123e <fflr_circuit+0xfe>
mov    %r15d,%edi
mov    $0x1e,%esi
mov    $0x17,%edx
call   1050 <bits@plt>
test   %eax,%eax
jne    1281 <fflr_circuit+0x141>
mov    %r14d,%edi
mov    $0x8,%esi
mov    $0x8,%edx
call   1050 <bits@plt>
cmp    $0x1,%eax
jne    1281 <fflr_circuit+0x141>
mov    %r15d,%edi
mov    $0x1f,%esi
mov    $0x1f,%edx
call   1050 <bits@plt>
mov    %eax,%ebx
shl    $0x1f,%ebx
mov    %r13d,%edi
mov    $0x16,%esi
xor    %edx,%edx
call   1050 <bits@plt>
mov    %eax,%edi
or     %ebx,%edi
jmp    12fb <fflr_circuit+0x1bb>
mov    %r15d,%edi
mov    $0x1f,%esi
mov    $0x1f,%edx
call   1050 <bits@plt>
cmp    $0x1,%eax
jne    12e1 <fflr_circuit+0x1a1>
mov    %r14d,%edi
mov    $0x8,%esi
mov    $0x8,%edx
call   1050 <bits@plt>
cmp    $0x1,%eax
jne    12e1 <fflr_circuit+0x1a1>
mov    %r15d,%edi
mov    $0x1f,%esi
mov    $0x1f,%edx
call   1050 <bits@plt>
mov    %eax,%ebx
shl    $0x1f,%ebx
mov    %r13d,%edi
mov    $0x16,%esi
xor    %edx,%edx
call   1050 <bits@plt>
mov    %eax,%edi
or     %ebx,%edi
or     $0x3f800000,%edi
jmp    12fb <fflr_circuit+0x1bb>
mov    %r15d,%edi
mov    $0x1f,%esi
mov    $0x1f,%edx
call   1050 <bits@plt>
mov    %eax,%edi
shl    $0x1f,%edi
or     %r13d,%edi
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <uint_as_float@plt>

LLVM IR (-O0):
define float @fflr_circuit(float %0) {
%2 = alloca float
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
store float %0, float* %2
%12 = load float, float* %2
%13 = call i32 @float_as_uint(float %12)
store i32 %13, i32* %3
%14 = load i32, i32* %3
%15 = call i32 @bits(i32 %14, i32 30, i32 23)
%16 = sub nsw i32 %15, 127
store i32 %16, i32* %5
%17 = load i32, i32* %5
%18 = call i32 @bits(i32 %17, i32 8, i32 8)
%19 = icmp eq i32 %18, 1
br i1 %19, label %20, label %21
20: ; preds = %1
br label %31
21: ; preds = %1
%22 = load i32, i32* %5
%23 = call i32 @bits(i32 %22, i32 7, i32 5)
%24 = icmp ne i32 %23, 0
br i1 %24, label %25, label %26
25: ; preds = %21
br label %29
26: ; preds = %21
%27 = load i32, i32* %5
%28 = call i32 @bits(i32 %27, i32 4, i32 0)
br label %29
29: ; preds = %26, %25
%30 = phi i32 [ 31, %25 ], [ %28, %26 ]
br label %31
31: ; preds = %29, %20
%32 = phi i32 [ 0, %20 ], [ %30, %29 ]
store i32 %32, i32* %4
%33 = call i32 @UINT32_C(i32 8388607)
%34 = load i32, i32* %4
%35 = lshr i32 %33, %34
store i32 %35, i32* %6
%36 = load i32, i32* %6
%37 = shl i32 %36, 1
%38 = xor i32 %37, 1
%39 = load i32, i32* %6
%40 = xor i32 %38, %39
store i32 %40, i32* %7
%41 = load i32, i32* %3
%42 = call i32 @bits(i32 %41, i32 30, i32 0)
%43 = load i32, i32* %6
%44 = xor i32 %43, -1
%45 = and i32 %42, %44
store i32 %45, i32* %8
%46 = load i32, i32* %8
%47 = load i32, i32* %7
%48 = add nsw i32 %46, %47
store i32 %48, i32* %9
%49 = load i32, i32* %3
%50 = call i32 @bits(i32 %49, i32 31, i32 31)
%51 = icmp eq i32 %50, 0
br i1 %51, label %57, label %52
52: ; preds = %31
%53 = load i32, i32* %3
%54 = call i32 @bits(i32 %53, i32 30, i32 0)
%55 = load i32, i32* %8
%56 = icmp eq i32 %54, %55
br i1 %56, label %57, label %59
57: ; preds = %52, %31
%58 = load i32, i32* %8
br label %61
59: ; preds = %52
%60 = load i32, i32* %9
br label %61
61: ; preds = %59, %57
%62 = phi i32 [ %58, %57 ], [ %60, %59 ]
store i32 %62, i32* %10
%63 = load i32, i32* %3
%64 = call i32 @bits(i32 %63, i32 31, i32 31)
%65 = icmp eq i32 %64, 0
br i1 %65, label %70, label %66
66: ; preds = %61
%67 = load i32, i32* %3
%68 = call i32 @bits(i32 %67, i32 30, i32 23)
%69 = icmp eq i32 %68, 0
br i1 %69, label %70, label %82
70: ; preds = %66, %61
%71 = load i32, i32* %5
%72 = call i32 @bits(i32 %71, i32 8, i32 8)
%73 = icmp eq i32 %72, 1
br i1 %73, label %74, label %82
74: ; preds = %70
%75 = load i32, i32* %3
%76 = call i32 @bits(i32 %75, i32 31, i32 31)
%77 = shl i32 %76, 31
%78 = or i32 %77, 0
%79 = load i32, i32* %10
%80 = call i32 @bits(i32 %79, i32 22, i32 0)
%81 = or i32 %78, %80
br label %106
82: ; preds = %70, %66
%83 = load i32, i32* %3
%84 = call i32 @bits(i32 %83, i32 31, i32 31)
%85 = icmp eq i32 %84, 1
br i1 %85, label %86, label %98
86: ; preds = %82
%87 = load i32, i32* %5
%88 = call i32 @bits(i32 %87, i32 8, i32 8)
%89 = icmp eq i32 %88, 1
br i1 %89, label %90, label %98
90: ; preds = %86
%91 = load i32, i32* %3
%92 = call i32 @bits(i32 %91, i32 31, i32 31)
%93 = shl i32 %92, 31
%94 = or i32 %93, 1065353216
%95 = load i32, i32* %10
%96 = call i32 @bits(i32 %95, i32 22, i32 0)
%97 = or i32 %94, %96
br label %104
98: ; preds = %86, %82
%99 = load i32, i32* %3
%100 = call i32 @bits(i32 %99, i32 31, i32 31)
%101 = shl i32 %100, 31
%102 = load i32, i32* %10
%103 = or i32 %101, %102
br label %104
104: ; preds = %98, %90
%105 = phi i32 [ %97, %90 ], [ %103, %98 ]
br label %106
106: ; preds = %104, %74
%107 = phi i32 [ %81, %74 ], [ %105, %104 ]
store i32 %107, i32* %11
%108 = load i32, i32* %11
%109 = call float @uint_as_float(i32 %108)
ret float %109
}

LLVM IR (-O2):
define float @fflr_circuit(float %0) {
%2 = tail call i32 @float_as_uint(float %0)
%3 = tail call i32 @bits(i32 %2, i32 30, i32 23)
%4 = add nsw i32 %3, -127
%5 = tail call i32 @bits(i32 %4, i32 8, i32 8)
%6 = icmp eq i32 %5, 1
br i1 %6, label %12, label %7
7: ; preds = %1
%8 = tail call i32 @bits(i32 %4, i32 7, i32 5)
%9 = icmp eq i32 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %7
%11 = tail call i32 @bits(i32 %4, i32 4, i32 0)
br label %12
12: ; preds = %10, %7, %1
%13 = phi i32 [ 0, %1 ], [ %11, %10 ], [ 31, %7 ]
%14 = tail call i32 @UINT32_C(i32 8388607)
%15 = lshr i32 %14, %13
%16 = tail call i32 @bits(i32 %2, i32 30, i32 0)
%17 = xor i32 %15, -1
%18 = and i32 %16, %17
%19 = tail call i32 @bits(i32 %2, i32 31, i32 31)
%20 = icmp eq i32 %19, 0
br i1 %20, label %29, label %21
21: ; preds = %12
%22 = shl i32 %15, 1
%23 = or i32 %22, 1
%24 = xor i32 %23, %15
%25 = tail call i32 @bits(i32 %2, i32 30, i32 0)
%26 = icmp eq i32 %25, %18
%27 = select i1 %26, i32 0, i32 %24
%28 = add nsw i32 %27, %18
br label %29
29: ; preds = %21, %12
%30 = phi i32 [ %18, %12 ], [ %28, %21 ]
%31 = tail call i32 @bits(i32 %2, i32 31, i32 31)
%32 = icmp eq i32 %31, 0
br i1 %32, label %36, label %33
33: ; preds = %29
%34 = tail call i32 @bits(i32 %2, i32 30, i32 23)
%35 = icmp eq i32 %34, 0
br i1 %35, label %36, label %44
36: ; preds = %33, %29
%37 = tail call i32 @bits(i32 %4, i32 8, i32 8)
%38 = icmp eq i32 %37, 1
br i1 %38, label %39, label %44
39: ; preds = %36
%40 = tail call i32 @bits(i32 %2, i32 31, i32 31)
%41 = shl i32 %40, 31
%42 = tail call i32 @bits(i32 %30, i32 22, i32 0)
%43 = or i32 %41, %42
br label %60
44: ; preds = %36, %33
%45 = tail call i32 @bits(i32 %2, i32 31, i32 31)
%46 = icmp eq i32 %45, 1
br i1 %46, label %47, label %56
47: ; preds = %44
%48 = tail call i32 @bits(i32 %4, i32 8, i32 8)
%49 = icmp eq i32 %48, 1
br i1 %49, label %50, label %56
50: ; preds = %47
%51 = tail call i32 @bits(i32 %2, i32 31, i32 31)
%52 = shl i32 %51, 31
%53 = tail call i32 @bits(i32 %30, i32 22, i32 0)
%54 = or i32 %53, %52
%55 = or i32 %54, 1065353216
br label %60
56: ; preds = %47, %44
%57 = tail call i32 @bits(i32 %2, i32 31, i32 31)
%58 = shl i32 %57, 31
%59 = or i32 %58, %30
br label %60
60: ; preds = %50, %56, %39
%61 = phi i32 [ %43, %39 ], [ %55, %50 ], [ %59, %56 ]
%62 = tail call float @uint_as_float(i32 %61)
ret float %62
}