#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*/ find_2x2_soln(int, int, unsigned short, unsigned short,
                                 unsigned short, unsigned short,
                                 unsigned short *);
unsigned short gf4096_mul(unsigned short, unsigned short);
void find_4bit_err_pats(unsigned short s0, unsigned short s1, unsigned short s2,
                        unsigned short s3, unsigned short z1, unsigned short z2,
                        unsigned short z3, unsigned short z4,
                        unsigned short *pats) {
  unsigned short z4_z1, z3z4_z3z3, z4_z2, s0z4_s1, z1z4_z1z1, z4_z3, z2z4_z2z2,
      s1z4_s2, z3z3z4_z3z3z3, z1z1z4_z1z1z1, z2z2z4_z2z2z2, s2z4_s3;
  unsigned short tmp0, tmp1, tmp2, tmp3;
  z4_z1 = z4 ^ z1;
  z3z4_z3z3 = gf4096_mul(z3, z4) ^ gf4096_mul(z3, z3);
  z4_z2 = z4 ^ z2;
  s0z4_s1 = gf4096_mul(s0, z4) ^ s1;
  z1z4_z1z1 = gf4096_mul(z1, z4) ^ gf4096_mul(z1, z1);
  z4_z3 = z4 ^ z3;
  z2z4_z2z2 = gf4096_mul(z2, z4) ^ gf4096_mul(z2, z2);
  s1z4_s2 = gf4096_mul(s1, z4) ^ s2;
  z3z3z4_z3z3z3 =
      gf4096_mul(gf4096_mul(z3, z3), z4) ^ gf4096_mul(gf4096_mul(z3, z3), z3);
  z1z1z4_z1z1z1 =
      gf4096_mul(gf4096_mul(z1, z1), z4) ^ gf4096_mul(gf4096_mul(z1, z1), z1);
  z2z2z4_z2z2z2 =
      gf4096_mul(gf4096_mul(z2, z2), z4) ^ gf4096_mul(gf4096_mul(z2, z2), z2);
  s2z4_s3 = gf4096_mul(s2, z4) ^ s3;
  find_2x2_soln(gf4096_mul(z4_z1, z3z4_z3z3) ^ gf4096_mul(z1z4_z1z1, z4_z3),
                gf4096_mul(z4_z2, z3z4_z3z3) ^ gf4096_mul(z2z4_z2z2, z4_z3),
                gf4096_mul(z1z4_z1z1, z3z3z4_z3z3z3) ^
                    gf4096_mul(z1z1z4_z1z1z1, z3z4_z3z3),
                gf4096_mul(z2z4_z2z2, z3z3z4_z3z3z3) ^
                    gf4096_mul(z2z2z4_z2z2z2, z3z4_z3z3),
                gf4096_mul(s0z4_s1, z3z4_z3z3) ^ gf4096_mul(s1z4_s2, z4_z3),
                gf4096_mul(s1z4_s2, z3z3z4_z3z3z3) ^
                    gf4096_mul(s2z4_s3, z3z4_z3z3),
                pats);
  tmp0 = pats[0];
  tmp1 = pats[1];
  tmp2 = pats[0] ^ pats[1] ^ s0;
  tmp3 = gf4096_mul(pats[0], z1) ^ gf4096_mul(pats[1], z2) ^ s1;
  find_2x2_soln(0x1, 0x1, z3, z4, tmp2, tmp3, pats);
  pats[2] = pats[0];
  pats[3] = pats[1];
  pats[0] = tmp0;
  pats[1] = tmp1;
}


