#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;
  }
  if (retval == 5) {
    rcode = 5;
    return rcode;
  }
  if (retval == 15) {
    rcode = 15;
    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    1472 <stopcheck+0x342>
cmpl   $0x5,-0x54(%rbp)
jne    11a5 <stopcheck+0x75>
movl   $0x5,-0x58(%rbp)
mov    -0x58(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1472 <stopcheck+0x342>
cmpl   $0xf,-0x54(%rbp)
jne    11c1 <stopcheck+0x91>
movl   $0xf,-0x58(%rbp)
mov    -0x58(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1472 <stopcheck+0x342>
movslq -0x14(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,-0x80(%rbp)
movsd  -0x10(%rbp),%xmm0
movaps 0xe20(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  -0x40(%rbp),%xmm1
movaps 0xe10(%rip),%xmm2
pand   %xmm2,%xmm1
ucomisd %xmm1,%xmm0
jbe    1218 <stopcheck+0xe8>
movsd  -0x10(%rbp),%xmm0
movaps 0xdf6(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
jmp    122d <stopcheck+0xfd>
movsd  -0x40(%rbp),%xmm0
movaps 0xddc(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
movl   $0x0,-0x5c(%rbp)
mov    -0x5c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    130e <stopcheck+0x1de>
mov    -0x28(%rbp),%rax
movslq -0x5c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movaps 0xdac(%rip),%xmm1
pand   %xmm1,%xmm0
mov    -0x38(%rbp),%rax
movslq -0x5c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
movaps 0xd94(%rip),%xmm1
pand   %xmm1,%xmm2
movsd  0xd98(%rip),%xmm1
divsd  %xmm2,%xmm1
ucomisd %xmm1,%xmm0
jbe    12a8 <stopcheck+0x178>
mov    -0x28(%rbp),%rax
movslq -0x5c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movaps 0xd66(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
jmp    12d1 <stopcheck+0x1a1>
mov    -0x38(%rbp),%rax
movslq -0x5c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
movaps 0xd44(%rip),%xmm0
pand   %xmm0,%xmm1
movsd  0xd48(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
mov    -0x30(%rbp),%rax
movslq -0x5c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movaps 0xd1b(%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    1234 <stopcheck+0x104>
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     133f <stopcheck+0x20f>
movl   $0x1,-0x58(%rbp)
jmp    1463 <stopcheck+0x333>
movl   $0x0,-0x5c(%rbp)
mov    -0x5c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1432 <stopcheck+0x302>
mov    -0x28(%rbp),%rax
movslq -0x5c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movaps 0xc9a(%rip),%xmm1
pand   %xmm1,%xmm0
mov    -0x38(%rbp),%rax
movslq -0x5c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
movaps 0xc82(%rip),%xmm1
pand   %xmm1,%xmm2
movsd  0xc86(%rip),%xmm1
divsd  %xmm2,%xmm1
ucomisd %xmm1,%xmm0
jbe    13ba <stopcheck+0x28a>
mov    -0x28(%rbp),%rax
movslq -0x5c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movaps 0xc54(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
jmp    13e3 <stopcheck+0x2b3>
mov    -0x38(%rbp),%rax
movslq -0x5c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
movaps 0xc32(%rip),%xmm0
pand   %xmm0,%xmm1
movsd  0xc36(%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 0xbfc(%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    1346 <stopcheck+0x216>
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     145e <stopcheck+0x32e>
movl   $0x2,-0x58(%rbp)
jmp    1463 <stopcheck+0x333>
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
cmp    $0x1,%r9d
je     1266 <stopcheck+0x136>
mov    %r9d,%r14d
cmp    $0xf,%r9d
je     14a5 <stopcheck+0x375>
cmp    $0x5,%r14d
je     14a5 <stopcheck+0x375>
mov    %r8,%r12
mov    %rcx,%rbp
mov    %rdx,%rbx
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,%r15
test   %esi,%esi
jle    1271 <stopcheck+0x141>
movapd 0xe54(%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    1297 <stopcheck+0x167>
xor    %eax,%eax
movsd  0xe46(%rip),%xmm0
nopw   0x0(%rax,%rax,1)
movsd  (%rbx,%rax,8),%xmm1
andpd  %xmm6,%xmm1
movsd  (%r12,%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,(%r15,%rax,8)
add    $0x1,%rax
cmp    %rax,%r13
jne    11e0 <stopcheck+0xb0>
mov    %r15,%rdi
call   1050 <array_max_abs@plt>
movapd 0xdd0(%rip),%xmm6
mov    %r14,%rsi
mov    $0x1,%r14d
movsd  0x8(%rsp),%xmm1
ucomisd %xmm0,%xmm1
mov    0x18(%rsp),%rbp
jae    149d <stopcheck+0x36d>
test   %esi,%esi
jle    1480 <stopcheck+0x350>
cmp    $0x1,%esi
jne    136e <stopcheck+0x23e>
xor    %eax,%eax
jmp    1429 <stopcheck+0x2f9>
mov    $0x3,%r14d
jmp    14a5 <stopcheck+0x375>
mov    %r15,%rdi
call   1050 <array_max_abs@plt>
mov    %r14,%rsi
mov    $0x1,%r14d
movsd  0x8(%rsp),%xmm1
ucomisd %xmm0,%xmm1
jb     1480 <stopcheck+0x350>
jmp    149d <stopcheck+0x36d>
lea    (%r15,%r13,8),%rax
lea    (%rbx,%r13,8),%rcx
lea    (%r12,%r13,8),%rdx
cmp    %rcx,%r15
setb   %r8b
cmp    %rbx,%rax
seta   %r9b
cmp    %rdx,%r15
setb   %cl
cmp    %r12,%rax
seta   %r10b
lea    0x0(,%r13,8),%rdx
add    %rbp,%rdx
cmp    %rdx,%r15
setb   %dl
cmp    %rbp,%rax
seta   %dil
xor    %eax,%eax
test   %r9b,%r8b
jne    11d2 <stopcheck+0xa2>
and    %r10b,%cl
jne    11d2 <stopcheck+0xa2>
and    %dil,%dl
jne    11d2 <stopcheck+0xa2>
mov    %r13d,%eax
and    $0xfffffffe,%eax
movapd %xmm7,%xmm0
unpcklpd %xmm7,%xmm0
xor    %ecx,%ecx
movapd 0xcf5(%rip),%xmm1
movapd 0xcfd(%rip),%xmm2
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movupd (%rbx,%rcx,8),%xmm3
andpd  %xmm1,%xmm3
movupd (%r12,%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,(%r15,%rcx,8)
add    $0x2,%rcx
cmp    %rcx,%rax
jne    1320 <stopcheck+0x1f0>
cmp    %r13,%rax
jne    11d2 <stopcheck+0xa2>
jmp    1220 <stopcheck+0xf0>
lea    (%r15,%r13,8),%rax
lea    (%rbx,%r13,8),%rcx
lea    (%r12,%r13,8),%rdx
cmp    %rcx,%r15
setb   %r8b
cmp    %rbx,%rax
seta   %r9b
cmp    %rdx,%r15
setb   %cl
cmp    %r12,%rax
seta   %r10b
lea    0x0(,%r13,8),%rdx
add    %rbp,%rdx
cmp    %rdx,%r15
setb   %dl
cmp    %rbp,%rax
seta   %dil
xor    %eax,%eax
test   %r9b,%r8b
jne    1429 <stopcheck+0x2f9>
and    %r10b,%cl
jne    1429 <stopcheck+0x2f9>
and    %dil,%dl
jne    1429 <stopcheck+0x2f9>
mov    %r13d,%eax
and    $0xfffffffe,%eax
xor    %ecx,%ecx
movapd 0xc32(%rip),%xmm0
movapd 0xc3a(%rip),%xmm1
cs nopw 0x0(%rax,%rax,1)
movupd (%rbx,%rcx,8),%xmm2
movapd %xmm2,%xmm3
andpd  %xmm0,%xmm3
movupd (%r12,%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,(%r15,%rcx,8)
add    $0x2,%rcx
cmp    %rcx,%rax
jne    13e0 <stopcheck+0x2b0>
cmp    %r13,%rax
je     1480 <stopcheck+0x350>
movsd  0xbef(%rip),%xmm0
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsd  (%rbx,%rax,8),%xmm1
movapd %xmm1,%xmm2
andpd  %xmm6,%xmm2
movsd  (%r12,%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,(%r15,%rax,8)
add    $0x1,%rax
cmp    %rax,%r13
jne    1440 <stopcheck+0x310>
mov    %r15,%rdi
call   1050 <array_max_abs@plt>
xor    %r14d,%r14d
movsd  0x10(%rsp),%xmm1
ucomisd %xmm0,%xmm1
jb     149d <stopcheck+0x36d>
mov    $0x2,%r14d
mov    %r15,%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 %192
32: ; preds = %10
%33 = load i32, i32* %21
%34 = icmp eq i32 %33, 5
br i1 %34, label %35, label %37
35: ; preds = %32
store i32 5, i32* %22
%36 = load i32, i32* %22
store i32 %36, i32* %11
br label %192
37: ; preds = %32
%38 = load i32, i32* %21
%39 = icmp eq i32 %38, 15
br i1 %39, label %40, label %42
40: ; preds = %37
store i32 15, i32* %22
%41 = load i32, i32* %22
store i32 %41, i32* %11
br label %192
42: ; preds = %37
%43 = load i32, i32* %13
%44 = sext i32 %43 to i64
%45 = mul i64 8, %44
%46 = trunc i64 %45 to i32
%47 = call i64 @malloc(i32 %46)
%48 = inttoptr i64 %47 to double*
store double* %48, double** %27
%49 = load double, double* %12
%50 = call double @llvm.fabs.f64(double %49)
%51 = load double, double* %18
%52 = call double @llvm.fabs.f64(double %51)
%53 = fcmp ogt double %50, %52
br i1 %53, label %54, label %57
54: ; preds = %42
%55 = load double, double* %12
%56 = call double @llvm.fabs.f64(double %55)
store double %56, double* %25
br label %60
57: ; preds = %42
%58 = load double, double* %18
%59 = call double @llvm.fabs.f64(double %58)
store double %59, double* %25
br label %60
60: ; preds = %57, %54
store i32 0, i32* %23
br label %61
61: ; preds = %110, %60
%62 = load i32, i32* %23
%63 = load i32, i32* %13
%64 = icmp slt i32 %62, %63
br i1 %64, label %65, label %113
65: ; preds = %61
%66 = load double*, double** %15
%67 = load i32, i32* %23
%68 = sext i32 %67 to i64
%69 = getelementptr inbounds double, double* %66, i64 %68
%70 = load double, double* %69
%71 = call double @llvm.fabs.f64(double %70)
%72 = load double*, double** %17
%73 = load i32, i32* %23
%74 = sext i32 %73 to i64
%75 = getelementptr inbounds double, double* %72, i64 %74
%76 = load double, double* %75
%77 = call double @llvm.fabs.f64(double %76)
%78 = fdiv double 1.000000e+00, %77
%79 = fcmp ogt double %71, %78
br i1 %79, label %80, label %87
80: ; preds = %65
%81 = load double*, double** %15
%82 = load i32, i32* %23
%83 = sext i32 %82 to i64
%84 = getelementptr inbounds double, double* %81, i64 %83
%85 = load double, double* %84
%86 = call double @llvm.fabs.f64(double %85)
store double %86, double* %24
br label %95
87: ; preds = %65
%88 = load double*, double** %17
%89 = load i32, i32* %23
%90 = sext i32 %89 to i64
%91 = getelementptr inbounds double, double* %88, i64 %90
%92 = load double, double* %91
%93 = call double @llvm.fabs.f64(double %92)
%94 = fdiv double 1.000000e+00, %93
store double %94, double* %24
br label %95
95: ; preds = %87, %80
%96 = load double*, double** %16
%97 = load i32, i32* %23
%98 = sext i32 %97 to i64
%99 = getelementptr inbounds double, double* %96, i64 %98
%100 = load double, double* %99
%101 = call double @llvm.fabs.f64(double %100)
%102 = load double, double* %24
%103 = fmul double %101, %102
%104 = load double, double* %25
%105 = fdiv double %103, %104
%106 = load double*, double** %27
%107 = load i32, i32* %23
%108 = sext i32 %107 to i64
%109 = getelementptr inbounds double, double* %106, i64 %108
store double %105, double* %109
br label %110
110: ; preds = %95
%111 = load i32, i32* %23
%112 = add nsw i32 %111, 1
store i32 %112, i32* %23
br label %61
113: ; preds = %61
%114 = load double*, double** %27
%115 = load i32, i32* %13
%116 = call double @array_max_abs(double* %114, i32 %115)
store double %116, double* %26
%117 = load double, double* %26
%118 = load double, double* %19
%119 = fcmp ole double %117, %118
br i1 %119, label %120, label %121
120: ; preds = %113
store i32 1, i32* %22
br label %188
121: ; preds = %113
store i32 0, i32* %23
br label %122
122: ; preds = %176, %121
%123 = load i32, i32* %23
%124 = load i32, i32* %13
%125 = icmp slt i32 %123, %124
br i1 %125, label %126, label %179
126: ; preds = %122
%127 = load double*, double** %15
%128 = load i32, i32* %23
%129 = sext i32 %128 to i64
%130 = getelementptr inbounds double, double* %127, i64 %129
%131 = load double, double* %130
%132 = call double @llvm.fabs.f64(double %131)
%133 = load double*, double** %17
%134 = load i32, i32* %23
%135 = sext i32 %134 to i64
%136 = getelementptr inbounds double, double* %133, i64 %135
%137 = load double, double* %136
%138 = call double @llvm.fabs.f64(double %137)
%139 = fdiv double 1.000000e+00, %138
%140 = fcmp ogt double %132, %139
br i1 %140, label %141, label %148
141: ; preds = %126
%142 = load double*, double** %15
%143 = load i32, i32* %23
%144 = sext i32 %143 to i64
%145 = getelementptr inbounds double, double* %142, i64 %144
%146 = load double, double* %145
%147 = call double @llvm.fabs.f64(double %146)
store double %147, double* %25
br label %156
148: ; preds = %126
%149 = load double*, double** %17
%150 = load i32, i32* %23
%151 = sext i32 %150 to i64
%152 = getelementptr inbounds double, double* %149, i64 %151
%153 = load double, double* %152
%154 = call double @llvm.fabs.f64(double %153)
%155 = fdiv double 1.000000e+00, %154
store double %155, double* %25
br label %156
156: ; preds = %148, %141
%157 = load double*, double** %15
%158 = load i32, i32* %23
%159 = sext i32 %158 to i64
%160 = getelementptr inbounds double, double* %157, i64 %159
%161 = load double, double* %160
%162 = load double*, double** %14
%163 = load i32, i32* %23
%164 = sext i32 %163 to i64
%165 = getelementptr inbounds double, double* %162, i64 %164
%166 = load double, double* %165
%167 = fsub double %161, %166
%168 = call double @llvm.fabs.f64(double %167)
store double %168, double* %24
%169 = load double, double* %24
%170 = load double, double* %25
%171 = fdiv double %169, %170
%172 = load double*, double** %27
%173 = load i32, i32* %23
%174 = sext i32 %173 to i64
%175 = getelementptr inbounds double, double* %172, i64 %174
store double %171, double* %175
br label %176
176: ; preds = %156
%177 = load i32, i32* %23
%178 = add nsw i32 %177, 1
store i32 %178, i32* %23
br label %122
179: ; preds = %122
%180 = load double*, double** %27
%181 = load i32, i32* %13
%182 = call double @array_max_abs(double* %180, i32 %181)
store double %182, double* %26
%183 = load double, double* %26
%184 = load double, double* %20
%185 = fcmp ole double %183, %184
br i1 %185, label %186, label %187
186: ; preds = %179
store i32 2, i32* %22
br label %187
187: ; preds = %186, %179
br label %188
188: ; preds = %187, %120
%189 = load double*, double** %27
%190 = call i32 @free(double* %189)
%191 = load i32, i32* %22
store i32 %191, i32* %11
br label %192
192: ; preds = %188, %40, %35, %30
%193 = load i32, i32* %11
ret i32 %193
}

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