#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 */
unsigned int atoi(char *);
int /*<<< orphan*/ exit(int);
double exponential(double);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ rand_val(int);
double strtod(char *, int /*<<< orphan*/ *);
int main(int argc, char *argv[]) {
  if (argc != 6) {
    printf(" Please provide the following arguments: simulation time, mean "
           "time between arrivals, mean service time, initial buf size, step "
           "buf size \n");
    exit(1);
  }
  unsigned int buf = atoi(argv[4]);
  unsigned int step = atoi(argv[5]);
  int cnt;
  for (cnt = 0; cnt < 10; cnt++) {
    double end_time = strtod(argv[1], NULL);
    double Ta = strtod(argv[2], NULL);
    double Ts = strtod(argv[3], NULL);
    double time = 0.0;
    double t1 = 0.0;
    double t2 = 1.0e6;
    unsigned int n = 0;
    unsigned int c = 0;
    double b = 0.0;
    double s = 0.0;
    double tn = time;
    double tb;
    double x;
    double u;
    double l;
    double w;
    rand_val(1);
    unsigned int max_buf = 0;
    while (time < end_time) {
      if (t1 < t2) {
        time = t1;
        s = s + n * (time - tn);
        n++;
        tn = time;
        t1 = time + exponential(Ta);
        if (n == 1) {
          tb = time;
          t2 = time + exponential(Ts);
        }
      } else {
        time = t2;
        s = s + n * (time - tn);
        n--;
        tn = time;
        c++;
        if (n > 0)
          t2 = time + exponential(Ts);
        else {
          t2 = 1.0e6;
          b = b + time - tb;
        }
      }
      if (max_buf < n)
        max_buf = n;
      if (n > buf) {
        break;
      }
    }
    printf("{\n");
    printf("\"P-Buf\": %d,\n", buf);
    printf("\"buf-size\": %d,\n", n);
    printf("\"max-buf\": %d,\n", max_buf);
    printf("\"hitting\": %3.2f\n", time);
    printf("}\n");
    buf = buf + 1000;
  }
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xc0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x6,-0x8(%rbp)
je     119b <main+0x3b>
lea    0xe7e(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    $0x1,%edi
call   1080 <exit@plt>
mov    -0x10(%rbp),%rax
mov    0x20(%rax),%rdi
call   1070 <atoi@plt>
mov    %eax,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    0x28(%rax),%rdi
call   1070 <atoi@plt>
mov    %eax,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpl   $0xa,-0x1c(%rbp)
jge    1495 <main+0x335>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1040 <strtod@plt>
movsd  %xmm0,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1040 <strtod@plt>
movsd  %xmm0,-0x30(%rbp)
mov    -0x10(%rbp),%rax
mov    0x18(%rax),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1040 <strtod@plt>
movsd  %xmm0,-0x38(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x40(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  0xdda(%rip),%xmm0
movsd  %xmm0,-0x50(%rbp)
movl   $0x0,-0x54(%rbp)
movl   $0x0,-0x58(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x60(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
mov    $0x1,%edi
call   1030 <rand_val@plt>
movl   $0x0,-0x9c(%rbp)
movsd  -0x40(%rbp),%xmm1
movsd  -0x28(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1417 <main+0x2b7>
movsd  -0x48(%rbp),%xmm1
movsd  -0x50(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    133f <main+0x1df>
movsd  -0x48(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x68(%rbp),%xmm1
mov    -0x54(%rbp),%eax
cvtsi2sd %rax,%xmm0
movsd  -0x40(%rbp),%xmm2
subsd  -0x70(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
mov    -0x54(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x54(%rbp)
movsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
movsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0xa8(%rbp)
ff
movsd  -0x30(%rbp),%xmm0
call   1060 <exponential@plt>
movaps %xmm0,%xmm1
movsd  -0xa8(%rbp),%xmm0
ff
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x48(%rbp)
cmpl   $0x1,-0x54(%rbp)
jne    133a <main+0x1da>
movsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x78(%rbp)
movsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0xb0(%rbp)
ff
movsd  -0x38(%rbp),%xmm0
call   1060 <exponential@plt>
movaps %xmm0,%xmm1
movsd  -0xb0(%rbp),%xmm0
ff
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
jmp    13e9 <main+0x289>
movsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x68(%rbp),%xmm1
mov    -0x54(%rbp),%eax
cvtsi2sd %rax,%xmm0
movsd  -0x40(%rbp),%xmm2
subsd  -0x70(%rbp),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
mov    -0x54(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x54(%rbp)
movsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x70(%rbp)
mov    -0x58(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x58(%rbp)
cmpl   $0x0,-0x54(%rbp)
jbe    13c3 <main+0x263>
movsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0xb8(%rbp)
ff
movsd  -0x38(%rbp),%xmm0
call   1060 <exponential@plt>
movaps %xmm0,%xmm1
movsd  -0xb8(%rbp),%xmm0
ff
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
jmp    13e4 <main+0x284>
movsd  0xc35(%rip),%xmm0
movsd  %xmm0,-0x50(%rbp)
movsd  -0x60(%rbp),%xmm0
addsd  -0x40(%rbp),%xmm0
subsd  -0x78(%rbp),%xmm0
movsd  %xmm0,-0x60(%rbp)
jmp    13e9 <main+0x289>
mov    -0x9c(%rbp),%eax
cmp    -0x54(%rbp),%eax
jae    1401 <main+0x2a1>
mov    -0x54(%rbp),%eax
mov    %eax,-0x9c(%rbp)
mov    -0x54(%rbp),%eax
cmp    -0x14(%rbp),%eax
jbe    1412 <main+0x2b2>
jmp    1417 <main+0x2b7>
jmp    1267 <main+0x107>
lea    0xc75(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x14(%rbp),%esi
lea    0xc67(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x54(%rbp),%esi
lea    0xc64(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x9c(%rbp),%esi
lea    0xc61(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movsd  -0x40(%rbp),%xmm0
lea    0xc5e(%rip),%rdi
mov    $0x1,%al
call   1050 <printf@plt>
lea    0xc62(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x3e8,%eax
mov    %eax,-0x14(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    11c2 <main+0x62>
xor    %eax,%eax
add    $0xc0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
cmp    $0x6,%edi
jne    1352 <main+0x1e2>
mov    %rsi,%rbx
mov    0x20(%rsi),%rdi
call   1080 <atoi@plt>
mov    %eax,%ebp
lea    0xeaf(%rip),%r15
xor    %r14d,%r14d
jmp    1224 <main+0xb4>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movsd  %xmm3,0x8(%rsp)
lea    0xe8c(%rip),%rdi
call   1040 <puts@plt>
lea    0xe3f(%rip),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xe3d(%rip),%rdi
mov    %r13d,%esi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xe3d(%rip),%rdi
mov    %r12d,%esi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xe3c(%rip),%rdi
movsd  0x8(%rsp),%xmm0
mov    $0x1,%al
call   1060 <printf@plt>
mov    %r15,%rdi
call   1040 <puts@plt>
add    $0x3e8,%ebp
add    $0x1,%r14d
cmp    $0xa,%r14d
je     1341 <main+0x1d1>
mov    0x8(%rbx),%rdi
xor    %esi,%esi
call   1050 <strtod@plt>
movsd  %xmm0,0x30(%rsp)
mov    0x10(%rbx),%rdi
xor    %esi,%esi
call   1050 <strtod@plt>
movsd  %xmm0,0x28(%rsp)
mov    0x18(%rbx),%rdi
xor    %esi,%esi
call   1050 <strtod@plt>
movsd  %xmm0,0x20(%rsp)
mov    $0x1,%edi
call   1030 <rand_val@plt>
xorpd  %xmm4,%xmm4
movsd  0xd93(%rip),%xmm2
xor    %r13d,%r13d
xorpd  %xmm3,%xmm3
xor    %r12d,%r12d
jmp    12cc <main+0x15c>
nopl   0x0(%rax)
movsd  %xmm2,0x10(%rsp)
movsd  0x28(%rsp),%xmm0
movsd  %xmm4,0x8(%rsp)
call   1070 <exponential@plt>
movsd  0x8(%rsp),%xmm1
movapd %xmm0,%xmm4
addsd  %xmm1,%xmm4
test   %r13d,%r13d
je     12fc <main+0x18c>
add    $0x1,%r13d
movsd  0x10(%rsp),%xmm0
movapd %xmm1,%xmm3
cmp    %r13d,%r12d
cmovb  %r13d,%r12d
movapd %xmm0,%xmm2
cmp    %ebp,%r13d
ja     11b0 <main+0x40>
movsd  0x30(%rsp),%xmm0
ucomisd %xmm3,%xmm0
jbe    11b0 <main+0x40>
ucomisd %xmm4,%xmm2
ja     1280 <main+0x110>
add    $0xffffffff,%r13d
je     132d <main+0x1bd>
movsd  %xmm4,0x18(%rsp)
movsd  %xmm2,0x8(%rsp)
movsd  %xmm2,0x10(%rsp)
jmp    130e <main+0x19e>
movsd  %xmm4,0x18(%rsp)
mov    $0x1,%r13d
movsd  %xmm1,0x10(%rsp)
movsd  0x20(%rsp),%xmm0
call   1070 <exponential@plt>
addsd  0x10(%rsp),%xmm0
movsd  0x8(%rsp),%xmm1
movsd  0x18(%rsp),%xmm4
jmp    12b4 <main+0x144>
xor    %r13d,%r13d
movsd  0xcc8(%rip),%xmm0
movapd %xmm2,%xmm1
jmp    12b4 <main+0x144>
xor    %eax,%eax
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xcf4(%rip),%rdi
call   1040 <puts@plt>
mov    $0x1,%edi
call   1090 <exit@plt>

LLVM IR (-O0):
@.str = [139 x i8] c" Please provide the following arguments: simulation time, mean time between arrivals, mean service time, initial buf size, step buf size \0A\00"
@.str.1 = [3 x i8] c"{\0A\00"
@.str.2 = [14 x i8] c"\22P-Buf\22: %d,\0A\00"
@.str.3 = [17 x i8] c"\22buf-size\22: %d,\0A\00"
@.str.4 = [16 x i8] c"\22max-buf\22: %d,\0A\00"
@.str.5 = [18 x i8] c"\22hitting\22: %3.2f\0A\00"
@.str.6 = [3 x i8] c"}\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca double
%13 = alloca double
%14 = alloca double
%15 = alloca i32
%16 = alloca i32
%17 = alloca double
%18 = alloca double
%19 = alloca double
%20 = alloca double
%21 = alloca double
%22 = alloca double
%23 = alloca double
%24 = alloca double
%25 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%26 = load i32, i32* %4
%27 = icmp ne i32 %26, 6
br i1 %27, label %28, label %31
28: ; preds = %2
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([139 x i8], [139 x i8]* @.str, i64 0, i64 0))
%30 = call i32 @exit(i32 1)
unreachable
31: ; preds = %2
%32 = load i8**, i8*** %5
%33 = getelementptr inbounds i8*, i8** %32, i64 4
%34 = load i8*, i8** %33
%35 = call i32 @atoi(i8* %34)
store i32 %35, i32* %6
%36 = load i8**, i8*** %5
%37 = getelementptr inbounds i8*, i8** %36, i64 5
%38 = load i8*, i8** %37
%39 = call i32 @atoi(i8* %38)
store i32 %39, i32* %7
store i32 0, i32* %8
br label %40
40: ; preds = %144, %31
%41 = load i32, i32* %8
%42 = icmp slt i32 %41, 10
br i1 %42, label %43, label %147
43: ; preds = %40
%44 = load i8**, i8*** %5
%45 = getelementptr inbounds i8*, i8** %44, i64 1
%46 = load i8*, i8** %45
%47 = call double @strtod(i8* %46, i32* null)
store double %47, double* %9
%48 = load i8**, i8*** %5
%49 = getelementptr inbounds i8*, i8** %48, i64 2
%50 = load i8*, i8** %49
%51 = call double @strtod(i8* %50, i32* null)
store double %51, double* %10
%52 = load i8**, i8*** %5
%53 = getelementptr inbounds i8*, i8** %52, i64 3
%54 = load i8*, i8** %53
%55 = call double @strtod(i8* %54, i32* null)
store double %55, double* %11
store double 0.000000e+00, double* %12
store double 0.000000e+00, double* %13
store double 1.000000e+06, double* %14
store i32 0, i32* %15
store i32 0, i32* %16
store double 0.000000e+00, double* %17
store double 0.000000e+00, double* %18
%56 = load double, double* %12
store double %56, double* %19
%57 = call i32 @rand_val(i32 1)
store i32 0, i32* %25
br label %58
58: ; preds = %130, %43
%59 = load double, double* %12
%60 = load double, double* %9
%61 = fcmp olt double %59, %60
br i1 %61, label %62, label %131
62: ; preds = %58
%63 = load double, double* %13
%64 = load double, double* %14
%65 = fcmp olt double %63, %64
br i1 %65, label %66, label %91
66: ; preds = %62
%67 = load double, double* %13
store double %67, double* %12
%68 = load double, double* %18
%69 = load i32, i32* %15
%70 = uitofp i32 %69 to double
%71 = load double, double* %12
%72 = load double, double* %19
%73 = fsub double %71, %72
%74 = call double @llvm.fmuladd.f64(double %70, double %73, double %68)
store double %74, double* %18
%75 = load i32, i32* %15
%76 = add i32 %75, 1
store i32 %76, i32* %15
%77 = load double, double* %12
store double %77, double* %19
%78 = load double, double* %12
%79 = load double, double* %10
%80 = call double @exponential(double %79)
%81 = fadd double %78, %80
store double %81, double* %13
%82 = load i32, i32* %15
%83 = icmp eq i32 %82, 1
br i1 %83, label %84, label %90
84: ; preds = %66
%85 = load double, double* %12
store double %85, double* %20
%86 = load double, double* %12
%87 = load double, double* %11
%88 = call double @exponential(double %87)
%89 = fadd double %86, %88
store double %89, double* %14
br label %90
90: ; preds = %84, %66
br label %119
91: ; preds = %62
%92 = load double, double* %14
store double %92, double* %12
%93 = load double, double* %18
%94 = load i32, i32* %15
%95 = uitofp i32 %94 to double
%96 = load double, double* %12
%97 = load double, double* %19
%98 = fsub double %96, %97
%99 = call double @llvm.fmuladd.f64(double %95, double %98, double %93)
store double %99, double* %18
%100 = load i32, i32* %15
%101 = add i32 %100, -1
store i32 %101, i32* %15
%102 = load double, double* %12
store double %102, double* %19
%103 = load i32, i32* %16
%104 = add i32 %103, 1
store i32 %104, i32* %16
%105 = load i32, i32* %15
%106 = icmp ugt i32 %105, 0
br i1 %106, label %107, label %112
107: ; preds = %91
%108 = load double, double* %12
%109 = load double, double* %11
%110 = call double @exponential(double %109)
%111 = fadd double %108, %110
store double %111, double* %14
br label %118
112: ; preds = %91
store double 1.000000e+06, double* %14
%113 = load double, double* %17
%114 = load double, double* %12
%115 = fadd double %113, %114
%116 = load double, double* %20
%117 = fsub double %115, %116
store double %117, double* %17
br label %118
118: ; preds = %112, %107
br label %119
119: ; preds = %118, %90
%120 = load i32, i32* %25
%121 = load i32, i32* %15
%122 = icmp ult i32 %120, %121
br i1 %122, label %123, label %125
123: ; preds = %119
%124 = load i32, i32* %15
store i32 %124, i32* %25
br label %125
125: ; preds = %123, %119
%126 = load i32, i32* %15
%127 = load i32, i32* %6
%128 = icmp ugt i32 %126, %127
br i1 %128, label %129, label %130
129: ; preds = %125
br label %131
130: ; preds = %125
br label %58
131: ; preds = %129, %58
%132 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%133 = load i32, i32* %6
%134 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i32 %133)
%135 = load i32, i32* %15
%136 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0), i32 %135)
%137 = load i32, i32* %25
%138 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0), i32 %137)
%139 = load double, double* %12
%140 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.5, i64 0, i64 0), double %139)
%141 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
%142 = load i32, i32* %6
%143 = add i32 %142, 1000
store i32 %143, i32* %6
br label %144
144: ; preds = %131
%145 = load i32, i32* %8
%146 = add nsw i32 %145, 1
store i32 %146, i32* %8
br label %40
147: ; preds = %40
ret i32 0
}

LLVM IR (-O2):
@.str.2 = [14 x i8] c"\22P-Buf\22: %d,\0A\00"
@.str.3 = [17 x i8] c"\22buf-size\22: %d,\0A\00"
@.str.4 = [16 x i8] c"\22max-buf\22: %d,\0A\00"
@.str.5 = [18 x i8] c"\22hitting\22: %3.2f\0A\00"
@str = [2 x i8] c"{\00"
@str.7 = [2 x i8] c"}\00"
@str.8 = [138 x i8] c" Please provide the following arguments: simulation time, mean time between arrivals, mean service time, initial buf size, step buf size \00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = icmp eq i32 %0, 6
br i1 %3, label %7, label %4
4: ; preds = %2
%5 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([138 x i8], [138 x i8]* @str.8, i64 0, i64 0))
%6 = tail call i32 @exit(i32 1)
unreachable
7: ; preds = %2
%8 = getelementptr inbounds i8*, i8** %1, i64 4
%9 = load i8*, i8** %8
%10 = tail call i32 @atoi(i8* %9)
%11 = getelementptr inbounds i8*, i8** %1, i64 1
%12 = getelementptr inbounds i8*, i8** %1, i64 2
%13 = getelementptr inbounds i8*, i8** %1, i64 3
br label %14
14: ; preds = %7, %55
%15 = phi i32 [ %10, %7 ], [ %65, %55 ]
%16 = phi i32 [ 0, %7 ], [ %66, %55 ]
%17 = load i8*, i8** %11
%18 = tail call double @strtod(i8* nocapture %17, i32* null)
%19 = load i8*, i8** %12
%20 = tail call double @strtod(i8* nocapture %19, i32* null)
%21 = load i8*, i8** %13
%22 = tail call double @strtod(i8* nocapture %21, i32* null)
%23 = tail call i32 @rand_val(i32 1)
br label %24
24: ; preds = %47, %14
%25 = phi double [ 1.000000e+06, %14 ], [ %48, %47 ]
%26 = phi i32 [ 0, %14 ], [ %49, %47 ]
%27 = phi double [ 0.000000e+00, %14 ], [ %50, %47 ]
%28 = phi double [ 0.000000e+00, %14 ], [ %51, %47 ]
%29 = phi i32 [ 0, %14 ], [ %53, %47 ]
%30 = fcmp olt double %28, %18
br i1 %30, label %31, label %55
31: ; preds = %24
%32 = fcmp olt double %27, %25
br i1 %32, label %33, label %38
33: ; preds = %31
%34 = add i32 %26, 1
%35 = tail call double @exponential(double %20)
%36 = fadd double %27, %35
%37 = icmp eq i32 %26, 0
br i1 %37, label %41, label %47
38: ; preds = %31
%39 = add i32 %26, -1
%40 = icmp eq i32 %39, 0
br i1 %40, label %47, label %41
41: ; preds = %38, %33
%42 = phi double [ %27, %33 ], [ %25, %38 ]
%43 = phi i32 [ 1, %33 ], [ %39, %38 ]
%44 = phi double [ %36, %33 ], [ %27, %38 ]
%45 = tail call double @exponential(double %22)
%46 = fadd double %42, %45
br label %47
47: ; preds = %41, %38, %33
%48 = phi double [ %25, %33 ], [ 1.000000e+06, %38 ], [ %46, %41 ]
%49 = phi i32 [ %34, %33 ], [ 0, %38 ], [ %43, %41 ]
%50 = phi double [ %36, %33 ], [ %27, %38 ], [ %44, %41 ]
%51 = phi double [ %27, %33 ], [ %25, %38 ], [ %42, %41 ]
%52 = icmp ult i32 %29, %49
%53 = select i1 %52, i32 %49, i32 %29
%54 = icmp ugt i32 %49, %15
br i1 %54, label %55, label %24
55: ; preds = %47, %24
%56 = phi i32 [ %49, %47 ], [ %26, %24 ]
%57 = phi double [ %51, %47 ], [ %28, %24 ]
%58 = phi i32 [ %53, %47 ], [ %29, %24 ]
%59 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str, i64 0, i64 0))
%60 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i32 %15)
%61 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0), i32 %56)
%62 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0), i32 %58)
%63 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.5, i64 0, i64 0), double %57)
%64 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([2 x i8], [2 x i8]* @str.7, i64 0, i64 0))
%65 = add i32 %15, 1000
%66 = add nuw nsw i32 %16, 1
%67 = icmp eq i32 %66, 10
br i1 %67, label %68, label %14
68: ; preds = %55
ret i32 0
}