#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 */
double INFINITY;
void **arghandler(int, char const **);
double *calloc(unsigned int, int);
scalar_t__ evolution(double *, unsigned int, double);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, double);
int /*<<< orphan*/ printf(char *, int, double);
int /*<<< orphan*/ stderr;
int main(int argc, const char *argv[]) {
  void **args;
  int i;
  unsigned int N;
  double K, C, h, a, L, T0, T1;
  h = 0.001;
  args = arghandler(argc, argv);
  K = *(double *)args[0];
  L = *(double *)args[1];
  N = *(unsigned int *)args[2];
  T0 = *(double *)args[3];
  T1 = *(double *)args[4];
  double *bar;
  bar = calloc(N, sizeof(double));
  bar[0] = T0;
  bar[N - 1] = T1;
  for (i = 1; i < N - 1; i++)
    bar[i] = (bar[0] + bar[N - 1]) / 2;
  a = L / N;
  C = K * h / a / a;
  if (C > 0.5)
    fprintf(stderr,
            "Value of C higher than 0.5: %lf Might give wrong results\n", C);
  else if (C < 5e-4)
    fprintf(stderr,
            "Value of C lower than 0.0005: %lf Might give wrong results\n", C);
  while (evolution(bar, N, C)) {
    if (bar[1] == INFINITY) {
      C /= 10;
      fprintf(stderr, "WARNING: ALGORITHM DIVERGED. TRYING WITH LOWER C: %lf\n",
              C);
      for (i = 1; i < N - 1; i++)
        bar[i] = (bar[0] + bar[N - 1]) / 2;
    }
  }
  for (i = 0; i < N; i++)
    printf("%d\t%lf\n", i, bar[i]);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movsd  0xe92(%rip),%xmm0
movsd  %xmm0,-0x38(%rbp)
mov    -0x8(%rbp),%edi
mov    -0x10(%rbp),%rsi
call   1070 <arghandler@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    (%rax),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x28(%rbp)
mov    -0x18(%rbp),%rax
mov    0x8(%rax),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x48(%rbp)
mov    -0x18(%rbp),%rax
mov    0x10(%rax),%rax
mov    (%rax),%eax
mov    %eax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
mov    0x18(%rax),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x50(%rbp)
mov    -0x18(%rbp),%rax
mov    0x20(%rax),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,-0x58(%rbp)
mov    -0x20(%rbp),%edi
mov    $0x8,%esi
call   1050 <calloc@plt>
mov    %rax,-0x60(%rbp)
movsd  -0x50(%rbp),%xmm0
mov    -0x60(%rbp),%rax
movsd  %xmm0,(%rax)
movsd  -0x58(%rbp),%xmm0
mov    -0x60(%rbp),%rax
mov    -0x20(%rbp),%ecx
sub    $0x1,%ecx
mov    %ecx,%ecx
movsd  %xmm0,(%rax,%rcx,8)
movl   $0x1,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    -0x20(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jae    125f <main+0x10f>
mov    -0x60(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x60(%rbp),%rax
mov    -0x20(%rbp),%ecx
sub    $0x1,%ecx
mov    %ecx,%ecx
addsd  (%rax,%rcx,8),%xmm0
movsd  0xde0(%rip),%xmm1
divsd  %xmm1,%xmm0
mov    -0x60(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    120e <main+0xbe>
movsd  -0x48(%rbp),%xmm0
mov    -0x20(%rbp),%eax
cvtsi2sd %rax,%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x40(%rbp)
movsd  -0x28(%rbp),%xmm0
mulsd  -0x38(%rbp),%xmm0
divsd  -0x40(%rbp),%xmm0
divsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movsd  -0x30(%rbp),%xmm0
movsd  0xd6d(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    12c4 <main+0x174>
mov    0x2d2c(%rip),%rax
mov    (%rax),%edi
movsd  -0x30(%rbp),%xmm0
lea    0xd6e(%rip),%rsi
call   1060 <fprintf@plt>
jmp    12f6 <main+0x1a6>
movsd  0xd44(%rip),%xmm0
ucomisd -0x30(%rbp),%xmm0
jbe    12f1 <main+0x1a1>
mov    0x2cfa(%rip),%rax
mov    (%rax),%edi
movsd  -0x30(%rbp),%xmm0
lea    0xd76(%rip),%rsi
call   1060 <fprintf@plt>
jmp    12f6 <main+0x1a6>
jmp    12fb <main+0x1ab>
mov    -0x60(%rbp),%rdi
mov    -0x20(%rbp),%esi
movsd  -0x30(%rbp),%xmm0
call   1030 <evolution@plt>
cmp    $0x0,%rax
je     13c8 <main+0x278>
mov    -0x60(%rbp),%rax
movsd  0x8(%rax),%xmm0
mov    0x2cc2(%rip),%rax
ucomisd (%rax),%xmm0
jne    13c3 <main+0x273>
jp     13c3 <main+0x273>
movsd  -0x30(%rbp),%xmm0
movsd  0xcd5(%rip),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x30(%rbp)
mov    0x2c85(%rip),%rax
mov    (%rax),%edi
movsd  -0x30(%rbp),%xmm0
lea    0xd3d(%rip),%rsi
call   1060 <fprintf@plt>
movl   $0x1,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
mov    -0x20(%rbp),%ecx
sub    $0x1,%ecx
cmp    %ecx,%eax
jae    13be <main+0x26e>
mov    -0x60(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x60(%rbp),%rax
mov    -0x20(%rbp),%ecx
sub    $0x1,%ecx
mov    %ecx,%ecx
addsd  (%rax,%rcx,8),%xmm0
movsd  0xc81(%rip),%xmm1
divsd  %xmm1,%xmm0
mov    -0x60(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    136d <main+0x21d>
jmp    13c3 <main+0x273>
jmp    12fb <main+0x1ab>
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x20(%rbp),%eax
jae    1405 <main+0x2b5>
mov    -0x1c(%rbp),%esi
mov    -0x60(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
lea    0xce3(%rip),%rdi
call   1040 <printf@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    13cf <main+0x27f>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
call   1070 <arghandler@plt>
mov    (%rax),%rcx
mov    0x8(%rax),%rdx
movsd  (%rcx),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  (%rdx),%xmm0
movsd  %xmm0,0x10(%rsp)
mov    0x10(%rax),%rcx
mov    (%rcx),%r14d
mov    0x18(%rax),%rcx
movsd  (%rcx),%xmm0
movsd  %xmm0,0x20(%rsp)
mov    0x20(%rax),%rax
movsd  (%rax),%xmm0
movsd  %xmm0,0x18(%rsp)
mov    %r14d,%edi
mov    $0x8,%esi
call   1050 <calloc@plt>
movsd  0x18(%rsp),%xmm1
mov    %rax,%r12
movsd  0x20(%rsp),%xmm0
movsd  %xmm0,(%rax)
mov    %r14d,%ebx
add    $0xffffffff,%ebx
movsd  %xmm1,(%rax,%rbx,8)
cmp    $0x2,%ebx
jb     12cc <main+0x17c>
movsd  (%r12),%xmm0
addsd  %xmm0,%xmm1
mulsd  0xe19(%rip),%xmm1
movsd  %xmm1,0x8(%r12)
cmp    $0x2,%ebx
je     12cc <main+0x17c>
lea    -0x2(%rbx),%rcx
lea    -0x3(%rbx),%rsi
mov    %ecx,%eax
and    $0x3,%eax
mov    $0x2,%edx
cmp    $0x3,%rsi
jb     1295 <main+0x145>
and    $0xfffffffffffffffc,%rcx
neg    %rcx
mov    $0x2,%edx
movsd  0xdd9(%rip),%xmm1
nopw   0x0(%rax,%rax,1)
movsd  (%r12,%rbx,8),%xmm2
addsd  %xmm0,%xmm2
mulsd  %xmm1,%xmm2
movsd  %xmm2,(%r12,%rdx,8)
movsd  (%r12,%rbx,8),%xmm2
addsd  %xmm0,%xmm2
mulsd  %xmm1,%xmm2
movsd  %xmm2,0x8(%r12,%rdx,8)
movsd  (%r12,%rbx,8),%xmm2
addsd  %xmm0,%xmm2
mulsd  %xmm1,%xmm2
movsd  %xmm2,0x10(%r12,%rdx,8)
movsd  (%r12,%rbx,8),%xmm2
addsd  %xmm0,%xmm2
mulsd  %xmm1,%xmm2
movsd  %xmm2,0x18(%r12,%rdx,8)
lea    (%rcx,%rdx,1),%rsi
add    $0x4,%rsi
add    $0x4,%rdx
cmp    $0x2,%rsi
jne    1230 <main+0xe0>
test   %rax,%rax
je     12cc <main+0x17c>
lea    (%r12,%rdx,8),%rcx
xor    %edx,%edx
movsd  0xd58(%rip),%xmm1
nopl   0x0(%rax,%rax,1)
movsd  (%r12,%rbx,8),%xmm2
addsd  %xmm0,%xmm2
mulsd  %xmm1,%xmm2
movsd  %xmm2,(%rcx,%rdx,8)
add    $0x1,%rdx
cmp    %rdx,%rax
jne    12b0 <main+0x160>
xorps  %xmm0,%xmm0
cvtsi2sd %r14,%xmm0
movsd  0x10(%rsp),%xmm1
divsd  %xmm0,%xmm1
movsd  0x8(%rsp),%xmm0
mulsd  0xd1c(%rip),%xmm0
divsd  %xmm1,%xmm0
divsd  %xmm1,%xmm0
ucomisd 0xd04(%rip),%xmm0
movsd  %xmm0,0x8(%rsp)
jbe    130d <main+0x1bd>
lea    0xd15(%rip),%rsi
jmp    1322 <main+0x1d2>
movsd  0xcfb(%rip),%xmm1
ucomisd %xmm0,%xmm1
jbe    1336 <main+0x1e6>
lea    0xd38(%rip),%rsi
mov    0x2caf(%rip),%rax
mov    (%rax),%edi
call   1060 <fprintf@plt>
movsd  0x8(%rsp),%xmm0
mov    %r12,%rdi
mov    %r14d,%esi
call   1030 <evolution@plt>
test   %rax,%rax
je     1481 <main+0x331>
lea    -0x1(%rbx),%rbp
lea    -0x2(%rbx),%rax
mov    %rax,0x10(%rsp)
mov    %ebp,%r13d
and    $0x3,%r13d
and    $0xfffffffffffffffc,%rbp
mov    0x2c7f(%rip),%r15
jmp    1390 <main+0x240>
nopl   0x0(%rax,%rax,1)
movsd  0x8(%rsp),%xmm0
mov    %r12,%rdi
mov    %r14d,%esi
movsd  %xmm0,0x8(%rsp)
call   1030 <evolution@plt>
test   %rax,%rax
je     1481 <main+0x331>
movsd  0x8(%r12),%xmm0
ucomisd (%r15),%xmm0
jne    1370 <main+0x220>
jp     1370 <main+0x220>
movsd  0x8(%rsp),%xmm0
divsd  0xc6a(%rip),%xmm0
mov    0x2c23(%rip),%rax
mov    (%rax),%edi
lea    0xcd8(%rip),%rsi
movsd  %xmm0,0x8(%rsp)
call   1060 <fprintf@plt>
cmp    $0x2,%ebx
jb     1370 <main+0x220>
movsd  (%r12),%xmm0
mov    $0x1,%eax
cmpq   $0x3,0x10(%rsp)
movsd  0xc19(%rip),%xmm2
jb     1451 <main+0x301>
xor    %eax,%eax
nopl   0x0(%rax,%rax,1)
movsd  (%r12,%rbx,8),%xmm1
addsd  %xmm0,%xmm1
mulsd  %xmm2,%xmm1
movsd  %xmm1,0x8(%r12,%rax,8)
movsd  (%r12,%rbx,8),%xmm1
addsd  %xmm0,%xmm1
mulsd  %xmm2,%xmm1
movsd  %xmm1,0x10(%r12,%rax,8)
movsd  (%r12,%rbx,8),%xmm1
addsd  %xmm0,%xmm1
mulsd  %xmm2,%xmm1
movsd  %xmm1,0x18(%r12,%rax,8)
movsd  (%r12,%rbx,8),%xmm1
addsd  %xmm0,%xmm1
mulsd  %xmm2,%xmm1
movsd  %xmm1,0x20(%r12,%rax,8)
add    $0x4,%rax
cmp    %rax,%rbp
jne    13f0 <main+0x2a0>
add    $0x1,%rax
test   %r13,%r13
je     1370 <main+0x220>
lea    (%r12,%rax,8),%rax
xor    %ecx,%ecx
movsd  (%r12,%rbx,8),%xmm1
addsd  %xmm0,%xmm1
mulsd  %xmm2,%xmm1
movsd  %xmm1,(%rax,%rcx,8)
add    $0x1,%rcx
cmp    %rcx,%r13
jne    1460 <main+0x310>
jmp    1370 <main+0x220>
test   %r14,%r14
je     14a9 <main+0x359>
xor    %ebx,%ebx
lea    0xc3e(%rip),%r15
nop
movsd  (%r12,%rbx,8),%xmm0
mov    %r15,%rdi
mov    %ebx,%esi
call   1040 <printf@plt>
add    $0x1,%rbx
cmp    %rbx,%r14
jne    1490 <main+0x340>
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@stderr = global i32 0
@.str = [58 x i8] c"Value of C higher than 0.5: %lf Might give wrong results\0A\00"
@.str.1 = [60 x i8] c"Value of C lower than 0.0005: %lf Might give wrong results\0A\00"
@INFINITY = global double 0.000000e+00
@.str.2 = [55 x i8] c"WARNING: ALGORITHM DIVERGED. TRYING WITH LOWER C: %lf\0A\00"
@.str.3 = [8 x i8] c"%d\09%lf\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i8**
%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 double
%16 = alloca double*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store double 1.000000e-03, double* %11
%17 = load i32, i32* %4
%18 = load i8**, i8*** %5
%19 = call i8** @arghandler(i32 %17, i8** %18)
store i8** %19, i8*** %6
%20 = load i8**, i8*** %6
%21 = getelementptr inbounds i8*, i8** %20, i64 0
%22 = load i8*, i8** %21
%23 = bitcast i8* %22 to double*
%24 = load double, double* %23
store double %24, double* %9
%25 = load i8**, i8*** %6
%26 = getelementptr inbounds i8*, i8** %25, i64 1
%27 = load i8*, i8** %26
%28 = bitcast i8* %27 to double*
%29 = load double, double* %28
store double %29, double* %13
%30 = load i8**, i8*** %6
%31 = getelementptr inbounds i8*, i8** %30, i64 2
%32 = load i8*, i8** %31
%33 = bitcast i8* %32 to i32*
%34 = load i32, i32* %33
store i32 %34, i32* %8
%35 = load i8**, i8*** %6
%36 = getelementptr inbounds i8*, i8** %35, i64 3
%37 = load i8*, i8** %36
%38 = bitcast i8* %37 to double*
%39 = load double, double* %38
store double %39, double* %14
%40 = load i8**, i8*** %6
%41 = getelementptr inbounds i8*, i8** %40, i64 4
%42 = load i8*, i8** %41
%43 = bitcast i8* %42 to double*
%44 = load double, double* %43
store double %44, double* %15
%45 = load i32, i32* %8
%46 = call double* @calloc(i32 %45, i32 8)
store double* %46, double** %16
%47 = load double, double* %14
%48 = load double*, double** %16
%49 = getelementptr inbounds double, double* %48, i64 0
store double %47, double* %49
%50 = load double, double* %15
%51 = load double*, double** %16
%52 = load i32, i32* %8
%53 = sub i32 %52, 1
%54 = zext i32 %53 to i64
%55 = getelementptr inbounds double, double* %51, i64 %54
store double %50, double* %55
store i32 1, i32* %7
br label %56
56: ; preds = %77, %2
%57 = load i32, i32* %7
%58 = load i32, i32* %8
%59 = sub i32 %58, 1
%60 = icmp ult i32 %57, %59
br i1 %60, label %61, label %80
61: ; preds = %56
%62 = load double*, double** %16
%63 = getelementptr inbounds double, double* %62, i64 0
%64 = load double, double* %63
%65 = load double*, double** %16
%66 = load i32, i32* %8
%67 = sub i32 %66, 1
%68 = zext i32 %67 to i64
%69 = getelementptr inbounds double, double* %65, i64 %68
%70 = load double, double* %69
%71 = fadd double %64, %70
%72 = fdiv double %71, 2.000000e+00
%73 = load double*, double** %16
%74 = load i32, i32* %7
%75 = sext i32 %74 to i64
%76 = getelementptr inbounds double, double* %73, i64 %75
store double %72, double* %76
br label %77
77: ; preds = %61
%78 = load i32, i32* %7
%79 = add nsw i32 %78, 1
store i32 %79, i32* %7
br label %56
80: ; preds = %56
%81 = load double, double* %13
%82 = load i32, i32* %8
%83 = uitofp i32 %82 to double
%84 = fdiv double %81, %83
store double %84, double* %12
%85 = load double, double* %9
%86 = load double, double* %11
%87 = fmul double %85, %86
%88 = load double, double* %12
%89 = fdiv double %87, %88
%90 = load double, double* %12
%91 = fdiv double %89, %90
store double %91, double* %10
%92 = load double, double* %10
%93 = fcmp ogt double %92, 5.000000e-01
br i1 %93, label %94, label %98
94: ; preds = %80
%95 = load i32, i32* @stderr
%96 = load double, double* %10
%97 = call i32 @fprintf(i32 %95, i8* getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0), double %96)
br label %106
98: ; preds = %80
%99 = load double, double* %10
%100 = fcmp olt double %99, 5.000000e-04
br i1 %100, label %101, label %105
101: ; preds = %98
%102 = load i32, i32* @stderr
%103 = load double, double* %10
%104 = call i32 @fprintf(i32 %102, i8* getelementptr inbounds ([60 x i8], [60 x i8]* @.str.1, i64 0, i64 0), double %103)
br label %105
105: ; preds = %101, %98
br label %106
106: ; preds = %105, %94
br label %107
107: ; preds = %150, %106
%108 = load double*, double** %16
%109 = load i32, i32* %8
%110 = load double, double* %10
%111 = call i64 @evolution(double* %108, i32 %109, double %110)
%112 = icmp ne i64 %111, 0
br i1 %112, label %113, label %151
113: ; preds = %107
%114 = load double*, double** %16
%115 = getelementptr inbounds double, double* %114, i64 1
%116 = load double, double* %115
%117 = load double, double* @INFINITY
%118 = fcmp oeq double %116, %117
br i1 %118, label %119, label %150
119: ; preds = %113
%120 = load double, double* %10
%121 = fdiv double %120, 1.000000e+01
store double %121, double* %10
%122 = load i32, i32* @stderr
%123 = load double, double* %10
%124 = call i32 @fprintf(i32 %122, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.2, i64 0, i64 0), double %123)
store i32 1, i32* %7
br label %125
125: ; preds = %146, %119
%126 = load i32, i32* %7
%127 = load i32, i32* %8
%128 = sub i32 %127, 1
%129 = icmp ult i32 %126, %128
br i1 %129, label %130, label %149
130: ; preds = %125
%131 = load double*, double** %16
%132 = getelementptr inbounds double, double* %131, i64 0
%133 = load double, double* %132
%134 = load double*, double** %16
%135 = load i32, i32* %8
%136 = sub i32 %135, 1
%137 = zext i32 %136 to i64
%138 = getelementptr inbounds double, double* %134, i64 %137
%139 = load double, double* %138
%140 = fadd double %133, %139
%141 = fdiv double %140, 2.000000e+00
%142 = load double*, double** %16
%143 = load i32, i32* %7
%144 = sext i32 %143 to i64
%145 = getelementptr inbounds double, double* %142, i64 %144
store double %141, double* %145
br label %146
146: ; preds = %130
%147 = load i32, i32* %7
%148 = add nsw i32 %147, 1
store i32 %148, i32* %7
br label %125
149: ; preds = %125
br label %150
150: ; preds = %149, %113
br label %107
151: ; preds = %107
store i32 0, i32* %7
br label %152
152: ; preds = %164, %151
%153 = load i32, i32* %7
%154 = load i32, i32* %8
%155 = icmp ult i32 %153, %154
br i1 %155, label %156, label %167
156: ; preds = %152
%157 = load i32, i32* %7
%158 = load double*, double** %16
%159 = load i32, i32* %7
%160 = sext i32 %159 to i64
%161 = getelementptr inbounds double, double* %158, i64 %160
%162 = load double, double* %161
%163 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i32 %157, double %162)
br label %164
164: ; preds = %156
%165 = load i32, i32* %7
%166 = add nsw i32 %165, 1
store i32 %166, i32* %7
br label %152
167: ; preds = %152
ret i32 0
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [58 x i8] c"Value of C higher than 0.5: %lf Might give wrong results\0A\00"
@.str.1 = [60 x i8] c"Value of C lower than 0.0005: %lf Might give wrong results\0A\00"
@INFINITY = global double 0.000000e+00
@.str.2 = [55 x i8] c"WARNING: ALGORITHM DIVERGED. TRYING WITH LOWER C: %lf\0A\00"
@.str.3 = [8 x i8] c"%d\09%lf\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = tail call i8** @arghandler(i32 %0, i8** %1)
%4 = bitcast i8** %3 to double**
%5 = load double*, double** %4
%6 = load double, double* %5
%7 = getelementptr inbounds i8*, i8** %3, i64 1
%8 = bitcast i8** %7 to double**
%9 = load double*, double** %8
%10 = load double, double* %9
%11 = getelementptr inbounds i8*, i8** %3, i64 2
%12 = bitcast i8** %11 to i32**
%13 = load i32*, i32** %12
%14 = load i32, i32* %13
%15 = getelementptr inbounds i8*, i8** %3, i64 3
%16 = bitcast i8** %15 to double**
%17 = load double*, double** %16
%18 = load double, double* %17
%19 = getelementptr inbounds i8*, i8** %3, i64 4
%20 = bitcast i8** %19 to double**
%21 = load double*, double** %20
%22 = load double, double* %21
%23 = tail call double* @calloc(i32 %14, i32 8)
store double %18, double* %23
%24 = add i32 %14, -1
%25 = zext i32 %24 to i64
%26 = getelementptr inbounds double, double* %23, i64 %25
store double %22, double* %26
%27 = icmp ugt i32 %24, 1
br i1 %27, label %28, label %79
28: ; preds = %2
%29 = load double, double* %23
%30 = fadd double %29, %22
%31 = fmul double %30, 5.000000e-01
%32 = getelementptr inbounds double, double* %23, i64 1
store double %31, double* %32
%33 = icmp eq i32 %24, 2
br i1 %33, label %79, label %34
34: ; preds = %28
%35 = add nsw i64 %25, -2
%36 = add nsw i64 %25, -3
%37 = and i64 %35, 3
%38 = icmp ult i64 %36, 3
br i1 %38, label %66, label %39
39: ; preds = %34
%40 = and i64 %35, -4
br label %41
41: ; preds = %41, %39
%42 = phi i64 [ 2, %39 ], [ %63, %41 ]
%43 = phi i64 [ 0, %39 ], [ %64, %41 ]
%44 = load double, double* %26
%45 = fadd double %29, %44
%46 = fmul double %45, 5.000000e-01
%47 = getelementptr inbounds double, double* %23, i64 %42
store double %46, double* %47
%48 = or i64 %42, 1
%49 = load double, double* %26
%50 = fadd double %29, %49
%51 = fmul double %50, 5.000000e-01
%52 = getelementptr inbounds double, double* %23, i64 %48
store double %51, double* %52
%53 = add nuw nsw i64 %42, 2
%54 = load double, double* %26
%55 = fadd double %29, %54
%56 = fmul double %55, 5.000000e-01
%57 = getelementptr inbounds double, double* %23, i64 %53
store double %56, double* %57
%58 = add nuw nsw i64 %42, 3
%59 = load double, double* %26
%60 = fadd double %29, %59
%61 = fmul double %60, 5.000000e-01
%62 = getelementptr inbounds double, double* %23, i64 %58
store double %61, double* %62
%63 = add nuw nsw i64 %42, 4
%64 = add i64 %43, 4
%65 = icmp eq i64 %64, %40
br i1 %65, label %66, label %41
66: ; preds = %41, %34
%67 = phi i64 [ 2, %34 ], [ %63, %41 ]
%68 = icmp eq i64 %37, 0
br i1 %68, label %79, label %69
69: ; preds = %66, %69
%70 = phi i64 [ %76, %69 ], [ %67, %66 ]
%71 = phi i64 [ %77, %69 ], [ 0, %66 ]
%72 = load double, double* %26
%73 = fadd double %29, %72
%74 = fmul double %73, 5.000000e-01
%75 = getelementptr inbounds double, double* %23, i64 %70
store double %74, double* %75
%76 = add nuw nsw i64 %70, 1
%77 = add i64 %71, 1
%78 = icmp eq i64 %77, %37
br i1 %78, label %79, label %69
79: ; preds = %66, %69, %28, %2
%80 = uitofp i32 %14 to double
%81 = fdiv double %10, %80
%82 = fmul double %6, 1.000000e-03
%83 = fdiv double %82, %81
%84 = fdiv double %83, %81
%85 = fcmp ogt double %84, 5.000000e-01
br i1 %85, label %88, label %86
86: ; preds = %79
%87 = fcmp olt double %84, 5.000000e-04
br i1 %87, label %88, label %92
88: ; preds = %86, %79
%89 = phi i8* [ getelementptr inbounds ([58 x i8], [58 x i8]* @.str, i64 0, i64 0), %79 ], [ getelementptr inbounds ([60 x i8], [60 x i8]* @.str.1, i64 0, i64 0), %86 ]
%90 = load i32, i32* @stderr
%91 = tail call i32 @fprintf(i32 %90, i8* %89, double %84)
br label %92
92: ; preds = %88, %86
%93 = tail call i64 @evolution(double* %23, i32 %14, double %84)
%94 = icmp eq i64 %93, 0
br i1 %94, label %103, label %95
95: ; preds = %92
%96 = getelementptr inbounds double, double* %23, i64 1
%97 = add nsw i64 %25, -1
%98 = add nsw i64 %25, -2
%99 = and i64 %97, 3
%100 = icmp ult i64 %98, 3
%101 = and i64 %97, -4
%102 = icmp eq i64 %99, 0
br label %107
103: ; preds = %155, %92
%104 = icmp eq i32 %14, 0
br i1 %104, label %167, label %105
105: ; preds = %103
%106 = zext i32 %14 to i64
br label %159
107: ; preds = %95, %155
%108 = phi double [ %84, %95 ], [ %156, %155 ]
%109 = load double, double* %96
%110 = load double, double* @INFINITY
%111 = fcmp oeq double %109, %110
br i1 %111, label %112, label %155
112: ; preds = %107
%113 = fdiv double %108, 1.000000e+01
%114 = load i32, i32* @stderr
%115 = tail call i32 @fprintf(i32 %114, i8* getelementptr inbounds ([55 x i8], [55 x i8]* @.str.2, i64 0, i64 0), double %113)
br i1 %27, label %116, label %155
116: ; preds = %112
%117 = load double, double* %23
br i1 %100, label %143, label %118
118: ; preds = %116, %118
%119 = phi i64 [ %140, %118 ], [ 1, %116 ]
%120 = phi i64 [ %141, %118 ], [ 0, %116 ]
%121 = load double, double* %26
%122 = fadd double %117, %121
%123 = fmul double %122, 5.000000e-01
%124 = getelementptr inbounds double, double* %23, i64 %119
store double %123, double* %124
%125 = add nuw nsw i64 %119, 1
%126 = load double, double* %26
%127 = fadd double %117, %126
%128 = fmul double %127, 5.000000e-01
%129 = getelementptr inbounds double, double* %23, i64 %125
store double %128, double* %129
%130 = add nuw nsw i64 %119, 2
%131 = load double, double* %26
%132 = fadd double %117, %131
%133 = fmul double %132, 5.000000e-01
%134 = getelementptr inbounds double, double* %23, i64 %130
store double %133, double* %134
%135 = add nuw nsw i64 %119, 3
%136 = load double, double* %26
%137 = fadd double %117, %136
%138 = fmul double %137, 5.000000e-01
%139 = getelementptr inbounds double, double* %23, i64 %135
store double %138, double* %139
%140 = add nuw nsw i64 %119, 4
%141 = add i64 %120, 4
%142 = icmp eq i64 %141, %101
br i1 %142, label %143, label %118
143: ; preds = %118, %116
%144 = phi i64 [ 1, %116 ], [ %140, %118 ]
br i1 %102, label %155, label %145
145: ; preds = %143, %145
%146 = phi i64 [ %152, %145 ], [ %144, %143 ]
%147 = phi i64 [ %153, %145 ], [ 0, %143 ]
%148 = load double, double* %26
%149 = fadd double %117, %148
%150 = fmul double %149, 5.000000e-01
%151 = getelementptr inbounds double, double* %23, i64 %146
store double %150, double* %151
%152 = add nuw nsw i64 %146, 1
%153 = add i64 %147, 1
%154 = icmp eq i64 %153, %99
br i1 %154, label %155, label %145
155: ; preds = %143, %145, %112, %107
%156 = phi double [ %108, %107 ], [ %113, %112 ], [ %113, %145 ], [ %113, %143 ]
%157 = tail call i64 @evolution(double* %23, i32 %14, double %156)
%158 = icmp eq i64 %157, 0
br i1 %158, label %103, label %107
159: ; preds = %105, %159
%160 = phi i64 [ 0, %105 ], [ %165, %159 ]
%161 = getelementptr inbounds double, double* %23, i64 %160
%162 = load double, double* %161
%163 = trunc i64 %160 to i32
%164 = tail call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i32 %163, double %162)
%165 = add nuw nsw i64 %160, 1
%166 = icmp eq i64 %165, %106
br i1 %166, label %167, label %159
167: ; preds = %159, %103
ret i32 0
}