#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*/ identity(double *, int, int);
int /*<<< orphan*/ matrix_add_two_rows(double *, int, int, int, int, double);
int /*<<< orphan*/ matrix_copy_matrix(double *, double *, int, int);
int /*<<< orphan*/ matrix_row_permutation(double *, int, int, int, int,
                                          double *);
int /*<<< orphan*/ matrix_scale_row(double *, int, int, int, int);
int matrix_inversion(double *output, double *input, int rows, int cols,
                     double *buffer_input, double *row_buffer) {
  int i, j;
  double pivot_value, scale;
  double lambda_inv = 1.0e-8;
  pivot_value = 0;
  matrix_copy_matrix(buffer_input, input, rows, cols);
  for (i = 0; i < rows; i++) {
    buffer_input[i + i * rows] = buffer_input[i + i * rows] + lambda_inv;
    input[i + i * rows] = input[i + i * rows] + lambda_inv;
  }
  identity(output, rows, cols);
  for (j = 0; j < cols; j++) {
    for (i = j; i < rows; i++) {
      if (buffer_input[i + j * rows] > 1e-6) {
        matrix_row_permutation(buffer_input, rows, cols, j, i, row_buffer);
        matrix_row_permutation(output, rows, cols, j, i, row_buffer);
        break;
      }
    }
    pivot_value = buffer_input[j + j * rows];
    matrix_scale_row(buffer_input, rows, cols, j, 1 / pivot_value);
    matrix_scale_row(output, rows, cols, j, 1 / pivot_value);
    pivot_value = 1;
    for (i = 0; i < rows; i++) {
      if (i != j) {
        scale = -buffer_input[i + j * cols];
        matrix_add_two_rows(buffer_input, rows, cols, i, j, scale);
        matrix_add_two_rows(output, rows, cols, i, j, scale);
      }
    }
  }
}


