#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 calcdis_s(unsigned char *, int);
scalar_t__ calclen_df(int, int);
scalar_t__ calclen_l0a(int, int);
scalar_t__ calclen_l1a(int);
scalar_t__ calclen_l1b(int);
int /*<<< orphan*/ flushb0();
int /*<<< orphan*/ free(unsigned char *);
unsigned char *get_subbuf(unsigned char *, int *, int *, int *);
int get_subbuflen(unsigned char *, int *, int);
unsigned char *malloc(int);
int /*<<< orphan*/ putbc(unsigned char, int);
int /*<<< orphan*/ putnum_df(int, int);
int /*<<< orphan*/ putnum_l0a(int, int);
int /*<<< orphan*/ putnum_l1a(int);
int /*<<< orphan*/ putnum_l1b(int);
int /*<<< orphan*/ putnum_s8(int);
int search0a(int, unsigned char *, unsigned char *, int, int *, int *);
int lzcompress_tek0(int prm, unsigned char *buf, int k, int i, int outlimit,
                    int maxdis) {
  unsigned char *subbuf, *subbuf0, *subbuf1;
  int len, maxlen, srchloglen = -1, srchlogdis = 0;
  int range, distance, dis_s;
  int i0, j, z, z0;
  static int table[10] = {-8,
                          -2 * 1024,
                          -128 * 1024,
                          -16 * 1024 * 1024,
                          -2 * 1024 * 1024 * 1024,
                          -0x7fffffff,
                          -0x7fffffff,
                          -0x7fffffff,
                          -0x7fffffff,
                          -0x7fffffff};
  int t, l, d, ii, ii0;
  z0 = ii0 = 0;
  subbuf0 = malloc(((16 * 1024 * 1024) * 4 / 4));
  subbuf = subbuf0;
  while (i < k) {
    if (i == 0)
      len = 0;
    else {
      range = i - maxdis;
      if (range < 0)
        range = 0;
      maxlen = k - i;
      len = srchloglen;
      distance = srchlogdis;
      if ((len = srchloglen) < 0)
        len = search0a(prm, buf + i, buf + range, maxlen, &distance, table);
      srchloglen = -1;
      if (len >= 2) {
        range = i + 1 - maxdis;
        if (range < 0)
          range = 0;
        srchloglen = search0a(prm, buf + i + 1, buf + range, maxlen - 1,
                              &srchlogdis, table);
        if (len < srchloglen) {
          len = 0;
          if (i >= 8) {
            for (distance = -1; distance <= -8; distance--) {
              if (buf[i] == buf[i + distance]) {
                len = 1;
                break;
              }
            }
          }
        }
      }
    }
    if (len < 1) {
      subbuf[0] = 0x01;
      i++;
      subbuf++;
    } else {
      i += len;
      if (len >= 2)
        srchloglen = -1;
      subbuf[0] = 0x13;
      subbuf1 = subbuf;
      subbuf[1] = len & 0xff;
      subbuf += 2;
      if (len > 255) {
        subbuf[0] = (len >> 8) & 0xff;
        subbuf[1] = (len >> 16) & 0xff;
        subbuf[2] = (len >> 24) & 0xff;
        subbuf += 3;
        *subbuf1 = 0x36;
      }
      *subbuf++ = distance & 0xff;
      if (distance < -256) {
        subbuf[0] = (distance >> 8) & 0xff;
        subbuf[1] = (distance >> 16) & 0xff;
        subbuf[2] = (distance >> 24) & 0xff;
        subbuf += 3;
        *subbuf1 += 0x43;
      }
    }
  }
  *subbuf = 0x00;
  i0 = 0x7fffffff;
  for (z = 0; z < 16; z++) {
    for (ii = 0; ii < 2; ii++) {
      for (j = 0; j < 4; j++) {
        dis_s = calcdis_s(subbuf0, j);
        subbuf = subbuf0;
        len = 0;
        for (;;) {
          srchloglen = get_subbuflen(subbuf, &t, j);
          if (srchloglen == 0)
            break;
          len += calclen_l0a(srchloglen, z & 0x03);
          do {
            subbuf = get_subbuf(subbuf, &t, &d, &l);
            if (t == 0x01) {
              len += 8;
              srchloglen--;
            } else {
              len += 8 * l;
              srchloglen -= l;
            }
          } while (srchloglen);
          srchloglen = get_subbuflen(subbuf, &t, j);
          if (srchloglen == 0)
            break;
          len += calclen_l0a(srchloglen, z >> 2);
          do {
            subbuf = get_subbuf(subbuf, &t, &d, &l);
            len += calclen_df(d, dis_s);
            if (ii == 0)
              len += calclen_l1a(l - j);
            else
              len += calclen_l1b(l - j);
          } while (--srchloglen);
        }
        if (i0 > len) {
          i0 = len;
          i = j;
          ii0 = ii;
          z0 = z;
        }
      }
    }
  }
  dis_s = calcdis_s(subbuf0, i);
  putnum_s8(dis_s);
  putbc(i, 0x2);
  putbc(ii0, 0x1);
  putbc(z0, 0x2);
  putbc(z0 >> 2, 0x2);
  subbuf = subbuf0;
  j = 0;
  for (;;) {
    srchloglen = get_subbuflen(subbuf, &t, i);
    if (srchloglen == 0)
      break;
    putnum_l0a(srchloglen, z0 & 0x03);
    do {
      subbuf = get_subbuf(subbuf, &t, &d, &l);
      if (t == 0x01)
        l = 1;
      do {
        putbc(buf[j], 0x80);
        j++;
        srchloglen--;
        l--;
      } while (l);
    } while (srchloglen);
    srchloglen = get_subbuflen(subbuf, &t, i);
    if (srchloglen == 0)
      break;
    putnum_l0a(srchloglen, z0 >> 2);
    do {
      subbuf = get_subbuf(subbuf, &t, &d, &l);
      putnum_df(d, dis_s);
      if (ii0 == 0)
        putnum_l1a(l - i);
      else
        putnum_l1b(l - i);
      j += l;
    } while (--srchloglen);
  }
  flushb0();
  free(subbuf0);
  return k;
}


