#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 */
typedef int /*<<< orphan*/ xPoints;
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ closerFurther(double *, double *, double *, double *, int,
                                 double, int *, int *, double *);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, double, double);
int /*<<< orphan*/ guessValues(double *, double *, int, double, unsigned int,
                               double *, double *, double *);
int /*<<< orphan*/ iniCloserFurther(double *, double *, int);
int /*<<< orphan*/ iniGuessValues(double *, double *, int, double *, double *,
                                  double *);
double maxValueInArray(double *, int);
double minValueInArray(double *, int);
int /*<<< orphan*/ printf(char *, double);
int /*<<< orphan*/ yCutsLine(double, double, double, double, int, double *,
                             double *);
int main() {
  unsigned int i;
  double xPoints[] = {1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0};
  double yPoints[] = {749.0, 614.0, 518.0, 412.0, 398.0,
                      347.0, 291.0, 238.0, 338.0};
  int pointCnt = sizeof(xPoints) / sizeof(double);
  double *xCutPts = xPoints;
  double yCutPtsRet[sizeof(xPoints) / sizeof(double)];
  double xPointMax;
  double xPointMin;
  double topMostValue;
  double bottomMostValue;
  double topMostValueArray[2];
  double bottomMostValueArray[2];
  double middleValueArray[2];
  int lineValueArrayCnt = 2;
  double lineBaseValueArray[2];
  double linePossibValueArray[2];
  double lineValueArray[2];
  double lastValues[sizeof(xPoints) / sizeof(double)];
  double closestValues[sizeof(xPoints) / sizeof(double)];
  double tolerance = 0.001;
  int valueIsCloserArray[sizeof(xPoints) / sizeof(double)];
  int valueIsMostClosestArray[sizeof(xPoints) / sizeof(double)];
  double valueToTargetSum;
  FILE *ptDataFilePtr;
  FILE *lineDataFilePtr;
  xPointMax = maxValueInArray(&xPoints[0], pointCnt);
  xPointMin = minValueInArray(&xPoints[0], pointCnt);
  topMostValue = maxValueInArray(&yPoints[0], pointCnt);
  bottomMostValue = minValueInArray(&yPoints[0], pointCnt);
  ptDataFilePtr = fopen("point.dat", "wb");
  if (!ptDataFilePtr)
    return 0;
  for (i = 0; i < pointCnt; i++) {
    fprintf(ptDataFilePtr, "%f %f\n\n", xPoints[i], yPoints[i]);
  }
  fclose(ptDataFilePtr);
  lineDataFilePtr = fopen("line.dat", "wb");
  if (!lineDataFilePtr)
    return 0;
  topMostValueArray[0] = topMostValue;
  bottomMostValueArray[0] = bottomMostValue;
  topMostValueArray[1] = topMostValue;
  bottomMostValueArray[1] = bottomMostValue;
  iniGuessValues(&topMostValueArray[0], &bottomMostValueArray[0],
                 lineValueArrayCnt, &lineBaseValueArray[0],
                 &linePossibValueArray[0], &lineValueArray[0]);
  iniCloserFurther(&lastValues[0], &closestValues[0], pointCnt);
  for (i = 1; i < 50; i++) {
    yCutsLine(xPointMin, xPointMax, lineValueArray[0], lineValueArray[1],
              pointCnt, &xCutPts[0], &yCutPtsRet[0]);
    closerFurther(&yCutPtsRet[0], &yPoints[0], &lastValues[0],
                  &closestValues[0], pointCnt, tolerance,
                  &valueIsCloserArray[0], &valueIsMostClosestArray[0],
                  &valueToTargetSum);
    printf("valueToTargetSum: %f\n", valueToTargetSum);
    guessValues(&topMostValueArray[0], &bottomMostValueArray[0],
                lineValueArrayCnt, valueToTargetSum, i, &lineBaseValueArray[0],
                &linePossibValueArray[0], &lineValueArray[0]);
    fprintf(lineDataFilePtr, "%f %f\n", xPointMin, lineValueArray[0]);
    fprintf(lineDataFilePtr, "%f %f\n\n\n", xPointMax, lineValueArray[1]);
  }
  fclose(lineDataFilePtr);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x2c0,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x50(%rbp),%rdi
lea    0xe33(%rip),%rsi
mov    $0x48,%edx
call   10b0 <memcpy@plt>
lea    -0xa0(%rbp),%rdi
lea    0xe6b(%rip),%rsi
mov    $0x48,%edx
call   10b0 <memcpy@plt>
movl   $0x9,-0xa4(%rbp)
lea    -0x50(%rbp),%rax
mov    %rax,-0xb0(%rbp)
movl   $0x2,-0x154(%rbp)
movsd  0xdda(%rip),%xmm0
movsd  %xmm0,-0x238(%rbp)
ff
lea    -0x50(%rbp),%rdi
mov    -0xa4(%rbp),%esi
call   1060 <maxValueInArray@plt>
movsd  %xmm0,-0x108(%rbp)
ff
lea    -0x50(%rbp),%rdi
mov    -0xa4(%rbp),%esi
call   1040 <minValueInArray@plt>
movsd  %xmm0,-0x110(%rbp)
ff
lea    -0xa0(%rbp),%rdi
mov    -0xa4(%rbp),%esi
call   1060 <maxValueInArray@plt>
movsd  %xmm0,-0x118(%rbp)
ff
lea    -0xa0(%rbp),%rdi
mov    -0xa4(%rbp),%esi
call   1040 <minValueInArray@plt>
movsd  %xmm0,-0x120(%rbp)
ff
lea    0xe11(%rip),%rdi
lea    0xe14(%rip),%rsi
call   10d0 <fopen@plt>
mov    %rax,-0x2a0(%rbp)
cmpq   $0x0,-0x2a0(%rbp)
jne    12c4 <main+0x104>
movl   $0x0,-0x4(%rbp)
jmp    1527 <main+0x367>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
cmp    -0xa4(%rbp),%eax
jae    1310 <main+0x150>
mov    -0x2a0(%rbp),%rdi
mov    -0x8(%rbp),%eax
movsd  -0x50(%rbp,%rax,8),%xmm0
mov    -0x8(%rbp),%eax
movsd  -0xa0(%rbp,%rax,8),%xmm1
ff ff
lea    0xdb8(%rip),%rsi
call   1090 <fprintf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    12cb <main+0x10b>
mov    -0x2a0(%rbp),%rdi
call   1050 <fclose@plt>
lea    0xd9a(%rip),%rdi
lea    0xd88(%rip),%rsi
call   10d0 <fopen@plt>
mov    %rax,-0x2a8(%rbp)
cmpq   $0x0,-0x2a8(%rbp)
jne    1350 <main+0x190>
movl   $0x0,-0x4(%rbp)
jmp    1527 <main+0x367>
movsd  -0x118(%rbp),%xmm0
ff
movsd  %xmm0,-0x130(%rbp)
ff
movsd  -0x120(%rbp),%xmm0
ff
movsd  %xmm0,-0x140(%rbp)
ff
movsd  -0x118(%rbp),%xmm0
ff
movsd  %xmm0,-0x128(%rbp)
ff
movsd  -0x120(%rbp),%xmm0
ff
movsd  %xmm0,-0x138(%rbp)
ff
lea    -0x130(%rbp),%rdi
lea    -0x140(%rbp),%rsi
mov    -0x154(%rbp),%edx
lea    -0x170(%rbp),%rcx
lea    -0x180(%rbp),%r8
lea    -0x190(%rbp),%r9
call   1080 <iniGuessValues@plt>
lea    -0x1e0(%rbp),%rdi
lea    -0x230(%rbp),%rsi
mov    -0xa4(%rbp),%edx
call   1030 <iniCloserFurther@plt>
movl   $0x1,-0x8(%rbp)
cmpl   $0x32,-0x8(%rbp)
jae    1514 <main+0x354>
movsd  -0x110(%rbp),%xmm0
ff
movsd  -0x108(%rbp),%xmm1
ff
movsd  -0x190(%rbp),%xmm2
ff
movsd  -0x188(%rbp),%xmm3
ff
mov    -0xa4(%rbp),%edi
mov    -0xb0(%rbp),%rsi
lea    -0x100(%rbp),%rdx
call   10c0 <yCutsLine@plt>
lea    -0x100(%rbp),%rdi
lea    -0xa0(%rbp),%rsi
lea    -0x1e0(%rbp),%rdx
lea    -0x230(%rbp),%rcx
mov    -0xa4(%rbp),%r8d
movsd  -0x238(%rbp),%xmm0
ff
lea    -0x260(%rbp),%r9
lea    -0x290(%rbp),%r10
lea    -0x298(%rbp),%rax
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
call   10a0 <closerFurther@plt>
movsd  -0x298(%rbp),%xmm0
ff
lea    0xc48(%rip),%rdi
call   1070 <printf@plt>
lea    -0x130(%rbp),%rdi
lea    -0x140(%rbp),%rsi
mov    -0x154(%rbp),%edx
movsd  -0x298(%rbp),%xmm0
ff
mov    -0x8(%rbp),%ecx
lea    -0x170(%rbp),%r8
lea    -0x180(%rbp),%r9
lea    -0x190(%rbp),%rax
mov    %rax,(%rsp)
call   10e0 <guessValues@plt>
mov    -0x2a8(%rbp),%rdi
movsd  -0x110(%rbp),%xmm0
ff
movsd  -0x190(%rbp),%xmm1
ff
lea    0xbfe(%rip),%rsi
call   1090 <fprintf@plt>
mov    -0x2a8(%rbp),%rdi
movsd  -0x108(%rbp),%xmm0
ff
movsd  -0x188(%rbp),%xmm1
ff
lea    0xbe2(%rip),%rsi
call   1090 <fprintf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    13de <main+0x21e>
mov    -0x2a8(%rbp),%rdi
call   1050 <fclose@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x2c0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x268,%rsp
mov    0xe88(%rip),%rax
mov    %rax,0xf0(%rsp)
movaps 0xe69(%rip),%xmm0
movaps %xmm0,0xe0(%rsp)
movaps 0xe4a(%rip),%xmm0
movaps %xmm0,0xd0(%rsp)
movaps 0xe2b(%rip),%xmm0
movaps %xmm0,0xc0(%rsp)
movaps 0xe0c(%rip),%xmm0
movaps %xmm0,0xb0(%rsp)
mov    0xe8d(%rip),%rax
mov    %rax,0xa0(%rsp)
movaps 0xe6e(%rip),%xmm0
movaps %xmm0,0x90(%rsp)
movaps 0xe4f(%rip),%xmm0
movaps %xmm0,0x80(%rsp)
movaps 0xe30(%rip),%xmm0
movaps %xmm0,0x70(%rsp)
movaps 0xe14(%rip),%xmm0
movaps %xmm0,0x60(%rsp)
lea    0xb0(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x9,%esi
call   1060 <maxValueInArray@plt>
movsd  %xmm0,0x20(%rsp)
mov    %rbx,%rdi
mov    $0x9,%esi
call   1040 <minValueInArray@plt>
movsd  %xmm0,0x18(%rsp)
lea    0x60(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x9,%esi
call   1060 <maxValueInArray@plt>
movsd  %xmm0,0x58(%rsp)
mov    %rbx,%rdi
mov    $0x9,%esi
call   1040 <minValueInArray@plt>
movsd  %xmm0,0x50(%rsp)
lea    0xdf7(%rip),%rdi
lea    0xdfa(%rip),%rsi
call   10c0 <fopen@plt>
test   %rax,%rax
je     157e <main+0x3ce>
mov    %rax,%rbx
movsd  0xb0(%rsp),%xmm0
movsd  0x60(%rsp),%xmm1
lea    0xdd6(%rip),%rbp
mov    %rax,%rdi
mov    %rbp,%rsi
call   1090 <fprintf@plt>
movsd  0xb8(%rsp),%xmm0
movsd  0x68(%rsp),%xmm1
mov    %rbx,%rdi
mov    %rbp,%rsi
call   1090 <fprintf@plt>
movsd  0xc0(%rsp),%xmm0
movsd  0x70(%rsp),%xmm1
mov    %rbx,%rdi
mov    %rbp,%rsi
call   1090 <fprintf@plt>
movsd  0xc8(%rsp),%xmm0
movsd  0x78(%rsp),%xmm1
mov    %rbx,%rdi
mov    %rbp,%rsi
call   1090 <fprintf@plt>
movsd  0xd0(%rsp),%xmm0
movsd  0x80(%rsp),%xmm1
mov    %rbx,%rdi
mov    %rbp,%rsi
call   1090 <fprintf@plt>
movsd  0xd8(%rsp),%xmm0
movsd  0x88(%rsp),%xmm1
mov    %rbx,%rdi
mov    %rbp,%rsi
call   1090 <fprintf@plt>
movsd  0xe0(%rsp),%xmm0
movsd  0x90(%rsp),%xmm1
mov    %rbx,%rdi
mov    %rbp,%rsi
call   1090 <fprintf@plt>
movsd  0xe8(%rsp),%xmm0
movsd  0x98(%rsp),%xmm1
mov    %rbx,%rdi
mov    %rbp,%rsi
call   1090 <fprintf@plt>
movsd  0xf0(%rsp),%xmm0
movsd  0xa0(%rsp),%xmm1
mov    %rbx,%rdi
mov    %rbp,%rsi
call   1090 <fprintf@plt>
mov    %rbx,%rdi
call   1050 <fclose@plt>
lea    0xce5(%rip),%rdi
lea    0xcd3(%rip),%rsi
call   10c0 <fopen@plt>
test   %rax,%rax
je     157e <main+0x3ce>
mov    %rax,%rbx
movsd  0x58(%rsp),%xmm0
movsd  %xmm0,0x40(%rsp)
movsd  0x50(%rsp),%xmm1
movsd  %xmm1,0x30(%rsp)
movsd  %xmm0,0x48(%rsp)
movsd  %xmm1,0x38(%rsp)
lea    0x40(%rsp),%rdi
lea    0x30(%rsp),%rsi
lea    0x110(%rsp),%rcx
lea    0x100(%rsp),%r8
mov    %rsp,%r9
mov    $0x2,%edx
call   1080 <iniGuessValues@plt>
lea    0x1d0(%rsp),%rdi
lea    0x180(%rsp),%rsi
mov    $0x9,%edx
call   1030 <iniCloserFurther@plt>
mov    $0x1,%r12d
lea    0x220(%rsp),%rbp
lea    0xc5c(%rip),%r13
lea    0xc6b(%rip),%r14
lea    0xc6b(%rip),%r15
nopl   0x0(%rax,%rax,1)
movsd  (%rsp),%xmm2
movsd  0x8(%rsp),%xmm3
movsd  0x18(%rsp),%xmm0
movsd  0x20(%rsp),%xmm1
mov    $0x9,%edi
lea    0xb0(%rsp),%rsi
mov    %rbp,%rdx
call   10b0 <yCutsLine@plt>
mov    %rbp,%rdi
lea    0x60(%rsp),%rsi
lea    0x1d0(%rsp),%rdx
lea    0x180(%rsp),%rcx
mov    $0x9,%r8d
movsd  0xb2e(%rip),%xmm0
lea    0x150(%rsp),%r9
lea    0x28(%rsp),%rax
push   %rax
lea    0x128(%rsp),%rax
push   %rax
call   10a0 <closerFurther@plt>
add    $0x10,%rsp
movsd  0x28(%rsp),%xmm0
mov    %r13,%rdi
call   1070 <printf@plt>
movsd  0x28(%rsp),%xmm0
sub    $0x8,%rsp
lea    0x48(%rsp),%rdi
lea    0x38(%rsp),%rsi
mov    $0x2,%edx
mov    %r12d,%ecx
lea    0x118(%rsp),%r8
lea    0x108(%rsp),%r9
lea    0x8(%rsp),%rax
push   %rax
call   10d0 <guessValues@plt>
add    $0x10,%rsp
movsd  (%rsp),%xmm1
mov    %rbx,%rdi
mov    %r14,%rsi
movsd  0x18(%rsp),%xmm0
call   1090 <fprintf@plt>
movsd  0x8(%rsp),%xmm1
mov    %rbx,%rdi
mov    %r15,%rsi
movsd  0x20(%rsp),%xmm0
call   1090 <fprintf@plt>
add    $0x1,%r12d
cmp    $0x32,%r12d
jne    1480 <main+0x2d0>
mov    %rbx,%rdi
call   1050 <fclose@plt>
xor    %eax,%eax
add    $0x268,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@__const.main.xPoints = [9 x double] [double 1.000000e+00, double 2.000000e+00, double 3.000000e+00, double 4.000000e+00, double 5.000000e+00, double 6.000000e+00, double 7.000000e+00, double 8.000000e+00, double 9.000000e+00]
@__const.main.yPoints = [9 x double] [double 7.490000e+02, double 6.140000e+02, double 5.180000e+02, double 4.120000e+02, double 3.980000e+02, double 3.470000e+02, double 2.910000e+02, double 2.380000e+02, double 3.380000e+02]
@.str = [10 x i8] c"point.dat\00"
@.str.1 = [3 x i8] c"wb\00"
@.str.2 = [8 x i8] c"%f %f\0A\0A\00"
@.str.3 = [9 x i8] c"line.dat\00"
@.str.4 = [22 x i8] c"valueToTargetSum: %f\0A\00"
@.str.5 = [7 x i8] c"%f %f\0A\00"
@.str.6 = [9 x i8] c"%f %f\0A\0A\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [9 x double]
%4 = alloca [9 x double]
%5 = alloca i32
%6 = alloca double*
%7 = alloca [9 x double]
%8 = alloca double
%9 = alloca double
%10 = alloca double
%11 = alloca double
%12 = alloca [2 x double]
%13 = alloca [2 x double]
%14 = alloca [2 x double]
%15 = alloca i32
%16 = alloca [2 x double]
%17 = alloca [2 x double]
%18 = alloca [2 x double]
%19 = alloca [9 x double]
%20 = alloca [9 x double]
%21 = alloca double
%22 = alloca [9 x i32]
%23 = alloca [9 x i32]
%24 = alloca double
%25 = alloca i32*
%26 = alloca i32*
store i32 0, i32* %1
%27 = bitcast [9 x double]* %3 to i8*
%28 = bitcast [9 x double]* %4 to i8*
store i32 9, i32* %5
%29 = getelementptr inbounds [9 x double], [9 x double]* %3, i64 0, i64 0
store double* %29, double** %6
store i32 2, i32* %15
store double 1.000000e-03, double* %21
%30 = getelementptr inbounds [9 x double], [9 x double]* %3, i64 0, i64 0
%31 = load i32, i32* %5
%32 = call double @maxValueInArray(double* %30, i32 %31)
store double %32, double* %8
%33 = getelementptr inbounds [9 x double], [9 x double]* %3, i64 0, i64 0
%34 = load i32, i32* %5
%35 = call double @minValueInArray(double* %33, i32 %34)
store double %35, double* %9
%36 = getelementptr inbounds [9 x double], [9 x double]* %4, i64 0, i64 0
%37 = load i32, i32* %5
%38 = call double @maxValueInArray(double* %36, i32 %37)
store double %38, double* %10
%39 = getelementptr inbounds [9 x double], [9 x double]* %4, i64 0, i64 0
%40 = load i32, i32* %5
%41 = call double @minValueInArray(double* %39, i32 %40)
store double %41, double* %11
%42 = call i32* @fopen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
store i32* %42, i32** %25
%43 = load i32*, i32** %25
%44 = icmp ne i32* %43, null
br i1 %44, label %46, label %45
45: ; preds = %0
store i32 0, i32* %1
br label %143
46: ; preds = %0
store i32 0, i32* %2
br label %47
47: ; preds = %62, %46
%48 = load i32, i32* %2
%49 = load i32, i32* %5
%50 = icmp ult i32 %48, %49
br i1 %50, label %51, label %65
51: ; preds = %47
%52 = load i32*, i32** %25
%53 = load i32, i32* %2
%54 = zext i32 %53 to i64
%55 = getelementptr inbounds [9 x double], [9 x double]* %3, i64 0, i64 %54
%56 = load double, double* %55
%57 = load i32, i32* %2
%58 = zext i32 %57 to i64
%59 = getelementptr inbounds [9 x double], [9 x double]* %4, i64 0, i64 %58
%60 = load double, double* %59
%61 = call i32 @fprintf(i32* %52, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), double %56, double %60)
br label %62
62: ; preds = %51
%63 = load i32, i32* %2
%64 = add i32 %63, 1
store i32 %64, i32* %2
br label %47
65: ; preds = %47
%66 = load i32*, i32** %25
%67 = call i32 @fclose(i32* %66)
%68 = call i32* @fopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
store i32* %68, i32** %26
%69 = load i32*, i32** %26
%70 = icmp ne i32* %69, null
br i1 %70, label %72, label %71
71: ; preds = %65
store i32 0, i32* %1
br label %143
72: ; preds = %65
%73 = load double, double* %10
%74 = getelementptr inbounds [2 x double], [2 x double]* %12, i64 0, i64 0
store double %73, double* %74
%75 = load double, double* %11
%76 = getelementptr inbounds [2 x double], [2 x double]* %13, i64 0, i64 0
store double %75, double* %76
%77 = load double, double* %10
%78 = getelementptr inbounds [2 x double], [2 x double]* %12, i64 0, i64 1
store double %77, double* %78
%79 = load double, double* %11
%80 = getelementptr inbounds [2 x double], [2 x double]* %13, i64 0, i64 1
store double %79, double* %80
%81 = getelementptr inbounds [2 x double], [2 x double]* %12, i64 0, i64 0
%82 = getelementptr inbounds [2 x double], [2 x double]* %13, i64 0, i64 0
%83 = load i32, i32* %15
%84 = getelementptr inbounds [2 x double], [2 x double]* %16, i64 0, i64 0
%85 = getelementptr inbounds [2 x double], [2 x double]* %17, i64 0, i64 0
%86 = getelementptr inbounds [2 x double], [2 x double]* %18, i64 0, i64 0
%87 = call i32 @iniGuessValues(double* %81, double* %82, i32 %83, double* %84, double* %85, double* %86)
%88 = getelementptr inbounds [9 x double], [9 x double]* %19, i64 0, i64 0
%89 = getelementptr inbounds [9 x double], [9 x double]* %20, i64 0, i64 0
%90 = load i32, i32* %5
%91 = call i32 @iniCloserFurther(double* %88, double* %89, i32 %90)
store i32 1, i32* %2
br label %92
92: ; preds = %137, %72
%93 = load i32, i32* %2
%94 = icmp ult i32 %93, 50
br i1 %94, label %95, label %140
95: ; preds = %92
%96 = load double, double* %9
%97 = load double, double* %8
%98 = getelementptr inbounds [2 x double], [2 x double]* %18, i64 0, i64 0
%99 = load double, double* %98
%100 = getelementptr inbounds [2 x double], [2 x double]* %18, i64 0, i64 1
%101 = load double, double* %100
%102 = load i32, i32* %5
%103 = load double*, double** %6
%104 = getelementptr inbounds double, double* %103, i64 0
%105 = getelementptr inbounds [9 x double], [9 x double]* %7, i64 0, i64 0
%106 = call i32 @yCutsLine(double %96, double %97, double %99, double %101, i32 %102, double* %104, double* %105)
%107 = getelementptr inbounds [9 x double], [9 x double]* %7, i64 0, i64 0
%108 = getelementptr inbounds [9 x double], [9 x double]* %4, i64 0, i64 0
%109 = getelementptr inbounds [9 x double], [9 x double]* %19, i64 0, i64 0
%110 = getelementptr inbounds [9 x double], [9 x double]* %20, i64 0, i64 0
%111 = load i32, i32* %5
%112 = load double, double* %21
%113 = getelementptr inbounds [9 x i32], [9 x i32]* %22, i64 0, i64 0
%114 = getelementptr inbounds [9 x i32], [9 x i32]* %23, i64 0, i64 0
%115 = call i32 @closerFurther(double* %107, double* %108, double* %109, double* %110, i32 %111, double %112, i32* %113, i32* %114, double* %24)
%116 = load double, double* %24
%117 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.4, i64 0, i64 0), double %116)
%118 = getelementptr inbounds [2 x double], [2 x double]* %12, i64 0, i64 0
%119 = getelementptr inbounds [2 x double], [2 x double]* %13, i64 0, i64 0
%120 = load i32, i32* %15
%121 = load double, double* %24
%122 = load i32, i32* %2
%123 = getelementptr inbounds [2 x double], [2 x double]* %16, i64 0, i64 0
%124 = getelementptr inbounds [2 x double], [2 x double]* %17, i64 0, i64 0
%125 = getelementptr inbounds [2 x double], [2 x double]* %18, i64 0, i64 0
%126 = call i32 @guessValues(double* %118, double* %119, i32 %120, double %121, i32 %122, double* %123, double* %124, double* %125)
%127 = load i32*, i32** %26
%128 = load double, double* %9
%129 = getelementptr inbounds [2 x double], [2 x double]* %18, i64 0, i64 0
%130 = load double, double* %129
%131 = call i32 @fprintf(i32* %127, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0), double %128, double %130)
%132 = load i32*, i32** %26
%133 = load double, double* %8
%134 = getelementptr inbounds [2 x double], [2 x double]* %18, i64 0, i64 1
%135 = load double, double* %134
%136 = call i32 @fprintf(i32* %132, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0), double %133, double %135)
br label %137
137: ; preds = %95
%138 = load i32, i32* %2
%139 = add i32 %138, 1
store i32 %139, i32* %2
br label %92
140: ; preds = %92
%141 = load i32*, i32** %26
%142 = call i32 @fclose(i32* %141)
store i32 0, i32* %1
br label %143
143: ; preds = %140, %71, %45
%144 = load i32, i32* %1
ret i32 %144
}

