#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 */
typedef int uint8_t;

/* Variables and functions */
int /*<<< orphan*/ info(int /*<<< orphan*/, char *, ...);
int hexdump_cmd(uint8_t *buff, int size) {
  int state, offs;
  int blen = 0;
  int addr = 0;
  int chain = 0;
  int badr = 0;
  int bcnt = 0;
  int i;
  state = 0;
  chain = 0;
  for (offs = 0; offs < size; offs++) {
    switch (state) {
    case 0:
      switch (buff[offs]) {
      case 0x01:
        info(0, "%05x: %02x", offs, buff[offs]);
        state = 1;
        break;
      case 0x02:
        info(0, "%05x: %02x", offs, buff[offs]);
        state = 2;
        break;
      default:
        info(0, "%05x: %02x", offs, buff[offs]);
        state = 3;
        break;
      }
      break;
    case 1:
      blen = buff[offs];
      state = 4;
      info(0, " %02x", buff[offs]);
      break;
    case 2:
      blen = buff[offs];
      state = 5;
      if (2 != blen) {
        blen = 2;
      }
      info(0, " %02x", buff[offs]);
      break;
    case 3:
      blen = buff[offs];
      bcnt = 0;
      state = 6;
      info(0, " %02x (comment length %03x)\n", buff[offs], blen);
      break;
    case 4:
      blen--;
      addr = buff[offs];
      state = 7;
      info(0, " %02x", buff[offs]);
      break;
    case 5:
      blen--;
      badr = buff[offs];
      state = 8;
      info(0, " %02x", buff[offs]);
      break;
    case 6:
      if (0 == (bcnt & 15))
        info(0, "%05x:(%04x)", offs, bcnt);
      info(0, " %02x", buff[offs]);
      bcnt++;
      if (0 == (bcnt & 15))
        info(0, "\n");
      if (--blen <= 0) {
        if (0 != (bcnt & 15))
          info(0, "\n");
        state = 0;
      }
      break;
    case 7:
      blen--;
      addr = 256 * buff[offs] + addr;
      state = 9;
      bcnt = 0;
      if (blen <= 0)
        blen += 256;
      info(0, " %02x (data length %03x @ %04x)\n", buff[offs], blen, addr);
      break;
    case 8:
      blen--;
      badr = 256 * buff[offs] + badr;
      bcnt = 0;
      info(0, " %02x (entry point %04x)\n", buff[offs], badr);
      offs = size;
      break;
    case 9:
      if (0 == (bcnt & 15))
        info(0, "%05x:(%04x)", offs, addr + bcnt);
      info(0, " %02x", buff[offs]);
      bcnt++;
      if (0 == (bcnt & 15)) {
        info(0, " - ");
        for (i = -15; i <= 0; i++)
          info(0, "%c",
               ((buff[offs + i]) < 32 || (buff[offs + i]) > 126
                    ? '.'
                    : (buff[offs + i])));
        info(0, "\n");
      }
      if (--blen <= 0) {
        if (0 != (bcnt & 15)) {
          info(0, "%-*s - ", 3 * (16 - (bcnt & 15)), "");
          for (i = -(bcnt & 15); i <= 0; i++)
            info(0, "%c",
                 ((buff[offs + i]) < 32 || (buff[offs + i]) > 126
                      ? '.'
                      : (buff[offs + i])));
          info(0, "\n");
        }
        state = 0;
      }
      break;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<hexdump_cmd>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
movl   $0x0,-0x24(%rbp)
movl   $0x0,-0x28(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x20(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    16c4 <hexdump_cmd+0x5b4>
mov    -0x10(%rbp),%eax
mov    %rax,-0x38(%rbp)
sub    $0x9,%rax
ja     16b1 <hexdump_cmd+0x5a1>
mov    -0x38(%rbp),%rax
lea    0xe81(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x3c(%rbp)
sub    $0x1,%eax
je     11b5 <hexdump_cmd+0xa5>
jmp    11a4 <hexdump_cmd+0x94>
mov    -0x3c(%rbp),%eax
sub    $0x2,%eax
je     11df <hexdump_cmd+0xcf>
jmp    1209 <hexdump_cmd+0xf9>
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%ecx
xor    %edi,%edi
lea    0xe5c(%rip),%rsi
mov    $0x0,%al
call   1030 <info@plt>
movl   $0x1,-0x10(%rbp)
jmp    122e <hexdump_cmd+0x11e>
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%ecx
xor    %edi,%edi
lea    0xe32(%rip),%rsi
mov    $0x0,%al
call   1030 <info@plt>
movl   $0x2,-0x10(%rbp)
jmp    122e <hexdump_cmd+0x11e>
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%ecx
xor    %edi,%edi
lea    0xe08(%rip),%rsi
mov    $0x0,%al
call   1030 <info@plt>
movl   $0x3,-0x10(%rbp)
jmp    16b1 <hexdump_cmd+0x5a1>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x18(%rbp)
movl   $0x4,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
xor    %edi,%edi
lea    0xdd1(%rip),%rsi
mov    $0x0,%al
call   1030 <info@plt>
jmp    16b1 <hexdump_cmd+0x5a1>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x18(%rbp)
movl   $0x5,-0x10(%rbp)
mov    $0x2,%eax
cmp    -0x18(%rbp),%eax
je     1292 <hexdump_cmd+0x182>
movl   $0x2,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
xor    %edi,%edi
lea    0xd87(%rip),%rsi
mov    $0x0,%al
call   1030 <info@plt>
jmp    16b1 <hexdump_cmd+0x5a1>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x18(%rbp)
movl   $0x0,-0x28(%rbp)
movl   $0x6,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x18(%rbp),%ecx
xor    %edi,%edi
lea    0xd4e(%rip),%rsi
mov    $0x0,%al
call   1030 <info@plt>
jmp    16b1 <hexdump_cmd+0x5a1>
mov    -0x18(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x1c(%rbp)
movl   $0x7,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
xor    %edi,%edi
lea    0xd0a(%rip),%rsi
mov    $0x0,%al
call   1030 <info@plt>
jmp    16b1 <hexdump_cmd+0x5a1>
mov    -0x18(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x24(%rbp)
movl   $0x8,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
xor    %edi,%edi
lea    0xccc(%rip),%rsi
mov    $0x0,%al
call   1030 <info@plt>
jmp    16b1 <hexdump_cmd+0x5a1>
mov    -0x28(%rbp),%ecx
and    $0xf,%ecx
xor    %eax,%eax
cmp    %ecx,%eax
jne    1393 <hexdump_cmd+0x283>
mov    -0x14(%rbp),%edx
mov    -0x28(%rbp),%ecx
xor    %edi,%edi
lea    0xcc4(%rip),%rsi
mov    $0x0,%al
call   1030 <info@plt>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
xor    %edi,%edi
lea    0xc86(%rip),%rsi
mov    $0x0,%al
call   1030 <info@plt>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
mov    -0x28(%rbp),%ecx
and    $0xf,%ecx
xor    %eax,%eax
cmp    %ecx,%eax
jne    13d7 <hexdump_cmd+0x2c7>
xor    %edi,%edi
lea    0xc7e(%rip),%rsi
mov    $0x0,%al
call   1030 <info@plt>
mov    -0x18(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x18(%rbp)
cmp    $0x0,%eax
jg     1410 <hexdump_cmd+0x300>
mov    -0x28(%rbp),%ecx
and    $0xf,%ecx
xor    %eax,%eax
cmp    %ecx,%eax
je     1409 <hexdump_cmd+0x2f9>
xor    %edi,%edi
lea    0xc4c(%rip),%rsi
mov    $0x0,%al
call   1030 <info@plt>
movl   $0x0,-0x10(%rbp)
jmp    16b1 <hexdump_cmd+0x5a1>
mov    -0x18(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
shl    $0x8,%eax
add    -0x1c(%rbp),%eax
mov    %eax,-0x1c(%rbp)
movl   $0x9,-0x10(%rbp)
movl   $0x0,-0x28(%rbp)
cmpl   $0x0,-0x18(%rbp)
jg     1455 <hexdump_cmd+0x345>
mov    -0x18(%rbp),%eax
add    $0x100,%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x18(%rbp),%ecx
mov    -0x1c(%rbp),%r8d
xor    %edi,%edi
lea    0xbec(%rip),%rsi
mov    $0x0,%al
call   1030 <info@plt>
jmp    16b1 <hexdump_cmd+0x5a1>
mov    -0x18(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%eax
shl    $0x8,%eax
add    -0x24(%rbp),%eax
mov    %eax,-0x24(%rbp)
movl   $0x0,-0x28(%rbp)
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
mov    -0x24(%rbp),%ecx
xor    %edi,%edi
lea    0xbc6(%rip),%rsi
mov    $0x0,%al
call   1030 <info@plt>
mov    -0xc(%rbp),%eax
mov    %eax,-0x14(%rbp)
jmp    16b1 <hexdump_cmd+0x5a1>
mov    -0x28(%rbp),%ecx
and    $0xf,%ecx
xor    %eax,%eax
cmp    %ecx,%eax
jne    14f2 <hexdump_cmd+0x3e2>
mov    -0x14(%rbp),%edx
mov    -0x1c(%rbp),%ecx
add    -0x28(%rbp),%ecx
xor    %edi,%edi
lea    0xb65(%rip),%rsi
mov    $0x0,%al
call   1030 <info@plt>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
xor    %edi,%edi
lea    0xb27(%rip),%rsi
mov    $0x0,%al
call   1030 <info@plt>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
mov    -0x28(%rbp),%ecx
and    $0xf,%ecx
xor    %eax,%eax
cmp    %ecx,%eax
jne    15c6 <hexdump_cmd+0x4b6>
xor    %edi,%edi
lea    0xb6f(%rip),%rsi
mov    $0x0,%al
call   1030 <info@plt>
movl   $0xfffffff1,-0x2c(%rbp)
cmpl   $0x0,-0x2c(%rbp)
jg     15b6 <hexdump_cmd+0x4a6>
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
add    -0x2c(%rbp),%ecx
movslq %ecx,%rcx
cmpl   $0x20,(%rax,%rcx,4)
jl     1575 <hexdump_cmd+0x465>
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
add    -0x2c(%rbp),%ecx
movslq %ecx,%rcx
cmpl   $0x7e,(%rax,%rcx,4)
jle    1582 <hexdump_cmd+0x472>
mov    $0x2e,%eax
mov    %eax,-0x40(%rbp)
jmp    1595 <hexdump_cmd+0x485>
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
add    -0x2c(%rbp),%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x40(%rbp)
mov    -0x40(%rbp),%edx
xor    %edi,%edi
lea    0xaf6(%rip),%rsi
mov    $0x0,%al
call   1030 <info@plt>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    153d <hexdump_cmd+0x42d>
xor    %edi,%edi
lea    0xa8f(%rip),%rsi
mov    $0x0,%al
call   1030 <info@plt>
mov    -0x18(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x18(%rbp)
cmp    $0x0,%eax
jg     16ac <hexdump_cmd+0x59c>
mov    -0x28(%rbp),%ecx
and    $0xf,%ecx
xor    %eax,%eax
cmp    %ecx,%eax
je     16a5 <hexdump_cmd+0x595>
mov    -0x28(%rbp),%ecx
and    $0xf,%ecx
mov    $0x10,%eax
sub    %ecx,%eax
imul   $0x3,%eax,%edx
xor    %edi,%edi
lea    0xa99(%rip),%rsi
lea    0xa47(%rip),%rcx
mov    $0x0,%al
call   1030 <info@plt>
mov    -0x28(%rbp),%ecx
and    $0xf,%ecx
xor    %eax,%eax
sub    %ecx,%eax
mov    %eax,-0x2c(%rbp)
cmpl   $0x0,-0x2c(%rbp)
jg     1695 <hexdump_cmd+0x585>
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
add    -0x2c(%rbp),%ecx
movslq %ecx,%rcx
cmpl   $0x20,(%rax,%rcx,4)
jl     1654 <hexdump_cmd+0x544>
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
add    -0x2c(%rbp),%ecx
movslq %ecx,%rcx
cmpl   $0x7e,(%rax,%rcx,4)
jle    1661 <hexdump_cmd+0x551>
mov    $0x2e,%eax
mov    %eax,-0x44(%rbp)
jmp    1674 <hexdump_cmd+0x564>
mov    -0x8(%rbp),%rax
mov    -0x14(%rbp),%ecx
add    -0x2c(%rbp),%ecx
movslq %ecx,%rcx
mov    (%rax,%rcx,4),%eax
mov    %eax,-0x44(%rbp)
mov    -0x44(%rbp),%edx
xor    %edi,%edi
lea    0xa17(%rip),%rsi
mov    $0x0,%al
call   1030 <info@plt>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    161c <hexdump_cmd+0x50c>
xor    %edi,%edi
lea    0x9b0(%rip),%rsi
mov    $0x0,%al
call   1030 <info@plt>
movl   $0x0,-0x10(%rbp)
jmp    16b1 <hexdump_cmd+0x5a1>
jmp    16b6 <hexdump_cmd+0x5a6>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1157 <hexdump_cmd+0x47>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<hexdump_cmd>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
test   %esi,%esi
jle    1703 <hexdump_cmd+0x5f3>
mov    %esi,%ebx
mov    %rdi,%r15
lea    0xece(%rip),%rbp
xor    %eax,%eax
mov    %rax,0x10(%rsp)
movl   $0x0,0x1c(%rsp)
xor    %r12d,%r12d
xor    %eax,%eax
mov    %rax,0x20(%rsp)
xor    %r13d,%r13d
xor    %r14d,%r14d
mov    %esi,0xc(%rsp)
mov    %rdi,0x30(%rsp)
jmp    11ad <hexdump_cmd+0x9d>
add    $0xffffffff,%r13d
movslq %r14d,%rax
mov    (%r15,%rax,4),%edx
mov    %edx,%eax
shl    $0x8,%eax
mov    0x1c(%rsp),%ecx
add    %eax,%ecx
xor    %eax,%eax
mov    %rax,0x10(%rsp)
xor    %edi,%edi
lea    0xefb(%rip),%rsi
mov    %ecx,0x1c(%rsp)
xor    %eax,%eax
call   1030 <info@plt>
mov    $0x8,%r12d
mov    %ebx,%r14d
cs nopw 0x0(%rax,%rax,1)
add    $0x1,%r14d
cmp    %ebx,%r14d
jge    1703 <hexdump_cmd+0x5f3>
cmp    $0x9,%r12d
ja     11a0 <hexdump_cmd+0x90>
mov    %r12d,%eax
movslq 0x0(%rbp,%rax,4),%rax
add    %rbp,%rax
jmp    *%rax
movslq %r14d,%rax
mov    (%r15,%rax,4),%ecx
cmp    $0x2,%ecx
je     16aa <hexdump_cmd+0x59a>
cmp    $0x1,%ecx
jne    16cd <hexdump_cmd+0x5bd>
mov    $0x1,%r12d
xor    %edi,%edi
lea    0xe40(%rip),%rsi
mov    %r14d,%edx
mov    $0x1,%ecx
jmp    16c1 <hexdump_cmd+0x5b1>
movslq %r14d,%rax
mov    (%r15,%rax,4),%r13d
xor    %edi,%edi
lea    0xe28(%rip),%rsi
mov    %r13d,%edx
xor    %eax,%eax
call   1030 <info@plt>
mov    $0x4,%r12d
jmp    11a0 <hexdump_cmd+0x90>
movslq %r14d,%rax
mov    (%r15,%rax,4),%edx
xor    %edi,%edi
lea    0xe06(%rip),%rsi
xor    %eax,%eax
call   1030 <info@plt>
mov    $0x5,%r12d
mov    $0x2,%r13d
jmp    11a0 <hexdump_cmd+0x90>
movslq %r14d,%rax
mov    (%r15,%rax,4),%r13d
xor    %eax,%eax
mov    %rax,0x10(%rsp)
xor    %edi,%edi
lea    0xddd(%rip),%rsi
mov    %r13d,%edx
mov    %r13d,%ecx
xor    %eax,%eax
call   1030 <info@plt>
mov    $0x6,%r12d
jmp    11a0 <hexdump_cmd+0x90>
add    $0xffffffff,%r13d
movslq %r14d,%rax
mov    (%r15,%rax,4),%edx
xor    %edi,%edi
lea    0xdab(%rip),%rsi
mov    %rdx,0x20(%rsp)
xor    %eax,%eax
call   1030 <info@plt>
mov    $0x7,%r12d
jmp    11a0 <hexdump_cmd+0x90>
add    $0xffffffff,%r13d
movslq %r14d,%rax
mov    (%r15,%rax,4),%edx
xor    %edi,%edi
lea    0xd80(%rip),%rsi
mov    %edx,0x1c(%rsp)
xor    %eax,%eax
call   1030 <info@plt>
mov    $0x8,%r12d
jmp    11a0 <hexdump_cmd+0x90>
mov    0x10(%rsp),%rbx
test   $0xf,%bl
jne    12e2 <hexdump_cmd+0x1d2>
xor    %edi,%edi
lea    0xd7a(%rip),%rsi
mov    %r14d,%edx
mov    %ebx,%ecx
xor    %eax,%eax
call   1030 <info@plt>
movslq %r14d,%rax
mov    (%r15,%rax,4),%edx
xor    %edi,%edi
lea    0xd3b(%rip),%rsi
xor    %eax,%eax
call   1030 <info@plt>
add    $0x1,%ebx
test   $0xf,%bl
mov    %rbx,0x10(%rsp)
je     148e <hexdump_cmd+0x37e>
lea    -0x1(%r13),%ebx
mov    $0x6,%r12d
cmp    $0x1,%r13d
jg     132d <hexdump_cmd+0x21d>
xor    %r12d,%r12d
xor    %edi,%edi
lea    0xd28(%rip),%rsi
xor    %eax,%eax
call   1030 <info@plt>
mov    %ebx,%r13d
mov    0xc(%rsp),%ebx
jmp    11a0 <hexdump_cmd+0x90>
movslq %r14d,%rax
mov    (%r15,%rax,4),%edx
mov    %edx,%eax
shl    $0x8,%eax
mov    0x20(%rsp),%r8
add    %eax,%r8d
xor    %eax,%eax
cmp    $0x2,%r13d
setl   %al
shl    $0x8,%eax
add    %eax,%r13d
add    $0xffffffff,%r13d
xor    %eax,%eax
mov    %rax,0x10(%rsp)
xor    %edi,%edi
lea    0xcec(%rip),%rsi
mov    %r13d,%ecx
mov    %r8,0x20(%rsp)
xor    %eax,%eax
call   1030 <info@plt>
mov    $0x9,%r12d
jmp    11a0 <hexdump_cmd+0x90>
mov    0x10(%rsp),%rbx
test   $0xf,%bl
jne    13af <hexdump_cmd+0x29f>
mov    0x20(%rsp),%rax
lea    (%rbx,%rax,1),%ecx
xor    %edi,%edi
lea    0xcab(%rip),%rsi
mov    %r14d,%edx
xor    %eax,%eax
call   1030 <info@plt>
movslq %r14d,%rbp
mov    (%r15,%rbp,4),%edx
xor    %edi,%edi
lea    0xc6e(%rip),%rsi
xor    %eax,%eax
call   1030 <info@plt>
add    $0x1,%ebx
mov    %r15,%r12
mov    %rbx,0x10(%rsp)
mov    %ebx,%r15d
and    $0xf,%r15d
je     14c1 <hexdump_cmd+0x3b1>
lea    -0x1(%r13),%eax
mov    $0x9,%r12d
cmp    $0x1,%r13d
jg     16eb <hexdump_cmd+0x5db>
mov    %eax,0x2c(%rsp)
mov    $0x10,%eax
sub    %r15d,%eax
lea    (%rax,%rax,2),%edx
xor    %edi,%edi
lea    0xc90(%rip),%rsi
lea    0xc3e(%rip),%rcx
xor    %eax,%eax
call   1030 <info@plt>
neg    %r15d
movslq %r15d,%rbx
mov    0x30(%rsp),%r15
lea    (%r15,%rbp,4),%rbp
mov    $0x2e,%r12d
lea    0xc63(%rip),%r13
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    0x0(%rbp,%rbx,4),%edx
lea    -0x7f(%rdx),%eax
cmp    $0xffffffa1,%eax
cmovb  %r12d,%edx
xor    %edi,%edi
mov    %r13,%rsi
xor    %eax,%eax
call   1030 <info@plt>
add    $0x1,%rbx
cmp    $0x1,%rbx
jne    1440 <hexdump_cmd+0x330>
xor    %r12d,%r12d
xor    %edi,%edi
lea    0xbde(%rip),%rsi
xor    %eax,%eax
call   1030 <info@plt>
mov    0x2c(%rsp),%eax
mov    %eax,%r13d
mov    0xc(%rsp),%ebx
lea    0xb77(%rip),%rbp
jmp    11a0 <hexdump_cmd+0x90>
xor    %edi,%edi
lea    0xbb7(%rip),%rsi
xor    %eax,%eax
call   1030 <info@plt>
cmp    $0x2,%r13d
lea    -0x1(%r13),%eax
mov    $0x6,%r12d
mov    $0x0,%ecx
cmovl  %ecx,%r12d
mov    %eax,%r13d
mov    0xc(%rsp),%ebx
jmp    11a0 <hexdump_cmd+0x90>
xor    %edi,%edi
lea    0xbd4(%rip),%rsi
xor    %eax,%eax
call   1030 <info@plt>
mov    -0x3c(%r12,%rbp,4),%edx
lea    -0x7f(%rdx),%eax
cmp    $0xffffffa1,%eax
mov    $0x2e,%r15d
cmovb  %r15d,%edx
xor    %edi,%edi
mov    %r12,%rbx
lea    0xba5(%rip),%r12
mov    %r12,%rsi
xor    %eax,%eax
call   1030 <info@plt>
mov    -0x38(%rbx,%rbp,4),%edx
lea    -0x7f(%rdx),%eax
cmp    $0xffffffa1,%eax
cmovb  %r15d,%edx
xor    %edi,%edi
mov    %r12,%rsi
xor    %eax,%eax
call   1030 <info@plt>
mov    -0x34(%rbx,%rbp,4),%edx
lea    -0x7f(%rdx),%eax
cmp    $0xffffffa1,%eax
cmovb  %r15d,%edx
xor    %edi,%edi
mov    %r12,%rsi
xor    %eax,%eax
call   1030 <info@plt>
mov    -0x30(%rbx,%rbp,4),%edx
lea    -0x7f(%rdx),%eax
cmp    $0xffffffa1,%eax
cmovb  %r15d,%edx
xor    %edi,%edi
mov    %r12,%rsi
xor    %eax,%eax
call   1030 <info@plt>
mov    -0x2c(%rbx,%rbp,4),%edx
lea    -0x7f(%rdx),%eax
cmp    $0xffffffa1,%eax
cmovb  %r15d,%edx
xor    %edi,%edi
mov    %r12,%rsi
xor    %eax,%eax
call   1030 <info@plt>
mov    -0x28(%rbx,%rbp,4),%edx
lea    -0x7f(%rdx),%eax
cmp    $0xffffffa1,%eax
cmovb  %r15d,%edx
xor    %edi,%edi
mov    %r12,%rsi
xor    %eax,%eax
call   1030 <info@plt>
mov    -0x24(%rbx,%rbp,4),%edx
lea    -0x7f(%rdx),%eax
cmp    $0xffffffa1,%eax
cmovb  %r15d,%edx
xor    %edi,%edi
mov    %r12,%rsi
xor    %eax,%eax
call   1030 <info@plt>
mov    -0x20(%rbx,%rbp,4),%edx
lea    -0x7f(%rdx),%eax
cmp    $0xffffffa1,%eax
cmovb  %r15d,%edx
xor    %edi,%edi
mov    %r12,%rsi
xor    %eax,%eax
call   1030 <info@plt>
mov    -0x1c(%rbx,%rbp,4),%edx
lea    -0x7f(%rdx),%eax
cmp    $0xffffffa1,%eax
cmovb  %r15d,%edx
xor    %edi,%edi
mov    %r12,%rsi
xor    %eax,%eax
call   1030 <info@plt>
mov    -0x18(%rbx,%rbp,4),%edx
lea    -0x7f(%rdx),%eax
cmp    $0xffffffa1,%eax
cmovb  %r15d,%edx
xor    %edi,%edi
mov    %r12,%rsi
xor    %eax,%eax
call   1030 <info@plt>
mov    -0x14(%rbx,%rbp,4),%edx
lea    -0x7f(%rdx),%eax
cmp    $0xffffffa1,%eax
cmovb  %r15d,%edx
xor    %edi,%edi
mov    %r12,%rsi
xor    %eax,%eax
call   1030 <info@plt>
mov    -0x10(%rbx,%rbp,4),%edx
lea    -0x7f(%rdx),%eax
cmp    $0xffffffa1,%eax
cmovb  %r15d,%edx
xor    %edi,%edi
mov    %r12,%rsi
xor    %eax,%eax
call   1030 <info@plt>
mov    -0xc(%rbx,%rbp,4),%edx
lea    -0x7f(%rdx),%eax
cmp    $0xffffffa1,%eax
cmovb  %r15d,%edx
xor    %edi,%edi
mov    %r12,%rsi
xor    %eax,%eax
call   1030 <info@plt>
mov    -0x8(%rbx,%rbp,4),%edx
lea    -0x7f(%rdx),%eax
cmp    $0xffffffa1,%eax
cmovb  %r15d,%edx
xor    %edi,%edi
mov    %r12,%rsi
xor    %eax,%eax
call   1030 <info@plt>
mov    -0x4(%rbx,%rbp,4),%edx
lea    -0x7f(%rdx),%eax
cmp    $0xffffffa1,%eax
cmovb  %r15d,%edx
xor    %edi,%edi
mov    %r12,%rsi
xor    %eax,%eax
call   1030 <info@plt>
mov    (%rbx,%rbp,4),%edx
lea    -0x7f(%rdx),%eax
cmp    $0xffffffa1,%eax
cmovb  %r15d,%edx
xor    %edi,%edi
mov    %r12,%rsi
xor    %eax,%eax
call   1030 <info@plt>
xor    %edi,%edi
lea    0x9c4(%rip),%rsi
xor    %eax,%eax
call   1030 <info@plt>
xor    %eax,%eax
cmp    $0x2,%r13d
lea    -0x1(%r13),%ecx
setge  %al
lea    (%rax,%rax,8),%r12d
mov    %ecx,%r13d
mov    %rbx,%r15
jmp    16f3 <hexdump_cmd+0x5e3>
mov    $0x2,%r12d
xor    %edi,%edi
lea    0x96f(%rip),%rsi
mov    %r14d,%edx
mov    $0x2,%ecx
xor    %eax,%eax
call   1030 <info@plt>
jmp    11a0 <hexdump_cmd+0x90>
xor    %edi,%edi
lea    0x952(%rip),%rsi
mov    %r14d,%edx
xor    %eax,%eax
call   1030 <info@plt>
mov    $0x3,%r12d
jmp    11a0 <hexdump_cmd+0x90>
mov    %eax,%r13d
mov    0x30(%rsp),%r15
lea    0x906(%rip),%rbp
mov    0xc(%rsp),%ebx
jmp    11a0 <hexdump_cmd+0x90>
xor    %eax,%eax
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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