#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*/ printf(char *, ...);
void printNumberData(int i) {
  int sign_bit = 0;
  int exponent_bits = 0;
  int fraction_bits = 0;
  int normalized = 1;
  if (i < 0)
    sign_bit = 1;
  exponent_bits = i & 0x7F800000;
  exponent_bits = exponent_bits >> 23;
  fraction_bits = i & 0x007FFFFF;
  printf("signBit %d, expBits %3d, fractBits 0x%08X\n", sign_bit, exponent_bits,
         fraction_bits);
  if (exponent_bits == 0) {
    if (fraction_bits != 0) {
      normalized = 0;
      printf("denormalized: exp = %d", (exponent_bits - 126));
    } else {
      normalized = 0;
      if (sign_bit == 0) {
        printf("+zero");
      } else {
        printf("-zero");
      }
    }
  } else {
    if (exponent_bits == 0xff && fraction_bits == 0) {
      normalized = 0;
      if (sign_bit == 0) {
        printf("+infinity");
      } else {
        printf("-infinity");
      }
    }
    if (exponent_bits == 0xff && fraction_bits > 0) {
      if (fraction_bits & 0x00400000) {
        normalized = 0;
        printf("QNaN");
      } else {
        normalized = 0;
        printf("SNaN");
      }
    }
    if (normalized) {
      printf("normalized:   exp =  %d", (exponent_bits - 127));
    }
  }
  printf("\n\n");
}


