#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 /*<<< orphan*/ assert(int);
double fabs(double const);
int ti_atr_start(double const *);
int ti_atr(int size, double const *const *inputs, double const *options,
           double *const *outputs) {
  const double *high = inputs[0];
  const double *low = inputs[1];
  const double *close = inputs[2];
  const int period = (int)options[0];
  double *output = outputs[0];
  if (period < 1)
    return 1;
  if (size <= ti_atr_start(options))
    return 0;
  const double per = 1.0 / ((double)period);
  double sum = 0;
  double truerange;
  sum += high[0] - low[0];
  int i;
  for (i = 1; i < period; ++i) {
    do {
      const double l = low[i];
      const double h = high[i];
      const double c = close[i - 1];
      const double ych = fabs(h - c);
      const double ycl = fabs(l - c);
      double v = h - l;
      if (ych > v)
        v = ych;
      if (ycl > v)
        v = ycl;
      truerange = v;
    } while (0);
    sum += truerange;
  }
  double val = sum / period;
  *output++ = val;
  for (i = period; i < size; ++i) {
    do {
      const double l = low[i];
      const double h = high[i];
      const double c = close[i - 1];
      const double ych = fabs(h - c);
      const double ycl = fabs(l - c);
      double v = h - l;
      if (ych > v)
        v = ych;
      if (ycl > v)
        v = ycl;
      truerange = v;
    } while (0);
    val = (truerange - val) * per + val;
    *output++ = val;
  }
  assert(output - outputs[0] == size - ti_atr_start(options));
  return 0;
}


