#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 */
float fabs(float);
scalar_t__ hIsFinite(float);
scalar_t__ hIsInd(float);
scalar_t__ hIsInf(float);
scalar_t__ hIsNan(float);
scalar_t__ hIsNeg(float);
scalar_t__ hIsZero(float);
int hPrintNumber(int, unsigned long long, int, int, int);
unsigned long long hScaleDoubleToULL(float, int *);
int fb_PrintUsingSingle(int fnum, float value_f, int mask) {
  int val_exp = 0;
  int flags;
  unsigned long long val_ull = 1;
  flags = 0x10 | 0x20;
  if (hIsNeg(value_f))
    flags |= 0x1;
  if (hIsZero(value_f)) {
    val_ull = 0;
    val_exp = 0;
  } else if (hIsFinite(value_f)) {
    value_f = fabs(value_f);
    val_ull = hScaleDoubleToULL(value_f, &val_exp);
  } else {
    if (hIsInf(value_f))
      flags |= 0x2;
    else if (hIsInd(value_f))
      flags |= 0x4;
    else if (hIsNan(value_f))
      flags |= 0x8;
    else
      ((void)0);
  }
  return hPrintNumber(fnum, val_ull, val_exp, flags, mask);
}


x86 assembly (clang, -O0):
<fb_PrintUsingSingle>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movss  %xmm0,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movq   $0x1,-0x20(%rbp)
movl   $0x30,-0x14(%rbp)
movss  -0x8(%rbp),%xmm0
call   1030 <hIsNeg@plt>
cmp    $0x0,%rax
je     11d6 <fb_PrintUsingSingle+0x46>
mov    -0x14(%rbp),%eax
or     $0x1,%eax
mov    %eax,-0x14(%rbp)
movss  -0x8(%rbp),%xmm0
call   1040 <hIsZero@plt>
cmp    $0x0,%rax
je     11fe <fb_PrintUsingSingle+0x6e>
movq   $0x0,-0x20(%rbp)
movl   $0x0,-0x10(%rbp)
jmp    12b7 <fb_PrintUsingSingle+0x127>
movss  -0x8(%rbp),%xmm0
call   1080 <hIsFinite@plt>
cmp    $0x0,%rax
je     1238 <fb_PrintUsingSingle+0xa8>
movss  -0x8(%rbp),%xmm0
call   1070 <fabs@plt>
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
lea    -0x10(%rbp),%rdi
call   1060 <hScaleDoubleToULL@plt>
mov    %rax,-0x20(%rbp)
jmp    12b2 <fb_PrintUsingSingle+0x122>
movss  -0x8(%rbp),%xmm0
call   1090 <hIsInf@plt>
cmp    $0x0,%rax
je     125a <fb_PrintUsingSingle+0xca>
mov    -0x14(%rbp),%eax
or     $0x2,%eax
mov    %eax,-0x14(%rbp)
jmp    12ad <fb_PrintUsingSingle+0x11d>
movss  -0x8(%rbp),%xmm0
call   10a0 <hIsInd@plt>
cmp    $0x0,%rax
je     127c <fb_PrintUsingSingle+0xec>
mov    -0x14(%rbp),%eax
or     $0x4,%eax
mov    %eax,-0x14(%rbp)
jmp    12a8 <fb_PrintUsingSingle+0x118>
movss  -0x8(%rbp),%xmm0
call   10b0 <hIsNan@plt>
cmp    $0x0,%rax
je     129e <fb_PrintUsingSingle+0x10e>
mov    -0x14(%rbp),%eax
or     $0x8,%eax
mov    %eax,-0x14(%rbp)
jmp    12a3 <fb_PrintUsingSingle+0x113>
jmp    12a3 <fb_PrintUsingSingle+0x113>
jmp    12a8 <fb_PrintUsingSingle+0x118>
jmp    12ad <fb_PrintUsingSingle+0x11d>
jmp    12b2 <fb_PrintUsingSingle+0x122>
jmp    12b7 <fb_PrintUsingSingle+0x127>
mov    -0x4(%rbp),%edi
mov    -0x20(%rbp),%rsi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
mov    -0xc(%rbp),%r8d
call   1050 <hPrintNumber@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fb_PrintUsingSingle>:
push   %rbp
push   %r14
push   %rbx
sub    $0x20,%rsp
mov    %esi,%r14d
movaps %xmm0,0x10(%rsp)
mov    %edi,%ebp
movl   $0x0,0xc(%rsp)
call   1030 <hIsNeg@plt>
cmp    $0x1,%rax
mov    $0x31,%ebx
sbb    $0x0,%ebx
movaps 0x10(%rsp),%xmm0
call   1040 <hIsZero@plt>
test   %rax,%rax
je     11c8 <fb_PrintUsingSingle+0x48>
movl   $0x0,0xc(%rsp)
xor    %edx,%edx
xor    %esi,%esi
jmp    123a <fb_PrintUsingSingle+0xba>
movaps 0x10(%rsp),%xmm0
call   1070 <hIsFinite@plt>
test   %rax,%rax
je     11f6 <fb_PrintUsingSingle+0x76>
movaps 0x10(%rsp),%xmm0
andps  0xe1d(%rip),%xmm0
lea    0xc(%rsp),%rdi
call   1060 <hScaleDoubleToULL@plt>
mov    %rax,%rsi
mov    0xc(%rsp),%edx
jmp    123a <fb_PrintUsingSingle+0xba>
movaps 0x10(%rsp),%xmm0
call   1080 <hIsInf@plt>
test   %rax,%rax
je     120a <fb_PrintUsingSingle+0x8a>
or     $0x2,%ebx
jmp    1233 <fb_PrintUsingSingle+0xb3>
movaps 0x10(%rsp),%xmm0
call   1090 <hIsInd@plt>
test   %rax,%rax
je     121e <fb_PrintUsingSingle+0x9e>
or     $0x4,%ebx
jmp    1233 <fb_PrintUsingSingle+0xb3>
movaps 0x10(%rsp),%xmm0
call   10a0 <hIsNan@plt>
mov    %ebx,%ecx
or     $0x8,%ecx
test   %rax,%rax
cmovne %ecx,%ebx
mov    $0x1,%esi
xor    %edx,%edx
mov    %ebp,%edi
mov    %ebx,%ecx
mov    %r14d,%r8d
call   1050 <hPrintNumber@plt>
add    $0x20,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define i32 @fb_PrintUsingSingle(i32 %0, float %1, i32 %2) {
%4 = alloca i32
%5 = alloca float
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i64
store i32 %0, i32* %4
store float %1, float* %5
store i32 %2, i32* %6
store i32 0, i32* %7
store i64 1, i64* %9
store i32 48, i32* %8
%10 = load float, float* %5
%11 = call i64 @hIsNeg(float %10)
%12 = icmp ne i64 %11, 0
br i1 %12, label %13, label %16
13: ; preds = %3
%14 = load i32, i32* %8
%15 = or i32 %14, 1
store i32 %15, i32* %8
br label %16
16: ; preds = %13, %3
%17 = load float, float* %5
%18 = call i64 @hIsZero(float %17)
%19 = icmp ne i64 %18, 0
br i1 %19, label %20, label %21
20: ; preds = %16
store i64 0, i64* %9
store i32 0, i32* %7
br label %56
21: ; preds = %16
%22 = load float, float* %5
%23 = call i64 @hIsFinite(float %22)
%24 = icmp ne i64 %23, 0
br i1 %24, label %25, label %30
25: ; preds = %21
%26 = load float, float* %5
%27 = call float @fabs(float %26)
store float %27, float* %5
%28 = load float, float* %5
%29 = call i64 @hScaleDoubleToULL(float %28, i32* %7)
store i64 %29, i64* %9
br label %55
30: ; preds = %21
%31 = load float, float* %5
%32 = call i64 @hIsInf(float %31)
%33 = icmp ne i64 %32, 0
br i1 %33, label %34, label %37
34: ; preds = %30
%35 = load i32, i32* %8
%36 = or i32 %35, 2
store i32 %36, i32* %8
br label %54
37: ; preds = %30
%38 = load float, float* %5
%39 = call i64 @hIsInd(float %38)
%40 = icmp ne i64 %39, 0
br i1 %40, label %41, label %44
41: ; preds = %37
%42 = load i32, i32* %8
%43 = or i32 %42, 4
store i32 %43, i32* %8
br label %53
44: ; preds = %37
%45 = load float, float* %5
%46 = call i64 @hIsNan(float %45)
%47 = icmp ne i64 %46, 0
br i1 %47, label %48, label %51
48: ; preds = %44
%49 = load i32, i32* %8
%50 = or i32 %49, 8
store i32 %50, i32* %8
br label %52
51: ; preds = %44
br label %52
52: ; preds = %51, %48
br label %53
53: ; preds = %52, %41
br label %54
54: ; preds = %53, %34
br label %55
55: ; preds = %54, %25
br label %56
56: ; preds = %55, %20
%57 = load i32, i32* %4
%58 = load i64, i64* %9
%59 = load i32, i32* %7
%60 = load i32, i32* %8
%61 = load i32, i32* %6
%62 = call i32 @hPrintNumber(i32 %57, i64 %58, i32 %59, i32 %60, i32 %61)
ret i32 %62
}

