#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 fct(float f) {
  float t = 1;
  float n = f;
  while (n != 1) {
    t = t * n;
    n--;
  }
  if (t > 9999999 || t < -9999999) {
    printf("ERROR 5");
    printf("\n\n");
    exit(0);
  } else {
    return t;
  }
}


x86 assembly (clang, -O0):
<fct>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movss  %xmm0,-0x4(%rbp)
movss  0xecb(%rip),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x4(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0xc(%rbp),%xmm0
movss  0xeaf(%rip),%xmm1
ucomiss %xmm1,%xmm0
jne    1165 <fct+0x45>
jp     1165 <fct+0x45>
jmp    118b <fct+0x6b>
movss  -0x8(%rbp),%xmm0
mulss  -0xc(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  0xe90(%rip),%xmm0
addss  -0xc(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
jmp    1144 <fct+0x24>
movss  -0x8(%rbp),%xmm0
movss  0xe6c(%rip),%xmm1
ucomiss %xmm1,%xmm0
ja     11b3 <fct+0x93>
movss  0xe5f(%rip),%xmm0
ucomiss -0x8(%rbp),%xmm0
jbe    11d2 <fct+0xb2>
lea    0xe56(%rip),%rdi
call   1030 <printf@plt>
lea    0xe52(%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):
<fct>:
push   %rax
movaps %xmm0,%xmm1
movss  0xec4(%rip),%xmm0
ucomiss %xmm0,%xmm1
jne    1143 <fct+0x13>
jnp    116f <fct+0x3f>
movss  0xeb5(%rip),%xmm2
movss  0xeb1(%rip),%xmm3
movaps %xmm2,%xmm0
cs nopw 0x0(%rax,%rax,1)
mulss  %xmm1,%xmm0
addss  %xmm3,%xmm1
ucomiss %xmm2,%xmm1
jne    1160 <fct+0x30>
jp     1160 <fct+0x30>
ucomiss 0xe92(%rip),%xmm0
ja     1187 <fct+0x57>
movss  0xe8c(%rip),%xmm1
ucomiss %xmm0,%xmm1
ja     1187 <fct+0x57>
pop    %rax
ret
lea    0xe82(%rip),%rdi
call   1040 <printf@plt>
lea    0xe7e(%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 @fct(float %0) {
%2 = alloca float
%3 = alloca float
%4 = alloca float
store float %0, float* %2
store float 1.000000e+00, float* %3
%5 = load float, float* %2
store float %5, float* %4
br label %6
6: ; preds = %9, %1
%7 = load float, float* %4
%8 = fcmp une float %7, 1.000000e+00
br i1 %8, label %9, label %15
9: ; preds = %6
%10 = load float, float* %3
%11 = load float, float* %4
%12 = fmul float %10, %11
store float %12, float* %3
%13 = load float, float* %4
%14 = fadd float %13, -1.000000e+00
store float %14, float* %4
br label %6
15: ; preds = %6
%16 = load float, float* %3
%17 = fcmp ogt float %16, 0x416312CFE0000000
br i1 %17, label %21, label %18
18: ; preds = %15
%19 = load float, float* %3
%20 = fcmp olt float %19, 0xC16312CFE0000000
br i1 %20, label %21, label %25
21: ; preds = %18, %15
%22 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%23 = call i32 @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%24 = call i32 @exit(i32 0)
unreachable
25: ; preds = %18
%26 = load float, float* %3
ret float %26
}

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