#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*/ extended_gcd(long *, long, long);
int /*<<< orphan*/ set_zero(long **, int /*<<< orphan*/, int const, long, long,
                            long, long, long);
void zero_first_column(long L[3][3], const int j, long A[3][3]) {
  long vals[3];
  extended_gcd(vals, A[0][0], A[j][0]);
  set_zero(L, 0, j, A[0][0], A[j][0], vals[0], vals[1], vals[2]);
}


x86 assembly (clang, -O0):
<zero_first_column>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
lea    -0x30(%rbp),%rdi
mov    -0x18(%rbp),%rax
mov    (%rax),%rsi
mov    -0x18(%rbp),%rax
movslq -0xc(%rbp),%rcx
imul   $0x18,%rcx,%rcx
add    %rcx,%rax
mov    (%rax),%rdx
call   1040 <extended_gcd@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%edx
mov    -0x18(%rbp),%rax
mov    (%rax),%rcx
mov    -0x18(%rbp),%rax
movslq -0xc(%rbp),%rsi
imul   $0x18,%rsi,%rsi
add    %rsi,%rax
mov    (%rax),%r8
mov    -0x30(%rbp),%r9
mov    -0x28(%rbp),%r10
mov    -0x20(%rbp),%rax
xor    %esi,%esi
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
call   1030 <set_zero@plt>
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zero_first_column>:
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %rdx,%rbx
mov    %rdi,%r14
mov    (%rdx),%rax
movslq %esi,%r15
lea    (%r15,%r15,2),%r12
mov    (%rdx,%r12,8),%rdx
lea    0x10(%rsp),%rdi
mov    %rax,%rsi
call   1040 <extended_gcd@plt>
mov    (%rbx),%rcx
mov    (%rbx,%r12,8),%r8
mov    0x10(%rsp),%r9
movups 0x18(%rsp),%xmm0
movups %xmm0,(%rsp)
mov    %r14,%rdi
xor    %esi,%esi
mov    %r15d,%edx
call   1030 <set_zero@plt>
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
define void @zero_first_column([3 x i64]* %0, i32 %1, [3 x i64]* %2) {
%4 = alloca [3 x i64]*
%5 = alloca i32
%6 = alloca [3 x i64]*
%7 = alloca [3 x i64]
store [3 x i64]* %0, [3 x i64]** %4
store i32 %1, i32* %5
store [3 x i64]* %2, [3 x i64]** %6
%8 = getelementptr inbounds [3 x i64], [3 x i64]* %7, i64 0, i64 0
%9 = load [3 x i64]*, [3 x i64]** %6
%10 = getelementptr inbounds [3 x i64], [3 x i64]* %9, i64 0
%11 = getelementptr inbounds [3 x i64], [3 x i64]* %10, i64 0, i64 0
%12 = load i64, i64* %11
%13 = load [3 x i64]*, [3 x i64]** %6
%14 = load i32, i32* %5
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds [3 x i64], [3 x i64]* %13, i64 %15
%17 = getelementptr inbounds [3 x i64], [3 x i64]* %16, i64 0, i64 0
%18 = load i64, i64* %17
%19 = call i32 @extended_gcd(i64* %8, i64 %12, i64 %18)
%20 = load [3 x i64]*, [3 x i64]** %4
%21 = bitcast [3 x i64]* %20 to i64**
%22 = load i32, i32* %5
%23 = load [3 x i64]*, [3 x i64]** %6
%24 = getelementptr inbounds [3 x i64], [3 x i64]* %23, i64 0
%25 = getelementptr inbounds [3 x i64], [3 x i64]* %24, i64 0, i64 0
%26 = load i64, i64* %25
%27 = load [3 x i64]*, [3 x i64]** %6
%28 = load i32, i32* %5
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds [3 x i64], [3 x i64]* %27, i64 %29
%31 = getelementptr inbounds [3 x i64], [3 x i64]* %30, i64 0, i64 0
%32 = load i64, i64* %31
%33 = getelementptr inbounds [3 x i64], [3 x i64]* %7, i64 0, i64 0
%34 = load i64, i64* %33
%35 = getelementptr inbounds [3 x i64], [3 x i64]* %7, i64 0, i64 1
%36 = load i64, i64* %35
%37 = getelementptr inbounds [3 x i64], [3 x i64]* %7, i64 0, i64 2
%38 = load i64, i64* %37
%39 = call i32 @set_zero(i64** %21, i32 0, i32 %22, i64 %26, i64 %32, i64 %34, i64 %36, i64 %38)
ret void
}

LLVM IR (-O2):
define void @zero_first_column([3 x i64]* %0, i32 %1, [3 x i64]* nocapture %2) {
%4 = alloca [3 x i64]
%5 = bitcast [3 x i64]* %4 to i8*
%6 = getelementptr inbounds [3 x i64], [3 x i64]* %4, i64 0, i64 0
%7 = getelementptr inbounds [3 x i64], [3 x i64]* %2, i64 0, i64 0
%8 = load i64, i64* %7
%9 = sext i32 %1 to i64
%10 = getelementptr inbounds [3 x i64], [3 x i64]* %2, i64 %9, i64 0
%11 = load i64, i64* %10
%12 = call i32 @extended_gcd(i64* %6, i64 %8, i64 %11)
%13 = bitcast [3 x i64]* %0 to i64**
%14 = load i64, i64* %7
%15 = load i64, i64* %10
%16 = load i64, i64* %6
%17 = getelementptr inbounds [3 x i64], [3 x i64]* %4, i64 0, i64 1
%18 = load i64, i64* %17
%19 = getelementptr inbounds [3 x i64], [3 x i64]* %4, i64 0, i64 2
%20 = load i64, i64* %19
%21 = call i32 @set_zero(i64** %13, i32 0, i32 %1, i64 %14, i64 %15, i64 %16, i64 %18, i64 %20)
ret void
}