LLVM IR (-O2):
define i32 @fb_PrintUsingSingle(i32 %0, float %1, i32 %2) {
%4 = alloca i32
%5 = bitcast i32* %4 to i8*
store i32 0, i32* %4
%6 = tail call i64 @hIsNeg(float %1)
%7 = icmp eq i64 %6, 0
%8 = select i1 %7, i32 48, i32 49
%9 = tail call i64 @hIsZero(float %1)
%10 = icmp eq i64 %9, 0
br i1 %10, label %12, label %11
11: ; preds = %3
store i32 0, i32* %4
br label %34
12: ; preds = %3
%13 = tail call i64 @hIsFinite(float %1)
%14 = icmp eq i64 %13, 0
br i1 %14, label %19, label %15
15: ; preds = %12
%16 = tail call float @llvm.fabs.f32(float %1)
%17 = call i64 @hScaleDoubleToULL(float %16, i32* %4)
%18 = load i32, i32* %4
br label %34
19: ; preds = %12
%20 = tail call i64 @hIsInf(float %1)
%21 = icmp eq i64 %20, 0
br i1 %21, label %24, label %22
22: ; preds = %19
%23 = or i32 %8, 2
br label %34
24: ; preds = %19
%25 = tail call i64 @hIsInd(float %1)
%26 = icmp eq i64 %25, 0
br i1 %26, label %29, label %27
27: ; preds = %24
%28 = or i32 %8, 4
br label %34
29: ; preds = %24
%30 = tail call i64 @hIsNan(float %1)
%31 = icmp eq i64 %30, 0
%32 = or i32 %8, 8
%33 = select i1 %31, i32 %8, i32 %32
br label %34
34: ; preds = %29, %15, %27, %22, %11
%35 = phi i32 [ 0, %11 ], [ %18, %15 ], [ 0, %22 ], [ 0, %27 ], [ 0, %29 ]
%36 = phi i32 [ %8, %11 ], [ %8, %15 ], [ %23, %22 ], [ %28, %27 ], [ %33, %29 ]
%37 = phi i64 [ 0, %11 ], [ %17, %15 ], [ 1, %22 ], [ 1, %27 ], [ 1, %29 ]
%38 = call i32 @hPrintNumber(i32 %0, i64 %37, i32 %35, i32 %36, i32 %2)
ret i32 %38
}