#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*/ matmul(long **, long **, long **);
int /*<<< orphan*/ swap_rows(long **, int, int);
int /*<<< orphan*/ zero_second_column(long **, long **);
void second_column(long A[3][3], long P[3][3]) {
  long L[3][3];
  if ((A[1][1] == 0) && (A[2][1] != 0)) {
    swap_rows(L, 1, 2);
    matmul(A, L, A);
    matmul(P, L, P);
  }
  if (A[2][1] != 0) {
    zero_second_column(L, A);
    matmul(A, L, A);
    matmul(P, L, P);
  }
}


x86 assembly (clang, -O0):
<second_column>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
cmpq   $0x0,0x20(%rax)
jne    1193 <second_column+0x63>
mov    -0x8(%rbp),%rax
cmpq   $0x0,0x38(%rax)
je     1193 <second_column+0x63>
lea    -0x60(%rbp),%rdi
mov    $0x1,%esi
mov    $0x2,%edx
call   1030 <swap_rows@plt>
mov    -0x8(%rbp),%rdi
lea    -0x60(%rbp),%rsi
mov    -0x8(%rbp),%rdx
call   1050 <matmul@plt>
mov    -0x10(%rbp),%rdi
lea    -0x60(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1050 <matmul@plt>
mov    -0x8(%rbp),%rax
cmpq   $0x0,0x38(%rax)
je     11d1 <second_column+0xa1>
lea    -0x60(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1040 <zero_second_column@plt>
mov    -0x8(%rbp),%rdi
lea    -0x60(%rbp),%rsi
mov    -0x8(%rbp),%rdx
call   1050 <matmul@plt>
mov    -0x10(%rbp),%rdi
lea    -0x60(%rbp),%rsi
mov    -0x10(%rbp),%rdx
call   1050 <matmul@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<second_column>:
push   %r15
push   %r14
push   %rbx
sub    $0x50,%rsp
mov    %rsi,%r14
mov    %rdi,%rbx
cmpq   $0x0,0x20(%rdi)
jne    117e <second_column+0x4e>
cmpq   $0x0,0x38(%rbx)
je     117e <second_column+0x4e>
mov    %rsp,%r15
mov    %r15,%rdi
mov    $0x1,%esi
mov    $0x2,%edx
call   1030 <swap_rows@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %rbx,%rdx
call   1050 <matmul@plt>
mov    %r14,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
call   1050 <matmul@plt>
cmpq   $0x0,0x38(%rbx)
je     11af <second_column+0x7f>
mov    %rsp,%r15
mov    %r15,%rdi
mov    %rbx,%rsi
call   1040 <zero_second_column@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
mov    %rbx,%rdx
call   1050 <matmul@plt>
mov    %r14,%rdi
mov    %r15,%rsi
mov    %r14,%rdx
call   1050 <matmul@plt>
add    $0x50,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @second_column([3 x i64]* %0, [3 x i64]* %1) {
%3 = alloca [3 x i64]*
%4 = alloca [3 x i64]*
%5 = alloca [3 x [3 x i64]]
store [3 x i64]* %0, [3 x i64]** %3
store [3 x i64]* %1, [3 x i64]** %4
%6 = load [3 x i64]*, [3 x i64]** %3
%7 = getelementptr inbounds [3 x i64], [3 x i64]* %6, i64 1
%8 = getelementptr inbounds [3 x i64], [3 x i64]* %7, i64 0, i64 1
%9 = load i64, i64* %8
%10 = icmp eq i64 %9, 0
br i1 %10, label %11, label %35
11: ; preds = %2
%12 = load [3 x i64]*, [3 x i64]** %3
%13 = getelementptr inbounds [3 x i64], [3 x i64]* %12, i64 2
%14 = getelementptr inbounds [3 x i64], [3 x i64]* %13, i64 0, i64 1
%15 = load i64, i64* %14
%16 = icmp ne i64 %15, 0
br i1 %16, label %17, label %35
17: ; preds = %11
%18 = getelementptr inbounds [3 x [3 x i64]], [3 x [3 x i64]]* %5, i64 0, i64 0
%19 = bitcast [3 x i64]* %18 to i64**
%20 = call i32 @swap_rows(i64** %19, i32 1, i32 2)
%21 = load [3 x i64]*, [3 x i64]** %3
%22 = bitcast [3 x i64]* %21 to i64**
%23 = getelementptr inbounds [3 x [3 x i64]], [3 x [3 x i64]]* %5, i64 0, i64 0
%24 = bitcast [3 x i64]* %23 to i64**
%25 = load [3 x i64]*, [3 x i64]** %3
%26 = bitcast [3 x i64]* %25 to i64**
%27 = call i32 @matmul(i64** %22, i64** %24, i64** %26)
%28 = load [3 x i64]*, [3 x i64]** %4
%29 = bitcast [3 x i64]* %28 to i64**
%30 = getelementptr inbounds [3 x [3 x i64]], [3 x [3 x i64]]* %5, i64 0, i64 0
%31 = bitcast [3 x i64]* %30 to i64**
%32 = load [3 x i64]*, [3 x i64]** %4
%33 = bitcast [3 x i64]* %32 to i64**
%34 = call i32 @matmul(i64** %29, i64** %31, i64** %33)
br label %35
35: ; preds = %17, %11, %2
%36 = load [3 x i64]*, [3 x i64]** %3
%37 = getelementptr inbounds [3 x i64], [3 x i64]* %36, i64 2
%38 = getelementptr inbounds [3 x i64], [3 x i64]* %37, i64 0, i64 1
%39 = load i64, i64* %38
%40 = icmp ne i64 %39, 0
br i1 %40, label %41, label %61
41: ; preds = %35
%42 = getelementptr inbounds [3 x [3 x i64]], [3 x [3 x i64]]* %5, i64 0, i64 0
%43 = bitcast [3 x i64]* %42 to i64**
%44 = load [3 x i64]*, [3 x i64]** %3
%45 = bitcast [3 x i64]* %44 to i64**
%46 = call i32 @zero_second_column(i64** %43, i64** %45)
%47 = load [3 x i64]*, [3 x i64]** %3
%48 = bitcast [3 x i64]* %47 to i64**
%49 = getelementptr inbounds [3 x [3 x i64]], [3 x [3 x i64]]* %5, i64 0, i64 0
%50 = bitcast [3 x i64]* %49 to i64**
%51 = load [3 x i64]*, [3 x i64]** %3
%52 = bitcast [3 x i64]* %51 to i64**
%53 = call i32 @matmul(i64** %48, i64** %50, i64** %52)
%54 = load [3 x i64]*, [3 x i64]** %4
%55 = bitcast [3 x i64]* %54 to i64**
%56 = getelementptr inbounds [3 x [3 x i64]], [3 x [3 x i64]]* %5, i64 0, i64 0
%57 = bitcast [3 x i64]* %56 to i64**
%58 = load [3 x i64]*, [3 x i64]** %4
%59 = bitcast [3 x i64]* %58 to i64**
%60 = call i32 @matmul(i64** %55, i64** %57, i64** %59)
br label %61
61: ; preds = %41, %35
ret void
}

LLVM IR (-O2):
define void @second_column([3 x i64]* %0, [3 x i64]* %1) {
%3 = alloca [3 x [3 x i64]]
%4 = bitcast [3 x [3 x i64]]* %3 to i8*
%5 = getelementptr inbounds [3 x i64], [3 x i64]* %0, i64 1, i64 1
%6 = load i64, i64* %5
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %19
8: ; preds = %2
%9 = getelementptr inbounds [3 x i64], [3 x i64]* %0, i64 2, i64 1
%10 = load i64, i64* %9
%11 = icmp eq i64 %10, 0
br i1 %11, label %19, label %12
12: ; preds = %8
%13 = bitcast [3 x [3 x i64]]* %3 to i64**
%14 = call i32 @swap_rows(i64** %13, i32 1, i32 2)
%15 = bitcast [3 x i64]* %0 to i64**
%16 = call i32 @matmul(i64** %15, i64** %13, i64** %15)
%17 = bitcast [3 x i64]* %1 to i64**
%18 = call i32 @matmul(i64** %17, i64** %13, i64** %17)
br label %19
19: ; preds = %12, %8, %2
%20 = getelementptr inbounds [3 x i64], [3 x i64]* %0, i64 2, i64 1
%21 = load i64, i64* %20
%22 = icmp eq i64 %21, 0
br i1 %22, label %30, label %23
23: ; preds = %19
%24 = bitcast [3 x [3 x i64]]* %3 to i64**
%25 = bitcast [3 x i64]* %0 to i64**
%26 = call i32 @zero_second_column(i64** %24, i64** %25)
%27 = call i32 @matmul(i64** %25, i64** %24, i64** %25)
%28 = bitcast [3 x i64]* %1 to i64**
%29 = call i32 @matmul(i64** %28, i64** %24, i64** %28)
br label %30
30: ; preds = %23, %19
ret void
}