#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 */
char *AddStrings(char const *, char const *);
int EXIT_FAILURE;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
char *realloc(char *, unsigned int);
int /*<<< orphan*/ run(char const *, char **);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdout;
int main(int argc, char *argv[]) {
  int i, j, k;
  const char *commandline = 0;
  const char *file = 0;
  char *outcbs = 0;
  int export0 = 1;
  int export1 = 1;
  int export2 = 1;
  int docbs = 0;
  char lastblock[1] = {'3'};
  unsigned int outcbssize = 0;
  char *data = NULL;
  fprintf(stderr, "DefDB Parser v1.02 by Mr_KrzYch00\n\n");
  for (i = 1; i < argc; ++i) {
    const char *arg = argv[i];
    if (arg[0] == '-' && arg[1] == '-' && arg[2] == 'b' && arg[3] == '=' &&
        arg[4] != '\0') {
      export0 = 0;
      export1 = 0;
      export2 = 0;
      for (j = 4; arg[j] != '\0'; j++) {
        switch (arg[j]) {
        case '0':
          export0 = 1;
          break;
        case '1':
          export1 = 1;
          break;
        case '2':
          export2 = 1;
          break;
        }
      }
    }
  }
  for (i = 1; i < argc; i++) {
    if (argv[i][0] != '-') {
      file = argv[i];
    }
  }
  if (!file) {
    fprintf(
        stderr,
        "Reads defdb output and parses it to be used with Zopfli KrzYmod's\n"
        "custom block split points command.\n\n"
        "Arguments:\n"
        "--b=#       Export info for # block types only (0-2, d: 012)\n"
        "The output can be safely piped to file or command line\n\n"
        "Example:\n"
        "%s filename.gz --b=0 >filename.cbs\n",
        argv[0]);
  } else {
    commandline = AddStrings("defdb ", file);
    commandline = AddStrings(commandline, " 2>&1");
    run(commandline, &data);
    if (data != NULL) {
      for (i = 0; data[i] != '\0'; i++) {
        if (data[i] == '\n') {
          j = i + 1;
          switch (data[j]) {
          case '0':
            if (export0 == 1 && data[j + 1] == ' ')
              docbs = 1;
            if (export0 == 0 && lastblock[0] == '1') {
              data[j] = '2';
              docbs = 1;
            }
            break;
          case '1':
            if (export1 == 1 && data[j + 1] == ' ')
              docbs = 1;
            if (export1 == 0 && lastblock[0] == '0') {
              data[j] = '2';
              docbs = 1;
            }
            break;
          case '2':
            if (export2 == 1 && data[j + 1] == ' ')
              docbs = 1;
            if (export2 == 0 && (lastblock[0] == '0' || lastblock[0] == '1'))
              docbs = 1;
            break;
          }
          if (docbs == 1 || lastblock[0] == '3') {
            for (k = j + 1; data[k] == ' '; k++) {
            }
            while (data[k] != ' ') {
              outcbs = realloc(outcbs, (++outcbssize) * sizeof(char *));
              outcbs[outcbssize - 1] = data[k];
              ++k;
            }
            outcbs = realloc(outcbs, (outcbssize + 1) * sizeof(char *));
            outcbs[outcbssize++] = ',';
            lastblock[0] = data[j];
            i = k;
          }
          docbs = 0;
        }
      }
      fprintf(stderr, "========================\nDEFDB OUTPUT "
                      "[stderr]:\n========================\n");
      fprintf(stderr, "%s", data);
      fprintf(stderr, "========================\nCBS OUTPUT "
                      "[stdout]:\n========================\n");
      if (outcbssize > 0) {
        outcbs[--outcbssize] = '\0';
        fprintf(stdout, "%s", outcbs);
        if (export2 == 0) {
          fprintf(
              stderr,
              "\n\n"
              "Please note that when block types 2 are not selected each "
              "block\n"
              "type 0 and 1 will be followed by block type 2 to mark correct\n"
              "boundaries of mentioned blocks.\n");
        }
      } else {
        fprintf(stderr, "Error: No blocks found in defdb output.\n");
        return EXIT_FAILURE;
      }
    } else {
      fprintf(stderr, "Unknown error.\n");
      return EXIT_FAILURE;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movq   $0x0,-0x28(%rbp)
movq   $0x0,-0x30(%rbp)
movq   $0x0,-0x38(%rbp)
movl   $0x1,-0x3c(%rbp)
movl   $0x1,-0x40(%rbp)
movl   $0x1,-0x44(%rbp)
movl   $0x0,-0x48(%rbp)
mov    0xe70(%rip),%al
mov    %al,-0x49(%rbp)
movl   $0x0,-0x50(%rbp)
movq   $0x0,-0x58(%rbp)
mov    0x2e37(%rip),%rax
mov    (%rax),%edi
lea    0xe4f(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    12ea <main+0x1aa>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x60(%rbp)
mov    -0x60(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
jne    12d7 <main+0x197>
mov    -0x60(%rbp),%rax
movsbl 0x1(%rax),%eax
cmp    $0x2d,%eax
jne    12d7 <main+0x197>
mov    -0x60(%rbp),%rax
movsbl 0x2(%rax),%eax
cmp    $0x62,%eax
jne    12d7 <main+0x197>
mov    -0x60(%rbp),%rax
movsbl 0x3(%rax),%eax
cmp    $0x3d,%eax
jne    12d7 <main+0x197>
mov    -0x60(%rbp),%rax
movsbl 0x4(%rax),%eax
cmp    $0x0,%eax
je     12d7 <main+0x197>
movl   $0x0,-0x3c(%rbp)
movl   $0x0,-0x40(%rbp)
movl   $0x0,-0x44(%rbp)
movl   $0x4,-0x18(%rbp)
mov    -0x60(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     12d2 <main+0x192>
mov    -0x60(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
mov    %eax,-0x64(%rbp)
sub    $0x30,%eax
je     12a0 <main+0x160>
jmp    127e <main+0x13e>
mov    -0x64(%rbp),%eax
sub    $0x31,%eax
je     12ac <main+0x16c>
jmp    128f <main+0x14f>
mov    -0x64(%rbp),%eax
sub    $0x32,%eax
je     12b8 <main+0x178>
jmp    12bf <main+0x17f>
movl   $0x1,-0x3c(%rbp)
jmp    12bf <main+0x17f>
movl   $0x1,-0x40(%rbp)
jmp    12bf <main+0x17f>
movl   $0x1,-0x44(%rbp)
jmp    12c4 <main+0x184>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    124c <main+0x10c>
jmp    12d7 <main+0x197>
jmp    12dc <main+0x19c>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11c0 <main+0x80>
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1338 <main+0x1f8>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
je     1325 <main+0x1e5>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x30(%rbp)
jmp    132a <main+0x1ea>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    12f1 <main+0x1b1>
cmpq   $0x0,-0x30(%rbp)
jne    1366 <main+0x226>
mov    0x2c96(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
lea    0xccb(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
jmp    1735 <main+0x5f5>
mov    -0x30(%rbp),%rsi
lea    0xdc7(%rip),%rdi
call   1060 <AddStrings@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
lea    0xdba(%rip),%rsi
call   1060 <AddStrings@plt>
mov    %rax,-0x28(%rbp)
mov    -0x28(%rbp),%rdi
lea    -0x58(%rbp),%rsi
call   1030 <run@plt>
cmpq   $0x0,-0x58(%rbp)
je     1708 <main+0x5c8>
movl   $0x0,-0x14(%rbp)
mov    -0x58(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     1634 <main+0x4f4>
mov    -0x58(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0xa,%eax
jne    1621 <main+0x4e1>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
mov    -0x58(%rbp),%rax
movslq -0x18(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
mov    %eax,-0x68(%rbp)
sub    $0x30,%eax
je     141f <main+0x2df>
jmp    13fd <main+0x2bd>
mov    -0x68(%rbp),%eax
sub    $0x31,%eax
je     1479 <main+0x339>
jmp    140e <main+0x2ce>
mov    -0x68(%rbp),%eax
sub    $0x32,%eax
je     14d3 <main+0x393>
jmp    152e <main+0x3ee>
cmpl   $0x1,-0x3c(%rbp)
jne    144a <main+0x30a>
mov    -0x58(%rbp),%rax
mov    -0x18(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x20,%eax
jne    144a <main+0x30a>
movl   $0x1,-0x48(%rbp)
cmpl   $0x0,-0x3c(%rbp)
jne    1474 <main+0x334>
movsbl -0x49(%rbp),%eax
cmp    $0x31,%eax
jne    1474 <main+0x334>
mov    -0x58(%rbp),%rax
movslq -0x18(%rbp),%rcx
movb   $0x32,(%rax,%rcx,1)
movl   $0x1,-0x48(%rbp)
jmp    152e <main+0x3ee>
cmpl   $0x1,-0x40(%rbp)
jne    14a4 <main+0x364>
mov    -0x58(%rbp),%rax
mov    -0x18(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x20,%eax
jne    14a4 <main+0x364>
movl   $0x1,-0x48(%rbp)
cmpl   $0x0,-0x40(%rbp)
jne    14ce <main+0x38e>
movsbl -0x49(%rbp),%eax
cmp    $0x30,%eax
jne    14ce <main+0x38e>
mov    -0x58(%rbp),%rax
movslq -0x18(%rbp),%rcx
movb   $0x32,(%rax,%rcx,1)
movl   $0x1,-0x48(%rbp)
jmp    152e <main+0x3ee>
cmpl   $0x1,-0x44(%rbp)
jne    14fe <main+0x3be>
mov    -0x58(%rbp),%rax
mov    -0x18(%rbp),%ecx
add    $0x1,%ecx
movslq %ecx,%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x20,%eax
jne    14fe <main+0x3be>
movl   $0x1,-0x48(%rbp)
cmpl   $0x0,-0x44(%rbp)
jne    1529 <main+0x3e9>
movsbl -0x49(%rbp),%eax
cmp    $0x30,%eax
je     1522 <main+0x3e2>
movsbl -0x49(%rbp),%eax
cmp    $0x31,%eax
jne    1529 <main+0x3e9>
movl   $0x1,-0x48(%rbp)
jmp    152e <main+0x3ee>
cmpl   $0x1,-0x48(%rbp)
je     1545 <main+0x405>
movsbl -0x49(%rbp),%eax
cmp    $0x33,%eax
jne    161a <main+0x4da>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x58(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x20,%eax
jne    1576 <main+0x436>
jmp    1568 <main+0x428>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    154e <main+0x40e>
jmp    157b <main+0x43b>
mov    -0x58(%rbp),%rax
movslq -0x1c(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x20,%eax
je     15d6 <main+0x496>
mov    -0x38(%rbp),%rdi
mov    -0x50(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x50(%rbp)
mov    %eax,%eax
shl    $0x3,%rax
mov    %eax,%esi
call   1050 <realloc@plt>
mov    %rax,-0x38(%rbp)
mov    -0x58(%rbp),%rax
movslq -0x1c(%rbp),%rcx
mov    (%rax,%rcx,1),%dl
mov    -0x38(%rbp),%rax
mov    -0x50(%rbp),%ecx
sub    $0x1,%ecx
mov    %ecx,%ecx
mov    %dl,(%rax,%rcx,1)
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    157b <main+0x43b>
mov    -0x38(%rbp),%rdi
mov    -0x50(%rbp),%eax
add    $0x1,%eax
mov    %eax,%eax
shl    $0x3,%rax
mov    %eax,%esi
call   1050 <realloc@plt>
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rax
mov    -0x50(%rbp),%ecx
mov    %ecx,%edx
add    $0x1,%edx
mov    %edx,-0x50(%rbp)
mov    %ecx,%ecx
movb   $0x2c,(%rax,%rcx,1)
mov    -0x58(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,1),%al
mov    %al,-0x49(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x14(%rbp)
movl   $0x0,-0x48(%rbp)
jmp    1626 <main+0x4e6>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    13ad <main+0x26d>
mov    0x29a5(%rip),%rax
mov    (%rax),%edi
lea    0xb01(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    0x298e(%rip),%rax
mov    (%rax),%edi
mov    -0x58(%rbp),%rdx
lea    0xb30(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    0x2973(%rip),%rax
mov    (%rax),%edi
lea    0xb1c(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
cmpl   $0x0,-0x50(%rbp)
jbe    16db <main+0x59b>
mov    -0x38(%rbp),%rax
mov    -0x50(%rbp),%ecx
add    $0xffffffff,%ecx
mov    %ecx,-0x50(%rbp)
mov    %ecx,%ecx
movb   $0x0,(%rax,%rcx,1)
mov    0x292f(%rip),%rax
mov    (%rax),%edi
mov    -0x38(%rbp),%rdx
lea    0xae1(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
cmpl   $0x0,-0x44(%rbp)
jne    16d6 <main+0x596>
mov    0x291a(%rip),%rax
mov    (%rax),%edi
lea    0xb0b(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
jmp    1703 <main+0x5c3>
mov    0x28fe(%rip),%rax
mov    (%rax),%edi
lea    0xb90(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    0x28df(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    173c <main+0x5fc>
jmp    1730 <main+0x5f0>
mov    0x28d1(%rip),%rax
mov    (%rax),%edi
lea    0xb8c(%rip),%rsi
mov    $0x0,%al
call   1040 <fprintf@plt>
mov    0x28b2(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    173c <main+0x5fc>
jmp    1735 <main+0x5f5>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %rsi,%rbx
mov    %edi,%ebp
movq   $0x0,0x8(%rsp)
mov    0x2e7d(%rip),%r14
mov    (%r14),%edi
lea    0xe93(%rip),%rsi
xor    %eax,%eax
call   1040 <fprintf@plt>
cmp    $0x2,%ebp
jl     149c <main+0x35c>
mov    %ebp,%esi
mov    $0x1,%r15d
mov    $0x1,%ecx
mov    $0x1,%r12d
mov    $0x1,%r13d
jmp    11a9 <main+0x69>
nopl   0x0(%rax,%rax,1)
add    $0x1,%rcx
cmp    %rsi,%rcx
je     1218 <main+0xd8>
mov    (%rbx,%rcx,8),%rdx
cmpb   $0x2d,(%rdx)
jne    11a0 <main+0x60>
cmpb   $0x2d,0x1(%rdx)
jne    11a0 <main+0x60>
cmpb   $0x62,0x2(%rdx)
jne    11a0 <main+0x60>
cmpb   $0x3d,0x3(%rdx)
jne    11a0 <main+0x60>
mov    0x4(%rdx),%al
test   %al,%al
je     11a0 <main+0x60>
add    $0x5,%rdx
xor    %r15d,%r15d
xor    %r12d,%r12d
xor    %r13d,%r13d
jmp    11f1 <main+0xb1>
nopw   0x0(%rax,%rax,1)
mov    $0x1,%r15d
movzbl (%rdx),%eax
add    $0x1,%rdx
test   %al,%al
je     11a0 <main+0x60>
movsbl %al,%eax
cmp    $0x32,%eax
je     11e0 <main+0xa0>
cmp    $0x31,%eax
je     1210 <main+0xd0>
cmp    $0x30,%eax
jne    11e6 <main+0xa6>
mov    $0x1,%r13d
jmp    11e6 <main+0xa6>
nopl   0x0(%rax,%rax,1)
mov    $0x1,%r12d
jmp    11e6 <main+0xa6>
cmp    $0x2,%ebp
jl     149c <main+0x35c>
lea    -0x1(%rsi),%rdx
add    $0xfffffffffffffffe,%rsi
mov    %edx,%ecx
and    $0x3,%ecx
cmp    $0x3,%rsi
jae    1242 <main+0x102>
mov    $0x1,%eax
xor    %esi,%esi
test   %rcx,%rcx
jne    1293 <main+0x153>
jmp    12b4 <main+0x174>
and    $0xfffffffffffffffc,%rdx
xor    %esi,%esi
xor    %eax,%eax
nopw   0x0(%rax,%rax,1)
mov    0x8(%rbx,%rax,8),%rdi
mov    0x10(%rbx,%rax,8),%rbp
cmpb   $0x2d,(%rdi)
cmovne %rdi,%rsi
cmpb   $0x2d,0x0(%rbp)
cmovne %rbp,%rsi
mov    0x18(%rbx,%rax,8),%rdi
cmpb   $0x2d,(%rdi)
cmovne %rdi,%rsi
mov    0x20(%rbx,%rax,8),%rdi
cmpb   $0x2d,(%rdi)
cmovne %rdi,%rsi
add    $0x4,%rax
cmp    %rax,%rdx
jne    1250 <main+0x110>
add    $0x1,%rax
test   %rcx,%rcx
je     12b4 <main+0x174>
lea    (%rbx,%rax,8),%rax
xor    %edx,%edx
nopl   0x0(%rax)
mov    (%rax,%rdx,8),%rdi
cmpb   $0x2d,(%rdi)
cmovne %rdi,%rsi
add    $0x1,%rdx
cmp    %rdx,%rcx
jne    12a0 <main+0x160>
test   %rsi,%rsi
je     149c <main+0x35c>
lea    0xe73(%rip),%rdi
call   1060 <AddStrings@plt>
lea    0xe6e(%rip),%rsi
mov    %rax,%rdi
call   1060 <AddStrings@plt>
lea    0x8(%rsp),%rsi
mov    %rax,%rdi
call   1030 <run@plt>
mov    0x8(%rsp),%rax
test   %rax,%rax
je     154f <main+0x40f>
mov    %r12d,0x18(%rsp)
mov    %r15d,0x14(%rsp)
mov    $0x33,%cl
xor    %r15d,%r15d
movabs $0x100000000,%rbp
xor    %ebx,%ebx
xor    %r12d,%r12d
mov    %r13d,0x1c(%rsp)
jmp    132c <main+0x1ec>
nopl   0x0(%rax,%rax,1)
test   %dl,%dl
je     14c3 <main+0x383>
add    $0x1,%r15d
movslq %r15d,%r8
mov    (%rax,%r8,1),%dl
cmp    $0xa,%dl
jne    1320 <main+0x1e0>
movsbl 0x1(%r8,%rax,1),%esi
cmp    $0x32,%esi
je     1361 <main+0x221>
xor    %edx,%edx
cmp    $0x31,%esi
je     1392 <main+0x252>
cmp    $0x30,%esi
jne    13a6 <main+0x266>
cmp    $0x1,%r13d
je     139b <main+0x25b>
test   %r13d,%r13d
jne    13a6 <main+0x266>
cmp    $0x31,%cl
je     13be <main+0x27e>
jmp    13a6 <main+0x266>
xor    %esi,%esi
cmpl   $0x1,0x14(%rsp)
jne    1376 <main+0x236>
xor    %esi,%esi
cmpb   $0x20,0x2(%r8,%rax,1)
sete   %sil
mov    %ecx,%edx
and    $0xfe,%dl
cmp    $0x30,%dl
mov    %esi,%edx
mov    $0x1,%edi
cmove  %edi,%edx
cmpl   $0x0,0x14(%rsp)
cmovne %esi,%edx
jmp    13a6 <main+0x266>
mov    0x18(%rsp),%esi
cmp    $0x1,%esi
jne    13b5 <main+0x275>
xor    %edx,%edx
cmpb   $0x20,0x2(%r8,%rax,1)
sete   %dl
test   %edx,%edx
jne    13c4 <main+0x284>
cmp    $0x33,%cl
jne    1328 <main+0x1e8>
jmp    13c4 <main+0x284>
test   %esi,%esi
jne    13a6 <main+0x266>
cmp    $0x30,%cl
jne    13a6 <main+0x266>
movb   $0x32,0x1(%rax,%r8,1)
add    $0x2,%r15d
mov    0x8(%rsp),%rax
movslq %r15d,%r13
lea    -0x1(%r13),%r15
shl    $0x20,%r13
movabs $0xffffffff00000000,%rcx
ff ff ff
add    %rcx,%r13
cs nopw 0x0(%rax,%rax,1)
nop
add    %rbp,%r13
cmpb   $0x20,0x1(%rax,%r15,1)
lea    0x1(%r15),%r15
je     13f0 <main+0x2b0>
sar    $0x20,%r13
cmpb   $0x20,(%rax,%r13,1)
mov    %r8,0x20(%rsp)
jne    1414 <main+0x2d4>
mov    %r12d,%r14d
jmp    145c <main+0x31c>
lea    0x8(,%r12,8),%ebp
nopl   0x0(%rax)
lea    0x1(%r12),%r14d
mov    %rbx,%rdi
mov    %ebp,%esi
call   1050 <realloc@plt>
mov    %rax,%rbx
mov    0x8(%rsp),%rax
movzbl (%rax,%r13,1),%eax
mov    %r12d,%ecx
mov    %al,(%rbx,%rcx,1)
lea    0x1(%r13),%r15
mov    0x8(%rsp),%rax
add    $0x8,%ebp
cmpb   $0x20,0x1(%rax,%r13,1)
mov    %r15,%r13
mov    %r14d,%r12d
jne    1420 <main+0x2e0>
lea    0x1(%r14),%r12d
lea    0x8(,%r14,8),%esi
mov    %rbx,%rdi
call   1050 <realloc@plt>
mov    %rax,%rbx
mov    %r14d,%eax
movb   $0x2c,(%rbx,%rax,1)
mov    0x8(%rsp),%rax
mov    0x20(%rsp),%rcx
mov    0x1(%rax,%rcx,1),%cl
mov    0x1c(%rsp),%r13d
movabs $0x100000000,%rbp
jmp    1328 <main+0x1e8>
mov    (%r14),%edi
mov    (%rbx),%rdx
lea    0xb7b(%rip),%rsi
xor    %eax,%eax
call   1040 <fprintf@plt>
xor    %ebp,%ebp
mov    %ebp,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x2b16(%rip),%r14
mov    (%r14),%edi
lea    0xc70(%rip),%rsi
xor    %ebp,%ebp
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    (%r14),%edi
mov    0x8(%rsp),%rdx
lea    0xca2(%rip),%rsi
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    (%r14),%edi
lea    0xc94(%rip),%rsi
xor    %eax,%eax
call   1040 <fprintf@plt>
test   %r12d,%r12d
je     155b <main+0x41b>
add    $0xffffffff,%r12d
movb   $0x0,(%rbx,%r12,1)
mov    0x2ab7(%rip),%rax
mov    (%rax),%edi
lea    0xc6c(%rip),%rsi
mov    %rbx,%rdx
xor    %eax,%eax
call   1040 <fprintf@plt>
cmpl   $0x0,0x14(%rsp)
jne    14b2 <main+0x372>
mov    (%r14),%edi
lea    0xc98(%rip),%rsi
xor    %ebp,%ebp
xor    %eax,%eax
call   1040 <fprintf@plt>
jmp    14b2 <main+0x372>
mov    (%r14),%edi
lea    0xd4a(%rip),%rsi
jmp    1565 <main+0x425>
mov    (%r14),%edi
lea    0xd15(%rip),%rsi
xor    %eax,%eax
call   1040 <fprintf@plt>
mov    0x2a65(%rip),%rax
mov    (%rax),%ebp
jmp    14b2 <main+0x372>

LLVM IR (-O0):
@__const.main.lastblock = [1 x i8] c"3"
@stderr = global i32 0
@.str = [36 x i8] c"DefDB Parser v1.02 by Mr_KrzYch00\0A\0A\00"
@.str.1 = [275 x i8] c"Reads defdb output and parses it to be used with Zopfli KrzYmod's\0Acustom block split points command.\0A\0AArguments:\0A--b=# Export info for # block types only (0-2, d: 012)\0AThe output can be safely piped to file or command line\0A\0AExample:\0A%s filename.gz --b=0 >filename.cbs\0A\00"
@.str.2 = [7 x i8] c"defdb \00"
@.str.3 = [6 x i8] c" 2>&1\00"
@.str.4 = [74 x i8] c"========================\0ADEFDB OUTPUT [stderr]:\0A========================\0A\00"
@.str.5 = [3 x i8] c"%s\00"
@.str.6 = [72 x i8] c"========================\0ACBS OUTPUT [stdout]:\0A========================\0A\00"
@stdout = global i32 0
@.str.7 = [161 x i8] c"\0A\0APlease note that when block types 2 are not selected each block\0Atype 0 and 1 will be followed by block type 2 to mark correct\0Aboundaries of mentioned blocks.\0A\00"
@.str.8 = [41 x i8] c"Error: No blocks found in defdb output.\0A\00"
@EXIT_FAILURE = global i32 0
@.str.9 = [16 x i8] c"Unknown error.\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca [1 x i8]
%17 = alloca i32
%18 = alloca i8*
%19 = alloca i8*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8* null, i8** %9
store i8* null, i8** %10
store i8* null, i8** %11
store i32 1, i32* %12
store i32 1, i32* %13
store i32 1, i32* %14
store i32 0, i32* %15
%20 = bitcast [1 x i8]* %16 to i8*
store i32 0, i32* %17
store i8* null, i8** %18
%21 = load i32, i32* @stderr
%22 = call i32 (i32, i8*, ...) @fprintf(i32 %21, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %6
br label %23
23: ; preds = %87, %2
%24 = load i32, i32* %6
%25 = load i32, i32* %4
%26 = icmp slt i32 %24, %25
br i1 %26, label %27, label %90
27: ; preds = %23
%28 = load i8**, i8*** %5
%29 = load i32, i32* %6
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds i8*, i8** %28, i64 %30
%32 = load i8*, i8** %31
store i8* %32, i8** %19
%33 = load i8*, i8** %19
%34 = getelementptr inbounds i8, i8* %33, i64 0
%35 = load i8, i8* %34
%36 = sext i8 %35 to i32
%37 = icmp eq i32 %36, 45
br i1 %37, label %38, label %86
38: ; preds = %27
%39 = load i8*, i8** %19
%40 = getelementptr inbounds i8, i8* %39, i64 1
%41 = load i8, i8* %40
%42 = sext i8 %41 to i32
%43 = icmp eq i32 %42, 45
br i1 %43, label %44, label %86
44: ; preds = %38
%45 = load i8*, i8** %19
%46 = getelementptr inbounds i8, i8* %45, i64 2
%47 = load i8, i8* %46
%48 = sext i8 %47 to i32
%49 = icmp eq i32 %48, 98
br i1 %49, label %50, label %86
50: ; preds = %44
%51 = load i8*, i8** %19
%52 = getelementptr inbounds i8, i8* %51, i64 3
%53 = load i8, i8* %52
%54 = sext i8 %53 to i32
%55 = icmp eq i32 %54, 61
br i1 %55, label %56, label %86
56: ; preds = %50
%57 = load i8*, i8** %19
%58 = getelementptr inbounds i8, i8* %57, i64 4
%59 = load i8, i8* %58
%60 = sext i8 %59 to i32
%61 = icmp ne i32 %60, 0
br i1 %61, label %62, label %86
62: ; preds = %56
store i32 0, i32* %12
store i32 0, i32* %13
store i32 0, i32* %14
store i32 4, i32* %7
br label %63
63: ; preds = %82, %62
%64 = load i8*, i8** %19
%65 = load i32, i32* %7
%66 = sext i32 %65 to i64
%67 = getelementptr inbounds i8, i8* %64, i64 %66
%68 = load i8, i8* %67
%69 = sext i8 %68 to i32
%70 = icmp ne i32 %69, 0
br i1 %70, label %71, label %85
71: ; preds = %63
%72 = load i8*, i8** %19
%73 = load i32, i32* %7
%74 = sext i32 %73 to i64
%75 = getelementptr inbounds i8, i8* %72, i64 %74
%76 = load i8, i8* %75
%77 = sext i8 %76 to i32
switch i32 %77, label %81 [
i32 48, label %78
i32 49, label %79
i32 50, label %80
]
78: ; preds = %71
store i32 1, i32* %12
br label %81
79: ; preds = %71
store i32 1, i32* %13
br label %81
80: ; preds = %71
store i32 1, i32* %14
br label %81
81: ; preds = %71, %80, %79, %78
br label %82
82: ; preds = %81
%83 = load i32, i32* %7
%84 = add nsw i32 %83, 1
store i32 %84, i32* %7
br label %63
85: ; preds = %63
br label %86
86: ; preds = %85, %56, %50, %44, %38, %27
br label %87
87: ; preds = %86
%88 = load i32, i32* %6
%89 = add nsw i32 %88, 1
store i32 %89, i32* %6
br label %23
90: ; preds = %23
store i32 1, i32* %6
br label %91
91: ; preds = %112, %90
%92 = load i32, i32* %6
%93 = load i32, i32* %4
%94 = icmp slt i32 %92, %93
br i1 %94, label %95, label %115
95: ; preds = %91
%96 = load i8**, i8*** %5
%97 = load i32, i32* %6
%98 = sext i32 %97 to i64
%99 = getelementptr inbounds i8*, i8** %96, i64 %98
%100 = load i8*, i8** %99
%101 = getelementptr inbounds i8, i8* %100, i64 0
%102 = load i8, i8* %101
%103 = sext i8 %102 to i32
%104 = icmp ne i32 %103, 45
br i1 %104, label %105, label %111
105: ; preds = %95
%106 = load i8**, i8*** %5
%107 = load i32, i32* %6
%108 = sext i32 %107 to i64
%109 = getelementptr inbounds i8*, i8** %106, i64 %108
%110 = load i8*, i8** %109
store i8* %110, i8** %10
br label %111
111: ; preds = %105, %95
br label %112
112: ; preds = %111
%113 = load i32, i32* %6
%114 = add nsw i32 %113, 1
store i32 %114, i32* %6
br label %91
115: ; preds = %91
%116 = load i8*, i8** %10
%117 = icmp ne i8* %116, null
br i1 %117, label %124, label %118
118: ; preds = %115
%119 = load i32, i32* @stderr
%120 = load i8**, i8*** %5
%121 = getelementptr inbounds i8*, i8** %120, i64 0
%122 = load i8*, i8** %121
%123 = call i32 (i32, i8*, ...) @fprintf(i32 %119, i8* getelementptr inbounds ([275 x i8], [275 x i8]* @.str.1, i64 0, i64 0), i8* %122)
br label %353
124: ; preds = %115
%125 = load i8*, i8** %10
%126 = call i8* @AddStrings(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8* %125)
store i8* %126, i8** %9
%127 = load i8*, i8** %9
%128 = call i8* @AddStrings(i8* %127, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
store i8* %128, i8** %9
%129 = load i8*, i8** %9
%130 = call i32 @run(i8* %129, i8** %18)
%131 = load i8*, i8** %18
%132 = icmp ne i8* %131, null
br i1 %132, label %133, label %348
133: ; preds = %124
store i32 0, i32* %6
br label %134
134: ; preds = %315, %133
%135 = load i8*, i8** %18
%136 = load i32, i32* %6
%137 = sext i32 %136 to i64
%138 = getelementptr inbounds i8, i8* %135, i64 %137
%139 = load i8, i8* %138
%140 = sext i8 %139 to i32
%141 = icmp ne i32 %140, 0
br i1 %141, label %142, label %318
142: ; preds = %134
%143 = load i8*, i8** %18
%144 = load i32, i32* %6
%145 = sext i32 %144 to i64
%146 = getelementptr inbounds i8, i8* %143, i64 %145
%147 = load i8, i8* %146
%148 = sext i8 %147 to i32
%149 = icmp eq i32 %148, 10
br i1 %149, label %150, label %314
150: ; preds = %142
%151 = load i32, i32* %6
%152 = add nsw i32 %151, 1
store i32 %152, i32* %7
%153 = load i8*, i8** %18
%154 = load i32, i32* %7
%155 = sext i32 %154 to i64
%156 = getelementptr inbounds i8, i8* %153, i64 %155
%157 = load i8, i8* %156
%158 = sext i8 %157 to i32
switch i32 %158, label %241 [
i32 48, label %159
i32 49, label %186
i32 50, label %213
]
159: ; preds = %150
%160 = load i32, i32* %12
%161 = icmp eq i32 %160, 1
br i1 %161, label %162, label %172
162: ; preds = %159
%163 = load i8*, i8** %18
%164 = load i32, i32* %7
%165 = add nsw i32 %164, 1
%166 = sext i32 %165 to i64
%167 = getelementptr inbounds i8, i8* %163, i64 %166
%168 = load i8, i8* %167
%169 = sext i8 %168 to i32
%170 = icmp eq i32 %169, 32
br i1 %170, label %171, label %172
171: ; preds = %162
store i32 1, i32* %15
br label %172
172: ; preds = %171, %162, %159
%173 = load i32, i32* %12
%174 = icmp eq i32 %173, 0
br i1 %174, label %175, label %185
175: ; preds = %172
%176 = getelementptr inbounds [1 x i8], [1 x i8]* %16, i64 0, i64 0
%177 = load i8, i8* %176
%178 = sext i8 %177 to i32
%179 = icmp eq i32 %178, 49
br i1 %179, label %180, label %185
180: ; preds = %175
%181 = load i8*, i8** %18
%182 = load i32, i32* %7
%183 = sext i32 %182 to i64
%184 = getelementptr inbounds i8, i8* %181, i64 %183
store i8 50, i8* %184
store i32 1, i32* %15
br label %185
185: ; preds = %180, %175, %172
br label %241
186: ; preds = %150
%187 = load i32, i32* %13
%188 = icmp eq i32 %187, 1
br i1 %188, label %189, label %199
189: ; preds = %186
%190 = load i8*, i8** %18
%191 = load i32, i32* %7
%192 = add nsw i32 %191, 1
%193 = sext i32 %192 to i64
%194 = getelementptr inbounds i8, i8* %190, i64 %193
%195 = load i8, i8* %194
%196 = sext i8 %195 to i32
%197 = icmp eq i32 %196, 32
br i1 %197, label %198, label %199
198: ; preds = %189
store i32 1, i32* %15
br label %199
199: ; preds = %198, %189, %186
%200 = load i32, i32* %13
%201 = icmp eq i32 %200, 0
br i1 %201, label %202, label %212
202: ; preds = %199
%203 = getelementptr inbounds [1 x i8], [1 x i8]* %16, i64 0, i64 0
%204 = load i8, i8* %203
%205 = sext i8 %204 to i32
%206 = icmp eq i32 %205, 48
br i1 %206, label %207, label %212
207: ; preds = %202
%208 = load i8*, i8** %18
%209 = load i32, i32* %7
%210 = sext i32 %209 to i64
%211 = getelementptr inbounds i8, i8* %208, i64 %210
store i8 50, i8* %211
store i32 1, i32* %15
br label %212
212: ; preds = %207, %202, %199
br label %241
213: ; preds = %150
%214 = load i32, i32* %14
%215 = icmp eq i32 %214, 1
br i1 %215, label %216, label %226
216: ; preds = %213
%217 = load i8*, i8** %18
%218 = load i32, i32* %7
%219 = add nsw i32 %218, 1
%220 = sext i32 %219 to i64
%221 = getelementptr inbounds i8, i8* %217, i64 %220
%222 = load i8, i8* %221
%223 = sext i8 %222 to i32
%224 = icmp eq i32 %223, 32
br i1 %224, label %225, label %226
225: ; preds = %216
store i32 1, i32* %15
br label %226
226: ; preds = %225, %216, %213
%227 = load i32, i32* %14
%228 = icmp eq i32 %227, 0
br i1 %228, label %229, label %240
229: ; preds = %226
%230 = getelementptr inbounds [1 x i8], [1 x i8]* %16, i64 0, i64 0
%231 = load i8, i8* %230
%232 = sext i8 %231 to i32
%233 = icmp eq i32 %232, 48
br i1 %233, label %239, label %234
234: ; preds = %229
%235 = getelementptr inbounds [1 x i8], [1 x i8]* %16, i64 0, i64 0
%236 = load i8, i8* %235
%237 = sext i8 %236 to i32
%238 = icmp eq i32 %237, 49
br i1 %238, label %239, label %240
239: ; preds = %234, %229
store i32 1, i32* %15
br label %240
240: ; preds = %239, %234, %226
br label %241
241: ; preds = %150, %240, %212, %185
%242 = load i32, i32* %15
%243 = icmp eq i32 %242, 1
br i1 %243, label %249, label %244
244: ; preds = %241
%245 = getelementptr inbounds [1 x i8], [1 x i8]* %16, i64 0, i64 0
%246 = load i8, i8* %245
%247 = sext i8 %246 to i32
%248 = icmp eq i32 %247, 51
br i1 %248, label %249, label %313
249: ; preds = %244, %241
%250 = load i32, i32* %7
%251 = add nsw i32 %250, 1
store i32 %251, i32* %8
br label %252
252: ; preds = %261, %249
%253 = load i8*, i8** %18
%254 = load i32, i32* %8
%255 = sext i32 %254 to i64
%256 = getelementptr inbounds i8, i8* %253, i64 %255
%257 = load i8, i8* %256
%258 = sext i8 %257 to i32
%259 = icmp eq i32 %258, 32
br i1 %259, label %260, label %264
260: ; preds = %252
br label %261
261: ; preds = %260
%262 = load i32, i32* %8
%263 = add nsw i32 %262, 1
store i32 %263, i32* %8
br label %252
264: ; preds = %252
br label %265
265: ; preds = %273, %264
%266 = load i8*, i8** %18
%267 = load i32, i32* %8
%268 = sext i32 %267 to i64
%269 = getelementptr inbounds i8, i8* %266, i64 %268
%270 = load i8, i8* %269
%271 = sext i8 %270 to i32
%272 = icmp ne i32 %271, 32
br i1 %272, label %273, label %293
273: ; preds = %265
%274 = load i8*, i8** %11
%275 = load i32, i32* %17
%276 = add i32 %275, 1
store i32 %276, i32* %17
%277 = zext i32 %276 to i64
%278 = mul i64 %277, 8
%279 = trunc i64 %278 to i32
%280 = call i8* @realloc(i8* %274, i32 %279)
store i8* %280, i8** %11
%281 = load i8*, i8** %18
%282 = load i32, i32* %8
%283 = sext i32 %282 to i64
%284 = getelementptr inbounds i8, i8* %281, i64 %283
%285 = load i8, i8* %284
%286 = load i8*, i8** %11
%287 = load i32, i32* %17
%288 = sub i32 %287, 1
%289 = zext i32 %288 to i64
%290 = getelementptr inbounds i8, i8* %286, i64 %289
store i8 %285, i8* %290
%291 = load i32, i32* %8
%292 = add nsw i32 %291, 1
store i32 %292, i32* %8
br label %265
293: ; preds = %265
%294 = load i8*, i8** %11
%295 = load i32, i32* %17
%296 = add i32 %295, 1
%297 = zext i32 %296 to i64
%298 = mul i64 %297, 8
%299 = trunc i64 %298 to i32
%300 = call i8* @realloc(i8* %294, i32 %299)
store i8* %300, i8** %11
%301 = load i8*, i8** %11
%302 = load i32, i32* %17
%303 = add i32 %302, 1
store i32 %303, i32* %17
%304 = zext i32 %302 to i64
%305 = getelementptr inbounds i8, i8* %301, i64 %304
store i8 44, i8* %305
%306 = load i8*, i8** %18
%307 = load i32, i32* %7
%308 = sext i32 %307 to i64
%309 = getelementptr inbounds i8, i8* %306, i64 %308
%310 = load i8, i8* %309
%311 = getelementptr inbounds [1 x i8], [1 x i8]* %16, i64 0, i64 0
store i8 %310, i8* %311
%312 = load i32, i32* %8
store i32 %312, i32* %6
br label %313
313: ; preds = %293, %244
store i32 0, i32* %15
br label %314
314: ; preds = %313, %142
br label %315
315: ; preds = %314
%316 = load i32, i32* %6
%317 = add nsw i32 %316, 1
store i32 %317, i32* %6
br label %134
318: ; preds = %134
%319 = load i32, i32* @stderr
%320 = call i32 (i32, i8*, ...) @fprintf(i32 %319, i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str.4, i64 0, i64 0))
%321 = load i32, i32* @stderr
%322 = load i8*, i8** %18
%323 = call i32 (i32, i8*, ...) @fprintf(i32 %321, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8* %322)
%324 = load i32, i32* @stderr
%325 = call i32 (i32, i8*, ...) @fprintf(i32 %324, i8* getelementptr inbounds ([72 x i8], [72 x i8]* @.str.6, i64 0, i64 0))
%326 = load i32, i32* %17
%327 = icmp ugt i32 %326, 0
br i1 %327, label %328, label %343
328: ; preds = %318
%329 = load i8*, i8** %11
%330 = load i32, i32* %17
%331 = add i32 %330, -1
store i32 %331, i32* %17
%332 = zext i32 %331 to i64
%333 = getelementptr inbounds i8, i8* %329, i64 %332
store i8 0, i8* %333
%334 = load i32, i32* @stdout
%335 = load i8*, i8** %11
%336 = call i32 (i32, i8*, ...) @fprintf(i32 %334, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8* %335)
%337 = load i32, i32* %14
%338 = icmp eq i32 %337, 0
br i1 %338, label %339, label %342
339: ; preds = %328
%340 = load i32, i32* @stderr
%341 = call i32 (i32, i8*, ...) @fprintf(i32 %340, i8* getelementptr inbounds ([161 x i8], [161 x i8]* @.str.7, i64 0, i64 0))
br label %342
342: ; preds = %339, %328
br label %347
343: ; preds = %318
%344 = load i32, i32* @stderr
%345 = call i32 (i32, i8*, ...) @fprintf(i32 %344, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.8, i64 0, i64 0))
%346 = load i32, i32* @EXIT_FAILURE
store i32 %346, i32* %3
br label %354
347: ; preds = %342
br label %352
348: ; preds = %124
%349 = load i32, i32* @stderr
%350 = call i32 (i32, i8*, ...) @fprintf(i32 %349, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.9, i64 0, i64 0))
%351 = load i32, i32* @EXIT_FAILURE
store i32 %351, i32* %3
br label %354
352: ; preds = %347
br label %353
353: ; preds = %352, %118
store i32 0, i32* %3
br label %354
354: ; preds = %353, %348, %343
%355 = load i32, i32* %3
ret i32 %355
}

LLVM IR (-O2):
@stderr = global i32 0
@.str = [36 x i8] c"DefDB Parser v1.02 by Mr_KrzYch00\0A\0A\00"
@.str.1 = [275 x i8] c"Reads defdb output and parses it to be used with Zopfli KrzYmod's\0Acustom block split points command.\0A\0AArguments:\0A--b=# Export info for # block types only (0-2, d: 012)\0AThe output can be safely piped to file or command line\0A\0AExample:\0A%s filename.gz --b=0 >filename.cbs\0A\00"
@.str.2 = [7 x i8] c"defdb \00"
@.str.3 = [6 x i8] c" 2>&1\00"
@.str.4 = [74 x i8] c"========================\0ADEFDB OUTPUT [stderr]:\0A========================\0A\00"
@.str.5 = [3 x i8] c"%s\00"
@.str.6 = [72 x i8] c"========================\0ACBS OUTPUT [stdout]:\0A========================\0A\00"
@stdout = global i32 0
@.str.7 = [161 x i8] c"\0A\0APlease note that when block types 2 are not selected each block\0Atype 0 and 1 will be followed by block type 2 to mark correct\0Aboundaries of mentioned blocks.\0A\00"
@.str.8 = [41 x i8] c"Error: No blocks found in defdb output.\0A\00"
@EXIT_FAILURE = global i32 0
@.str.9 = [16 x i8] c"Unknown error.\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca i8*
%4 = bitcast i8** %3 to i8*
store i8* null, i8** %3
%5 = load i32, i32* @stderr
%6 = tail call i32 (i32, i8*, ...) @fprintf(i32 %5, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0))
%7 = icmp sgt i32 %0, 1
br i1 %7, label %8, label %117
8: ; preds = %2
%9 = zext i32 %0 to i64
br label %18
10: ; preds = %61
br i1 %7, label %11, label %117
11: ; preds = %10
%12 = add nsw i64 %9, -1
%13 = add nsw i64 %9, -2
%14 = and i64 %12, 3
%15 = icmp ult i64 %13, 3
br i1 %15, label %97, label %16
16: ; preds = %11
%17 = and i64 %12, -4
br label %67
18: ; preds = %8, %61
%19 = phi i64 [ 1, %8 ], [ %65, %61 ]
%20 = phi i32 [ 1, %8 ], [ %64, %61 ]
%21 = phi i32 [ 1, %8 ], [ %63, %61 ]
%22 = phi i32 [ 1, %8 ], [ %62, %61 ]
%23 = getelementptr inbounds i8*, i8** %1, i64 %19
%24 = load i8*, i8** %23
%25 = load i8, i8* %24
%26 = icmp eq i8 %25, 45
br i1 %26, label %27, label %61
27: ; preds = %18
%28 = getelementptr inbounds i8, i8* %24, i64 1
%29 = load i8, i8* %28
%30 = icmp eq i8 %29, 45
br i1 %30, label %31, label %61
31: ; preds = %27
%32 = getelementptr inbounds i8, i8* %24, i64 2
%33 = load i8, i8* %32
%34 = icmp eq i8 %33, 98
br i1 %34, label %35, label %61
35: ; preds = %31
%36 = getelementptr inbounds i8, i8* %24, i64 3
%37 = load i8, i8* %36
%38 = icmp eq i8 %37, 61
br i1 %38, label %39, label %61
39: ; preds = %35
%40 = getelementptr inbounds i8, i8* %24, i64 4
%41 = load i8, i8* %40
%42 = icmp eq i8 %41, 0
br i1 %42, label %61, label %43
43: ; preds = %39, %53
%44 = phi i64 [ %57, %53 ], [ 4, %39 ]
%45 = phi i8 [ %59, %53 ], [ %41, %39 ]
%46 = phi i32 [ %56, %53 ], [ 0, %39 ]
%47 = phi i32 [ %55, %53 ], [ 0, %39 ]
%48 = phi i32 [ %54, %53 ], [ 0, %39 ]
%49 = sext i8 %45 to i32
switch i32 %49, label %53 [
i32 48, label %50
i32 49, label %51
i32 50, label %52
]
50: ; preds = %43
br label %53
51: ; preds = %43
br label %53
52: ; preds = %43
br label %53
53: ; preds = %50, %51, %52, %43
%54 = phi i32 [ %48, %43 ], [ %48, %52 ], [ %48, %51 ], [ 1, %50 ]
%55 = phi i32 [ %47, %43 ], [ %47, %52 ], [ 1, %51 ], [ %47, %50 ]
%56 = phi i32 [ %46, %43 ], [ 1, %52 ], [ %46, %51 ], [ %46, %50 ]
%57 = add nuw i64 %44, 1
%58 = getelementptr inbounds i8, i8* %24, i64 %57
%59 = load i8, i8* %58
%60 = icmp eq i8 %59, 0
br i1 %60, label %61, label %43
61: ; preds = %53, %39, %35, %31, %27, %18
%62 = phi i32 [ %22, %39 ], [ %22, %35 ], [ %22, %31 ], [ %22, %27 ], [ %22, %18 ], [ %54, %53 ]
%63 = phi i32 [ %21, %39 ], [ %21, %35 ], [ %21, %31 ], [ %21, %27 ], [ %21, %18 ], [ %55, %53 ]
%64 = phi i32 [ %20, %39 ], [ %20, %35 ], [ %20, %31 ], [ %20, %27 ], [ %20, %18 ], [ %56, %53 ]
%65 = add nuw nsw i64 %19, 1
%66 = icmp eq i64 %65, %9
br i1 %66, label %10, label %18
67: ; preds = %67, %16
%68 = phi i64 [ 1, %16 ], [ %94, %67 ]
%69 = phi i8* [ null, %16 ], [ %93, %67 ]
%70 = phi i64 [ 0, %16 ], [ %95, %67 ]
%71 = getelementptr inbounds i8*, i8** %1, i64 %68
%72 = load i8*, i8** %71
%73 = load i8, i8* %72
%74 = icmp eq i8 %73, 45
%75 = select i1 %74, i8* %69, i8* %72
%76 = add nuw nsw i64 %68, 1
%77 = getelementptr inbounds i8*, i8** %1, i64 %76
%78 = load i8*, i8** %77
%79 = load i8, i8* %78
%80 = icmp eq i8 %79, 45
%81 = select i1 %80, i8* %75, i8* %78
%82 = add nuw nsw i64 %68, 2
%83 = getelementptr inbounds i8*, i8** %1, i64 %82
%84 = load i8*, i8** %83
%85 = load i8, i8* %84
%86 = icmp eq i8 %85, 45
%87 = select i1 %86, i8* %81, i8* %84
%88 = add nuw nsw i64 %68, 3
%89 = getelementptr inbounds i8*, i8** %1, i64 %88
%90 = load i8*, i8** %89
%91 = load i8, i8* %90
%92 = icmp eq i8 %91, 45
%93 = select i1 %92, i8* %87, i8* %90
%94 = add nuw nsw i64 %68, 4
%95 = add i64 %70, 4
%96 = icmp eq i64 %95, %17
br i1 %96, label %97, label %67
97: ; preds = %67, %11
%98 = phi i8* [ undef, %11 ], [ %93, %67 ]
%99 = phi i64 [ 1, %11 ], [ %94, %67 ]
%100 = phi i8* [ null, %11 ], [ %93, %67 ]
%101 = icmp eq i64 %14, 0
br i1 %101, label %114, label %102
102: ; preds = %97, %102
%103 = phi i64 [ %111, %102 ], [ %99, %97 ]
%104 = phi i8* [ %110, %102 ], [ %100, %97 ]
%105 = phi i64 [ %112, %102 ], [ 0, %97 ]
%106 = getelementptr inbounds i8*, i8** %1, i64 %103
%107 = load i8*, i8** %106
%108 = load i8, i8* %107
%109 = icmp eq i8 %108, 45
%110 = select i1 %109, i8* %104, i8* %107
%111 = add nuw nsw i64 %103, 1
%112 = add i64 %105, 1
%113 = icmp eq i64 %112, %14
br i1 %113, label %114, label %102
114: ; preds = %102, %97
%115 = phi i8* [ %98, %97 ], [ %110, %102 ]
%116 = icmp eq i8* %115, null
br i1 %116, label %117, label %121
117: ; preds = %2, %10, %114
%118 = load i32, i32* @stderr
%119 = load i8*, i8** %1
%120 = tail call i32 (i32, i8*, ...) @fprintf(i32 %118, i8* getelementptr inbounds ([275 x i8], [275 x i8]* @.str.1, i64 0, i64 0), i8* %119)
br label %270
121: ; preds = %114
%122 = tail call i8* @AddStrings(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.2, i64 0, i64 0), i8* %115)
%123 = tail call i8* @AddStrings(i8* %122, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0))
%124 = call i32 @run(i8* %123, i8** %3)
%125 = load i8*, i8** %3
%126 = icmp eq i8* %125, null
br i1 %126, label %266, label %127
127: ; preds = %121
%128 = icmp eq i32 %64, 1
%129 = icmp eq i32 %64, 0
%130 = icmp eq i32 %63, 1
%131 = icmp eq i32 %63, 0
%132 = icmp eq i32 %62, 1
%133 = icmp eq i32 %62, 0
br label %134
134: ; preds = %127, %237
%135 = phi i8* [ %238, %237 ], [ %125, %127 ]
%136 = phi i32 [ %243, %237 ], [ 0, %127 ]
%137 = phi i8* [ %240, %237 ], [ null, %127 ]
%138 = phi i8 [ %241, %237 ], [ 51, %127 ]
%139 = phi i32 [ %242, %237 ], [ 0, %127 ]
%140 = sext i32 %136 to i64
%141 = getelementptr inbounds i8, i8* %135, i64 %140
%142 = load i8, i8* %141
switch i8 %142, label %237 [
i8 0, label %244
i8 10, label %143
]
143: ; preds = %134
%144 = add nsw i32 %136, 1
%145 = sext i32 %144 to i64
%146 = getelementptr inbounds i8, i8* %135, i64 %145
%147 = load i8, i8* %146
%148 = sext i8 %147 to i32
switch i32 %148, label %185 [
i32 48, label %149
i32 49, label %160
i32 50, label %171
]
149: ; preds = %143
br i1 %132, label %150, label %157
150: ; preds = %149
%151 = add nsw i32 %136, 2
%152 = sext i32 %151 to i64
%153 = getelementptr inbounds i8, i8* %135, i64 %152
%154 = load i8, i8* %153
%155 = icmp eq i8 %154, 32
%156 = zext i1 %155 to i32
br label %185
157: ; preds = %149
%158 = icmp eq i8 %138, 49
%159 = select i1 %133, i1 %158, i1 false
br i1 %159, label %190, label %185
160: ; preds = %143
br i1 %130, label %161, label %168
161: ; preds = %160
%162 = add nsw i32 %136, 2
%163 = sext i32 %162 to i64
%164 = getelementptr inbounds i8, i8* %135, i64 %163
%165 = load i8, i8* %164
%166 = icmp eq i8 %165, 32
%167 = zext i1 %166 to i32
br label %185
168: ; preds = %160
%169 = icmp eq i8 %138, 48
%170 = select i1 %131, i1 %169, i1 false
br i1 %170, label %190, label %185
171: ; preds = %143
br i1 %128, label %172, label %179
172: ; preds = %171
%173 = add nsw i32 %136, 2
%174 = sext i32 %173 to i64
%175 = getelementptr inbounds i8, i8* %135, i64 %174
%176 = load i8, i8* %175
%177 = icmp eq i8 %176, 32
%178 = zext i1 %177 to i32
br label %179
179: ; preds = %172, %171
%180 = phi i32 [ 0, %171 ], [ %178, %172 ]
%181 = and i8 %138, -2
%182 = icmp eq i8 %181, 48
%183 = select i1 %129, i1 %182, i1 false
%184 = select i1 %183, i32 1, i32 %180
br label %185
185: ; preds = %161, %150, %179, %168, %157, %143
%186 = phi i32 [ 0, %143 ], [ 0, %168 ], [ 0, %157 ], [ %184, %179 ], [ %156, %150 ], [ %167, %161 ]
%187 = icmp eq i32 %186, 1
%188 = icmp eq i8 %138, 51
%189 = select i1 %187, i1 true, i1 %188
br i1 %189, label %191, label %237
190: ; preds = %168, %157
store i8 50, i8* %146
br label %191
191: ; preds = %190, %185
%192 = add i32 %136, 2
%193 = load i8*, i8** %3
%194 = sext i32 %192 to i64
br label %195
195: ; preds = %195, %191
%196 = phi i64 [ %200, %195 ], [ %194, %191 ]
%197 = getelementptr inbounds i8, i8* %193, i64 %196
%198 = load i8, i8* %197
%199 = icmp eq i8 %198, 32
%200 = add i64 %196, 1
br i1 %199, label %195, label %201
201: ; preds = %195
%202 = shl i64 %196, 32
%203 = ashr exact i64 %202, 32
%204 = getelementptr inbounds i8, i8* %193, i64 %203
%205 = load i8, i8* %204
%206 = icmp eq i8 %205, 32
br i1 %206, label %224, label %207
207: ; preds = %201, %207
%208 = phi i64 [ %219, %207 ], [ %203, %201 ]
%209 = phi i32 [ %211, %207 ], [ %139, %201 ]
%210 = phi i8* [ %213, %207 ], [ %137, %201 ]
%211 = add i32 %209, 1
%212 = shl i32 %211, 3
%213 = call i8* @realloc(i8* %210, i32 %212)
%214 = load i8*, i8** %3
%215 = getelementptr inbounds i8, i8* %214, i64 %208
%216 = load i8, i8* %215
%217 = zext i32 %209 to i64
%218 = getelementptr inbounds i8, i8* %213, i64 %217
store i8 %216, i8* %218
%219 = add i64 %208, 1
%220 = load i8*, i8** %3
%221 = getelementptr inbounds i8, i8* %220, i64 %219
%222 = load i8, i8* %221
%223 = icmp eq i8 %222, 32
br i1 %223, label %224, label %207
224: ; preds = %207, %201
%225 = phi i64 [ %196, %201 ], [ %219, %207 ]
%226 = phi i8* [ %137, %201 ], [ %213, %207 ]
%227 = phi i32 [ %139, %201 ], [ %211, %207 ]
%228 = trunc i64 %225 to i32
%229 = add i32 %227, 1
%230 = shl i32 %229, 3
%231 = call i8* @realloc(i8* %226, i32 %230)
%232 = zext i32 %227 to i64
%233 = getelementptr inbounds i8, i8* %231, i64 %232
store i8 44, i8* %233
%234 = load i8*, i8** %3
%235 = getelementptr inbounds i8, i8* %234, i64 %145
%236 = load i8, i8* %235
br label %237
237: ; preds = %224, %185, %134
%238 = phi i8* [ %135, %134 ], [ %234, %224 ], [ %135, %185 ]
%239 = phi i32 [ %136, %134 ], [ %228, %224 ], [ %136, %185 ]
%240 = phi i8* [ %137, %134 ], [ %231, %224 ], [ %137, %185 ]
%241 = phi i8 [ %138, %134 ], [ %236, %224 ], [ %138, %185 ]
%242 = phi i32 [ %139, %134 ], [ %229, %224 ], [ %139, %185 ]
%243 = add nsw i32 %239, 1
br label %134
244: ; preds = %134
%245 = load i32, i32* @stderr
%246 = call i32 (i32, i8*, ...) @fprintf(i32 %245, i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str.4, i64 0, i64 0))
%247 = load i32, i32* @stderr
%248 = load i8*, i8** %3
%249 = call i32 (i32, i8*, ...) @fprintf(i32 %247, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8* %248)
%250 = load i32, i32* @stderr
%251 = call i32 (i32, i8*, ...) @fprintf(i32 %250, i8* getelementptr inbounds ([72 x i8], [72 x i8]* @.str.6, i64 0, i64 0))
%252 = icmp eq i32 %139, 0
br i1 %252, label %262, label %253
253: ; preds = %244
%254 = add i32 %139, -1
%255 = zext i32 %254 to i64
%256 = getelementptr inbounds i8, i8* %137, i64 %255
store i8 0, i8* %256
%257 = load i32, i32* @stdout
%258 = call i32 (i32, i8*, ...) @fprintf(i32 %257, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i8* %137)
br i1 %129, label %259, label %270
259: ; preds = %253
%260 = load i32, i32* @stderr
%261 = call i32 (i32, i8*, ...) @fprintf(i32 %260, i8* getelementptr inbounds ([161 x i8], [161 x i8]* @.str.7, i64 0, i64 0))
br label %270
262: ; preds = %244
%263 = load i32, i32* @stderr
%264 = call i32 (i32, i8*, ...) @fprintf(i32 %263, i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.8, i64 0, i64 0))
%265 = load i32, i32* @EXIT_FAILURE
br label %270
266: ; preds = %121
%267 = load i32, i32* @stderr
%268 = call i32 (i32, i8*, ...) @fprintf(i32 %267, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.9, i64 0, i64 0))
%269 = load i32, i32* @EXIT_FAILURE
br label %270
270: ; preds = %117, %259, %253, %266, %262
%271 = phi i32 [ %265, %262 ], [ %269, %266 ], [ 0, %253 ], [ 0, %259 ], [ 0, %117 ]
ret i32 %271
}