x86 assembly (clang, -O0):
<printNumberData>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x1,-0x14(%rbp)
cmpl   $0x0,-0x4(%rbp)
jge    1148 <printNumberData+0x38>
movl   $0x1,-0x8(%rbp)
mov    -0x4(%rbp),%eax
and    $0x7f800000,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
sar    $0x17,%eax
mov    %eax,-0xc(%rbp)
mov    -0x4(%rbp),%eax
and    $0x7fffff,%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0x10(%rbp),%ecx
lea    0xe89(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0x0,-0xc(%rbp)
jne    11ee <printNumberData+0xde>
cmpl   $0x0,-0x10(%rbp)
je     11b2 <printNumberData+0xa2>
movl   $0x0,-0x14(%rbp)
mov    -0xc(%rbp),%esi
sub    $0x7e,%esi
lea    0xe85(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11e9 <printNumberData+0xd9>
movl   $0x0,-0x14(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    11d6 <printNumberData+0xc6>
lea    0xe78(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11e4 <printNumberData+0xd4>
lea    0xe6b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11e9 <printNumberData+0xd9>
jmp    12bb <printNumberData+0x1ab>
cmpl   $0xff,-0xc(%rbp)
jne    123c <printNumberData+0x12c>
cmpl   $0x0,-0x10(%rbp)
jne    123c <printNumberData+0x12c>
movl   $0x0,-0x14(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1229 <printNumberData+0x119>
lea    0xe31(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1237 <printNumberData+0x127>
lea    0xe28(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    123c <printNumberData+0x12c>
cmpl   $0xff,-0xc(%rbp)
jne    1298 <printNumberData+0x188>
cmpl   $0x0,-0x10(%rbp)
jle    1298 <printNumberData+0x188>
mov    -0x10(%rbp),%eax
and    $0x400000,%eax
cmp    $0x0,%eax
je     127e <printNumberData+0x16e>
movl   $0x0,-0x14(%rbp)
lea    0xdf0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1293 <printNumberData+0x183>
movl   $0x0,-0x14(%rbp)
lea    0xddb(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1298 <printNumberData+0x188>
cmpl   $0x0,-0x14(%rbp)
je     12b6 <printNumberData+0x1a6>
mov    -0xc(%rbp),%esi
sub    $0x7f,%esi
lea    0xdbd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12bb <printNumberData+0x1ab>
lea    0xdc2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<printNumberData>:
push   %rbp
push   %r14
push   %rbx
mov    %edi,%r14d
mov    %edi,%esi
shr    $0x1f,%esi
mov    %edi,%ebp
shr    $0x17,%ebp
mov    %edi,%ebx
and    $0x7fffff,%ebx
lea    0xec0(%rip),%rdi
mov    %ebp,%edx
and    $0xff,%edx
mov    %ebx,%ecx
xor    %eax,%eax
call   1040 <printf@plt>
and    $0xff,%ebp
je     1173 <printNumberData+0x53>
test   %ebx,%ebx
jne    1185 <printNumberData+0x65>
cmp    $0xff,%ebp
jne    1185 <printNumberData+0x65>
test   %r14d,%r14d
js     11c6 <printNumberData+0xa6>
lea    0xedd(%rip),%rdi
jmp    11df <printNumberData+0xbf>
test   %ebx,%ebx
je     11b8 <printNumberData+0x98>
lea    0xead(%rip),%rdi
mov    $0xffffff82,%esi
jmp    11af <printNumberData+0x8f>
test   %ebx,%ebx
je     11a3 <printNumberData+0x83>
cmp    $0xff,%ebp
jne    11a3 <printNumberData+0x83>
test   $0x400000,%r14d
jne    11cf <printNumberData+0xaf>
lea    0xec6(%rip),%rdi
jmp    11df <printNumberData+0xbf>
add    $0xffffff81,%ebp
lea    0xebf(%rip),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    11e6 <printNumberData+0xc6>
test   %r14d,%r14d
js     11d8 <printNumberData+0xb8>
lea    0xe7e(%rip),%rdi
jmp    11df <printNumberData+0xbf>
lea    0xe8b(%rip),%rdi
jmp    11df <printNumberData+0xbf>
lea    0xe8c(%rip),%rdi
jmp    11df <printNumberData+0xbf>
lea    0xe69(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe3c(%rip),%rdi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1030 <puts@plt>

LLVM IR (-O0):
@.str = [43 x i8] c"signBit %d, expBits %3d, fractBits 0x%08X\0A\00"
@.str.1 = [23 x i8] c"denormalized: exp = %d\00"
@.str.2 = [6 x i8] c"+zero\00"
@.str.3 = [6 x i8] c"-zero\00"
@.str.4 = [10 x i8] c"+infinity\00"
@.str.5 = [10 x i8] c"-infinity\00"
@.str.6 = [5 x i8] c"QNaN\00"
@.str.7 = [5 x i8] c"SNaN\00"
@.str.8 = [24 x i8] c"normalized: exp = %d\00"
@.str.9 = [3 x i8] c"\0A\0A\00"
define void @printNumberData(i32 %0) {
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i32 %0, i32* %2
store i32 0, i32* %3
store i32 0, i32* %4
store i32 0, i32* %5
store i32 1, i32* %6
%7 = load i32, i32* %2
%8 = icmp slt i32 %7, 0
br i1 %8, label %9, label %10
9: ; preds = %1
store i32 1, i32* %3
br label %10
10: ; preds = %9, %1
%11 = load i32, i32* %2
%12 = and i32 %11, 2139095040
store i32 %12, i32* %4
%13 = load i32, i32* %4
%14 = ashr i32 %13, 23
store i32 %14, i32* %4
%15 = load i32, i32* %2
%16 = and i32 %15, 8388607
store i32 %16, i32* %5
%17 = load i32, i32* %3
%18 = load i32, i32* %4
%19 = load i32, i32* %5
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i32 %17, i32 %18, i32 %19)
%21 = load i32, i32* %4
%22 = icmp eq i32 %21, 0
br i1 %22, label %23, label %39
23: ; preds = %10
%24 = load i32, i32* %5
%25 = icmp ne i32 %24, 0
br i1 %25, label %26, label %30
26: ; preds = %23
store i32 0, i32* %6
%27 = load i32, i32* %4
%28 = sub nsw i32 %27, 126
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i32 %28)
br label %38
30: ; preds = %23
store i32 0, i32* %6
%31 = load i32, i32* %3
%32 = icmp eq i32 %31, 0
br i1 %32, label %33, label %35
33: ; preds = %30
%34 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
br label %37
35: ; preds = %30
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
br label %37
37: ; preds = %35, %33
br label %38
38: ; preds = %37, %26
br label %76
39: ; preds = %10
%40 = load i32, i32* %4
%41 = icmp eq i32 %40, 255
br i1 %41, label %42, label %53
42: ; preds = %39
%43 = load i32, i32* %5
%44 = icmp eq i32 %43, 0
br i1 %44, label %45, label %53
45: ; preds = %42
store i32 0, i32* %6
%46 = load i32, i32* %3
%47 = icmp eq i32 %46, 0
br i1 %47, label %48, label %50
48: ; preds = %45
%49 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0))
br label %52
50: ; preds = %45
%51 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0))
br label %52
52: ; preds = %50, %48
br label %53
53: ; preds = %52, %42, %39
%54 = load i32, i32* %4
%55 = icmp eq i32 %54, 255
br i1 %55, label %56, label %68
56: ; preds = %53
%57 = load i32, i32* %5
%58 = icmp sgt i32 %57, 0
br i1 %58, label %59, label %68
59: ; preds = %56
%60 = load i32, i32* %5
%61 = and i32 %60, 4194304
%62 = icmp ne i32 %61, 0
br i1 %62, label %63, label %65
63: ; preds = %59
store i32 0, i32* %6
%64 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0))
br label %67
65: ; preds = %59
store i32 0, i32* %6
%66 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0))
br label %67
67: ; preds = %65, %63
br label %68
68: ; preds = %67, %56, %53
%69 = load i32, i32* %6
%70 = icmp ne i32 %69, 0
br i1 %70, label %71, label %75
71: ; preds = %68
%72 = load i32, i32* %4
%73 = sub nsw i32 %72, 127
%74 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.8, i64 0, i64 0), i32 %73)
br label %75
75: ; preds = %71, %68
br label %76
76: ; preds = %75, %38
%77 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@.str = [43 x i8] c"signBit %d, expBits %3d, fractBits 0x%08X\0A\00"
@.str.1 = [23 x i8] c"denormalized: exp = %d\00"
@.str.2 = [6 x i8] c"+zero\00"
@.str.3 = [6 x i8] c"-zero\00"
@.str.4 = [10 x i8] c"+infinity\00"
@.str.5 = [10 x i8] c"-infinity\00"
@.str.6 = [5 x i8] c"QNaN\00"
@.str.7 = [5 x i8] c"SNaN\00"
@.str.8 = [24 x i8] c"normalized: exp = %d\00"
@str = [2 x i8] c"\0A\00"
define void @printNumberData(i32 %0) {
%2 = icmp slt i32 %0, 0
%3 = lshr i32 %0, 31
%4 = lshr i32 %0, 23
%5 = and i32 %4, 255
%6 = and i32 %0, 8388607
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %5, i32 %6)
%8 = icmp eq i32 %5, 0
br i1 %8, label %9, label %18
9: ; preds = %1
%10 = icmp eq i32 %6, 0
br i1 %10, label %13, label %11
11: ; preds = %9
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.1, i64 0, i64 0), i32 -126)
br label %40
13: ; preds = %9
br i1 %2, label %16, label %14
14: ; preds = %13
%15 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
br label %40
16: ; preds = %13
%17 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
br label %40
18: ; preds = %1
%19 = icmp eq i32 %5, 255
%20 = icmp eq i32 %6, 0
%21 = and i1 %20, %19
br i1 %21, label %22, label %27
22: ; preds = %18
br i1 %2, label %25, label %23
23: ; preds = %22
%24 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0))
br label %40
25: ; preds = %22
%26 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0))
br label %40
27: ; preds = %18
%28 = icmp ne i32 %6, 0
%29 = and i1 %28, %19
br i1 %29, label %30, label %37
30: ; preds = %27
%31 = and i32 %0, 4194304
%32 = icmp eq i32 %31, 0
br i1 %32, label %35, label %33
33: ; preds = %30
%34 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0))
br label %40
35: ; preds = %30
%36 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0))
br label %40
37: ; preds = %27
%38 = add nsw i32 %5, -127
%39 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.8, i64 0, i64 0), i32 %38)
br label %40
40: ; preds = %25, %23, %35, %33, %37, %11, %16, %14
%41 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
ret void
}