#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ arp_dump(unsigned char *, int);
int /*<<< orphan*/ clear_code(unsigned char);
int /*<<< orphan*/ data_dump(unsigned char *, int, int);
int /*<<< orphan*/ dump_x25_addr(unsigned char *);
int /*<<< orphan*/ facility(unsigned char *, int);
int /*<<< orphan*/ flexnet_dump(unsigned char *, int, int);
int /*<<< orphan*/ ip_dump(unsigned char *, int, int);
int /*<<< orphan*/ lprintf(int, char *, ...);
int /*<<< orphan*/ netrom_dump(unsigned char *, int, int);
int /*<<< orphan*/ reset_code(unsigned char);
int /*<<< orphan*/ restart_code(unsigned char);
void rose_dump(unsigned char *data, int length, int hexdump) {
  unsigned char *totdata;
  unsigned char *source = NULL;
  unsigned char *dest = NULL;
  unsigned int len, hlen, totlen;
  int pid;
  unsigned int lci = ((unsigned)(data[0] & 0x0F) << 8) + data[1];
  totdata = data;
  totlen = length;
  lprintf(11, "ROSE: LCI %3.3X : ", lci);
  switch (data[2]) {
  case 0x0B:
    len = 4;
    hlen = (((data[3] >> 4) & 0x0F) + 1) / 2;
    hlen += (((data[3] >> 0) & 0x0F) + 1) / 2;
    if (hlen == 10) {
      dest = data + 4;
      source = data + 9;
    }
    len += hlen;
    data += len;
    length -= len;
    lprintf(11, "CALL REQUEST - ");
    if (length) {
      unsigned int flen = data[0] + 1;
      facility(data, length);
      length -= flen;
      data += flen;
      if (length) {
        unsigned char cudf0 = data[0];
        data += length;
        switch (cudf0) {
        case 0xCC:
          lprintf(11, "PROTOCOL IP -");
          if (source && dest) {
            lprintf(11, " %s -> ", dump_x25_addr(source));
            lprintf(11, "%s\n", dump_x25_addr(dest));
          }
          break;
        default:
          break;
        }
      }
    }
    data_dump(totdata, totlen, 1);
    return;
  case 0x0F:
    lprintf(11, "CALL ACCEPTED\n");
    data_dump(totdata, length, 1);
    return;
  case 0x13:
    lprintf(11, "CLEAR REQUEST - Cause %s - Diag %d\n", clear_code(data[3]),
            data[4]);
    return;
  case 0x17:
    lprintf(11, "CLEAR CONFIRMATION\n");
    return;
  case 0xF1:
    lprintf(11, "DIAGNOSTIC - Diag %d (%2X)\n", data[3], data[3]);
    return;
  case 0x23:
    lprintf(11, "INTERRUPT\n");
    data_dump(data + 3, length - 3, hexdump);
    return;
  case 0x27:
    lprintf(11, "INTERRUPT CONFIRMATION\n");
    return;
  case 0x1B:
    lprintf(11, "RESET REQUEST - Cause %s - Diag %d\n", reset_code(data[3]),
            data[4]);
    return;
  case 0x1F:
    lprintf(11, "RESET CONFIRMATION\n");
    return;
  case 0xFB:
    lprintf(11, "RESTART REQUEST - Cause %s - Diag %d\n", restart_code(data[3]),
            data[4]);
    return;
  case 0xFF:
    lprintf(11, "RESTART CONFIRMATION\n");
    return;
  case 0xF3:
    lprintf(11, "REGISTRATION REQUEST\n");
    return;
  case 0xF7:
    lprintf(11, "REGISTRATION CONFIRMATION\n");
    return;
  }
  if ((data[2] & 0x01) == 0x00) {
    lprintf(11, "DATA R%d S%d %s%s%s ", (data[2] >> 5) & 0x07,
            (data[2] >> 1) & 0x07, (data[0] & 0x80) ? "Q" : "",
            (data[0] & 0x40) ? "D" : "", (data[2] & 0x10) ? "M" : "");
    if ((length >= 5) && (data[0] & 0x80) && (data[3] == 0x7f)) {
      pid = data[4];
      data += 5;
      length -= 5;
      switch (pid) {
      case 0x08:
        lprintf(11, "\n");
        data_dump(data, length, hexdump);
        break;
      case 0xCD:
        lprintf(11, " pid=ARP\n");
        arp_dump(data, length);
        break;
      case 0xCF:
        lprintf(11, " pid=NET/ROM\n");
        netrom_dump(data, length, hexdump);
        break;
      case 0xCC:
        lprintf(11, " pid=IP\n");
        ip_dump(data, length, hexdump);
        break;
      case 0x01:
        lprintf(11, " pid=X.25\n");
        rose_dump(data, length, hexdump);
        break;
      case 0xC3:
        lprintf(11, " pid=TEXNET\n");
        data_dump(data, length, hexdump);
        break;
      case 0xCE:
        lprintf(11, " pid=FLEXNET\n");
        flexnet_dump(data, length, hexdump);
        break;
      case 0xF0:
        lprintf(11, " pid=Text\n");
        data_dump(data, length, hexdump);
        break;
      default:
        lprintf(11, " pid=0x%x\n", pid);
        data_dump(data, length, hexdump);
        break;
      }
    } else {
      lprintf(11, " (%d)\n", length - 3);
      data_dump(data + 3, length - 3, hexdump);
    }
    return;
  }
  switch (data[2] & 0x1F) {
  case 0x01:
    lprintf(11, "RR R%d\n", (data[2] >> 5) & 0x07);
    return;
  case 0x05:
    lprintf(11, "RNR R%d\n", (data[2] >> 5) & 0x07);
    return;
  case 0x09:
    lprintf(11, "REJ R%d\n", (data[2] >> 5) & 0x07);
    return;
  }
  lprintf(11, "UNKNOWN\n");
  data_dump(data, length, 1);
}


