#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*/ fprintf(int /*<<< orphan*/, char *, char *, int);
int /*<<< orphan*/ stderr;
int convert_float(float a) {
  if ((a < -1.0) || (a > 1.0)) {
    fprintf(stderr, "[%s:%d] Error: given float is not in [-1..1]\n",
            "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
            "2022-01-22/02-19-57/repos/super7ramp/Leonard/refs/heads/master/"
            "src/com/at-commands.c",
            14);
    return 0;
  } else
    return *(int *)(&a);
}


x86 assembly (clang, -O0):
<convert_float>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm1
movsd  0xed2(%rip),%xmm0
ucomisd %xmm1,%xmm0
ja     1153 <convert_float+0x43>
movss  -0x8(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xebf(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1180 <convert_float+0x70>
mov    0x2e86(%rip),%rax
mov    (%rax),%edi
lea    0xead(%rip),%rsi
lea    0xed4(%rip),%rdx
mov    $0xe,%ecx
call   1030 <fprintf@plt>
movl   $0x0,-0x4(%rbp)
jmp    1186 <convert_float+0x76>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<convert_float>:
push   %rax
movss  0xee7(%rip),%xmm1
ucomiss %xmm0,%xmm1
ja     112d <convert_float+0x1d>
ucomiss 0xedf(%rip),%xmm0
ja     112d <convert_float+0x1d>
movd   %xmm0,%eax
pop    %rcx
ret
mov    0x2eac(%rip),%rax
mov    (%rax),%edi
lea    0xecb(%rip),%rsi
lea    0xef2(%rip),%rdx
mov    $0xe,%ecx
call   1030 <fprintf@plt>
xor    %eax,%eax
pop    %rcx
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [46 x i8] c"[%s:%d] Error: given float is not in [-1..1]\0A\00"
@.str.1 = [149 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/super7ramp/Leonard/refs/heads/master/src/com/at-commands.c\00"
define i32 @convert_float(float %0) {
%2 = alloca i32
%3 = alloca float
store float %0, float* %3
%4 = load float, float* %3
%5 = fpext float %4 to double
%6 = fcmp olt double %5, -1.000000e+00
br i1 %6, label %11, label %7
7: ; preds = %1
%8 = load float, float* %3
%9 = fpext float %8 to double
%10 = fcmp ogt double %9, 1.000000e+00
br i1 %10, label %11, label %14
11: ; preds = %7, %1
%12 = load i32, i32* @stderr
%13 = call i32 @fprintf(i32 %12, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([149 x i8], [149 x i8]* @.str.1, i64 0, i64 0), i32 14)
store i32 0, i32* %2
br label %17
14: ; preds = %7
%15 = bitcast float* %3 to i32*
%16 = load i32, i32* %15
store i32 %16, i32* %2
br label %17
17: ; preds = %14, %11
%18 = load i32, i32* %2
ret i32 %18
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [46 x i8] c"[%s:%d] Error: given float is not in [-1..1]\0A\00"
@.str.1 = [149 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/super7ramp/Leonard/refs/heads/master/src/com/at-commands.c\00"
define i32 @convert_float(float %0) {
%2 = fcmp olt float %0, -1.000000e+00
%3 = fcmp ogt float %0, 1.000000e+00
%4 = or i1 %2, %3
br i1 %4, label %5, label %8
5: ; preds = %1
%6 = load i32, i32* @stderr
%7 = tail call i32 @fprintf(i32 %6, i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([149 x i8], [149 x i8]* @.str.1, i64 0, i64 0), i32 14)
br label %10
8: ; preds = %1
%9 = bitcast float %0 to i32
br label %10
10: ; preds = %8, %5
%11 = phi i32 [ 0, %5 ], [ %9, %8 ]
ret i32 %11
}