x86 assembly (clang, -O0):
<lzcompress_tek0>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    %r8d,-0x1c(%rbp)
mov    %r9d,-0x20(%rbp)
movl   $0xffffffff,-0x44(%rbp)
movl   $0x0,-0x48(%rbp)
movl   $0x0,-0x78(%rbp)
movl   $0x0,-0x64(%rbp)
mov    $0x1000000,%edi
call   10d0 <malloc@plt>
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x18(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    152c <lzcompress_tek0+0x31c>
cmpl   $0x0,-0x18(%rbp)
jne    1284 <lzcompress_tek0+0x74>
movl   $0x0,-0x3c(%rbp)
jmp    13db <lzcompress_tek0+0x1cb>
mov    -0x18(%rbp),%eax
sub    -0x20(%rbp),%eax
mov    %eax,-0x4c(%rbp)
cmpl   $0x0,-0x4c(%rbp)
jge    129e <lzcompress_tek0+0x8e>
movl   $0x0,-0x4c(%rbp)
mov    -0x14(%rbp),%eax
sub    -0x18(%rbp),%eax
mov    %eax,-0x40(%rbp)
mov    -0x44(%rbp),%eax
mov    %eax,-0x3c(%rbp)
mov    -0x48(%rbp),%eax
mov    %eax,-0x50(%rbp)
mov    -0x44(%rbp),%eax
mov    %eax,-0x3c(%rbp)
cmp    $0x0,%eax
jge    12f1 <lzcompress_tek0+0xe1>
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
movslq -0x18(%rbp),%rax
add    %rax,%rsi
mov    -0x10(%rbp),%rdx
movslq -0x4c(%rbp),%rax
add    %rax,%rdx
mov    -0x40(%rbp),%ecx
lea    -0x50(%rbp),%r8
lea    0x2dc7(%rip),%r9
call   1120 <search0a@plt>
mov    %eax,-0x3c(%rbp)
movl   $0xffffffff,-0x44(%rbp)
cmpl   $0x2,-0x3c(%rbp)
jl     13d6 <lzcompress_tek0+0x1c6>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
sub    -0x20(%rbp),%eax
mov    %eax,-0x4c(%rbp)
cmpl   $0x0,-0x4c(%rbp)
jge    131f <lzcompress_tek0+0x10f>
movl   $0x0,-0x4c(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x10(%rbp),%rsi
movslq -0x18(%rbp),%rax
add    %rax,%rsi
add    $0x1,%rsi
mov    -0x10(%rbp),%rdx
movslq -0x4c(%rbp),%rax
add    %rax,%rdx
mov    -0x40(%rbp),%ecx
sub    $0x1,%ecx
lea    -0x48(%rbp),%r8
lea    0x2d63(%rip),%r9
call   1120 <search0a@plt>
mov    %eax,-0x44(%rbp)
mov    -0x3c(%rbp),%eax
cmp    -0x44(%rbp),%eax
jge    13d1 <lzcompress_tek0+0x1c1>
movl   $0x0,-0x3c(%rbp)
cmpl   $0x8,-0x18(%rbp)
jl     13cc <lzcompress_tek0+0x1bc>
movl   $0xffffffff,-0x50(%rbp)
cmpl   $0xfffffff8,-0x50(%rbp)
jg     13c7 <lzcompress_tek0+0x1b7>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
movzbl (%rax,%rcx,1),%eax
mov    -0x10(%rbp),%rcx
mov    -0x18(%rbp),%edx
add    -0x50(%rbp),%edx
movslq %edx,%rdx
movzbl (%rcx,%rdx,1),%ecx
cmp    %ecx,%eax
jne    13b4 <lzcompress_tek0+0x1a4>
movl   $0x1,-0x3c(%rbp)
jmp    13c7 <lzcompress_tek0+0x1b7>
jmp    13b9 <lzcompress_tek0+0x1a9>
mov    -0x50(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x50(%rbp)
jmp    1379 <lzcompress_tek0+0x169>
jmp    13cc <lzcompress_tek0+0x1bc>
jmp    13d1 <lzcompress_tek0+0x1c1>
jmp    13d6 <lzcompress_tek0+0x1c6>
jmp    13db <lzcompress_tek0+0x1cb>
cmpl   $0x1,-0x3c(%rbp)
jge    1406 <lzcompress_tek0+0x1f6>
mov    -0x28(%rbp),%rax
movb   $0x1,(%rax)
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
mov    -0x28(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x28(%rbp)
jmp    1527 <lzcompress_tek0+0x317>
mov    -0x3c(%rbp),%eax
add    -0x18(%rbp),%eax
mov    %eax,-0x18(%rbp)
cmpl   $0x2,-0x3c(%rbp)
jl     1420 <lzcompress_tek0+0x210>
movl   $0xffffffff,-0x44(%rbp)
mov    -0x28(%rbp),%rax
movb   $0x13,(%rax)
mov    -0x28(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x3c(%rbp),%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x28(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x28(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x28(%rbp)
cmpl   $0xff,-0x3c(%rbp)
jle    14a7 <lzcompress_tek0+0x297>
mov    -0x3c(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x28(%rbp),%rax
mov    %cl,(%rax)
mov    -0x3c(%rbp),%eax
sar    $0x10,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x28(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x3c(%rbp),%eax
sar    $0x18,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x28(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0x28(%rbp),%rax
add    $0x3,%rax
mov    %rax,-0x28(%rbp)
mov    -0x38(%rbp),%rax
movb   $0x36,(%rax)
mov    -0x50(%rbp),%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x28(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x28(%rbp)
mov    %cl,(%rax)
cmpl   $0xffffff00,-0x50(%rbp)
jge    1522 <lzcompress_tek0+0x312>
mov    -0x50(%rbp),%eax
sar    $0x8,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x28(%rbp),%rax
mov    %cl,(%rax)
mov    -0x50(%rbp),%eax
sar    $0x10,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x28(%rbp),%rax
mov    %cl,0x1(%rax)
mov    -0x50(%rbp),%eax
sar    $0x18,%eax
and    $0xff,%eax
mov    %al,%cl
mov    -0x28(%rbp),%rax
mov    %cl,0x2(%rax)
mov    -0x28(%rbp),%rax
add    $0x3,%rax
mov    %rax,-0x28(%rbp)
mov    -0x38(%rbp),%rax
movzbl (%rax),%ecx
add    $0x43,%ecx
mov    %cl,(%rax)
jmp    1527 <lzcompress_tek0+0x317>
jmp    1262 <lzcompress_tek0+0x52>
mov    -0x28(%rbp),%rax
movb   $0x0,(%rax)
movl   $0x7fffffff,-0x58(%rbp)
movl   $0x0,-0x60(%rbp)
cmpl   $0x10,-0x60(%rbp)
jge    174e <lzcompress_tek0+0x53e>
movl   $0x0,-0x74(%rbp)
cmpl   $0x2,-0x74(%rbp)
jge    173b <lzcompress_tek0+0x52b>
movl   $0x0,-0x5c(%rbp)
cmpl   $0x4,-0x5c(%rbp)
jge    1728 <lzcompress_tek0+0x518>
mov    -0x30(%rbp),%rdi
mov    -0x5c(%rbp),%esi
call   10a0 <calcdis_s@plt>
mov    %eax,-0x54(%rbp)
mov    -0x30(%rbp),%rax
mov    %rax,-0x28(%rbp)
movl   $0x0,-0x3c(%rbp)
mov    -0x28(%rbp),%rdi
mov    -0x5c(%rbp),%edx
lea    -0x68(%rbp),%rsi
call   10c0 <get_subbuflen@plt>
mov    %eax,-0x44(%rbp)
cmpl   $0x0,-0x44(%rbp)
jne    15ad <lzcompress_tek0+0x39d>
jmp    16f1 <lzcompress_tek0+0x4e1>
mov    -0x44(%rbp),%edi
mov    -0x60(%rbp),%esi
and    $0x3,%esi
call   1030 <calclen_l0a@plt>
mov    %rax,%rcx
movslq -0x3c(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x3c(%rbp)
mov    -0x28(%rbp),%rdi
lea    -0x68(%rbp),%rsi
lea    -0x70(%rbp),%rdx
lea    -0x6c(%rbp),%rcx
call   1130 <get_subbuf@plt>
mov    %rax,-0x28(%rbp)
cmpl   $0x1,-0x68(%rbp)
jne    1602 <lzcompress_tek0+0x3f2>
mov    -0x3c(%rbp),%eax
add    $0x8,%eax
mov    %eax,-0x3c(%rbp)
mov    -0x44(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x44(%rbp)
jmp    1619 <lzcompress_tek0+0x409>
mov    -0x6c(%rbp),%eax
shl    $0x3,%eax
add    -0x3c(%rbp),%eax
mov    %eax,-0x3c(%rbp)
mov    -0x6c(%rbp),%ecx
mov    -0x44(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x44(%rbp)
jmp    161e <lzcompress_tek0+0x40e>
cmpl   $0x0,-0x44(%rbp)
jne    15c8 <lzcompress_tek0+0x3b8>
mov    -0x28(%rbp),%rdi
mov    -0x5c(%rbp),%edx
lea    -0x68(%rbp),%rsi
call   10c0 <get_subbuflen@plt>
mov    %eax,-0x44(%rbp)
cmpl   $0x0,-0x44(%rbp)
jne    164a <lzcompress_tek0+0x43a>
jmp    16f1 <lzcompress_tek0+0x4e1>
mov    -0x44(%rbp),%edi
mov    -0x60(%rbp),%esi
sar    $0x2,%esi
call   1030 <calclen_l0a@plt>
mov    %rax,%rcx
movslq -0x3c(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x3c(%rbp)
mov    -0x28(%rbp),%rdi
lea    -0x68(%rbp),%rsi
lea    -0x70(%rbp),%rdx
lea    -0x6c(%rbp),%rcx
call   1130 <get_subbuf@plt>
mov    %rax,-0x28(%rbp)
mov    -0x70(%rbp),%edi
mov    -0x54(%rbp),%esi
call   1090 <calclen_df@plt>
mov    %rax,%rcx
movslq -0x3c(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x3c(%rbp)
cmpl   $0x0,-0x74(%rbp)
jne    16bd <lzcompress_tek0+0x4ad>
mov    -0x6c(%rbp),%edi
sub    -0x5c(%rbp),%edi
call   10f0 <calclen_l1a@plt>
mov    %rax,%rcx
movslq -0x3c(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x3c(%rbp)
jmp    16d5 <lzcompress_tek0+0x4c5>
mov    -0x6c(%rbp),%edi
sub    -0x5c(%rbp),%edi
call   1080 <calclen_l1b@plt>
mov    %rax,%rcx
movslq -0x3c(%rbp),%rax
add    %rcx,%rax
mov    %eax,-0x3c(%rbp)
jmp    16da <lzcompress_tek0+0x4ca>
mov    -0x44(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x44(%rbp)
cmp    $0x0,%eax
jne    1665 <lzcompress_tek0+0x455>
jmp    158b <lzcompress_tek0+0x37b>
mov    -0x58(%rbp),%eax
cmp    -0x3c(%rbp),%eax
jle    1715 <lzcompress_tek0+0x505>
mov    -0x3c(%rbp),%eax
mov    %eax,-0x58(%rbp)
mov    -0x5c(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x74(%rbp),%eax
mov    %eax,-0x78(%rbp)
mov    -0x60(%rbp),%eax
mov    %eax,-0x64(%rbp)
jmp    171a <lzcompress_tek0+0x50a>
mov    -0x5c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x5c(%rbp)
jmp    1563 <lzcompress_tek0+0x353>
jmp    172d <lzcompress_tek0+0x51d>
mov    -0x74(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x74(%rbp)
jmp    1552 <lzcompress_tek0+0x342>
jmp    1740 <lzcompress_tek0+0x530>
mov    -0x60(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x60(%rbp)
jmp    1541 <lzcompress_tek0+0x331>
mov    -0x30(%rbp),%rdi
mov    -0x18(%rbp),%esi
call   10a0 <calcdis_s@plt>
mov    %eax,-0x54(%rbp)
mov    -0x54(%rbp),%edi
call   1100 <putnum_s8@plt>
mov    -0x18(%rbp),%eax
mov    $0x2,%esi
movzbl %al,%edi
call   1060 <putbc@plt>
mov    -0x78(%rbp),%eax
mov    $0x1,%esi
movzbl %al,%edi
call   1060 <putbc@plt>
mov    -0x64(%rbp),%eax
mov    $0x2,%esi
movzbl %al,%edi
call   1060 <putbc@plt>
mov    -0x64(%rbp),%eax
sar    $0x2,%eax
mov    $0x2,%esi
movzbl %al,%edi
call   1060 <putbc@plt>
mov    -0x30(%rbp),%rax
mov    %rax,-0x28(%rbp)
movl   $0x0,-0x5c(%rbp)
mov    -0x28(%rbp),%rdi
mov    -0x18(%rbp),%edx
lea    -0x68(%rbp),%rsi
call   10c0 <get_subbuflen@plt>
mov    %eax,-0x44(%rbp)
cmpl   $0x0,-0x44(%rbp)
jne    17d9 <lzcompress_tek0+0x5c9>
jmp    18f9 <lzcompress_tek0+0x6e9>
mov    -0x44(%rbp),%edi
mov    -0x64(%rbp),%esi
and    $0x3,%esi
call   1040 <putnum_l0a@plt>
mov    -0x28(%rbp),%rdi
lea    -0x68(%rbp),%rsi
lea    -0x70(%rbp),%rdx
lea    -0x6c(%rbp),%rcx
call   1130 <get_subbuf@plt>
mov    %rax,-0x28(%rbp)
cmpl   $0x1,-0x68(%rbp)
jne    1811 <lzcompress_tek0+0x601>
movl   $0x1,-0x6c(%rbp)
jmp    1816 <lzcompress_tek0+0x606>
mov    -0x10(%rbp),%rax
movslq -0x5c(%rbp),%rcx
mov    $0x80,%esi
movzbl (%rax,%rcx,1),%edi
call   1060 <putbc@plt>
mov    -0x5c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x5c(%rbp)
mov    -0x44(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x44(%rbp)
mov    -0x6c(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x6c(%rbp)
cmpl   $0x0,-0x6c(%rbp)
jne    1816 <lzcompress_tek0+0x606>
jmp    1856 <lzcompress_tek0+0x646>
cmpl   $0x0,-0x44(%rbp)
jne    17e7 <lzcompress_tek0+0x5d7>
mov    -0x28(%rbp),%rdi
mov    -0x18(%rbp),%edx
lea    -0x68(%rbp),%rsi
call   10c0 <get_subbuflen@plt>
mov    %eax,-0x44(%rbp)
cmpl   $0x0,-0x44(%rbp)
jne    1882 <lzcompress_tek0+0x672>
jmp    18f9 <lzcompress_tek0+0x6e9>
mov    -0x44(%rbp),%edi
mov    -0x64(%rbp),%esi
sar    $0x2,%esi
call   1040 <putnum_l0a@plt>
mov    -0x28(%rbp),%rdi
lea    -0x68(%rbp),%rsi
lea    -0x70(%rbp),%rdx
lea    -0x6c(%rbp),%rcx
call   1130 <get_subbuf@plt>
mov    %rax,-0x28(%rbp)
mov    -0x70(%rbp),%edi
mov    -0x54(%rbp),%esi
call   1070 <putnum_df@plt>
cmpl   $0x0,-0x78(%rbp)
jne    18ce <lzcompress_tek0+0x6be>
mov    -0x6c(%rbp),%edi
sub    -0x18(%rbp),%edi
call   1110 <putnum_l1a@plt>
jmp    18d9 <lzcompress_tek0+0x6c9>
mov    -0x6c(%rbp),%edi
sub    -0x18(%rbp),%edi
call   10b0 <putnum_l1b@plt>
mov    -0x6c(%rbp),%eax
add    -0x5c(%rbp),%eax
mov    %eax,-0x5c(%rbp)
mov    -0x44(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x44(%rbp)
cmp    $0x0,%eax
jne    1890 <lzcompress_tek0+0x680>
jmp    17b7 <lzcompress_tek0+0x5a7>
mov    $0x0,%al
call   10e0 <flushb0@plt>
mov    -0x30(%rbp),%rdi
call   1050 <free@plt>
mov    -0x14(%rbp),%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<lzcompress_tek0>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x68,%rsp
mov    %r9d,%r14d
mov    %ecx,%ebx
mov    %edx,%r15d
mov    %rsi,%rbp
mov    %edi,0x1c(%rsp)
movl   $0x0,0x54(%rsp)
mov    $0x1000000,%edi
call   10d0 <malloc@plt>
mov    %ebx,%ecx
cmp    %r15d,%ebx
mov    %r15d,0x14(%rsp)
mov    %rax,0x40(%rsp)
mov    %rbp,0x58(%rsp)
jge    1408 <lzcompress_tek0+0x1f8>
mov    %r15d,%esi
lea    0x1(%rbp),%rdx
mov    %rdx,0x30(%rsp)
mov    %rax,%rbp
mov    $0xffffffff,%ebx
mov    %r14d,0x18(%rsp)
jmp    12a0 <lzcompress_tek0+0x90>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %ecx,%r13d
mov    %ebx,%eax
movb   $0x1,0x0(%rbp)
add    $0x1,%r13d
add    $0x1,%rbp
mov    %r13d,%ebx
mov    %ebx,%ecx
mov    %eax,%ebx
cmp    %esi,%ecx
jge    140b <lzcompress_tek0+0x1fb>
test   %ecx,%ecx
je     1280 <lzcompress_tek0+0x70>
mov    %ecx,%r15d
sub    %r14d,%r15d
mov    %esi,%r12d
mov    %ecx,%r13d
sub    %ecx,%r12d
mov    0x54(%rsp),%eax
mov    %eax,0x20(%rsp)
test   %ebx,%ebx
js     1330 <lzcompress_tek0+0x120>
cmp    $0x2,%ebx
jl     1371 <lzcompress_tek0+0x161>
add    $0x1,%r15d
mov    $0x0,%eax
cmovs  %eax,%r15d
mov    %r13d,%r14d
movslq %r13d,%rsi
add    0x30(%rsp),%rsi
add    0x58(%rsp),%r15
add    $0xffffffff,%r12d
mov    0x1c(%rsp),%edi
mov    %r15,%rdx
mov    %r12d,%ecx
lea    0x54(%rsp),%r8
lea    0x2db1(%rip),%r9
call   1120 <search0a@plt>
cmp    %eax,%ebx
jge    138b <lzcompress_tek0+0x17b>
cmp    $0x8,%r14d
jl     131a <lzcompress_tek0+0x10a>
movl   $0xffffffff,0x20(%rsp)
ff
mov    0x14(%rsp),%esi
mov    0x18(%rsp),%r14d
jmp    1285 <lzcompress_tek0+0x75>
nopl   0x0(%rax,%rax,1)
test   %r15d,%r15d
mov    $0x0,%edx
cmovns %r15d,%edx
movslq %r13d,%rsi
mov    0x58(%rsp),%rax
add    %rax,%rsi
add    %rax,%rdx
mov    0x1c(%rsp),%edi
mov    %r12d,%ecx
lea    0x20(%rsp),%r8
lea    0x2d53(%rip),%r9
call   1120 <search0a@plt>
mov    0x14(%rsp),%esi
mov    %eax,%ebx
cmp    $0x2,%ebx
jge    12c8 <lzcompress_tek0+0xb8>
mov    $0xffffffff,%eax
cmp    $0x1,%ebx
jne    1285 <lzcompress_tek0+0x75>
movw   $0x113,0x0(%rbp)
lea    0x2(%rbp),%rcx
jmp    13c4 <lzcompress_tek0+0x1b4>
movb   $0x13,0x0(%rbp)
mov    %bl,0x1(%rbp)
cmp    $0x100,%ebx
jb     13b7 <lzcompress_tek0+0x1a7>
mov    %bh,0x2(%rbp)
mov    %ebx,%eax
shr    $0x10,%eax
mov    %al,0x3(%rbp)
mov    %ebx,%eax
shr    $0x18,%eax
mov    %al,0x4(%rbp)
lea    0x5(%rbp),%rcx
movb   $0x36,0x0(%rbp)
jmp    13bb <lzcompress_tek0+0x1ab>
lea    0x2(%rbp),%rcx
mov    0x14(%rsp),%esi
mov    0x18(%rsp),%r14d
add    %r13d,%ebx
movzbl 0x20(%rsp),%eax
mov    %al,(%rcx)
mov    0x20(%rsp),%edx
mov    $0xffffffff,%eax
cmp    $0xfffffeff,%edx
jg     13fc <lzcompress_tek0+0x1ec>
mov    %dh,0x1(%rcx)
movzbl 0x22(%rsp),%edx
mov    %dl,0x2(%rcx)
movzbl 0x23(%rsp),%edx
mov    %dl,0x3(%rcx)
add    $0x4,%rcx
addb   $0x43,0x0(%rbp)
jmp    1400 <lzcompress_tek0+0x1f0>
add    $0x1,%rcx
mov    %rcx,%rbp
jmp    1294 <lzcompress_tek0+0x84>
mov    %rax,%rbp
mov    %ecx,0x2c(%rsp)
movb   $0x0,0x0(%rbp)
movl   $0x7fffffff,0x50(%rsp)
7f
movl   $0x0,0x3c(%rsp)
lea    0x10(%rsp),%rbp
movl   $0x0,0x28(%rsp)
xor    %eax,%eax
mov    0x40(%rsp),%r15
jmp    1450 <lzcompress_tek0+0x240>
nopl   0x0(%rax)
mov    0x48(%rsp),%eax
add    $0x1,%eax
cmp    $0x10,%eax
je     1625 <lzcompress_tek0+0x415>
mov    %eax,%ecx
and    $0x3,%ecx
mov    %ecx,0x18(%rsp)
mov    %eax,0x48(%rsp)
shr    $0x2,%eax
mov    %eax,0x64(%rsp)
mov    $0x1,%al
mov    %eax,0x30(%rsp)
movl   $0x0,0x4c(%rsp)
jmp    1497 <lzcompress_tek0+0x287>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movl   $0x1,0x4c(%rsp)
testb  $0x1,0x30(%rsp)
movl   $0x0,0x30(%rsp)
je     1440 <lzcompress_tek0+0x230>
xor    %ebx,%ebx
jmp    14ad <lzcompress_tek0+0x29d>
nopl   0x0(%rax,%rax,1)
add    $0x1,%ebx
cmp    $0x4,%ebx
mov    0x40(%rsp),%r15
je     1480 <lzcompress_tek0+0x270>
mov    %r15,%rdi
mov    %ebx,%esi
call   10a0 <calcdis_s@plt>
mov    %eax,0x1c(%rsp)
mov    %r15,%rdi
mov    %rbp,%rsi
mov    %ebx,%r13d
mov    %ebx,%edx
call   10c0 <get_subbuflen@plt>
mov    $0x0,%r14d
test   %eax,%eax
je     15f6 <lzcompress_tek0+0x3e6>
mov    %eax,%r15d
xor    %r14d,%r14d
mov    0x40(%rsp),%r12
jmp    150c <lzcompress_tek0+0x2fc>
cs nopw 0x0(%rax,%rax,1)
mov    %r12,%rdi
mov    %r15,%rbp
mov    %r15,%rsi
mov    %r13d,%edx
call   10c0 <get_subbuflen@plt>
mov    %eax,%r15d
test   %eax,%eax
je     15f6 <lzcompress_tek0+0x3e6>
mov    %r15d,%edi
mov    0x18(%rsp),%esi
call   1030 <calclen_l0a@plt>
mov    %rax,%rbx
add    %r14d,%ebx
jmp    152f <lzcompress_tek0+0x31f>
mov    0xc(%rsp),%eax
lea    (%rbx,%rax,8),%ebx
sub    %eax,%r15d
test   %r15d,%r15d
je     155a <lzcompress_tek0+0x34a>
mov    %r12,%rdi
mov    %rbp,%rsi
lea    0x24(%rsp),%rdx
lea    0xc(%rsp),%rcx
call   1130 <get_subbuf@plt>
mov    %rax,%r12
cmpl   $0x1,0x10(%rsp)
jne    1520 <lzcompress_tek0+0x310>
add    $0x8,%ebx
add    $0xffffffff,%r15d
test   %r15d,%r15d
jne    152f <lzcompress_tek0+0x31f>
mov    %r12,%rdi
mov    %rbp,%r15
mov    %rbp,%rsi
mov    %r13d,%edx
call   10c0 <get_subbuflen@plt>
test   %eax,%eax
je     15f0 <lzcompress_tek0+0x3e0>
mov    %eax,%ebp
mov    %eax,%edi
mov    0x64(%rsp),%esi
call   1030 <calclen_l0a@plt>
add    %eax,%ebx
mov    %ebx,%r14d
jmp    15a1 <lzcompress_tek0+0x391>
nopw   0x0(%rax,%rax,1)
call   1080 <calclen_l1b@plt>
add    %eax,%r14d
add    $0xffffffff,%ebp
je     14f0 <lzcompress_tek0+0x2e0>
mov    %r14d,%ebx
mov    %r12,%rdi
mov    %r15,%rsi
lea    0x24(%rsp),%rdx
lea    0xc(%rsp),%rcx
call   1130 <get_subbuf@plt>
mov    %rax,%r12
mov    0x24(%rsp),%edi
mov    0x1c(%rsp),%esi
call   1090 <calclen_df@plt>
mov    %rax,%r14
add    %ebx,%r14d
mov    0xc(%rsp),%edi
sub    %r13d,%edi
testb  $0x1,0x30(%rsp)
je     1590 <lzcompress_tek0+0x380>
call   10f0 <calclen_l1a@plt>
jmp    1595 <lzcompress_tek0+0x385>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %ebx,%r14d
mov    %r15,%rbp
cmp    %r14d,0x50(%rsp)
mov    %r13d,%ebx
jle    14a0 <lzcompress_tek0+0x290>
mov    %ebx,0x2c(%rsp)
mov    %r14d,%eax
mov    %r14d,0x50(%rsp)
mov    0x48(%rsp),%eax
mov    %eax,0x28(%rsp)
mov    0x4c(%rsp),%eax
mov    %eax,0x3c(%rsp)
jmp    14a0 <lzcompress_tek0+0x290>
mov    %r15,%rdi
mov    0x2c(%rsp),%r14d
mov    %r14d,%esi
call   10a0 <calcdis_s@plt>
mov    %eax,0x1c(%rsp)
mov    %eax,%edi
call   1100 <putnum_s8@plt>
movzbl %r14b,%edi
mov    $0x2,%esi
call   1060 <putbc@plt>
movzbl 0x3c(%rsp),%edi
mov    $0x1,%esi
call   1060 <putbc@plt>
mov    0x28(%rsp),%ebp
movzbl %bpl,%edi
mov    $0x2,%esi
call   1060 <putbc@plt>
sar    $0x2,%ebp
mov    %ebp,0x30(%rsp)
movzbl %bpl,%edi
mov    $0x2,%esi
call   1060 <putbc@plt>
lea    0x10(%rsp),%rsi
mov    %r15,%rdi
mov    %r14d,%edx
call   10c0 <get_subbuflen@plt>
test   %eax,%eax
je     17ce <lzcompress_tek0+0x5be>
mov    %eax,%r14d
andl   $0x3,0x28(%rsp)
xor    %r12d,%r12d
mov    0x40(%rsp),%rbx
jmp    16cb <lzcompress_tek0+0x4bb>
xchg   %ax,%ax
mov    %rbx,%rdi
lea    0x10(%rsp),%rsi
mov    %r14d,%edx
call   10c0 <get_subbuflen@plt>
mov    %eax,%r14d
test   %eax,%eax
je     17ce <lzcompress_tek0+0x5be>
mov    %r14d,%edi
mov    0x28(%rsp),%esi
call   1040 <putnum_l0a@plt>
nopw   0x0(%rax,%rax,1)
mov    %r12d,%r13d
mov    %rbx,%rdi
lea    0x10(%rsp),%rsi
lea    0x24(%rsp),%rdx
lea    0xc(%rsp),%rcx
call   1130 <get_subbuf@plt>
mov    %rax,%rbx
cmpl   $0x1,0x10(%rsp)
jne    170c <lzcompress_tek0+0x4fc>
movl   $0x1,0xc(%rsp)
movslq %r13d,%rbp
add    0x58(%rsp),%rbp
xor    %r15d,%r15d
nopw   0x0(%rax,%rax,1)
movzbl 0x0(%rbp,%r15,1),%edi
mov    $0x80,%esi
call   1060 <putbc@plt>
add    $0x1,%r15
addl   $0xffffffff,0xc(%rsp)
jne    1720 <lzcompress_tek0+0x510>
lea    (%r15,%r13,1),%r12d
sub    %r15d,%r14d
jne    16e0 <lzcompress_tek0+0x4d0>
mov    %rbx,%rdi
lea    0x10(%rsp),%rsi
mov    0x2c(%rsp),%edx
call   10c0 <get_subbuflen@plt>
test   %eax,%eax
je     17ce <lzcompress_tek0+0x5be>
mov    %eax,%ebp
add    %r15d,%r13d
mov    %eax,%edi
mov    0x30(%rsp),%esi
call   1040 <putnum_l0a@plt>
mov    %r13d,%r12d
mov    0x2c(%rsp),%r14d
mov    0x1c(%rsp),%r15d
jmp    1793 <lzcompress_tek0+0x583>
nopl   0x0(%rax,%rax,1)
call   10b0 <putnum_l1b@plt>
add    0xc(%rsp),%r12d
add    $0xffffffff,%ebp
je     16b0 <lzcompress_tek0+0x4a0>
mov    %rbx,%rdi
lea    0x10(%rsp),%rsi
lea    0x24(%rsp),%rdx
lea    0xc(%rsp),%rcx
call   1130 <get_subbuf@plt>
mov    %rax,%rbx
mov    0x24(%rsp),%edi
mov    %r15d,%esi
call   1070 <putnum_df@plt>
mov    0xc(%rsp),%edi
sub    %r14d,%edi
cmpl   $0x0,0x3c(%rsp)
jne    1780 <lzcompress_tek0+0x570>
call   1110 <putnum_l1a@plt>
jmp    1785 <lzcompress_tek0+0x575>
xor    %eax,%eax
call   10e0 <flushb0@plt>
mov    0x40(%rsp),%rdi
call   1050 <free@plt>
mov    0x14(%rsp),%eax
add    $0x68,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@lzcompress_tek0.table = internal global [10 x i32] [i32 -8, i32 -2048, i32 -131072, i32 -16777216, i32 -2147483648, i32 -2147483647, i32 -2147483647, i32 -2147483647, i32 -2147483647, i32 -2147483647]
define i32 @lzcompress_tek0(i32 %0, i8* %1, i32 %2, i32 %3, i32 %4, i32 %5) {
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i8*
%14 = alloca i8*
%15 = alloca i8*
%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
%25 = alloca i32
%26 = alloca i32
%27 = alloca i32
%28 = alloca i32
%29 = alloca i32
%30 = alloca i32
%31 = alloca i32
store i32 %0, i32* %7
store i8* %1, i8** %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store i32 %4, i32* %11
store i32 %5, i32* %12
store i32 -1, i32* %18
store i32 0, i32* %19
store i32 0, i32* %31
store i32 0, i32* %26
%32 = call i8* @malloc(i32 16777216)
store i8* %32, i8** %14
%33 = load i8*, i8** %14
store i8* %33, i8** %13
br label %34
34: ; preds = %216, %6
%35 = load i32, i32* %10
%36 = load i32, i32* %9
%37 = icmp slt i32 %35, %36
br i1 %37, label %38, label %217
38: ; preds = %34
%39 = load i32, i32* %10
%40 = icmp eq i32 %39, 0
br i1 %40, label %41, label %42
41: ; preds = %38
store i32 0, i32* %16
br label %129
42: ; preds = %38
%43 = load i32, i32* %10
%44 = load i32, i32* %12
%45 = sub nsw i32 %43, %44
store i32 %45, i32* %20
%46 = load i32, i32* %20
%47 = icmp slt i32 %46, 0
br i1 %47, label %48, label %49
48: ; preds = %42
store i32 0, i32* %20
br label %49
49: ; preds = %48, %42
%50 = load i32, i32* %9
%51 = load i32, i32* %10
%52 = sub nsw i32 %50, %51
store i32 %52, i32* %17
%53 = load i32, i32* %18
store i32 %53, i32* %16
%54 = load i32, i32* %19
store i32 %54, i32* %21
%55 = load i32, i32* %18
store i32 %55, i32* %16
%56 = icmp slt i32 %55, 0
br i1 %56, label %57, label %69
57: ; preds = %49
%58 = load i32, i32* %7
%59 = load i8*, i8** %8
%60 = load i32, i32* %10
%61 = sext i32 %60 to i64
%62 = getelementptr inbounds i8, i8* %59, i64 %61
%63 = load i8*, i8** %8
%64 = load i32, i32* %20
%65 = sext i32 %64 to i64
%66 = getelementptr inbounds i8, i8* %63, i64 %65
%67 = load i32, i32* %17
%68 = call i32 @search0a(i32 %58, i8* %62, i8* %66, i32 %67, i32* %21, i32* getelementptr inbounds ([10 x i32], [10 x i32]* @lzcompress_tek0.table, i64 0, i64 0))
store i32 %68, i32* %16
br label %69
69: ; preds = %57, %49
store i32 -1, i32* %18
%70 = load i32, i32* %16
%71 = icmp sge i32 %70, 2
br i1 %71, label %72, label %128
72: ; preds = %69
%73 = load i32, i32* %10
%74 = add nsw i32 %73, 1
%75 = load i32, i32* %12
%76 = sub nsw i32 %74, %75
store i32 %76, i32* %20
%77 = load i32, i32* %20
%78 = icmp slt i32 %77, 0
br i1 %78, label %79, label %80
79: ; preds = %72
store i32 0, i32* %20
br label %80
80: ; preds = %79, %72
%81 = load i32, i32* %7
%82 = load i8*, i8** %8
%83 = load i32, i32* %10
%84 = sext i32 %83 to i64
%85 = getelementptr inbounds i8, i8* %82, i64 %84
%86 = getelementptr inbounds i8, i8* %85, i64 1
%87 = load i8*, i8** %8
%88 = load i32, i32* %20
%89 = sext i32 %88 to i64
%90 = getelementptr inbounds i8, i8* %87, i64 %89
%91 = load i32, i32* %17
%92 = sub nsw i32 %91, 1
%93 = call i32 @search0a(i32 %81, i8* %86, i8* %90, i32 %92, i32* %19, i32* getelementptr inbounds ([10 x i32], [10 x i32]* @lzcompress_tek0.table, i64 0, i64 0))
store i32 %93, i32* %18
%94 = load i32, i32* %16
%95 = load i32, i32* %18
%96 = icmp slt i32 %94, %95
br i1 %96, label %97, label %127
97: ; preds = %80
store i32 0, i32* %16
%98 = load i32, i32* %10
%99 = icmp sge i32 %98, 8
br i1 %99, label %100, label %126
100: ; preds = %97
store i32 -1, i32* %21
br label %101
101: ; preds = %122, %100
%102 = load i32, i32* %21
%103 = icmp sle i32 %102, -8
br i1 %103, label %104, label %125
104: ; preds = %101
%105 = load i8*, i8** %8
%106 = load i32, i32* %10
%107 = sext i32 %106 to i64
%108 = getelementptr inbounds i8, i8* %105, i64 %107
%109 = load i8, i8* %108
%110 = zext i8 %109 to i32
%111 = load i8*, i8** %8
%112 = load i32, i32* %10
%113 = load i32, i32* %21
%114 = add nsw i32 %112, %113
%115 = sext i32 %114 to i64
%116 = getelementptr inbounds i8, i8* %111, i64 %115
%117 = load i8, i8* %116
%118 = zext i8 %117 to i32
%119 = icmp eq i32 %110, %118
br i1 %119, label %120, label %121
120: ; preds = %104
store i32 1, i32* %16
br label %125
121: ; preds = %104
br label %122
122: ; preds = %121
%123 = load i32, i32* %21
%124 = add nsw i32 %123, -1
store i32 %124, i32* %21
br label %101
125: ; preds = %120, %101
br label %126
126: ; preds = %125, %97
br label %127
127: ; preds = %126, %80
br label %128
128: ; preds = %127, %69
br label %129
129: ; preds = %128, %41
%130 = load i32, i32* %16
%131 = icmp slt i32 %130, 1
br i1 %131, label %132, label %139
132: ; preds = %129
%133 = load i8*, i8** %13
%134 = getelementptr inbounds i8, i8* %133, i64 0
store i8 1, i8* %134
%135 = load i32, i32* %10
%136 = add nsw i32 %135, 1
store i32 %136, i32* %10
%137 = load i8*, i8** %13
%138 = getelementptr inbounds i8, i8* %137, i32 1
store i8* %138, i8** %13
br label %216
139: ; preds = %129
%140 = load i32, i32* %16
%141 = load i32, i32* %10
%142 = add nsw i32 %141, %140
store i32 %142, i32* %10
%143 = load i32, i32* %16
%144 = icmp sge i32 %143, 2
br i1 %144, label %145, label %146
145: ; preds = %139
store i32 -1, i32* %18
br label %146
146: ; preds = %145, %139
%147 = load i8*, i8** %13
%148 = getelementptr inbounds i8, i8* %147, i64 0
store i8 19, i8* %148
%149 = load i8*, i8** %13
store i8* %149, i8** %15
%150 = load i32, i32* %16
%151 = and i32 %150, 255
%152 = trunc i32 %151 to i8
%153 = load i8*, i8** %13
%154 = getelementptr inbounds i8, i8* %153, i64 1
store i8 %152, i8* %154
%155 = load i8*, i8** %13
%156 = getelementptr inbounds i8, i8* %155, i64 2
store i8* %156, i8** %13
%157 = load i32, i32* %16
%158 = icmp sgt i32 %157, 255
br i1 %158, label %159, label %181
159: ; preds = %146
%160 = load i32, i32* %16
%161 = ashr i32 %160, 8
%162 = and i32 %161, 255
%163 = trunc i32 %162 to i8
%164 = load i8*, i8** %13
%165 = getelementptr inbounds i8, i8* %164, i64 0
store i8 %163, i8* %165
%166 = load i32, i32* %16
%167 = ashr i32 %166, 16
%168 = and i32 %167, 255
%169 = trunc i32 %168 to i8
%170 = load i8*, i8** %13
%171 = getelementptr inbounds i8, i8* %170, i64 1
store i8 %169, i8* %171
%172 = load i32, i32* %16
%173 = ashr i32 %172, 24
%174 = and i32 %173, 255
%175 = trunc i32 %174 to i8
%176 = load i8*, i8** %13
%177 = getelementptr inbounds i8, i8* %176, i64 2
store i8 %175, i8* %177
%178 = load i8*, i8** %13
%179 = getelementptr inbounds i8, i8* %178, i64 3
store i8* %179, i8** %13
%180 = load i8*, i8** %15
store i8 54, i8* %180
br label %181
181: ; preds = %159, %146
%182 = load i32, i32* %21
%183 = and i32 %182, 255
%184 = trunc i32 %183 to i8
%185 = load i8*, i8** %13
%186 = getelementptr inbounds i8, i8* %185, i32 1
store i8* %186, i8** %13
store i8 %184, i8* %185
%187 = load i32, i32* %21
%188 = icmp slt i32 %187, -256
br i1 %188, label %189, label %215
189: ; preds = %181
%190 = load i32, i32* %21
%191 = ashr i32 %190, 8
%192 = and i32 %191, 255
%193 = trunc i32 %192 to i8
%194 = load i8*, i8** %13
%195 = getelementptr inbounds i8, i8* %194, i64 0
store i8 %193, i8* %195
%196 = load i32, i32* %21
%197 = ashr i32 %196, 16
%198 = and i32 %197, 255
%199 = trunc i32 %198 to i8
%200 = load i8*, i8** %13
%201 = getelementptr inbounds i8, i8* %200, i64 1
store i8 %199, i8* %201
%202 = load i32, i32* %21
%203 = ashr i32 %202, 24
%204 = and i32 %203, 255
%205 = trunc i32 %204 to i8
%206 = load i8*, i8** %13
%207 = getelementptr inbounds i8, i8* %206, i64 2
store i8 %205, i8* %207
%208 = load i8*, i8** %13
%209 = getelementptr inbounds i8, i8* %208, i64 3
store i8* %209, i8** %13
%210 = load i8*, i8** %15
%211 = load i8, i8* %210
%212 = zext i8 %211 to i32
%213 = add nsw i32 %212, 67
%214 = trunc i32 %213 to i8
store i8 %214, i8* %210
br label %215
215: ; preds = %189, %181
br label %216
216: ; preds = %215, %132
br label %34
217: ; preds = %34
%218 = load i8*, i8** %13
store i8 0, i8* %218
store i32 2147483647, i32* %23
store i32 0, i32* %25
br label %219
219: ; preds = %343, %217
%220 = load i32, i32* %25
%221 = icmp slt i32 %220, 16
br i1 %221, label %222, label %346
222: ; preds = %219
store i32 0, i32* %30
br label %223
223: ; preds = %339, %222
%224 = load i32, i32* %30
%225 = icmp slt i32 %224, 2
br i1 %225, label %226, label %342
226: ; preds = %223
store i32 0, i32* %24
br label %227
227: ; preds = %335, %226
%228 = load i32, i32* %24
%229 = icmp slt i32 %228, 4
br i1 %229, label %230, label %338
230: ; preds = %227
%231 = load i8*, i8** %14
%232 = load i32, i32* %24
%233 = call i32 @calcdis_s(i8* %231, i32 %232)
store i32 %233, i32* %22
%234 = load i8*, i8** %14
store i8* %234, i8** %13
store i32 0, i32* %16
br label %235
235: ; preds = %324, %230
%236 = load i8*, i8** %13
%237 = load i32, i32* %24
%238 = call i32 @get_subbuflen(i8* %236, i32* %27, i32 %237)
store i32 %238, i32* %18
%239 = load i32, i32* %18
%240 = icmp eq i32 %239, 0
br i1 %240, label %241, label %242
241: ; preds = %235
br label %325
242: ; preds = %235
%243 = load i32, i32* %18
%244 = load i32, i32* %25
%245 = and i32 %244, 3
%246 = call i64 @calclen_l0a(i32 %243, i32 %245)
%247 = load i32, i32* %16
%248 = sext i32 %247 to i64
%249 = add nsw i64 %248, %246
%250 = trunc i64 %249 to i32
store i32 %250, i32* %16
br label %251
251: ; preds = %270, %242
%252 = load i8*, i8** %13
%253 = call i8* @get_subbuf(i8* %252, i32* %27, i32* %29, i32* %28)
store i8* %253, i8** %13
%254 = load i32, i32* %27
%255 = icmp eq i32 %254, 1
br i1 %255, label %256, label %261
256: ; preds = %251
%257 = load i32, i32* %16
%258 = add nsw i32 %257, 8
store i32 %258, i32* %16
%259 = load i32, i32* %18
%260 = add nsw i32 %259, -1
store i32 %260, i32* %18
br label %269
261: ; preds = %251
%262 = load i32, i32* %28
%263 = mul nsw i32 8, %262
%264 = load i32, i32* %16
%265 = add nsw i32 %264, %263
store i32 %265, i32* %16
%266 = load i32, i32* %28
%267 = load i32, i32* %18
%268 = sub nsw i32 %267, %266
store i32 %268, i32* %18
br label %269
269: ; preds = %261, %256
br label %270
270: ; preds = %269
%271 = load i32, i32* %18
%272 = icmp ne i32 %271, 0
br i1 %272, label %251, label %273
273: ; preds = %270
%274 = load i8*, i8** %13
%275 = load i32, i32* %24
%276 = call i32 @get_subbuflen(i8* %274, i32* %27, i32 %275)
store i32 %276, i32* %18
%277 = load i32, i32* %18
%278 = icmp eq i32 %277, 0
br i1 %278, label %279, label %280
279: ; preds = %273
br label %325
280: ; preds = %273
%281 = load i32, i32* %18
%282 = load i32, i32* %25
%283 = ashr i32 %282, 2
%284 = call i64 @calclen_l0a(i32 %281, i32 %283)
%285 = load i32, i32* %16
%286 = sext i32 %285 to i64
%287 = add nsw i64 %286, %284
%288 = trunc i64 %287 to i32
store i32 %288, i32* %16
br label %289
289: ; preds = %320, %280
%290 = load i8*, i8** %13
%291 = call i8* @get_subbuf(i8* %290, i32* %27, i32* %29, i32* %28)
store i8* %291, i8** %13
%292 = load i32, i32* %29
%293 = load i32, i32* %22
%294 = call i64 @calclen_df(i32 %292, i32 %293)
%295 = load i32, i32* %16
%296 = sext i32 %295 to i64
%297 = add nsw i64 %296, %294
%298 = trunc i64 %297 to i32
store i32 %298, i32* %16
%299 = load i32, i32* %30
%300 = icmp eq i32 %299, 0
br i1 %300, label %301, label %310
301: ; preds = %289
%302 = load i32, i32* %28
%303 = load i32, i32* %24
%304 = sub nsw i32 %302, %303
%305 = call i64 @calclen_l1a(i32 %304)
%306 = load i32, i32* %16
%307 = sext i32 %306 to i64
%308 = add nsw i64 %307, %305
%309 = trunc i64 %308 to i32
store i32 %309, i32* %16
br label %319
310: ; preds = %289
%311 = load i32, i32* %28
%312 = load i32, i32* %24
%313 = sub nsw i32 %311, %312
%314 = call i64 @calclen_l1b(i32 %313)
%315 = load i32, i32* %16
%316 = sext i32 %315 to i64
%317 = add nsw i64 %316, %314
%318 = trunc i64 %317 to i32
store i32 %318, i32* %16
br label %319
319: ; preds = %310, %301
br label %320
320: ; preds = %319
%321 = load i32, i32* %18
%322 = add nsw i32 %321, -1
store i32 %322, i32* %18
%323 = icmp ne i32 %322, 0
br i1 %323, label %289, label %324
324: ; preds = %320
br label %235
325: ; preds = %279, %241
%326 = load i32, i32* %23
%327 = load i32, i32* %16
%328 = icmp sgt i32 %326, %327
br i1 %328, label %329, label %334
329: ; preds = %325
%330 = load i32, i32* %16
store i32 %330, i32* %23
%331 = load i32, i32* %24
store i32 %331, i32* %10
%332 = load i32, i32* %30
store i32 %332, i32* %31
%333 = load i32, i32* %25
store i32 %333, i32* %26
br label %334
334: ; preds = %329, %325
br label %335
335: ; preds = %334
%336 = load i32, i32* %24
%337 = add nsw i32 %336, 1
store i32 %337, i32* %24
br label %227
338: ; preds = %227
br label %339
339: ; preds = %338
%340 = load i32, i32* %30
%341 = add nsw i32 %340, 1
store i32 %341, i32* %30
br label %223
342: ; preds = %223
br label %343
343: ; preds = %342
%344 = load i32, i32* %25
%345 = add nsw i32 %344, 1
store i32 %345, i32* %25
br label %219
346: ; preds = %219
%347 = load i8*, i8** %14
%348 = load i32, i32* %10
%349 = call i32 @calcdis_s(i8* %347, i32 %348)
store i32 %349, i32* %22
%350 = load i32, i32* %22
%351 = call i32 @putnum_s8(i32 %350)
%352 = load i32, i32* %10
%353 = trunc i32 %352 to i8
%354 = call i32 @putbc(i8 zeroext %353, i32 2)
%355 = load i32, i32* %31
%356 = trunc i32 %355 to i8
%357 = call i32 @putbc(i8 zeroext %356, i32 1)
%358 = load i32, i32* %26
%359 = trunc i32 %358 to i8
%360 = call i32 @putbc(i8 zeroext %359, i32 2)
%361 = load i32, i32* %26
%362 = ashr i32 %361, 2
%363 = trunc i32 %362 to i8
%364 = call i32 @putbc(i8 zeroext %363, i32 2)
%365 = load i8*, i8** %14
store i8* %365, i8** %13
store i32 0, i32* %24
br label %366
366: ; preds = %443, %346
%367 = load i8*, i8** %13
%368 = load i32, i32* %10
%369 = call i32 @get_subbuflen(i8* %367, i32* %27, i32 %368)
store i32 %369, i32* %18
%370 = load i32, i32* %18
%371 = icmp eq i32 %370, 0
br i1 %371, label %372, label %373
372: ; preds = %366
br label %444
373: ; preds = %366
%374 = load i32, i32* %18
%375 = load i32, i32* %26
%376 = and i32 %375, 3
%377 = call i32 @putnum_l0a(i32 %374, i32 %376)
br label %378
378: ; preds = %402, %373
%379 = load i8*, i8** %13
%380 = call i8* @get_subbuf(i8* %379, i32* %27, i32* %29, i32* %28)
store i8* %380, i8** %13
%381 = load i32, i32* %27
%382 = icmp eq i32 %381, 1
br i1 %382, label %383, label %384
383: ; preds = %378
store i32 1, i32* %28
br label %384
384: ; preds = %383, %378
br label %385
385: ; preds = %398, %384
%386 = load i8*, i8** %8
%387 = load i32, i32* %24
%388 = sext i32 %387 to i64
%389 = getelementptr inbounds i8, i8* %386, i64 %388
%390 = load i8, i8* %389
%391 = call i32 @putbc(i8 zeroext %390, i32 128)
%392 = load i32, i32* %24
%393 = add nsw i32 %392, 1
store i32 %393, i32* %24
%394 = load i32, i32* %18
%395 = add nsw i32 %394, -1
store i32 %395, i32* %18
%396 = load i32, i32* %28
%397 = add nsw i32 %396, -1
store i32 %397, i32* %28
br label %398
398: ; preds = %385
%399 = load i32, i32* %28
%400 = icmp ne i32 %399, 0
br i1 %400, label %385, label %401
401: ; preds = %398
br label %402
402: ; preds = %401
%403 = load i32, i32* %18
%404 = icmp ne i32 %403, 0
br i1 %404, label %378, label %405
405: ; preds = %402
%406 = load i8*, i8** %13
%407 = load i32, i32* %10
%408 = call i32 @get_subbuflen(i8* %406, i32* %27, i32 %407)
store i32 %408, i32* %18
%409 = load i32, i32* %18
%410 = icmp eq i32 %409, 0
br i1 %410, label %411, label %412
411: ; preds = %405
br label %444
412: ; preds = %405
%413 = load i32, i32* %18
%414 = load i32, i32* %26
%415 = ashr i32 %414, 2
%416 = call i32 @putnum_l0a(i32 %413, i32 %415)
br label %417
417: ; preds = %439, %412
%418 = load i8*, i8** %13
%419 = call i8* @get_subbuf(i8* %418, i32* %27, i32* %29, i32* %28)
store i8* %419, i8** %13
%420 = load i32, i32* %29
%421 = load i32, i32* %22
%422 = call i32 @putnum_df(i32 %420, i32 %421)
%423 = load i32, i32* %31
%424 = icmp eq i32 %423, 0
br i1 %424, label %425, label %430
425: ; preds = %417
%426 = load i32, i32* %28
%427 = load i32, i32* %10
%428 = sub nsw i32 %426, %427
%429 = call i32 @putnum_l1a(i32 %428)
br label %435
430: ; preds = %417
%431 = load i32, i32* %28
%432 = load i32, i32* %10
%433 = sub nsw i32 %431, %432
%434 = call i32 @putnum_l1b(i32 %433)
br label %435
435: ; preds = %430, %425
%436 = load i32, i32* %28
%437 = load i32, i32* %24
%438 = add nsw i32 %437, %436
store i32 %438, i32* %24
br label %439
439: ; preds = %435
%440 = load i32, i32* %18
%441 = add nsw i32 %440, -1
store i32 %441, i32* %18
%442 = icmp ne i32 %441, 0
br i1 %442, label %417, label %443
443: ; preds = %439
br label %366
444: ; preds = %411, %372
%445 = call i32 (...) @flushb0()
%446 = load i8*, i8** %14
%447 = call i32 @free(i8* %446)
%448 = load i32, i32* %9
ret i32 %448
}

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