x86 assembly (clang, -O0):
<ti_atr>:
push   %rbp
mov    %rsp,%rbp
sub    $0xf0,%rsp
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rax
mov    %rax,-0x30(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rax
mov    %rax,-0x38(%rbp)
mov    -0x18(%rbp),%rax
cvttsd2si (%rax),%eax
mov    %eax,-0x3c(%rbp)
mov    -0x20(%rbp),%rax
mov    (%rax),%rax
mov    %rax,-0x48(%rbp)
cmpl   $0x1,-0x3c(%rbp)
jge    1189 <ti_atr+0x69>
movl   $0x1,-0x4(%rbp)
jmp    14f0 <ti_atr+0x3d0>
mov    -0x8(%rbp),%eax
mov    %eax,-0xd4(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <ti_atr_start@plt>
mov    %eax,%ecx
mov    -0xd4(%rbp),%eax
cmp    %ecx,%eax
jg     11b7 <ti_atr+0x97>
movl   $0x0,-0x4(%rbp)
jmp    14f0 <ti_atr+0x3d0>
cvtsi2sdl -0x3c(%rbp),%xmm1
movsd  0xe3c(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x50(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x58(%rbp)
mov    -0x28(%rbp),%rax
movsd  (%rax),%xmm0
mov    -0x30(%rbp),%rax
subsd  (%rax),%xmm0
addsd  -0x58(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
movl   $0x1,-0x64(%rbp)
mov    -0x64(%rbp),%eax
cmp    -0x3c(%rbp),%eax
jge    1304 <ti_atr+0x1e4>
jmp    1207 <ti_atr+0xe7>
mov    -0x30(%rbp),%rax
movslq -0x64(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x70(%rbp)
mov    -0x28(%rbp),%rax
movslq -0x64(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x78(%rbp)
mov    -0x38(%rbp),%rax
mov    -0x64(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x80(%rbp)
movsd  -0x78(%rbp),%xmm0
subsd  -0x80(%rbp),%xmm0
movaps 0xdbd(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  %xmm0,-0x88(%rbp)
ff
movsd  -0x70(%rbp),%xmm0
subsd  -0x80(%rbp),%xmm0
movaps 0xda0(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  %xmm0,-0x90(%rbp)
ff
movsd  -0x78(%rbp),%xmm0
subsd  -0x70(%rbp),%xmm0
movsd  %xmm0,-0x98(%rbp)
ff
movsd  -0x88(%rbp),%xmm0
ff
ucomisd -0x98(%rbp),%xmm0
ff
jbe    12b4 <ti_atr+0x194>
movsd  -0x88(%rbp),%xmm0
ff
movsd  %xmm0,-0x98(%rbp)
ff
movsd  -0x90(%rbp),%xmm0
ff
ucomisd -0x98(%rbp),%xmm0
ff
jbe    12da <ti_atr+0x1ba>
movsd  -0x90(%rbp),%xmm0
ff
movsd  %xmm0,-0x98(%rbp)
ff
movsd  -0x98(%rbp),%xmm0
ff
movsd  %xmm0,-0x60(%rbp)
movsd  -0x60(%rbp),%xmm0
addsd  -0x58(%rbp),%xmm0
movsd  %xmm0,-0x58(%rbp)
mov    -0x64(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x64(%rbp)
jmp    11f6 <ti_atr+0xd6>
movsd  -0x58(%rbp),%xmm0
cvtsi2sdl -0x3c(%rbp),%xmm1
divsd  %xmm1,%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
movsd  -0xa0(%rbp),%xmm0
ff
mov    -0x48(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x48(%rbp)
movsd  %xmm0,(%rax)
mov    -0x3c(%rbp),%eax
mov    %eax,-0x64(%rbp)
mov    -0x64(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    149a <ti_atr+0x37a>
jmp    134c <ti_atr+0x22c>
mov    -0x30(%rbp),%rax
movslq -0x64(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0xa8(%rbp)
ff
mov    -0x28(%rbp),%rax
movslq -0x64(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0xb0(%rbp)
ff
mov    -0x38(%rbp),%rax
mov    -0x64(%rbp),%ecx
sub    $0x1,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0xb8(%rbp)
ff
movsd  -0xb0(%rbp),%xmm0
ff
subsd  -0xb8(%rbp),%xmm0
ff
movaps 0xc69(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  %xmm0,-0xc0(%rbp)
ff
movsd  -0xa8(%rbp),%xmm0
ff
subsd  -0xb8(%rbp),%xmm0
ff
movaps 0xc46(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  %xmm0,-0xc8(%rbp)
ff
movsd  -0xb0(%rbp),%xmm0
ff
subsd  -0xa8(%rbp),%xmm0
ff
movsd  %xmm0,-0xd0(%rbp)
ff
movsd  -0xc0(%rbp),%xmm0
ff
ucomisd -0xd0(%rbp),%xmm0
ff
jbe    1414 <ti_atr+0x2f4>
movsd  -0xc0(%rbp),%xmm0
ff
movsd  %xmm0,-0xd0(%rbp)
ff
movsd  -0xc8(%rbp),%xmm0
ff
ucomisd -0xd0(%rbp),%xmm0
ff
jbe    143a <ti_atr+0x31a>
movsd  -0xc8(%rbp),%xmm0
ff
movsd  %xmm0,-0xd0(%rbp)
ff
movsd  -0xd0(%rbp),%xmm0
ff
movsd  %xmm0,-0x60(%rbp)
movsd  -0x60(%rbp),%xmm0
subsd  -0xa0(%rbp),%xmm0
ff
movsd  -0x50(%rbp),%xmm2
movsd  -0xa0(%rbp),%xmm1
ff
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,-0xa0(%rbp)
ff
movsd  -0xa0(%rbp),%xmm0
ff
mov    -0x48(%rbp),%rax
mov    %rax,%rcx
add    $0x8,%rcx
mov    %rcx,-0x48(%rbp)
movsd  %xmm0,(%rax)
mov    -0x64(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x64(%rbp)
jmp    133b <ti_atr+0x21b>
mov    -0x48(%rbp),%rax
mov    -0x20(%rbp),%rcx
mov    (%rcx),%rcx
sub    %rcx,%rax
sar    $0x3,%rax
mov    %rax,-0xe0(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0xe4(%rbp)
mov    -0x18(%rbp),%rdi
call   1030 <ti_atr_start@plt>
mov    -0xe4(%rbp),%ecx
mov    %eax,%edx
mov    -0xe0(%rbp),%rax
sub    %edx,%ecx
movslq %ecx,%rcx
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xf0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<ti_atr>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
cvttsd2si (%rdx),%ebx
test   %ebx,%ebx
jle    12a2 <ti_atr+0x182>
mov    %edi,%r13d
mov    (%rsi),%r14
mov    0x8(%rsi),%r12
mov    0x10(%rsi),%r15
mov    (%rcx),%rbp
mov    %rdx,%rdi
mov    %rdx,0x10(%rsp)
mov    %rcx,0x8(%rsp)
call   1030 <ti_atr_start@plt>
xor    %ecx,%ecx
cmp    %r13d,%eax
jge    12a7 <ti_atr+0x187>
mov    0x8(%rsp),%r9
mov    0x10(%rsp),%rdi
cvtsi2sd %ebx,%xmm1
movsd  (%r14),%xmm2
subsd  (%r12),%xmm2
xorpd  %xmm0,%xmm0
addsd  %xmm2,%xmm0
cmp    $0x2,%ebx
jb     11e1 <ti_atr+0xc1>
mov    %ebx,%eax
add    $0xffffffffffffffff,%rax
xor    %ecx,%ecx
movapd 0xe72(%rip),%xmm2
xchg   %ax,%ax
movsd  0x8(%r12,%rcx,8),%xmm3
movsd  0x8(%r14,%rcx,8),%xmm4
movsd  (%r15,%rcx,8),%xmm5
movapd %xmm4,%xmm6
subsd  %xmm5,%xmm6
andpd  %xmm2,%xmm6
subsd  %xmm3,%xmm4
subsd  %xmm5,%xmm3
andpd  %xmm2,%xmm3
maxsd  %xmm4,%xmm6
maxsd  %xmm6,%xmm3
addsd  %xmm3,%xmm0
add    $0x1,%rcx
cmp    %rcx,%rax
jne    11a0 <ti_atr+0x80>
divsd  %xmm1,%xmm0
movsd  %xmm0,0x0(%rbp)
add    $0x8,%rbp
cmp    %r13d,%ebx
jge    127e <ti_atr+0x15e>
movsd  0xe01(%rip),%xmm2
divsd  %xmm1,%xmm2
movslq %ebx,%rbx
movslq %r13d,%rax
lea    (%r12,%rbx,8),%rcx
lea    (%r14,%rbx,8),%rdx
lea    (%r15,%rbx,8),%rsi
add    $0xfffffffffffffff8,%rsi
sub    %rbx,%rax
xor    %ebx,%ebx
movapd 0xdea(%rip),%xmm1
cs nopw 0x0(%rax,%rax,1)
movsd  (%rcx,%rbx,1),%xmm3
movsd  (%rdx,%rbx,1),%xmm4
movsd  (%rsi,%rbx,1),%xmm5
movapd %xmm4,%xmm6
subsd  %xmm5,%xmm6
andpd  %xmm1,%xmm6
subsd  %xmm3,%xmm4
subsd  %xmm5,%xmm3
andpd  %xmm1,%xmm3
maxsd  %xmm4,%xmm6
maxsd  %xmm6,%xmm3
subsd  %xmm0,%xmm3
mulsd  %xmm2,%xmm3
addsd  %xmm3,%xmm0
movsd  %xmm0,0x0(%rbp,%rbx,1)
add    $0x8,%rbx
add    $0xffffffffffffffff,%rax
jne    1230 <ti_atr+0x110>
add    %rbx,%rbp
sub    (%r9),%rbp
sar    $0x3,%rbp
call   1030 <ti_atr_start@plt>
sub    %eax,%r13d
movslq %r13d,%rax
xor    %edi,%edi
cmp    %rax,%rbp
sete   %dil
call   1040 <assert@plt>
xor    %ecx,%ecx
jmp    12a7 <ti_atr+0x187>
mov    $0x1,%ecx
mov    %ecx,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @ti_atr(i32 %0, double** %1, double* %2, double** %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca double**
%8 = alloca double*
%9 = alloca double**
%10 = alloca double*
%11 = alloca double*
%12 = alloca double*
%13 = alloca i32
%14 = alloca double*
%15 = alloca double
%16 = alloca double
%17 = alloca double
%18 = alloca i32
%19 = alloca double
%20 = alloca double
%21 = alloca double
%22 = alloca double
%23 = alloca double
%24 = alloca double
%25 = alloca double
%26 = alloca double
%27 = alloca double
%28 = alloca double
%29 = alloca double
%30 = alloca double
%31 = alloca double
store i32 %0, i32* %6
store double** %1, double*** %7
store double* %2, double** %8
store double** %3, double*** %9
%32 = load double**, double*** %7
%33 = getelementptr inbounds double*, double** %32, i64 0
%34 = load double*, double** %33
store double* %34, double** %10
%35 = load double**, double*** %7
%36 = getelementptr inbounds double*, double** %35, i64 1
%37 = load double*, double** %36
store double* %37, double** %11
%38 = load double**, double*** %7
%39 = getelementptr inbounds double*, double** %38, i64 2
%40 = load double*, double** %39
store double* %40, double** %12
%41 = load double*, double** %8
%42 = getelementptr inbounds double, double* %41, i64 0
%43 = load double, double* %42
%44 = fptosi double %43 to i32
store i32 %44, i32* %13
%45 = load double**, double*** %9
%46 = getelementptr inbounds double*, double** %45, i64 0
%47 = load double*, double** %46
store double* %47, double** %14
%48 = load i32, i32* %13
%49 = icmp slt i32 %48, 1
br i1 %49, label %50, label %51
50: ; preds = %4
store i32 1, i32* %5
br label %208
51: ; preds = %4
%52 = load i32, i32* %6
%53 = load double*, double** %8
%54 = call i32 @ti_atr_start(double* %53)
%55 = icmp sle i32 %52, %54
br i1 %55, label %56, label %57
56: ; preds = %51
store i32 0, i32* %5
br label %208
57: ; preds = %51
%58 = load i32, i32* %13
%59 = sitofp i32 %58 to double
%60 = fdiv double 1.000000e+00, %59
store double %60, double* %15
store double 0.000000e+00, double* %16
%61 = load double*, double** %10
%62 = getelementptr inbounds double, double* %61, i64 0
%63 = load double, double* %62
%64 = load double*, double** %11
%65 = getelementptr inbounds double, double* %64, i64 0
%66 = load double, double* %65
%67 = fsub double %63, %66
%68 = load double, double* %16
%69 = fadd double %68, %67
store double %69, double* %16
store i32 1, i32* %18
br label %70
70: ; preds = %120, %57
%71 = load i32, i32* %18
%72 = load i32, i32* %13
%73 = icmp slt i32 %71, %72
br i1 %73, label %74, label %123
74: ; preds = %70
br label %75
75: ; preds = %74
%76 = load double*, double** %11
%77 = load i32, i32* %18
%78 = sext i32 %77 to i64
%79 = getelementptr inbounds double, double* %76, i64 %78
%80 = load double, double* %79
store double %80, double* %19
%81 = load double*, double** %10
%82 = load i32, i32* %18
%83 = sext i32 %82 to i64
%84 = getelementptr inbounds double, double* %81, i64 %83
%85 = load double, double* %84
store double %85, double* %20
%86 = load double*, double** %12
%87 = load i32, i32* %18
%88 = sub nsw i32 %87, 1
%89 = sext i32 %88 to i64
%90 = getelementptr inbounds double, double* %86, i64 %89
%91 = load double, double* %90
store double %91, double* %21
%92 = load double, double* %20
%93 = load double, double* %21
%94 = fsub double %92, %93
%95 = call double @llvm.fabs.f64(double %94)
store double %95, double* %22
%96 = load double, double* %19
%97 = load double, double* %21
%98 = fsub double %96, %97
%99 = call double @llvm.fabs.f64(double %98)
store double %99, double* %23
%100 = load double, double* %20
%101 = load double, double* %19
%102 = fsub double %100, %101
store double %102, double* %24
%103 = load double, double* %22
%104 = load double, double* %24
%105 = fcmp ogt double %103, %104
br i1 %105, label %106, label %108
106: ; preds = %75
%107 = load double, double* %22
store double %107, double* %24
br label %108
108: ; preds = %106, %75
%109 = load double, double* %23
%110 = load double, double* %24
%111 = fcmp ogt double %109, %110
br i1 %111, label %112, label %114
112: ; preds = %108
%113 = load double, double* %23
store double %113, double* %24
br label %114
114: ; preds = %112, %108
%115 = load double, double* %24
store double %115, double* %17
br label %116
116: ; preds = %114
%117 = load double, double* %17
%118 = load double, double* %16
%119 = fadd double %118, %117
store double %119, double* %16
br label %120
120: ; preds = %116
%121 = load i32, i32* %18
%122 = add nsw i32 %121, 1
store i32 %122, i32* %18
br label %70
123: ; preds = %70
%124 = load double, double* %16
%125 = load i32, i32* %13
%126 = sitofp i32 %125 to double
%127 = fdiv double %124, %126
store double %127, double* %25
%128 = load double, double* %25
%129 = load double*, double** %14
%130 = getelementptr inbounds double, double* %129, i32 1
store double* %130, double** %14
store double %128, double* %129
%131 = load i32, i32* %13
store i32 %131, i32* %18
br label %132
132: ; preds = %188, %123
%133 = load i32, i32* %18
%134 = load i32, i32* %6
%135 = icmp slt i32 %133, %134
br i1 %135, label %136, label %191
136: ; preds = %132
br label %137
137: ; preds = %136
%138 = load double*, double** %11
%139 = load i32, i32* %18
%140 = sext i32 %139 to i64
%141 = getelementptr inbounds double, double* %138, i64 %140
%142 = load double, double* %141
store double %142, double* %26
%143 = load double*, double** %10
%144 = load i32, i32* %18
%145 = sext i32 %144 to i64
%146 = getelementptr inbounds double, double* %143, i64 %145
%147 = load double, double* %146
store double %147, double* %27
%148 = load double*, double** %12
%149 = load i32, i32* %18
%150 = sub nsw i32 %149, 1
%151 = sext i32 %150 to i64
%152 = getelementptr inbounds double, double* %148, i64 %151
%153 = load double, double* %152
store double %153, double* %28
%154 = load double, double* %27
%155 = load double, double* %28
%156 = fsub double %154, %155
%157 = call double @llvm.fabs.f64(double %156)
store double %157, double* %29
%158 = load double, double* %26
%159 = load double, double* %28
%160 = fsub double %158, %159
%161 = call double @llvm.fabs.f64(double %160)
store double %161, double* %30
%162 = load double, double* %27
%163 = load double, double* %26
%164 = fsub double %162, %163
store double %164, double* %31
%165 = load double, double* %29
%166 = load double, double* %31
%167 = fcmp ogt double %165, %166
br i1 %167, label %168, label %170
168: ; preds = %137
%169 = load double, double* %29
store double %169, double* %31
br label %170
170: ; preds = %168, %137
%171 = load double, double* %30
%172 = load double, double* %31
%173 = fcmp ogt double %171, %172
br i1 %173, label %174, label %176
174: ; preds = %170
%175 = load double, double* %30
store double %175, double* %31
br label %176
176: ; preds = %174, %170
%177 = load double, double* %31
store double %177, double* %17
br label %178
178: ; preds = %176
%179 = load double, double* %17
%180 = load double, double* %25
%181 = fsub double %179, %180
%182 = load double, double* %15
%183 = load double, double* %25
%184 = call double @llvm.fmuladd.f64(double %181, double %182, double %183)
store double %184, double* %25
%185 = load double, double* %25
%186 = load double*, double** %14
%187 = getelementptr inbounds double, double* %186, i32 1
store double* %187, double** %14
store double %185, double* %186
br label %188
188: ; preds = %178
%189 = load i32, i32* %18
%190 = add nsw i32 %189, 1
store i32 %190, i32* %18
br label %132
191: ; preds = %132
%192 = load double*, double** %14
%193 = load double**, double*** %9
%194 = getelementptr inbounds double*, double** %193, i64 0
%195 = load double*, double** %194
%196 = ptrtoint double* %192 to i64
%197 = ptrtoint double* %195 to i64
%198 = sub i64 %196, %197
%199 = sdiv exact i64 %198, 8
%200 = load i32, i32* %6
%201 = load double*, double** %8
%202 = call i32 @ti_atr_start(double* %201)
%203 = sub nsw i32 %200, %202
%204 = sext i32 %203 to i64
%205 = icmp eq i64 %199, %204
%206 = zext i1 %205 to i32
%207 = call i32 @assert(i32 %206)
store i32 0, i32* %5
br label %208
208: ; preds = %191, %56, %50
%209 = load i32, i32* %5
ret i32 %209
}

LLVM IR (-O2):
define i32 @ti_atr(i32 %0, double** nocapture %1, double* %2, double** nocapture %3) {
%5 = load double*, double** %1
%6 = getelementptr inbounds double*, double** %1, i64 1
%7 = load double*, double** %6
%8 = getelementptr inbounds double*, double** %1, i64 2
%9 = load double*, double** %8
%10 = load double, double* %2
%11 = fptosi double %10 to i32
%12 = load double*, double** %3
%13 = icmp slt i32 %11, 1
br i1 %13, label %95, label %14
14: ; preds = %4
%15 = tail call i32 @ti_atr_start(double* %2)
%16 = icmp slt i32 %15, %0
br i1 %16, label %17, label %95
17: ; preds = %14
%18 = sitofp i32 %11 to double
%19 = fdiv double 1.000000e+00, %18
%20 = load double, double* %5
%21 = load double, double* %7
%22 = fsub double %20, %21
%23 = fadd double %22, 0.000000e+00
%24 = icmp ugt i32 %11, 1
br i1 %24, label %25, label %49
25: ; preds = %17
%26 = zext i32 %11 to i64
br label %27
27: ; preds = %25, %27
%28 = phi i64 [ 1, %25 ], [ %47, %27 ]
%29 = phi double [ %23, %25 ], [ %46, %27 ]
%30 = getelementptr inbounds double, double* %7, i64 %28
%31 = load double, double* %30
%32 = getelementptr inbounds double, double* %5, i64 %28
%33 = load double, double* %32
%34 = add nsw i64 %28, -1
%35 = getelementptr inbounds double, double* %9, i64 %34
%36 = load double, double* %35
%37 = fsub double %33, %36
%38 = tail call double @llvm.fabs.f64(double %37)
%39 = fsub double %31, %36
%40 = tail call double @llvm.fabs.f64(double %39)
%41 = fsub double %33, %31
%42 = fcmp ogt double %38, %41
%43 = select i1 %42, double %38, double %41
%44 = fcmp ogt double %40, %43
%45 = select i1 %44, double %40, double %43
%46 = fadd double %29, %45
%47 = add nuw nsw i64 %28, 1
%48 = icmp eq i64 %47, %26
br i1 %48, label %49, label %27
49: ; preds = %27, %17
%50 = phi double [ %23, %17 ], [ %46, %27 ]
%51 = fdiv double %50, %18
store double %51, double* %12
%52 = getelementptr inbounds double, double* %12, i64 1
%53 = icmp slt i32 %11, %0
br i1 %53, label %54, label %82
54: ; preds = %49
%55 = sext i32 %11 to i64
%56 = sext i32 %0 to i64
br label %57
57: ; preds = %54, %57
%58 = phi i64 [ %55, %54 ], [ %79, %57 ]
%59 = phi double* [ %52, %54 ], [ %80, %57 ]
%60 = phi double [ %51, %54 ], [ %78, %57 ]
%61 = getelementptr inbounds double, double* %7, i64 %58
%62 = load double, double* %61
%63 = getelementptr inbounds double, double* %5, i64 %58
%64 = load double, double* %63
%65 = add nsw i64 %58, -1
%66 = getelementptr inbounds double, double* %9, i64 %65
%67 = load double, double* %66
%68 = fsub double %64, %67
%69 = tail call double @llvm.fabs.f64(double %68)
%70 = fsub double %62, %67
%71 = tail call double @llvm.fabs.f64(double %70)
%72 = fsub double %64, %62
%73 = fcmp ogt double %69, %72
%74 = select i1 %73, double %69, double %72
%75 = fcmp ogt double %71, %74
%76 = select i1 %75, double %71, double %74
%77 = fsub double %76, %60
%78 = tail call double @llvm.fmuladd.f64(double %77, double %19, double %60)
store double %78, double* %59
%79 = add nsw i64 %58, 1
%80 = getelementptr inbounds double, double* %59, i64 1
%81 = icmp eq i64 %79, %56
br i1 %81, label %82, label %57
82: ; preds = %57, %49
%83 = phi double* [ %52, %49 ], [ %80, %57 ]
%84 = load double*, double** %3
%85 = ptrtoint double* %83 to i64
%86 = ptrtoint double* %84 to i64
%87 = sub i64 %85, %86
%88 = ashr exact i64 %87, 3
%89 = tail call i32 @ti_atr_start(double* %2)
%90 = sub nsw i32 %0, %89
%91 = sext i32 %90 to i64
%92 = icmp eq i64 %88, %91
%93 = zext i1 %92 to i32
%94 = tail call i32 @assert(i32 %93)
br label %95
95: ; preds = %14, %4, %82
%96 = phi i32 [ 0, %82 ], [ 1, %4 ], [ 0, %14 ]
ret i32 %96
}