#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
scalar_t__ mat_check_identity_matrix_l3(long **, long **);
int /*<<< orphan*/ mat_copy_matrix_l3(long **, long **);
int /*<<< orphan*/ mat_multiply_matrix_l3(long **, long **, long **);
int /*<<< orphan*/ mat_transpose_matrix_l3(long **, long **);
int grg_get_reciprocal_point_group(long rec_rotations[48][3][3],
                                   long (*rotations)[3][3], const int num_rot,
                                   const int is_time_reversal) {
  int i, j, num_rot_ret, inv_exist;
  long inversion[3][3] = {{-1, 0, 0}, {0, -1, 0}, {0, 0, -1}};
  num_rot_ret = 0;
  for (i = 0; i < num_rot; i++) {
    for (j = 0; j < num_rot_ret; j++) {
      if (mat_check_identity_matrix_l3(rotations[i], rec_rotations[j])) {
        goto escape;
      }
    }
    if (num_rot_ret == 48) {
      goto err;
    }
    mat_copy_matrix_l3(rec_rotations[num_rot_ret], rotations[i]);
    num_rot_ret++;
  escape:;
  }
  inv_exist = 0;
  if (is_time_reversal) {
    for (i = 0; i < num_rot_ret; i++) {
      if (mat_check_identity_matrix_l3(inversion, rec_rotations[i])) {
        inv_exist = 1;
        break;
      }
    }
    if (!inv_exist) {
      if (num_rot_ret > 24) {
        goto err;
      }
      for (i = 0; i < num_rot_ret; i++) {
        mat_multiply_matrix_l3(rec_rotations[num_rot_ret + i], inversion,
                               rec_rotations[i]);
      }
      num_rot_ret *= 2;
    }
  }
  for (i = 0; i < num_rot_ret; i++) {
    mat_transpose_matrix_l3(rec_rotations[i], rec_rotations[i]);
  }
  return num_rot_ret;
err:
  return 0;
}


