#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 stopcheck(double fx, int N, double *xc, double *xf, double *jac, double *dx,
              double fsval, double gtol, double stol, int retval) {
  int rcode, i;
  double num, den;
  double stop0;
  double *scheck;
  rcode = 0;
  if (retval == 1) {
    rcode = 3;
    return rcode;
  }
  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):
<stopcheck>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movsd  %xmm0,-0x10(%rbp)
mov    %edi,-0x14(%rbp)
mov    %rsi,-0x20(%rbp)
mov    %rdx,-0x28(%rbp)
mov    %rcx,-0x30(%rbp)
mov    %r8,-0x38(%rbp)
movsd  %xmm1,-0x40(%rbp)
movsd  %xmm2,-0x48(%rbp)
movsd  %xmm3,-0x50(%rbp)
mov    %r9d,-0x54(%rbp)
movl   $0x0,-0x58(%rbp)
cmpl   $0x1,-0x54(%rbp)
jne    1189 <stopcheck+0x59>
movl   $0x3,-0x58(%rbp)
mov    -0x58(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    143a <stopcheck+0x30a>
movslq -0x14(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,-0x80(%rbp)
movsd  -0x10(%rbp),%xmm0
movaps 0xe58(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  -0x40(%rbp),%xmm1
movaps 0xe48(%rip),%xmm2
pand   %xmm2,%xmm1
ucomisd %xmm1,%xmm0
jbe    11e0 <stopcheck+0xb0>
movsd  -0x10(%rbp),%xmm0
movaps 0xe2e(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
jmp    11f5 <stopcheck+0xc5>
movsd  -0x40(%rbp),%xmm0
movaps 0xe14(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
movl   $0x0,-0x5c(%rbp)
mov    -0x5c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    12d6 <stopcheck+0x1a6>
mov    -0x28(%rbp),%rax
movslq -0x5c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movaps 0xde4(%rip),%xmm1
pand   %xmm1,%xmm0
mov    -0x38(%rbp),%rax
movslq -0x5c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
movaps 0xdcc(%rip),%xmm1
pand   %xmm1,%xmm2
movsd  0xdd0(%rip),%xmm1
divsd  %xmm2,%xmm1
ucomisd %xmm1,%xmm0
jbe    1270 <stopcheck+0x140>
mov    -0x28(%rbp),%rax
movslq -0x5c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movaps 0xd9e(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
jmp    1299 <stopcheck+0x169>
mov    -0x38(%rbp),%rax
movslq -0x5c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
movaps 0xd7c(%rip),%xmm0
pand   %xmm0,%xmm1
movsd  0xd80(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
mov    -0x30(%rbp),%rax
movslq -0x5c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movaps 0xd53(%rip),%xmm1
pand   %xmm1,%xmm0
mulsd  -0x68(%rbp),%xmm0
divsd  -0x70(%rbp),%xmm0
mov    -0x80(%rbp),%rax
movslq -0x5c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x5c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x5c(%rbp)
jmp    11fc <stopcheck+0xcc>
mov    -0x80(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1050 <array_max_abs@plt>
movsd  %xmm0,-0x78(%rbp)
movsd  -0x78(%rbp),%xmm1
movsd  -0x48(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jb     1307 <stopcheck+0x1d7>
movl   $0x1,-0x58(%rbp)
jmp    142b <stopcheck+0x2fb>
movl   $0x0,-0x5c(%rbp)
mov    -0x5c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    13fa <stopcheck+0x2ca>
mov    -0x28(%rbp),%rax
movslq -0x5c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movaps 0xcd2(%rip),%xmm1
pand   %xmm1,%xmm0
mov    -0x38(%rbp),%rax
movslq -0x5c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
movaps 0xcba(%rip),%xmm1
pand   %xmm1,%xmm2
movsd  0xcbe(%rip),%xmm1
divsd  %xmm2,%xmm1
ucomisd %xmm1,%xmm0
jbe    1382 <stopcheck+0x252>
mov    -0x28(%rbp),%rax
movslq -0x5c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movaps 0xc8c(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
jmp    13ab <stopcheck+0x27b>
mov    -0x38(%rbp),%rax
movslq -0x5c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
movaps 0xc6a(%rip),%xmm0
pand   %xmm0,%xmm1
movsd  0xc6e(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
mov    -0x28(%rbp),%rax
movslq -0x5c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x20(%rbp),%rax
movslq -0x5c(%rbp),%rcx
subsd  (%rax,%rcx,8),%xmm0
movaps 0xc34(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  -0x68(%rbp),%xmm0
divsd  -0x70(%rbp),%xmm0
mov    -0x80(%rbp),%rax
movslq -0x5c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x5c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x5c(%rbp)
jmp    130e <stopcheck+0x1de>
mov    -0x80(%rbp),%rdi
mov    -0x14(%rbp),%esi
call   1050 <array_max_abs@plt>
movsd  %xmm0,-0x78(%rbp)
movsd  -0x78(%rbp),%xmm1
movsd  -0x50(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jb     1426 <stopcheck+0x2f6>
movl   $0x2,-0x58(%rbp)
jmp    142b <stopcheck+0x2fb>
mov    -0x80(%rbp),%rdi
call   1030 <free@plt>
mov    -0x58(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stopcheck>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x48,%rsp
mov    $0x3,%r14d
cmp    $0x1,%r9d
je     1485 <stopcheck+0x355>
mov    %r8,%r15
mov    %rcx,%rbp
mov    %rdx,%r12
mov    %edi,%eax
movapd %xmm1,0x20(%rsp)
movapd %xmm0,0x30(%rsp)
movsd  %xmm2,0x8(%rsp)
mov    %rsi,0x18(%rsp)
movsd  %xmm3,0x10(%rsp)
lea    0x0(,%rax,8),%edi
mov    %rax,%r14
call   1040 <malloc@plt>
mov    %r14,%rsi
mov    %rax,%rbx
test   %esi,%esi
jle    1256 <stopcheck+0x126>
movapd 0xe65(%rip),%xmm6
movapd 0x30(%rsp),%xmm7
andpd  %xmm6,%xmm7
movapd 0x20(%rsp),%xmm0
andpd  %xmm6,%xmm0
maxsd  %xmm0,%xmm7
mov    %esi,%r13d
cmp    $0x1,%esi
jne    127c <stopcheck+0x14c>
xor    %eax,%eax
movsd  0xe57(%rip),%xmm0
nopl   0x0(%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,%r13
jne    11d0 <stopcheck+0xa0>
mov    %rbx,%rdi
call   1050 <array_max_abs@plt>
movapd 0xde0(%rip),%xmm6
mov    %r14,%rsi
mov    $0x1,%r14d
movsd  0x8(%rsp),%xmm1
ucomisd %xmm0,%xmm1
mov    0x18(%rsp),%rbp
jae    147d <stopcheck+0x34d>
test   %esi,%esi
jle    1460 <stopcheck+0x330>
cmp    $0x1,%esi
jne    134e <stopcheck+0x21e>
xor    %eax,%eax
jmp    1409 <stopcheck+0x2d9>
mov    %rbx,%rdi
call   1050 <array_max_abs@plt>
mov    %r14,%rsi
mov    $0x1,%r14d
movsd  0x8(%rsp),%xmm1
ucomisd %xmm0,%xmm1
jb     1460 <stopcheck+0x330>
jmp    147d <stopcheck+0x34d>
lea    (%rbx,%r13,8),%rax
lea    (%r12,%r13,8),%rcx
lea    (%r15,%r13,8),%rdx
cmp    %rcx,%rbx
setb   %r8b
cmp    %r12,%rax
seta   %r9b
cmp    %rdx,%rbx
setb   %cl
cmp    %r15,%rax
seta   %r10b
lea    0x0(,%r13,8),%rdx
add    %rbp,%rdx
cmp    %rdx,%rbx
setb   %dl
cmp    %rbp,%rax
seta   %dil
xor    %eax,%eax
test   %r9b,%r8b
jne    11c1 <stopcheck+0x91>
and    %r10b,%cl
jne    11c1 <stopcheck+0x91>
and    %dil,%dl
jne    11c1 <stopcheck+0x91>
mov    %r13d,%eax
and    $0xfffffffe,%eax
movapd %xmm7,%xmm0
unpcklpd %xmm7,%xmm0
xor    %ecx,%ecx
movapd 0xd10(%rip),%xmm1
movapd 0xd18(%rip),%xmm2
nopl   0x0(%rax,%rax,1)
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    1300 <stopcheck+0x1d0>
cmp    %r13,%rax
jne    11c1 <stopcheck+0x91>
jmp    1210 <stopcheck+0xe0>
lea    (%rbx,%r13,8),%rax
lea    (%r12,%r13,8),%rcx
lea    (%r15,%r13,8),%rdx
cmp    %rcx,%rbx
setb   %r8b
cmp    %r12,%rax
seta   %r9b
cmp    %rdx,%rbx
setb   %cl
cmp    %r15,%rax
seta   %r10b
lea    0x0(,%r13,8),%rdx
add    %rbp,%rdx
cmp    %rdx,%rbx
setb   %dl
cmp    %rbp,%rax
seta   %dil
xor    %eax,%eax
test   %r9b,%r8b
jne    1409 <stopcheck+0x2d9>
and    %r10b,%cl
jne    1409 <stopcheck+0x2d9>
and    %dil,%dl
jne    1409 <stopcheck+0x2d9>
mov    %r13d,%eax
and    $0xfffffffe,%eax
xor    %ecx,%ecx
movapd 0xc52(%rip),%xmm0
movapd 0xc5a(%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(%rbp,%rcx,8),%xmm4
subpd  %xmm4,%xmm2
andpd  %xmm0,%xmm2
divpd  %xmm3,%xmm2
movupd %xmm2,(%rbx,%rcx,8)
add    $0x2,%rcx
cmp    %rcx,%rax
jne    13c0 <stopcheck+0x290>
cmp    %r13,%rax
je     1460 <stopcheck+0x330>
movsd  0xc0f(%rip),%xmm0
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
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(%rbp,%rax,8),%xmm1
andpd  %xmm6,%xmm1
divsd  %xmm2,%xmm1
movsd  %xmm1,(%rbx,%rax,8)
add    $0x1,%rax
cmp    %rax,%r13
jne    1420 <stopcheck+0x2f0>
mov    %rbx,%rdi
call   1050 <array_max_abs@plt>
xor    %r14d,%r14d
movsd  0x10(%rsp),%xmm1
ucomisd %xmm0,%xmm1
jb     147d <stopcheck+0x34d>
mov    $0x2,%r14d
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %r14d,%eax
add    $0x48,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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