#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 */
int /*<<< orphan*/ free(double *);
int iterate_graddesc(double *, int, int, int, double *, double *, double *,
                     double *);
double *malloc(int);
int /*<<< orphan*/ memcpy(double *, double *, int);
int /*<<< orphan*/ relax_aat(double *, int, int, int, double *, int);
int /*<<< orphan*/ relax_ata(double *, int, int, int, double *, int);
int /*<<< orphan*/ relax_atb(double *, int, int, int, double *, double *);
int gradient_descent(double *A, int m, int n, int stride, double *b,
                     double *x0) {
  double *C, *c, *res, *ares;
  int err;
  err = 0;
  C = NULL;
  c = NULL;
  if (m == n) {
    memcpy(x0, b, m * sizeof b[0]);
    ares = malloc(m * sizeof ares[0]);
    res = malloc(m * sizeof res[0]);
    if ((err = iterate_graddesc(A, m, n, stride, b, x0, res, ares)) == -1) {
      err = -1;
      goto err_out;
    }
  } else if (m > n) {
    C = malloc(n * n * sizeof C[0]);
    c = malloc(m * sizeof c[0]);
    ares = malloc(n * sizeof ares[0]);
    res = malloc(n * sizeof res[0]);
    relax_ata(A, m, n, stride, C, n);
    relax_atb(A, m, n, stride, b, c);
    if ((err = iterate_graddesc(C, n, n, n, c, x0, res, ares)) == -1) {
      err = -1;
      goto err_out;
    }
  } else {
    C = malloc(m * m * sizeof C[0]);
    c = malloc(m * sizeof c[0]);
    ares = malloc(m * sizeof ares[0]);
    res = malloc(m * sizeof res[0]);
    relax_aat(A, m, n, stride, C, m);
    if ((err = iterate_graddesc(C, m, m, m, b, c, res, ares)) == -1) {
      err = -1;
      goto err_out;
    }
    relax_atb(A, m, n, stride, c, x0);
  }
err_out:
  if (C != NULL)
    free(C);
  if (c != NULL)
    free(c);
  free(res);
  free(ares);
  return err;
}