x86 assembly (clang, -O0):
<matrix_inversion>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    %ecx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
movsd  0xe8a(%rip),%xmm0
movsd  %xmm0,-0x50(%rbp)
xorps  %xmm0,%xmm0
movsd  %xmm0,-0x40(%rbp)
mov    -0x28(%rbp),%rdi
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
mov    -0x20(%rbp),%ecx
call   1030 <matrix_copy_matrix@plt>
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    1221 <matrix_inversion+0xd1>
mov    -0x28(%rbp),%rax
mov    -0x34(%rbp),%ecx
mov    -0x34(%rbp),%edx
imul   -0x1c(%rbp),%edx
add    %edx,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
addsd  -0x50(%rbp),%xmm0
mov    -0x28(%rbp),%rax
mov    -0x34(%rbp),%ecx
mov    -0x34(%rbp),%edx
imul   -0x1c(%rbp),%edx
add    %edx,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x18(%rbp),%rax
mov    -0x34(%rbp),%ecx
mov    -0x34(%rbp),%edx
imul   -0x1c(%rbp),%edx
add    %edx,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
addsd  -0x50(%rbp),%xmm0
mov    -0x18(%rbp),%rax
mov    -0x34(%rbp),%ecx
mov    -0x34(%rbp),%edx
imul   -0x1c(%rbp),%edx
add    %edx,%ecx
movslq %ecx,%rcx
movsd  %xmm0,(%rax,%rcx,8)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    119d <matrix_inversion+0x4d>
mov    -0x10(%rbp),%rdi
mov    -0x1c(%rbp),%esi
mov    -0x20(%rbp),%edx
call   1050 <identity@plt>
movl   $0x0,-0x38(%rbp)
mov    -0x38(%rbp),%eax
cmp    -0x20(%rbp),%eax
jge    13ec <matrix_inversion+0x29c>
mov    -0x38(%rbp),%eax
mov    %eax,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    12cb <matrix_inversion+0x17b>
mov    -0x28(%rbp),%rax
mov    -0x34(%rbp),%ecx
mov    -0x38(%rbp),%edx
imul   -0x1c(%rbp),%edx
add    %edx,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  0xd93(%rip),%xmm1
ucomisd %xmm1,%xmm0
jbe    12b8 <matrix_inversion+0x168>
mov    -0x28(%rbp),%rdi
mov    -0x1c(%rbp),%esi
mov    -0x20(%rbp),%edx
mov    -0x38(%rbp),%ecx
mov    -0x34(%rbp),%r8d
mov    -0x30(%rbp),%r9
call   1040 <matrix_row_permutation@plt>
mov    -0x10(%rbp),%rdi
mov    -0x1c(%rbp),%esi
mov    -0x20(%rbp),%edx
mov    -0x38(%rbp),%ecx
mov    -0x34(%rbp),%r8d
mov    -0x30(%rbp),%r9
call   1040 <matrix_row_permutation@plt>
jmp    12cb <matrix_inversion+0x17b>
jmp    12bd <matrix_inversion+0x16d>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1249 <matrix_inversion+0xf9>
mov    -0x28(%rbp),%rax
mov    -0x38(%rbp),%ecx
mov    -0x38(%rbp),%edx
imul   -0x1c(%rbp),%edx
add    %edx,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movsd  %xmm0,-0x40(%rbp)
mov    -0x28(%rbp),%rdi
mov    -0x1c(%rbp),%esi
mov    -0x20(%rbp),%edx
mov    -0x38(%rbp),%ecx
movsd  0xd13(%rip),%xmm0
divsd  -0x40(%rbp),%xmm0
cvttsd2si %xmm0,%r8d
call   1060 <matrix_scale_row@plt>
mov    -0x10(%rbp),%rdi
mov    -0x1c(%rbp),%esi
mov    -0x20(%rbp),%edx
mov    -0x38(%rbp),%ecx
movsd  0xcef(%rip),%xmm0
divsd  -0x40(%rbp),%xmm0
cvttsd2si %xmm0,%r8d
call   1060 <matrix_scale_row@plt>
movsd  0xcd8(%rip),%xmm0
movsd  %xmm0,-0x40(%rbp)
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    13d9 <matrix_inversion+0x289>
mov    -0x34(%rbp),%eax
cmp    -0x38(%rbp),%eax
je     13c6 <matrix_inversion+0x276>
mov    -0x28(%rbp),%rax
mov    -0x34(%rbp),%ecx
mov    -0x38(%rbp),%edx
imul   -0x20(%rbp),%edx
add    %edx,%ecx
movslq %ecx,%rcx
movsd  (%rax,%rcx,8),%xmm0
movq   %xmm0,%rax
movabs $0x8000000000000000,%rcx
xor    %rcx,%rax
movq   %rax,%xmm0
movsd  %xmm0,-0x48(%rbp)
mov    -0x28(%rbp),%rdi
mov    -0x1c(%rbp),%esi
mov    -0x20(%rbp),%edx
mov    -0x34(%rbp),%ecx
mov    -0x38(%rbp),%r8d
movsd  -0x48(%rbp),%xmm0
call   1070 <matrix_add_two_rows@plt>
mov    -0x10(%rbp),%rdi
mov    -0x1c(%rbp),%esi
mov    -0x20(%rbp),%edx
mov    -0x34(%rbp),%ecx
mov    -0x38(%rbp),%r8d
movsd  -0x48(%rbp),%xmm0
call   1070 <matrix_add_two_rows@plt>
jmp    13cb <matrix_inversion+0x27b>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1344 <matrix_inversion+0x1f4>
jmp    13de <matrix_inversion+0x28e>
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x38(%rbp)
jmp    1237 <matrix_inversion+0xe7>
mov    -0x4(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<matrix_inversion>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x68,%rsp
mov    %r9,0x28(%rsp)
mov    %r8,%r15
mov    %edx,%r12d
mov    %rsi,%r14
mov    %rdi,0x18(%rsp)
mov    %r8,%rdi
mov    %ecx,0x4(%rsp)
call   1030 <matrix_copy_matrix@plt>
mov    %r12d,%ebx
test   %r12d,%r12d
jle    125f <matrix_inversion+0x10f>
xor    %eax,%eax
cmp    $0x1,%r12d
je     122a <matrix_inversion+0xda>
lea    (%r12,%r12,1),%r9d
mov    %ebx,%r8d
and    $0xfffffffe,%r8d
neg    %r8
mov    $0x1,%r10d
movsd  0xe4f(%rip),%xmm0
xor    %esi,%esi
mov    %r12d,%ebp
xor    %edx,%edx
nopl   0x0(%rax,%rax,1)
movslq %ebp,%rbp
lea    (%r10,%rbp,1),%rcx
cltq
lea    (%rdx,%rax,1),%rdi
movsd  (%r15,%rdi,8),%xmm1
addsd  %xmm0,%xmm1
movsd  %xmm1,(%r15,%rdi,8)
movsd  (%r14,%rdi,8),%xmm1
addsd  %xmm0,%xmm1
movsd  %xmm1,(%r14,%rdi,8)
movsd  (%r15,%rcx,8),%xmm1
addsd  %xmm0,%xmm1
movsd  %xmm1,(%r15,%rcx,8)
movsd  (%r14,%rcx,8),%xmm1
addsd  %xmm0,%xmm1
movsd  %xmm1,(%r14,%rcx,8)
add    $0x2,%rdx
add    %r9d,%eax
add    $0x2,%r10
add    %r9d,%ebp
add    $0xfffffffffffffffe,%rsi
cmp    %rsi,%r8
jne    11c0 <matrix_inversion+0x70>
neg    %rsi
mov    %rsi,%rax
test   $0x1,%bl
je     125f <matrix_inversion+0x10f>
mov    %eax,%ecx
imul   %r12d,%ecx
movslq %ecx,%rcx
add    %rax,%rcx
movsd  0xdbd(%rip),%xmm0
movsd  (%r15,%rcx,8),%xmm1
addsd  %xmm0,%xmm1
movsd  %xmm1,(%r15,%rcx,8)
addsd  (%r14,%rcx,8),%xmm0
movsd  %xmm0,(%r14,%rcx,8)
mov    %r15,0x10(%rsp)
mov    0x18(%rsp),%rdi
mov    %r12,0x8(%rsp)
mov    %r12d,%esi
mov    0x4(%rsp),%ebp
mov    %ebp,%edx
call   1050 <identity@plt>
test   %ebp,%ebp
jle    143c <matrix_inversion+0x2ec>
movslq 0x8(%rsp),%rax
mov    0x4(%rsp),%ecx
mov    %rax,0x60(%rsp)
lea    0x8(,%rax,8),%rax
mov    %rax,0x50(%rsp)
mov    %rcx,0x58(%rsp)
lea    0x0(,%rcx,8),%rax
mov    %rax,0x48(%rsp)
xor    %eax,%eax
mov    %rax,0x20(%rsp)
movsd  0xd48(%rip),%xmm1
mov    0x10(%rsp),%r15
mov    %r15,%r13
xor    %r14d,%r14d
jmp    12f7 <matrix_inversion+0x1a7>
nopl   (%rax)
add    $0x1,%r14
addq   $0xffffffffffffffff,0x20(%rsp)
add    0x50(%rsp),%r15
add    0x48(%rsp),%r13
cmp    0x58(%rsp),%r14
movsd  0xd17(%rip),%xmm1
je     143c <matrix_inversion+0x2ec>
mov    %r14,%r12
mov    0x60(%rsp),%rax
imul   %rax,%r12
cmp    %rax,%r14
jge    137d <matrix_inversion+0x22d>
mov    0x20(%rsp),%rax
add    %rbx,%rax
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movsd  (%r15,%rbp,8),%xmm0
ucomisd %xmm1,%xmm0
ja     1340 <matrix_inversion+0x1f0>
add    $0x1,%rbp
cmp    %rbp,%rax
jne    1320 <matrix_inversion+0x1d0>
jmp    137d <matrix_inversion+0x22d>
nopw   0x0(%rax,%rax,1)
sub    0x20(%rsp),%ebp
mov    0x10(%rsp),%rdi
mov    %ebx,%esi
mov    0x4(%rsp),%edx
mov    %r14d,%ecx
mov    %ebp,%r8d
mov    0x28(%rsp),%r9
call   1040 <matrix_row_permutation@plt>
mov    0x18(%rsp),%rdi
mov    0x8(%rsp),%rsi
mov    0x4(%rsp),%edx
mov    %r14d,%ecx
mov    %ebp,%r8d
mov    0x28(%rsp),%r9
call   1040 <matrix_row_permutation@plt>
add    %r14,%r12
movsd  0xc88(%rip),%xmm0
mov    0x10(%rsp),%rdi
divsd  (%rdi,%r12,8),%xmm0
cvttsd2si %xmm0,%r8d
mov    %r8d,0x30(%rsp)
mov    0x8(%rsp),%r12
mov    %r12d,%esi
mov    0x4(%rsp),%ebp
mov    %ebp,%edx
mov    %r14d,%ecx
call   1060 <matrix_scale_row@plt>
mov    0x18(%rsp),%rdi
mov    %r12d,%esi
mov    %ebp,%edx
mov    %r14d,%ecx
mov    0x30(%rsp),%r8d
call   1060 <matrix_scale_row@plt>
test   %r12d,%r12d
jle    12d0 <matrix_inversion+0x180>
xor    %r12d,%r12d
jmp    13ed <matrix_inversion+0x29d>
nopl   0x0(%rax,%rax,1)
add    $0x1,%r12
cmp    %r12,%rbx
je     12d0 <matrix_inversion+0x180>
cmp    %r12,%r14
je     13e0 <matrix_inversion+0x290>
movsd  0x0(%r13,%r12,8),%xmm0
xorps  0xc20(%rip),%xmm0
movaps %xmm0,0x30(%rsp)
mov    0x10(%rsp),%rdi
mov    %ebx,%esi
mov    0x4(%rsp),%ebp
mov    %ebp,%edx
mov    %r12d,%ecx
mov    %r14d,%r8d
call   1070 <matrix_add_two_rows@plt>
mov    0x18(%rsp),%rdi
mov    0x8(%rsp),%rsi
mov    %ebp,%edx
mov    %r12d,%ecx
mov    %r14d,%r8d
movapd 0x30(%rsp),%xmm0
call   1070 <matrix_add_two_rows@plt>
jmp    13e0 <matrix_inversion+0x290>
add    $0x68,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
define i32 @matrix_inversion(double* %0, double* %1, i32 %2, i32 %3, double* %4, double* %5) {
%7 = tail call i32 @matrix_copy_matrix(double* %4, double* %1, i32 %2, i32 %3)
%8 = icmp sgt i32 %2, 0
br i1 %8, label %9, label %56
9: ; preds = %6
%10 = zext i32 %2 to i64
%11 = and i64 %10, 1
%12 = icmp eq i32 %2, 1
br i1 %12, label %42, label %13
13: ; preds = %9
%14 = and i64 %10, 4294967294
br label %15
15: ; preds = %15, %13
%16 = phi i64 [ 0, %13 ], [ %39, %15 ]
%17 = phi i64 [ 0, %13 ], [ %40, %15 ]
%18 = trunc i64 %16 to i32
%19 = mul nsw i32 %18, %2
%20 = sext i32 %19 to i64
%21 = add nsw i64 %16, %20
%22 = getelementptr inbounds double, double* %4, i64 %21
%23 = load double, double* %22
%24 = fadd double %23, 1.000000e-08
store double %24, double* %22
%25 = getelementptr inbounds double, double* %1, i64 %21
%26 = load double, double* %25
%27 = fadd double %26, 1.000000e-08
store double %27, double* %25
%28 = or i64 %16, 1
%29 = trunc i64 %28 to i32
%30 = mul nsw i32 %29, %2
%31 = sext i32 %30 to i64
%32 = add nsw i64 %28, %31
%33 = getelementptr inbounds double, double* %4, i64 %32
%34 = load double, double* %33
%35 = fadd double %34, 1.000000e-08
store double %35, double* %33
%36 = getelementptr inbounds double, double* %1, i64 %32
%37 = load double, double* %36
%38 = fadd double %37, 1.000000e-08
store double %38, double* %36
%39 = add nuw nsw i64 %16, 2
%40 = add i64 %17, 2
%41 = icmp eq i64 %40, %14
br i1 %41, label %42, label %15
42: ; preds = %15, %9
%43 = phi i64 [ 0, %9 ], [ %39, %15 ]
%44 = icmp eq i64 %11, 0
br i1 %44, label %56, label %45
45: ; preds = %42
%46 = trunc i64 %43 to i32
%47 = mul nsw i32 %46, %2
%48 = sext i32 %47 to i64
%49 = add nsw i64 %43, %48
%50 = getelementptr inbounds double, double* %4, i64 %49
%51 = load double, double* %50
%52 = fadd double %51, 1.000000e-08
store double %52, double* %50
%53 = getelementptr inbounds double, double* %1, i64 %49
%54 = load double, double* %53
%55 = fadd double %54, 1.000000e-08
store double %55, double* %53
br label %56
56: ; preds = %45, %42, %6
%57 = tail call i32 @identity(double* %0, i32 %2, i32 %3)
%58 = icmp sgt i32 %3, 0
br i1 %58, label %59, label %111
59: ; preds = %56
%60 = sext i32 %2 to i64
%61 = zext i32 %3 to i64
%62 = zext i32 %3 to i64
%63 = zext i32 %2 to i64
%64 = zext i32 %2 to i64
br label %65
65: ; preds = %59, %108
%66 = phi i64 [ 0, %59 ], [ %109, %108 ]
%67 = icmp slt i64 %66, %60
%68 = mul nsw i64 %66, %60
br i1 %67, label %69, label %83
69: ; preds = %65, %80
%70 = phi i64 [ %81, %80 ], [ %66, %65 ]
%71 = add nsw i64 %70, %68
%72 = getelementptr inbounds double, double* %4, i64 %71
%73 = load double, double* %72
%74 = fcmp ogt double %73, 0x3EB0C6F7A0B5ED8D
br i1 %74, label %75, label %80
75: ; preds = %69
%76 = trunc i64 %70 to i32
%77 = trunc i64 %66 to i32
%78 = tail call i32 @matrix_row_permutation(double* %4, i32 %2, i32 %3, i32 %77, i32 %76, double* %5)
%79 = tail call i32 @matrix_row_permutation(double* %0, i32 %2, i32 %3, i32 %77, i32 %76, double* %5)
br label %83
80: ; preds = %69
%81 = add nuw nsw i64 %70, 1
%82 = icmp eq i64 %81, %63
br i1 %82, label %83, label %69
83: ; preds = %80, %65, %75
%84 = add nsw i64 %68, %66
%85 = getelementptr inbounds double, double* %4, i64 %84
%86 = load double, double* %85
%87 = fdiv double 1.000000e+00, %86
%88 = fptosi double %87 to i32
%89 = trunc i64 %66 to i32
%90 = tail call i32 @matrix_scale_row(double* %4, i32 %2, i32 %3, i32 %89, i32 %88)
%91 = tail call i32 @matrix_scale_row(double* %0, i32 %2, i32 %3, i32 %89, i32 %88)
br i1 %8, label %92, label %108
92: ; preds = %83
%93 = mul nsw i64 %66, %61
br label %94
94: ; preds = %92, %105
%95 = phi i64 [ 0, %92 ], [ %106, %105 ]
%96 = icmp eq i64 %95, %66
br i1 %96, label %105, label %97
97: ; preds = %94
%98 = add nuw nsw i64 %95, %93
%99 = getelementptr inbounds double, double* %4, i64 %98
%100 = load double, double* %99
%101 = fneg double %100
%102 = trunc i64 %95 to i32
%103 = tail call i32 @matrix_add_two_rows(double* %4, i32 %2, i32 %3, i32 %102, i32 %89, double %101)
%104 = tail call i32 @matrix_add_two_rows(double* %0, i32 %2, i32 %3, i32 %102, i32 %89, double %101)
br label %105
105: ; preds = %94, %97
%106 = add nuw nsw i64 %95, 1
%107 = icmp eq i64 %106, %64
br i1 %107, label %108, label %94
108: ; preds = %105, %83
%109 = add nuw nsw i64 %66, 1
%110 = icmp eq i64 %109, %62
br i1 %110, label %111, label %65
111: ; preds = %108, %56
ret i32 undef
}