#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 EINVAL;
int err_pos(unsigned short);
int /*<<< orphan*/ find_3bit_err_coefs(unsigned short, unsigned short,
                                       unsigned short, unsigned short,
                                       unsigned short, unsigned short,
                                       unsigned short *);
int /*<<< orphan*/ find_3bit_err_pats(unsigned short, unsigned short,
                                      unsigned short, unsigned short,
                                      unsigned short, unsigned short,
                                      unsigned short *);
unsigned short gf4096_inv(unsigned short);
unsigned short gf4096_mul(unsigned short, unsigned short);
int chk_3_err_only(unsigned short *chk_syndrome_list,
                   unsigned short *err_info) {
  unsigned short tmp0, tmp1, tmp2, tmp3, tmp4, tmp5;
  unsigned short coefs[4];
  unsigned short err_pats[4];
  int found_num_root = 0;
  unsigned short bit3_root0, bit3_root1, bit3_root2;
  unsigned short bit3_root0_inv, bit3_root1_inv, bit3_root2_inv;
  unsigned short err_loc_eqn, test_root;
  find_3bit_err_coefs(chk_syndrome_list[0], chk_syndrome_list[1],
                      chk_syndrome_list[2], chk_syndrome_list[3],
                      chk_syndrome_list[4], chk_syndrome_list[5], coefs);
  for (test_root = 0x1; test_root < 0xfff; test_root++) {
    err_loc_eqn =
        gf4096_mul(coefs[2],
                   gf4096_mul(gf4096_mul(test_root, test_root), test_root)) ^
        gf4096_mul(coefs[1], gf4096_mul(test_root, test_root)) ^
        gf4096_mul(coefs[0], test_root) ^ 0x1;
    if (err_loc_eqn == 0x0) {
      if (found_num_root == 0) {
        bit3_root0 = test_root;
        found_num_root = 1;
      } else if (found_num_root == 1) {
        bit3_root1 = test_root;
        found_num_root = 2;
      } else if (found_num_root == 2) {
        bit3_root2 = test_root;
        found_num_root = 3;
        break;
      }
    }
  }
  if (found_num_root != 3)
    return -EINVAL;
  else {
    bit3_root0_inv = gf4096_inv(bit3_root0);
    bit3_root1_inv = gf4096_inv(bit3_root1);
    bit3_root2_inv = gf4096_inv(bit3_root2);
    find_3bit_err_pats(chk_syndrome_list[0], chk_syndrome_list[1],
                       chk_syndrome_list[2], bit3_root0_inv, bit3_root1_inv,
                       bit3_root2_inv, err_pats);
    tmp0 = gf4096_mul(bit3_root0_inv, bit3_root0_inv);
    tmp0 = gf4096_mul(tmp0, tmp0);
    tmp0 = gf4096_mul(tmp0, bit3_root0_inv);
    tmp0 = gf4096_mul(tmp0, bit3_root0_inv);
    tmp1 = gf4096_mul(tmp0, bit3_root0_inv);
    tmp2 = gf4096_mul(bit3_root1_inv, bit3_root1_inv);
    tmp2 = gf4096_mul(tmp2, tmp2);
    tmp2 = gf4096_mul(tmp2, bit3_root1_inv);
    tmp2 = gf4096_mul(tmp2, bit3_root1_inv);
    tmp3 = gf4096_mul(tmp2, bit3_root1_inv);
    tmp4 = gf4096_mul(bit3_root2_inv, bit3_root2_inv);
    tmp4 = gf4096_mul(tmp4, tmp4);
    tmp4 = gf4096_mul(tmp4, bit3_root2_inv);
    tmp4 = gf4096_mul(tmp4, bit3_root2_inv);
    tmp5 = gf4096_mul(tmp4, bit3_root2_inv);
    if ((chk_syndrome_list[6] ==
         (gf4096_mul(err_pats[0], tmp0) ^ gf4096_mul(err_pats[1], tmp2) ^
          gf4096_mul(err_pats[2], tmp4))) &
        (chk_syndrome_list[7] ==
         (gf4096_mul(err_pats[0], tmp1) ^ gf4096_mul(err_pats[1], tmp3) ^
          gf4096_mul(err_pats[2], tmp5)))) {
      if ((err_pos(bit3_root0_inv) == 0xfff) |
          (err_pos(bit3_root1_inv) == 0xfff) |
          (err_pos(bit3_root2_inv) == 0xfff)) {
        return -EINVAL;
      } else {
        err_info[0] = 0x3;
        err_info[1] = (0x55e - err_pos(bit3_root0_inv));
        err_info[2] = (0x55e - err_pos(bit3_root1_inv));
        err_info[3] = (0x55e - err_pos(bit3_root2_inv));
        err_info[5] = err_pats[0];
        err_info[6] = err_pats[1];
        err_info[7] = err_pats[2];
        return 0;
      }
    } else
      return -EINVAL;
  }
}