x86 assembly (clang, -O0):
<find_4bit_err_pats>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
mov    %r8d,-0x80(%rbp)
mov    %ecx,%eax
mov    -0x80(%rbp),%ecx
mov    %eax,-0x7c(%rbp)
mov    %edx,%eax
mov    -0x7c(%rbp),%edx
mov    %eax,-0x78(%rbp)
mov    %esi,%eax
mov    -0x78(%rbp),%esi
mov    %eax,-0x74(%rbp)
mov    %edi,%r8d
mov    -0x74(%rbp),%edi
mov    %r9w,%ax
mov    0x20(%rbp),%r9
mov    0x18(%rbp),%r9w
mov    0x10(%rbp),%r9w
mov    %r8w,-0x2(%rbp)
mov    %di,-0x4(%rbp)
mov    %si,-0x6(%rbp)
mov    %dx,-0x8(%rbp)
mov    %cx,-0xa(%rbp)
mov    %ax,-0xc(%rbp)
movzwl 0x18(%rbp),%eax
movzwl -0xa(%rbp),%ecx
xor    %ecx,%eax
mov    %ax,-0xe(%rbp)
mov    0x10(%rbp),%ax
movzwl %ax,%edi
movzwl 0x18(%rbp),%esi
call   1030 <gf4096_mul@plt>
movzwl %ax,%eax
mov    %eax,-0x70(%rbp)
mov    0x10(%rbp),%ax
movzwl %ax,%edi
movzwl 0x10(%rbp),%esi
call   1030 <gf4096_mul@plt>
mov    %ax,%cx
mov    -0x70(%rbp),%eax
movzwl %cx,%ecx
xor    %ecx,%eax
mov    %ax,-0x10(%rbp)
movzwl 0x18(%rbp),%eax
movzwl -0xc(%rbp),%ecx
xor    %ecx,%eax
mov    %ax,-0x12(%rbp)
mov    -0x2(%rbp),%ax
movzwl %ax,%edi
movzwl 0x18(%rbp),%esi
call   1030 <gf4096_mul@plt>
movzwl %ax,%eax
movzwl -0x4(%rbp),%ecx
xor    %ecx,%eax
mov    %ax,-0x14(%rbp)
mov    -0xa(%rbp),%ax
movzwl %ax,%edi
movzwl 0x18(%rbp),%esi
call   1030 <gf4096_mul@plt>
movzwl %ax,%eax
mov    %eax,-0x6c(%rbp)
mov    -0xa(%rbp),%ax
movzwl %ax,%edi
movzwl -0xa(%rbp),%esi
call   1030 <gf4096_mul@plt>
mov    %ax,%cx
mov    -0x6c(%rbp),%eax
movzwl %cx,%ecx
xor    %ecx,%eax
mov    %ax,-0x16(%rbp)
movzwl 0x18(%rbp),%eax
movzwl 0x10(%rbp),%ecx
xor    %ecx,%eax
mov    %ax,-0x18(%rbp)
mov    -0xc(%rbp),%ax
movzwl %ax,%edi
movzwl 0x18(%rbp),%esi
call   1030 <gf4096_mul@plt>
movzwl %ax,%eax
mov    %eax,-0x68(%rbp)
mov    -0xc(%rbp),%ax
movzwl %ax,%edi
movzwl -0xc(%rbp),%esi
call   1030 <gf4096_mul@plt>
mov    %ax,%cx
mov    -0x68(%rbp),%eax
movzwl %cx,%ecx
xor    %ecx,%eax
mov    %ax,-0x1a(%rbp)
mov    -0x4(%rbp),%ax
movzwl %ax,%edi
movzwl 0x18(%rbp),%esi
call   1030 <gf4096_mul@plt>
movzwl %ax,%eax
movzwl -0x6(%rbp),%ecx
xor    %ecx,%eax
mov    %ax,-0x1c(%rbp)
mov    0x10(%rbp),%ax
movzwl %ax,%edi
movzwl 0x10(%rbp),%esi
call   1030 <gf4096_mul@plt>
movzwl %ax,%edi
movzwl 0x18(%rbp),%esi
call   1030 <gf4096_mul@plt>
movzwl %ax,%eax
mov    %eax,-0x64(%rbp)
mov    0x10(%rbp),%ax
movzwl %ax,%edi
movzwl 0x10(%rbp),%esi
call   1030 <gf4096_mul@plt>
movzwl %ax,%edi
movzwl 0x10(%rbp),%esi
call   1030 <gf4096_mul@plt>
mov    %ax,%cx
mov    -0x64(%rbp),%eax
movzwl %cx,%ecx
xor    %ecx,%eax
mov    %ax,-0x1e(%rbp)
mov    -0xa(%rbp),%ax
movzwl %ax,%edi
movzwl -0xa(%rbp),%esi
call   1030 <gf4096_mul@plt>
movzwl %ax,%edi
movzwl 0x18(%rbp),%esi
call   1030 <gf4096_mul@plt>
movzwl %ax,%eax
mov    %eax,-0x60(%rbp)
mov    -0xa(%rbp),%ax
movzwl %ax,%edi
movzwl -0xa(%rbp),%esi
call   1030 <gf4096_mul@plt>
movzwl %ax,%edi
movzwl -0xa(%rbp),%esi
call   1030 <gf4096_mul@plt>
mov    %ax,%cx
mov    -0x60(%rbp),%eax
movzwl %cx,%ecx
xor    %ecx,%eax
mov    %ax,-0x20(%rbp)
mov    -0xc(%rbp),%ax
movzwl %ax,%edi
movzwl -0xc(%rbp),%esi
call   1030 <gf4096_mul@plt>
movzwl %ax,%edi
movzwl 0x18(%rbp),%esi
call   1030 <gf4096_mul@plt>
movzwl %ax,%eax
mov    %eax,-0x5c(%rbp)
mov    -0xc(%rbp),%ax
movzwl %ax,%edi
movzwl -0xc(%rbp),%esi
call   1030 <gf4096_mul@plt>
movzwl %ax,%edi
movzwl -0xc(%rbp),%esi
call   1030 <gf4096_mul@plt>
mov    %ax,%cx
mov    -0x5c(%rbp),%eax
movzwl %cx,%ecx
xor    %ecx,%eax
mov    %ax,-0x22(%rbp)
mov    -0x6(%rbp),%ax
movzwl %ax,%edi
movzwl 0x18(%rbp),%esi
call   1030 <gf4096_mul@plt>
movzwl %ax,%eax
movzwl -0x8(%rbp),%ecx
xor    %ecx,%eax
mov    %ax,-0x24(%rbp)
mov    -0xe(%rbp),%ax
movzwl %ax,%edi
movzwl -0x10(%rbp),%esi
call   1030 <gf4096_mul@plt>
movzwl %ax,%eax
mov    %eax,-0x58(%rbp)
mov    -0x16(%rbp),%ax
movzwl %ax,%edi
movzwl -0x18(%rbp),%esi
call   1030 <gf4096_mul@plt>
mov    %ax,%cx
mov    -0x58(%rbp),%eax
movzwl %cx,%ecx
xor    %ecx,%eax
mov    %eax,-0x44(%rbp)
mov    -0x12(%rbp),%ax
movzwl %ax,%edi
movzwl -0x10(%rbp),%esi
call   1030 <gf4096_mul@plt>
movzwl %ax,%eax
mov    %eax,-0x54(%rbp)
mov    -0x1a(%rbp),%ax
movzwl %ax,%edi
movzwl -0x18(%rbp),%esi
call   1030 <gf4096_mul@plt>
mov    %ax,%cx
mov    -0x54(%rbp),%eax
movzwl %cx,%ecx
xor    %ecx,%eax
mov    %eax,-0x40(%rbp)
mov    -0x16(%rbp),%ax
movzwl %ax,%edi
movzwl -0x1e(%rbp),%esi
call   1030 <gf4096_mul@plt>
movzwl %ax,%eax
mov    %eax,-0x50(%rbp)
mov    -0x20(%rbp),%ax
movzwl %ax,%edi
movzwl -0x10(%rbp),%esi
call   1030 <gf4096_mul@plt>
mov    %ax,%cx
mov    -0x50(%rbp),%eax
movzwl %cx,%ecx
xor    %ecx,%eax
mov    %ax,-0x3a(%rbp)
mov    -0x1a(%rbp),%ax
movzwl %ax,%edi
movzwl -0x1e(%rbp),%esi
call   1030 <gf4096_mul@plt>
movzwl %ax,%eax
mov    %eax,-0x4c(%rbp)
mov    -0x22(%rbp),%ax
movzwl %ax,%edi
movzwl -0x10(%rbp),%esi
call   1030 <gf4096_mul@plt>
mov    %ax,%cx
mov    -0x4c(%rbp),%eax
movzwl %cx,%ecx
xor    %ecx,%eax
mov    %ax,-0x38(%rbp)
mov    -0x14(%rbp),%ax
movzwl %ax,%edi
movzwl -0x10(%rbp),%esi
call   1030 <gf4096_mul@plt>
movzwl %ax,%eax
mov    %eax,-0x48(%rbp)
mov    -0x1c(%rbp),%ax
movzwl %ax,%edi
movzwl -0x18(%rbp),%esi
call   1030 <gf4096_mul@plt>
mov    %ax,%cx
mov    -0x48(%rbp),%eax
movzwl %cx,%ecx
xor    %ecx,%eax
mov    %ax,-0x36(%rbp)
mov    -0x1c(%rbp),%ax
movzwl %ax,%edi
movzwl -0x1e(%rbp),%esi
call   1030 <gf4096_mul@plt>
movzwl %ax,%eax
mov    %eax,-0x34(%rbp)
mov    -0x24(%rbp),%ax
movzwl %ax,%edi
movzwl -0x10(%rbp),%esi
call   1030 <gf4096_mul@plt>
mov    -0x44(%rbp),%edi
mov    -0x40(%rbp),%esi
mov    -0x3a(%rbp),%dx
mov    -0x38(%rbp),%cx
mov    -0x36(%rbp),%r8w
mov    %ax,%r9w
mov    -0x34(%rbp),%eax
movzwl %r9w,%r9d
xor    %r9d,%eax
mov    %ax,%r9w
mov    0x20(%rbp),%rax
movzwl %dx,%edx
movzwl %cx,%ecx
movzwl %r8w,%r8d
movzwl %r9w,%r9d
mov    %rax,(%rsp)
call   1040 <find_2x2_soln@plt>
mov    0x20(%rbp),%rax
mov    (%rax),%ax
mov    %ax,-0x26(%rbp)
mov    0x20(%rbp),%rax
mov    0x2(%rax),%ax
mov    %ax,-0x28(%rbp)
mov    0x20(%rbp),%rax
movzwl (%rax),%eax
mov    0x20(%rbp),%rcx
movzwl 0x2(%rcx),%ecx
xor    %ecx,%eax
movzwl -0x2(%rbp),%ecx
xor    %ecx,%eax
mov    %ax,-0x2a(%rbp)
mov    0x20(%rbp),%rax
mov    (%rax),%ax
movzwl %ax,%edi
movzwl -0xa(%rbp),%esi
call   1030 <gf4096_mul@plt>
movzwl %ax,%eax
mov    %eax,-0x30(%rbp)
mov    0x20(%rbp),%rax
mov    0x2(%rax),%ax
movzwl %ax,%edi
movzwl -0xc(%rbp),%esi
call   1030 <gf4096_mul@plt>
mov    %ax,%cx
mov    -0x30(%rbp),%eax
movzwl %cx,%ecx
xor    %ecx,%eax
movzwl -0x4(%rbp),%ecx
xor    %ecx,%eax
mov    %ax,-0x2c(%rbp)
mov    0x10(%rbp),%dx
mov    0x18(%rbp),%cx
mov    -0x2a(%rbp),%r8w
mov    -0x2c(%rbp),%r9w
mov    0x20(%rbp),%rax
mov    $0x1,%esi
mov    %esi,%edi
movzwl %dx,%edx
movzwl %cx,%ecx
movzwl %r8w,%r8d
movzwl %r9w,%r9d
mov    %rax,(%rsp)
call   1040 <find_2x2_soln@plt>
mov    0x20(%rbp),%rax
mov    (%rax),%cx
mov    0x20(%rbp),%rax
mov    %cx,0x4(%rax)
mov    0x20(%rbp),%rax
mov    0x2(%rax),%cx
mov    0x20(%rbp),%rax
mov    %cx,0x6(%rax)
mov    -0x26(%rbp),%cx
mov    0x20(%rbp),%rax
mov    %cx,(%rax)
mov    -0x28(%rbp),%cx
mov    0x20(%rbp),%rax
mov    %cx,0x2(%rax)
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<find_4bit_err_pats>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x58,%rsp
mov    %r9d,%ebp
mov    %r8d,%r13d
mov    %ecx,0x18(%rsp)
mov    %edx,0x28(%rsp)
mov    %esi,0x24(%rsp)
mov    %edi,%r12d
mov    %edi,0x54(%rsp)
movzwl 0x90(%rsp),%r15d
movzwl 0x98(%rsp),%ebx
mov    %ebx,%eax
xor    %r8d,%eax
mov    %eax,0x10(%rsp)
mov    %r15d,%edi
mov    %ebx,%esi
call   1030 <gf4096_mul@plt>
mov    %eax,%r14d
mov    %r15d,%edi
mov    %r15d,%esi
call   1030 <gf4096_mul@plt>
xor    %r14d,%eax
mov    %eax,0xc(%rsp)
mov    %ebx,%eax
xor    %ebp,%eax
mov    %eax,0x14(%rsp)
mov    %r12d,%edi
mov    %ebx,%esi
call   1030 <gf4096_mul@plt>
mov    0x24(%rsp),%r12d
xor    %r12d,%eax
mov    %eax,0x4c(%rsp)
mov    %r13d,%edi
mov    %ebx,%esi
call   1030 <gf4096_mul@plt>
mov    %eax,%r14d
mov    %r13d,0x20(%rsp)
mov    %r13d,%edi
mov    %r13d,%esi
call   1030 <gf4096_mul@plt>
xor    %r14d,%eax
mov    %eax,0x3c(%rsp)
mov    %ebx,%eax
xor    %r15d,%eax
mov    %eax,0x40(%rsp)
mov    %ebp,%edi
mov    %ebx,%esi
call   1030 <gf4096_mul@plt>
mov    %eax,%r14d
mov    %ebp,0x1c(%rsp)
mov    %ebp,%edi
mov    %ebp,%esi
call   1030 <gf4096_mul@plt>
xor    %r14d,%eax
mov    %eax,0x38(%rsp)
mov    %r12d,%edi
mov    %ebx,%esi
call   1030 <gf4096_mul@plt>
mov    0x28(%rsp),%r13d
xor    %r13d,%eax
mov    %eax,0x48(%rsp)
mov    %r15d,%edi
mov    %r15d,%esi
call   1030 <gf4096_mul@plt>
movzwl %ax,%edi
mov    %ebx,%esi
mov    %ebx,%r14d
call   1030 <gf4096_mul@plt>
mov    %eax,%ebx
mov    %r15d,%edi
mov    %r15d,%esi
mov    %r15d,0x50(%rsp)
call   1030 <gf4096_mul@plt>
movzwl %ax,%edi
mov    %r15d,%esi
call   1030 <gf4096_mul@plt>
xor    %ebx,%eax
mov    %eax,0x34(%rsp)
mov    0x20(%rsp),%ebp
mov    %ebp,%edi
mov    %ebp,%esi
call   1030 <gf4096_mul@plt>
movzwl %ax,%edi
mov    %r14d,%ebx
mov    %r14d,%esi
call   1030 <gf4096_mul@plt>
mov    %eax,%r14d
mov    %ebp,%edi
mov    %ebp,%esi
call   1030 <gf4096_mul@plt>
movzwl %ax,%edi
mov    %ebp,%esi
call   1030 <gf4096_mul@plt>
xor    %r14d,%eax
mov    %eax,0x30(%rsp)
mov    0x1c(%rsp),%ebp
mov    %ebp,%edi
mov    %ebp,%esi
call   1030 <gf4096_mul@plt>
movzwl %ax,%edi
mov    %ebx,%esi
mov    %ebx,0x44(%rsp)
call   1030 <gf4096_mul@plt>
mov    %eax,%r14d
mov    %ebp,%edi
mov    %ebp,%esi
call   1030 <gf4096_mul@plt>
movzwl %ax,%edi
mov    %ebp,%esi
call   1030 <gf4096_mul@plt>
xor    %r14d,%eax
mov    %eax,0x2c(%rsp)
mov    %r13d,%edi
mov    %ebx,%esi
call   1030 <gf4096_mul@plt>
xor    0x18(%rsp),%eax
mov    %eax,0x18(%rsp)
movzwl 0xc(%rsp),%r14d
mov    0x10(%rsp),%edi
mov    %r14d,%esi
call   1030 <gf4096_mul@plt>
mov    %eax,%ebx
movzwl 0x3c(%rsp),%ebp
mov    %ebp,%edi
mov    0x40(%rsp),%r15d
mov    %r15d,%esi
call   1030 <gf4096_mul@plt>
xor    %ebx,%eax
movzwl %ax,%eax
mov    %eax,0x10(%rsp)
mov    0x14(%rsp),%edi
mov    %r14d,%esi
call   1030 <gf4096_mul@plt>
mov    %eax,%ebx
movzwl 0x38(%rsp),%r12d
mov    %r12d,%edi
mov    %r15d,%esi
call   1030 <gf4096_mul@plt>
xor    %ebx,%eax
movzwl %ax,%eax
mov    %eax,0x14(%rsp)
movzwl 0x34(%rsp),%r13d
mov    %ebp,%edi
mov    %r13d,%esi
call   1030 <gf4096_mul@plt>
mov    %eax,%ebp
movzwl 0x30(%rsp),%edi
mov    %r14d,%esi
call   1030 <gf4096_mul@plt>
xor    %ebp,%eax
mov    %eax,0xc(%rsp)
mov    %r12d,%edi
mov    %r13d,%esi
call   1030 <gf4096_mul@plt>
mov    %eax,%ebx
movzwl 0x2c(%rsp),%edi
mov    %r14d,%esi
call   1030 <gf4096_mul@plt>
mov    %eax,%ebp
xor    %ebx,%ebp
movzwl 0x4c(%rsp),%edi
mov    %r14d,%esi
call   1030 <gf4096_mul@plt>
mov    %eax,%r12d
movzwl 0x48(%rsp),%ebx
mov    %ebx,%edi
mov    %r15d,%esi
call   1030 <gf4096_mul@plt>
mov    %eax,%r15d
xor    %r12d,%r15d
mov    %ebx,%edi
mov    %r13d,%esi
call   1030 <gf4096_mul@plt>
mov    %eax,%ebx
movzwl 0x18(%rsp),%edi
mov    %r14d,%esi
call   1030 <gf4096_mul@plt>
xor    %ebx,%eax
mov    0xa0(%rsp),%rbx
mov    %rbx,(%rsp)
movzwl 0xc(%rsp),%edx
movzwl %bp,%ecx
movzwl %r15w,%r8d
movzwl %ax,%r9d
mov    0x10(%rsp),%edi
mov    0x14(%rsp),%esi
call   1040 <find_2x2_soln@plt>
mov    %rbx,%r15
movzwl (%rbx),%ebx
movzwl 0x2(%r15),%r14d
mov    0x54(%rsp),%eax
xor    %ebx,%eax
xor    %r14d,%eax
mov    %eax,%r12d
mov    %ebx,%edi
mov    0x20(%rsp),%esi
call   1030 <gf4096_mul@plt>
mov    %eax,%ebp
movzwl 0x2(%r15),%edi
mov    0x1c(%rsp),%esi
call   1030 <gf4096_mul@plt>
xor    0x24(%rsp),%ebp
xor    %eax,%ebp
mov    %r15,(%rsp)
movzwl %bp,%r9d
movzwl %r12w,%r8d
mov    $0x1,%edi
mov    $0x1,%esi
mov    0x50(%rsp),%edx
mov    0x44(%rsp),%ecx
call   1040 <find_2x2_soln@plt>
mov    (%r15),%eax
mov    %eax,0x4(%r15)
mov    %bx,(%r15)
mov    %r14w,0x2(%r15)
add    $0x58,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @find_4bit_err_pats(i16 zeroext %0, i16 zeroext %1, i16 zeroext %2, i16 zeroext %3, i16 zeroext %4, i16 zeroext %5, i16 zeroext %6, i16 zeroext %7, i16* %8) {
%10 = alloca i16
%11 = alloca i16
%12 = alloca i16
%13 = alloca i16
%14 = alloca i16
%15 = alloca i16
%16 = alloca i16
%17 = alloca i16
%18 = alloca i16*
%19 = alloca i16
%20 = alloca i16
%21 = alloca i16
%22 = alloca i16
%23 = alloca i16
%24 = alloca i16
%25 = alloca i16
%26 = alloca i16
%27 = alloca i16
%28 = alloca i16
%29 = alloca i16
%30 = alloca i16
%31 = alloca i16
%32 = alloca i16
%33 = alloca i16
%34 = alloca i16
store i16 %0, i16* %10
store i16 %1, i16* %11
store i16 %2, i16* %12
store i16 %3, i16* %13
store i16 %4, i16* %14
store i16 %5, i16* %15
store i16 %6, i16* %16
store i16 %7, i16* %17
store i16* %8, i16** %18
%35 = load i16, i16* %17
%36 = zext i16 %35 to i32
%37 = load i16, i16* %14
%38 = zext i16 %37 to i32
%39 = xor i32 %36, %38
%40 = trunc i32 %39 to i16
store i16 %40, i16* %19
%41 = load i16, i16* %16
%42 = load i16, i16* %17
%43 = call zeroext i16 @gf4096_mul(i16 zeroext %41, i16 zeroext %42)
%44 = zext i16 %43 to i32
%45 = load i16, i16* %16
%46 = load i16, i16* %16
%47 = call zeroext i16 @gf4096_mul(i16 zeroext %45, i16 zeroext %46)
%48 = zext i16 %47 to i32
%49 = xor i32 %44, %48
%50 = trunc i32 %49 to i16
store i16 %50, i16* %20
%51 = load i16, i16* %17
%52 = zext i16 %51 to i32
%53 = load i16, i16* %15
%54 = zext i16 %53 to i32
%55 = xor i32 %52, %54
%56 = trunc i32 %55 to i16
store i16 %56, i16* %21
%57 = load i16, i16* %10
%58 = load i16, i16* %17
%59 = call zeroext i16 @gf4096_mul(i16 zeroext %57, i16 zeroext %58)
%60 = zext i16 %59 to i32
%61 = load i16, i16* %11
%62 = zext i16 %61 to i32
%63 = xor i32 %60, %62
%64 = trunc i32 %63 to i16
store i16 %64, i16* %22
%65 = load i16, i16* %14
%66 = load i16, i16* %17
%67 = call zeroext i16 @gf4096_mul(i16 zeroext %65, i16 zeroext %66)
%68 = zext i16 %67 to i32
%69 = load i16, i16* %14
%70 = load i16, i16* %14
%71 = call zeroext i16 @gf4096_mul(i16 zeroext %69, i16 zeroext %70)
%72 = zext i16 %71 to i32
%73 = xor i32 %68, %72
%74 = trunc i32 %73 to i16
store i16 %74, i16* %23
%75 = load i16, i16* %17
%76 = zext i16 %75 to i32
%77 = load i16, i16* %16
%78 = zext i16 %77 to i32
%79 = xor i32 %76, %78
%80 = trunc i32 %79 to i16
store i16 %80, i16* %24
%81 = load i16, i16* %15
%82 = load i16, i16* %17
%83 = call zeroext i16 @gf4096_mul(i16 zeroext %81, i16 zeroext %82)
%84 = zext i16 %83 to i32
%85 = load i16, i16* %15
%86 = load i16, i16* %15
%87 = call zeroext i16 @gf4096_mul(i16 zeroext %85, i16 zeroext %86)
%88 = zext i16 %87 to i32
%89 = xor i32 %84, %88
%90 = trunc i32 %89 to i16
store i16 %90, i16* %25
%91 = load i16, i16* %11
%92 = load i16, i16* %17
%93 = call zeroext i16 @gf4096_mul(i16 zeroext %91, i16 zeroext %92)
%94 = zext i16 %93 to i32
%95 = load i16, i16* %12
%96 = zext i16 %95 to i32
%97 = xor i32 %94, %96
%98 = trunc i32 %97 to i16
store i16 %98, i16* %26
%99 = load i16, i16* %16
%100 = load i16, i16* %16
%101 = call zeroext i16 @gf4096_mul(i16 zeroext %99, i16 zeroext %100)
%102 = load i16, i16* %17
%103 = call zeroext i16 @gf4096_mul(i16 zeroext %101, i16 zeroext %102)
%104 = zext i16 %103 to i32
%105 = load i16, i16* %16
%106 = load i16, i16* %16
%107 = call zeroext i16 @gf4096_mul(i16 zeroext %105, i16 zeroext %106)
%108 = load i16, i16* %16
%109 = call zeroext i16 @gf4096_mul(i16 zeroext %107, i16 zeroext %108)
%110 = zext i16 %109 to i32
%111 = xor i32 %104, %110
%112 = trunc i32 %111 to i16
store i16 %112, i16* %27
%113 = load i16, i16* %14
%114 = load i16, i16* %14
%115 = call zeroext i16 @gf4096_mul(i16 zeroext %113, i16 zeroext %114)
%116 = load i16, i16* %17
%117 = call zeroext i16 @gf4096_mul(i16 zeroext %115, i16 zeroext %116)
%118 = zext i16 %117 to i32
%119 = load i16, i16* %14
%120 = load i16, i16* %14
%121 = call zeroext i16 @gf4096_mul(i16 zeroext %119, i16 zeroext %120)
%122 = load i16, i16* %14
%123 = call zeroext i16 @gf4096_mul(i16 zeroext %121, i16 zeroext %122)
%124 = zext i16 %123 to i32
%125 = xor i32 %118, %124
%126 = trunc i32 %125 to i16
store i16 %126, i16* %28
%127 = load i16, i16* %15
%128 = load i16, i16* %15
%129 = call zeroext i16 @gf4096_mul(i16 zeroext %127, i16 zeroext %128)
%130 = load i16, i16* %17
%131 = call zeroext i16 @gf4096_mul(i16 zeroext %129, i16 zeroext %130)
%132 = zext i16 %131 to i32
%133 = load i16, i16* %15
%134 = load i16, i16* %15
%135 = call zeroext i16 @gf4096_mul(i16 zeroext %133, i16 zeroext %134)
%136 = load i16, i16* %15
%137 = call zeroext i16 @gf4096_mul(i16 zeroext %135, i16 zeroext %136)
%138 = zext i16 %137 to i32
%139 = xor i32 %132, %138
%140 = trunc i32 %139 to i16
store i16 %140, i16* %29
%141 = load i16, i16* %12
%142 = load i16, i16* %17
%143 = call zeroext i16 @gf4096_mul(i16 zeroext %141, i16 zeroext %142)
%144 = zext i16 %143 to i32
%145 = load i16, i16* %13
%146 = zext i16 %145 to i32
%147 = xor i32 %144, %146
%148 = trunc i32 %147 to i16
store i16 %148, i16* %30
%149 = load i16, i16* %19
%150 = load i16, i16* %20
%151 = call zeroext i16 @gf4096_mul(i16 zeroext %149, i16 zeroext %150)
%152 = zext i16 %151 to i32
%153 = load i16, i16* %23
%154 = load i16, i16* %24
%155 = call zeroext i16 @gf4096_mul(i16 zeroext %153, i16 zeroext %154)
%156 = zext i16 %155 to i32
%157 = xor i32 %152, %156
%158 = load i16, i16* %21
%159 = load i16, i16* %20
%160 = call zeroext i16 @gf4096_mul(i16 zeroext %158, i16 zeroext %159)
%161 = zext i16 %160 to i32
%162 = load i16, i16* %25
%163 = load i16, i16* %24
%164 = call zeroext i16 @gf4096_mul(i16 zeroext %162, i16 zeroext %163)
%165 = zext i16 %164 to i32
%166 = xor i32 %161, %165
%167 = load i16, i16* %23
%168 = load i16, i16* %27
%169 = call zeroext i16 @gf4096_mul(i16 zeroext %167, i16 zeroext %168)
%170 = zext i16 %169 to i32
%171 = load i16, i16* %28
%172 = load i16, i16* %20
%173 = call zeroext i16 @gf4096_mul(i16 zeroext %171, i16 zeroext %172)
%174 = zext i16 %173 to i32
%175 = xor i32 %170, %174
%176 = trunc i32 %175 to i16
%177 = load i16, i16* %25
%178 = load i16, i16* %27
%179 = call zeroext i16 @gf4096_mul(i16 zeroext %177, i16 zeroext %178)
%180 = zext i16 %179 to i32
%181 = load i16, i16* %29
%182 = load i16, i16* %20
%183 = call zeroext i16 @gf4096_mul(i16 zeroext %181, i16 zeroext %182)
%184 = zext i16 %183 to i32
%185 = xor i32 %180, %184
%186 = trunc i32 %185 to i16
%187 = load i16, i16* %22
%188 = load i16, i16* %20
%189 = call zeroext i16 @gf4096_mul(i16 zeroext %187, i16 zeroext %188)
%190 = zext i16 %189 to i32
%191 = load i16, i16* %26
%192 = load i16, i16* %24
%193 = call zeroext i16 @gf4096_mul(i16 zeroext %191, i16 zeroext %192)
%194 = zext i16 %193 to i32
%195 = xor i32 %190, %194
%196 = trunc i32 %195 to i16
%197 = load i16, i16* %26
%198 = load i16, i16* %27
%199 = call zeroext i16 @gf4096_mul(i16 zeroext %197, i16 zeroext %198)
%200 = zext i16 %199 to i32
%201 = load i16, i16* %30
%202 = load i16, i16* %20
%203 = call zeroext i16 @gf4096_mul(i16 zeroext %201, i16 zeroext %202)
%204 = zext i16 %203 to i32
%205 = xor i32 %200, %204
%206 = trunc i32 %205 to i16
%207 = load i16*, i16** %18
%208 = call i32 @find_2x2_soln(i32 %157, i32 %166, i16 zeroext %176, i16 zeroext %186, i16 zeroext %196, i16 zeroext %206, i16* %207)
%209 = load i16*, i16** %18
%210 = getelementptr inbounds i16, i16* %209, i64 0
%211 = load i16, i16* %210
store i16 %211, i16* %31
%212 = load i16*, i16** %18
%213 = getelementptr inbounds i16, i16* %212, i64 1
%214 = load i16, i16* %213
store i16 %214, i16* %32
%215 = load i16*, i16** %18
%216 = getelementptr inbounds i16, i16* %215, i64 0
%217 = load i16, i16* %216
%218 = zext i16 %217 to i32
%219 = load i16*, i16** %18
%220 = getelementptr inbounds i16, i16* %219, i64 1
%221 = load i16, i16* %220
%222 = zext i16 %221 to i32
%223 = xor i32 %218, %222
%224 = load i16, i16* %10
%225 = zext i16 %224 to i32
%226 = xor i32 %223, %225
%227 = trunc i32 %226 to i16
store i16 %227, i16* %33
%228 = load i16*, i16** %18
%229 = getelementptr inbounds i16, i16* %228, i64 0
%230 = load i16, i16* %229
%231 = load i16, i16* %14
%232 = call zeroext i16 @gf4096_mul(i16 zeroext %230, i16 zeroext %231)
%233 = zext i16 %232 to i32
%234 = load i16*, i16** %18
%235 = getelementptr inbounds i16, i16* %234, i64 1
%236 = load i16, i16* %235
%237 = load i16, i16* %15
%238 = call zeroext i16 @gf4096_mul(i16 zeroext %236, i16 zeroext %237)
%239 = zext i16 %238 to i32
%240 = xor i32 %233, %239
%241 = load i16, i16* %11
%242 = zext i16 %241 to i32
%243 = xor i32 %240, %242
%244 = trunc i32 %243 to i16
store i16 %244, i16* %34
%245 = load i16, i16* %16
%246 = load i16, i16* %17
%247 = load i16, i16* %33
%248 = load i16, i16* %34
%249 = load i16*, i16** %18
%250 = call i32 @find_2x2_soln(i32 1, i32 1, i16 zeroext %245, i16 zeroext %246, i16 zeroext %247, i16 zeroext %248, i16* %249)
%251 = load i16*, i16** %18
%252 = getelementptr inbounds i16, i16* %251, i64 0
%253 = load i16, i16* %252
%254 = load i16*, i16** %18
%255 = getelementptr inbounds i16, i16* %254, i64 2
store i16 %253, i16* %255
%256 = load i16*, i16** %18
%257 = getelementptr inbounds i16, i16* %256, i64 1
%258 = load i16, i16* %257
%259 = load i16*, i16** %18
%260 = getelementptr inbounds i16, i16* %259, i64 3
store i16 %258, i16* %260
%261 = load i16, i16* %31
%262 = load i16*, i16** %18
%263 = getelementptr inbounds i16, i16* %262, i64 0
store i16 %261, i16* %263
%264 = load i16, i16* %32
%265 = load i16*, i16** %18
%266 = getelementptr inbounds i16, i16* %265, i64 1
store i16 %264, i16* %266
ret void
}