x86 assembly (clang, -O0):
<grg_get_reciprocal_point_group>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    %ecx,-0x20(%rbp)
lea    -0x80(%rbp),%rdi
xor    %esi,%esi
mov    $0x48,%edx
call   1030 <memset@plt>
movq   $0xffffffffffffffff,-0x80(%rbp)
ff
movq   $0xffffffffffffffff,-0x60(%rbp)
ff
movq   $0xffffffffffffffff,-0x40(%rbp)
ff
movl   $0x0,-0x2c(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    1251 <grg_get_reciprocal_point_group+0x101>
movl   $0x0,-0x28(%rbp)
mov    -0x28(%rbp),%eax
cmp    -0x2c(%rbp),%eax
jge    1203 <grg_get_reciprocal_point_group+0xb3>
mov    -0x18(%rbp),%rdi
movslq -0x24(%rbp),%rax
imul   $0x48,%rax,%rax
add    %rax,%rdi
mov    -0x10(%rbp),%rsi
movslq -0x28(%rbp),%rax
imul   $0x48,%rax,%rax
add    %rax,%rsi
call   1050 <mat_check_identity_matrix_l3@plt>
cmp    $0x0,%rax
je     11f0 <grg_get_reciprocal_point_group+0xa0>
jmp    123e <grg_get_reciprocal_point_group+0xee>
jmp    11f5 <grg_get_reciprocal_point_group+0xa5>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    11b2 <grg_get_reciprocal_point_group+0x62>
cmpl   $0x30,-0x2c(%rbp)
jne    1212 <grg_get_reciprocal_point_group+0xc2>
jmp    1378 <grg_get_reciprocal_point_group+0x228>
mov    -0x10(%rbp),%rdi
movslq -0x2c(%rbp),%rax
imul   $0x48,%rax,%rax
add    %rax,%rdi
mov    -0x18(%rbp),%rsi
movslq -0x24(%rbp),%rax
imul   $0x48,%rax,%rax
add    %rax,%rsi
call   1040 <mat_copy_matrix_l3@plt>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1243 <grg_get_reciprocal_point_group+0xf3>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    119f <grg_get_reciprocal_point_group+0x4f>
movl   $0x0,-0x30(%rbp)
cmpl   $0x0,-0x20(%rbp)
je     1329 <grg_get_reciprocal_point_group+0x1d9>
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x2c(%rbp),%eax
jge    12b6 <grg_get_reciprocal_point_group+0x166>
lea    -0x80(%rbp),%rdi
mov    -0x10(%rbp),%rsi
movslq -0x24(%rbp),%rax
imul   $0x48,%rax,%rax
add    %rax,%rsi
call   1050 <mat_check_identity_matrix_l3@plt>
cmp    $0x0,%rax
je     12a3 <grg_get_reciprocal_point_group+0x153>
movl   $0x1,-0x30(%rbp)
jmp    12b6 <grg_get_reciprocal_point_group+0x166>
jmp    12a8 <grg_get_reciprocal_point_group+0x158>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1269 <grg_get_reciprocal_point_group+0x119>
cmpl   $0x0,-0x30(%rbp)
jne    1324 <grg_get_reciprocal_point_group+0x1d4>
cmpl   $0x18,-0x2c(%rbp)
jle    12cf <grg_get_reciprocal_point_group+0x17f>
jmp    1378 <grg_get_reciprocal_point_group+0x228>
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x2c(%rbp),%eax
jge    131b <grg_get_reciprocal_point_group+0x1cb>
mov    -0x10(%rbp),%rdi
mov    -0x2c(%rbp),%eax
add    -0x24(%rbp),%eax
cltq
imul   $0x48,%rax,%rax
add    %rax,%rdi
lea    -0x80(%rbp),%rsi
mov    -0x10(%rbp),%rdx
movslq -0x24(%rbp),%rax
imul   $0x48,%rax,%rax
add    %rax,%rdx
call   1070 <mat_multiply_matrix_l3@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    12d6 <grg_get_reciprocal_point_group+0x186>
mov    -0x2c(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    1329 <grg_get_reciprocal_point_group+0x1d9>
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x2c(%rbp),%eax
jge    136d <grg_get_reciprocal_point_group+0x21d>
mov    -0x10(%rbp),%rdi
movslq -0x24(%rbp),%rax
imul   $0x48,%rax,%rax
add    %rax,%rdi
mov    -0x10(%rbp),%rsi
movslq -0x24(%rbp),%rax
imul   $0x48,%rax,%rax
add    %rax,%rsi
call   1060 <mat_transpose_matrix_l3@plt>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    1330 <grg_get_reciprocal_point_group+0x1e0>
mov    -0x2c(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    137f <grg_get_reciprocal_point_group+0x22f>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<grg_get_reciprocal_point_group>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x68,%rsp
mov    %rdi,%r12
xorps  %xmm0,%xmm0
movaps %xmm0,0x20(%rsp)
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x30(%rsp)
movq   $0xffffffffffffffff,0x20(%rsp)
ff ff
movq   $0xffffffffffffffff,0x40(%rsp)
ff ff
movq   $0xffffffffffffffff,0x60(%rsp)
ff ff
test   %edx,%edx
jle    12b1 <grg_get_reciprocal_point_group+0x171>
mov    %rsi,%rbx
mov    %ecx,0xc(%rsp)
mov    %edx,%eax
mov    %rax,0x18(%rsp)
xor    %r14d,%r14d
xor    %r15d,%r15d
mov    %rsi,0x10(%rsp)
jmp    11d7 <grg_get_reciprocal_point_group+0x97>
cs nopw 0x0(%rax,%rax,1)
movslq %r15d,%rax
lea    (%rax,%rax,8),%rax
lea    (%r12,%rax,8),%rdi
lea    (%r14,%r14,8),%rax
lea    (%rbx,%rax,8),%rsi
call   1030 <mat_copy_matrix_l3@plt>
add    $0x1,%r15d
add    $0x1,%r14
cmp    0x18(%rsp),%r14
je     122a <grg_get_reciprocal_point_group+0xea>
test   %r15d,%r15d
jle    11b0 <grg_get_reciprocal_point_group+0x70>
lea    (%r14,%r14,8),%rax
lea    (%rbx,%rax,8),%rbp
mov    %r15d,%r13d
mov    %r15d,%r15d
mov    %r12,%rbx
nopl   (%rax)
mov    %rbp,%rdi
mov    %rbx,%rsi
call   1040 <mat_check_identity_matrix_l3@plt>
test   %rax,%rax
jne    1220 <grg_get_reciprocal_point_group+0xe0>
add    $0x48,%rbx
add    $0xffffffffffffffff,%r15
jne    11f0 <grg_get_reciprocal_point_group+0xb0>
mov    %r13d,%r15d
cmp    $0x30,%r13d
mov    0x10(%rsp),%rbx
jne    11b0 <grg_get_reciprocal_point_group+0x70>
jmp    12f7 <grg_get_reciprocal_point_group+0x1b7>
nopl   (%rax)
mov    0x10(%rsp),%rbx
mov    %r13d,%r15d
jmp    11cc <grg_get_reciprocal_point_group+0x8c>
cmpl   $0x0,0xc(%rsp)
je     12c0 <grg_get_reciprocal_point_group+0x180>
test   %r15d,%r15d
jle    12bd <grg_get_reciprocal_point_group+0x17d>
mov    %r15d,%r13d
mov    %r15d,%r14d
lea    0x20(%rsp),%r15
mov    %r14,%rbp
mov    %r12,%rbx
nop
mov    %r15,%rdi
mov    %rbx,%rsi
call   1040 <mat_check_identity_matrix_l3@plt>
test   %rax,%rax
jne    12fb <grg_get_reciprocal_point_group+0x1bb>
add    $0x48,%rbx
add    $0xffffffffffffffff,%rbp
jne    1250 <grg_get_reciprocal_point_group+0x110>
xor    %eax,%eax
cmp    $0x18,%r13d
jg     12e8 <grg_get_reciprocal_point_group+0x1a8>
mov    %r13d,%r15d
test   %r13d,%r13d
jle    12bd <grg_get_reciprocal_point_group+0x17d>
shl    $0x3,%r14
lea    (%r14,%r14,8),%r15
xor    %ebx,%ebx
lea    0x20(%rsp),%r14
mov    %r12,%rbp
lea    (%r15,%rbp,1),%rdi
mov    %r14,%rsi
mov    %rbp,%rdx
call   1060 <mat_multiply_matrix_l3@plt>
add    $0x48,%rbp
add    $0x48,%rbx
cmp    %rbx,%r15
jne    1290 <grg_get_reciprocal_point_group+0x150>
mov    %r13d,%r15d
jmp    12bd <grg_get_reciprocal_point_group+0x17d>
xor    %r15d,%r15d
mov    $0x0,%eax
test   %ecx,%ecx
je     12e8 <grg_get_reciprocal_point_group+0x1a8>
add    %r15d,%r15d
test   %r15d,%r15d
jle    12e5 <grg_get_reciprocal_point_group+0x1a5>
mov    %r15d,%ebx
nopl   0x0(%rax,%rax,1)
mov    %r12,%rdi
mov    %r12,%rsi
call   1050 <mat_transpose_matrix_l3@plt>
add    $0x48,%r12
add    $0xffffffffffffffff,%rbx
jne    12d0 <grg_get_reciprocal_point_group+0x190>
mov    %r15d,%eax
add    $0x68,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
xor    %eax,%eax
jmp    12e8 <grg_get_reciprocal_point_group+0x1a8>
mov    %r13d,%r15d
test   %r15d,%r15d
jg     12c5 <grg_get_reciprocal_point_group+0x185>
jmp    12e5 <grg_get_reciprocal_point_group+0x1a5>

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

LLVM IR (-O2):
define i32 @grg_get_reciprocal_point_group([3 x [3 x i64]]* %0, [3 x [3 x i64]]* %1, i32 %2, i32 %3) {
%5 = alloca [3 x [3 x i64]]
%6 = bitcast [3 x [3 x i64]]* %5 to i8*
%7 = getelementptr inbounds [3 x [3 x i64]], [3 x [3 x i64]]* %5, i64 0, i64 0, i64 0
store i64 -1, i64* %7
%8 = getelementptr inbounds [3 x [3 x i64]], [3 x [3 x i64]]* %5, i64 0, i64 1, i64 1
store i64 -1, i64* %8
%9 = getelementptr inbounds [3 x [3 x i64]], [3 x [3 x i64]]* %5, i64 0, i64 2, i64 2
store i64 -1, i64* %9
%10 = icmp sgt i32 %2, 0
br i1 %10, label %11, label %46
11: ; preds = %4
%12 = zext i32 %2 to i64
br label %13
13: ; preds = %11, %40
%14 = phi i64 [ 0, %11 ], [ %42, %40 ]
%15 = phi i32 [ 0, %11 ], [ %41, %40 ]
%16 = icmp sgt i32 %15, 0
br i1 %16, label %17, label %32
17: ; preds = %13
%18 = getelementptr inbounds [3 x [3 x i64]], [3 x [3 x i64]]* %1, i64 %14, i64 0
%19 = bitcast [3 x i64]* %18 to i64**
%20 = zext i32 %15 to i64
br label %23
21: ; preds = %23
%22 = icmp eq i64 %29, %20
br i1 %22, label %30, label %23
23: ; preds = %17, %21
%24 = phi i64 [ 0, %17 ], [ %29, %21 ]
%25 = getelementptr inbounds [3 x [3 x i64]], [3 x [3 x i64]]* %0, i64 %24, i64 0
%26 = bitcast [3 x i64]* %25 to i64**
%27 = tail call i64 @mat_check_identity_matrix_l3(i64** %19, i64** %26)
%28 = icmp eq i64 %27, 0
%29 = add nuw nsw i64 %24, 1
br i1 %28, label %21, label %40
30: ; preds = %21
%31 = icmp eq i32 %15, 48
br i1 %31, label %94, label %32
32: ; preds = %13, %30
%33 = sext i32 %15 to i64
%34 = getelementptr inbounds [3 x [3 x i64]], [3 x [3 x i64]]* %0, i64 %33, i64 0
%35 = bitcast [3 x i64]* %34 to i64**
%36 = getelementptr inbounds [3 x [3 x i64]], [3 x [3 x i64]]* %1, i64 %14, i64 0
%37 = bitcast [3 x i64]* %36 to i64**
%38 = tail call i32 @mat_copy_matrix_l3(i64** %35, i64** %37)
%39 = add nsw i32 %15, 1
br label %40
40: ; preds = %23, %32
%41 = phi i32 [ %39, %32 ], [ %15, %23 ]
%42 = add nuw nsw i64 %14, 1
%43 = icmp eq i64 %42, %12
br i1 %43, label %44, label %13
44: ; preds = %40
%45 = icmp eq i32 %3, 0
br i1 %45, label %82, label %48
46: ; preds = %4
%47 = icmp eq i32 %3, 0
br i1 %47, label %94, label %79
48: ; preds = %44
%49 = icmp sgt i32 %41, 0
br i1 %49, label %50, label %79
50: ; preds = %48
%51 = bitcast [3 x [3 x i64]]* %5 to i64**
%52 = zext i32 %41 to i64
br label %55
53: ; preds = %55
%54 = icmp eq i64 %61, %52
br i1 %54, label %62, label %55
55: ; preds = %50, %53
%56 = phi i64 [ 0, %50 ], [ %61, %53 ]
%57 = getelementptr inbounds [3 x [3 x i64]], [3 x [3 x i64]]* %0, i64 %56, i64 0
%58 = bitcast [3 x i64]* %57 to i64**
%59 = call i64 @mat_check_identity_matrix_l3(i64** %51, i64** %58)
%60 = icmp eq i64 %59, 0
%61 = add nuw nsw i64 %56, 1
br i1 %60, label %53, label %82
62: ; preds = %53
%63 = icmp sgt i32 %41, 24
br i1 %63, label %94, label %64
64: ; preds = %62
br i1 %49, label %65, label %79
65: ; preds = %64
%66 = bitcast [3 x [3 x i64]]* %5 to i64**
%67 = zext i32 %41 to i64
%68 = zext i32 %41 to i64
br label %69
69: ; preds = %65, %69
%70 = phi i64 [ 0, %65 ], [ %77, %69 ]
%71 = add nuw nsw i64 %70, %67
%72 = getelementptr inbounds [3 x [3 x i64]], [3 x [3 x i64]]* %0, i64 %71, i64 0
%73 = bitcast [3 x i64]* %72 to i64**
%74 = getelementptr inbounds [3 x [3 x i64]], [3 x [3 x i64]]* %0, i64 %70, i64 0
%75 = bitcast [3 x i64]* %74 to i64**
%76 = call i32 @mat_multiply_matrix_l3(i64** %73, i64** %66, i64** %75)
%77 = add nuw nsw i64 %70, 1
%78 = icmp eq i64 %77, %68
br i1 %78, label %79, label %69
79: ; preds = %69, %48, %46, %64
%80 = phi i32 [ %41, %64 ], [ %41, %48 ], [ 0, %46 ], [ %41, %69 ]
%81 = shl nsw i32 %80, 1
br label %82
82: ; preds = %55, %79, %44
%83 = phi i32 [ %81, %79 ], [ %41, %44 ], [ %41, %55 ]
%84 = icmp sgt i32 %83, 0
br i1 %84, label %85, label %94
85: ; preds = %82
%86 = zext i32 %83 to i64
br label %87
87: ; preds = %85, %87
%88 = phi i64 [ 0, %85 ], [ %92, %87 ]
%89 = getelementptr inbounds [3 x [3 x i64]], [3 x [3 x i64]]* %0, i64 %88, i64 0
%90 = bitcast [3 x i64]* %89 to i64**
%91 = call i32 @mat_transpose_matrix_l3(i64** %90, i64** %90)
%92 = add nuw nsw i64 %88, 1
%93 = icmp eq i64 %92, %86
br i1 %93, label %94, label %87
94: ; preds = %30, %87, %46, %82, %62
%95 = phi i32 [ 0, %62 ], [ %83, %82 ], [ 0, %46 ], [ %83, %87 ], [ 0, %30 ]
ret i32 %95
}