#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 array_max_abs(double *, int);
double fabs(double);
int /*<<< orphan*/ free(double *);
scalar_t__ malloc(int);
int stopcheck2(double fx, int N, double *xc, double *xf, double *jac,
               double *dx, double fsval, double gtol, double stol) {
  int rcode, i;
  double num, den;
  double stop0;
  double *scheck;
  rcode = 0;
  scheck = (double *)malloc(sizeof(double) * N);
  if (fabs(fx) > fabs(fsval)) {
    den = fabs(fx);
  } else {
    den = fabs(fsval);
  }
  for (i = 0; i < N; ++i) {
    if (fabs(xf[i]) > 1.0 / fabs(dx[i])) {
      num = fabs(xf[i]);
    } else {
      num = 1.0 / fabs(dx[i]);
    }
    scheck[i] = fabs(jac[i]) * num / den;
  }
  stop0 = array_max_abs(scheck, N);
  if (stop0 <= gtol) {
    rcode = 1;
  } else {
    for (i = 0; i < N; ++i) {
      if (fabs(xf[i]) > 1.0 / fabs(dx[i])) {
        den = fabs(xf[i]);
      } else {
        den = 1.0 / fabs(dx[i]);
      }
      num = fabs(xf[i] - xc[i]);
      scheck[i] = num / den;
    }
    stop0 = array_max_abs(scheck, N);
    if (stop0 <= stol) {
      rcode = 2;
    }
  }
  free(scheck);
  return rcode;
}