LLVM IR (-O2):
define void @find_4bit_err_pats(i16 zeroext %0, i16 zeroext %1, i16 zeroext %2, i16 zeroext %3, i16 zeroext %4, i16 zeroext %5, i16 zeroext %6, i16 zeroext %7, i16* %8) {
%10 = xor i16 %7, %4
%11 = tail call zeroext i16 @gf4096_mul(i16 zeroext %6, i16 zeroext %7)
%12 = tail call zeroext i16 @gf4096_mul(i16 zeroext %6, i16 zeroext %6)
%13 = xor i16 %12, %11
%14 = xor i16 %7, %5
%15 = tail call zeroext i16 @gf4096_mul(i16 zeroext %0, i16 zeroext %7)
%16 = xor i16 %15, %1
%17 = tail call zeroext i16 @gf4096_mul(i16 zeroext %4, i16 zeroext %7)
%18 = tail call zeroext i16 @gf4096_mul(i16 zeroext %4, i16 zeroext %4)
%19 = xor i16 %18, %17
%20 = xor i16 %7, %6
%21 = tail call zeroext i16 @gf4096_mul(i16 zeroext %5, i16 zeroext %7)
%22 = tail call zeroext i16 @gf4096_mul(i16 zeroext %5, i16 zeroext %5)
%23 = xor i16 %22, %21
%24 = tail call zeroext i16 @gf4096_mul(i16 zeroext %1, i16 zeroext %7)
%25 = xor i16 %24, %2
%26 = tail call zeroext i16 @gf4096_mul(i16 zeroext %6, i16 zeroext %6)
%27 = tail call zeroext i16 @gf4096_mul(i16 zeroext %26, i16 zeroext %7)
%28 = tail call zeroext i16 @gf4096_mul(i16 zeroext %6, i16 zeroext %6)
%29 = tail call zeroext i16 @gf4096_mul(i16 zeroext %28, i16 zeroext %6)
%30 = xor i16 %29, %27
%31 = tail call zeroext i16 @gf4096_mul(i16 zeroext %4, i16 zeroext %4)
%32 = tail call zeroext i16 @gf4096_mul(i16 zeroext %31, i16 zeroext %7)
%33 = tail call zeroext i16 @gf4096_mul(i16 zeroext %4, i16 zeroext %4)
%34 = tail call zeroext i16 @gf4096_mul(i16 zeroext %33, i16 zeroext %4)
%35 = xor i16 %34, %32
%36 = tail call zeroext i16 @gf4096_mul(i16 zeroext %5, i16 zeroext %5)
%37 = tail call zeroext i16 @gf4096_mul(i16 zeroext %36, i16 zeroext %7)
%38 = tail call zeroext i16 @gf4096_mul(i16 zeroext %5, i16 zeroext %5)
%39 = tail call zeroext i16 @gf4096_mul(i16 zeroext %38, i16 zeroext %5)
%40 = xor i16 %39, %37
%41 = tail call zeroext i16 @gf4096_mul(i16 zeroext %2, i16 zeroext %7)
%42 = xor i16 %41, %3
%43 = tail call zeroext i16 @gf4096_mul(i16 zeroext %10, i16 zeroext %13)
%44 = tail call zeroext i16 @gf4096_mul(i16 zeroext %19, i16 zeroext %20)
%45 = xor i16 %44, %43
%46 = zext i16 %45 to i32
%47 = tail call zeroext i16 @gf4096_mul(i16 zeroext %14, i16 zeroext %13)
%48 = tail call zeroext i16 @gf4096_mul(i16 zeroext %23, i16 zeroext %20)
%49 = xor i16 %48, %47
%50 = zext i16 %49 to i32
%51 = tail call zeroext i16 @gf4096_mul(i16 zeroext %19, i16 zeroext %30)
%52 = tail call zeroext i16 @gf4096_mul(i16 zeroext %35, i16 zeroext %13)
%53 = xor i16 %52, %51
%54 = tail call zeroext i16 @gf4096_mul(i16 zeroext %23, i16 zeroext %30)
%55 = tail call zeroext i16 @gf4096_mul(i16 zeroext %40, i16 zeroext %13)
%56 = xor i16 %55, %54
%57 = tail call zeroext i16 @gf4096_mul(i16 zeroext %16, i16 zeroext %13)
%58 = tail call zeroext i16 @gf4096_mul(i16 zeroext %25, i16 zeroext %20)
%59 = xor i16 %58, %57
%60 = tail call zeroext i16 @gf4096_mul(i16 zeroext %25, i16 zeroext %30)
%61 = tail call zeroext i16 @gf4096_mul(i16 zeroext %42, i16 zeroext %13)
%62 = xor i16 %61, %60
%63 = tail call i32 @find_2x2_soln(i32 %46, i32 %50, i16 zeroext %53, i16 zeroext %56, i16 zeroext %59, i16 zeroext %62, i16* %8)
%64 = load i16, i16* %8
%65 = getelementptr inbounds i16, i16* %8, i64 1
%66 = load i16, i16* %65
%67 = xor i16 %64, %0
%68 = xor i16 %67, %66
%69 = tail call zeroext i16 @gf4096_mul(i16 zeroext %64, i16 zeroext %4)
%70 = load i16, i16* %65
%71 = tail call zeroext i16 @gf4096_mul(i16 zeroext %70, i16 zeroext %5)
%72 = xor i16 %69, %1
%73 = xor i16 %72, %71
%74 = tail call i32 @find_2x2_soln(i32 1, i32 1, i16 zeroext %6, i16 zeroext %7, i16 zeroext %68, i16 zeroext %73, i16* %8)
%75 = load i16, i16* %8
%76 = getelementptr inbounds i16, i16* %8, i64 2
store i16 %75, i16* %76
%77 = load i16, i16* %65
%78 = getelementptr inbounds i16, i16* %8, i64 3
store i16 %77, i16* %78
store i16 %64, i16* %8
store i16 %66, i16* %65
ret void
}