#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 int mpy_mod_gf(unsigned int, unsigned int);
int /*<<< orphan*/ pr_debug(char *, ...);
unsigned int berlekamp(unsigned int select_4_8, unsigned int synd[],
                       unsigned int err[]) {
  int loop, iteration;
  unsigned int LL = 0;
  unsigned int d = 0;
  unsigned int invd = 0;
  unsigned int gammas[16] = {0};
  unsigned int D[16] = {0};
  unsigned int next_gamma = 0;
  int e = 0;
  unsigned int sign = 0;
  unsigned int u = 0;
  unsigned int v = 0;
  unsigned int C1 = 0, C2 = 0;
  unsigned int ss = 0;
  unsigned int tmp_v = 0, tmp_s = 0;
  unsigned int tmp_poly;
  for (loop = 0; loop < 16; loop++)
    gammas[loop] = 0;
  gammas[0] = 1;
  D[1] = 1;
  iteration = 0;
  LL = 0;
  while ((iteration < ((select_4_8 + 1) * 2 * 4)) &&
         (LL <= ((select_4_8 + 1) * 4))) {
    pr_debug("\nIteration.............%d\n", iteration);
    d = 0;
    for (loop = 0; loop <= LL; loop++) {
      tmp_poly = mpy_mod_gf(gammas[loop], synd[iteration - loop]);
      d ^= tmp_poly;
      pr_debug("%02d. s=0 LL=%x poly %x\n", loop, LL, tmp_poly);
    }
    v = d << 1;
    e = -1;
    sign = 1;
    ss = 0x2000;
    invd = 0;
    u = 0x201B;
    for (loop = 0; (d != 0) && (loop <= (2 * 12)); loop++) {
      pr_debug("%02d. s=1 LL=%x poly NULL\n", loop, LL);
      C1 = (v >> 13) & 1;
      C2 = C1 & sign;
      sign ^= C2 ^ (e == 0);
      tmp_v = v;
      tmp_s = ss;
      if (C1 == 1) {
        v ^= u;
        ss ^= invd;
      }
      v = (v << 1) & 0x3FFF;
      if (C2 == 1) {
        u = tmp_v;
        invd = tmp_s;
        e = -e;
      }
      invd >>= 1;
      e--;
    }
    for (loop = 0; (d != 0) && (loop <= (iteration + 1)); loop++) {
      tmp_poly = mpy_mod_gf(d, D[loop]);
      pr_debug("%02d. s=2 LL=%x poly %x\n", loop, LL, tmp_poly);
      next_gamma = gammas[loop] ^ tmp_poly;
      if ((2 * LL) < (iteration + 1)) {
      } else {
        gammas[loop] = next_gamma;
        if (loop == (iteration + 1)) {
          break;
        }
      }
      D[loop] = mpy_mod_gf(gammas[loop], invd);
      pr_debug("%02d. s=3 LL=%x poly %x\n", loop, LL, D[loop]);
      gammas[loop] = next_gamma;
      if (loop == (iteration + 1)) {
        LL = iteration - LL + 1;
        break;
      }
    }
    for (loop = 0; loop < 15; loop++)
      D[15 - loop] = D[14 - loop];
    D[0] = 0;
    iteration++;
  }
  for (loop = 0; loop < 8; loop++)
    err[loop] = gammas[loop + 1];
  pr_debug("\n Err poly:");
  for (loop = 0; loop < 8; loop++)
    pr_debug("0x%x ", err[loop]);
  return LL;
}