x86 assembly (clang, -O0):
<rose_dump>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
movq   $0x0,-0x20(%rbp)
movq   $0x0,-0x28(%rbp)
mov    -0x8(%rbp),%rcx
movzbl (%rcx),%eax
and    $0xf,%eax
shl    $0x8,%eax
movzbl 0x1(%rcx),%ecx
or     %ecx,%eax
mov    %eax,-0x3c(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x18(%rbp)
mov    -0xc(%rbp),%eax
mov    %eax,-0x34(%rbp)
mov    -0x3c(%rbp),%edx
lea    0xdf0(%rip),%rsi
xor    %eax,%eax
mov    $0xb,%edi
call   10d0 <lprintf@plt>
mov    -0x8(%rbp),%rax
movzbl 0x2(%rax),%eax
mov    %eax,-0x48(%rbp)
sub    $0xb,%eax
je     130b <rose_dump+0x14b>
jmp    1235 <rose_dump+0x75>
mov    -0x48(%rbp),%eax
sub    $0xf,%eax
je     14a5 <rose_dump+0x2e5>
jmp    1246 <rose_dump+0x86>
mov    -0x48(%rbp),%eax
sub    $0x13,%eax
je     14ce <rose_dump+0x30e>
jmp    1257 <rose_dump+0x97>
mov    -0x48(%rbp),%eax
sub    $0x17,%eax
je     14fd <rose_dump+0x33d>
jmp    1268 <rose_dump+0xa8>
mov    -0x48(%rbp),%eax
sub    $0x1b,%eax
je     1583 <rose_dump+0x3c3>
jmp    1279 <rose_dump+0xb9>
mov    -0x48(%rbp),%eax
sub    $0x1f,%eax
je     15b2 <rose_dump+0x3f2>
jmp    128a <rose_dump+0xca>
mov    -0x48(%rbp),%eax
sub    $0x23,%eax
je     153d <rose_dump+0x37d>
jmp    129b <rose_dump+0xdb>
mov    -0x48(%rbp),%eax
sub    $0x27,%eax
je     156b <rose_dump+0x3ab>
jmp    12ac <rose_dump+0xec>
mov    -0x48(%rbp),%eax
sub    $0xf1,%eax
je     1515 <rose_dump+0x355>
jmp    12bf <rose_dump+0xff>
mov    -0x48(%rbp),%eax
sub    $0xf3,%eax
je     1611 <rose_dump+0x451>
jmp    12d2 <rose_dump+0x112>
mov    -0x48(%rbp),%eax
sub    $0xf7,%eax
je     1629 <rose_dump+0x469>
jmp    12e5 <rose_dump+0x125>
mov    -0x48(%rbp),%eax
sub    $0xfb,%eax
je     15ca <rose_dump+0x40a>
jmp    12f8 <rose_dump+0x138>
mov    -0x48(%rbp),%eax
sub    $0xff,%eax
je     15f9 <rose_dump+0x439>
jmp    1641 <rose_dump+0x481>
movl   $0x4,-0x2c(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x3(%rax),%eax
sar    $0x4,%eax
and    $0xf,%eax
add    $0x1,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,-0x30(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x3(%rax),%eax
sar    $0x0,%eax
and    $0xf,%eax
add    $0x1,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
add    -0x30(%rbp),%eax
mov    %eax,-0x30(%rbp)
cmpl   $0xa,-0x30(%rbp)
jne    136f <rose_dump+0x1af>
mov    -0x8(%rbp),%rax
add    $0x4,%rax
mov    %rax,-0x28(%rbp)
mov    -0x8(%rbp),%rax
add    $0x9,%rax
mov    %rax,-0x20(%rbp)
mov    -0x30(%rbp),%eax
add    -0x2c(%rbp),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x2c(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,%ecx
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x2c(%rbp),%ecx
mov    -0xc(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    $0xb,%edi
lea    0xc74(%rip),%rsi
mov    $0x0,%al
call   10d0 <lprintf@plt>
cmpl   $0x0,-0xc(%rbp)
je     148f <rose_dump+0x2cf>
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
add    $0x1,%eax
mov    %eax,-0x40(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   10a0 <facility@plt>
mov    -0x40(%rbp),%ecx
mov    -0xc(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0xc(%rbp)
mov    -0x40(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,%ecx
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
cmpl   $0x0,-0xc(%rbp)
je     148a <rose_dump+0x2ca>
mov    -0x8(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x41(%rbp)
movslq -0xc(%rbp),%rcx
mov    -0x8(%rbp),%rax
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x41(%rbp),%al
sub    $0xcc,%al
jne    1480 <rose_dump+0x2c0>
jmp    1416 <rose_dump+0x256>
mov    $0xb,%edi
lea    0xc01(%rip),%rsi
mov    $0x0,%al
call   10d0 <lprintf@plt>
cmpq   $0x0,-0x20(%rbp)
je     147b <rose_dump+0x2bb>
cmpq   $0x0,-0x28(%rbp)
je     147b <rose_dump+0x2bb>
mov    -0x20(%rbp),%rdi
call   1030 <dump_x25_addr@plt>
mov    %eax,%edx
mov    $0xb,%edi
lea    0xbdb(%rip),%rsi
mov    $0x0,%al
call   10d0 <lprintf@plt>
mov    -0x28(%rbp),%rdi
call   1030 <dump_x25_addr@plt>
mov    %eax,%edx
mov    $0xb,%edi
lea    0xbc5(%rip),%rsi
mov    $0x0,%al
call   10d0 <lprintf@plt>
jmp    1485 <rose_dump+0x2c5>
jmp    1485 <rose_dump+0x2c5>
jmp    148a <rose_dump+0x2ca>
jmp    148f <rose_dump+0x2cf>
mov    -0x18(%rbp),%rdi
mov    -0x34(%rbp),%esi
mov    $0x1,%edx
call   1050 <data_dump@plt>
jmp    1a37 <rose_dump+0x877>
mov    $0xb,%edi
lea    0xb8c(%rip),%rsi
mov    $0x0,%al
call   10d0 <lprintf@plt>
mov    -0x18(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    $0x1,%edx
call   1050 <data_dump@plt>
jmp    1a37 <rose_dump+0x877>
mov    -0x8(%rbp),%rax
movzbl 0x3(%rax),%edi
call   1060 <clear_code@plt>
mov    %eax,%edx
mov    -0x8(%rbp),%rax
movzbl 0x4(%rax),%ecx
mov    $0xb,%edi
lea    0xb5b(%rip),%rsi
mov    $0x0,%al
call   10d0 <lprintf@plt>
jmp    1a37 <rose_dump+0x877>
mov    $0xb,%edi
lea    0xb67(%rip),%rsi
mov    $0x0,%al
call   10d0 <lprintf@plt>
jmp    1a37 <rose_dump+0x877>
mov    -0x8(%rbp),%rax
movzbl 0x3(%rax),%edx
mov    -0x8(%rbp),%rax
movzbl 0x3(%rax),%ecx
mov    $0xb,%edi
lea    0xb53(%rip),%rsi
mov    $0x0,%al
call   10d0 <lprintf@plt>
jmp    1a37 <rose_dump+0x877>
mov    $0xb,%edi
lea    0xb57(%rip),%rsi
mov    $0x0,%al
call   10d0 <lprintf@plt>
mov    -0x8(%rbp),%rdi
add    $0x3,%rdi
mov    -0xc(%rbp),%esi
sub    $0x3,%esi
mov    -0x10(%rbp),%edx
call   1050 <data_dump@plt>
jmp    1a37 <rose_dump+0x877>
mov    $0xb,%edi
lea    0xb34(%rip),%rsi
mov    $0x0,%al
call   10d0 <lprintf@plt>
jmp    1a37 <rose_dump+0x877>
mov    -0x8(%rbp),%rax
movzbl 0x3(%rax),%edi
call   10e0 <reset_code@plt>
mov    %eax,%edx
mov    -0x8(%rbp),%rax
movzbl 0x4(%rax),%ecx
mov    $0xb,%edi
lea    0xb1d(%rip),%rsi
mov    $0x0,%al
call   10d0 <lprintf@plt>
jmp    1a37 <rose_dump+0x877>
mov    $0xb,%edi
lea    0xb29(%rip),%rsi
mov    $0x0,%al
call   10d0 <lprintf@plt>
jmp    1a37 <rose_dump+0x877>
mov    -0x8(%rbp),%rax
movzbl 0x3(%rax),%edi
call   1080 <restart_code@plt>
mov    %eax,%edx
mov    -0x8(%rbp),%rax
movzbl 0x4(%rax),%ecx
mov    $0xb,%edi
lea    0xb0e(%rip),%rsi
mov    $0x0,%al
call   10d0 <lprintf@plt>
jmp    1a37 <rose_dump+0x877>
mov    $0xb,%edi
lea    0xb1c(%rip),%rsi
mov    $0x0,%al
call   10d0 <lprintf@plt>
jmp    1a37 <rose_dump+0x877>
mov    $0xb,%edi
lea    0xb1a(%rip),%rsi
mov    $0x0,%al
call   10d0 <lprintf@plt>
jmp    1a37 <rose_dump+0x877>
mov    $0xb,%edi
lea    0xb18(%rip),%rsi
mov    $0x0,%al
call   10d0 <lprintf@plt>
jmp    1a37 <rose_dump+0x877>
mov    -0x8(%rbp),%rax
movzbl 0x2(%rax),%eax
and    $0x1,%eax
cmp    $0x0,%eax
jne    1963 <rose_dump+0x7a3>
mov    -0x8(%rbp),%rax
movzbl 0x2(%rax),%edx
sar    $0x5,%edx
and    $0x7,%edx
mov    -0x8(%rbp),%rax
movzbl 0x2(%rax),%ecx
sar    $0x1,%ecx
and    $0x7,%ecx
mov    -0x8(%rbp),%rax
movzbl (%rax),%esi
and    $0x80,%esi
lea    0xa1a(%rip),%r8
lea    0xaf1(%rip),%rax
cmp    $0x0,%esi
cmovne %rax,%r8
mov    -0x8(%rbp),%rax
movzbl (%rax),%esi
and    $0x40,%esi
lea    0x9fb(%rip),%r9
lea    0xad4(%rip),%rax
cmp    $0x0,%esi
cmovne %rax,%r9
mov    -0x8(%rbp),%rax
movzbl 0x2(%rax),%edi
and    $0x10,%edi
lea    0x9db(%rip),%rax
lea    0xab6(%rip),%rsi
cmp    $0x0,%edi
cmovne %rsi,%rax
mov    $0xb,%edi
lea    0xa8a(%rip),%rsi
mov    %rax,(%rsp)
mov    $0x0,%al
call   10d0 <lprintf@plt>
cmpl   $0x5,-0xc(%rbp)
jl     192f <rose_dump+0x76f>
mov    -0x8(%rbp),%rax
movzbl (%rax),%eax
and    $0x80,%eax
cmp    $0x0,%eax
je     192f <rose_dump+0x76f>
mov    -0x8(%rbp),%rax
movzbl 0x3(%rax),%eax
cmp    $0x7f,%eax
jne    192f <rose_dump+0x76f>
mov    -0x8(%rbp),%rax
movzbl 0x4(%rax),%eax
mov    %eax,-0x38(%rbp)
mov    -0x8(%rbp),%rax
add    $0x5,%rax
mov    %rax,-0x8(%rbp)
mov    -0xc(%rbp),%eax
add    $0xfffffffb,%eax
mov    %eax,-0xc(%rbp)
mov    -0x38(%rbp),%eax
mov    %eax,-0x4c(%rbp)
sub    $0x1,%eax
je     1869 <rose_dump+0x6a9>
jmp    174d <rose_dump+0x58d>
mov    -0x4c(%rbp),%eax
sub    $0x8,%eax
je     17d0 <rose_dump+0x610>
jmp    175e <rose_dump+0x59e>
mov    -0x4c(%rbp),%eax
sub    $0xc3,%eax
je     1890 <rose_dump+0x6d0>
jmp    1771 <rose_dump+0x5b1>
mov    -0x4c(%rbp),%eax
sub    $0xcc,%eax
je     1842 <rose_dump+0x682>
jmp    1784 <rose_dump+0x5c4>
mov    -0x4c(%rbp),%eax
sub    $0xcd,%eax
je     17f7 <rose_dump+0x637>
jmp    1797 <rose_dump+0x5d7>
mov    -0x4c(%rbp),%eax
sub    $0xce,%eax
je     18b7 <rose_dump+0x6f7>
jmp    17aa <rose_dump+0x5ea>
mov    -0x4c(%rbp),%eax
sub    $0xcf,%eax
je     181b <rose_dump+0x65b>
jmp    17bd <rose_dump+0x5fd>
mov    -0x4c(%rbp),%eax
sub    $0xf0,%eax
je     18de <rose_dump+0x71e>
jmp    1905 <rose_dump+0x745>
mov    $0xb,%edi
lea    0x8c2(%rip),%rsi
mov    $0x0,%al
call   10d0 <lprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1050 <data_dump@plt>
jmp    192a <rose_dump+0x76a>
mov    $0xb,%edi
lea    0x980(%rip),%rsi
mov    $0x0,%al
call   10d0 <lprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
call   1040 <arp_dump@plt>
jmp    192a <rose_dump+0x76a>
mov    $0xb,%edi
lea    0x966(%rip),%rsi
mov    $0x0,%al
call   10d0 <lprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   10b0 <netrom_dump@plt>
jmp    192a <rose_dump+0x76a>
mov    $0xb,%edi
lea    0x94d(%rip),%rsi
mov    $0x0,%al
call   10d0 <lprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   10c0 <ip_dump@plt>
jmp    192a <rose_dump+0x76a>
mov    $0xb,%edi
lea    0x92f(%rip),%rsi
mov    $0x0,%al
call   10d0 <lprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1090 <rose_dump@plt>
jmp    192a <rose_dump+0x76a>
mov    $0xb,%edi
lea    0x913(%rip),%rsi
mov    $0x0,%al
call   10d0 <lprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1050 <data_dump@plt>
jmp    192a <rose_dump+0x76a>
mov    $0xb,%edi
lea    0x8f9(%rip),%rsi
mov    $0x0,%al
call   10d0 <lprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1070 <flexnet_dump@plt>
jmp    192a <rose_dump+0x76a>
mov    $0xb,%edi
lea    0x8e0(%rip),%rsi
mov    $0x0,%al
call   10d0 <lprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1050 <data_dump@plt>
jmp    192a <rose_dump+0x76a>
mov    -0x38(%rbp),%edx
mov    $0xb,%edi
lea    0x8c1(%rip),%rsi
mov    $0x0,%al
call   10d0 <lprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   1050 <data_dump@plt>
jmp    195e <rose_dump+0x79e>
mov    -0xc(%rbp),%edx
sub    $0x3,%edx
mov    $0xb,%edi
lea    0x89f(%rip),%rsi
mov    $0x0,%al
call   10d0 <lprintf@plt>
mov    -0x8(%rbp),%rdi
add    $0x3,%rdi
mov    -0xc(%rbp),%esi
sub    $0x3,%esi
mov    -0x10(%rbp),%edx
call   1050 <data_dump@plt>
jmp    1a37 <rose_dump+0x877>
mov    -0x8(%rbp),%rax
movzbl 0x2(%rax),%eax
and    $0x1f,%eax
mov    %eax,-0x50(%rbp)
sub    $0x1,%eax
je     19a1 <rose_dump+0x7e1>
jmp    197f <rose_dump+0x7bf>
mov    -0x50(%rbp),%eax
sub    $0x5,%eax
je     19c7 <rose_dump+0x807>
jmp    1990 <rose_dump+0x7d0>
mov    -0x50(%rbp),%eax
sub    $0x9,%eax
je     19ed <rose_dump+0x82d>
jmp    1a13 <rose_dump+0x853>
mov    -0x8(%rbp),%rax
movzbl 0x2(%rax),%edx
sar    $0x5,%edx
and    $0x7,%edx
mov    $0xb,%edi
lea    0x82c(%rip),%rsi
mov    $0x0,%al
call   10d0 <lprintf@plt>
jmp    1a37 <rose_dump+0x877>
mov    -0x8(%rbp),%rax
movzbl 0x2(%rax),%edx
sar    $0x5,%edx
and    $0x7,%edx
mov    $0xb,%edi
lea    0x80e(%rip),%rsi
mov    $0x0,%al
call   10d0 <lprintf@plt>
jmp    1a37 <rose_dump+0x877>
mov    -0x8(%rbp),%rax
movzbl 0x2(%rax),%edx
sar    $0x5,%edx
and    $0x7,%edx
mov    $0xb,%edi
lea    0x7f1(%rip),%rsi
mov    $0x0,%al
call   10d0 <lprintf@plt>
jmp    1a37 <rose_dump+0x877>
mov    $0xb,%edi
lea    0x7e2(%rip),%rsi
mov    $0x0,%al
call   10d0 <lprintf@plt>
mov    -0x8(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    $0x1,%edx
call   1050 <data_dump@plt>
add    $0x60,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<rose_dump>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x48,%rsp
mov    %edx,0x18(%rsp)
mov    %rdi,%rbx
lea    0xfbc(%rip),%r12
lea    0x1054(%rip),%r13
lea    0xe26(%rip),%r14
xor    %r15d,%r15d
mov    %rsi,0x10(%rsp)
mov    %esi,%ebp
movzbl (%rbx,%r15,1),%eax
and    $0xf,%eax
shl    $0x8,%eax
movzbl 0x1(%rbx,%r15,1),%edx
or     %eax,%edx
mov    $0xb,%edi
mov    %r12,%rsi
xor    %eax,%eax
call   10c0 <lprintf@plt>
movzbl 0x2(%rbx,%r15,1),%edx
lea    0xf(%rdx),%eax
ror    %al
cmp    $0x1b,%al
ja     1221 <rose_dump+0x71>
movzbl %al,%eax
movslq (%r14,%rax,4),%rax
add    %r14,%rax
jmp    *%rax
mov    %edx,%eax
test   $0x1,%dl
jne    1591 <rose_dump+0x3e1>
shr    $0x5,%eax
mov    %edx,%ecx
shr    %ecx
and    $0x7,%ecx
movzbl (%rbx,%r15,1),%esi
test   $0x80,%sil
lea    0x10bf(%rip),%r8
cmove  %r13,%r8
test   $0x40,%sil
lea    0x10b2(%rip),%r9
cmove  %r13,%r9
test   $0x10,%dl
lea    0x10a6(%rip),%rdx
cmove  %r13,%rdx
mov    %rdx,(%rsp)
mov    $0xb,%edi
lea    0x1079(%rip),%rsi
mov    %eax,%edx
xor    %eax,%eax
call   10c0 <lprintf@plt>
cmp    $0x5,%ebp
jl     12e8 <rose_dump+0x138>
cmpb   $0x0,(%rbx,%r15,1)
jns    12e8 <rose_dump+0x138>
cmpb   $0x7f,0x3(%rbx,%r15,1)
jne    12e8 <rose_dump+0x138>
movzbl 0x4(%rbx,%r15,1),%edx
cmp    $0x1,%edx
jne    12be <rose_dump+0x10e>
mov    $0xb,%edi
lea    0x1081(%rip),%rsi
xor    %eax,%eax
call   10c0 <lprintf@plt>
add    $0x5,%r15
add    $0xfffffffb,%ebp
jmp    11e4 <rose_dump+0x34>
lea    0x3d(%rdx),%eax
cmp    $0x45,%al
ja     16cc <rose_dump+0x51c>
movzbl %al,%eax
lea    0xd9d(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0x1054(%rip),%rsi
jmp    16be <rose_dump+0x50e>
mov    0x10(%rsp),%rbp
sub    %r15d,%ebp
add    $0xfffffffd,%ebp
lea    0x106e(%rip),%rsi
mov    $0xb,%edi
mov    %ebp,%edx
xor    %eax,%eax
call   10c0 <lprintf@plt>
lea    (%rbx,%r15,1),%rdi
add    $0x3,%rdi
mov    %ebp,%esi
jmp    16f2 <rose_dump+0x542>
movzbl 0x3(%rbx,%r15,1),%ecx
lea    0xee8(%rip),%rsi
mov    $0xb,%edi
mov    %ecx,%edx
jmp    155b <rose_dump+0x3ab>
lea    0xf88(%rip),%rsi
jmp    1577 <rose_dump+0x3c7>
lea    0xf92(%rip),%rsi
jmp    1577 <rose_dump+0x3c7>
movzbl 0x3(%rbx,%r15,1),%edi
call   1080 <restart_code@plt>
movzbl 0x4(%rbx,%r15,1),%ecx
lea    0xf23(%rip),%rsi
jmp    1554 <rose_dump+0x3a4>
lea    0xf3d(%rip),%rsi
jmp    1577 <rose_dump+0x3c7>
movzbl 0x3(%rbx,%r15,1),%edi
call   1060 <clear_code@plt>
movzbl 0x4(%rbx,%r15,1),%ecx
lea    0xe4b(%rip),%rsi
jmp    1554 <rose_dump+0x3a4>
lea    0xe63(%rip),%rsi
jmp    1577 <rose_dump+0x3c7>
lea    0xe87(%rip),%rsi
mov    $0xb,%edi
xor    %eax,%eax
call   10c0 <lprintf@plt>
lea    (%rbx,%r15,1),%rdi
add    $0x3,%rdi
mov    0x10(%rsp),%rsi
sub    %r15d,%esi
add    $0xfffffffd,%esi
jmp    16f2 <rose_dump+0x542>
lea    0xe67(%rip),%rsi
jmp    1577 <rose_dump+0x3c7>
movzbl 0x3(%rbx,%r15,1),%r14d
mov    %r14,%r12
shr    $0x4,%r12
add    $0x1,%r12
shr    %r12
and    $0xf,%r14d
add    $0x1,%r14
shr    %r14
lea    (%r12,%r14,1),%rcx
mov    %rcx,0x28(%rsp)
xor    %eax,%eax
cmp    $0xa,%ecx
lea    0x4(%rbx,%r15,1),%rcx
lea    0x9(%rbx,%r15,1),%rdx
cmovne %rax,%rcx
mov    %rcx,0x40(%rsp)
cmovne %rax,%rdx
mov    %rdx,0x38(%rsp)
lea    (%rbx,%r15,1),%rax
mov    %rax,0x18(%rsp)
lea    (%r14,%r12,1),%ecx
mov    0x10(%rsp),%rax
mov    %eax,%r13d
mov    %ecx,0x24(%rsp)
sub    %ecx,%r13d
add    $0xfffffffc,%r13d
lea    0xd5a(%rip),%rsi
mov    $0xb,%edi
xor    %eax,%eax
call   10c0 <lprintf@plt>
cmp    %r15d,%r13d
je     1510 <rose_dump+0x360>
mov    0x28(%rsp),%rax
lea    (%rbx,%rax,1),%rdi
add    $0x4,%rdi
mov    0x24(%rsp),%ecx
mov    %ecx,%eax
neg    %eax
mov    0x10(%rsp),%r13
lea    -0x4(%r13),%esi
add    %rax,%rsi
sub    %r15,%rsi
movzbl (%rdi,%r15,1),%eax
add    %r15,%rdi
mov    %rax,0x30(%rsp)
add    %eax,%ecx
sub    %ecx,%r13d
add    $0xfffffffb,%r13d
call   1090 <facility@plt>
cmp    %r15d,%r13d
je     1510 <rose_dump+0x360>
lea    (%r12,%r14,1),%rax
add    $0x4,%rax
mov    0x30(%rsp),%rcx
add    $0x1,%rcx
add    %rax,%rcx
add    %rbx,%rcx
cmpb   $0xcc,(%r15,%rcx,1)
jne    1510 <rose_dump+0x360>
lea    0xcec(%rip),%rsi
mov    $0xb,%edi
xor    %eax,%eax
call   10c0 <lprintf@plt>
cmpl   $0xa,0x28(%rsp)
jne    1510 <rose_dump+0x360>
mov    0x38(%rsp),%rdi
call   1030 <dump_x25_addr@plt>
lea    0xcd6(%rip),%rsi
mov    $0xb,%edi
mov    %eax,%edx
xor    %eax,%eax
call   10c0 <lprintf@plt>
mov    0x40(%rsp),%rdi
call   1030 <dump_x25_addr@plt>
lea    0xcbf(%rip),%rsi
mov    $0xb,%edi
mov    %eax,%edx
xor    %eax,%eax
call   10c0 <lprintf@plt>
mov    0x18(%rsp),%rdi
jmp    1530 <rose_dump+0x380>
lea    0xca7(%rip),%rsi
mov    $0xb,%edi
xor    %eax,%eax
call   10c0 <lprintf@plt>
add    %r15,%rbx
mov    %rbx,%rdi
mov    %ebp,%esi
mov    $0x1,%edx
jmp    16f6 <rose_dump+0x546>
movzbl 0x3(%rbx,%r15,1),%edi
call   10d0 <reset_code@plt>
movzbl 0x4(%rbx,%r15,1),%ecx
lea    0xcf7(%rip),%rsi
mov    $0xb,%edi
mov    %eax,%edx
xor    %eax,%eax
add    $0x48,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    10c0 <lprintf@plt>
lea    0xcf8(%rip),%rsi
mov    $0xb,%edi
xor    %eax,%eax
add    $0x48,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    10c0 <lprintf@plt>
and    $0x1f,%eax
cmp    $0x9,%eax
je     1709 <rose_dump+0x559>
cmp    $0x5,%eax
je     1715 <rose_dump+0x565>
cmp    $0x1,%eax
jne    1739 <rose_dump+0x589>
shr    $0x5,%edx
lea    0xdb6(%rip),%rsi
jmp    171f <rose_dump+0x56f>
lea    0xd5e(%rip),%rsi
mov    $0xb,%edi
xor    %eax,%eax
call   10c0 <lprintf@plt>
lea    (%rbx,%r15,1),%rdi
add    $0x5,%rdi
mov    0x10(%rsp),%rsi
sub    %r15d,%esi
add    $0xfffffffb,%esi
mov    0x18(%rsp),%edx
add    $0x48,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    10b0 <ip_dump@plt>
lea    0xd09(%rip),%rsi
mov    $0xb,%edi
xor    %eax,%eax
call   10c0 <lprintf@plt>
lea    (%rbx,%r15,1),%rdi
add    $0x5,%rdi
mov    0x10(%rsp),%rsi
sub    %r15d,%esi
add    $0xfffffffb,%esi
add    $0x48,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <arp_dump@plt>
lea    0xd09(%rip),%rsi
mov    $0xb,%edi
xor    %eax,%eax
call   10c0 <lprintf@plt>
lea    (%rbx,%r15,1),%rdi
add    $0x5,%rdi
mov    0x10(%rsp),%rsi
sub    %r15d,%esi
add    $0xfffffffb,%esi
mov    0x18(%rsp),%edx
add    $0x48,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1070 <flexnet_dump@plt>
lea    0xc9d(%rip),%rsi
mov    $0xb,%edi
xor    %eax,%eax
call   10c0 <lprintf@plt>
lea    (%rbx,%r15,1),%rdi
add    $0x5,%rdi
mov    0x10(%rsp),%rsi
sub    %r15d,%esi
add    $0xfffffffb,%esi
mov    0x18(%rsp),%edx
add    $0x48,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    10a0 <netrom_dump@plt>
lea    0xc9d(%rip),%rsi
jmp    16be <rose_dump+0x50e>
lea    0xb68(%rip),%rsi
mov    $0xb,%edi
xor    %eax,%eax
call   10c0 <lprintf@plt>
jmp    16df <rose_dump+0x52f>
lea    0xc8a(%rip),%rsi
mov    $0xb,%edi
xor    %eax,%eax
call   10c0 <lprintf@plt>
lea    (%rbx,%r15,1),%rdi
add    $0x5,%rdi
mov    0x10(%rsp),%rsi
sub    %r15d,%esi
add    $0xfffffffb,%esi
mov    0x18(%rsp),%edx
add    $0x48,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1050 <data_dump@plt>
shr    $0x5,%edx
lea    0xc6d(%rip),%rsi
jmp    171f <rose_dump+0x56f>
shr    $0x5,%edx
lea    0xc58(%rip),%rsi
mov    $0xb,%edi
xor    %eax,%eax
add    $0x48,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    10c0 <lprintf@plt>
add    %r15,%rbx
lea    0xc46(%rip),%rsi
mov    $0xb,%edi
xor    %eax,%eax
call   10c0 <lprintf@plt>
jmp    152d <rose_dump+0x37d>

LLVM IR (-O0):
@.str = [19 x i8] c"ROSE: LCI %3.3X : \00"
@.str.1 = [16 x i8] c"CALL REQUEST - \00"
@.str.2 = [14 x i8] c"PROTOCOL IP -\00"
@.str.3 = [8 x i8] c" %s -> \00"
@.str.4 = [4 x i8] c"%s\0A\00"
@.str.5 = [15 x i8] c"CALL ACCEPTED\0A\00"
@.str.6 = [36 x i8] c"CLEAR REQUEST - Cause %s - Diag %d\0A\00"
@.str.7 = [20 x i8] c"CLEAR CONFIRMATION\0A\00"
@.str.8 = [28 x i8] c"DIAGNOSTIC - Diag %d (%2X)\0A\00"
@.str.9 = [11 x i8] c"INTERRUPT\0A\00"
@.str.10 = [24 x i8] c"INTERRUPT CONFIRMATION\0A\00"
@.str.11 = [36 x i8] c"RESET REQUEST - Cause %s - Diag %d\0A\00"
@.str.12 = [20 x i8] c"RESET CONFIRMATION\0A\00"
@.str.13 = [38 x i8] c"RESTART REQUEST - Cause %s - Diag %d\0A\00"
@.str.14 = [22 x i8] c"RESTART CONFIRMATION\0A\00"
@.str.15 = [22 x i8] c"REGISTRATION REQUEST\0A\00"
@.str.16 = [27 x i8] c"REGISTRATION CONFIRMATION\0A\00"
@.str.17 = [21 x i8] c"DATA R%d S%d %s%s%s \00"
@.str.18 = [2 x i8] c"Q\00"
@.str.19 = [1 x i8] zeroinitializer
@.str.20 = [2 x i8] c"D\00"
@.str.21 = [2 x i8] c"M\00"
@.str.22 = [2 x i8] c"\0A\00"
@.str.23 = [10 x i8] c" pid=ARP\0A\00"
@.str.24 = [14 x i8] c" pid=NET/ROM\0A\00"
@.str.25 = [9 x i8] c" pid=IP\0A\00"
@.str.26 = [11 x i8] c" pid=X.25\0A\00"
@.str.27 = [13 x i8] c" pid=TEXNET\0A\00"
@.str.28 = [14 x i8] c" pid=FLEXNET\0A\00"
@.str.29 = [11 x i8] c" pid=Text\0A\00"
@.str.30 = [11 x i8] c" pid=0x%x\0A\00"
@.str.31 = [7 x i8] c" (%d)\0A\00"
@.str.32 = [8 x i8] c"RR R%d\0A\00"
@.str.33 = [9 x i8] c"RNR R%d\0A\00"
@.str.34 = [9 x i8] c"REJ R%d\0A\00"
@.str.35 = [9 x i8] c"UNKNOWN\0A\00"
define void @rose_dump(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i8
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
store i8* null, i8** %8
store i8* null, i8** %9
%17 = load i8*, i8** %4
%18 = getelementptr inbounds i8, i8* %17, i64 0
%19 = load i8, i8* %18
%20 = zext i8 %19 to i32
%21 = and i32 %20, 15
%22 = shl i32 %21, 8
%23 = load i8*, i8** %4
%24 = getelementptr inbounds i8, i8* %23, i64 1
%25 = load i8, i8* %24
%26 = zext i8 %25 to i32
%27 = add i32 %22, %26
store i32 %27, i32* %14
%28 = load i8*, i8** %4
store i8* %28, i8** %7
%29 = load i32, i32* %5
store i32 %29, i32* %12
%30 = load i32, i32* %14
%31 = call i32 (i32, i8*, ...) @lprintf(i32 11, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %30)
%32 = load i8*, i8** %4
%33 = getelementptr inbounds i8, i8* %32, i64 2
%34 = load i8, i8* %33
%35 = zext i8 %34 to i32
switch i32 %35, label %191 [
i32 11, label %36
i32 15, label %126
i32 19, label %131
i32 23, label %141
i32 241, label %143
i32 35, label %153
i32 39, label %161
i32 27, label %163
i32 31, label %173
i32 251, label %175
i32 255, label %185
i32 243, label %187
i32 247, label %189
]
36: ; preds = %3
store i32 4, i32* %10
%37 = load i8*, i8** %4
%38 = getelementptr inbounds i8, i8* %37, i64 3
%39 = load i8, i8* %38
%40 = zext i8 %39 to i32
%41 = ashr i32 %40, 4
%42 = and i32 %41, 15
%43 = add nsw i32 %42, 1
%44 = sdiv i32 %43, 2
store i32 %44, i32* %11
%45 = load i8*, i8** %4
%46 = getelementptr inbounds i8, i8* %45, i64 3
%47 = load i8, i8* %46
%48 = zext i8 %47 to i32
%49 = ashr i32 %48, 0
%50 = and i32 %49, 15
%51 = add nsw i32 %50, 1
%52 = sdiv i32 %51, 2
%53 = load i32, i32* %11
%54 = add i32 %53, %52
store i32 %54, i32* %11
%55 = load i32, i32* %11
%56 = icmp eq i32 %55, 10
br i1 %56, label %57, label %62
57: ; preds = %36
%58 = load i8*, i8** %4
%59 = getelementptr inbounds i8, i8* %58, i64 4
store i8* %59, i8** %9
%60 = load i8*, i8** %4
%61 = getelementptr inbounds i8, i8* %60, i64 9
store i8* %61, i8** %8
br label %62
62: ; preds = %57, %36
%63 = load i32, i32* %11
%64 = load i32, i32* %10
%65 = add i32 %64, %63
store i32 %65, i32* %10
%66 = load i32, i32* %10
%67 = load i8*, i8** %4
%68 = zext i32 %66 to i64
%69 = getelementptr inbounds i8, i8* %67, i64 %68
store i8* %69, i8** %4
%70 = load i32, i32* %10
%71 = load i32, i32* %5
%72 = sub i32 %71, %70
store i32 %72, i32* %5
%73 = call i32 (i32, i8*, ...) @lprintf(i32 11, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
%74 = load i32, i32* %5
%75 = icmp ne i32 %74, 0
br i1 %75, label %76, label %122
76: ; preds = %62
%77 = load i8*, i8** %4
%78 = getelementptr inbounds i8, i8* %77, i64 0
%79 = load i8, i8* %78
%80 = zext i8 %79 to i32
%81 = add nsw i32 %80, 1
store i32 %81, i32* %15
%82 = load i8*, i8** %4
%83 = load i32, i32* %5
%84 = call i32 @facility(i8* %82, i32 %83)
%85 = load i32, i32* %15
%86 = load i32, i32* %5
%87 = sub i32 %86, %85
store i32 %87, i32* %5
%88 = load i32, i32* %15
%89 = load i8*, i8** %4
%90 = zext i32 %88 to i64
%91 = getelementptr inbounds i8, i8* %89, i64 %90
store i8* %91, i8** %4
%92 = load i32, i32* %5
%93 = icmp ne i32 %92, 0
br i1 %93, label %94, label %121
94: ; preds = %76
%95 = load i8*, i8** %4
%96 = getelementptr inbounds i8, i8* %95, i64 0
%97 = load i8, i8* %96
store i8 %97, i8* %16
%98 = load i32, i32* %5
%99 = load i8*, i8** %4
%100 = sext i32 %98 to i64
%101 = getelementptr inbounds i8, i8* %99, i64 %100
store i8* %101, i8** %4
%102 = load i8, i8* %16
%103 = zext i8 %102 to i32
switch i32 %103, label %119 [
i32 204, label %104
]
104: ; preds = %94
%105 = call i32 (i32, i8*, ...) @lprintf(i32 11, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
%106 = load i8*, i8** %8
%107 = icmp ne i8* %106, null
br i1 %107, label %108, label %118
108: ; preds = %104
%109 = load i8*, i8** %9
%110 = icmp ne i8* %109, null
br i1 %110, label %111, label %118
111: ; preds = %108
%112 = load i8*, i8** %8
%113 = call i32 @dump_x25_addr(i8* %112)
%114 = call i32 (i32, i8*, ...) @lprintf(i32 11, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i32 %113)
%115 = load i8*, i8** %9
%116 = call i32 @dump_x25_addr(i8* %115)
%117 = call i32 (i32, i8*, ...) @lprintf(i32 11, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i32 %116)
br label %118
118: ; preds = %111, %108, %104
br label %120
119: ; preds = %94
br label %120
120: ; preds = %119, %118
br label %121
121: ; preds = %120, %76
br label %122
122: ; preds = %121, %62
%123 = load i8*, i8** %7
%124 = load i32, i32* %12
%125 = call i32 @data_dump(i8* %123, i32 %124, i32 1)
br label %361
126: ; preds = %3
%127 = call i32 (i32, i8*, ...) @lprintf(i32 11, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0))
%128 = load i8*, i8** %7
%129 = load i32, i32* %5
%130 = call i32 @data_dump(i8* %128, i32 %129, i32 1)
br label %361
131: ; preds = %3
%132 = load i8*, i8** %4
%133 = getelementptr inbounds i8, i8* %132, i64 3
%134 = load i8, i8* %133
%135 = call i32 @clear_code(i8 zeroext %134)
%136 = load i8*, i8** %4
%137 = getelementptr inbounds i8, i8* %136, i64 4
%138 = load i8, i8* %137
%139 = zext i8 %138 to i32
%140 = call i32 (i32, i8*, ...) @lprintf(i32 11, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.6, i64 0, i64 0), i32 %135, i32 %139)
br label %361
141: ; preds = %3
%142 = call i32 (i32, i8*, ...) @lprintf(i32 11, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.7, i64 0, i64 0))
br label %361
143: ; preds = %3
%144 = load i8*, i8** %4
%145 = getelementptr inbounds i8, i8* %144, i64 3
%146 = load i8, i8* %145
%147 = zext i8 %146 to i32
%148 = load i8*, i8** %4
%149 = getelementptr inbounds i8, i8* %148, i64 3
%150 = load i8, i8* %149
%151 = zext i8 %150 to i32
%152 = call i32 (i32, i8*, ...) @lprintf(i32 11, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.8, i64 0, i64 0), i32 %147, i32 %151)
br label %361
153: ; preds = %3
%154 = call i32 (i32, i8*, ...) @lprintf(i32 11, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.9, i64 0, i64 0))
%155 = load i8*, i8** %4
%156 = getelementptr inbounds i8, i8* %155, i64 3
%157 = load i32, i32* %5
%158 = sub nsw i32 %157, 3
%159 = load i32, i32* %6
%160 = call i32 @data_dump(i8* %156, i32 %158, i32 %159)
br label %361
161: ; preds = %3
%162 = call i32 (i32, i8*, ...) @lprintf(i32 11, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.10, i64 0, i64 0))
br label %361
163: ; preds = %3
%164 = load i8*, i8** %4
%165 = getelementptr inbounds i8, i8* %164, i64 3
%166 = load i8, i8* %165
%167 = call i32 @reset_code(i8 zeroext %166)
%168 = load i8*, i8** %4
%169 = getelementptr inbounds i8, i8* %168, i64 4
%170 = load i8, i8* %169
%171 = zext i8 %170 to i32
%172 = call i32 (i32, i8*, ...) @lprintf(i32 11, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.11, i64 0, i64 0), i32 %167, i32 %171)
br label %361
173: ; preds = %3
%174 = call i32 (i32, i8*, ...) @lprintf(i32 11, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.12, i64 0, i64 0))
br label %361
175: ; preds = %3
%176 = load i8*, i8** %4
%177 = getelementptr inbounds i8, i8* %176, i64 3
%178 = load i8, i8* %177
%179 = call i32 @restart_code(i8 zeroext %178)
%180 = load i8*, i8** %4
%181 = getelementptr inbounds i8, i8* %180, i64 4
%182 = load i8, i8* %181
%183 = zext i8 %182 to i32
%184 = call i32 (i32, i8*, ...) @lprintf(i32 11, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.13, i64 0, i64 0), i32 %179, i32 %183)
br label %361
185: ; preds = %3
%186 = call i32 (i32, i8*, ...) @lprintf(i32 11, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.14, i64 0, i64 0))
br label %361
187: ; preds = %3
%188 = call i32 (i32, i8*, ...) @lprintf(i32 11, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.15, i64 0, i64 0))
br label %361
189: ; preds = %3
%190 = call i32 (i32, i8*, ...) @lprintf(i32 11, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.16, i64 0, i64 0))
br label %361
191: ; preds = %3
%192 = load i8*, i8** %4
%193 = getelementptr inbounds i8, i8* %192, i64 2
%194 = load i8, i8* %193
%195 = zext i8 %194 to i32
%196 = and i32 %195, 1
%197 = icmp eq i32 %196, 0
br i1 %197, label %198, label %326
198: ; preds = %191
%199 = load i8*, i8** %4
%200 = getelementptr inbounds i8, i8* %199, i64 2
%201 = load i8, i8* %200
%202 = zext i8 %201 to i32
%203 = ashr i32 %202, 5
%204 = and i32 %203, 7
%205 = load i8*, i8** %4
%206 = getelementptr inbounds i8, i8* %205, i64 2
%207 = load i8, i8* %206
%208 = zext i8 %207 to i32
%209 = ashr i32 %208, 1
%210 = and i32 %209, 7
%211 = load i8*, i8** %4
%212 = getelementptr inbounds i8, i8* %211, i64 0
%213 = load i8, i8* %212
%214 = zext i8 %213 to i32
%215 = and i32 %214, 128
%216 = icmp ne i32 %215, 0
%217 = zext i1 %216 to i64
%218 = select i1 %216, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.18, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.19, i64 0, i64 0)
%219 = load i8*, i8** %4
%220 = getelementptr inbounds i8, i8* %219, i64 0
%221 = load i8, i8* %220
%222 = zext i8 %221 to i32
%223 = and i32 %222, 64
%224 = icmp ne i32 %223, 0
%225 = zext i1 %224 to i64
%226 = select i1 %224, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.20, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.19, i64 0, i64 0)
%227 = load i8*, i8** %4
%228 = getelementptr inbounds i8, i8* %227, i64 2
%229 = load i8, i8* %228
%230 = zext i8 %229 to i32
%231 = and i32 %230, 16
%232 = icmp ne i32 %231, 0
%233 = zext i1 %232 to i64
%234 = select i1 %232, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.21, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.19, i64 0, i64 0)
%235 = call i32 (i32, i8*, ...) @lprintf(i32 11, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.17, i64 0, i64 0), i32 %204, i32 %210, i8* %218, i8* %226, i8* %234)
%236 = load i32, i32* %5
%237 = icmp sge i32 %236, 5
br i1 %237, label %238, label %315
238: ; preds = %198
%239 = load i8*, i8** %4
%240 = getelementptr inbounds i8, i8* %239, i64 0
%241 = load i8, i8* %240
%242 = zext i8 %241 to i32
%243 = and i32 %242, 128
%244 = icmp ne i32 %243, 0
br i1 %244, label %245, label %315
245: ; preds = %238
%246 = load i8*, i8** %4
%247 = getelementptr inbounds i8, i8* %246, i64 3
%248 = load i8, i8* %247
%249 = zext i8 %248 to i32
%250 = icmp eq i32 %249, 127
br i1 %250, label %251, label %315
251: ; preds = %245
%252 = load i8*, i8** %4
%253 = getelementptr inbounds i8, i8* %252, i64 4
%254 = load i8, i8* %253
%255 = zext i8 %254 to i32
store i32 %255, i32* %13
%256 = load i8*, i8** %4
%257 = getelementptr inbounds i8, i8* %256, i64 5
store i8* %257, i8** %4
%258 = load i32, i32* %5
%259 = sub nsw i32 %258, 5
store i32 %259, i32* %5
%260 = load i32, i32* %13
switch i32 %260, label %307 [
i32 8, label %261
i32 205, label %267
i32 207, label %272
i32 204, label %278
i32 1, label %284
i32 195, label %289
i32 206, label %295
i32 240, label %301
]
261: ; preds = %251
%262 = call i32 (i32, i8*, ...) @lprintf(i32 11, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.22, i64 0, i64 0))
%263 = load i8*, i8** %4
%264 = load i32, i32* %5
%265 = load i32, i32* %6
%266 = call i32 @data_dump(i8* %263, i32 %264, i32 %265)
br label %314
267: ; preds = %251
%268 = call i32 (i32, i8*, ...) @lprintf(i32 11, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.23, i64 0, i64 0))
%269 = load i8*, i8** %4
%270 = load i32, i32* %5
%271 = call i32 @arp_dump(i8* %269, i32 %270)
br label %314
272: ; preds = %251
%273 = call i32 (i32, i8*, ...) @lprintf(i32 11, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.24, i64 0, i64 0))
%274 = load i8*, i8** %4
%275 = load i32, i32* %5
%276 = load i32, i32* %6
%277 = call i32 @netrom_dump(i8* %274, i32 %275, i32 %276)
br label %314
278: ; preds = %251
%279 = call i32 (i32, i8*, ...) @lprintf(i32 11, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.25, i64 0, i64 0))
%280 = load i8*, i8** %4
%281 = load i32, i32* %5
%282 = load i32, i32* %6
%283 = call i32 @ip_dump(i8* %280, i32 %281, i32 %282)
br label %314
284: ; preds = %251
%285 = call i32 (i32, i8*, ...) @lprintf(i32 11, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.26, i64 0, i64 0))
%286 = load i8*, i8** %4
%287 = load i32, i32* %5
%288 = load i32, i32* %6
br label %314
289: ; preds = %251
%290 = call i32 (i32, i8*, ...) @lprintf(i32 11, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.27, i64 0, i64 0))
%291 = load i8*, i8** %4
%292 = load i32, i32* %5
%293 = load i32, i32* %6
%294 = call i32 @data_dump(i8* %291, i32 %292, i32 %293)
br label %314
295: ; preds = %251
%296 = call i32 (i32, i8*, ...) @lprintf(i32 11, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.28, i64 0, i64 0))
%297 = load i8*, i8** %4
%298 = load i32, i32* %5
%299 = load i32, i32* %6
%300 = call i32 @flexnet_dump(i8* %297, i32 %298, i32 %299)
br label %314
301: ; preds = %251
%302 = call i32 (i32, i8*, ...) @lprintf(i32 11, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.29, i64 0, i64 0))
%303 = load i8*, i8** %4
%304 = load i32, i32* %5
%305 = load i32, i32* %6
%306 = call i32 @data_dump(i8* %303, i32 %304, i32 %305)
br label %314
307: ; preds = %251
%308 = load i32, i32* %13
%309 = call i32 (i32, i8*, ...) @lprintf(i32 11, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.30, i64 0, i64 0), i32 %308)
%310 = load i8*, i8** %4
%311 = load i32, i32* %5
%312 = load i32, i32* %6
%313 = call i32 @data_dump(i8* %310, i32 %311, i32 %312)
br label %314
314: ; preds = %307, %301, %295, %289, %284, %278, %272, %267, %261
br label %325
315: ; preds = %245, %238, %198
%316 = load i32, i32* %5
%317 = sub nsw i32 %316, 3
%318 = call i32 (i32, i8*, ...) @lprintf(i32 11, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.31, i64 0, i64 0), i32 %317)
%319 = load i8*, i8** %4
%320 = getelementptr inbounds i8, i8* %319, i64 3
%321 = load i32, i32* %5
%322 = sub nsw i32 %321, 3
%323 = load i32, i32* %6
%324 = call i32 @data_dump(i8* %320, i32 %322, i32 %323)
br label %325
325: ; preds = %315, %314
br label %361
326: ; preds = %191
%327 = load i8*, i8** %4
%328 = getelementptr inbounds i8, i8* %327, i64 2
%329 = load i8, i8* %328
%330 = zext i8 %329 to i32
%331 = and i32 %330, 31
switch i32 %331, label %356 [
i32 1, label %332
i32 5, label %340
i32 9, label %348
]
332: ; preds = %326
%333 = load i8*, i8** %4
%334 = getelementptr inbounds i8, i8* %333, i64 2
%335 = load i8, i8* %334
%336 = zext i8 %335 to i32
%337 = ashr i32 %336, 5
%338 = and i32 %337, 7
%339 = call i32 (i32, i8*, ...) @lprintf(i32 11, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.32, i64 0, i64 0), i32 %338)
br label %361
340: ; preds = %326
%341 = load i8*, i8** %4
%342 = getelementptr inbounds i8, i8* %341, i64 2
%343 = load i8, i8* %342
%344 = zext i8 %343 to i32
%345 = ashr i32 %344, 5
%346 = and i32 %345, 7
%347 = call i32 (i32, i8*, ...) @lprintf(i32 11, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.33, i64 0, i64 0), i32 %346)
br label %361
348: ; preds = %326
%349 = load i8*, i8** %4
%350 = getelementptr inbounds i8, i8* %349, i64 2
%351 = load i8, i8* %350
%352 = zext i8 %351 to i32
%353 = ashr i32 %352, 5
%354 = and i32 %353, 7
%355 = call i32 (i32, i8*, ...) @lprintf(i32 11, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.34, i64 0, i64 0), i32 %354)
br label %361
356: ; preds = %326
%357 = call i32 (i32, i8*, ...) @lprintf(i32 11, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.35, i64 0, i64 0))
%358 = load i8*, i8** %4
%359 = load i32, i32* %5
%360 = call i32 @data_dump(i8* %358, i32 %359, i32 1)
br label %361
361: ; preds = %356, %348, %340, %332, %325, %189, %187, %185, %175, %173, %163, %161, %153, %143, %141, %131, %126, %122
ret void
}