x86 assembly (clang, -O0):
<gradient_descent>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8,-0x20(%rbp)
mov    %r9,-0x28(%rbp)
movl   $0x0,-0x4c(%rbp)
movq   $0x0,-0x30(%rbp)
movq   $0x0,-0x38(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jne    1235 <gradient_descent+0xc5>
mov    -0x28(%rbp),%rdi
mov    -0x20(%rbp),%rsi
movslq -0xc(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edx
call   1070 <memcpy@plt>
movslq -0xc(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1080 <malloc@plt>
mov    %rax,-0x48(%rbp)
movslq -0xc(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1080 <malloc@plt>
mov    %rax,-0x40(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
mov    -0x20(%rbp),%r8
mov    -0x28(%rbp),%r9
mov    -0x40(%rbp),%r10
mov    -0x48(%rbp),%rax
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
call   1030 <iterate_graddesc@plt>
mov    %eax,-0x4c(%rbp)
cmp    $0xffffffff,%eax
jne    1230 <gradient_descent+0xc0>
movl   $0xffffffff,-0x4c(%rbp)
jmp    13e0 <gradient_descent+0x270>
jmp    13db <gradient_descent+0x26b>
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
jle    130e <gradient_descent+0x19e>
mov    -0x10(%rbp),%eax
imul   -0x10(%rbp),%eax
cltq
shl    $0x3,%rax
mov    %eax,%edi
call   1080 <malloc@plt>
mov    %rax,-0x30(%rbp)
movslq -0xc(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1080 <malloc@plt>
mov    %rax,-0x38(%rbp)
movslq -0x10(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1080 <malloc@plt>
mov    %rax,-0x48(%rbp)
movslq -0x10(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1080 <malloc@plt>
mov    %rax,-0x40(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
mov    -0x30(%rbp),%r8
mov    -0x10(%rbp),%r9d
call   1050 <relax_ata@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
mov    -0x20(%rbp),%r8
mov    -0x38(%rbp),%r9
call   1090 <relax_atb@plt>
mov    -0x30(%rbp),%rdi
mov    -0x10(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x10(%rbp),%ecx
mov    -0x38(%rbp),%r8
mov    -0x28(%rbp),%r9
mov    -0x40(%rbp),%r10
mov    -0x48(%rbp),%rax
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
call   1030 <iterate_graddesc@plt>
mov    %eax,-0x4c(%rbp)
cmp    $0xffffffff,%eax
jne    1309 <gradient_descent+0x199>
movl   $0xffffffff,-0x4c(%rbp)
jmp    13e0 <gradient_descent+0x270>
jmp    13d6 <gradient_descent+0x266>
mov    -0xc(%rbp),%eax
imul   -0xc(%rbp),%eax
cltq
shl    $0x3,%rax
mov    %eax,%edi
call   1080 <malloc@plt>
mov    %rax,-0x30(%rbp)
movslq -0xc(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1080 <malloc@plt>
mov    %rax,-0x38(%rbp)
movslq -0xc(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1080 <malloc@plt>
mov    %rax,-0x48(%rbp)
movslq -0xc(%rbp),%rax
shl    $0x3,%rax
mov    %eax,%edi
call   1080 <malloc@plt>
mov    %rax,-0x40(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
mov    -0x30(%rbp),%r8
mov    -0xc(%rbp),%r9d
call   1060 <relax_aat@plt>
mov    -0x30(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0xc(%rbp),%edx
mov    -0xc(%rbp),%ecx
mov    -0x20(%rbp),%r8
mov    -0x38(%rbp),%r9
mov    -0x40(%rbp),%r10
mov    -0x48(%rbp),%rax
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
call   1030 <iterate_graddesc@plt>
mov    %eax,-0x4c(%rbp)
cmp    $0xffffffff,%eax
jne    13bc <gradient_descent+0x24c>
movl   $0xffffffff,-0x4c(%rbp)
jmp    13e0 <gradient_descent+0x270>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
mov    -0x14(%rbp),%ecx
mov    -0x38(%rbp),%r8
mov    -0x28(%rbp),%r9
call   1090 <relax_atb@plt>
jmp    13db <gradient_descent+0x26b>
jmp    13e0 <gradient_descent+0x270>
cmpq   $0x0,-0x30(%rbp)
je     13f4 <gradient_descent+0x284>
mov    -0x30(%rbp),%rdi
call   1040 <free@plt>
cmpq   $0x0,-0x38(%rbp)
je     1408 <gradient_descent+0x298>
mov    -0x38(%rbp),%rdi
call   1040 <free@plt>
mov    -0x40(%rbp),%rdi
call   1040 <free@plt>
mov    -0x48(%rbp),%rdi
call   1040 <free@plt>
mov    -0x4c(%rbp),%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<gradient_descent>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
mov    %esi,%r14d
cmp    %edx,%esi
mov    %r9,0x28(%rsp)
jne    11e3 <gradient_descent+0x73>
lea    0x0(,%r14,8),%ebx
mov    %rdi,%r15
mov    %r9,%rdi
mov    %r8,%rsi
mov    %ebx,%edx
mov    %ecx,%r12d
mov    %r8,%r13
call   1070 <memcpy@plt>
mov    %ebx,%edi
call   1080 <malloc@plt>
mov    %rax,%rbp
mov    %ebx,%edi
call   1080 <malloc@plt>
mov    %rax,%rbx
mov    %r15,%rdi
mov    %r14d,%esi
mov    %r14d,%edx
mov    %r12d,%ecx
mov    %r13,%r8
mov    0x28(%rsp),%r9
push   %rbp
push   %rax
call   1030 <iterate_graddesc@plt>
add    $0x10,%rsp
mov    %eax,%r12d
jmp    1372 <gradient_descent+0x202>
mov    %edx,%ebp
mov    %r8,0x10(%rsp)
mov    %rdi,0x30(%rsp)
mov    %ecx,0xc(%rsp)
jle    12aa <gradient_descent+0x13a>
lea    0x0(,%rbp,8),%ebx
mov    %ebx,%edi
imul   %ebp,%edi
call   1080 <malloc@plt>
mov    %rax,%r13
lea    0x0(,%r14,8),%edi
call   1080 <malloc@plt>
mov    %rax,0x20(%rsp)
mov    %ebx,%edi
call   1080 <malloc@plt>
mov    %rax,0x18(%rsp)
mov    %ebx,%edi
call   1080 <malloc@plt>
mov    %rax,%r15
mov    0x30(%rsp),%rbx
mov    %rbx,%rdi
mov    %r14d,%esi
mov    %ebp,%edx
mov    0xc(%rsp),%r12d
mov    %r12d,%ecx
mov    %r13,%r8
mov    %ebp,%r9d
call   1050 <relax_ata@plt>
mov    %rbx,%rdi
mov    %r14d,%esi
mov    0x20(%rsp),%rbx
mov    %ebp,%edx
mov    %r12d,%ecx
mov    0x10(%rsp),%r8
mov    %rbx,%r9
call   1090 <relax_atb@plt>
mov    %r13,%rdi
mov    %ebp,%esi
mov    %ebp,%edx
mov    %ebp,%ecx
mov    0x18(%rsp),%rbp
mov    %rbx,%r8
mov    0x28(%rsp),%r9
push   %rbp
mov    %r15,0x18(%rsp)
push   %r15
call   1030 <iterate_graddesc@plt>
add    $0x10,%rsp
mov    %eax,%r12d
test   %r13,%r13
jne    1358 <gradient_descent+0x1e8>
jmp    1360 <gradient_descent+0x1f0>
lea    0x0(,%r14,8),%ebx
mov    %ebx,%edi
imul   %r14d,%edi
call   1080 <malloc@plt>
mov    %rax,%r13
mov    %ebx,%edi
call   1080 <malloc@plt>
mov    %rax,%r12
mov    %ebx,%edi
call   1080 <malloc@plt>
mov    %rax,0x18(%rsp)
mov    %ebx,%edi
call   1080 <malloc@plt>
mov    %rax,%rbx
mov    0x30(%rsp),%r15
mov    %r15,%rdi
mov    %r14d,%esi
mov    %ebp,%edx
mov    0xc(%rsp),%ecx
mov    %r13,%r8
mov    %r14d,%r9d
call   1060 <relax_aat@plt>
mov    %r13,%rdi
mov    %r14d,%esi
mov    %r14d,%edx
mov    %r14d,%ecx
mov    0x10(%rsp),%r8
mov    %r12,0x20(%rsp)
mov    %r12,%r9
push   0x18(%rsp)
mov    %rbx,0x18(%rsp)
push   %rbx
call   1030 <iterate_graddesc@plt>
add    $0x10,%rsp
cmp    $0xffffffff,%eax
je     1394 <gradient_descent+0x224>
mov    %eax,%r12d
mov    %r15,%rdi
mov    %r14d,%esi
mov    %ebp,%edx
mov    0xc(%rsp),%ecx
mov    0x20(%rsp),%rbx
mov    %rbx,%r8
mov    0x28(%rsp),%r9
call   1090 <relax_atb@plt>
mov    0x18(%rsp),%rbp
test   %r13,%r13
je     1360 <gradient_descent+0x1f0>
mov    %r13,%rdi
call   1040 <free@plt>
test   %rbx,%rbx
je     136d <gradient_descent+0x1fd>
mov    %rbx,%rdi
call   1040 <free@plt>
mov    0x10(%rsp),%rbx
mov    %rbx,%rdi
call   1040 <free@plt>
mov    %rbp,%rdi
call   1040 <free@plt>
mov    %r12d,%eax
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    $0xffffffff,%r12d
mov    0x18(%rsp),%rbp
mov    0x20(%rsp),%rbx
test   %r13,%r13
jne    1358 <gradient_descent+0x1e8>
jmp    1360 <gradient_descent+0x1f0>

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

LLVM IR (-O2):
define i32 @gradient_descent(double* %0, i32 %1, i32 %2, i32 %3, double* %4, double* %5) {
%7 = icmp eq i32 %1, %2
br i1 %7, label %8, label %14
8: ; preds = %6
%9 = shl i32 %1, 3
%10 = tail call i32 @memcpy(double* %5, double* %4, i32 %9)
%11 = tail call double* @malloc(i32 %9)
%12 = tail call double* @malloc(i32 %9)
%13 = tail call i32 @iterate_graddesc(double* %0, i32 %1, i32 %1, i32 %3, double* %4, double* %5, double* %12, double* %11)
br label %52
14: ; preds = %6
%15 = icmp sgt i32 %1, %2
br i1 %15, label %16, label %27
16: ; preds = %14
%17 = shl i32 %2, 3
%18 = mul i32 %17, %2
%19 = tail call double* @malloc(i32 %18)
%20 = shl i32 %1, 3
%21 = tail call double* @malloc(i32 %20)
%22 = tail call double* @malloc(i32 %17)
%23 = tail call double* @malloc(i32 %17)
%24 = tail call i32 @relax_ata(double* %0, i32 %1, i32 %2, i32 %3, double* %19, i32 %2)
%25 = tail call i32 @relax_atb(double* %0, i32 %1, i32 %2, i32 %3, double* %4, double* %21)
%26 = tail call i32 @iterate_graddesc(double* %19, i32 %2, i32 %2, i32 %2, double* %21, double* %5, double* %23, double* %22)
br label %39
27: ; preds = %14
%28 = shl i32 %1, 3
%29 = mul i32 %28, %1
%30 = tail call double* @malloc(i32 %29)
%31 = tail call double* @malloc(i32 %28)
%32 = tail call double* @malloc(i32 %28)
%33 = tail call double* @malloc(i32 %28)
%34 = tail call i32 @relax_aat(double* %0, i32 %1, i32 %2, i32 %3, double* %30, i32 %1)
%35 = tail call i32 @iterate_graddesc(double* %30, i32 %1, i32 %1, i32 %1, double* %4, double* %31, double* %33, double* %32)
%36 = icmp eq i32 %35, -1
br i1 %36, label %39, label %37
37: ; preds = %27
%38 = tail call i32 @relax_atb(double* %0, i32 %1, i32 %2, i32 %3, double* %31, double* %5)
br label %39
39: ; preds = %27, %16, %37
%40 = phi double* [ %19, %16 ], [ %30, %37 ], [ %30, %27 ]
%41 = phi double* [ %21, %16 ], [ %31, %37 ], [ %31, %27 ]
%42 = phi double* [ %23, %16 ], [ %33, %37 ], [ %33, %27 ]
%43 = phi double* [ %22, %16 ], [ %32, %37 ], [ %32, %27 ]
%44 = phi i32 [ %26, %16 ], [ %35, %37 ], [ -1, %27 ]
%45 = icmp eq double* %40, null
br i1 %45, label %48, label %46
46: ; preds = %39
%47 = tail call i32 @free(double* %40)
br label %48
48: ; preds = %46, %39
%49 = icmp eq double* %41, null
br i1 %49, label %52, label %50
50: ; preds = %48
%51 = tail call i32 @free(double* %41)
br label %52
52: ; preds = %8, %50, %48
%53 = phi double* [ %12, %8 ], [ %42, %50 ], [ %42, %48 ]
%54 = phi double* [ %11, %8 ], [ %43, %50 ], [ %43, %48 ]
%55 = phi i32 [ %13, %8 ], [ %44, %50 ], [ %44, %48 ]
%56 = tail call i32 @free(double* %53)
%57 = tail call i32 @free(double* %54)
ret i32 %55
}