#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 *);
double *mat(int, int);
int /*<<< orphan*/ matcpy(double *, double const *, int, int);
int matinv(double *, int);
int /*<<< orphan*/ matmul(char *, int, int, int, double, double *,
                          double const *, double, double *);
extern int smoother(const double *xf, const double *Qf, const double *xb,
                    const double *Qb, int n, double *xs, double *Qs) {
  double *invQf = mat(n, n), *invQb = mat(n, n), *xx = mat(n, 1);
  int i, info = -1;
  matcpy(invQf, Qf, n, n);
  matcpy(invQb, Qb, n, n);
  if (!matinv(invQf, n) && !matinv(invQb, n)) {
    for (i = 0; i < n * n; i++)
      Qs[i] = invQf[i] + invQb[i];
    if (!(info = matinv(Qs, n))) {
      matmul("NN", n, 1, n, 1.0, invQf, xf, 0.0, xx);
      matmul("NN", n, 1, n, 1.0, invQb, xb, 1.0, xx);
      matmul("NN", n, 1, n, 1.0, Qs, xx, 0.0, xs);
    }
  }
  free(invQf);
  free(invQb);
  free(xx);
  return info;
}


x86 assembly (clang, -O0):
<smoother>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
mov    %r9,-0x30(%rbp)
mov    -0x24(%rbp),%edi
mov    -0x24(%rbp),%esi
call   1040 <mat@plt>
mov    %rax,-0x38(%rbp)
mov    -0x24(%rbp),%edi
mov    -0x24(%rbp),%esi
call   1040 <mat@plt>
mov    %rax,-0x40(%rbp)
mov    -0x24(%rbp),%edi
mov    $0x1,%esi
call   1040 <mat@plt>
mov    %rax,-0x48(%rbp)
movl   $0xffffffff,-0x50(%rbp)
mov    -0x38(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x24(%rbp),%edx
mov    -0x24(%rbp),%ecx
call   1070 <matcpy@plt>
mov    -0x40(%rbp),%rdi
mov    -0x20(%rbp),%rsi
mov    -0x24(%rbp),%edx
mov    -0x24(%rbp),%ecx
call   1070 <matcpy@plt>
mov    -0x38(%rbp),%rdi
mov    -0x24(%rbp),%esi
call   1050 <matinv@plt>
cmp    $0x0,%eax
jne    12fb <smoother+0x1ab>
mov    -0x40(%rbp),%rdi
mov    -0x24(%rbp),%esi
call   1050 <matinv@plt>
cmp    $0x0,%eax
jne    12fb <smoother+0x1ab>
movl   $0x0,-0x4c(%rbp)
mov    -0x4c(%rbp),%eax
mov    -0x24(%rbp),%ecx
imul   -0x24(%rbp),%ecx
cmp    %ecx,%eax
jge    1248 <smoother+0xf8>
mov    -0x38(%rbp),%rax
movslq -0x4c(%rbp),%rcx
movsd  (%rax,%rcx,8),%xmm0
mov    -0x40(%rbp),%rax
movslq -0x4c(%rbp),%rcx
addsd  (%rax,%rcx,8),%xmm0
mov    0x10(%rbp),%rax
movslq -0x4c(%rbp),%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x4c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4c(%rbp)
jmp    1201 <smoother+0xb1>
mov    0x10(%rbp),%rdi
mov    -0x24(%rbp),%esi
call   1050 <matinv@plt>
mov    %eax,-0x50(%rbp)
cmp    $0x0,%eax
jne    12f6 <smoother+0x1a6>
mov    -0x24(%rbp),%esi
mov    -0x24(%rbp),%ecx
mov    -0x38(%rbp),%r8
mov    -0x8(%rbp),%r9
mov    -0x48(%rbp),%rax
lea    0xd8f(%rip),%rdi
mov    $0x1,%edx
movsd  0xd7a(%rip),%xmm0
xorps  %xmm1,%xmm1
mov    %rax,(%rsp)
call   1060 <matmul@plt>
mov    -0x24(%rbp),%esi
mov    -0x24(%rbp),%ecx
mov    -0x40(%rbp),%r8
mov    -0x18(%rbp),%r9
mov    -0x48(%rbp),%rax
lea    0xd5d(%rip),%rdi
mov    $0x1,%edx
movsd  0xd48(%rip),%xmm1
movaps %xmm1,%xmm0
mov    %rax,(%rsp)
call   1060 <matmul@plt>
mov    -0x24(%rbp),%esi
mov    -0x24(%rbp),%ecx
mov    0x10(%rbp),%r8
mov    -0x48(%rbp),%r9
mov    -0x30(%rbp),%rax
lea    0xd2b(%rip),%rdi
mov    $0x1,%edx
movsd  0xd16(%rip),%xmm0
xorps  %xmm1,%xmm1
mov    %rax,(%rsp)
call   1060 <matmul@plt>
jmp    12fb <smoother+0x1ab>
mov    -0x38(%rbp),%rdi
call   1030 <free@plt>
mov    -0x40(%rbp),%rdi
call   1030 <free@plt>
mov    -0x48(%rbp),%rdi
call   1030 <free@plt>
mov    -0x50(%rbp),%eax
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<smoother>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %r9,0x20(%rsp)
mov    %r8d,%r15d
mov    %rcx,%r12
mov    %rdx,0x18(%rsp)
mov    %rsi,%rbp
mov    %rdi,0x10(%rsp)
mov    %r8d,%edi
mov    %r8d,%esi
call   1040 <mat@plt>
mov    %rax,%rbx
mov    %r15d,%edi
mov    %r15d,%esi
call   1040 <mat@plt>
mov    %rax,%r14
mov    %r15d,%edi
mov    $0x1,%esi
call   1040 <mat@plt>
mov    %rax,%r13
mov    %rbx,%rdi
mov    %rbp,%rsi
mov    %r15d,%edx
mov    %r15d,%ecx
call   1070 <matcpy@plt>
mov    %r14,%rdi
mov    %r12,%rsi
mov    %r15d,%edx
mov    %r15d,%ecx
call   1070 <matcpy@plt>
mov    %rbx,%rdi
mov    %r15d,%esi
call   1050 <matinv@plt>
mov    $0xffffffff,%r12d
test   %eax,%eax
je     11e1 <smoother+0x91>
mov    %r13,%rbp
jmp    146d <smoother+0x31d>
mov    %r14,%rdi
mov    %r15d,%esi
call   1050 <matinv@plt>
test   %eax,%eax
mov    %r13,%rbp
jne    146d <smoother+0x31d>
mov    0x60(%rsp),%r13
mov    %r15d,%ecx
imul   %r15d,%ecx
test   %ecx,%ecx
je     13c9 <smoother+0x279>
mov    %ecx,%eax
cmp    $0x4,%ecx
jae    12bc <smoother+0x16c>
xor    %ecx,%ecx
mov    %rcx,%rdx
not    %rdx
add    %rax,%rdx
mov    %rax,%rsi
and    $0x3,%rsi
je     124c <smoother+0xfc>
nopw   0x0(%rax,%rax,1)
movsd  (%rbx,%rcx,8),%xmm0
addsd  (%r14,%rcx,8),%xmm0
movsd  %xmm0,0x0(%r13,%rcx,8)
add    $0x1,%rcx
add    $0xffffffffffffffff,%rsi
jne    1230 <smoother+0xe0>
cmp    $0x3,%rdx
jb     13c9 <smoother+0x279>
cs nopw 0x0(%rax,%rax,1)
movsd  (%rbx,%rcx,8),%xmm0
addsd  (%r14,%rcx,8),%xmm0
movsd  %xmm0,0x0(%r13,%rcx,8)
movsd  0x8(%rbx,%rcx,8),%xmm0
addsd  0x8(%r14,%rcx,8),%xmm0
movsd  %xmm0,0x8(%r13,%rcx,8)
movsd  0x10(%rbx,%rcx,8),%xmm0
addsd  0x10(%r14,%rcx,8),%xmm0
movsd  %xmm0,0x10(%r13,%rcx,8)
movsd  0x18(%rbx,%rcx,8),%xmm0
addsd  0x18(%r14,%rcx,8),%xmm0
movsd  %xmm0,0x18(%r13,%rcx,8)
add    $0x4,%rcx
cmp    %rcx,%rax
jne    1260 <smoother+0x110>
jmp    13c9 <smoother+0x279>
lea    0x0(,%rax,8),%rcx
add    %r13,%rcx
lea    (%rbx,%rax,8),%rdx
lea    (%r14,%rax,8),%rsi
cmp    %r13,%rdx
seta   %dil
cmp    %rcx,%rbx
setb   %r8b
cmp    %r13,%rsi
seta   %dl
cmp    %rcx,%r14
setb   %sil
xor    %ecx,%ecx
test   %r8b,%dil
jne    1218 <smoother+0xc8>
and    %sil,%dl
jne    1218 <smoother+0xc8>
mov    %eax,%ecx
and    $0xfffffffc,%ecx
lea    -0x4(%rcx),%rdx
mov    %rdx,%rsi
shr    $0x2,%rsi
add    $0x1,%rsi
test   %rdx,%rdx
je     138a <smoother+0x23a>
mov    %rsi,%rdi
and    $0xfffffffffffffffe,%rdi
xor    %edx,%edx
movupd (%rbx,%rdx,8),%xmm0
movupd 0x10(%rbx,%rdx,8),%xmm1
movupd (%r14,%rdx,8),%xmm2
addpd  %xmm0,%xmm2
movupd 0x10(%r14,%rdx,8),%xmm0
addpd  %xmm1,%xmm0
movupd %xmm2,0x0(%r13,%rdx,8)
movupd %xmm0,0x10(%r13,%rdx,8)
movupd 0x20(%rbx,%rdx,8),%xmm0
movupd 0x30(%rbx,%rdx,8),%xmm1
movupd 0x20(%r14,%rdx,8),%xmm2
addpd  %xmm0,%xmm2
movupd 0x30(%r14,%rdx,8),%xmm0
addpd  %xmm1,%xmm0
movupd %xmm2,0x20(%r13,%rdx,8)
movupd %xmm0,0x30(%r13,%rdx,8)
add    $0x8,%rdx
add    $0xfffffffffffffffe,%rdi
jne    1320 <smoother+0x1d0>
jmp    138c <smoother+0x23c>
xor    %edx,%edx
test   $0x1,%sil
je     13c0 <smoother+0x270>
movupd (%rbx,%rdx,8),%xmm0
movupd 0x10(%rbx,%rdx,8),%xmm1
movupd (%r14,%rdx,8),%xmm2
addpd  %xmm0,%xmm2
movupd 0x10(%r14,%rdx,8),%xmm0
addpd  %xmm1,%xmm0
movupd %xmm2,0x0(%r13,%rdx,8)
movupd %xmm0,0x10(%r13,%rdx,8)
cmp    %rax,%rcx
jne    1218 <smoother+0xc8>
mov    %r13,%rdi
mov    %r15d,%esi
call   1050 <matinv@plt>
mov    %eax,%r12d
test   %eax,%eax
jne    146d <smoother+0x31d>
mov    %rbp,(%rsp)
lea    0xc1e(%rip),%r12
movsd  0xc0e(%rip),%xmm0
xorpd  %xmm1,%xmm1
mov    %r12,%rdi
mov    %r15d,%esi
mov    $0x1,%edx
mov    %r15d,%ecx
mov    %rbx,%r8
mov    0x10(%rsp),%r9
call   1060 <matmul@plt>
mov    %rbp,(%rsp)
mov    %r12,%rdi
mov    %r15d,%esi
mov    $0x1,%edx
mov    %r15d,%ecx
movsd  0xbd5(%rip),%xmm0
mov    %r14,%r8
mov    0x18(%rsp),%r9
movapd %xmm0,%xmm1
call   1060 <matmul@plt>
mov    0x20(%rsp),%rax
mov    %rax,(%rsp)
xorpd  %xmm1,%xmm1
mov    %r12,%rdi
mov    %r15d,%esi
mov    $0x1,%edx
mov    %r15d,%ecx
movsd  0xba1(%rip),%xmm0
mov    %r13,%r8
mov    %rbp,%r9
call   1060 <matmul@plt>
xor    %r12d,%r12d
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %r14,%rdi
call   1030 <free@plt>
mov    %rbp,%rdi
call   1030 <free@plt>
mov    %r12d,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [3 x i8] c"NN\00"
define i32 @smoother(double* %0, double* %1, double* %2, double* %3, i32 %4, double* %5, double* %6) {
%8 = alloca double*
%9 = alloca double*
%10 = alloca double*
%11 = alloca double*
%12 = alloca i32
%13 = alloca double*
%14 = alloca double*
%15 = alloca double*
%16 = alloca double*
%17 = alloca double*
%18 = alloca i32
%19 = alloca i32
store double* %0, double** %8
store double* %1, double** %9
store double* %2, double** %10
store double* %3, double** %11
store i32 %4, i32* %12
store double* %5, double** %13
store double* %6, double** %14
%20 = load i32, i32* %12
%21 = load i32, i32* %12
%22 = call double* @mat(i32 %20, i32 %21)
store double* %22, double** %15
%23 = load i32, i32* %12
%24 = load i32, i32* %12
%25 = call double* @mat(i32 %23, i32 %24)
store double* %25, double** %16
%26 = load i32, i32* %12
%27 = call double* @mat(i32 %26, i32 1)
store double* %27, double** %17
store i32 -1, i32* %19
%28 = load double*, double** %15
%29 = load double*, double** %9
%30 = load i32, i32* %12
%31 = load i32, i32* %12
%32 = call i32 @matcpy(double* %28, double* %29, i32 %30, i32 %31)
%33 = load double*, double** %16
%34 = load double*, double** %11
%35 = load i32, i32* %12
%36 = load i32, i32* %12
%37 = call i32 @matcpy(double* %33, double* %34, i32 %35, i32 %36)
%38 = load double*, double** %15
%39 = load i32, i32* %12
%40 = call i32 @matinv(double* %38, i32 %39)
%41 = icmp ne i32 %40, 0
br i1 %41, label %98, label %42
42: ; preds = %7
%43 = load double*, double** %16
%44 = load i32, i32* %12
%45 = call i32 @matinv(double* %43, i32 %44)
%46 = icmp ne i32 %45, 0
br i1 %46, label %98, label %47
47: ; preds = %42
store i32 0, i32* %18
br label %48
48: ; preds = %70, %47
%49 = load i32, i32* %18
%50 = load i32, i32* %12
%51 = load i32, i32* %12
%52 = mul nsw i32 %50, %51
%53 = icmp slt i32 %49, %52
br i1 %53, label %54, label %73
54: ; preds = %48
%55 = load double*, double** %15
%56 = load i32, i32* %18
%57 = sext i32 %56 to i64
%58 = getelementptr inbounds double, double* %55, i64 %57
%59 = load double, double* %58
%60 = load double*, double** %16
%61 = load i32, i32* %18
%62 = sext i32 %61 to i64
%63 = getelementptr inbounds double, double* %60, i64 %62
%64 = load double, double* %63
%65 = fadd double %59, %64
%66 = load double*, double** %14
%67 = load i32, i32* %18
%68 = sext i32 %67 to i64
%69 = getelementptr inbounds double, double* %66, i64 %68
store double %65, double* %69
br label %70
70: ; preds = %54
%71 = load i32, i32* %18
%72 = add nsw i32 %71, 1
store i32 %72, i32* %18
br label %48
73: ; preds = %48
%74 = load double*, double** %14
%75 = load i32, i32* %12
%76 = call i32 @matinv(double* %74, i32 %75)
store i32 %76, i32* %19
%77 = icmp ne i32 %76, 0
br i1 %77, label %97, label %78
78: ; preds = %73
%79 = load i32, i32* %12
%80 = load i32, i32* %12
%81 = load double*, double** %15
%82 = load double*, double** %8
%83 = load double*, double** %17
%84 = call i32 @matmul(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %79, i32 1, i32 %80, double 1.000000e+00, double* %81, double* %82, double 0.000000e+00, double* %83)
%85 = load i32, i32* %12
%86 = load i32, i32* %12
%87 = load double*, double** %16
%88 = load double*, double** %10
%89 = load double*, double** %17
%90 = call i32 @matmul(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %85, i32 1, i32 %86, double 1.000000e+00, double* %87, double* %88, double 1.000000e+00, double* %89)
%91 = load i32, i32* %12
%92 = load i32, i32* %12
%93 = load double*, double** %14
%94 = load double*, double** %17
%95 = load double*, double** %13
%96 = call i32 @matmul(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %91, i32 1, i32 %92, double 1.000000e+00, double* %93, double* %94, double 0.000000e+00, double* %95)
br label %97
97: ; preds = %78, %73
br label %98
98: ; preds = %97, %42, %7
%99 = load double*, double** %15
%100 = call i32 @free(double* %99)
%101 = load double*, double** %16
%102 = call i32 @free(double* %101)
%103 = load double*, double** %17
%104 = call i32 @free(double* %103)
%105 = load i32, i32* %19
ret i32 %105
}

LLVM IR (-O2):
@.str = [3 x i8] c"NN\00"
define i32 @smoother(double* %0, double* %1, double* %2, double* %3, i32 %4, double* %5, double* %6) {
%8 = tail call double* @mat(i32 %4, i32 %4)
%9 = tail call double* @mat(i32 %4, i32 %4)
%10 = tail call double* @mat(i32 %4, i32 1)
%11 = tail call i32 @matcpy(double* %8, double* %1, i32 %4, i32 %4)
%12 = tail call i32 @matcpy(double* %9, double* %3, i32 %4, i32 %4)
%13 = tail call i32 @matinv(double* %8, i32 %4)
%14 = icmp eq i32 %13, 0
br i1 %14, label %15, label %170
15: ; preds = %7
%16 = tail call i32 @matinv(double* %9, i32 %4)
%17 = icmp eq i32 %16, 0
br i1 %17, label %18, label %170
18: ; preds = %15
%19 = mul i32 %4, %4
%20 = icmp eq i32 %19, 0
br i1 %20, label %163, label %21
21: ; preds = %18
%22 = zext i32 %19 to i64
%23 = icmp ult i32 %19, 4
br i1 %23, label %111, label %24
24: ; preds = %21
%25 = getelementptr double, double* %6, i64 %22
%26 = getelementptr double, double* %8, i64 %22
%27 = getelementptr double, double* %9, i64 %22
%28 = icmp ugt double* %26, %6
%29 = icmp ult double* %8, %25
%30 = and i1 %28, %29
%31 = icmp ugt double* %27, %6
%32 = icmp ult double* %9, %25
%33 = and i1 %31, %32
%34 = or i1 %30, %33
br i1 %34, label %111, label %35
35: ; preds = %24
%36 = and i64 %22, 4294967292
%37 = add nsw i64 %36, -4
%38 = lshr exact i64 %37, 2
%39 = add nuw nsw i64 %38, 1
%40 = and i64 %39, 1
%41 = icmp eq i64 %37, 0
br i1 %41, label %87, label %42
42: ; preds = %35
%43 = and i64 %39, 9223372036854775806
br label %44
44: ; preds = %44, %42
%45 = phi i64 [ 0, %42 ], [ %84, %44 ]
%46 = phi i64 [ 0, %42 ], [ %85, %44 ]
%47 = getelementptr inbounds double, double* %8, i64 %45
%48 = bitcast double* %47 to <2 x double>*
%49 = load <2 x double>, <2 x double>* %48
%50 = getelementptr inbounds double, double* %47, i64 2
%51 = bitcast double* %50 to <2 x double>*
%52 = load <2 x double>, <2 x double>* %51
%53 = getelementptr inbounds double, double* %9, i64 %45
%54 = bitcast double* %53 to <2 x double>*
%55 = load <2 x double>, <2 x double>* %54
%56 = getelementptr inbounds double, double* %53, i64 2
%57 = bitcast double* %56 to <2 x double>*
%58 = load <2 x double>, <2 x double>* %57
%59 = fadd <2 x double> %49, %55
%60 = fadd <2 x double> %52, %58
%61 = getelementptr inbounds double, double* %6, i64 %45
%62 = bitcast double* %61 to <2 x double>*
store <2 x double> %59, <2 x double>* %62
%63 = getelementptr inbounds double, double* %61, i64 2
%64 = bitcast double* %63 to <2 x double>*
store <2 x double> %60, <2 x double>* %64
%65 = or i64 %45, 4
%66 = getelementptr inbounds double, double* %8, i64 %65
%67 = bitcast double* %66 to <2 x double>*
%68 = load <2 x double>, <2 x double>* %67
%69 = getelementptr inbounds double, double* %66, i64 2
%70 = bitcast double* %69 to <2 x double>*
%71 = load <2 x double>, <2 x double>* %70
%72 = getelementptr inbounds double, double* %9, i64 %65
%73 = bitcast double* %72 to <2 x double>*
%74 = load <2 x double>, <2 x double>* %73
%75 = getelementptr inbounds double, double* %72, i64 2
%76 = bitcast double* %75 to <2 x double>*
%77 = load <2 x double>, <2 x double>* %76
%78 = fadd <2 x double> %68, %74
%79 = fadd <2 x double> %71, %77
%80 = getelementptr inbounds double, double* %6, i64 %65
%81 = bitcast double* %80 to <2 x double>*
store <2 x double> %78, <2 x double>* %81
%82 = getelementptr inbounds double, double* %80, i64 2
%83 = bitcast double* %82 to <2 x double>*
store <2 x double> %79, <2 x double>* %83
%84 = add nuw i64 %45, 8
%85 = add i64 %46, 2
%86 = icmp eq i64 %85, %43
br i1 %86, label %87, label %44
87: ; preds = %44, %35
%88 = phi i64 [ 0, %35 ], [ %84, %44 ]
%89 = icmp eq i64 %40, 0
br i1 %89, label %109, label %90
90: ; preds = %87
%91 = getelementptr inbounds double, double* %8, i64 %88
%92 = bitcast double* %91 to <2 x double>*
%93 = load <2 x double>, <2 x double>* %92
%94 = getelementptr inbounds double, double* %91, i64 2
%95 = bitcast double* %94 to <2 x double>*
%96 = load <2 x double>, <2 x double>* %95
%97 = getelementptr inbounds double, double* %9, i64 %88
%98 = bitcast double* %97 to <2 x double>*
%99 = load <2 x double>, <2 x double>* %98
%100 = getelementptr inbounds double, double* %97, i64 2
%101 = bitcast double* %100 to <2 x double>*
%102 = load <2 x double>, <2 x double>* %101
%103 = fadd <2 x double> %93, %99
%104 = fadd <2 x double> %96, %102
%105 = getelementptr inbounds double, double* %6, i64 %88
%106 = bitcast double* %105 to <2 x double>*
store <2 x double> %103, <2 x double>* %106
%107 = getelementptr inbounds double, double* %105, i64 2
%108 = bitcast double* %107 to <2 x double>*
store <2 x double> %104, <2 x double>* %108
br label %109
109: ; preds = %87, %90
%110 = icmp eq i64 %36, %22
br i1 %110, label %163, label %111
111: ; preds = %24, %21, %109
%112 = phi i64 [ 0, %24 ], [ 0, %21 ], [ %36, %109 ]
%113 = xor i64 %112, -1
%114 = add nsw i64 %113, %22
%115 = and i64 %22, 3
%116 = icmp eq i64 %115, 0
br i1 %116, label %129, label %117
117: ; preds = %111, %117
%118 = phi i64 [ %126, %117 ], [ %112, %111 ]
%119 = phi i64 [ %127, %117 ], [ 0, %111 ]
%120 = getelementptr inbounds double, double* %8, i64 %118
%121 = load double, double* %120
%122 = getelementptr inbounds double, double* %9, i64 %118
%123 = load double, double* %122
%124 = fadd double %121, %123
%125 = getelementptr inbounds double, double* %6, i64 %118
store double %124, double* %125
%126 = add nuw nsw i64 %118, 1
%127 = add i64 %119, 1
%128 = icmp eq i64 %127, %115
br i1 %128, label %129, label %117
129: ; preds = %117, %111
%130 = phi i64 [ %112, %111 ], [ %126, %117 ]
%131 = icmp ult i64 %114, 3
br i1 %131, label %163, label %132
132: ; preds = %129, %132
%133 = phi i64 [ %161, %132 ], [ %130, %129 ]
%134 = getelementptr inbounds double, double* %8, i64 %133
%135 = load double, double* %134
%136 = getelementptr inbounds double, double* %9, i64 %133
%137 = load double, double* %136
%138 = fadd double %135, %137
%139 = getelementptr inbounds double, double* %6, i64 %133
store double %138, double* %139
%140 = add nuw nsw i64 %133, 1
%141 = getelementptr inbounds double, double* %8, i64 %140
%142 = load double, double* %141
%143 = getelementptr inbounds double, double* %9, i64 %140
%144 = load double, double* %143
%145 = fadd double %142, %144
%146 = getelementptr inbounds double, double* %6, i64 %140
store double %145, double* %146
%147 = add nuw nsw i64 %133, 2
%148 = getelementptr inbounds double, double* %8, i64 %147
%149 = load double, double* %148
%150 = getelementptr inbounds double, double* %9, i64 %147
%151 = load double, double* %150
%152 = fadd double %149, %151
%153 = getelementptr inbounds double, double* %6, i64 %147
store double %152, double* %153
%154 = add nuw nsw i64 %133, 3
%155 = getelementptr inbounds double, double* %8, i64 %154
%156 = load double, double* %155
%157 = getelementptr inbounds double, double* %9, i64 %154
%158 = load double, double* %157
%159 = fadd double %156, %158
%160 = getelementptr inbounds double, double* %6, i64 %154
store double %159, double* %160
%161 = add nuw nsw i64 %133, 4
%162 = icmp eq i64 %161, %22
br i1 %162, label %163, label %132
163: ; preds = %129, %132, %109, %18
%164 = tail call i32 @matinv(double* %6, i32 %4)
%165 = icmp eq i32 %164, 0
br i1 %165, label %166, label %170
166: ; preds = %163
%167 = tail call i32 @matmul(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %4, i32 1, i32 %4, double 1.000000e+00, double* %8, double* %0, double 0.000000e+00, double* %10)
%168 = tail call i32 @matmul(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %4, i32 1, i32 %4, double 1.000000e+00, double* %9, double* %2, double 1.000000e+00, double* %10)
%169 = tail call i32 @matmul(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i32 %4, i32 1, i32 %4, double 1.000000e+00, double* %6, double* %10, double 0.000000e+00, double* %5)
br label %170
170: ; preds = %163, %166, %15, %7
%171 = phi i32 [ -1, %7 ], [ -1, %15 ], [ %164, %163 ], [ 0, %166 ]
%172 = tail call i32 @free(double* %8)
%173 = tail call i32 @free(double* %9)
%174 = tail call i32 @free(double* %10)
ret i32 %171
}