x86 assembly (clang, -O0):
<chk_3_err_only>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
movl   $0x0,-0x38(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%di
mov    -0x10(%rbp),%rax
mov    0x2(%rax),%si
mov    -0x10(%rbp),%rax
mov    0x4(%rax),%dx
mov    -0x10(%rbp),%rax
mov    0x6(%rax),%cx
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%r8w
mov    -0x10(%rbp),%rax
mov    0xa(%rax),%r9w
lea    -0x2c(%rbp),%rax
movzwl %di,%edi
movzwl %si,%esi
movzwl %dx,%edx
movzwl %cx,%ecx
movzwl %r8w,%r8d
movzwl %r9w,%r9d
mov    %rax,(%rsp)
call   1060 <find_3bit_err_coefs@plt>
movw   $0x1,-0x48(%rbp)
movzwl -0x48(%rbp),%eax
cmp    $0xfff,%eax
jge    12ed <chk_3_err_only+0x19d>
mov    -0x28(%rbp),%ax
mov    %ax,-0x54(%rbp)
mov    -0x48(%rbp),%ax
movzwl %ax,%edi
movzwl -0x48(%rbp),%esi
call   1040 <gf4096_mul@plt>
movzwl %ax,%edi
movzwl -0x48(%rbp),%esi
call   1040 <gf4096_mul@plt>
mov    -0x54(%rbp),%cx
movzwl %cx,%edi
movzwl %ax,%esi
call   1040 <gf4096_mul@plt>
movzwl %ax,%eax
mov    %eax,-0x50(%rbp)
mov    -0x2a(%rbp),%ax
mov    %ax,-0x52(%rbp)
mov    -0x48(%rbp),%ax
movzwl %ax,%edi
movzwl -0x48(%rbp),%esi
call   1040 <gf4096_mul@plt>
mov    -0x52(%rbp),%cx
movzwl %cx,%edi
movzwl %ax,%esi
call   1040 <gf4096_mul@plt>
mov    %ax,%cx
mov    -0x50(%rbp),%eax
movzwl %cx,%ecx
xor    %ecx,%eax
mov    %eax,-0x4c(%rbp)
mov    -0x2c(%rbp),%ax
movzwl %ax,%edi
movzwl -0x48(%rbp),%esi
call   1040 <gf4096_mul@plt>
mov    %ax,%cx
mov    -0x4c(%rbp),%eax
movzwl %cx,%ecx
xor    %ecx,%eax
xor    $0x1,%eax
mov    %ax,-0x46(%rbp)
movzwl -0x46(%rbp),%eax
cmp    $0x0,%eax
jne    12d7 <chk_3_err_only+0x187>
cmpl   $0x0,-0x38(%rbp)
jne    128c <chk_3_err_only+0x13c>
mov    -0x48(%rbp),%ax
mov    %ax,-0x3a(%rbp)
movl   $0x1,-0x38(%rbp)
jmp    12d2 <chk_3_err_only+0x182>
cmpl   $0x1,-0x38(%rbp)
jne    12aa <chk_3_err_only+0x15a>
mov    -0x48(%rbp),%ax
mov    %ax,-0x3c(%rbp)
movl   $0x2,-0x38(%rbp)
jmp    12cd <chk_3_err_only+0x17d>
cmpl   $0x2,-0x38(%rbp)
jne    12c8 <chk_3_err_only+0x178>
mov    -0x48(%rbp),%ax
mov    %ax,-0x3e(%rbp)
movl   $0x3,-0x38(%rbp)
jmp    12ed <chk_3_err_only+0x19d>
jmp    12cd <chk_3_err_only+0x17d>
jmp    12d2 <chk_3_err_only+0x182>
jmp    12d7 <chk_3_err_only+0x187>
jmp    12dc <chk_3_err_only+0x18c>
mov    -0x48(%rbp),%ax
add    $0x1,%ax
mov    %ax,-0x48(%rbp)
jmp    11c2 <chk_3_err_only+0x72>
cmpl   $0x3,-0x38(%rbp)
je     130a <chk_3_err_only+0x1ba>
xor    %eax,%eax
mov    0x2ce0(%rip),%rcx
sub    (%rcx),%eax
mov    %eax,-0x4(%rbp)
jmp    1697 <chk_3_err_only+0x547>
movzwl -0x3a(%rbp),%edi
call   1050 <gf4096_inv@plt>
mov    %ax,-0x40(%rbp)
movzwl -0x3c(%rbp),%edi
call   1050 <gf4096_inv@plt>
mov    %ax,-0x42(%rbp)
movzwl -0x3e(%rbp),%edi
call   1050 <gf4096_inv@plt>
mov    %ax,-0x44(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%di
mov    -0x10(%rbp),%rax
mov    0x2(%rax),%si
mov    -0x10(%rbp),%rax
mov    0x4(%rax),%dx
mov    -0x40(%rbp),%cx
mov    -0x42(%rbp),%r8w
mov    -0x44(%rbp),%r9w
lea    -0x34(%rbp),%rax
movzwl %di,%edi
movzwl %si,%esi
movzwl %dx,%edx
movzwl %cx,%ecx
movzwl %r8w,%r8d
movzwl %r9w,%r9d
mov    %rax,(%rsp)
call   1070 <find_3bit_err_pats@plt>
mov    -0x40(%rbp),%ax
movzwl %ax,%edi
movzwl -0x40(%rbp),%esi
call   1040 <gf4096_mul@plt>
mov    %ax,-0x1a(%rbp)
mov    -0x1a(%rbp),%ax
movzwl %ax,%edi
movzwl -0x1a(%rbp),%esi
call   1040 <gf4096_mul@plt>
mov    %ax,-0x1a(%rbp)
mov    -0x1a(%rbp),%ax
movzwl %ax,%edi
movzwl -0x40(%rbp),%esi
call   1040 <gf4096_mul@plt>
mov    %ax,-0x1a(%rbp)
mov    -0x1a(%rbp),%ax
movzwl %ax,%edi
movzwl -0x40(%rbp),%esi
call   1040 <gf4096_mul@plt>
mov    %ax,-0x1a(%rbp)
mov    -0x1a(%rbp),%ax
movzwl %ax,%edi
movzwl -0x40(%rbp),%esi
call   1040 <gf4096_mul@plt>
mov    %ax,-0x1c(%rbp)
mov    -0x42(%rbp),%ax
movzwl %ax,%edi
movzwl -0x42(%rbp),%esi
call   1040 <gf4096_mul@plt>
mov    %ax,-0x1e(%rbp)
mov    -0x1e(%rbp),%ax
movzwl %ax,%edi
movzwl -0x1e(%rbp),%esi
call   1040 <gf4096_mul@plt>
mov    %ax,-0x1e(%rbp)
mov    -0x1e(%rbp),%ax
movzwl %ax,%edi
movzwl -0x42(%rbp),%esi
call   1040 <gf4096_mul@plt>
mov    %ax,-0x1e(%rbp)
mov    -0x1e(%rbp),%ax
movzwl %ax,%edi
movzwl -0x42(%rbp),%esi
call   1040 <gf4096_mul@plt>
mov    %ax,-0x1e(%rbp)
mov    -0x1e(%rbp),%ax
movzwl %ax,%edi
movzwl -0x42(%rbp),%esi
call   1040 <gf4096_mul@plt>
mov    %ax,-0x20(%rbp)
mov    -0x44(%rbp),%ax
movzwl %ax,%edi
movzwl -0x44(%rbp),%esi
call   1040 <gf4096_mul@plt>
mov    %ax,-0x22(%rbp)
mov    -0x22(%rbp),%ax
movzwl %ax,%edi
movzwl -0x22(%rbp),%esi
call   1040 <gf4096_mul@plt>
mov    %ax,-0x22(%rbp)
mov    -0x22(%rbp),%ax
movzwl %ax,%edi
movzwl -0x44(%rbp),%esi
call   1040 <gf4096_mul@plt>
mov    %ax,-0x22(%rbp)
mov    -0x22(%rbp),%ax
movzwl %ax,%edi
movzwl -0x44(%rbp),%esi
call   1040 <gf4096_mul@plt>
mov    %ax,-0x22(%rbp)
mov    -0x22(%rbp),%ax
movzwl %ax,%edi
movzwl -0x44(%rbp),%esi
call   1040 <gf4096_mul@plt>
mov    %ax,-0x24(%rbp)
mov    -0x10(%rbp),%rax
movzwl 0xc(%rax),%eax
mov    %eax,-0x68(%rbp)
mov    -0x34(%rbp),%ax
movzwl %ax,%edi
movzwl -0x1a(%rbp),%esi
call   1040 <gf4096_mul@plt>
movzwl %ax,%eax
mov    %eax,-0x70(%rbp)
mov    -0x32(%rbp),%ax
movzwl %ax,%edi
movzwl -0x1e(%rbp),%esi
call   1040 <gf4096_mul@plt>
mov    %ax,%cx
mov    -0x70(%rbp),%eax
movzwl %cx,%ecx
xor    %ecx,%eax
mov    %eax,-0x6c(%rbp)
mov    -0x30(%rbp),%ax
movzwl %ax,%edi
movzwl -0x22(%rbp),%esi
call   1040 <gf4096_mul@plt>
mov    -0x6c(%rbp),%ecx
mov    %ax,%dx
mov    -0x68(%rbp),%eax
movzwl %dx,%edx
xor    %edx,%ecx
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x58(%rbp)
mov    -0x10(%rbp),%rax
movzwl 0xe(%rax),%eax
mov    %eax,-0x5c(%rbp)
mov    -0x34(%rbp),%ax
movzwl %ax,%edi
movzwl -0x1c(%rbp),%esi
call   1040 <gf4096_mul@plt>
movzwl %ax,%eax
mov    %eax,-0x64(%rbp)
mov    -0x32(%rbp),%ax
movzwl %ax,%edi
movzwl -0x20(%rbp),%esi
call   1040 <gf4096_mul@plt>
mov    %ax,%cx
mov    -0x64(%rbp),%eax
movzwl %cx,%ecx
xor    %ecx,%eax
mov    %eax,-0x60(%rbp)
mov    -0x30(%rbp),%ax
movzwl %ax,%edi
movzwl -0x24(%rbp),%esi
call   1040 <gf4096_mul@plt>
mov    -0x60(%rbp),%edx
mov    -0x5c(%rbp),%ecx
mov    %ax,%si
mov    -0x58(%rbp),%eax
movzwl %si,%esi
xor    %esi,%edx
cmp    %edx,%ecx
sete   %cl
and    $0x1,%cl
movzbl %cl,%ecx
and    %ecx,%eax
cmp    $0x0,%eax
je     1689 <chk_3_err_only+0x539>
movzwl -0x40(%rbp),%edi
call   1030 <err_pos@plt>
cmp    $0xfff,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x78(%rbp)
movzwl -0x42(%rbp),%edi
call   1030 <err_pos@plt>
mov    %eax,%ecx
mov    -0x78(%rbp),%eax
cmp    $0xfff,%ecx
sete   %cl
and    $0x1,%cl
movzbl %cl,%ecx
or     %ecx,%eax
mov    %eax,-0x74(%rbp)
movzwl -0x44(%rbp),%edi
call   1030 <err_pos@plt>
mov    %eax,%ecx
mov    -0x74(%rbp),%eax
cmp    $0xfff,%ecx
sete   %cl
and    $0x1,%cl
movzbl %cl,%ecx
or     %ecx,%eax
cmp    $0x0,%eax
je     15f9 <chk_3_err_only+0x4a9>
xor    %eax,%eax
mov    0x29f1(%rip),%rcx
sub    (%rcx),%eax
mov    %eax,-0x4(%rbp)
jmp    1697 <chk_3_err_only+0x547>
mov    -0x18(%rbp),%rax
movw   $0x3,(%rax)
movzwl -0x40(%rbp),%edi
call   1030 <err_pos@plt>
mov    %eax,%ecx
mov    $0x55e,%eax
sub    %ecx,%eax
mov    %ax,%cx
mov    -0x18(%rbp),%rax
mov    %cx,0x2(%rax)
movzwl -0x42(%rbp),%edi
call   1030 <err_pos@plt>
mov    %eax,%ecx
mov    $0x55e,%eax
sub    %ecx,%eax
mov    %ax,%cx
mov    -0x18(%rbp),%rax
mov    %cx,0x4(%rax)
movzwl -0x44(%rbp),%edi
call   1030 <err_pos@plt>
mov    %eax,%ecx
mov    $0x55e,%eax
sub    %ecx,%eax
mov    %ax,%cx
mov    -0x18(%rbp),%rax
mov    %cx,0x6(%rax)
mov    -0x34(%rbp),%cx
mov    -0x18(%rbp),%rax
mov    %cx,0xa(%rax)
mov    -0x32(%rbp),%cx
mov    -0x18(%rbp),%rax
mov    %cx,0xc(%rax)
mov    -0x30(%rbp),%cx
mov    -0x18(%rbp),%rax
mov    %cx,0xe(%rax)
movl   $0x0,-0x4(%rbp)
jmp    1697 <chk_3_err_only+0x547>
xor    %eax,%eax
mov    0x294e(%rip),%rcx
sub    (%rcx),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<chk_3_err_only>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x48,%rsp
mov    %rsi,0x38(%rsp)
mov    %rdi,%rax
movzwl (%rdi),%edi
movzwl 0x2(%rax),%esi
movzwl 0x4(%rax),%edx
movzwl 0x6(%rax),%ecx
movzwl 0x8(%rax),%r8d
mov    %rax,0x40(%rsp)
movzwl 0xa(%rax),%r9d
lea    0x30(%rsp),%rax
mov    %rax,(%rsp)
call   1060 <find_3bit_err_coefs@plt>
xor    %r13d,%r13d
mov    $0x1,%r12w
jmp    11bf <chk_3_err_only+0x6f>
mov    $0x2,%r13d
mov    %r12d,%eax
mov    %r12w,0x14(%rsp)
nopl   0x0(%rax,%rax,1)
add    $0x1,%r12d
movzwl %r12w,%eax
cmp    $0xfff,%eax
je     123e <chk_3_err_only+0xee>
movzwl 0x34(%rsp),%ebx
movzwl %r12w,%ebp
mov    %ebp,%edi
mov    %ebp,%esi
call   1040 <gf4096_mul@plt>
movzwl %ax,%edi
mov    %ebp,%esi
call   1040 <gf4096_mul@plt>
movzwl %ax,%esi
mov    %ebx,%edi
call   1040 <gf4096_mul@plt>
mov    %eax,%r14d
movzwl 0x32(%rsp),%ebx
mov    %ebp,%edi
mov    %ebp,%esi
call   1040 <gf4096_mul@plt>
movzwl %ax,%esi
mov    %ebx,%edi
call   1040 <gf4096_mul@plt>
mov    %eax,%ebx
xor    %r14d,%ebx
movzwl 0x30(%rsp),%edi
mov    %ebp,%esi
call   1040 <gf4096_mul@plt>
xor    %ebx,%eax
cmp    $0x1,%ax
jne    11b0 <chk_3_err_only+0x60>
test   %r13d,%r13d
je     1230 <chk_3_err_only+0xe0>
cmp    $0x1,%r13d
je     119c <chk_3_err_only+0x4c>
cmp    $0x2,%r13d
jne    11b0 <chk_3_err_only+0x60>
jmp    124d <chk_3_err_only+0xfd>
mov    $0x1,%r13d
mov    %r12d,%r15d
jmp    11b0 <chk_3_err_only+0x60>
mov    $0xfff,%r12w
cmp    $0x3,%r13d
jne    148a <chk_3_err_only+0x33a>
movzwl %r15w,%edi
call   1050 <gf4096_inv@plt>
mov    %eax,%ebx
movzwl 0x14(%rsp),%edi
call   1050 <gf4096_inv@plt>
mov    %eax,%ebp
movzwl %r12w,%edi
call   1050 <gf4096_inv@plt>
mov    0x40(%rsp),%r15
movzwl (%r15),%edi
movzwl 0x2(%r15),%esi
movzwl 0x4(%r15),%edx
lea    0x16(%rsp),%rcx
mov    %rcx,(%rsp)
movzwl %bx,%r14d
movzwl %bp,%ebp
movzwl %ax,%ebx
mov    %r14d,%ecx
mov    %ebp,%r8d
mov    %ebx,%r9d
call   1070 <find_3bit_err_pats@plt>
mov    %r14d,%edi
mov    %r14d,%esi
call   1040 <gf4096_mul@plt>
movzwl %ax,%edi
mov    %edi,%esi
call   1040 <gf4096_mul@plt>
movzwl %ax,%edi
mov    %r14d,%esi
call   1040 <gf4096_mul@plt>
movzwl %ax,%edi
mov    %r14d,%esi
call   1040 <gf4096_mul@plt>
movzwl %ax,%edi
mov    %edi,0x2c(%rsp)
mov    %r14d,%esi
call   1040 <gf4096_mul@plt>
mov    %ax,0x14(%rsp)
mov    %ebp,%edi
mov    %ebp,%esi
call   1040 <gf4096_mul@plt>
movzwl %ax,%edi
mov    %edi,%esi
call   1040 <gf4096_mul@plt>
movzwl %ax,%edi
mov    %ebp,%esi
call   1040 <gf4096_mul@plt>
movzwl %ax,%edi
mov    %ebp,%esi
call   1040 <gf4096_mul@plt>
movzwl %ax,%r13d
mov    %r13d,%edi
mov    %ebp,0x24(%rsp)
mov    %ebp,%esi
call   1040 <gf4096_mul@plt>
mov    %ax,0x22(%rsp)
mov    %ebx,%edi
mov    %ebx,%esi
call   1040 <gf4096_mul@plt>
movzwl %ax,%edi
mov    %edi,%esi
call   1040 <gf4096_mul@plt>
movzwl %ax,%edi
mov    %ebx,%esi
call   1040 <gf4096_mul@plt>
movzwl %ax,%edi
mov    %ebx,%esi
call   1040 <gf4096_mul@plt>
movzwl %ax,%r12d
mov    %r12d,%edi
mov    %ebx,0x28(%rsp)
mov    %ebx,%esi
call   1040 <gf4096_mul@plt>
mov    %ax,0x1e(%rsp)
movzwl 0xc(%r15),%eax
mov    %ax,0x20(%rsp)
movzwl 0x16(%rsp),%edi
mov    0x2c(%rsp),%esi
call   1040 <gf4096_mul@plt>
mov    %eax,%ebp
movzwl 0x18(%rsp),%edi
mov    %r13d,%esi
call   1040 <gf4096_mul@plt>
mov    %eax,%ebx
xor    %ebp,%ebx
movzwl 0x1a(%rsp),%edi
mov    %r12d,%esi
call   1040 <gf4096_mul@plt>
mov    %eax,%r12d
xor    %ebx,%r12d
movzwl 0xe(%r15),%r13d
movzwl 0x16(%rsp),%edi
movzwl 0x14(%rsp),%esi
call   1040 <gf4096_mul@plt>
mov    %eax,%ebx
movzwl 0x18(%rsp),%edi
movzwl 0x22(%rsp),%esi
call   1040 <gf4096_mul@plt>
mov    %eax,%ebp
movzwl 0x1a(%rsp),%edi
movzwl 0x1e(%rsp),%esi
call   1040 <gf4096_mul@plt>
cmp    %r12w,0x20(%rsp)
jne    148a <chk_3_err_only+0x33a>
xor    %ebx,%ebp
xor    %ebp,%eax
cmp    %ax,%r13w
jne    148a <chk_3_err_only+0x33a>
mov    %r14d,%edi
call   1030 <err_pos@plt>
mov    %eax,%ebp
mov    0x24(%rsp),%r12d
mov    %r12d,%edi
call   1030 <err_pos@plt>
mov    %eax,%ebx
mov    0x28(%rsp),%r15d
mov    %r15d,%edi
call   1030 <err_pos@plt>
cmp    $0xfff,%ebp
je     148a <chk_3_err_only+0x33a>
cmp    $0xfff,%ebx
je     148a <chk_3_err_only+0x33a>
cmp    $0xfff,%eax
je     148a <chk_3_err_only+0x33a>
mov    0x38(%rsp),%rbp
movw   $0x3,0x0(%rbp)
mov    %r14d,%edi
call   1030 <err_pos@plt>
mov    $0x55e,%ebx
mov    $0x55e,%ecx
sub    %eax,%ecx
mov    %cx,0x2(%rbp)
mov    %r12d,%edi
call   1030 <err_pos@plt>
mov    $0x55e,%ecx
sub    %eax,%ecx
mov    %cx,0x4(%rbp)
mov    %r15d,%edi
call   1030 <err_pos@plt>
sub    %eax,%ebx
mov    %bx,0x6(%rbp)
movzwl 0x16(%rsp),%eax
mov    %ax,0xa(%rbp)
movzwl 0x18(%rsp),%eax
mov    %ax,0xc(%rbp)
movzwl 0x1a(%rsp),%eax
mov    %ax,0xe(%rbp)
xor    %eax,%eax
jmp    1495 <chk_3_err_only+0x345>
mov    0x2b4f(%rip),%rcx
xor    %eax,%eax
sub    (%rcx),%eax
add    $0x48,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@EINVAL = global i32 0
define i32 @chk_3_err_only(i16* nocapture %0, i16* nocapture writeonly %1) {
%3 = alloca [4 x i16]
%4 = alloca [4 x i16]
%5 = bitcast [4 x i16]* %3 to i8*
%6 = bitcast [4 x i16]* %4 to i8*
%7 = load i16, i16* %0
%8 = getelementptr inbounds i16, i16* %0, i64 1
%9 = load i16, i16* %8
%10 = getelementptr inbounds i16, i16* %0, i64 2
%11 = load i16, i16* %10
%12 = getelementptr inbounds i16, i16* %0, i64 3
%13 = load i16, i16* %12
%14 = getelementptr inbounds i16, i16* %0, i64 4
%15 = load i16, i16* %14
%16 = getelementptr inbounds i16, i16* %0, i64 5
%17 = load i16, i16* %16
%18 = getelementptr inbounds [4 x i16], [4 x i16]* %3, i64 0, i64 0
%19 = call i32 @find_3bit_err_coefs(i16 zeroext %7, i16 zeroext %9, i16 zeroext %11, i16 zeroext %13, i16 zeroext %15, i16 zeroext %17, i16* %18)
%20 = getelementptr inbounds [4 x i16], [4 x i16]* %3, i64 0, i64 2
%21 = getelementptr inbounds [4 x i16], [4 x i16]* %3, i64 0, i64 1
br label %22
22: ; preds = %2, %42
%23 = phi i16 [ 1, %2 ], [ %46, %42 ]
%24 = phi i32 [ 0, %2 ], [ %45, %42 ]
%25 = phi i16 [ undef, %2 ], [ %44, %42 ]
%26 = phi i16 [ undef, %2 ], [ %43, %42 ]
%27 = load i16, i16* %20
%28 = call zeroext i16 @gf4096_mul(i16 zeroext %23, i16 zeroext %23)
%29 = call zeroext i16 @gf4096_mul(i16 zeroext %28, i16 zeroext %23)
%30 = call zeroext i16 @gf4096_mul(i16 zeroext %27, i16 zeroext %29)
%31 = load i16, i16* %21
%32 = call zeroext i16 @gf4096_mul(i16 zeroext %23, i16 zeroext %23)
%33 = call zeroext i16 @gf4096_mul(i16 zeroext %31, i16 zeroext %32)
%34 = xor i16 %33, %30
%35 = load i16, i16* %18
%36 = call zeroext i16 @gf4096_mul(i16 zeroext %35, i16 zeroext %23)
%37 = xor i16 %34, %36
%38 = icmp eq i16 %37, 1
br i1 %38, label %39, label %42
39: ; preds = %22
switch i32 %24, label %41 [
i32 0, label %42
i32 1, label %40
i32 2, label %53
]
40: ; preds = %39
br label %42
41: ; preds = %39
br label %42
42: ; preds = %39, %41, %22, %40
%43 = phi i16 [ %23, %40 ], [ %26, %22 ], [ %26, %39 ], [ %26, %41 ]
%44 = phi i16 [ %25, %40 ], [ %25, %22 ], [ %23, %39 ], [ %25, %41 ]
%45 = phi i32 [ 2, %40 ], [ %24, %22 ], [ 1, %39 ], [ %24, %41 ]
%46 = add nuw nsw i16 %23, 1
%47 = icmp eq i16 %46, 4095
br i1 %47, label %48, label %22
48: ; preds = %42
%49 = icmp eq i32 %45, 3
br i1 %49, label %53, label %50
50: ; preds = %48
%51 = load i32, i32* @EINVAL
%52 = sub nsw i32 0, %51
br label %139
53: ; preds = %39, %48
%54 = phi i16 [ %43, %48 ], [ %26, %39 ]
%55 = phi i16 [ %44, %48 ], [ %25, %39 ]
%56 = phi i16 [ 4095, %48 ], [ %23, %39 ]
%57 = call zeroext i16 @gf4096_inv(i16 zeroext %55)
%58 = call zeroext i16 @gf4096_inv(i16 zeroext %54)
%59 = call zeroext i16 @gf4096_inv(i16 zeroext %56)
%60 = load i16, i16* %0
%61 = load i16, i16* %8
%62 = load i16, i16* %10
%63 = getelementptr inbounds [4 x i16], [4 x i16]* %4, i64 0, i64 0
%64 = call i32 @find_3bit_err_pats(i16 zeroext %60, i16 zeroext %61, i16 zeroext %62, i16 zeroext %57, i16 zeroext %58, i16 zeroext %59, i16* %63)
%65 = call zeroext i16 @gf4096_mul(i16 zeroext %57, i16 zeroext %57)
%66 = call zeroext i16 @gf4096_mul(i16 zeroext %65, i16 zeroext %65)
%67 = call zeroext i16 @gf4096_mul(i16 zeroext %66, i16 zeroext %57)
%68 = call zeroext i16 @gf4096_mul(i16 zeroext %67, i16 zeroext %57)
%69 = call zeroext i16 @gf4096_mul(i16 zeroext %68, i16 zeroext %57)
%70 = call zeroext i16 @gf4096_mul(i16 zeroext %58, i16 zeroext %58)
%71 = call zeroext i16 @gf4096_mul(i16 zeroext %70, i16 zeroext %70)
%72 = call zeroext i16 @gf4096_mul(i16 zeroext %71, i16 zeroext %58)
%73 = call zeroext i16 @gf4096_mul(i16 zeroext %72, i16 zeroext %58)
%74 = call zeroext i16 @gf4096_mul(i16 zeroext %73, i16 zeroext %58)
%75 = call zeroext i16 @gf4096_mul(i16 zeroext %59, i16 zeroext %59)
%76 = call zeroext i16 @gf4096_mul(i16 zeroext %75, i16 zeroext %75)
%77 = call zeroext i16 @gf4096_mul(i16 zeroext %76, i16 zeroext %59)
%78 = call zeroext i16 @gf4096_mul(i16 zeroext %77, i16 zeroext %59)
%79 = call zeroext i16 @gf4096_mul(i16 zeroext %78, i16 zeroext %59)
%80 = getelementptr inbounds i16, i16* %0, i64 6
%81 = load i16, i16* %80
%82 = load i16, i16* %63
%83 = call zeroext i16 @gf4096_mul(i16 zeroext %82, i16 zeroext %68)
%84 = getelementptr inbounds [4 x i16], [4 x i16]* %4, i64 0, i64 1
%85 = load i16, i16* %84
%86 = call zeroext i16 @gf4096_mul(i16 zeroext %85, i16 zeroext %73)
%87 = xor i16 %86, %83
%88 = getelementptr inbounds [4 x i16], [4 x i16]* %4, i64 0, i64 2
%89 = load i16, i16* %88
%90 = call zeroext i16 @gf4096_mul(i16 zeroext %89, i16 zeroext %78)
%91 = xor i16 %87, %90
%92 = icmp eq i16 %81, %91
%93 = getelementptr inbounds i16, i16* %0, i64 7
%94 = load i16, i16* %93
%95 = load i16, i16* %63
%96 = call zeroext i16 @gf4096_mul(i16 zeroext %95, i16 zeroext %69)
%97 = load i16, i16* %84
%98 = call zeroext i16 @gf4096_mul(i16 zeroext %97, i16 zeroext %74)
%99 = xor i16 %98, %96
%100 = load i16, i16* %88
%101 = call zeroext i16 @gf4096_mul(i16 zeroext %100, i16 zeroext %79)
%102 = xor i16 %99, %101
%103 = icmp eq i16 %94, %102
%104 = and i1 %92, %103
br i1 %104, label %105, label %136
105: ; preds = %53
%106 = call i32 @err_pos(i16 zeroext %57)
%107 = icmp eq i32 %106, 4095
%108 = call i32 @err_pos(i16 zeroext %58)
%109 = icmp eq i32 %108, 4095
%110 = or i1 %107, %109
%111 = call i32 @err_pos(i16 zeroext %59)
%112 = icmp eq i32 %111, 4095
%113 = or i1 %110, %112
br i1 %113, label %114, label %117
114: ; preds = %105
%115 = load i32, i32* @EINVAL
%116 = sub nsw i32 0, %115
br label %139
117: ; preds = %105
store i16 3, i16* %1
%118 = call i32 @err_pos(i16 zeroext %57)
%119 = trunc i32 %118 to i16
%120 = sub i16 1374, %119
%121 = getelementptr inbounds i16, i16* %1, i64 1
store i16 %120, i16* %121
%122 = call i32 @err_pos(i16 zeroext %58)
%123 = trunc i32 %122 to i16
%124 = sub i16 1374, %123
%125 = getelementptr inbounds i16, i16* %1, i64 2
store i16 %124, i16* %125
%126 = call i32 @err_pos(i16 zeroext %59)
%127 = trunc i32 %126 to i16
%128 = sub i16 1374, %127
%129 = getelementptr inbounds i16, i16* %1, i64 3
store i16 %128, i16* %129
%130 = load i16, i16* %63
%131 = getelementptr inbounds i16, i16* %1, i64 5
store i16 %130, i16* %131
%132 = load i16, i16* %84
%133 = getelementptr inbounds i16, i16* %1, i64 6
store i16 %132, i16* %133
%134 = load i16, i16* %88
%135 = getelementptr inbounds i16, i16* %1, i64 7
store i16 %134, i16* %135
br label %139
136: ; preds = %53
%137 = load i32, i32* @EINVAL
%138 = sub nsw i32 0, %137
br label %139
139: ; preds = %136, %117, %114, %50
%140 = phi i32 [ %52, %50 ], [ %116, %114 ], [ 0, %117 ], [ %138, %136 ]
ret i32 %140
}