#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 */
scalar_t__ fabs(double);
int /*<<< orphan*/ fdjac3(double *, double *, double *, double *, double *,
                          void (*)(double *, double *, int, int), int);
void stub1(double *, double *, int, int, ...);
int /*<<< orphan*/ tridiag(double *, double *, double *, double *, int);
int newt_raph(void (*vecfunc)(double x[], double fvec[], int n, int init, ...),
              double x[], int n) {
  int k, i, index[50], Error;
  double errx, errf, d, fvec[50], fjac[50 * 50], p[50];
  double a[50], b[50], c[50];
  Error = 0;
  for (k = 0; k < 150; k++) {
    (*vecfunc)(x, fvec, n, 0, -1);
    errf = 0.0;
    for (i = 0; i < n; i++)
      errf += fabs(fvec[i]);
    if (errf <= 1e-1) {
      return (Error);
    }
    fdjac3(x, fvec, a, b, c, vecfunc, n);
    for (i = 0; i < n; i++)
      p[i] = -fvec[i];
    tridiag(a, b, c, p, n);
    errx = 0.0;
    for (i = 0; i < n; i++) {
      errx += fabs(p[i]);
      if (k > 10 && k <= 20 && x[i] < 2.0 && x[i] > -5.0)
        x[i] += p[i] * 0.9;
      else if (k > 20 && k <= 60 && x[i] < 2.0 && x[i] > -5.0)
        x[i] += p[i] * 0.7;
      else if (k > 60 && x[i] < 2.0 && x[i] > -5.0)
        x[i] += p[i] * 0.2;
      else
        x[i] += p[i];
    }
    if (errx <= 1e-4) {
      return (Error);
    }
  }
  Error = 1;
  return (Error);
}


