#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*/ src;

/* Variables and functions */
int /*<<< orphan*/ _float32_unpack(long);
int /*<<< orphan*/ printf(char *, long, int /*<<< orphan*/);
int main(void) {
  long src[] = {
      -535612621, -535822336, -537919488,  1610612736,  1609564160,
      1611661312, 1611871027, +2147483647, -2147483648,
  };
  int size = sizeof(src) / sizeof(*src);
  for (int i = 0; i < size; i++) {
    printf("testpack(%ld, %f);\n", src[i], _float32_unpack(src[i]));
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x50(%rbp),%rdi
lea    0xeb6(%rip),%rsi
mov    $0x48,%edx
call   1040 <memcpy@plt>
movl   $0x9,-0x54(%rbp)
movl   $0x0,-0x58(%rbp)
mov    -0x58(%rbp),%eax
cmp    -0x54(%rbp),%eax
jge    11a9 <main+0x79>
movslq -0x58(%rbp),%rax
mov    -0x50(%rbp,%rax,8),%rax
mov    %rax,-0x60(%rbp)
movslq -0x58(%rbp),%rax
mov    -0x50(%rbp,%rax,8),%rdi
call   1050 <_float32_unpack@plt>
mov    -0x60(%rbp),%rsi
mov    %eax,%edx
lea    0xeb2(%rip),%rdi
call   1030 <printf@plt>
mov    -0x58(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x58(%rbp)
jmp    1162 <main+0x32>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
mov    $0xffffffffe0133333,%rdi
call   1040 <_float32_unpack@plt>
lea    0xecc(%rip),%rbx
mov    %rbx,%rdi
mov    $0xffffffffe0133333,%rsi
mov    %eax,%edx
call   1030 <printf@plt>
mov    $0xffffffffe0100000,%rdi
call   1040 <_float32_unpack@plt>
mov    %rbx,%rdi
mov    $0xffffffffe0100000,%rsi
mov    %eax,%edx
call   1030 <printf@plt>
mov    $0xffffffffdff00000,%rdi
call   1040 <_float32_unpack@plt>
mov    %rbx,%rdi
mov    $0xffffffffdff00000,%rsi
mov    %eax,%edx
call   1030 <printf@plt>
mov    $0x60000000,%edi
call   1040 <_float32_unpack@plt>
mov    $0x60000000,%esi
mov    %rbx,%rdi
mov    %eax,%edx
call   1030 <printf@plt>
mov    $0x5ff00000,%edi
call   1040 <_float32_unpack@plt>
mov    $0x5ff00000,%esi
mov    %rbx,%rdi
mov    %eax,%edx
call   1030 <printf@plt>
mov    $0x60100000,%edi
call   1040 <_float32_unpack@plt>
mov    $0x60100000,%esi
mov    %rbx,%rdi
mov    %eax,%edx
call   1030 <printf@plt>
mov    $0x60133333,%edi
call   1040 <_float32_unpack@plt>
mov    $0x60133333,%esi
mov    %rbx,%rdi
mov    %eax,%edx
call   1030 <printf@plt>
mov    $0x7fffffff,%edi
call   1040 <_float32_unpack@plt>
mov    $0x7fffffff,%esi
mov    %rbx,%rdi
mov    %eax,%edx
call   1030 <printf@plt>
mov    $0xffffffff80000000,%rdi
call   1040 <_float32_unpack@plt>
mov    %rbx,%rdi
mov    $0xffffffff80000000,%rsi
mov    %eax,%edx
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.src = [9 x i64] [i64 -535612621, i64 -535822336, i64 -537919488, i64 1610612736, i64 1609564160, i64 1611661312, i64 1611871027, i64 2147483647, i64 -2147483648]
@.str = [20 x i8] c"testpack(%ld, %f);\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [9 x i64]
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = bitcast [9 x i64]* %2 to i8*
store i32 9, i32* %3
store i32 0, i32* %4
br label %6
6: ; preds = %21, %0
%7 = load i32, i32* %4
%8 = load i32, i32* %3
%9 = icmp slt i32 %7, %8
br i1 %9, label %10, label %24
10: ; preds = %6
%11 = load i32, i32* %4
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds [9 x i64], [9 x i64]* %2, i64 0, i64 %12
%14 = load i64, i64* %13
%15 = load i32, i32* %4
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds [9 x i64], [9 x i64]* %2, i64 0, i64 %16
%18 = load i64, i64* %17
%19 = call i32 @_float32_unpack(i64 %18)
%20 = call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i64 %14, i32 %19)
br label %21
21: ; preds = %10
%22 = load i32, i32* %4
%23 = add nsw i32 %22, 1
store i32 %23, i32* %4
br label %6
24: ; preds = %6
ret i32 0
}

LLVM IR (-O2):
@.str = [20 x i8] c"testpack(%ld, %f);\0A\00"
define i32 @main() {
%1 = tail call i32 @_float32_unpack(i64 -535612621)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i64 -535612621, i32 %1)
%3 = tail call i32 @_float32_unpack(i64 -535822336)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i64 -535822336, i32 %3)
%5 = tail call i32 @_float32_unpack(i64 -537919488)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i64 -537919488, i32 %5)
%7 = tail call i32 @_float32_unpack(i64 1610612736)
%8 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i64 1610612736, i32 %7)
%9 = tail call i32 @_float32_unpack(i64 1609564160)
%10 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i64 1609564160, i32 %9)
%11 = tail call i32 @_float32_unpack(i64 1611661312)
%12 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i64 1611661312, i32 %11)
%13 = tail call i32 @_float32_unpack(i64 1611871027)
%14 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i64 1611871027, i32 %13)
%15 = tail call i32 @_float32_unpack(i64 2147483647)
%16 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i64 2147483647, i32 %15)
%17 = tail call i32 @_float32_unpack(i64 -2147483648)
%18 = tail call i32 @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0), i64 -2147483648, i32 %17)
ret i32 0
}