#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 **cre_mat(int, int);
double fabs(double);
int /*<<< orphan*/ free_mat(double **, int);
void suc_fail(double (*f)(double **vars, int n), double **vars, double **d,
              int n, double prec, double h) {
  int i;
  double alpha = 0;
  double f1, f2;
  double **vars_temp1 = cre_mat(n, 1);
  double **vars_temp2 = cre_mat(n, 1);
  for (i = 0; i < n; ++i) {
    vars_temp1[i][0] = vars[i][0] - alpha * d[i][0];
    vars_temp2[i][0] = vars[i][0] - (alpha + h) * d[i][0];
  }
  f1 = f(vars_temp1, n);
  while (1) {
    f2 = f(vars_temp2, n);
    if (f2 < f1) {
      alpha += h;
      for (i = 0; i < n; ++i)
        vars_temp1[i][0] = vars[i][0] - alpha * d[i][0];
      f1 = f2;
      h = 2 * h;
      for (i = 0; i < n; ++i)
        vars_temp2[i][0] = vars[i][0] - (alpha + h) * d[i][0];
    } else if (fabs(h) <= prec) {
      for (i = 0; i < n; ++i)
        vars[i][0] = vars_temp1[i][0];
      break;
    } else {
      h = -(h / 4);
      for (i = 0; i < n; ++i)
        vars_temp2[i][0] = vars[i][0] - (alpha + h) * d[i][0];
    }
  }
  free_mat(vars_temp1, n);
  vars_temp1 = NULL;
  free_mat(vars_temp2, n);
  vars_temp2 = NULL;
}


