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

/* Variables and functions */
int /*<<< orphan*/ SEEK_SET;
float atof(char *);
int /*<<< orphan*/ fclose(int /*<<< orphan*/ *);
scalar_t__ fgets(char *, int, int /*<<< orphan*/ *);
int /*<<< orphan*/ *fopen(char *, char *);
int /*<<< orphan*/ fseek(int /*<<< orphan*/ *, int, int /*<<< orphan*/);
int ftell(int /*<<< orphan*/ *);
int /*<<< orphan*/ printf(char *, float, float, ...);
int main(void) {
  int init_pos;
  float positive_sum = 0;
  float negative_sum = 0;
  FILE *infile;
  char price[8];
  int lines = 0;
  infile = fopen("./amzn_close.csv", "r");
  init_pos = ftell(infile);
  while (fgets(price, sizeof(price), infile) != 0) {
    price[6] = '\0';
    lines++;
  }
  fseek(infile, init_pos, SEEK_SET);
  float stocks[lines];
  int line_iterator = 0;
  while (fgets(price, sizeof(price), infile) != 0) {
    price[6] = '\0';
    stocks[line_iterator] = atof(price);
    line_iterator++;
  }
  fclose(infile);
  float circular_array[30];
  float *array_start, *array_end, *head_tail, *right_brim, *left_brim;
  head_tail = array_start = &circular_array[0];
  right_brim = &circular_array[20];
  left_brim = &circular_array[10];
  array_end = &circular_array[29];
  int i;
  for (i = 0; i < 30; i++) {
    circular_array[i] = stocks[i];
  }
  for (i = 0; i < 30 / 2; i++) {
    printf("left_brim %f; head_tail %f; right_brim %f\n\n\n", *(left_brim),
           *(head_tail), *(right_brim));
    head_tail = head_tail++;
    left_brim = left_brim++;
    right_brim = right_brim++;
    if (head_tail - array_start >= 30) {
      head_tail = array_start;
    } else if (left_brim - array_start >= 30) {
      left_brim = array_start;
    } else if (right_brim - array_start >= 30) {
      right_brim = array_start;
    }
    negative_sum -= *(left_brim);
    positive_sum += *(right_brim);
    printf("the negative_sum is %f; the positive_sum is %f \n", negative_sum,
           positive_sum);
  }
  printf("the negative_sum is %f; the positive_sum is %f \n", negative_sum,
         positive_sum);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100,%rsp
movl   $0x0,-0x4(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0xc(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x10(%rbp)
movl   $0x0,-0x24(%rbp)
lea    0xe60(%rip),%rdi
lea    0xe6a(%rip),%rsi
call   1090 <fopen@plt>
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rdi
call   1070 <ftell@plt>
mov    %eax,-0x8(%rbp)
lea    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    $0x8,%esi
call   1060 <fgets@plt>
cmp    $0x0,%rax
je     11ea <main+0x7a>
movb   $0x0,-0x1a(%rbp)
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    11bc <main+0x4c>
mov    -0x18(%rbp),%rdi
mov    -0x8(%rbp),%esi
mov    0x2de8(%rip),%rax
mov    (%rax),%edx
call   1080 <fseek@plt>
mov    -0x24(%rbp),%eax
mov    %rsp,%rcx
mov    %rcx,-0x30(%rbp)
lea    0xf(,%rax,4),%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0xf8(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x38(%rbp)
movl   $0x0,-0x3c(%rbp)
lea    -0x20(%rbp),%rdi
mov    -0x18(%rbp),%rdx
mov    $0x8,%esi
call   1060 <fgets@plt>
cmp    $0x0,%rax
je     1277 <main+0x107>
movb   $0x0,-0x1a(%rbp)
lea    -0x20(%rbp),%rdi
call   1030 <atof@plt>
mov    -0xf8(%rbp),%rax
movslq -0x3c(%rbp),%rcx
movss  %xmm0,(%rax,%rcx,4)
mov    -0x3c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x3c(%rbp)
jmp    1230 <main+0xc0>
mov    -0x18(%rbp),%rdi
call   1040 <fclose@plt>
lea    -0xc0(%rbp),%rax
mov    %rax,-0xc8(%rbp)
mov    %rax,-0xd8(%rbp)
lea    -0xc0(%rbp),%rax
add    $0x50,%rax
mov    %rax,-0xe0(%rbp)
lea    -0xc0(%rbp),%rax
add    $0x28,%rax
mov    %rax,-0xe8(%rbp)
lea    -0xc0(%rbp),%rax
add    $0x74,%rax
mov    %rax,-0xd0(%rbp)
movl   $0x0,-0xec(%rbp)
cmpl   $0x1e,-0xec(%rbp)
jge    1319 <main+0x1a9>
mov    -0xf8(%rbp),%rax
movslq -0xec(%rbp),%rcx
movss  (%rax,%rcx,4),%xmm0
movslq -0xec(%rbp),%rax
movss  %xmm0,-0xc0(%rbp,%rax,4)
ff ff
mov    -0xec(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xec(%rbp)
jmp    12d5 <main+0x165>
movl   $0x0,-0xec(%rbp)
cmpl   $0xf,-0xec(%rbp)
jge    14ac <main+0x33c>
mov    -0xe8(%rbp),%rax
movss  (%rax),%xmm0
mov    -0xd8(%rbp),%rax
movss  (%rax),%xmm1
mov    -0xe0(%rbp),%rax
movss  (%rax),%xmm2
cvtss2sd %xmm2,%xmm2
lea    0xcb7(%rip),%rdi
mov    $0x3,%al
call   1050 <printf@plt>
mov    -0xd8(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0xd8(%rbp)
mov    %rax,-0xd8(%rbp)
mov    -0xe8(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0xe8(%rbp)
mov    %rax,-0xe8(%rbp)
mov    -0xe0(%rbp),%rax
mov    %rax,%rcx
add    $0x4,%rcx
mov    %rcx,-0xe0(%rbp)
mov    %rax,-0xe0(%rbp)
mov    -0xd8(%rbp),%rax
mov    -0xc8(%rbp),%rcx
sub    %rcx,%rax
sar    $0x2,%rax
cmp    $0x1e,%rax
jl     13e9 <main+0x279>
mov    -0xc8(%rbp),%rax
mov    %rax,-0xd8(%rbp)
jmp    1452 <main+0x2e2>
mov    -0xe8(%rbp),%rax
mov    -0xc8(%rbp),%rcx
sub    %rcx,%rax
sar    $0x2,%rax
cmp    $0x1e,%rax
jl     141b <main+0x2ab>
mov    -0xc8(%rbp),%rax
mov    %rax,-0xe8(%rbp)
jmp    144d <main+0x2dd>
mov    -0xe0(%rbp),%rax
mov    -0xc8(%rbp),%rcx
sub    %rcx,%rax
sar    $0x2,%rax
cmp    $0x1e,%rax
jl     1448 <main+0x2d8>
mov    -0xc8(%rbp),%rax
mov    %rax,-0xe0(%rbp)
jmp    144d <main+0x2dd>
jmp    1452 <main+0x2e2>
mov    -0xe8(%rbp),%rax
movss  (%rax),%xmm1
movss  -0x10(%rbp),%xmm0
subss  %xmm1,%xmm0
movss  %xmm0,-0x10(%rbp)
mov    -0xe0(%rbp),%rax
movss  (%rax),%xmm0
addss  -0xc(%rbp),%xmm0
movss  %xmm0,-0xc(%rbp)
movss  -0x10(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
lea    0xbaf(%rip),%rdi
mov    $0x2,%al
call   1050 <printf@plt>
mov    -0xec(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xec(%rbp)
jmp    1323 <main+0x1b3>
movss  -0x10(%rbp),%xmm0
movss  -0xc(%rbp),%xmm1
lea    0xb83(%rip),%rdi
mov    $0x2,%al
call   1050 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x30(%rbp),%rax
mov    %rax,%rsp
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x98,%rsp
lea    0xe75(%rip),%rdi
lea    0xe7f(%rip),%rsi
call   1090 <fopen@plt>
mov    %rax,%r15
mov    %rax,%rdi
call   1070 <ftell@plt>
mov    %eax,%r14d
lea    -0x38(%rbp),%rdi
mov    $0x8,%esi
mov    %r15,%rdx
call   1060 <fgets@plt>
xor    %ebx,%ebx
test   %rax,%rax
je     11ed <main+0x7d>
lea    -0x38(%rbp),%r12
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movb   $0x0,-0x32(%rbp)
mov    %r12,%rdi
mov    $0x8,%esi
mov    %r15,%rdx
call   1060 <fgets@plt>
add    $0x1,%rbx
test   %rax,%rax
jne    11d0 <main+0x60>
mov    0x2dec(%rip),%rax
mov    (%rax),%edx
mov    %r15,%rdi
mov    %r14d,%esi
call   1080 <fseek@plt>
mov    %rsp,-0x40(%rbp)
mov    %rsp,%r14
lea    0xf(,%rbx,4),%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%r14
mov    %r14,%rsp
lea    -0x38(%rbp),%rdi
mov    $0x8,%esi
mov    %r15,%rdx
call   1060 <fgets@plt>
test   %rax,%rax
je     1269 <main+0xf9>
lea    -0x38(%rbp),%r12
mov    %r14,%rbx
nopw   0x0(%rax,%rax,1)
movb   $0x0,-0x32(%rbp)
mov    %r12,%rdi
call   1030 <atof@plt>
movss  %xmm0,(%rbx)
mov    %r12,%rdi
mov    $0x8,%esi
mov    %r15,%rdx
call   1060 <fgets@plt>
add    $0x4,%rbx
test   %rax,%rax
jne    1240 <main+0xd0>
mov    %r15,%rdi
call   1040 <fclose@plt>
lea    -0x70(%rbp),%rbx
mov    0x70(%r14),%rax
mov    %rax,-0x50(%rbp)
movaps 0x60(%r14),%xmm0
movaps %xmm0,-0x60(%rbp)
movaps 0x50(%r14),%xmm0
movaps %xmm0,-0x70(%rbp)
movaps 0x40(%r14),%xmm0
movaps %xmm0,-0x80(%rbp)
movaps (%r14),%xmm0
movaps 0x10(%r14),%xmm1
movaps 0x20(%r14),%xmm2
movaps 0x30(%r14),%xmm3
movaps %xmm3,-0x90(%rbp)
movaps %xmm2,-0xa0(%rbp)
movaps %xmm1,-0xb0(%rbp)
movaps %xmm0,-0xc0(%rbp)
xorps  %xmm0,%xmm0
movss  %xmm0,-0x30(%rbp)
mov    $0xf,%r13d
lea    -0x98(%rbp),%r12
lea    -0xc0(%rbp),%r14
lea    0xd56(%rip),%r15
xorps  %xmm0,%xmm0
movss  %xmm0,-0x2c(%rbp)
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movss  (%r12),%xmm0
movss  -0xc0(%rbp),%xmm1
ff
movss  (%rbx),%xmm2
cvtss2sd %xmm2,%xmm2
lea    0xcf6(%rip),%rdi
mov    $0x3,%al
call   1050 <printf@plt>
mov    %r12,%rax
sub    %r14,%rax
mov    %rbx,%rcx
sub    %r14,%rcx
cmp    $0x75,%rcx
mov    %rbx,%rcx
cmovge %r14,%rcx
cmp    $0x75,%rax
cmovl  %rcx,%rbx
cmovge %r14,%r12
movss  -0x2c(%rbp),%xmm0
subss  (%r12),%xmm0
movss  -0x30(%rbp),%xmm1
addss  (%rbx),%xmm1
mov    %r15,%rdi
movss  %xmm0,-0x2c(%rbp)
movss  %xmm1,-0x30(%rbp)
mov    $0x2,%al
call   1050 <printf@plt>
add    $0xffffffff,%r13d
jne    1300 <main+0x190>
lea    0xcc4(%rip),%rdi
movss  -0x2c(%rbp),%xmm0
movss  -0x30(%rbp),%xmm1
mov    $0x2,%al
call   1050 <printf@plt>
mov    -0x40(%rbp),%rsp
xor    %eax,%eax
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [17 x i8] c"./amzn_close.csv\00"
@.str.1 = [2 x i8] c"r\00"
@SEEK_SET = global i32 0
@.str.2 = [45 x i8] c"left_brim %f; head_tail %f; right_brim %f\0A\0A\0A\00"
@.str.3 = [49 x i8] c"the negative_sum is %f; the positive_sum is %f \0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca float
%4 = alloca float
%5 = alloca i32*
%6 = alloca [8 x i8]
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i64
%10 = alloca i32
%11 = alloca [30 x float]
%12 = alloca float*
%13 = alloca float*
%14 = alloca float*
%15 = alloca float*
%16 = alloca float*
%17 = alloca i32
store i32 0, i32* %1
store float 0.000000e+00, float* %3
store float 0.000000e+00, float* %4
store i32 0, i32* %7
%18 = call i32* @fopen(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
store i32* %18, i32** %5
%19 = load i32*, i32** %5
%20 = call i32 @ftell(i32* %19)
store i32 %20, i32* %2
br label %21
21: ; preds = %26, %0
%22 = getelementptr inbounds [8 x i8], [8 x i8]* %6, i64 0, i64 0
%23 = load i32*, i32** %5
%24 = call i64 @fgets(i8* %22, i32 8, i32* %23)
%25 = icmp ne i64 %24, 0
br i1 %25, label %26, label %30
26: ; preds = %21
%27 = getelementptr inbounds [8 x i8], [8 x i8]* %6, i64 0, i64 6
store i8 0, i8* %27
%28 = load i32, i32* %7
%29 = add nsw i32 %28, 1
store i32 %29, i32* %7
br label %21
30: ; preds = %21
%31 = load i32*, i32** %5
%32 = load i32, i32* %2
%33 = load i32, i32* @SEEK_SET
%34 = call i32 @fseek(i32* %31, i32 %32, i32 %33)
%35 = load i32, i32* %7
%36 = zext i32 %35 to i64
%37 = call i8* @llvm.stacksave()
store i8* %37, i8** %8
%38 = alloca float, i64 %36
store i64 %36, i64* %9
store i32 0, i32* %10
br label %39
39: ; preds = %44, %30
%40 = getelementptr inbounds [8 x i8], [8 x i8]* %6, i64 0, i64 0
%41 = load i32*, i32** %5
%42 = call i64 @fgets(i8* %40, i32 8, i32* %41)
%43 = icmp ne i64 %42, 0
br i1 %43, label %44, label %53
44: ; preds = %39
%45 = getelementptr inbounds [8 x i8], [8 x i8]* %6, i64 0, i64 6
store i8 0, i8* %45
%46 = getelementptr inbounds [8 x i8], [8 x i8]* %6, i64 0, i64 0
%47 = call float @atof(i8* %46)
%48 = load i32, i32* %10
%49 = sext i32 %48 to i64
%50 = getelementptr inbounds float, float* %38, i64 %49
store float %47, float* %50
%51 = load i32, i32* %10
%52 = add nsw i32 %51, 1
store i32 %52, i32* %10
br label %39
53: ; preds = %39
%54 = load i32*, i32** %5
%55 = call i32 @fclose(i32* %54)
%56 = getelementptr inbounds [30 x float], [30 x float]* %11, i64 0, i64 0
store float* %56, float** %12
store float* %56, float** %14
%57 = getelementptr inbounds [30 x float], [30 x float]* %11, i64 0, i64 20
store float* %57, float** %15
%58 = getelementptr inbounds [30 x float], [30 x float]* %11, i64 0, i64 10
store float* %58, float** %16
%59 = getelementptr inbounds [30 x float], [30 x float]* %11, i64 0, i64 29
store float* %59, float** %13
store i32 0, i32* %17
br label %60
60: ; preds = %71, %53
%61 = load i32, i32* %17
%62 = icmp slt i32 %61, 30
br i1 %62, label %63, label %74
63: ; preds = %60
%64 = load i32, i32* %17
%65 = sext i32 %64 to i64
%66 = getelementptr inbounds float, float* %38, i64 %65
%67 = load float, float* %66
%68 = load i32, i32* %17
%69 = sext i32 %68 to i64
%70 = getelementptr inbounds [30 x float], [30 x float]* %11, i64 0, i64 %69
store float %67, float* %70
br label %71
71: ; preds = %63
%72 = load i32, i32* %17
%73 = add nsw i32 %72, 1
store i32 %73, i32* %17
br label %60
74: ; preds = %60
store i32 0, i32* %17
br label %75
75: ; preds = %136, %74
%76 = load i32, i32* %17
%77 = icmp slt i32 %76, 15
br i1 %77, label %78, label %139
78: ; preds = %75
%79 = load float*, float** %16
%80 = load float, float* %79
%81 = load float*, float** %14
%82 = load float, float* %81
%83 = load float*, float** %15
%84 = load float, float* %83
%85 = fpext float %84 to double
%86 = call i32 (i8*, float, float, ...) @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.2, i64 0, i64 0), float %80, float %82, double %85)
%87 = load float*, float** %14
%88 = getelementptr inbounds float, float* %87, i32 1
store float* %88, float** %14
store float* %87, float** %14
%89 = load float*, float** %16
%90 = getelementptr inbounds float, float* %89, i32 1
store float* %90, float** %16
store float* %89, float** %16
%91 = load float*, float** %15
%92 = getelementptr inbounds float, float* %91, i32 1
store float* %92, float** %15
store float* %91, float** %15
%93 = load float*, float** %14
%94 = load float*, float** %12
%95 = ptrtoint float* %93 to i64
%96 = ptrtoint float* %94 to i64
%97 = sub i64 %95, %96
%98 = sdiv exact i64 %97, 4
%99 = icmp sge i64 %98, 30
br i1 %99, label %100, label %102
100: ; preds = %78
%101 = load float*, float** %12
store float* %101, float** %14
br label %124
102: ; preds = %78
%103 = load float*, float** %16
%104 = load float*, float** %12
%105 = ptrtoint float* %103 to i64
%106 = ptrtoint float* %104 to i64
%107 = sub i64 %105, %106
%108 = sdiv exact i64 %107, 4
%109 = icmp sge i64 %108, 30
br i1 %109, label %110, label %112
110: ; preds = %102
%111 = load float*, float** %12
store float* %111, float** %16
br label %123
112: ; preds = %102
%113 = load float*, float** %15
%114 = load float*, float** %12
%115 = ptrtoint float* %113 to i64
%116 = ptrtoint float* %114 to i64
%117 = sub i64 %115, %116
%118 = sdiv exact i64 %117, 4
%119 = icmp sge i64 %118, 30
br i1 %119, label %120, label %122
120: ; preds = %112
%121 = load float*, float** %12
store float* %121, float** %15
br label %122
122: ; preds = %120, %112
br label %123
123: ; preds = %122, %110
br label %124
124: ; preds = %123, %100
%125 = load float*, float** %16
%126 = load float, float* %125
%127 = load float, float* %4
%128 = fsub float %127, %126
store float %128, float* %4
%129 = load float*, float** %15
%130 = load float, float* %129
%131 = load float, float* %3
%132 = fadd float %131, %130
store float %132, float* %3
%133 = load float, float* %4
%134 = load float, float* %3
%135 = call i32 (i8*, float, float, ...) @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.3, i64 0, i64 0), float %133, float %134)
br label %136
136: ; preds = %124
%137 = load i32, i32* %17
%138 = add nsw i32 %137, 1
store i32 %138, i32* %17
br label %75
139: ; preds = %75
%140 = load float, float* %4
%141 = load float, float* %3
%142 = call i32 (i8*, float, float, ...) @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.3, i64 0, i64 0), float %140, float %141)
store i32 0, i32* %1
%143 = load i8*, i8** %8
%144 = load i32, i32* %1
ret i32 %144
}

LLVM IR (-O2):
@.str = [17 x i8] c"./amzn_close.csv\00"
@.str.1 = [2 x i8] c"r\00"
@SEEK_SET = global i32 0
@.str.2 = [45 x i8] c"left_brim %f; head_tail %f; right_brim %f\0A\0A\0A\00"
@.str.3 = [49 x i8] c"the negative_sum is %f; the positive_sum is %f \0A\00"
define i32 @main() {
%1 = alloca [8 x i8]
%2 = alloca [30 x float]
%3 = bitcast [30 x float]* %2 to i8*
%4 = getelementptr inbounds [8 x i8], [8 x i8]* %1, i64 0, i64 0
%5 = tail call i32* @fopen(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%6 = tail call i32 @ftell(i32* %5)
%7 = call i64 @fgets(i8* %4, i32 8, i32* %5)
%8 = icmp eq i64 %7, 0
br i1 %8, label %18, label %9
9: ; preds = %0
%10 = getelementptr inbounds [8 x i8], [8 x i8]* %1, i64 0, i64 6
br label %11
11: ; preds = %9, %11
%12 = phi i32 [ 0, %9 ], [ %13, %11 ]
store i8 0, i8* %10
%13 = add nuw nsw i32 %12, 1
%14 = call i64 @fgets(i8* %4, i32 8, i32* %5)
%15 = icmp eq i64 %14, 0
br i1 %15, label %16, label %11
16: ; preds = %11
%17 = zext i32 %13 to i64
br label %18
18: ; preds = %16, %0
%19 = phi i64 [ 0, %0 ], [ %17, %16 ]
%20 = load i32, i32* @SEEK_SET
%21 = call i32 @fseek(i32* %5, i32 %6, i32 %20)
%22 = call i8* @llvm.stacksave()
%23 = alloca float, i64 %19
%24 = bitcast float* %23 to i8*
%25 = call i64 @fgets(i8* %4, i32 8, i32* %5)
%26 = icmp eq i64 %25, 0
br i1 %26, label %36, label %27
27: ; preds = %18
%28 = getelementptr inbounds [8 x i8], [8 x i8]* %1, i64 0, i64 6
br label %29
29: ; preds = %27, %29
%30 = phi i64 [ 0, %27 ], [ %33, %29 ]
store i8 0, i8* %28
%31 = call float @atof(i8* %4)
%32 = getelementptr inbounds float, float* %23, i64 %30
store float %31, float* %32
%33 = add nuw i64 %30, 1
%34 = call i64 @fgets(i8* %4, i32 8, i32* %5)
%35 = icmp eq i64 %34, 0
br i1 %35, label %36, label %29
36: ; preds = %29, %18
%37 = call i32 @fclose(i32* %5)
%38 = getelementptr inbounds [30 x float], [30 x float]* %2, i64 0, i64 20
%39 = getelementptr inbounds [30 x float], [30 x float]* %2, i64 0, i64 0
%40 = getelementptr inbounds [30 x float], [30 x float]* %2, i64 0, i64 10
%41 = ptrtoint [30 x float]* %2 to i64
br label %42
42: ; preds = %36, %42
%43 = phi i32 [ 0, %36 ], [ %67, %42 ]
%44 = phi float* [ %40, %36 ], [ %61, %42 ]
%45 = phi float* [ %38, %36 ], [ %60, %42 ]
%46 = phi float [ 0.000000e+00, %36 ], [ %65, %42 ]
%47 = phi float [ 0.000000e+00, %36 ], [ %63, %42 ]
%48 = load float, float* %44
%49 = load float, float* %39
%50 = load float, float* %45
%51 = fpext float %50 to double
%52 = call i32 (i8*, float, float, ...) @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.2, i64 0, i64 0), float %48, float %49, double %51)
%53 = ptrtoint float* %44 to i64
%54 = sub i64 %53, %41
%55 = icmp sgt i64 %54, 116
%56 = ptrtoint float* %45 to i64
%57 = sub i64 %56, %41
%58 = icmp sgt i64 %57, 116
%59 = select i1 %58, float* %39, float* %45
%60 = select i1 %55, float* %45, float* %59
%61 = select i1 %55, float* %39, float* %44
%62 = load float, float* %61
%63 = fsub float %47, %62
%64 = load float, float* %60
%65 = fadd float %46, %64
%66 = call i32 (i8*, float, float, ...) @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.3, i64 0, i64 0), float %63, float %65)
%67 = add nuw nsw i32 %43, 1
%68 = icmp eq i32 %67, 15
br i1 %68, label %69, label %42
69: ; preds = %42
%70 = call i32 (i8*, float, float, ...) @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.3, i64 0, i64 0), float %63, float %65)
ret i32 0
}