#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 */
unsigned short gf4096_inv(unsigned short);
unsigned short gf4096_mul(unsigned short, unsigned short);
void zero_3x4_col1(unsigned short m[3][4]) {
  unsigned short minv;
  minv = gf4096_mul(m[2][1], gf4096_inv(m[1][1]));
  m[2][0] = m[2][0] ^ gf4096_mul(m[1][0], minv);
  m[2][3] = m[2][3] ^ gf4096_mul(m[1][3], minv);
}


x86 assembly (clang, -O0):
<zero_3x4_col1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x12(%rax),%ax
mov    %ax,-0x16(%rbp)
mov    -0x8(%rbp),%rax
movzwl 0xa(%rax),%edi
call   1040 <gf4096_inv@plt>
mov    -0x16(%rbp),%cx
movzwl %cx,%edi
movzwl %ax,%esi
call   1030 <gf4096_mul@plt>
mov    %ax,-0xa(%rbp)
mov    -0x8(%rbp),%rax
movzwl 0x10(%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    0x8(%rax),%ax
movzwl %ax,%edi
movzwl -0xa(%rbp),%esi
call   1030 <gf4096_mul@plt>
mov    %ax,%cx
mov    -0x14(%rbp),%eax
movzwl %cx,%ecx
xor    %ecx,%eax
mov    %ax,%cx
mov    -0x8(%rbp),%rax
mov    %cx,0x10(%rax)
mov    -0x8(%rbp),%rax
movzwl 0x16(%rax),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    0xe(%rax),%ax
movzwl %ax,%edi
movzwl -0xa(%rbp),%esi
call   1030 <gf4096_mul@plt>
mov    %ax,%cx
mov    -0x10(%rbp),%eax
movzwl %cx,%ecx
xor    %ecx,%eax
mov    %ax,%cx
mov    -0x8(%rbp),%rax
mov    %cx,0x16(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zero_3x4_col1>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%rbx
movzwl 0x12(%rdi),%ebp
movzwl 0xa(%rdi),%edi
call   1040 <gf4096_inv@plt>
movzwl %ax,%esi
mov    %ebp,%edi
call   1030 <gf4096_mul@plt>
movzwl 0x10(%rbx),%r14d
movzwl 0x8(%rbx),%edi
movzwl %ax,%ebp
mov    %ebp,%esi
call   1030 <gf4096_mul@plt>
xor    %r14w,%ax
mov    %ax,0x10(%rbx)
movzwl 0x16(%rbx),%r14d
movzwl 0xe(%rbx),%edi
mov    %ebp,%esi
call   1030 <gf4096_mul@plt>
xor    %r14w,%ax
mov    %ax,0x16(%rbx)
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @zero_3x4_col1([4 x i16]* %0) {
%2 = alloca [4 x i16]*
%3 = alloca i16
store [4 x i16]* %0, [4 x i16]** %2
%4 = load [4 x i16]*, [4 x i16]** %2
%5 = getelementptr inbounds [4 x i16], [4 x i16]* %4, i64 2
%6 = getelementptr inbounds [4 x i16], [4 x i16]* %5, i64 0, i64 1
%7 = load i16, i16* %6
%8 = load [4 x i16]*, [4 x i16]** %2
%9 = getelementptr inbounds [4 x i16], [4 x i16]* %8, i64 1
%10 = getelementptr inbounds [4 x i16], [4 x i16]* %9, i64 0, i64 1
%11 = load i16, i16* %10
%12 = call zeroext i16 @gf4096_inv(i16 zeroext %11)
%13 = call zeroext i16 @gf4096_mul(i16 zeroext %7, i16 zeroext %12)
store i16 %13, i16* %3
%14 = load [4 x i16]*, [4 x i16]** %2
%15 = getelementptr inbounds [4 x i16], [4 x i16]* %14, i64 2
%16 = getelementptr inbounds [4 x i16], [4 x i16]* %15, i64 0, i64 0
%17 = load i16, i16* %16
%18 = zext i16 %17 to i32
%19 = load [4 x i16]*, [4 x i16]** %2
%20 = getelementptr inbounds [4 x i16], [4 x i16]* %19, i64 1
%21 = getelementptr inbounds [4 x i16], [4 x i16]* %20, i64 0, i64 0
%22 = load i16, i16* %21
%23 = load i16, i16* %3
%24 = call zeroext i16 @gf4096_mul(i16 zeroext %22, i16 zeroext %23)
%25 = zext i16 %24 to i32
%26 = xor i32 %18, %25
%27 = trunc i32 %26 to i16
%28 = load [4 x i16]*, [4 x i16]** %2
%29 = getelementptr inbounds [4 x i16], [4 x i16]* %28, i64 2
%30 = getelementptr inbounds [4 x i16], [4 x i16]* %29, i64 0, i64 0
store i16 %27, i16* %30
%31 = load [4 x i16]*, [4 x i16]** %2
%32 = getelementptr inbounds [4 x i16], [4 x i16]* %31, i64 2
%33 = getelementptr inbounds [4 x i16], [4 x i16]* %32, i64 0, i64 3
%34 = load i16, i16* %33
%35 = zext i16 %34 to i32
%36 = load [4 x i16]*, [4 x i16]** %2
%37 = getelementptr inbounds [4 x i16], [4 x i16]* %36, i64 1
%38 = getelementptr inbounds [4 x i16], [4 x i16]* %37, i64 0, i64 3
%39 = load i16, i16* %38
%40 = load i16, i16* %3
%41 = call zeroext i16 @gf4096_mul(i16 zeroext %39, i16 zeroext %40)
%42 = zext i16 %41 to i32
%43 = xor i32 %35, %42
%44 = trunc i32 %43 to i16
%45 = load [4 x i16]*, [4 x i16]** %2
%46 = getelementptr inbounds [4 x i16], [4 x i16]* %45, i64 2
%47 = getelementptr inbounds [4 x i16], [4 x i16]* %46, i64 0, i64 3
store i16 %44, i16* %47
ret void
}

LLVM IR (-O2):
define void @zero_3x4_col1([4 x i16]* nocapture %0) {
%2 = getelementptr inbounds [4 x i16], [4 x i16]* %0, i64 2, i64 1
%3 = load i16, i16* %2
%4 = getelementptr inbounds [4 x i16], [4 x i16]* %0, i64 1, i64 1
%5 = load i16, i16* %4
%6 = tail call zeroext i16 @gf4096_inv(i16 zeroext %5)
%7 = tail call zeroext i16 @gf4096_mul(i16 zeroext %3, i16 zeroext %6)
%8 = getelementptr inbounds [4 x i16], [4 x i16]* %0, i64 2, i64 0
%9 = load i16, i16* %8
%10 = getelementptr inbounds [4 x i16], [4 x i16]* %0, i64 1, i64 0
%11 = load i16, i16* %10
%12 = tail call zeroext i16 @gf4096_mul(i16 zeroext %11, i16 zeroext %7)
%13 = xor i16 %12, %9
store i16 %13, i16* %8
%14 = getelementptr inbounds [4 x i16], [4 x i16]* %0, i64 2, i64 3
%15 = load i16, i16* %14
%16 = getelementptr inbounds [4 x i16], [4 x i16]* %0, i64 1, i64 3
%17 = load i16, i16* %16
%18 = tail call zeroext i16 @gf4096_mul(i16 zeroext %17, i16 zeroext %7)
%19 = xor i16 %18, %15
store i16 %19, i16* %14
ret void
}