LLVM IR (-O2):
@.str = [19 x i8] c"ROSE: LCI %3.3X : \00"
@.str.1 = [16 x i8] c"CALL REQUEST - \00"
@.str.2 = [14 x i8] c"PROTOCOL IP -\00"
@.str.3 = [8 x i8] c" %s -> \00"
@.str.4 = [4 x i8] c"%s\0A\00"
@.str.5 = [15 x i8] c"CALL ACCEPTED\0A\00"
@.str.6 = [36 x i8] c"CLEAR REQUEST - Cause %s - Diag %d\0A\00"
@.str.7 = [20 x i8] c"CLEAR CONFIRMATION\0A\00"
@.str.8 = [28 x i8] c"DIAGNOSTIC - Diag %d (%2X)\0A\00"
@.str.9 = [11 x i8] c"INTERRUPT\0A\00"
@.str.10 = [24 x i8] c"INTERRUPT CONFIRMATION\0A\00"
@.str.11 = [36 x i8] c"RESET REQUEST - Cause %s - Diag %d\0A\00"
@.str.12 = [20 x i8] c"RESET CONFIRMATION\0A\00"
@.str.13 = [38 x i8] c"RESTART REQUEST - Cause %s - Diag %d\0A\00"
@.str.14 = [22 x i8] c"RESTART CONFIRMATION\0A\00"
@.str.15 = [22 x i8] c"REGISTRATION REQUEST\0A\00"
@.str.16 = [27 x i8] c"REGISTRATION CONFIRMATION\0A\00"
@.str.17 = [21 x i8] c"DATA R%d S%d %s%s%s \00"
@.str.18 = [2 x i8] c"Q\00"
@.str.19 = [1 x i8] zeroinitializer
@.str.20 = [2 x i8] c"D\00"
@.str.21 = [2 x i8] c"M\00"
@.str.22 = [2 x i8] c"\0A\00"
@.str.23 = [10 x i8] c" pid=ARP\0A\00"
@.str.24 = [14 x i8] c" pid=NET/ROM\0A\00"
@.str.25 = [9 x i8] c" pid=IP\0A\00"
@.str.26 = [11 x i8] c" pid=X.25\0A\00"
@.str.27 = [13 x i8] c" pid=TEXNET\0A\00"
@.str.28 = [14 x i8] c" pid=FLEXNET\0A\00"
@.str.29 = [11 x i8] c" pid=Text\0A\00"
@.str.30 = [11 x i8] c" pid=0x%x\0A\00"
@.str.31 = [7 x i8] c" (%d)\0A\00"
@.str.32 = [8 x i8] c"RR R%d\0A\00"
@.str.33 = [9 x i8] c"RNR R%d\0A\00"
@.str.34 = [9 x i8] c"REJ R%d\0A\00"
@.str.35 = [9 x i8] c"UNKNOWN\0A\00"
define void @rose_dump(i8* %0, i32 %1, i32 %2) {
br label %4
4: ; preds = %156, %3
%5 = phi i8* [ %0, %3 ], [ %142, %156 ]
%6 = phi i32 [ %1, %3 ], [ %143, %156 ]
%7 = load i8, i8* %5
%8 = and i8 %7, 15
%9 = zext i8 %8 to i32
%10 = shl nuw nsw i32 %9, 8
%11 = getelementptr inbounds i8, i8* %5, i64 1
%12 = load i8, i8* %11
%13 = zext i8 %12 to i32
%14 = or i32 %10, %13
%15 = tail call i32 (i32, i8*, ...) @lprintf(i32 11, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i32 %14)
%16 = getelementptr inbounds i8, i8* %5, i64 2
%17 = load i8, i8* %16
%18 = zext i8 %17 to i32
%19 = add i8 %17, 15
%20 = tail call i8 @llvm.fshl.i8(i8 %19, i8 %19, i8 7)
switch i8 %20, label %112 [
i8 13, label %21
i8 15, label %63
i8 17, label %66
i8 19, label %74
i8 0, label %76
i8 25, label %81
i8 27, label %86
i8 21, label %88
i8 23, label %96
i8 5, label %98
i8 7, label %106
i8 1, label %108
i8 3, label %110
]
21: ; preds = %4
%22 = getelementptr inbounds i8, i8* %5, i64 3
%23 = load i8, i8* %22
%24 = zext i8 %23 to i32
%25 = lshr i32 %24, 4
%26 = add nuw nsw i32 %25, 1
%27 = lshr i32 %26, 1
%28 = and i32 %24, 15
%29 = add nuw nsw i32 %28, 1
%30 = lshr i32 %29, 1
%31 = add nuw nsw i32 %27, %30
%32 = icmp eq i32 %31, 10
%33 = getelementptr inbounds i8, i8* %5, i64 4
%34 = getelementptr inbounds i8, i8* %5, i64 9
%35 = select i1 %32, i8* %33, i8* null
%36 = select i1 %32, i8* %34, i8* null
%37 = add nuw nsw i32 %31, 4
%38 = zext i32 %37 to i64
%39 = getelementptr inbounds i8, i8* %5, i64 %38
%40 = sub i32 %6, %37
%41 = tail call i32 (i32, i8*, ...) @lprintf(i32 11, i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
%42 = icmp eq i32 %40, 0
br i1 %42, label %61, label %43
43: ; preds = %21
%44 = load i8, i8* %39
%45 = zext i8 %44 to i32
%46 = add nuw nsw i32 %45, 1
%47 = tail call i32 @facility(i8* %39, i32 %40)
%48 = icmp eq i32 %40, %46
br i1 %48, label %61, label %49
49: ; preds = %43
%50 = zext i32 %46 to i64
%51 = getelementptr inbounds i8, i8* %39, i64 %50
%52 = load i8, i8* %51
%53 = icmp eq i8 %52, -52
br i1 %53, label %54, label %61
54: ; preds = %49
%55 = tail call i32 (i32, i8*, ...) @lprintf(i32 11, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0))
br i1 %32, label %56, label %61
56: ; preds = %54
%57 = tail call i32 @dump_x25_addr(i8* %36)
%58 = tail call i32 (i32, i8*, ...) @lprintf(i32 11, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0), i32 %57)
%59 = tail call i32 @dump_x25_addr(i8* %35)
%60 = tail call i32 (i32, i8*, ...) @lprintf(i32 11, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i32 %59)
br label %61
61: ; preds = %43, %49, %54, %56, %21
%62 = tail call i32 @data_dump(i8* %5, i32 %6, i32 1)
br label %191
63: ; preds = %4
%64 = tail call i32 (i32, i8*, ...) @lprintf(i32 11, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0))
%65 = tail call i32 @data_dump(i8* %5, i32 %6, i32 1)
br label %191
66: ; preds = %4
%67 = getelementptr inbounds i8, i8* %5, i64 3
%68 = load i8, i8* %67
%69 = tail call i32 @clear_code(i8 zeroext %68)
%70 = getelementptr inbounds i8, i8* %5, i64 4
%71 = load i8, i8* %70
%72 = zext i8 %71 to i32
%73 = tail call i32 (i32, i8*, ...) @lprintf(i32 11, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.6, i64 0, i64 0), i32 %69, i32 %72)
br label %191
74: ; preds = %4
%75 = tail call i32 (i32, i8*, ...) @lprintf(i32 11, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.7, i64 0, i64 0))
br label %191
76: ; preds = %4
%77 = getelementptr inbounds i8, i8* %5, i64 3
%78 = load i8, i8* %77
%79 = zext i8 %78 to i32
%80 = tail call i32 (i32, i8*, ...) @lprintf(i32 11, i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.8, i64 0, i64 0), i32 %79, i32 %79)
br label %191
81: ; preds = %4
%82 = tail call i32 (i32, i8*, ...) @lprintf(i32 11, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.9, i64 0, i64 0))
%83 = getelementptr inbounds i8, i8* %5, i64 3
%84 = add nsw i32 %6, -3
%85 = tail call i32 @data_dump(i8* %83, i32 %84, i32 %2)
br label %191
86: ; preds = %4
%87 = tail call i32 (i32, i8*, ...) @lprintf(i32 11, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.10, i64 0, i64 0))
br label %191
88: ; preds = %4
%89 = getelementptr inbounds i8, i8* %5, i64 3
%90 = load i8, i8* %89
%91 = tail call i32 @reset_code(i8 zeroext %90)
%92 = getelementptr inbounds i8, i8* %5, i64 4
%93 = load i8, i8* %92
%94 = zext i8 %93 to i32
%95 = tail call i32 (i32, i8*, ...) @lprintf(i32 11, i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.11, i64 0, i64 0), i32 %91, i32 %94)
br label %191
96: ; preds = %4
%97 = tail call i32 (i32, i8*, ...) @lprintf(i32 11, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.12, i64 0, i64 0))
br label %191
98: ; preds = %4
%99 = getelementptr inbounds i8, i8* %5, i64 3
%100 = load i8, i8* %99
%101 = tail call i32 @restart_code(i8 zeroext %100)
%102 = getelementptr inbounds i8, i8* %5, i64 4
%103 = load i8, i8* %102
%104 = zext i8 %103 to i32
%105 = tail call i32 (i32, i8*, ...) @lprintf(i32 11, i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.13, i64 0, i64 0), i32 %101, i32 %104)
br label %191
106: ; preds = %4
%107 = tail call i32 (i32, i8*, ...) @lprintf(i32 11, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.14, i64 0, i64 0))
br label %191
108: ; preds = %4
%109 = tail call i32 (i32, i8*, ...) @lprintf(i32 11, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.15, i64 0, i64 0))
br label %191
110: ; preds = %4
%111 = tail call i32 (i32, i8*, ...) @lprintf(i32 11, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.16, i64 0, i64 0))
br label %191
112: ; preds = %4
%113 = and i32 %18, 1
%114 = icmp eq i32 %113, 0
br i1 %114, label %115, label %176
115: ; preds = %112
%116 = lshr i32 %18, 5
%117 = lshr i32 %18, 1
%118 = and i32 %117, 7
%119 = load i8, i8* %5
%120 = zext i8 %119 to i32
%121 = and i32 %120, 128
%122 = icmp eq i32 %121, 0
%123 = select i1 %122, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.19, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.18, i64 0, i64 0)
%124 = and i32 %120, 64
%125 = icmp eq i32 %124, 0
%126 = select i1 %125, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.19, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.20, i64 0, i64 0)
%127 = and i32 %18, 16
%128 = icmp eq i32 %127, 0
%129 = select i1 %128, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.19, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.21, i64 0, i64 0)
%130 = tail call i32 (i32, i8*, ...) @lprintf(i32 11, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.17, i64 0, i64 0), i32 %116, i32 %118, i8* %123, i8* %126, i8* %129)
%131 = icmp sgt i32 %6, 4
br i1 %131, label %132, label %171
132: ; preds = %115
%133 = load i8, i8* %5
%134 = icmp sgt i8 %133, -1
br i1 %134, label %171, label %135
135: ; preds = %132
%136 = getelementptr inbounds i8, i8* %5, i64 3
%137 = load i8, i8* %136
%138 = icmp eq i8 %137, 127
br i1 %138, label %139, label %171
139: ; preds = %135
%140 = getelementptr inbounds i8, i8* %5, i64 4
%141 = load i8, i8* %140
%142 = getelementptr inbounds i8, i8* %5, i64 5
%143 = add nsw i32 %6, -5
switch i8 %141, label %167 [
i8 8, label %144
i8 -51, label %147
i8 -49, label %150
i8 -52, label %153
i8 1, label %156
i8 -61, label %158
i8 -50, label %161
i8 -16, label %164
]
144: ; preds = %139
%145 = tail call i32 (i32, i8*, ...) @lprintf(i32 11, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.22, i64 0, i64 0))
%146 = tail call i32 @data_dump(i8* %142, i32 %143, i32 %2)
br label %191
147: ; preds = %139
%148 = tail call i32 (i32, i8*, ...) @lprintf(i32 11, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.23, i64 0, i64 0))
%149 = tail call i32 @arp_dump(i8* %142, i32 %143)
br label %191
150: ; preds = %139
%151 = tail call i32 (i32, i8*, ...) @lprintf(i32 11, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.24, i64 0, i64 0))
%152 = tail call i32 @netrom_dump(i8* %142, i32 %143, i32 %2)
br label %191
153: ; preds = %139
%154 = tail call i32 (i32, i8*, ...) @lprintf(i32 11, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.25, i64 0, i64 0))
%155 = tail call i32 @ip_dump(i8* %142, i32 %143, i32 %2)
br label %191
156: ; preds = %139
%157 = tail call i32 (i32, i8*, ...) @lprintf(i32 11, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.26, i64 0, i64 0))
br label %4
158: ; preds = %139
%159 = tail call i32 (i32, i8*, ...) @lprintf(i32 11, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.27, i64 0, i64 0))
%160 = tail call i32 @data_dump(i8* %142, i32 %143, i32 %2)
br label %191
161: ; preds = %139
%162 = tail call i32 (i32, i8*, ...) @lprintf(i32 11, i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.28, i64 0, i64 0))
%163 = tail call i32 @flexnet_dump(i8* %142, i32 %143, i32 %2)
br label %191
164: ; preds = %139
%165 = tail call i32 (i32, i8*, ...) @lprintf(i32 11, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.29, i64 0, i64 0))
%166 = tail call i32 @data_dump(i8* %142, i32 %143, i32 %2)
br label %191
167: ; preds = %139
%168 = zext i8 %141 to i32
%169 = tail call i32 (i32, i8*, ...) @lprintf(i32 11, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.30, i64 0, i64 0), i32 %168)
%170 = tail call i32 @data_dump(i8* %142, i32 %143, i32 %2)
br label %191
171: ; preds = %135, %132, %115
%172 = add nsw i32 %6, -3
%173 = tail call i32 (i32, i8*, ...) @lprintf(i32 11, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.31, i64 0, i64 0), i32 %172)
%174 = getelementptr inbounds i8, i8* %5, i64 3
%175 = tail call i32 @data_dump(i8* %174, i32 %172, i32 %2)
br label %191
176: ; preds = %112
%177 = zext i8 %17 to i32
%178 = and i32 %177, 31
switch i32 %178, label %188 [
i32 1, label %179
i32 5, label %182
i32 9, label %185
]
179: ; preds = %176
%180 = lshr i32 %177, 5
%181 = tail call i32 (i32, i8*, ...) @lprintf(i32 11, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.32, i64 0, i64 0), i32 %180)
br label %191
182: ; preds = %176
%183 = lshr i32 %177, 5
%184 = tail call i32 (i32, i8*, ...) @lprintf(i32 11, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.33, i64 0, i64 0), i32 %183)
br label %191
185: ; preds = %176
%186 = lshr i32 %177, 5
%187 = tail call i32 (i32, i8*, ...) @lprintf(i32 11, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.34, i64 0, i64 0), i32 %186)
br label %191
188: ; preds = %176
%189 = tail call i32 (i32, i8*, ...) @lprintf(i32 11, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.35, i64 0, i64 0))
%190 = tail call i32 @data_dump(i8* %5, i32 %6, i32 1)
br label %191
191: ; preds = %171, %167, %164, %161, %158, %153, %150, %147, %144, %188, %185, %182, %179, %110, %108, %106, %98, %96, %88, %86, %81, %76, %74, %66, %63, %61
ret void
}