#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;
  }
  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    1456 <stopcheck+0x326>
cmpl   $0x5,-0x54(%rbp)
jne    11a5 <stopcheck+0x75>
movl   $0x5,-0x58(%rbp)
mov    -0x58(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1456 <stopcheck+0x326>
movslq -0x14(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1040 <malloc@plt>
mov    %rax,-0x80(%rbp)
movsd  -0x10(%rbp),%xmm0
movaps 0xe3c(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  -0x40(%rbp),%xmm1
movaps 0xe2c(%rip),%xmm2
pand   %xmm2,%xmm1
ucomisd %xmm1,%xmm0
jbe    11fc <stopcheck+0xcc>
movsd  -0x10(%rbp),%xmm0
movaps 0xe12(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
jmp    1211 <stopcheck+0xe1>
movsd  -0x40(%rbp),%xmm0
movaps 0xdf8(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
movl   $0x0,-0x5c(%rbp)
mov    -0x5c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    12f2 <stopcheck+0x1c2>
mov    -0x28(%rbp),%rax
movslq -0x5c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movaps 0xdc8(%rip),%xmm1
pand   %xmm1,%xmm0
mov    -0x38(%rbp),%rax
movslq -0x5c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
movaps 0xdb0(%rip),%xmm1
pand   %xmm1,%xmm2
movsd  0xdb4(%rip),%xmm1
divsd  %xmm2,%xmm1
ucomisd %xmm1,%xmm0
jbe    128c <stopcheck+0x15c>
mov    -0x28(%rbp),%rax
movslq -0x5c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movaps 0xd82(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
jmp    12b5 <stopcheck+0x185>
mov    -0x38(%rbp),%rax
movslq -0x5c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
movaps 0xd60(%rip),%xmm0
pand   %xmm0,%xmm1
movsd  0xd64(%rip),%xmm0
divsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
mov    -0x30(%rbp),%rax
movslq -0x5c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movaps 0xd37(%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    1218 <stopcheck+0xe8>
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     1323 <stopcheck+0x1f3>
movl   $0x1,-0x58(%rbp)
jmp    1447 <stopcheck+0x317>
movl   $0x0,-0x5c(%rbp)
mov    -0x5c(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    1416 <stopcheck+0x2e6>
mov    -0x28(%rbp),%rax
movslq -0x5c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movaps 0xcb6(%rip),%xmm1
pand   %xmm1,%xmm0
mov    -0x38(%rbp),%rax
movslq -0x5c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm2
movaps 0xc9e(%rip),%xmm1
pand   %xmm1,%xmm2
movsd  0xca2(%rip),%xmm1
divsd  %xmm2,%xmm1
ucomisd %xmm1,%xmm0
jbe    139e <stopcheck+0x26e>
mov    -0x28(%rbp),%rax
movslq -0x5c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movaps 0xc70(%rip),%xmm1
pand   %xmm1,%xmm0
movsd  %xmm0,-0x70(%rbp)
jmp    13c7 <stopcheck+0x297>
mov    -0x38(%rbp),%rax
movslq -0x5c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
movaps 0xc4e(%rip),%xmm0
pand   %xmm0,%xmm1
movsd  0xc52(%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 0xc18(%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    132a <stopcheck+0x1fa>
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     1442 <stopcheck+0x312>
movl   $0x2,-0x58(%rbp)
jmp    1447 <stopcheck+0x317>
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     1154 <stopcheck+0x24>
cmp    $0x5,%r9d
jne    115e <stopcheck+0x2e>
mov    $0x5,%ebp
jmp    1494 <stopcheck+0x364>
mov    $0x3,%ebp
jmp    1494 <stopcheck+0x364>
mov    %r8,%r15
mov    %rcx,%rbp
mov    %rdx,%rbx
mov    %rsi,%r13
mov    %edi,%eax
movapd %xmm1,0x20(%rsp)
movapd %xmm0,0x30(%rsp)
movsd  %xmm2,0x10(%rsp)
movsd  %xmm3,0x18(%rsp)
lea    0x0(,%rax,8),%edi
mov    %rax,0x8(%rsp)
call   1040 <malloc@plt>
mov    0x8(%rsp),%rsi
mov    %rax,%r12
test   %esi,%esi
jle    1262 <stopcheck+0x132>
movapd 0xe53(%rip),%xmm6
movapd 0x30(%rsp),%xmm7
andpd  %xmm6,%xmm7
movapd 0x20(%rsp),%xmm0
andpd  %xmm6,%xmm0
maxsd  %xmm0,%xmm7
mov    %esi,%r14d
cmp    $0x1,%esi
jne    1289 <stopcheck+0x159>
xor    %eax,%eax
movsd  0xe45(%rip),%xmm0
nopl   0x0(%rax,%rax,1)
movsd  (%rbx,%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,(%r12,%rax,8)
add    $0x1,%rax
cmp    %rax,%r14
jne    11e0 <stopcheck+0xb0>
mov    %r12,%rdi
call   1050 <array_max_abs@plt>
movapd 0xdd0(%rip),%xmm6
mov    0x8(%rsp),%rsi
mov    $0x1,%ebp
movsd  0x10(%rsp),%xmm1
ucomisd %xmm0,%xmm1
jae    148c <stopcheck+0x35c>
test   %esi,%esi
jle    1471 <stopcheck+0x341>
cmp    $0x1,%esi
jne    135e <stopcheck+0x22e>
xor    %eax,%eax
jmp    141a <stopcheck+0x2ea>
mov    %r12,%rdi
call   1050 <array_max_abs@plt>
mov    0x8(%rsp),%rsi
mov    $0x1,%ebp
movsd  0x10(%rsp),%xmm1
ucomisd %xmm0,%xmm1
jb     1471 <stopcheck+0x341>
jmp    148c <stopcheck+0x35c>
lea    (%r12,%r14,8),%rax
lea    (%rbx,%r14,8),%rcx
lea    (%r15,%r14,8),%rdx
cmp    %rcx,%r12
setb   %r8b
cmp    %rbx,%rax
seta   %r9b
cmp    %rdx,%r12
setb   %cl
cmp    %r15,%rax
seta   %r10b
lea    0x0(,%r14,8),%rdx
add    %rbp,%rdx
cmp    %rdx,%r12
setb   %dl
cmp    %rbp,%rax
seta   %dil
xor    %eax,%eax
test   %r9b,%r8b
jne    11d3 <stopcheck+0xa3>
and    %r10b,%cl
jne    11d3 <stopcheck+0xa3>
and    %dil,%dl
jne    11d3 <stopcheck+0xa3>
mov    %r14d,%eax
and    $0xfffffffe,%eax
movapd %xmm7,%xmm0
unpcklpd %xmm7,%xmm0
xor    %ecx,%ecx
movapd 0xd03(%rip),%xmm1
movapd 0xd0b(%rip),%xmm2
cs nopw 0x0(%rax,%rax,1)
nop
movupd (%rbx,%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,(%r12,%rcx,8)
add    $0x2,%rcx
cmp    %rcx,%rax
jne    1310 <stopcheck+0x1e0>
cmp    %r14,%rax
jne    11d3 <stopcheck+0xa3>
jmp    1220 <stopcheck+0xf0>
lea    (%r12,%r14,8),%rax
lea    (%rbx,%r14,8),%rcx
lea    (%r15,%r14,8),%rdx
cmp    %rcx,%r12
setb   %r8b
cmp    %rbx,%rax
seta   %r9b
cmp    %rdx,%r12
setb   %cl
cmp    %r15,%rax
seta   %r10b
lea    0x0(,%r14,8),%rdx
add    %r13,%rdx
cmp    %rdx,%r12
setb   %dl
cmp    %r13,%rax
seta   %dil
xor    %eax,%eax
test   %r9b,%r8b
jne    141a <stopcheck+0x2ea>
and    %r10b,%cl
jne    141a <stopcheck+0x2ea>
and    %dil,%dl
jne    141a <stopcheck+0x2ea>
mov    %r14d,%eax
and    $0xfffffffe,%eax
xor    %ecx,%ecx
movapd 0xc42(%rip),%xmm0
movapd 0xc4a(%rip),%xmm1
cs nopw 0x0(%rax,%rax,1)
movupd (%rbx,%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,(%r12,%rcx,8)
add    $0x2,%rcx
cmp    %rcx,%rax
jne    13d0 <stopcheck+0x2a0>
cmp    %r14,%rax
je     1471 <stopcheck+0x341>
movsd  0xbfe(%rip),%xmm0
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsd  (%rbx,%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,(%r12,%rax,8)
add    $0x1,%rax
cmp    %rax,%r14
jne    1430 <stopcheck+0x300>
mov    %r12,%rdi
call   1050 <array_max_abs@plt>
xor    %ebp,%ebp
movsd  0x18(%rsp),%xmm1
ucomisd %xmm0,%xmm1
jb     148c <stopcheck+0x35c>
mov    $0x2,%ebp
mov    %r12,%rdi
call   1030 <free@plt>
mov    %ebp,%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 %187
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 %187
37: ; preds = %32
%38 = load i32, i32* %13
%39 = sext i32 %38 to i64
%40 = mul i64 8, %39
%41 = trunc i64 %40 to i32
%42 = call i64 @malloc(i32 %41)
%43 = inttoptr i64 %42 to double*
store double* %43, double** %27
%44 = load double, double* %12
%45 = call double @llvm.fabs.f64(double %44)
%46 = load double, double* %18
%47 = call double @llvm.fabs.f64(double %46)
%48 = fcmp ogt double %45, %47
br i1 %48, label %49, label %52
49: ; preds = %37
%50 = load double, double* %12
%51 = call double @llvm.fabs.f64(double %50)
store double %51, double* %25
br label %55
52: ; preds = %37
%53 = load double, double* %18
%54 = call double @llvm.fabs.f64(double %53)
store double %54, double* %25
br label %55
55: ; preds = %52, %49
store i32 0, i32* %23
br label %56
56: ; preds = %105, %55
%57 = load i32, i32* %23
%58 = load i32, i32* %13
%59 = icmp slt i32 %57, %58
br i1 %59, label %60, label %108
60: ; preds = %56
%61 = load double*, double** %15
%62 = load i32, i32* %23
%63 = sext i32 %62 to i64
%64 = getelementptr inbounds double, double* %61, i64 %63
%65 = load double, double* %64
%66 = call double @llvm.fabs.f64(double %65)
%67 = load double*, double** %17
%68 = load i32, i32* %23
%69 = sext i32 %68 to i64
%70 = getelementptr inbounds double, double* %67, i64 %69
%71 = load double, double* %70
%72 = call double @llvm.fabs.f64(double %71)
%73 = fdiv double 1.000000e+00, %72
%74 = fcmp ogt double %66, %73
br i1 %74, label %75, label %82
75: ; preds = %60
%76 = load double*, double** %15
%77 = load i32, i32* %23
%78 = sext i32 %77 to i64
%79 = getelementptr inbounds double, double* %76, i64 %78
%80 = load double, double* %79
%81 = call double @llvm.fabs.f64(double %80)
store double %81, double* %24
br label %90
82: ; preds = %60
%83 = load double*, double** %17
%84 = load i32, i32* %23
%85 = sext i32 %84 to i64
%86 = getelementptr inbounds double, double* %83, i64 %85
%87 = load double, double* %86
%88 = call double @llvm.fabs.f64(double %87)
%89 = fdiv double 1.000000e+00, %88
store double %89, double* %24
br label %90
90: ; preds = %82, %75
%91 = load double*, double** %16
%92 = load i32, i32* %23
%93 = sext i32 %92 to i64
%94 = getelementptr inbounds double, double* %91, i64 %93
%95 = load double, double* %94
%96 = call double @llvm.fabs.f64(double %95)
%97 = load double, double* %24
%98 = fmul double %96, %97
%99 = load double, double* %25
%100 = fdiv double %98, %99
%101 = load double*, double** %27
%102 = load i32, i32* %23
%103 = sext i32 %102 to i64
%104 = getelementptr inbounds double, double* %101, i64 %103
store double %100, double* %104
br label %105
105: ; preds = %90
%106 = load i32, i32* %23
%107 = add nsw i32 %106, 1
store i32 %107, i32* %23
br label %56
108: ; preds = %56
%109 = load double*, double** %27
%110 = load i32, i32* %13
%111 = call double @array_max_abs(double* %109, i32 %110)
store double %111, double* %26
%112 = load double, double* %26
%113 = load double, double* %19
%114 = fcmp ole double %112, %113
br i1 %114, label %115, label %116
115: ; preds = %108
store i32 1, i32* %22
br label %183
116: ; preds = %108
store i32 0, i32* %23
br label %117
117: ; preds = %171, %116
%118 = load i32, i32* %23
%119 = load i32, i32* %13
%120 = icmp slt i32 %118, %119
br i1 %120, label %121, label %174
121: ; preds = %117
%122 = load double*, double** %15
%123 = load i32, i32* %23
%124 = sext i32 %123 to i64
%125 = getelementptr inbounds double, double* %122, i64 %124
%126 = load double, double* %125
%127 = call double @llvm.fabs.f64(double %126)
%128 = load double*, double** %17
%129 = load i32, i32* %23
%130 = sext i32 %129 to i64
%131 = getelementptr inbounds double, double* %128, i64 %130
%132 = load double, double* %131
%133 = call double @llvm.fabs.f64(double %132)
%134 = fdiv double 1.000000e+00, %133
%135 = fcmp ogt double %127, %134
br i1 %135, label %136, label %143
136: ; preds = %121
%137 = load double*, double** %15
%138 = load i32, i32* %23
%139 = sext i32 %138 to i64
%140 = getelementptr inbounds double, double* %137, i64 %139
%141 = load double, double* %140
%142 = call double @llvm.fabs.f64(double %141)
store double %142, double* %25
br label %151
143: ; preds = %121
%144 = load double*, double** %17
%145 = load i32, i32* %23
%146 = sext i32 %145 to i64
%147 = getelementptr inbounds double, double* %144, i64 %146
%148 = load double, double* %147
%149 = call double @llvm.fabs.f64(double %148)
%150 = fdiv double 1.000000e+00, %149
store double %150, double* %25
br label %151
151: ; preds = %143, %136
%152 = load double*, double** %15
%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 = load double*, double** %14
%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 = fsub double %156, %161
%163 = call double @llvm.fabs.f64(double %162)
store double %163, double* %24
%164 = load double, double* %24
%165 = load double, double* %25
%166 = fdiv double %164, %165
%167 = load double*, double** %27
%168 = load i32, i32* %23
%169 = sext i32 %168 to i64
%170 = getelementptr inbounds double, double* %167, i64 %169
store double %166, double* %170
br label %171
171: ; preds = %151
%172 = load i32, i32* %23
%173 = add nsw i32 %172, 1
store i32 %173, i32* %23
br label %117
174: ; preds = %117
%175 = load double*, double** %27
%176 = load i32, i32* %13
%177 = call double @array_max_abs(double* %175, i32 %176)
store double %177, double* %26
%178 = load double, double* %26
%179 = load double, double* %20
%180 = fcmp ole double %178, %179
br i1 %180, label %181, label %182
181: ; preds = %174
store i32 2, i32* %22
br label %182
182: ; preds = %181, %174
br label %183
183: ; preds = %182, %115
%184 = load double*, double** %27
%185 = call i32 @free(double* %184)
%186 = load i32, i32* %22
store i32 %186, i32* %11
br label %187
187: ; preds = %183, %35, %30
%188 = load i32, i32* %11
ret i32 %188
}

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 %12 [
i32 1, label %178
i32 5, label %11
]
11: ; preds = %10
br label %178
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, %11
%179 = phi i32 [ 5, %11 ], [ %176, %175 ], [ 3, %10 ]
ret i32 %179
}