x86 assembly (clang, -O0):
<suc_fail>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
movsd  %xmm0,-0x28(%rbp)
movsd  %xmm1,-0x30(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x40(%rbp)
mov    -0x1c(%rbp),%edi
mov    $0x1,%esi
call   1030 <cre_mat@plt>
mov    %rax,-0x58(%rbp)
mov    -0x1c(%rbp),%edi
mov    $0x1,%esi
call   1030 <cre_mat@plt>
mov    %rax,-0x60(%rbp)
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    1239 <suc_fail+0x119>
mov    -0x10(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movsd  (%rax),%xmm1
movsd  -0x40(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movsd  (%rax),%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x58(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movsd  %xmm0,(%rax)
mov    -0x10(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movsd  (%rax),%xmm1
movsd  -0x40(%rbp),%xmm0
addsd  -0x30(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movsd  (%rax),%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x60(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movsd  %xmm0,(%rax)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1172 <suc_fail+0x52>
mov    -0x8(%rbp),%rax
mov    -0x58(%rbp),%rdi
mov    -0x1c(%rbp),%esi
call   *%rax
movsd  %xmm0,-0x48(%rbp)
mov    -0x8(%rbp),%rax
mov    -0x60(%rbp),%rdi
mov    -0x1c(%rbp),%esi
call   *%rax
movsd  %xmm0,-0x50(%rbp)
movsd  -0x50(%rbp),%xmm1
movsd  -0x48(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jbe    1390 <suc_fail+0x270>
movsd  -0x30(%rbp),%xmm0
addsd  -0x40(%rbp),%xmm0
movsd  %xmm0,-0x40(%rbp)
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    12f5 <suc_fail+0x1d5>
mov    -0x10(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movsd  (%rax),%xmm1
movsd  -0x40(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movsd  (%rax),%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x58(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movsd  %xmm0,(%rax)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1287 <suc_fail+0x167>
movsd  -0x50(%rbp),%xmm0
movsd  %xmm0,-0x48(%rbp)
movsd  0xd11(%rip),%xmm0
mulsd  -0x30(%rbp),%xmm0
movsd  %xmm0,-0x30(%rbp)
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    138b <suc_fail+0x26b>
mov    -0x10(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movsd  (%rax),%xmm1
movsd  -0x40(%rbp),%xmm0
addsd  -0x30(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movsd  (%rax),%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x60(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movsd  %xmm0,(%rax)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1318 <suc_fail+0x1f8>
jmp    14a6 <suc_fail+0x386>
movsd  -0x30(%rbp),%xmm1
movaps 0xc64(%rip),%xmm0
pand   %xmm0,%xmm1
movsd  -0x28(%rbp),%xmm0
ucomisd %xmm1,%xmm0
jb     13f5 <suc_fail+0x2d5>
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    13f0 <suc_fail+0x2d0>
mov    -0x58(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movsd  (%rax),%xmm0
mov    -0x10(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movsd  %xmm0,(%rax)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    13b6 <suc_fail+0x296>
jmp    14ab <suc_fail+0x38b>
movsd  -0x30(%rbp),%xmm0
movsd  0xc0e(%rip),%xmm1
divsd  %xmm1,%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x30(%rbp)
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    149c <suc_fail+0x37c>
mov    -0x10(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movsd  (%rax),%xmm1
movsd  -0x40(%rbp),%xmm0
addsd  -0x30(%rbp),%xmm0
mov    -0x18(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movsd  (%rax),%xmm2
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
mulsd  %xmm2,%xmm0
addsd  %xmm1,%xmm0
mov    -0x60(%rbp),%rax
movslq -0x34(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movsd  %xmm0,(%rax)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1429 <suc_fail+0x309>
jmp    14a1 <suc_fail+0x381>
jmp    14a6 <suc_fail+0x386>
jmp    124b <suc_fail+0x12b>
mov    -0x58(%rbp),%rdi
mov    -0x1c(%rbp),%esi
call   1040 <free_mat@plt>
movq   $0x0,-0x58(%rbp)
mov    -0x60(%rbp),%rdi
mov    -0x1c(%rbp),%esi
call   1040 <free_mat@plt>
movq   $0x0,-0x60(%rbp)
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<suc_fail>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x48,%rsp
movapd %xmm1,0x10(%rsp)
movsd  %xmm0,0x40(%rsp)
mov    %ecx,%r14d
mov    %rdx,%rbp
mov    %rsi,%rbx
mov    %rdi,0x20(%rsp)
mov    %ecx,%edi
mov    $0x1,%esi
call   1030 <cre_mat@plt>
mov    %rax,%r15
mov    %r14d,%edi
mov    $0x1,%esi
call   1030 <cre_mat@plt>
mov    %rax,%r12
mov    %r14d,%r13d
test   %r14d,%r14d
jle    11ca <suc_fail+0xaa>
xorpd  %xmm0,%xmm0
addsd  0x10(%rsp),%xmm0
xorpd  0xe7f(%rip),%xmm0
xor    %eax,%eax
movsd  0xe95(%rip),%xmm1
nopl   0x0(%rax,%rax,1)
mov    (%rbx,%rax,8),%rcx
mov    0x0(%rbp,%rax,8),%rdx
movsd  (%rdx),%xmm2
mulsd  %xmm1,%xmm2
addsd  (%rcx),%xmm2
mov    (%r15,%rax,8),%rsi
movsd  %xmm2,(%rsi)
movsd  (%rdx),%xmm2
mulsd  %xmm0,%xmm2
addsd  (%rcx),%xmm2
mov    (%r12,%rax,8),%rcx
movsd  %xmm2,(%rcx)
add    $0x1,%rax
cmp    %rax,%r13
jne    1190 <suc_fail+0x70>
mov    %r15,%rdi
mov    %r14d,%esi
call   *0x20(%rsp)
movsd  %xmm0,0x28(%rsp)
lea    -0x1(%r13),%rax
mov    %rax,(%rsp)
mov    %r13,0x8(%rsp)
and    $0xfffffffe,%r13d
xorpd  %xmm0,%xmm0
movapd %xmm0,0x30(%rsp)
movapd 0x10(%rsp),%xmm2
nopl   0x0(%rax,%rax,1)
movapd %xmm2,0x10(%rsp)
mov    %r12,%rdi
mov    %r14d,%esi
call   *0x20(%rsp)
movsd  0x28(%rsp),%xmm1
ucomisd %xmm0,%xmm1
ja     12ba <suc_fail+0x19a>
movapd 0x10(%rsp),%xmm2
movapd %xmm2,%xmm0
andpd  0xdde(%rip),%xmm0
movsd  0x40(%rsp),%xmm1
ucomisd %xmm0,%xmm1
jae    1426 <suc_fail+0x306>
mulsd  0xdde(%rip),%xmm2
test   %r14d,%r14d
jle    1200 <suc_fail+0xe0>
movapd 0x30(%rsp),%xmm0
addsd  %xmm2,%xmm0
xorpd  0xd9f(%rip),%xmm0
cmpq   $0x0,(%rsp)
je     13e0 <suc_fail+0x2c0>
xor    %eax,%eax
xchg   %ax,%ax
mov    (%rbx,%rax,8),%rcx
mov    0x0(%rbp,%rax,8),%rdx
movsd  (%rdx),%xmm1
mulsd  %xmm0,%xmm1
addsd  (%rcx),%xmm1
mov    (%r12,%rax,8),%rcx
movsd  %xmm1,(%rcx)
mov    0x8(%rbx,%rax,8),%rcx
mov    0x8(%rbp,%rax,8),%rdx
movsd  (%rdx),%xmm1
mulsd  %xmm0,%xmm1
addsd  (%rcx),%xmm1
mov    0x8(%r12,%rax,8),%rcx
movsd  %xmm1,(%rcx)
add    $0x2,%rax
cmp    %rax,%r13
jne    1270 <suc_fail+0x150>
jmp    13e2 <suc_fail+0x2c2>
movsd  %xmm0,0x28(%rsp)
movapd 0x10(%rsp),%xmm2
movapd 0x30(%rsp),%xmm1
addsd  %xmm2,%xmm1
test   %r14d,%r14d
movapd %xmm1,0x30(%rsp)
jle    140b <suc_fail+0x2eb>
movapd %xmm1,%xmm0
xorpd  0xd15(%rip),%xmm0
cmpq   $0x0,(%rsp)
je     1414 <suc_fail+0x2f4>
xor    %eax,%eax
nopl   0x0(%rax,%rax,1)
mov    (%rbx,%rax,8),%rcx
mov    0x0(%rbp,%rax,8),%rdx
movsd  (%rdx),%xmm1
mulsd  %xmm0,%xmm1
addsd  (%rcx),%xmm1
mov    (%r15,%rax,8),%rcx
movsd  %xmm1,(%rcx)
mov    0x8(%rbx,%rax,8),%rcx
mov    0x8(%rbp,%rax,8),%rdx
movsd  (%rdx),%xmm1
mulsd  %xmm0,%xmm1
addsd  (%rcx),%xmm1
mov    0x8(%r15,%rax,8),%rcx
movsd  %xmm1,(%rcx)
add    $0x2,%rax
cmp    %rax,%r13
jne    1300 <suc_fail+0x1e0>
testb  $0x1,0x8(%rsp)
je     1365 <suc_fail+0x245>
mov    (%rbx,%rax,8),%rcx
mov    0x0(%rbp,%rax,8),%rdx
mulsd  (%rdx),%xmm0
addsd  (%rcx),%xmm0
mov    (%r15,%rax,8),%rax
movsd  %xmm0,(%rax)
addsd  %xmm2,%xmm2
test   %r14d,%r14d
jle    1200 <suc_fail+0xe0>
movapd 0x30(%rsp),%xmm0
addsd  %xmm2,%xmm0
xorpd  0xc7c(%rip),%xmm0
cmpq   $0x0,(%rsp)
je     13e0 <suc_fail+0x2c0>
xor    %eax,%eax
nopl   (%rax)
mov    (%rbx,%rax,8),%rcx
mov    0x0(%rbp,%rax,8),%rdx
movsd  (%rdx),%xmm1
mulsd  %xmm0,%xmm1
addsd  (%rcx),%xmm1
mov    (%r12,%rax,8),%rcx
movsd  %xmm1,(%rcx)
mov    0x8(%rbx,%rax,8),%rcx
mov    0x8(%rbp,%rax,8),%rdx
movsd  (%rdx),%xmm1
mulsd  %xmm0,%xmm1
addsd  (%rcx),%xmm1
mov    0x8(%r12,%rax,8),%rcx
movsd  %xmm1,(%rcx)
add    $0x2,%rax
cmp    %rax,%r13
jne    1390 <suc_fail+0x270>
jmp    13e2 <suc_fail+0x2c2>
nopw   0x0(%rax,%rax,1)
xor    %eax,%eax
testb  $0x1,0x8(%rsp)
je     1200 <suc_fail+0xe0>
mov    (%rbx,%rax,8),%rcx
mov    0x0(%rbp,%rax,8),%rdx
mulsd  (%rdx),%xmm0
addsd  (%rcx),%xmm0
mov    (%r12,%rax,8),%rax
movsd  %xmm0,(%rax)
jmp    1200 <suc_fail+0xe0>
addsd  %xmm2,%xmm2
jmp    1200 <suc_fail+0xe0>
xor    %eax,%eax
testb  $0x1,0x8(%rsp)
jne    134c <suc_fail+0x22c>
jmp    1365 <suc_fail+0x245>
test   %r14d,%r14d
jle    14c9 <suc_fail+0x3a9>
mov    0x8(%rsp),%rsi
mov    %esi,%eax
and    $0x3,%eax
cmpq   $0x3,(%rsp)
jae    1444 <suc_fail+0x324>
xor    %ecx,%ecx
jmp    149f <suc_fail+0x37f>
and    $0xfffffffc,%esi
xor    %ecx,%ecx
nopl   0x0(%rax)
mov    (%r15,%rcx,8),%rdx
movsd  (%rdx),%xmm0
mov    (%rbx,%rcx,8),%rdx
movsd  %xmm0,(%rdx)
mov    0x8(%r15,%rcx,8),%rdx
movsd  (%rdx),%xmm0
mov    0x8(%rbx,%rcx,8),%rdx
movsd  %xmm0,(%rdx)
mov    0x10(%r15,%rcx,8),%rdx
movsd  (%rdx),%xmm0
mov    0x10(%rbx,%rcx,8),%rdx
movsd  %xmm0,(%rdx)
mov    0x18(%r15,%rcx,8),%rdx
movsd  (%rdx),%xmm0
mov    0x18(%rbx,%rcx,8),%rdx
movsd  %xmm0,(%rdx)
add    $0x4,%rcx
cmp    %rcx,%rsi
jne    1450 <suc_fail+0x330>
test   %rax,%rax
je     14c9 <suc_fail+0x3a9>
lea    (%rbx,%rcx,8),%rdx
lea    (%r15,%rcx,8),%rcx
xor    %esi,%esi
xchg   %ax,%ax
mov    (%rcx,%rsi,8),%rdi
movsd  (%rdi),%xmm0
mov    (%rdx,%rsi,8),%rdi
movsd  %xmm0,(%rdi)
add    $0x1,%rsi
cmp    %rsi,%rax
jne    14b0 <suc_fail+0x390>
mov    %r15,%rdi
mov    %r14d,%esi
call   1040 <free_mat@plt>
mov    %r12,%rdi
mov    %r14d,%esi
add    $0x48,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <free_mat@plt>

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

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