LLVM IR (-O2):
@__const.main.xPoints = [9 x double] [double 1.000000e+00, double 2.000000e+00, double 3.000000e+00, double 4.000000e+00, double 5.000000e+00, double 6.000000e+00, double 7.000000e+00, double 8.000000e+00, double 9.000000e+00]
@__const.main.yPoints = [9 x double] [double 7.490000e+02, double 6.140000e+02, double 5.180000e+02, double 4.120000e+02, double 3.980000e+02, double 3.470000e+02, double 2.910000e+02, double 2.380000e+02, double 3.380000e+02]
@.str = [10 x i8] c"point.dat\00"
@.str.1 = [3 x i8] c"wb\00"
@.str.2 = [8 x i8] c"%f %f\0A\0A\00"
@.str.3 = [9 x i8] c"line.dat\00"
@.str.4 = [22 x i8] c"valueToTargetSum: %f\0A\00"
@.str.5 = [7 x i8] c"%f %f\0A\00"
@.str.6 = [9 x i8] c"%f %f\0A\0A\0A\00"
define i32 @main() {
%1 = alloca [9 x double]
%2 = alloca [9 x double]
%3 = alloca [9 x double]
%4 = alloca [2 x double]
%5 = alloca [2 x double]
%6 = alloca [2 x double]
%7 = alloca [2 x double]
%8 = alloca [2 x double]
%9 = alloca [9 x double]
%10 = alloca [9 x double]
%11 = alloca [9 x i32]
%12 = alloca [9 x i32]
%13 = alloca double
%14 = bitcast [9 x double]* %1 to i8*
%15 = bitcast [9 x double]* %2 to i8*
%16 = getelementptr inbounds [9 x double], [9 x double]* %1, i64 0, i64 0
%17 = bitcast [9 x double]* %3 to i8*
%18 = bitcast [2 x double]* %4 to i8*
%19 = bitcast [2 x double]* %5 to i8*
%20 = bitcast [2 x double]* %6 to i8*
%21 = bitcast [2 x double]* %7 to i8*
%22 = bitcast [2 x double]* %8 to i8*
%23 = bitcast [9 x double]* %9 to i8*
%24 = bitcast [9 x double]* %10 to i8*
%25 = bitcast [9 x i32]* %11 to i8*
%26 = bitcast [9 x i32]* %12 to i8*
%27 = bitcast double* %13 to i8*
%28 = call double @maxValueInArray(double* %16, i32 9)
%29 = call double @minValueInArray(double* %16, i32 9)
%30 = getelementptr inbounds [9 x double], [9 x double]* %2, i64 0, i64 0
%31 = call double @maxValueInArray(double* %30, i32 9)
%32 = call double @minValueInArray(double* %30, i32 9)
%33 = call i32* @fopen(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%34 = icmp eq i32* %33, null
br i1 %34, label %116, label %35
35: ; preds = %0
%36 = load double, double* %16
%37 = load double, double* %30
%38 = call i32 @fprintf(i32* %33, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), double %36, double %37)
%39 = getelementptr inbounds [9 x double], [9 x double]* %1, i64 0, i64 1
%40 = load double, double* %39
%41 = getelementptr inbounds [9 x double], [9 x double]* %2, i64 0, i64 1
%42 = load double, double* %41
%43 = call i32 @fprintf(i32* %33, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), double %40, double %42)
%44 = getelementptr inbounds [9 x double], [9 x double]* %1, i64 0, i64 2
%45 = load double, double* %44
%46 = getelementptr inbounds [9 x double], [9 x double]* %2, i64 0, i64 2
%47 = load double, double* %46
%48 = call i32 @fprintf(i32* %33, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), double %45, double %47)
%49 = getelementptr inbounds [9 x double], [9 x double]* %1, i64 0, i64 3
%50 = load double, double* %49
%51 = getelementptr inbounds [9 x double], [9 x double]* %2, i64 0, i64 3
%52 = load double, double* %51
%53 = call i32 @fprintf(i32* %33, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), double %50, double %52)
%54 = getelementptr inbounds [9 x double], [9 x double]* %1, i64 0, i64 4
%55 = load double, double* %54
%56 = getelementptr inbounds [9 x double], [9 x double]* %2, i64 0, i64 4
%57 = load double, double* %56
%58 = call i32 @fprintf(i32* %33, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), double %55, double %57)
%59 = getelementptr inbounds [9 x double], [9 x double]* %1, i64 0, i64 5
%60 = load double, double* %59
%61 = getelementptr inbounds [9 x double], [9 x double]* %2, i64 0, i64 5
%62 = load double, double* %61
%63 = call i32 @fprintf(i32* %33, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), double %60, double %62)
%64 = getelementptr inbounds [9 x double], [9 x double]* %1, i64 0, i64 6
%65 = load double, double* %64
%66 = getelementptr inbounds [9 x double], [9 x double]* %2, i64 0, i64 6
%67 = load double, double* %66
%68 = call i32 @fprintf(i32* %33, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), double %65, double %67)
%69 = getelementptr inbounds [9 x double], [9 x double]* %1, i64 0, i64 7
%70 = load double, double* %69
%71 = getelementptr inbounds [9 x double], [9 x double]* %2, i64 0, i64 7
%72 = load double, double* %71
%73 = call i32 @fprintf(i32* %33, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), double %70, double %72)
%74 = getelementptr inbounds [9 x double], [9 x double]* %1, i64 0, i64 8
%75 = load double, double* %74
%76 = getelementptr inbounds [9 x double], [9 x double]* %2, i64 0, i64 8
%77 = load double, double* %76
%78 = call i32 @fprintf(i32* %33, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.2, i64 0, i64 0), double %75, double %77)
%79 = call i32 @fclose(i32* %33)
%80 = call i32* @fopen(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0))
%81 = icmp eq i32* %80, null
br i1 %81, label %116, label %82
82: ; preds = %35
%83 = getelementptr inbounds [2 x double], [2 x double]* %4, i64 0, i64 0
store double %31, double* %83
%84 = getelementptr inbounds [2 x double], [2 x double]* %5, i64 0, i64 0
store double %32, double* %84
%85 = getelementptr inbounds [2 x double], [2 x double]* %4, i64 0, i64 1
store double %31, double* %85
%86 = getelementptr inbounds [2 x double], [2 x double]* %5, i64 0, i64 1
store double %32, double* %86
%87 = getelementptr inbounds [2 x double], [2 x double]* %6, i64 0, i64 0
%88 = getelementptr inbounds [2 x double], [2 x double]* %7, i64 0, i64 0
%89 = getelementptr inbounds [2 x double], [2 x double]* %8, i64 0, i64 0
%90 = call i32 @iniGuessValues(double* %83, double* %84, i32 2, double* %87, double* %88, double* %89)
%91 = getelementptr inbounds [9 x double], [9 x double]* %9, i64 0, i64 0
%92 = getelementptr inbounds [9 x double], [9 x double]* %10, i64 0, i64 0
%93 = call i32 @iniCloserFurther(double* %91, double* %92, i32 9)
%94 = getelementptr inbounds [2 x double], [2 x double]* %8, i64 0, i64 1
%95 = getelementptr inbounds [9 x double], [9 x double]* %3, i64 0, i64 0
%96 = getelementptr inbounds [9 x i32], [9 x i32]* %11, i64 0, i64 0
%97 = getelementptr inbounds [9 x i32], [9 x i32]* %12, i64 0, i64 0
br label %98
98: ; preds = %82, %98
%99 = phi i32 [ 1, %82 ], [ %112, %98 ]
%100 = load double, double* %89
%101 = load double, double* %94
%102 = call i32 @yCutsLine(double %29, double %28, double %100, double %101, i32 9, double* %16, double* %95)
%103 = call i32 @closerFurther(double* %95, double* %30, double* %91, double* %92, i32 9, double 1.000000e-03, i32* %96, i32* %97, double* %13)
%104 = load double, double* %13
%105 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.4, i64 0, i64 0), double %104)
%106 = load double, double* %13
%107 = call i32 @guessValues(double* %83, double* %84, i32 2, double %106, i32 %99, double* %87, double* %88, double* %89)
%108 = load double, double* %89
%109 = call i32 @fprintf(i32* %80, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.5, i64 0, i64 0), double %29, double %108)
%110 = load double, double* %94
%111 = call i32 @fprintf(i32* %80, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0), double %28, double %110)
%112 = add nuw nsw i32 %99, 1
%113 = icmp eq i32 %112, 50
br i1 %113, label %114, label %98
114: ; preds = %98
%115 = call i32 @fclose(i32* %80)
br label %116
116: ; preds = %35, %0, %114
ret i32 0
}