#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*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
float abv(float f) {
  float t;
  if (f < 0) {
    t = (f * -1.0);
  } else {
    t = f;
  }
  if (t > 9999999 || t < -9999999) {
    printf("ERROR 5");
    printf("\n\n");
    exit(0);
  } else {
    return t;
  }
}


x86 assembly (clang, -O0):
<abv>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
xorps  %xmm0,%xmm0
ucomiss -0x4(%rbp),%xmm0
jbe    115d <abv+0x3d>
movss  -0x4(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0xeb5(%rip),%xmm1
mulsd  %xmm1,%xmm0
cvtsd2ss %xmm0,%xmm0
movss  %xmm0,-0x8(%rbp)
jmp    1167 <abv+0x47>
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
movss  0xe94(%rip),%xmm1
ucomiss %xmm1,%xmm0
ja     118f <abv+0x6f>
movss  0xe87(%rip),%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    11ae <abv+0x8e>
lea    0xe7a(%rip),%rdi
call   1030 <printf@plt>
lea    0xe76(%rip),%rdi
call   1030 <printf@plt>
xor    %edi,%edi
call   1040 <exit@plt>
movss  -0x8(%rbp),%xmm0
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<abv>:
push   %rax
movaps %xmm0,%xmm1
movaps 0xec5(%rip),%xmm2
xorps  %xmm0,%xmm2
xorps  %xmm3,%xmm3
cmpltss %xmm3,%xmm0
andps  %xmm0,%xmm2
andnps %xmm1,%xmm0
orps   %xmm2,%xmm0
ucomiss 0xeba(%rip),%xmm0
ja     1167 <abv+0x37>
movss  0xeb4(%rip),%xmm1
ucomiss %xmm0,%xmm1
ja     1167 <abv+0x37>
pop    %rax
ret
lea    0xeaa(%rip),%rdi
call   1040 <printf@plt>
lea    0xea6(%rip),%rdi
call   1030 <puts@plt>
xor    %edi,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@.str = [8 x i8] c"ERROR 5\00"
@.str.1 = [3 x i8] c"\0A\0A\00"
define float @abv(float %0) {
%2 = alloca float
%3 = alloca float
store float %0, float* %2
%4 = load float, float* %2
%5 = fcmp olt float %4, 0.000000e+00
br i1 %5, label %6, label %11
6: ; preds = %1
%7 = load float, float* %2
%8 = fpext float %7 to double
%9 = fmul double %8, -1.000000e+00
%10 = fptrunc double %9 to float
store float %10, float* %3
br label %13
11: ; preds = %1
%12 = load float, float* %2
store float %12, float* %3
br label %13
13: ; preds = %11, %6
%14 = load float, float* %3
%15 = fcmp ogt float %14, 0x416312CFE0000000
br i1 %15, label %19, label %16
16: ; preds = %13
%17 = load float, float* %3
%18 = fcmp olt float %17, 0xC16312CFE0000000
br i1 %18, label %19, label %23
19: ; preds = %16, %13
%20 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%21 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%22 = call i32 @exit(i32 0)
unreachable
23: ; preds = %16
%24 = load float, float* %3
ret float %24
}

LLVM IR (-O2):
@.str = [8 x i8] c"ERROR 5\00"
@str = [2 x i8] c"\0A\00"
define float @abv(float %0) {
%2 = fcmp olt float %0, 0.000000e+00
%3 = fneg float %0
%4 = select i1 %2, float %3, float %0
%5 = fcmp ogt float %4, 0x416312CFE0000000
%6 = fcmp olt float %4, 0xC16312CFE0000000
%7 = or i1 %5, %6
br i1 %7, label %8, label %12
8: ; preds = %1
%9 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%10 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
%11 = tail call i32 @exit(i32 0)
unreachable
12: ; preds = %1
ret float %4
}