x86 assembly (clang, -O0):
<stopcheck2>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movsd  %xmm0,-0x8(%rbp)
mov    %edi,-0xc(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %r8,-0x30(%rbp)
movsd  %xmm1,-0x38(%rbp)
movsd  %xmm2,-0x40(%rbp)
movsd  %xmm3,-0x48(%rbp)
movl   $0x0,-0x4c(%rbp)
movslq -0xc(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,-0x70(%rbp)
movsd  -0x8(%rbp),%xmm0
movaps 0xe7b(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  -0x38(%rbp),%xmm1
movaps 0xe6b(%rip),%xmm2
pand   %xmm2,%xmm1
ucomisd %xmm1,%xmm0
jbe    11bd <stopcheck2+0x8d>
movsd  -0x8(%rbp),%xmm0
movaps 0xe51(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
jmp    11d2 <stopcheck2+0xa2>
movsd  -0x38(%rbp),%xmm0
movaps 0xe37(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
movl   $0x0,-0x50(%rbp)
mov    -0x50(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    12b3 <stopcheck2+0x183>
mov    -0x20(%rbp),%rax
movslq -0x50(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movaps 0xe07(%rip),%xmm1
pand   %xmm1,%xmm0
mov    -0x30(%rbp),%rax
movslq -0x50(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
movaps 0xdef(%rip),%xmm1
pand   %xmm1,%xmm2
movsd  0xdf3(%rip),%xmm1
divsd  %xmm2,%xmm1
ucomisd %xmm1,%xmm0
jbe    124d <stopcheck2+0x11d>
mov    -0x20(%rbp),%rax
movslq -0x50(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movaps 0xdc1(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
jmp    1276 <stopcheck2+0x146>
mov    -0x30(%rbp),%rax
movslq -0x50(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
movaps 0xd9f(%rip),%xmm0
pand   %xmm0,%xmm1
movsd  0xda3(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
mov    -0x28(%rbp),%rax
movslq -0x50(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movaps 0xd76(%rip),%xmm1
pand   %xmm1,%xmm0
mulsd  -0x58(%rbp),%xmm0
divsd  -0x60(%rbp),%xmm0
mov    -0x70(%rbp),%rax
movslq -0x50(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x50(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x50(%rbp)
jmp    11d9 <stopcheck2+0xa9>
mov    -0x70(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1050 <array_max_abs@plt>
movsd  %xmm0,-0x68(%rbp)
movsd  -0x68(%rbp),%xmm1
movsd  -0x40(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jb     12e4 <stopcheck2+0x1b4>
movl   $0x1,-0x4c(%rbp)
jmp    1408 <stopcheck2+0x2d8>
movl   $0x0,-0x50(%rbp)
mov    -0x50(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    13d7 <stopcheck2+0x2a7>
mov    -0x20(%rbp),%rax
movslq -0x50(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movaps 0xcf5(%rip),%xmm1
pand   %xmm1,%xmm0
mov    -0x30(%rbp),%rax
movslq -0x50(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
movaps 0xcdd(%rip),%xmm1
pand   %xmm1,%xmm2
movsd  0xce1(%rip),%xmm1
divsd  %xmm2,%xmm1
ucomisd %xmm1,%xmm0
jbe    135f <stopcheck2+0x22f>
mov    -0x20(%rbp),%rax
movslq -0x50(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movaps 0xcaf(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
jmp    1388 <stopcheck2+0x258>
mov    -0x30(%rbp),%rax
movslq -0x50(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
movaps 0xc8d(%rip),%xmm0
pand   %xmm0,%xmm1
movsd  0xc91(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x60(%rbp)
mov    -0x20(%rbp),%rax
movslq -0x50(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x18(%rbp),%rax
movslq -0x50(%rbp),%rcx
subsd  (%rax,%rcx,8),%xmm0
movaps 0xc57(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  %xmm0,-0x58(%rbp)
movsd  -0x58(%rbp),%xmm0
divsd  -0x60(%rbp),%xmm0
mov    -0x70(%rbp),%rax
movslq -0x50(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x50(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x50(%rbp)
jmp    12eb <stopcheck2+0x1bb>
mov    -0x70(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1050 <array_max_abs@plt>
movsd  %xmm0,-0x68(%rbp)
movsd  -0x68(%rbp),%xmm1
movsd  -0x48(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jb     1403 <stopcheck2+0x2d3>
movl   $0x2,-0x4c(%rbp)
jmp    1408 <stopcheck2+0x2d8>
mov    -0x70(%rbp),%rdi
call   1030 <free@plt>
mov    -0x4c(%rbp),%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stopcheck2>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
movsd  %xmm3,0x8(%rsp)
movsd  %xmm2,(%rsp)
movapd %xmm1,0x20(%rsp)
mov    %r8,%r15
mov    %rcx,%rbp
mov    %rdx,%r12
mov    %rsi,%r13
mov    %edi,%ebx
movapd %xmm0,0x10(%rsp)
lea    0x0(,%rbx,8),%edi
call   1040 <malloc@plt>
mov    %rbx,%rsi
mov    %rax,%rbx
test   %esi,%esi
jle    1242 <stopcheck2+0x112>
movapd 0xe7b(%rip),%xmm6
movapd 0x10(%rsp),%xmm7
andpd  %xmm6,%xmm7
movapd 0x20(%rsp),%xmm0
andpd  %xmm6,%xmm0
maxsd  %xmm0,%xmm7
mov    %esi,%r14d
cmp    $0x1,%esi
jne    1269 <stopcheck2+0x139>
xor    %eax,%eax
movsd  0xe6d(%rip),%xmm0
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movsd  (%r12,%rax,8),%xmm1
andpd  %xmm6,%xmm1
movsd  (%r15,%rax,8),%xmm2
andpd  %xmm6,%xmm2
movapd %xmm0,%xmm3
divsd  %xmm2,%xmm3
maxsd  %xmm3,%xmm1
movsd  0x0(%rbp,%rax,8),%xmm2
andpd  %xmm6,%xmm2
mulsd  %xmm1,%xmm2
divsd  %xmm7,%xmm2
movsd  %xmm2,(%rbx,%rax,8)
add    $0x1,%rax
cmp    %rax,%r14
jne    11c0 <stopcheck2+0x90>
mov    %rbx,%rdi
mov    %rsi,%rbp
call   1050 <array_max_abs@plt>
movapd 0xded(%rip),%xmm6
mov    %rbp,%rsi
mov    $0x1,%ebp
movsd  (%rsp),%xmm1
ucomisd %xmm0,%xmm1
jae    146c <stopcheck2+0x33c>
test   %esi,%esi
jle    1451 <stopcheck2+0x321>
cmp    $0x1,%esi
jne    133e <stopcheck2+0x20e>
xor    %eax,%eax
jmp    13fa <stopcheck2+0x2ca>
mov    %rbx,%rdi
mov    %rsi,%rbp
call   1050 <array_max_abs@plt>
mov    %rbp,%rsi
mov    $0x1,%ebp
movsd  (%rsp),%xmm1
ucomisd %xmm0,%xmm1
jb     1451 <stopcheck2+0x321>
jmp    146c <stopcheck2+0x33c>
lea    (%rbx,%r14,8),%rax
lea    (%r12,%r14,8),%rcx
lea    (%r15,%r14,8),%rdx
cmp    %rcx,%rbx
setb   %r8b
cmp    %r12,%rax
seta   %r9b
cmp    %rdx,%rbx
setb   %cl
cmp    %r15,%rax
seta   %r10b
lea    0x0(,%r14,8),%rdx
add    %rbp,%rdx
cmp    %rdx,%rbx
setb   %dl
cmp    %rbp,%rax
seta   %dil
xor    %eax,%eax
test   %r9b,%r8b
jne    11ab <stopcheck2+0x7b>
and    %r10b,%cl
jne    11ab <stopcheck2+0x7b>
and    %dil,%dl
jne    11ab <stopcheck2+0x7b>
mov    %r14d,%eax
and    $0xfffffffe,%eax
movapd %xmm7,%xmm0
unpcklpd %xmm7,%xmm0
xor    %ecx,%ecx
movapd 0xd23(%rip),%xmm1
movapd 0xd2b(%rip),%xmm2
cs nopw 0x0(%rax,%rax,1)
nop
movupd (%r12,%rcx,8),%xmm3
andpd  %xmm1,%xmm3
movupd (%r15,%rcx,8),%xmm4
andpd  %xmm1,%xmm4
movapd %xmm2,%xmm5
divpd  %xmm4,%xmm5
maxpd  %xmm5,%xmm3
movupd 0x0(%rbp,%rcx,8),%xmm4
andpd  %xmm1,%xmm4
mulpd  %xmm3,%xmm4
divpd  %xmm0,%xmm4
movupd %xmm4,(%rbx,%rcx,8)
add    $0x2,%rcx
cmp    %rcx,%rax
jne    12f0 <stopcheck2+0x1c0>
cmp    %r14,%rax
jne    11ab <stopcheck2+0x7b>
jmp    1200 <stopcheck2+0xd0>
lea    (%rbx,%r14,8),%rax
lea    (%r12,%r14,8),%rcx
lea    (%r15,%r14,8),%rdx
cmp    %rcx,%rbx
setb   %r8b
cmp    %r12,%rax
seta   %r9b
cmp    %rdx,%rbx
setb   %cl
cmp    %r15,%rax
seta   %r10b
lea    0x0(,%r14,8),%rdx
add    %r13,%rdx
cmp    %rdx,%rbx
setb   %dl
cmp    %r13,%rax
seta   %dil
xor    %eax,%eax
test   %r9b,%r8b
jne    13fa <stopcheck2+0x2ca>
and    %r10b,%cl
jne    13fa <stopcheck2+0x2ca>
and    %dil,%dl
jne    13fa <stopcheck2+0x2ca>
mov    %r14d,%eax
and    $0xfffffffe,%eax
xor    %ecx,%ecx
movapd 0xc62(%rip),%xmm0
movapd 0xc6a(%rip),%xmm1
cs nopw 0x0(%rax,%rax,1)
movupd (%r12,%rcx,8),%xmm2
movapd %xmm2,%xmm3
andpd  %xmm0,%xmm3
movupd (%r15,%rcx,8),%xmm4
andpd  %xmm0,%xmm4
movapd %xmm1,%xmm5
divpd  %xmm4,%xmm5
maxpd  %xmm5,%xmm3
movupd 0x0(%r13,%rcx,8),%xmm4
subpd  %xmm4,%xmm2
andpd  %xmm0,%xmm2
divpd  %xmm3,%xmm2
movupd %xmm2,(%rbx,%rcx,8)
add    $0x2,%rcx
cmp    %rcx,%rax
jne    13b0 <stopcheck2+0x280>
cmp    %r14,%rax
je     1451 <stopcheck2+0x321>
movsd  0xc1e(%rip),%xmm0
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsd  (%r12,%rax,8),%xmm1
movapd %xmm1,%xmm2
andpd  %xmm6,%xmm2
movsd  (%r15,%rax,8),%xmm3
andpd  %xmm6,%xmm3
movapd %xmm0,%xmm4
divsd  %xmm3,%xmm4
maxsd  %xmm4,%xmm2
subsd  0x0(%r13,%rax,8),%xmm1
andpd  %xmm6,%xmm1
divsd  %xmm2,%xmm1
movsd  %xmm1,(%rbx,%rax,8)
add    $0x1,%rax
cmp    %rax,%r14
jne    1410 <stopcheck2+0x2e0>
mov    %rbx,%rdi
call   1050 <array_max_abs@plt>
xor    %ebp,%ebp
movsd  0x8(%rsp),%xmm1
ucomisd %xmm0,%xmm1
jb     146c <stopcheck2+0x33c>
mov    $0x2,%ebp
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %ebp,%eax
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @stopcheck2(double %0, i32 %1, double* %2, double* %3, double* %4, double* %5, double %6, double %7, double %8) {
%10 = alloca double
%11 = alloca i32
%12 = alloca double*
%13 = alloca double*
%14 = alloca double*
%15 = alloca double*
%16 = alloca double
%17 = alloca double
%18 = alloca double
%19 = alloca i32
%20 = alloca i32
%21 = alloca double
%22 = alloca double
%23 = alloca double
%24 = alloca double*
store double %0, double* %10
store i32 %1, i32* %11
store double* %2, double** %12
store double* %3, double** %13
store double* %4, double** %14
store double* %5, double** %15
store double %6, double* %16
store double %7, double* %17
store double %8, double* %18
store i32 0, i32* %19
%25 = load i32, i32* %11
%26 = sext i32 %25 to i64
%27 = mul i64 8, %26
%28 = trunc i64 %27 to i32
%29 = call i64 @malloc(i32 %28)
%30 = inttoptr i64 %29 to double*
store double* %30, double** %24
%31 = load double, double* %10
%32 = call double @llvm.fabs.f64(double %31)
%33 = load double, double* %16
%34 = call double @llvm.fabs.f64(double %33)
%35 = fcmp ogt double %32, %34
br i1 %35, label %36, label %39
36: ; preds = %9
%37 = load double, double* %10
%38 = call double @llvm.fabs.f64(double %37)
store double %38, double* %22
br label %42
39: ; preds = %9
%40 = load double, double* %16
%41 = call double @llvm.fabs.f64(double %40)
store double %41, double* %22
br label %42
42: ; preds = %39, %36
store i32 0, i32* %20
br label %43
43: ; preds = %92, %42
%44 = load i32, i32* %20
%45 = load i32, i32* %11
%46 = icmp slt i32 %44, %45
br i1 %46, label %47, label %95
47: ; preds = %43
%48 = load double*, double** %13
%49 = load i32, i32* %20
%50 = sext i32 %49 to i64
%51 = getelementptr inbounds double, double* %48, i64 %50
%52 = load double, double* %51
%53 = call double @llvm.fabs.f64(double %52)
%54 = load double*, double** %15
%55 = load i32, i32* %20
%56 = sext i32 %55 to i64
%57 = getelementptr inbounds double, double* %54, i64 %56
%58 = load double, double* %57
%59 = call double @llvm.fabs.f64(double %58)
%60 = fdiv double 1.000000e+00, %59
%61 = fcmp ogt double %53, %60
br i1 %61, label %62, label %69
62: ; preds = %47
%63 = load double*, double** %13
%64 = load i32, i32* %20
%65 = sext i32 %64 to i64
%66 = getelementptr inbounds double, double* %63, i64 %65
%67 = load double, double* %66
%68 = call double @llvm.fabs.f64(double %67)
store double %68, double* %21
br label %77
69: ; preds = %47
%70 = load double*, double** %15
%71 = load i32, i32* %20
%72 = sext i32 %71 to i64
%73 = getelementptr inbounds double, double* %70, i64 %72
%74 = load double, double* %73
%75 = call double @llvm.fabs.f64(double %74)
%76 = fdiv double 1.000000e+00, %75
store double %76, double* %21
br label %77
77: ; preds = %69, %62
%78 = load double*, double** %14
%79 = load i32, i32* %20
%80 = sext i32 %79 to i64
%81 = getelementptr inbounds double, double* %78, i64 %80
%82 = load double, double* %81
%83 = call double @llvm.fabs.f64(double %82)
%84 = load double, double* %21
%85 = fmul double %83, %84
%86 = load double, double* %22
%87 = fdiv double %85, %86
%88 = load double*, double** %24
%89 = load i32, i32* %20
%90 = sext i32 %89 to i64
%91 = getelementptr inbounds double, double* %88, i64 %90
store double %87, double* %91
br label %92
92: ; preds = %77
%93 = load i32, i32* %20
%94 = add nsw i32 %93, 1
store i32 %94, i32* %20
br label %43
95: ; preds = %43
%96 = load double*, double** %24
%97 = load i32, i32* %11
%98 = call double @array_max_abs(double* %96, i32 %97)
store double %98, double* %23
%99 = load double, double* %23
%100 = load double, double* %17
%101 = fcmp ole double %99, %100
br i1 %101, label %102, label %103
102: ; preds = %95
store i32 1, i32* %19
br label %170
103: ; preds = %95
store i32 0, i32* %20
br label %104
104: ; preds = %158, %103
%105 = load i32, i32* %20
%106 = load i32, i32* %11
%107 = icmp slt i32 %105, %106
br i1 %107, label %108, label %161
108: ; preds = %104
%109 = load double*, double** %13
%110 = load i32, i32* %20
%111 = sext i32 %110 to i64
%112 = getelementptr inbounds double, double* %109, i64 %111
%113 = load double, double* %112
%114 = call double @llvm.fabs.f64(double %113)
%115 = load double*, double** %15
%116 = load i32, i32* %20
%117 = sext i32 %116 to i64
%118 = getelementptr inbounds double, double* %115, i64 %117
%119 = load double, double* %118
%120 = call double @llvm.fabs.f64(double %119)
%121 = fdiv double 1.000000e+00, %120
%122 = fcmp ogt double %114, %121
br i1 %122, label %123, label %130
123: ; preds = %108
%124 = load double*, double** %13
%125 = load i32, i32* %20
%126 = sext i32 %125 to i64
%127 = getelementptr inbounds double, double* %124, i64 %126
%128 = load double, double* %127
%129 = call double @llvm.fabs.f64(double %128)
store double %129, double* %22
br label %138
130: ; preds = %108
%131 = load double*, double** %15
%132 = load i32, i32* %20
%133 = sext i32 %132 to i64
%134 = getelementptr inbounds double, double* %131, i64 %133
%135 = load double, double* %134
%136 = call double @llvm.fabs.f64(double %135)
%137 = fdiv double 1.000000e+00, %136
store double %137, double* %22
br label %138
138: ; preds = %130, %123
%139 = load double*, double** %13
%140 = load i32, i32* %20
%141 = sext i32 %140 to i64
%142 = getelementptr inbounds double, double* %139, i64 %141
%143 = load double, double* %142
%144 = load double*, double** %12
%145 = load i32, i32* %20
%146 = sext i32 %145 to i64
%147 = getelementptr inbounds double, double* %144, i64 %146
%148 = load double, double* %147
%149 = fsub double %143, %148
%150 = call double @llvm.fabs.f64(double %149)
store double %150, double* %21
%151 = load double, double* %21
%152 = load double, double* %22
%153 = fdiv double %151, %152
%154 = load double*, double** %24
%155 = load i32, i32* %20
%156 = sext i32 %155 to i64
%157 = getelementptr inbounds double, double* %154, i64 %156
store double %153, double* %157
br label %158
158: ; preds = %138
%159 = load i32, i32* %20
%160 = add nsw i32 %159, 1
store i32 %160, i32* %20
br label %104
161: ; preds = %104
%162 = load double*, double** %24
%163 = load i32, i32* %11
%164 = call double @array_max_abs(double* %162, i32 %163)
store double %164, double* %23
%165 = load double, double* %23
%166 = load double, double* %18
%167 = fcmp ole double %165, %166
br i1 %167, label %168, label %169
168: ; preds = %161
store i32 2, i32* %19
br label %169
169: ; preds = %168, %161
br label %170
170: ; preds = %169, %102
%171 = load double*, double** %24
%172 = call i32 @free(double* %171)
%173 = load i32, i32* %19
ret i32 %173
}

LLVM IR (-O2):
define i32 @stopcheck2(double %0, i32 %1, double* nocapture %2, double* nocapture %3, double* nocapture %4, double* nocapture %5, double %6, double %7, double %8) {
%10 = shl i32 %1, 3
%11 = tail call i64 @malloc(i32 %10)
%12 = inttoptr i64 %11 to double*
%13 = inttoptr i64 %11 to i8*
%14 = tail call double @llvm.fabs.f64(double %0)
%15 = tail call double @llvm.fabs.f64(double %6)
%16 = fcmp ogt double %14, %15
%17 = select i1 %16, double %14, double %15
%18 = icmp sgt i32 %1, 0
br i1 %18, label %19, label %94
19: ; preds = %9
%20 = zext i32 %1 to i64
%21 = icmp eq i32 %1, 1
br i1 %21, label %70, label %22
22: ; preds = %19
%23 = getelementptr double, double* %12, i64 %20
%24 = getelementptr double, double* %3, i64 %20
%25 = bitcast double* %24 to i8*
%26 = getelementptr double, double* %5, i64 %20
%27 = bitcast double* %26 to i8*
%28 = getelementptr double, double* %4, i64 %20
%29 = bitcast double* %28 to i8*
%30 = icmp ult i8* %13, %25
%31 = icmp ugt double* %23, %3
%32 = and i1 %30, %31
%33 = icmp ult i8* %13, %27
%34 = icmp ugt double* %23, %5
%35 = and i1 %33, %34
%36 = or i1 %32, %35
%37 = icmp ult i8* %13, %29
%38 = icmp ugt double* %23, %4
%39 = and i1 %37, %38
%40 = or i1 %36, %39
br i1 %40, label %70, label %41
41: ; preds = %22
%42 = and i64 %20, 4294967294
%43 = insertelement <2 x double> poison, double %17, i64 0
%44 = shufflevector <2 x double> %43, <2 x double> poison, <2 x i32> zeroinitializer
br label %45
45: ; preds = %45, %41
%46 = phi i64 [ 0, %41 ], [ %66, %45 ]
%47 = getelementptr inbounds double, double* %3, i64 %46
%48 = bitcast double* %47 to <2 x double>*
%49 = load <2 x double>, <2 x double>* %48
%50 = call <2 x double> @llvm.fabs.v2f64(<2 x double> %49)
%51 = getelementptr inbounds double, double* %5, i64 %46
%52 = bitcast double* %51 to <2 x double>*
%53 = load <2 x double>, <2 x double>* %52
%54 = call <2 x double> @llvm.fabs.v2f64(<2 x double> %53)
%55 = fdiv <2 x double> <double 1.000000e+00, double 1.000000e+00>, %54
%56 = fcmp ogt <2 x double> %50, %55
%57 = select <2 x i1> %56, <2 x double> %50, <2 x double> %55
%58 = getelementptr inbounds double, double* %4, i64 %46
%59 = bitcast double* %58 to <2 x double>*
%60 = load <2 x double>, <2 x double>* %59
%61 = call <2 x double> @llvm.fabs.v2f64(<2 x double> %60)
%62 = fmul <2 x double> %61, %57
%63 = fdiv <2 x double> %62, %44
%64 = getelementptr inbounds double, double* %12, i64 %46
%65 = bitcast double* %64 to <2 x double>*
store <2 x double> %63, <2 x double>* %65
%66 = add nuw i64 %46, 2
%67 = icmp eq i64 %66, %42
br i1 %67, label %68, label %45
68: ; preds = %45
%69 = icmp eq i64 %42, %20
br i1 %69, label %91, label %70
70: ; preds = %22, %19, %68
%71 = phi i64 [ 0, %22 ], [ 0, %19 ], [ %42, %68 ]
br label %72
72: ; preds = %70, %72
%73 = phi i64 [ %89, %72 ], [ %71, %70 ]
%74 = getelementptr inbounds double, double* %3, i64 %73
%75 = load double, double* %74
%76 = tail call double @llvm.fabs.f64(double %75)
%77 = getelementptr inbounds double, double* %5, i64 %73
%78 = load double, double* %77
%79 = tail call double @llvm.fabs.f64(double %78)
%80 = fdiv double 1.000000e+00, %79
%81 = fcmp ogt double %76, %80
%82 = select i1 %81, double %76, double %80
%83 = getelementptr inbounds double, double* %4, i64 %73
%84 = load double, double* %83
%85 = tail call double @llvm.fabs.f64(double %84)
%86 = fmul double %85, %82
%87 = fdiv double %86, %17
%88 = getelementptr inbounds double, double* %12, i64 %73
store double %87, double* %88
%89 = add nuw nsw i64 %73, 1
%90 = icmp eq i64 %89, %20
br i1 %90, label %91, label %72
91: ; preds = %72, %68
%92 = tail call double @array_max_abs(double* %12, i32 %1)
%93 = fcmp ugt double %92, %7
br i1 %93, label %97, label %172
94: ; preds = %9
%95 = tail call double @array_max_abs(double* %12, i32 %1)
%96 = fcmp ugt double %95, %7
br i1 %96, label %168, label %172
97: ; preds = %91
br i1 %18, label %98, label %168
98: ; preds = %97
%99 = zext i32 %1 to i64
%100 = icmp eq i32 %1, 1
br i1 %100, label %147, label %101
101: ; preds = %98
%102 = getelementptr double, double* %12, i64 %20
%103 = getelementptr double, double* %3, i64 %20
%104 = bitcast double* %103 to i8*
%105 = getelementptr double, double* %5, i64 %20
%106 = bitcast double* %105 to i8*
%107 = getelementptr double, double* %2, i64 %20
%108 = bitcast double* %107 to i8*
%109 = icmp ult i8* %13, %104
%110 = icmp ugt double* %102, %3
%111 = and i1 %109, %110
%112 = icmp ult i8* %13, %106
%113 = icmp ugt double* %102, %5
%114 = and i1 %112, %113
%115 = or i1 %111, %114
%116 = icmp ult i8* %13, %108
%117 = icmp ugt double* %102, %2
%118 = and i1 %116, %117
%119 = or i1 %115, %118
br i1 %119, label %147, label %120
120: ; preds = %101
%121 = and i64 %20, 4294967294
br label %122
122: ; preds = %122, %120
%123 = phi i64 [ 0, %120 ], [ %143, %122 ]
%124 = getelementptr inbounds double, double* %3, i64 %123
%125 = bitcast double* %124 to <2 x double>*
%126 = load <2 x double>, <2 x double>* %125
%127 = call <2 x double> @llvm.fabs.v2f64(<2 x double> %126)
%128 = getelementptr inbounds double, double* %5, i64 %123
%129 = bitcast double* %128 to <2 x double>*
%130 = load <2 x double>, <2 x double>* %129
%131 = call <2 x double> @llvm.fabs.v2f64(<2 x double> %130)
%132 = fdiv <2 x double> <double 1.000000e+00, double 1.000000e+00>, %131
%133 = fcmp ogt <2 x double> %127, %132
%134 = select <2 x i1> %133, <2 x double> %127, <2 x double> %132
%135 = getelementptr inbounds double, double* %2, i64 %123
%136 = bitcast double* %135 to <2 x double>*
%137 = load <2 x double>, <2 x double>* %136
%138 = fsub <2 x double> %126, %137
%139 = call <2 x double> @llvm.fabs.v2f64(<2 x double> %138)
%140 = fdiv <2 x double> %139, %134
%141 = getelementptr inbounds double, double* %12, i64 %123
%142 = bitcast double* %141 to <2 x double>*
store <2 x double> %140, <2 x double>* %142
%143 = add nuw i64 %123, 2
%144 = icmp eq i64 %143, %121
br i1 %144, label %145, label %122
145: ; preds = %122
%146 = icmp eq i64 %121, %20
br i1 %146, label %168, label %147
147: ; preds = %101, %98, %145
%148 = phi i64 [ 0, %101 ], [ 0, %98 ], [ %121, %145 ]
br label %149
149: ; preds = %147, %149
%150 = phi i64 [ %166, %149 ], [ %148, %147 ]
%151 = getelementptr inbounds double, double* %3, i64 %150
%152 = load double, double* %151
%153 = tail call double @llvm.fabs.f64(double %152)
%154 = getelementptr inbounds double, double* %5, i64 %150
%155 = load double, double* %154
%156 = tail call double @llvm.fabs.f64(double %155)
%157 = fdiv double 1.000000e+00, %156
%158 = fcmp ogt double %153, %157
%159 = select i1 %158, double %153, double %157
%160 = getelementptr inbounds double, double* %2, i64 %150
%161 = load double, double* %160
%162 = fsub double %152, %161
%163 = tail call double @llvm.fabs.f64(double %162)
%164 = fdiv double %163, %159
%165 = getelementptr inbounds double, double* %12, i64 %150
store double %164, double* %165
%166 = add nuw nsw i64 %150, 1
%167 = icmp eq i64 %166, %99
br i1 %167, label %168, label %149
168: ; preds = %149, %145, %94, %97
%169 = tail call double @array_max_abs(double* %12, i32 %1)
%170 = fcmp ugt double %169, %8
br i1 %170, label %172, label %171
171: ; preds = %168
br label %172
172: ; preds = %94, %91, %168, %171
%173 = phi i32 [ 2, %171 ], [ 0, %168 ], [ 1, %91 ], [ 1, %94 ]
%174 = tail call i32 @free(double* %12)
ret i32 %173
}