#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*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, float *);
int /*<<< orphan*/ system(char *);
main() {
  float n;
  float e;
  float i;
  float f;
  do {
    printf("Inserire N");
    scanf("%f", &n);
  } while (n > 100);
  do {
    f = 1;
    for (i = n; i > 0; i--) {
      f = f * i;
    }
    e = e + 1 / f;
    n--;
  } while (n > -1);
  printf("\n %f ", e);
  system("PAUSE");
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xec6(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xec3(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1050 <scanf@plt>
movss  -0x8(%rbp),%xmm0
movss  0xe96(%rip),%xmm1
ucomiss %xmm1,%xmm0
ja     113f <main+0xf>
jmp    1178 <main+0x48>
movss  0xe84(%rip),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
movss  -0x10(%rbp),%xmm0
xorps  %xmm1,%xmm1
ucomiss %xmm1,%xmm0
jbe    11c6 <main+0x96>
movss  -0x14(%rbp),%xmm0
mulss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x14(%rbp)
movss  0xe51(%rip),%xmm0
addss  -0x10(%rbp),%xmm0
movss  %xmm0,-0x10(%rbp)
jmp    118f <main+0x5f>
movss  -0xc(%rbp),%xmm0
movss  0xe31(%rip),%xmm1
divss  -0x14(%rbp),%xmm1
addss  %xmm1,%xmm0
movss  %xmm0,-0xc(%rbp)
movss  0xe1f(%rip),%xmm0
addss  -0x8(%rbp),%xmm0
movss  %xmm0,-0x8(%rbp)
movss  -0x8(%rbp),%xmm0
movss  0xe08(%rip),%xmm1
ucomiss %xmm1,%xmm0
ja     1178 <main+0x48>
movss  -0xc(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
lea    0xe01(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
lea    0xdf9(%rip),%rdi
call   1030 <system@plt>
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x10,%rsp
lea    0xecc(%rip),%r14
lea    0xed0(%rip),%r15
lea    0xc(%rsp),%rbx
nopl   0x0(%rax)
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %r15,%rdi
mov    %rbx,%rsi
call   1050 <scanf@plt>
movss  0xc(%rsp),%xmm0
ucomiss 0xe8e(%rip),%xmm0
ja     1150 <main+0x20>
movss  0xe88(%rip),%xmm1
xorps  %xmm2,%xmm2
movss  0xe81(%rip),%xmm4
jmp    11a4 <main+0x74>
nopl   0x0(%rax)
movaps %xmm1,%xmm6
divss  %xmm5,%xmm6
addss  %xmm6,%xmm3
addss  %xmm4,%xmm0
ucomiss %xmm4,%xmm0
jbe    11cf <main+0x9f>
ucomiss %xmm2,%xmm0
movaps %xmm1,%xmm5
jbe    1190 <main+0x60>
movaps %xmm1,%xmm5
movaps %xmm0,%xmm6
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mulss  %xmm6,%xmm5
addss  %xmm4,%xmm6
ucomiss %xmm2,%xmm6
ja     11c0 <main+0x90>
jmp    1190 <main+0x60>
movss  %xmm0,0xc(%rsp)
xorps  %xmm0,%xmm0
cvtss2sd %xmm3,%xmm0
lea    0xe37(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
lea    0xe2f(%rip),%rdi
call   1030 <system@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [11 x i8] c"Inserire N\00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [6 x i8] c"\0A %f \00"
@.str.3 = [6 x i8] c"PAUSE\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca float
%3 = alloca float
%4 = alloca float
%5 = alloca float
store i32 0, i32* %1
br label %6
6: ; preds = %9, %0
%7 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%8 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %2)
br label %9
9: ; preds = %6
%10 = load float, float* %2
%11 = fcmp ogt float %10, 1.000000e+02
br i1 %11, label %6, label %12
12: ; preds = %9
br label %13
13: ; preds = %32, %12
store float 1.000000e+00, float* %5
%14 = load float, float* %2
store float %14, float* %4
br label %15
15: ; preds = %22, %13
%16 = load float, float* %4
%17 = fcmp ogt float %16, 0.000000e+00
br i1 %17, label %18, label %25
18: ; preds = %15
%19 = load float, float* %5
%20 = load float, float* %4
%21 = fmul float %19, %20
store float %21, float* %5
br label %22
22: ; preds = %18
%23 = load float, float* %4
%24 = fadd float %23, -1.000000e+00
store float %24, float* %4
br label %15
25: ; preds = %15
%26 = load float, float* %3
%27 = load float, float* %5
%28 = fdiv float 1.000000e+00, %27
%29 = fadd float %26, %28
store float %29, float* %3
%30 = load float, float* %2
%31 = fadd float %30, -1.000000e+00
store float %31, float* %2
br label %32
32: ; preds = %25
%33 = load float, float* %2
%34 = fcmp ogt float %33, -1.000000e+00
br i1 %34, label %13, label %35
35: ; preds = %32
%36 = load float, float* %3
%37 = fpext float %36 to double
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), double %37)
%39 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
%40 = load i32, i32* %1
ret i32 %40
}

LLVM IR (-O2):
@.str = [11 x i8] c"Inserire N\00"
@.str.1 = [3 x i8] c"%f\00"
@.str.2 = [6 x i8] c"\0A %f \00"
@.str.3 = [6 x i8] c"PAUSE\00"
define i32 @main() {
%1 = alloca float
%2 = bitcast float* %1 to i8*
br label %3
3: ; preds = %3, %0
%4 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str, i64 0, i64 0))
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), float* %1)
%6 = load float, float* %1
%7 = fcmp ogt float %6, 1.000000e+02
br i1 %7, label %3, label %8
8: ; preds = %3, %18
%9 = phi float [ %22, %18 ], [ %6, %3 ]
%10 = phi float [ %21, %18 ], [ undef, %3 ]
%11 = fcmp ogt float %9, 0.000000e+00
br i1 %11, label %12, label %18
12: ; preds = %8, %12
%13 = phi float [ %15, %12 ], [ 1.000000e+00, %8 ]
%14 = phi float [ %16, %12 ], [ %9, %8 ]
%15 = fmul float %14, %13
%16 = fadd float %14, -1.000000e+00
%17 = fcmp ogt float %16, 0.000000e+00
br i1 %17, label %12, label %18
18: ; preds = %12, %8
%19 = phi float [ 1.000000e+00, %8 ], [ %15, %12 ]
%20 = fdiv float 1.000000e+00, %19
%21 = fadd float %10, %20
%22 = fadd float %9, -1.000000e+00
%23 = fcmp ogt float %22, -1.000000e+00
br i1 %23, label %8, label %24
24: ; preds = %18
store float %22, float* %1
%25 = fpext float %21 to double
%26 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), double %25)
%27 = call i32 @system(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
ret i32 0
}