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


x86 assembly (clang, -O0):
<zero_4x5_col1>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    0x20(%rax),%ax
mov    %ax,-0x16(%rbp)
mov    -0x8(%rbp),%rax
movzwl 0x16(%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 0x1e(%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rax
mov    0x14(%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,0x1e(%rax)
mov    -0x8(%rbp),%rax
movzwl 0x26(%rax),%eax
mov    %eax,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    0x1c(%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,0x26(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<zero_4x5_col1>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%rbx
movzwl 0x20(%rdi),%ebp
movzwl 0x16(%rdi),%edi
call   1040 <gf4096_inv@plt>
movzwl %ax,%esi
mov    %ebp,%edi
call   1030 <gf4096_mul@plt>
movzwl 0x1e(%rbx),%r14d
movzwl 0x14(%rbx),%edi
movzwl %ax,%ebp
mov    %ebp,%esi
call   1030 <gf4096_mul@plt>
xor    %r14w,%ax
mov    %ax,0x1e(%rbx)
movzwl 0x26(%rbx),%r14d
movzwl 0x1c(%rbx),%edi
mov    %ebp,%esi
call   1030 <gf4096_mul@plt>
xor    %r14w,%ax
mov    %ax,0x26(%rbx)
pop    %rbx
pop    %r14
pop    %rbp
ret

LLVM IR (-O0):
define void @zero_4x5_col1([5 x i16]* %0) {
%2 = alloca [5 x i16]*
%3 = alloca i16
store [5 x i16]* %0, [5 x i16]** %2
%4 = load [5 x i16]*, [5 x i16]** %2
%5 = getelementptr inbounds [5 x i16], [5 x i16]* %4, i64 3
%6 = getelementptr inbounds [5 x i16], [5 x i16]* %5, i64 0, i64 1
%7 = load i16, i16* %6
%8 = load [5 x i16]*, [5 x i16]** %2
%9 = getelementptr inbounds [5 x i16], [5 x i16]* %8, i64 2
%10 = getelementptr inbounds [5 x i16], [5 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 [5 x i16]*, [5 x i16]** %2
%15 = getelementptr inbounds [5 x i16], [5 x i16]* %14, i64 3
%16 = getelementptr inbounds [5 x i16], [5 x i16]* %15, i64 0, i64 0
%17 = load i16, i16* %16
%18 = zext i16 %17 to i32
%19 = load [5 x i16]*, [5 x i16]** %2
%20 = getelementptr inbounds [5 x i16], [5 x i16]* %19, i64 2
%21 = getelementptr inbounds [5 x i16], [5 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 [5 x i16]*, [5 x i16]** %2
%29 = getelementptr inbounds [5 x i16], [5 x i16]* %28, i64 3
%30 = getelementptr inbounds [5 x i16], [5 x i16]* %29, i64 0, i64 0
store i16 %27, i16* %30
%31 = load [5 x i16]*, [5 x i16]** %2
%32 = getelementptr inbounds [5 x i16], [5 x i16]* %31, i64 3
%33 = getelementptr inbounds [5 x i16], [5 x i16]* %32, i64 0, i64 4
%34 = load i16, i16* %33
%35 = zext i16 %34 to i32
%36 = load [5 x i16]*, [5 x i16]** %2
%37 = getelementptr inbounds [5 x i16], [5 x i16]* %36, i64 2
%38 = getelementptr inbounds [5 x i16], [5 x i16]* %37, i64 0, i64 4
%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 [5 x i16]*, [5 x i16]** %2
%46 = getelementptr inbounds [5 x i16], [5 x i16]* %45, i64 3
%47 = getelementptr inbounds [5 x i16], [5 x i16]* %46, i64 0, i64 4
store i16 %44, i16* %47
ret void
}

LLVM IR (-O2):
define void @zero_4x5_col1([5 x i16]* nocapture %0) {
%2 = getelementptr inbounds [5 x i16], [5 x i16]* %0, i64 3, i64 1
%3 = load i16, i16* %2
%4 = getelementptr inbounds [5 x i16], [5 x i16]* %0, i64 2, 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 [5 x i16], [5 x i16]* %0, i64 3, i64 0
%9 = load i16, i16* %8
%10 = getelementptr inbounds [5 x i16], [5 x i16]* %0, i64 2, 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 [5 x i16], [5 x i16]* %0, i64 3, i64 4
%15 = load i16, i16* %14
%16 = getelementptr inbounds [5 x i16], [5 x i16]* %0, i64 2, i64 4
%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
}