#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 exp(double);
int /*<<< orphan*/ floor(double);
int /*<<< orphan*/ printf(char *, ...);
int main(int argc, char **argv) {
  double y;
  int debug;
  if (argc < 2)
    debug = 0;
  else
    debug = 1;
  if (!debug)
    printf("{ ");
  for (int x = 0; x <= 100; x++) {
    y = exp((double)(x - 40) / 13) - 1;
    if (y < 0)
      y = 0;
    if (y > 100)
      y = 100;
    if (debug)
      printf("P(%d)=%04.1f\n", x, y);
    else
      printf("%.0lf, ", floor(y));
  }
  if (!debug)
    printf("};\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    115c <main+0x2c>
movl   $0x0,-0x1c(%rbp)
jmp    1163 <main+0x33>
movl   $0x1,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jne    117b <main+0x4b>
lea    0xe9c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movl   $0x0,-0x20(%rbp)
cmpl   $0x64,-0x20(%rbp)
jg     123f <main+0x10f>
mov    -0x20(%rbp),%eax
sub    $0x28,%eax
cvtsi2sd %eax,%xmm0
movsd  0xe62(%rip),%xmm1
divsd  %xmm1,%xmm0
call   1040 <exp@plt>
sub    $0x1,%eax
cvtsi2sd %eax,%xmm0
movsd  %xmm0,-0x18(%rbp)
xorps  %xmm0,%xmm0
ucomisd -0x18(%rbp),%xmm0
jbe    11c9 <main+0x99>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x18(%rbp)
movsd  -0x18(%rbp),%xmm0
movsd  0xe32(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    11ed <main+0xbd>
movsd  0xe20(%rip),%xmm0
movsd  %xmm0,-0x18(%rbp)
cmpl   $0x0,-0x1c(%rbp)
je     1212 <main+0xe2>
mov    -0x20(%rbp),%esi
movsd  -0x18(%rbp),%xmm0
lea    0xe0d(%rip),%rdi
mov    $0x1,%al
call   1030 <printf@plt>
jmp    122c <main+0xfc>
movsd  -0x18(%rbp),%xmm0
call   1050 <floor@plt>
mov    %eax,%esi
lea    0xdfc(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1231 <main+0x101>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1182 <main+0x52>
cmpl   $0x0,-0x1c(%rbp)
jne    1257 <main+0x127>
lea    0xdd9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edi,%ebp
cmp    $0x1,%edi
jg     115c <main+0x1c>
lea    0xebb(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xebe(%rip),%r14
lea    0xea9(%rip),%r15
xor    %ebx,%ebx
jmp    1184 <main+0x44>
xchg   %ax,%ax
mov    %r15,%rdi
mov    %ebx,%esi
mov    $0x1,%al
call   1040 <printf@plt>
add    $0x1,%ebx
cmp    $0x65,%ebx
je     11e3 <main+0xa3>
lea    -0x28(%rbx),%eax
xorps  %xmm0,%xmm0
cvtsi2sd %eax,%xmm0
divsd  0xe6a(%rip),%xmm0
call   1050 <exp@plt>
xorpd  %xmm1,%xmm1
test   %eax,%eax
jle    11ad <main+0x6d>
add    $0xffffffff,%eax
xorps  %xmm1,%xmm1
cvtsi2sd %eax,%xmm1
movsd  0xe53(%rip),%xmm0
minsd  %xmm1,%xmm0
cmp    $0x1,%ebp
jg     1170 <main+0x30>
call   1060 <floor@plt>
mov    %r14,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1040 <printf@plt>
add    $0x1,%ebx
cmp    $0x65,%ebx
jne    1184 <main+0x44>
lea    0xe4b(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"{ \00"
@.str.1 = [14 x i8] c"P(%d)=%04.1f\0A\00"
@.str.2 = [8 x i8] c"%.0lf, \00"
@.str.3 = [4 x i8] c"};\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca double
%7 = alloca i32
%8 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%9 = load i32, i32* %4
%10 = icmp slt i32 %9, 2
br i1 %10, label %11, label %12
11: ; preds = %2
store i32 0, i32* %7
br label %13
12: ; preds = %2
store i32 1, i32* %7
br label %13
13: ; preds = %12, %11
%14 = load i32, i32* %7
%15 = icmp ne i32 %14, 0
br i1 %15, label %18, label %16
16: ; preds = %13
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
br label %18
18: ; preds = %16, %13
store i32 0, i32* %8
br label %19
19: ; preds = %49, %18
%20 = load i32, i32* %8
%21 = icmp sle i32 %20, 100
br i1 %21, label %22, label %52
22: ; preds = %19
%23 = load i32, i32* %8
%24 = sub nsw i32 %23, 40
%25 = sitofp i32 %24 to double
%26 = fdiv double %25, 1.300000e+01
%27 = call i32 @exp(double %26)
%28 = sub nsw i32 %27, 1
%29 = sitofp i32 %28 to double
store double %29, double* %6
%30 = load double, double* %6
%31 = fcmp olt double %30, 0.000000e+00
br i1 %31, label %32, label %33
32: ; preds = %22
store double 0.000000e+00, double* %6
br label %33
33: ; preds = %32, %22
%34 = load double, double* %6
%35 = fcmp ogt double %34, 1.000000e+02
br i1 %35, label %36, label %37
36: ; preds = %33
store double 1.000000e+02, double* %6
br label %37
37: ; preds = %36, %33
%38 = load i32, i32* %7
%39 = icmp ne i32 %38, 0
br i1 %39, label %40, label %44
40: ; preds = %37
%41 = load i32, i32* %8
%42 = load double, double* %6
%43 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 %41, double %42)
br label %48
44: ; preds = %37
%45 = load double, double* %6
%46 = call i32 @floor(double %45)
%47 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i32 %46)
br label %48
48: ; preds = %44, %40
br label %49
49: ; preds = %48
%50 = load i32, i32* %8
%51 = add nsw i32 %50, 1
store i32 %51, i32* %8
br label %19
52: ; preds = %19
%53 = load i32, i32* %7
%54 = icmp ne i32 %53, 0
br i1 %54, label %57, label %55
55: ; preds = %52
%56 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
br label %57
57: ; preds = %55, %52
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"{ \00"
@.str.1 = [14 x i8] c"P(%d)=%04.1f\0A\00"
@.str.2 = [8 x i8] c"%.0lf, \00"
@str = [3 x i8] c"};\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = icmp slt i32 %0, 2
br i1 %3, label %4, label %6
4: ; preds = %2
%5 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0))
br label %6
6: ; preds = %4, %2
br label %7
7: ; preds = %24, %6
%8 = phi i32 [ 0, %6 ], [ %25, %24 ]
%9 = add nsw i32 %8, -40
%10 = sitofp i32 %9 to double
%11 = fdiv double %10, 1.300000e+01
%12 = tail call i32 @exp(double %11)
%13 = add nsw i32 %12, -1
%14 = sitofp i32 %13 to double
%15 = icmp slt i32 %12, 1
%16 = select i1 %15, double 0.000000e+00, double %14
%17 = fcmp ogt double %16, 1.000000e+02
%18 = select i1 %17, double 1.000000e+02, double %16
br i1 %3, label %19, label %26
19: ; preds = %7
%20 = tail call i32 @floor(double %18)
%21 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), i32 %20)
%22 = add nuw nsw i32 %8, 1
%23 = icmp eq i32 %22, 101
br i1 %23, label %30, label %24
24: ; preds = %19, %26
%25 = phi i32 [ %22, %19 ], [ %28, %26 ]
br label %7
26: ; preds = %7
%27 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0), i32 %8, double %18)
%28 = add nuw nsw i32 %8, 1
%29 = icmp eq i32 %28, 101
br i1 %29, label %32, label %24
30: ; preds = %19
%31 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0))
br label %32
32: ; preds = %26, %30
ret i32 0
}