#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_pack(float);
int /*<<< orphan*/ printf(char *, float, int /*<<< orphan*/);
int main(void) {
  float src[] = {
      -1.2f, -1.0f, -0.5f, +0.0f, +0.5f, +1.0f, +1.2f,
  };
  int size = sizeof(src) / sizeof(*src);
  for (int i = 0; i < size; i++) {
    printf("test(%f, %ld);\n", src[i], _float32_pack(src[i]));
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
mov    0xeca(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0xec7(%rip),%rax
mov    %rax,-0x18(%rbp)
mov    0xec4(%rip),%rax
mov    %rax,-0x10(%rbp)
mov    0xec2(%rip),%eax
mov    %eax,-0x8(%rbp)
movl   $0x7,-0x24(%rbp)
movl   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%eax
cmp    -0x24(%rbp),%eax
jge    11b2 <main+0x92>
movslq -0x28(%rbp),%rax
movss  -0x20(%rbp,%rax,4),%xmm0
movss  %xmm0,-0x2c(%rbp)
movslq -0x28(%rbp),%rax
movss  -0x20(%rbp,%rax,4),%xmm0
call   1040 <_float32_pack@plt>
movss  -0x2c(%rbp),%xmm0
mov    %eax,%esi
lea    0xe7d(%rip),%rdi
call   1030 <printf@plt>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    1167 <main+0x47>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbx
movss  0xed7(%rip),%xmm0
call   1040 <_float32_pack@plt>
lea    0xee3(%rip),%rbx
mov    %rbx,%rdi
movss  0xec0(%rip),%xmm0
mov    %eax,%esi
call   1030 <printf@plt>
movss  0xeb5(%rip),%xmm0
call   1040 <_float32_pack@plt>
mov    %rbx,%rdi
movss  0xea5(%rip),%xmm0
mov    %eax,%esi
call   1030 <printf@plt>
movss  0xe9a(%rip),%xmm0
call   1040 <_float32_pack@plt>
mov    %rbx,%rdi
movss  0xe8a(%rip),%xmm0
mov    %eax,%esi
call   1030 <printf@plt>
xorps  %xmm0,%xmm0
call   1040 <_float32_pack@plt>
xorps  %xmm0,%xmm0
mov    %rbx,%rdi
mov    %eax,%esi
call   1030 <printf@plt>
movss  0xe6a(%rip),%xmm0
call   1040 <_float32_pack@plt>
mov    %rbx,%rdi
movss  0xe5a(%rip),%xmm0
mov    %eax,%esi
call   1030 <printf@plt>
movss  0xe4f(%rip),%xmm0
call   1040 <_float32_pack@plt>
mov    %rbx,%rdi
movss  0xe3f(%rip),%xmm0
mov    %eax,%esi
call   1030 <printf@plt>
movss  0xe34(%rip),%xmm0
call   1040 <_float32_pack@plt>
mov    %rbx,%rdi
movss  0xe24(%rip),%xmm0
mov    %eax,%esi
call   1030 <printf@plt>
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
@__const.main.src = [7 x float] [float 0xBFF3333340000000, float -1.000000e+00, float -5.000000e-01, float 0.000000e+00, float 5.000000e-01, float 1.000000e+00, float 0x3FF3333340000000]
@.str = [16 x i8] c"test(%f, %ld);\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [7 x float]
%3 = alloca i32
%4 = alloca i32
store i32 0, i32* %1
%5 = bitcast [7 x float]* %2 to i8*
store i32 7, 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 [7 x float], [7 x float]* %2, i64 0, i64 %12
%14 = load float, float* %13
%15 = load i32, i32* %4
%16 = sext i32 %15 to i64
%17 = getelementptr inbounds [7 x float], [7 x float]* %2, i64 0, i64 %16
%18 = load float, float* %17
%19 = call i32 @_float32_pack(float %18)
%20 = call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), float %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 = [16 x i8] c"test(%f, %ld);\0A\00"
define i32 @main() {
%1 = tail call i32 @_float32_pack(float 0xBFF3333340000000)
%2 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), float 0xBFF3333340000000, i32 %1)
%3 = tail call i32 @_float32_pack(float -1.000000e+00)
%4 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), float -1.000000e+00, i32 %3)
%5 = tail call i32 @_float32_pack(float -5.000000e-01)
%6 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), float -5.000000e-01, i32 %5)
%7 = tail call i32 @_float32_pack(float 0.000000e+00)
%8 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), float 0.000000e+00, i32 %7)
%9 = tail call i32 @_float32_pack(float 5.000000e-01)
%10 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), float 5.000000e-01, i32 %9)
%11 = tail call i32 @_float32_pack(float 1.000000e+00)
%12 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), float 1.000000e+00, i32 %11)
%13 = tail call i32 @_float32_pack(float 0x3FF3333340000000)
%14 = tail call i32 @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str, i64 0, i64 0), float 0x3FF3333340000000, i32 %13)
ret i32 0
}