x86 assembly (clang, -O0):
<newt_raph>:
push   %rbp
mov    %rsp,%rbp
sub    $0x5710,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
movl   $0x0,-0xf4(%rbp)
movl   $0x0,-0x20(%rbp)
cmpl   $0x96,-0x20(%rbp)
jge    14d4 <newt_raph+0x3a4>
mov    -0x10(%rbp),%r9
mov    -0x18(%rbp),%rdi
lea    -0x2a0(%rbp),%rsi
mov    -0x1c(%rbp),%edx
xor    %ecx,%ecx
mov    $0xffffffff,%r8d
mov    $0x0,%al
call   *%r9
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x108(%rbp)
ff
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    11d6 <newt_raph+0xa6>
movslq -0x24(%rbp),%rax
movsd  -0x2a0(%rbp,%rax,8),%xmm0
ff ff
call   1040 <fabs@plt>
cvtsi2sd %rax,%xmm0
addsd  -0x108(%rbp),%xmm0
ff
movsd  %xmm0,-0x108(%rbp)
ff
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1195 <newt_raph+0x65>
movsd  0xe22(%rip),%xmm0
ucomisd -0x108(%rbp),%xmm0
ff
jb     11fa <newt_raph+0xca>
mov    -0xf4(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    14e7 <newt_raph+0x3b7>
mov    -0x18(%rbp),%rdi
lea    -0x2a0(%rbp),%rsi
lea    -0x53e0(%rbp),%rdx
lea    -0x5570(%rbp),%rcx
lea    -0x5700(%rbp),%r8
mov    -0x10(%rbp),%r9
mov    -0x1c(%rbp),%eax
mov    %eax,(%rsp)
call   1050 <fdjac3@plt>
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    127b <newt_raph+0x14b>
movslq -0x24(%rbp),%rax
movsd  -0x2a0(%rbp,%rax,8),%xmm0
ff ff
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movslq -0x24(%rbp),%rax
movsd  %xmm0,-0x5250(%rbp,%rax,8)
ff ff
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1230 <newt_raph+0x100>
lea    -0x53e0(%rbp),%rdi
lea    -0x5570(%rbp),%rsi
lea    -0x5700(%rbp),%rdx
lea    -0x5250(%rbp),%rcx
mov    -0x1c(%rbp),%r8d
call   1030 <tridiag@plt>
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x100(%rbp)
ff
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    149d <newt_raph+0x36d>
movslq -0x24(%rbp),%rax
movsd  -0x5250(%rbp,%rax,8),%xmm0
ff ff
call   1040 <fabs@plt>
cvtsi2sd %rax,%xmm0
addsd  -0x100(%rbp),%xmm0
ff
movsd  %xmm0,-0x100(%rbp)
ff
cmpl   $0xa,-0x20(%rbp)
jle    1367 <newt_raph+0x237>
cmpl   $0x14,-0x20(%rbp)
jg     1367 <newt_raph+0x237>
mov    -0x18(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsd  0xd07(%rip),%xmm0
ucomisd (%rax,%rcx,8),%xmm0
jbe    1367 <newt_raph+0x237>
mov    -0x18(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  0xcef(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1367 <newt_raph+0x237>
movslq -0x24(%rbp),%rax
movsd  -0x5250(%rbp,%rax,8),%xmm0
ff ff
mov    -0x18(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
movsd  0xcdb(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
jmp    148a <newt_raph+0x35a>
cmpl   $0x14,-0x20(%rbp)
jle    13e9 <newt_raph+0x2b9>
cmpl   $0x3c,-0x20(%rbp)
jg     13e9 <newt_raph+0x2b9>
mov    -0x18(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsd  0xc85(%rip),%xmm0
ucomisd (%rax,%rcx,8),%xmm0
jbe    13e9 <newt_raph+0x2b9>
mov    -0x18(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  0xc6d(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    13e9 <newt_raph+0x2b9>
movslq -0x24(%rbp),%rax
movsd  -0x5250(%rbp,%rax,8),%xmm0
ff ff
mov    -0x18(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
movsd  0xc51(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
jmp    1485 <newt_raph+0x355>
cmpl   $0x3c,-0x20(%rbp)
jle    1461 <newt_raph+0x331>
mov    -0x18(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsd  0xc0d(%rip),%xmm0
ucomisd (%rax,%rcx,8),%xmm0
jbe    1461 <newt_raph+0x331>
mov    -0x18(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  0xbf5(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    1461 <newt_raph+0x331>
movslq -0x24(%rbp),%rax
movsd  -0x5250(%rbp,%rax,8),%xmm0
ff ff
mov    -0x18(%rbp),%rax
movslq -0x24(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm1
movsd  0xbd1(%rip),%xmm2
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
movsd  %xmm0,(%rax,%rcx,8)
jmp    1480 <newt_raph+0x350>
movslq -0x24(%rbp),%rax
movsd  -0x5250(%rbp,%rax,8),%xmm0
ff ff
mov    -0x18(%rbp),%rax
movslq -0x24(%rbp),%rcx
addsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,(%rax,%rcx,8)
jmp    1485 <newt_raph+0x355>
jmp    148a <newt_raph+0x35a>
jmp    148f <newt_raph+0x35f>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    12b2 <newt_raph+0x182>
movsd  0xb63(%rip),%xmm0
ucomisd -0x100(%rbp),%xmm0
ff
jb     14c1 <newt_raph+0x391>
mov    -0xf4(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    14e7 <newt_raph+0x3b7>
jmp    14c6 <newt_raph+0x396>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    1157 <newt_raph+0x27>
movl   $0x1,-0xf4(%rbp)
mov    -0xf4(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x5710,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<newt_raph>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x828,%rsp
mov    %edx,%r15d
mov    %rsi,%r13
mov    %rdi,%r12
mov    %edx,%r14d
lea    -0x1(%r14),%rax
mov    %rax,0x48(%rsp)
mov    %r14d,%ebx
and    $0xfffffffc,%ebx
lea    -0x4(%rbx),%rax
mov    %rax,0x38(%rsp)
mov    %rax,%rcx
shr    $0x2,%rcx
add    $0x1,%rcx
mov    %r14d,%eax
and    $0x3,%eax
mov    %rax,0x20(%rsp)
mov    %rcx,%rax
mov    %rcx,0x30(%rsp)
and    $0xfffffffffffffffe,%rcx
mov    %rcx,0x28(%rsp)
xor    %eax,%eax
mov    %rax,0x10(%rsp)
mov    %rdi,0x40(%rsp)
mov    %rbx,0x18(%rsp)
nopl   (%rax)
mov    %r13,%rdi
lea    0x1e0(%rsp),%rsi
mov    %r15d,%edx
xor    %ecx,%ecx
mov    $0xffffffff,%r8d
xor    %eax,%eax
call   *%r12
test   %r15d,%r15d
jle    15bc <newt_raph+0x48c>
cmpq   $0x3,0x48(%rsp)
jae    11e0 <newt_raph+0xb0>
xorpd  %xmm1,%xmm1
xor    %ebp,%ebp
jmp    1285 <newt_raph+0x155>
nopw   0x0(%rax,%rax,1)
xorps  %xmm1,%xmm1
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nop
movsd  %xmm1,0x8(%rsp)
movsd  0x1e0(%rsp,%rbp,8),%xmm0
call   1040 <fabs@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
addsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0x1e8(%rsp,%rbp,8),%xmm0
call   1040 <fabs@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
addsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0x1f0(%rsp,%rbp,8),%xmm0
call   1040 <fabs@plt>
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
addsd  0x8(%rsp),%xmm0
movsd  %xmm0,0x8(%rsp)
movsd  0x1f8(%rsp,%rbp,8),%xmm0
call   1040 <fabs@plt>
xorps  %xmm1,%xmm1
cvtsi2sd %rax,%xmm1
addsd  0x8(%rsp),%xmm1
add    $0x4,%rbp
cmp    %rbp,%rbx
jne    11f0 <newt_raph+0xc0>
cmpq   $0x0,0x20(%rsp)
je     12ce <newt_raph+0x19e>
lea    (%rsp,%rbp,8),%rbp
add    $0x1e0,%rbp
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
movsd  %xmm1,0x8(%rsp)
movsd  0x0(%rbp,%rbx,8),%xmm0
call   1040 <fabs@plt>
movsd  0x8(%rsp),%xmm1
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
addsd  %xmm0,%xmm1
add    $0x1,%rbx
cmp    %rbx,0x20(%rsp)
jne    12a0 <newt_raph+0x170>
movsd  0xd2a(%rip),%xmm0
ucomisd %xmm1,%xmm0
jae    15bc <newt_raph+0x48c>
mov    %r15d,(%rsp)
mov    %r13,%rdi
lea    0x1e0(%rsp),%rsi
lea    0x690(%rsp),%rbx
mov    %rbx,%rdx
lea    0x500(%rsp),%rcx
lea    0x370(%rsp),%r8
mov    %r12,%r9
call   1050 <fdjac3@plt>
test   %r15d,%r15d
jle    1597 <newt_raph+0x467>
cmp    $0x4,%r15d
jae    1330 <newt_raph+0x200>
xor    %eax,%eax
movapd 0xd15(%rip),%xmm2
jmp    13e0 <newt_raph+0x2b0>
cmpq   $0x0,0x38(%rsp)
mov    0x18(%rsp),%rdx
movapd 0xcfd(%rip),%xmm2
je     1585 <newt_raph+0x455>
mov    0x28(%rsp),%rcx
xor    %eax,%eax
movapd 0x1e0(%rsp,%rax,8),%xmm0
xorpd  %xmm2,%xmm0
movapd 0x1f0(%rsp,%rax,8),%xmm1
xorpd  %xmm2,%xmm1
movapd %xmm0,0x50(%rsp,%rax,8)
movapd %xmm1,0x60(%rsp,%rax,8)
movapd 0x200(%rsp,%rax,8),%xmm0
xorpd  %xmm2,%xmm0
movapd 0x210(%rsp,%rax,8),%xmm1
xorpd  %xmm2,%xmm1
movapd %xmm0,0x70(%rsp,%rax,8)
movapd %xmm1,0x80(%rsp,%rax,8)
add    $0x8,%rax
add    $0xfffffffffffffffe,%rcx
jne    1350 <newt_raph+0x220>
testb  $0x1,0x30(%rsp)
je     13d6 <newt_raph+0x2a6>
movapd 0x1e0(%rsp,%rax,8),%xmm0
xorpd  %xmm2,%xmm0
movapd 0x1f0(%rsp,%rax,8),%xmm1
xorpd  %xmm2,%xmm1
movapd %xmm0,0x50(%rsp,%rax,8)
movapd %xmm1,0x60(%rsp,%rax,8)
mov    %rdx,%rax
cmp    %r14,%rdx
je     13fc <newt_raph+0x2cc>
xchg   %ax,%ax
movsd  0x1e0(%rsp,%rax,8),%xmm0
xorpd  %xmm2,%xmm0
movlpd %xmm0,0x50(%rsp,%rax,8)
add    $0x1,%rax
cmp    %rax,%r14
jne    13e0 <newt_raph+0x2b0>
mov    %rbx,%rdi
lea    0x500(%rsp),%rsi
lea    0x370(%rsp),%rdx
lea    0x50(%rsp),%rcx
mov    %r15d,%r8d
call   1030 <tridiag@plt>
test   %r15d,%r15d
jle    15bc <newt_raph+0x48c>
mov    %r15d,%ebx
mov    0x10(%rsp),%rax
lea    -0xb(%rax),%ebp
lea    -0x15(%rax),%r15d
xorpd  %xmm1,%xmm1
xor    %r12d,%r12d
jmp    146d <newt_raph+0x33d>
nopl   (%rax)
addsd  0x50(%rsp,%r12,8),%xmm0
movsd  %xmm0,0x0(%r13,%r12,8)
movsd  0x8(%rsp),%xmm1
xorps  %xmm0,%xmm0
cvtsi2sd %rax,%xmm0
addsd  %xmm0,%xmm1
add    $0x1,%r12
cmp    %r12,%r14
je     1550 <newt_raph+0x420>
movsd  %xmm1,0x8(%rsp)
movsd  0x50(%rsp,%r12,8),%xmm0
call   1040 <fabs@plt>
movsd  0x0(%r13,%r12,8),%xmm0
cmp    $0x9,%ebp
ja     14c0 <newt_raph+0x390>
movsd  0xb75(%rip),%xmm1
ucomisd %xmm0,%xmm1
jbe    1440 <newt_raph+0x310>
ucomisd 0xb6f(%rip),%xmm0
jbe    1440 <newt_raph+0x310>
movsd  0x50(%rsp,%r12,8),%xmm1
mulsd  0xb76(%rip),%xmm1
jmp    1540 <newt_raph+0x410>
nopw   0x0(%rax,%rax,1)
cmp    $0x27,%r15d
ja     1500 <newt_raph+0x3d0>
movsd  0xb3a(%rip),%xmm1
ucomisd %xmm0,%xmm1
jbe    1440 <newt_raph+0x310>
ucomisd 0xb30(%rip),%xmm0
jbe    1440 <newt_raph+0x310>
movsd  0x50(%rsp,%r12,8),%xmm1
mulsd  0xb2b(%rip),%xmm1
jmp    1540 <newt_raph+0x410>
nopw   0x0(%rax,%rax,1)
cmpl   $0x3d,0x10(%rsp)
jb     1440 <newt_raph+0x310>
movsd  0xaf5(%rip),%xmm1
ucomisd %xmm0,%xmm1
jbe    1440 <newt_raph+0x310>
ucomisd 0xaeb(%rip),%xmm0
jbe    1440 <newt_raph+0x310>
movsd  0x50(%rsp,%r12,8),%xmm1
mulsd  0xade(%rip),%xmm1
nopw   0x0(%rax,%rax,1)
addsd  %xmm0,%xmm1
movsd  %xmm1,0x0(%r13,%r12,8)
jmp    144e <newt_raph+0x31e>
movsd  0xad8(%rip),%xmm0
ucomisd %xmm1,%xmm0
jae    15bc <newt_raph+0x48c>
mov    0x10(%rsp),%rax
add    $0x1,%eax
mov    %rax,0x10(%rsp)
cmp    $0x96,%eax
mov    %ebx,%r15d
mov    0x40(%rsp),%r12
mov    0x18(%rsp),%rbx
jne    11a0 <newt_raph+0x70>
jmp    15d0 <newt_raph+0x4a0>
xor    %eax,%eax
testb  $0x1,0x30(%rsp)
jne    13b0 <newt_raph+0x280>
jmp    13d6 <newt_raph+0x2a6>
lea    0x690(%rsp),%rdi
lea    0x500(%rsp),%rsi
lea    0x370(%rsp),%rdx
lea    0x50(%rsp),%rcx
mov    %r15d,%r8d
call   1030 <tridiag@plt>
xor    %eax,%eax
add    $0x828,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    $0x1,%eax
jmp    15be <newt_raph+0x48e>

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

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