x86 assembly (clang, -O0):
<berlekamp>:
push   %rbp
mov    %rsp,%rbp
sub    $0xe0,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
movl   $0x0,-0x24(%rbp)
movl   $0x0,-0x28(%rbp)
movl   $0x0,-0x2c(%rbp)
lea    -0x70(%rbp),%rdi
xor    %esi,%esi
mov    $0x40,%edx
call   1030 <memset@plt>
lea    -0xb0(%rbp),%rdi
xor    %esi,%esi
mov    $0x40,%edx
call   1030 <memset@plt>
movl   $0x0,-0xb4(%rbp)
movl   $0x0,-0xb8(%rbp)
movl   $0x0,-0xbc(%rbp)
movl   $0x0,-0xc0(%rbp)
movl   $0x0,-0xc4(%rbp)
movl   $0x0,-0xc8(%rbp)
movl   $0x0,-0xcc(%rbp)
movl   $0x0,-0xd0(%rbp)
movl   $0x0,-0xd4(%rbp)
movl   $0x0,-0xd8(%rbp)
movl   $0x0,-0x1c(%rbp)
cmpl   $0x10,-0x1c(%rbp)
jge    120d <berlekamp+0xdd>
movslq -0x1c(%rbp),%rax
movl   $0x0,-0x70(%rbp,%rax,4)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    11e9 <berlekamp+0xb9>
movl   $0x1,-0x70(%rbp)
movl   $0x1,-0xac(%rbp)
movl   $0x0,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
mov    -0x20(%rbp),%ecx
mov    -0x4(%rbp),%edx
add    $0x1,%edx
shl    $0x1,%edx
shl    $0x2,%edx
xor    %eax,%eax
cmp    %edx,%ecx
mov    %al,-0xdd(%rbp)
jae    1262 <berlekamp+0x132>
mov    -0x24(%rbp),%eax
mov    -0x4(%rbp),%ecx
add    $0x1,%ecx
shl    $0x2,%ecx
cmp    %ecx,%eax
setbe  %al
mov    %al,-0xdd(%rbp)
mov    -0xdd(%rbp),%al
test   $0x1,%al
jne    1275 <berlekamp+0x145>
jmp    1618 <berlekamp+0x4e8>
mov    -0x20(%rbp),%esi
lea    0xd81(%rip),%rdi
mov    $0x0,%al
call   1040 <pr_debug@plt>
movl   $0x0,-0x28(%rbp)
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x24(%rbp),%eax
ja     12f7 <berlekamp+0x1c7>
movslq -0x1c(%rbp),%rax
mov    -0x70(%rbp,%rax,4),%edi
mov    -0x10(%rbp),%rax
mov    -0x20(%rbp),%ecx
sub    -0x1c(%rbp),%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%esi
call   1050 <mpy_mod_gf@plt>
mov    %eax,-0xdc(%rbp)
mov    -0xdc(%rbp),%eax
xor    -0x28(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0x1c(%rbp),%esi
mov    -0x24(%rbp),%edx
mov    -0xdc(%rbp),%ecx
lea    0xd39(%rip),%rdi
mov    $0x0,%al
call   1040 <pr_debug@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1294 <berlekamp+0x164>
mov    -0x28(%rbp),%eax
shl    $0x1,%eax
mov    %eax,-0xc4(%rbp)
movl   $0xffffffff,-0xb8(%rbp)
ff ff ff
movl   $0x1,-0xbc(%rbp)
movl   $0x2000,-0xd0(%rbp)
movl   $0x0,-0x2c(%rbp)
movl   $0x201b,-0xc0(%rbp)
movl   $0x0,-0x1c(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x28(%rbp)
mov    %al,-0xde(%rbp)
je     1358 <berlekamp+0x228>
cmpl   $0x18,-0x1c(%rbp)
setle  %al
mov    %al,-0xde(%rbp)
mov    -0xde(%rbp),%al
test   $0x1,%al
jne    136b <berlekamp+0x23b>
jmp    1477 <berlekamp+0x347>
mov    -0x1c(%rbp),%esi
mov    -0x24(%rbp),%edx
lea    0xcbc(%rip),%rdi
mov    $0x0,%al
call   1040 <pr_debug@plt>
mov    -0xc4(%rbp),%eax
shr    $0xd,%eax
and    $0x1,%eax
mov    %eax,-0xc8(%rbp)
mov    -0xc8(%rbp),%eax
and    -0xbc(%rbp),%eax
mov    %eax,-0xcc(%rbp)
mov    -0xcc(%rbp),%eax
cmpl   $0x0,-0xb8(%rbp)
sete   %cl
and    $0x1,%cl
movzbl %cl,%ecx
xor    %ecx,%eax
xor    -0xbc(%rbp),%eax
mov    %eax,-0xbc(%rbp)
mov    -0xc4(%rbp),%eax
mov    %eax,-0xd4(%rbp)
mov    -0xd0(%rbp),%eax
mov    %eax,-0xd8(%rbp)
cmpl   $0x1,-0xc8(%rbp)
jne    140d <berlekamp+0x2dd>
mov    -0xc0(%rbp),%eax
xor    -0xc4(%rbp),%eax
mov    %eax,-0xc4(%rbp)
mov    -0x2c(%rbp),%eax
xor    -0xd0(%rbp),%eax
mov    %eax,-0xd0(%rbp)
mov    -0xc4(%rbp),%eax
shl    $0x1,%eax
and    $0x3fff,%eax
mov    %eax,-0xc4(%rbp)
cmpl   $0x1,-0xcc(%rbp)
jne    1451 <berlekamp+0x321>
mov    -0xd4(%rbp),%eax
mov    %eax,-0xc0(%rbp)
mov    -0xd8(%rbp),%eax
mov    %eax,-0x2c(%rbp)
xor    %eax,%eax
sub    -0xb8(%rbp),%eax
mov    %eax,-0xb8(%rbp)
mov    -0x2c(%rbp),%eax
shr    $0x1,%eax
mov    %eax,-0x2c(%rbp)
mov    -0xb8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0xb8(%rbp)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1339 <berlekamp+0x209>
movl   $0x0,-0x1c(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x28(%rbp)
mov    %al,-0xdf(%rbp)
je     14a4 <berlekamp+0x374>
mov    -0x1c(%rbp),%eax
mov    -0x20(%rbp),%ecx
add    $0x1,%ecx
cmp    %ecx,%eax
setle  %al
mov    %al,-0xdf(%rbp)
mov    -0xdf(%rbp),%al
test   $0x1,%al
jne    14b7 <berlekamp+0x387>
jmp    15bf <berlekamp+0x48f>
mov    -0x28(%rbp),%edi
movslq -0x1c(%rbp),%rax
mov    -0xb0(%rbp,%rax,4),%esi
call   1050 <mpy_mod_gf@plt>
mov    %eax,-0xdc(%rbp)
mov    -0x1c(%rbp),%esi
mov    -0x24(%rbp),%edx
mov    -0xdc(%rbp),%ecx
lea    0xb6c(%rip),%rdi
mov    $0x0,%al
call   1040 <pr_debug@plt>
movslq -0x1c(%rbp),%rax
mov    -0x70(%rbp,%rax,4),%eax
xor    -0xdc(%rbp),%eax
mov    %eax,-0xb4(%rbp)
mov    -0x24(%rbp),%eax
shl    $0x1,%eax
mov    -0x20(%rbp),%ecx
add    $0x1,%ecx
cmp    %ecx,%eax
jae    1517 <berlekamp+0x3e7>
jmp    1540 <berlekamp+0x410>
mov    -0xb4(%rbp),%ecx
movslq -0x1c(%rbp),%rax
mov    %ecx,-0x70(%rbp,%rax,4)
mov    -0x1c(%rbp),%eax
mov    -0x20(%rbp),%ecx
add    $0x1,%ecx
cmp    %ecx,%eax
jne    153b <berlekamp+0x40b>
jmp    15bf <berlekamp+0x48f>
jmp    1540 <berlekamp+0x410>
movslq -0x1c(%rbp),%rax
mov    -0x70(%rbp,%rax,4),%edi
mov    -0x2c(%rbp),%esi
call   1050 <mpy_mod_gf@plt>
mov    %eax,%ecx
movslq -0x1c(%rbp),%rax
mov    %ecx,-0xb0(%rbp,%rax,4)
mov    -0x1c(%rbp),%esi
mov    -0x24(%rbp),%edx
movslq -0x1c(%rbp),%rax
mov    -0xb0(%rbp,%rax,4),%ecx
lea    0xaf3(%rip),%rdi
mov    $0x0,%al
call   1040 <pr_debug@plt>
mov    -0xb4(%rbp),%ecx
movslq -0x1c(%rbp),%rax
mov    %ecx,-0x70(%rbp,%rax,4)
mov    -0x1c(%rbp),%eax
mov    -0x20(%rbp),%ecx
add    $0x1,%ecx
cmp    %ecx,%eax
jne    15ac <berlekamp+0x47c>
mov    -0x20(%rbp),%eax
sub    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    15bf <berlekamp+0x48f>
jmp    15b1 <berlekamp+0x481>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    147e <berlekamp+0x34e>
movl   $0x0,-0x1c(%rbp)
cmpl   $0xf,-0x1c(%rbp)
jge    1600 <berlekamp+0x4d0>
mov    $0xe,%eax
sub    -0x1c(%rbp),%eax
cltq
mov    -0xb0(%rbp,%rax,4),%ecx
mov    $0xf,%eax
sub    -0x1c(%rbp),%eax
cltq
mov    %ecx,-0xb0(%rbp,%rax,4)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    15c6 <berlekamp+0x496>
movl   $0x0,-0xb0(%rbp)
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    122c <berlekamp+0xfc>
movl   $0x0,-0x1c(%rbp)
cmpl   $0x8,-0x1c(%rbp)
jge    164e <berlekamp+0x51e>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
cltq
mov    -0x70(%rbp,%rax,4),%edx
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    %edx,(%rax,%rcx,4)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    161f <berlekamp+0x4ef>
lea    0xa2c(%rip),%rdi
mov    $0x0,%al
call   1040 <pr_debug@plt>
movl   $0x0,-0x1c(%rbp)
cmpl   $0x8,-0x1c(%rbp)
jge    1694 <berlekamp+0x564>
mov    -0x18(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,4),%esi
lea    0xa0e(%rip),%rdi
mov    $0x0,%al
call   1040 <pr_debug@plt>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    1663 <berlekamp+0x533>
mov    -0x24(%rbp),%eax
add    $0xe0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<berlekamp>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xc8,%rsp
mov    %rdx,0x28(%rsp)
mov    %rsi,0x38(%rsp)
xorps  %xmm0,%xmm0
movaps %xmm0,0x40(%rsp)
movaps %xmm0,0x70(%rsp)
movaps %xmm0,0x60(%rsp)
movaps %xmm0,0x50(%rsp)
movaps %xmm0,0x80(%rsp)
movaps %xmm0,0x90(%rsp)
movaps %xmm0,0xa0(%rsp)
movaps %xmm0,0xb0(%rsp)
movl   $0x1,0x80(%rsp)
movl   $0x1,0x44(%rsp)
lea    0x8(,%rdi,8),%eax
test   %eax,%eax
je     1424 <berlekamp+0x304>
lea    0x4(,%rdi,4),%ecx
mov    %ecx,0x10(%rsp)
mov    %eax,%eax
mov    %rax,0x30(%rsp)
lea    0xe6e(%rip),%r15
xor    %ebx,%ebx
xor    %r13d,%r13d
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
lea    0xe39(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
call   1030 <pr_debug@plt>
lea    0x1(%r13),%r14d
mov    0x38(%rsp),%rax
mov    %rbx,0x8(%rsp)
lea    (%rax,%rbx,4),%rbx
xor    %ebp,%ebp
xor    %r12d,%r12d
nopw   0x0(%rax,%rax,1)
mov    0x80(%rsp,%rbp,4),%edi
mov    (%rbx),%esi
call   1040 <mpy_mod_gf@plt>
xor    %eax,%r12d
mov    %r15,%rdi
mov    %ebp,%esi
mov    %r13d,%edx
mov    %eax,%ecx
xor    %eax,%eax
call   1030 <pr_debug@plt>
add    $0x1,%rbp
add    $0xfffffffffffffffc,%rbx
cmp    %rbp,%r14
jne    11f0 <berlekamp+0xd0>
test   %r12d,%r12d
je     13b0 <berlekamp+0x290>
mov    %r12,0x18(%rsp)
lea    (%r12,%r12,1),%ebx
xor    %r14d,%r14d
mov    $0x1,%r12d
mov    $0x201b,%r15d
mov    $0x2000,%eax
mov    $0xffffffff,%ebp
mov    $0xffffffff,%ecx
mov    %r13,0x20(%rsp)
mov    %ecx,%r13d
nopw   0x0(%rax,%rax,1)
mov    %ecx,0x14(%rsp)
mov    %eax,(%rsp)
add    $0x1,%ebp
lea    0xdc3(%rip),%rdi
mov    %ebp,%esi
mov    0x20(%rsp),%rdx
xor    %eax,%eax
call   1030 <pr_debug@plt>
mov    %ebx,%edx
shr    $0xd,%edx
and    %r12d,%edx
mov    %ebx,%eax
shl    $0x12,%eax
sar    $0x1f,%eax
mov    %edx,%esi
and    $0x1,%esi
xor    %ecx,%ecx
mov    0x14(%rsp),%r8d
test   %r8d,%r8d
sete   %cl
xor    %r12d,%ecx
xor    %esi,%ecx
mov    %eax,%esi
and    %r15d,%esi
xor    %ebx,%esi
and    %r14d,%eax
mov    (%rsp),%edi
xor    %edi,%eax
add    %esi,%esi
and    $0x3ffe,%esi
neg    %r13d
test   $0x1,%dl
cmovne %edi,%r14d
cmove  %r8d,%r13d
cmovne %ebx,%r15d
shr    %r14d
add    $0xffffffff,%r13d
mov    %esi,%ebx
mov    %ecx,%r12d
mov    %r13d,%ecx
cmp    $0x18,%ebp
jb     1260 <berlekamp+0x140>
mov    0x20(%rsp),%r13
mov    0x8(%rsp),%rax
lea    0x1(%rax),%rbx
mov    0x18(%rsp),%rdi
test   %edi,%edi
je     13d2 <berlekamp+0x2b2>
lea    0x0(%r13,%r13,1),%r12d
mov    %rbx,(%rsp)
mov    %ebx,%ebx
xor    %esi,%esi
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
call   1040 <mpy_mod_gf@plt>
mov    %eax,%r15d
lea    0xd20(%rip),%rdi
mov    %ebp,%esi
mov    %r13d,%edx
mov    %eax,%ecx
xor    %eax,%eax
call   1030 <pr_debug@plt>
mov    0x80(%rsp,%rbp,4),%edi
xor    %edi,%r15d
cmp    %r12,0x8(%rsp)
jae    135e <berlekamp+0x23e>
mov    %r15d,0x80(%rsp,%rbp,4)
mov    %r15d,%edi
cmp    %rbp,%rbx
je     13c0 <berlekamp+0x2a0>
mov    %r14d,%esi
call   1040 <mpy_mod_gf@plt>
mov    %eax,0x40(%rsp,%rbp,4)
lea    0xcf7(%rip),%rdi
mov    %ebp,%esi
mov    %r13d,%edx
mov    %eax,%ecx
xor    %eax,%eax
call   1030 <pr_debug@plt>
mov    %r15d,0x80(%rsp,%rbp,4)
cmp    %rbp,%rbx
je     13c6 <berlekamp+0x2a6>
cmp    0x8(%rsp),%rbp
ja     13c0 <berlekamp+0x2a0>
mov    0x44(%rsp,%rbp,4),%esi
add    $0x1,%rbp
mov    0x18(%rsp),%rdi
jmp    1320 <berlekamp+0x200>
cs nopw 0x0(%rax,%rax,1)
nop
mov    0x8(%rsp),%rbx
add    $0x1,%rbx
jmp    13d9 <berlekamp+0x2b9>
nopl   0x0(%rax,%rax,1)
mov    (%rsp),%rbx
jmp    13d2 <berlekamp+0x2b2>
mov    (%rsp),%rbx
mov    %ebx,%eax
sub    %r13d,%eax
mov    %eax,%r13d
lea    0xc42(%rip),%r15
movaps 0x40(%rsp),%xmm0
movaps 0x50(%rsp),%xmm1
movaps 0x60(%rsp),%xmm2
mov    0x70(%rsp),%rax
mov    0x78(%rsp),%ecx
lea    0x44(%rsp),%rdx
mov    %ecx,0x38(%rdx)
mov    %rax,0x30(%rdx)
movups %xmm2,0x20(%rdx)
movups %xmm1,0x10(%rdx)
movups %xmm0,(%rdx)
movl   $0x0,0x40(%rsp)
cmp    0x30(%rsp),%rbx
jae    1427 <berlekamp+0x307>
cmp    0x10(%rsp),%r13d
jbe    11c0 <berlekamp+0xa0>
jmp    1427 <berlekamp+0x307>
xor    %r13d,%r13d
movups 0x84(%rsp),%xmm0
movups 0x94(%rsp),%xmm1
mov    0x28(%rsp),%rbx
movups %xmm1,0x10(%rbx)
movups %xmm0,(%rbx)
lea    0xc37(%rip),%rdi
xor    %eax,%eax
call   1030 <pr_debug@plt>
mov    (%rbx),%esi
lea    0xc33(%rip),%rbp
mov    %rbp,%rdi
xor    %eax,%eax
call   1030 <pr_debug@plt>
mov    0x4(%rbx),%esi
mov    %rbp,%rdi
xor    %eax,%eax
call   1030 <pr_debug@plt>
mov    0x8(%rbx),%esi
mov    %rbp,%rdi
xor    %eax,%eax
call   1030 <pr_debug@plt>
mov    0xc(%rbx),%esi
mov    %rbp,%rdi
xor    %eax,%eax
call   1030 <pr_debug@plt>
mov    0x10(%rbx),%esi
mov    %rbp,%rdi
xor    %eax,%eax
call   1030 <pr_debug@plt>
mov    0x14(%rbx),%esi
mov    %rbp,%rdi
xor    %eax,%eax
call   1030 <pr_debug@plt>
mov    0x18(%rbx),%esi
mov    %rbp,%rdi
xor    %eax,%eax
call   1030 <pr_debug@plt>
mov    0x1c(%rbx),%esi
mov    %rbp,%rdi
xor    %eax,%eax
call   1030 <pr_debug@plt>
mov    %r13d,%eax
add    $0xc8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [27 x i8] c"\0AIteration.............%d\0A\00"
@.str.1 = [25 x i8] c"%02d. s=0 LL=%x poly %x\0A\00"
@.str.2 = [27 x i8] c"%02d. s=1 LL=%x poly NULL\0A\00"
@.str.3 = [25 x i8] c"%02d. s=2 LL=%x poly %x\0A\00"
@.str.4 = [25 x i8] c"%02d. s=3 LL=%x poly %x\0A\00"
@.str.5 = [12 x i8] c"\0A Err poly:\00"
@.str.6 = [6 x i8] c"0x%x \00"
define i32 @berlekamp(i32 %0, i32* nocapture %1, i32* nocapture %2) {
%4 = alloca [16 x i32]
%5 = bitcast [16 x i32]* %4 to i8*
%6 = alloca [16 x i32]
%7 = bitcast [16 x i32]* %6 to i8*
%8 = getelementptr inbounds [16 x i32], [16 x i32]* %4, i64 0, i64 0
store i32 1, i32* %8
%9 = getelementptr inbounds [16 x i32], [16 x i32]* %6, i64 0, i64 1
store i32 1, i32* %9
%10 = add i32 %0, 1
%11 = shl i32 %10, 3
%12 = shl i32 %10, 2
%13 = icmp eq i32 %11, 0
br i1 %13, label %18, label %14
14: ; preds = %3
%15 = getelementptr inbounds [16 x i32], [16 x i32]* %6, i64 0, i64 0
%16 = bitcast i32* %9 to i8*
%17 = zext i32 %11 to i64
br label %47
18: ; preds = %139, %3
%19 = phi i32 [ 0, %3 ], [ %141, %139 ]
%20 = bitcast i32* %2 to i8*
%21 = getelementptr inbounds [16 x i32], [16 x i32]* %4, i64 0, i64 1
%22 = bitcast i32* %21 to i8*
%23 = tail call i32 (i8*, ...) @pr_debug(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.5, i64 0, i64 0))
%24 = load i32, i32* %2
%25 = tail call i32 (i8*, ...) @pr_debug(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0), i32 %24)
%26 = getelementptr inbounds i32, i32* %2, i64 1
%27 = load i32, i32* %26
%28 = tail call i32 (i8*, ...) @pr_debug(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0), i32 %27)
%29 = getelementptr inbounds i32, i32* %2, i64 2
%30 = load i32, i32* %29
%31 = tail call i32 (i8*, ...) @pr_debug(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0), i32 %30)
%32 = getelementptr inbounds i32, i32* %2, i64 3
%33 = load i32, i32* %32
%34 = tail call i32 (i8*, ...) @pr_debug(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0), i32 %33)
%35 = getelementptr inbounds i32, i32* %2, i64 4
%36 = load i32, i32* %35
%37 = tail call i32 (i8*, ...) @pr_debug(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0), i32 %36)
%38 = getelementptr inbounds i32, i32* %2, i64 5
%39 = load i32, i32* %38
%40 = tail call i32 (i8*, ...) @pr_debug(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0), i32 %39)
%41 = getelementptr inbounds i32, i32* %2, i64 6
%42 = load i32, i32* %41
%43 = tail call i32 (i8*, ...) @pr_debug(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0), i32 %42)
%44 = getelementptr inbounds i32, i32* %2, i64 7
%45 = load i32, i32* %44
%46 = tail call i32 (i8*, ...) @pr_debug(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.6, i64 0, i64 0), i32 %45)
ret i32 %19
47: ; preds = %14, %139
%48 = phi i64 [ 0, %14 ], [ %140, %139 ]
%49 = phi i32 [ 0, %14 ], [ %141, %139 ]
%50 = trunc i64 %48 to i32
%51 = tail call i32 (i8*, ...) @pr_debug(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i32 %50)
%52 = add i32 %49, 1
%53 = zext i32 %52 to i64
br label %54
54: ; preds = %47, %54
%55 = phi i64 [ 0, %47 ], [ %66, %54 ]
%56 = phi i32 [ 0, %47 ], [ %63, %54 ]
%57 = getelementptr inbounds [16 x i32], [16 x i32]* %4, i64 0, i64 %55
%58 = load i32, i32* %57
%59 = sub nsw i64 %48, %55
%60 = getelementptr inbounds i32, i32* %1, i64 %59
%61 = load i32, i32* %60
%62 = tail call i32 @mpy_mod_gf(i32 %58, i32 %61)
%63 = xor i32 %62, %56
%64 = trunc i64 %55 to i32
%65 = tail call i32 (i8*, ...) @pr_debug(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0), i32 %64, i32 %49, i32 %62)
%66 = add nuw nsw i64 %55, 1
%67 = icmp eq i64 %66, %53
br i1 %67, label %68, label %54
68: ; preds = %54
%69 = icmp eq i32 %63, 0
br i1 %69, label %70, label %72
70: ; preds = %68
%71 = add nuw nsw i64 %48, 1
br label %139
72: ; preds = %68
%73 = shl i32 %63, 1
br label %82
74: ; preds = %82
%75 = add nuw nsw i64 %48, 1
br i1 %69, label %139, label %76
76: ; preds = %74
%77 = shl i32 %49, 1
%78 = zext i32 %77 to i64
%79 = icmp ult i64 %48, %78
%80 = trunc i64 %75 to i32
%81 = and i64 %75, 4294967295
br label %120
82: ; preds = %72, %82
%83 = phi i32 [ %102, %82 ], [ 8192, %72 ]
%84 = phi i32 [ %104, %82 ], [ %73, %72 ]
%85 = phi i32 [ %109, %82 ], [ 8219, %72 ]
%86 = phi i32 [ %97, %82 ], [ 1, %72 ]
%87 = phi i32 [ %111, %82 ], [ -1, %72 ]
%88 = phi i32 [ %110, %82 ], [ 0, %72 ]
%89 = phi i32 [ %112, %82 ], [ 0, %72 ]
%90 = tail call i32 (i8*, ...) @pr_debug(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.2, i64 0, i64 0), i32 %89, i32 %49)
%91 = lshr i32 %84, 13
%92 = and i32 %91, 1
%93 = and i32 %92, %86
%94 = icmp eq i32 %87, 0
%95 = zext i1 %94 to i32
%96 = xor i32 %86, %95
%97 = xor i32 %96, %93
%98 = icmp eq i32 %92, 0
%99 = select i1 %98, i32 0, i32 %85
%100 = xor i32 %99, %84
%101 = select i1 %98, i32 0, i32 %88
%102 = xor i32 %101, %83
%103 = shl i32 %100, 1
%104 = and i32 %103, 16382
%105 = icmp eq i32 %93, 1
%106 = sub nsw i32 0, %87
%107 = select i1 %105, i32 %83, i32 %88
%108 = select i1 %105, i32 %106, i32 %87
%109 = select i1 %105, i32 %84, i32 %85
%110 = lshr i32 %107, 1
%111 = add nsw i32 %108, -1
%112 = add nuw nsw i32 %89, 1
%113 = icmp ult i32 %89, 24
br i1 %113, label %82, label %74
114: ; preds = %132
%115 = add nuw nsw i64 %122, 1
%116 = icmp ugt i64 %122, %48
br i1 %116, label %139, label %117
117: ; preds = %114
%118 = getelementptr inbounds [16 x i32], [16 x i32]* %6, i64 0, i64 %115
%119 = load i32, i32* %118
br label %120
120: ; preds = %117, %76
%121 = phi i32 [ 0, %76 ], [ %119, %117 ]
%122 = phi i64 [ 0, %76 ], [ %115, %117 ]
%123 = getelementptr inbounds [16 x i32], [16 x i32]* %6, i64 0, i64 %122
%124 = tail call i32 @mpy_mod_gf(i32 %63, i32 %121)
%125 = trunc i64 %122 to i32
%126 = tail call i32 (i8*, ...) @pr_debug(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.3, i64 0, i64 0), i32 %125, i32 %49, i32 %124)
%127 = getelementptr inbounds [16 x i32], [16 x i32]* %4, i64 0, i64 %122
%128 = load i32, i32* %127
%129 = xor i32 %128, %124
br i1 %79, label %130, label %132
130: ; preds = %120
store i32 %129, i32* %127
%131 = icmp eq i64 %122, %81
br i1 %131, label %139, label %132
132: ; preds = %130, %120
%133 = phi i32 [ %129, %130 ], [ %128, %120 ]
%134 = tail call i32 @mpy_mod_gf(i32 %133, i32 %110)
store i32 %134, i32* %123
%135 = tail call i32 (i8*, ...) @pr_debug(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.4, i64 0, i64 0), i32 %125, i32 %49, i32 %134)
store i32 %129, i32* %127
%136 = icmp eq i64 %122, %81
br i1 %136, label %137, label %114
137: ; preds = %132
%138 = sub i32 %80, %49
br label %139
139: ; preds = %114, %130, %70, %74, %137
%140 = phi i64 [ %75, %137 ], [ %75, %74 ], [ %71, %70 ], [ %75, %130 ], [ %75, %114 ]
%141 = phi i32 [ %138, %137 ], [ %49, %74 ], [ %49, %70 ], [ %49, %130 ], [ %49, %114 ]
store i32 0, i32* %15
%142 = icmp uge i64 %140, %17
%143 = icmp ugt i32 %141, %12
%144 = select i1 %142, i1 true, i1 %143
br i1 %144, label %18, label %47
}