void facility(unsigned char *data, int lgtot) {
  int lgfac, l, lg, fct, lgdigi, lgaddcall;
  int lgad, lgadind, digi_fac;
  char digis[80], digid[80];
  char indorig[10], inddest[10];
  char addstorig[20], addstdest[20];
  char *d, *factot;
  char buf[512];
  char *result = buf;
  factot = data;
  lgfac = *data++;
  lg = lgfac;
  digi_fac = 0;
  digid[0] = digis[0] = '\0';
  indorig[0] = inddest[0] = '\0';
  while (lg > 0) {
    fct = *data++;
    lg--;
    switch (fct) {
    case 0:
      data++;
      lg--;
      break;
    case 0x3F:
      lprintf(11, "Facility 3F%2.2X\n", *data++);
      lg--;
      break;
    case 0x7F:
      lprintf(11, "NbAlea: %2.2X%2.2X\n", *data, *(data + 1));
      data += 2;
      lg -= 2;
      break;
    case 0xE9:
      lgdigi = *data++;
      if (!digi_fac)
        strcpy(digid, dump_ax25_call(data, lgdigi));
      data += lgdigi;
      lg -= 1 + lgdigi;
      break;
    case 0xEB:
      lgdigi = *data++;
      if (!digi_fac)
        strcpy(digis, dump_ax25_call(data, lgdigi));
      data += lgdigi;
      lg -= 1 + lgdigi;
      break;
    case 0xED:
      lgaddcall = *data++;
      lprintf(11, "at %s", dump_ax25_call(data, lgaddcall));
      data += lgaddcall;
      lg -= 1 + lgaddcall;
      break;
    case 0xEE:
      lgaddcall = *data++;
      ++data;
      lprintf(11, " @%s\n", dump_x25_addr(data));
      data += lgaddcall;
      lg -= 1 + lgaddcall;
      break;
    case 0xEF:
      lgaddcall = *data++;
      for (d = data, l = 0; l < lgaddcall; l += 7, d += 7) {
        if (l > (6 * 7)) {
          break;
        }
        if (d[6] & 0x80) {
          strcat(digis, dump_ax25_call(d, 7));
          strcat(digis, " ");
        } else {
          strcat(digid, dump_ax25_call(d, 7));
          strcat(digid, " ");
        }
      }
      data += lgaddcall;
      lg -= 1 + lgaddcall;
      digi_fac = 1;
      break;
    case 0xC9:
    case 0xCB:
      lgaddcall = *data++;
      data++;
      data += 3;
      lgad = *data++;
      lg -= 6;
      if (fct == 0xCB)
        strcpy(addstorig, dump_x25_addr(data));
      else
        strcpy(addstdest, dump_x25_addr(data));
      data += (lgad + 1) / 2;
      lg -= (lgad + 1) / 2;
      lgadind = lgaddcall - (lgad + 1) / 2 - 5;
      if (fct == 0xCB) {
        strncpy(indorig, data, lgadind);
        indorig[lgadind] = '\0';
      } else {
        strncpy(inddest, data, lgadind);
        inddest[lgadind] = '\0';
      }
      data += lgadind;
      lg -= lgadind;
      break;
    default:
      lprintf(11, "Unknown Facility Type %2.2X\n", fct);
      data_dump(factot, lgtot, 1);
      lg = 0;
      break;
    }
    result += strlen(result);
  }
  if (*indorig && *inddest) {
    lprintf(11, "fm %-9s @%s", indorig, addstorig);
    if (*digis)
      lprintf(11, " via %s", digis);
    lprintf(11, "\n");
    lprintf(11, "to %-9s @%s", inddest, addstdest);
    if (*digid)
      lprintf(11, " via %s", digid);
    lprintf(11, "\n");
  }
}


x86 assembly (clang, -O0):
<facility>:
push   %rbp
mov    %rsp,%rbp
sub    $0x380,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    -0x330(%rbp),%rax
mov    %rax,-0x338(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x130(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movzbl (%rax),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
mov    %eax,-0x18(%rbp)
movl   $0x0,-0x30(%rbp)
movb   $0x0,-0x80(%rbp)
movb   $0x0,-0xd0(%rbp)
movb   $0x0,-0xe4(%rbp)
movb   $0x0,-0xda(%rbp)
cmpl   $0x0,-0x18(%rbp)
jle    1808 <facility+0x688>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movzbl (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x18(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x18(%rbp)
mov    -0x1c(%rbp),%eax
mov    %eax,-0x33c(%rbp)
test   %eax,%eax
je     12e6 <facility+0x166>
jmp    1224 <facility+0xa4>
mov    -0x33c(%rbp),%eax
sub    $0x3f,%eax
je     1300 <facility+0x180>
jmp    1238 <facility+0xb8>
mov    -0x33c(%rbp),%eax
sub    $0x7f,%eax
je     1333 <facility+0x1b3>
jmp    124c <facility+0xcc>
mov    -0x33c(%rbp),%eax
sub    $0xc9,%eax
je     1639 <facility+0x4b9>
jmp    1262 <facility+0xe2>
mov    -0x33c(%rbp),%eax
sub    $0xcb,%eax
je     1639 <facility+0x4b9>
jmp    1278 <facility+0xf8>
mov    -0x33c(%rbp),%eax
sub    $0xe9,%eax
je     136f <facility+0x1ef>
jmp    128e <facility+0x10e>
mov    -0x33c(%rbp),%eax
sub    $0xeb,%eax
je     13dd <facility+0x25d>
jmp    12a4 <facility+0x124>
mov    -0x33c(%rbp),%eax
sub    $0xed,%eax
je     1448 <facility+0x2c8>
jmp    12ba <facility+0x13a>
mov    -0x33c(%rbp),%eax
sub    $0xee,%eax
je     14a4 <facility+0x324>
jmp    12d0 <facility+0x150>
mov    -0x33c(%rbp),%eax
sub    $0xef,%eax
je     1509 <facility+0x389>
jmp    17b6 <facility+0x636>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x18(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x18(%rbp)
jmp    17e9 <facility+0x669>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movzbl (%rax),%edx
mov    $0xb,%edi
lea    0xce2(%rip),%rsi
mov    $0x0,%al
call   10a0 <lprintf@plt>
mov    -0x18(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x18(%rbp)
jmp    17e9 <facility+0x669>
mov    -0x8(%rbp),%rax
movzbl (%rax),%edx
mov    -0x8(%rbp),%rax
movzbl 0x1(%rax),%ecx
mov    $0xb,%edi
lea    0xcc4(%rip),%rsi
mov    $0x0,%al
call   10a0 <lprintf@plt>
mov    -0x8(%rbp),%rax
add    $0x2,%rax
mov    %rax,-0x8(%rbp)
mov    -0x18(%rbp),%eax
sub    $0x2,%eax
mov    %eax,-0x18(%rbp)
jmp    17e9 <facility+0x669>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movzbl (%rax),%eax
mov    %eax,-0x20(%rbp)
cmpl   $0x0,-0x30(%rbp)
jne    13b9 <facility+0x239>
lea    -0xd0(%rbp),%rax
mov    %rax,-0x348(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x20(%rbp),%esi
mov    $0x0,%al
call   1080 <dump_ax25_call@plt>
mov    -0x348(%rbp),%rdi
movslq %eax,%rsi
call   1050 <strcpy@plt>
mov    -0x20(%rbp),%ecx
mov    -0x8(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x20(%rbp),%ecx
add    $0x1,%ecx
mov    -0x18(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x18(%rbp)
jmp    17e9 <facility+0x669>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movzbl (%rax),%eax
mov    %eax,-0x20(%rbp)
cmpl   $0x0,-0x30(%rbp)
jne    1424 <facility+0x2a4>
lea    -0x80(%rbp),%rax
mov    %rax,-0x350(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x20(%rbp),%esi
mov    $0x0,%al
call   1080 <dump_ax25_call@plt>
mov    -0x350(%rbp),%rdi
movslq %eax,%rsi
call   1050 <strcpy@plt>
mov    -0x20(%rbp),%ecx
mov    -0x8(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x20(%rbp),%ecx
add    $0x1,%ecx
mov    -0x18(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x18(%rbp)
jmp    17e9 <facility+0x669>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movzbl (%rax),%eax
mov    %eax,-0x24(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x24(%rbp),%esi
mov    $0x0,%al
call   1080 <dump_ax25_call@plt>
mov    %eax,%edx
mov    $0xb,%edi
lea    0xbad(%rip),%rsi
mov    $0x0,%al
call   10a0 <lprintf@plt>
mov    -0x24(%rbp),%ecx
mov    -0x8(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x24(%rbp),%ecx
add    $0x1,%ecx
mov    -0x18(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x18(%rbp)
jmp    17e9 <facility+0x669>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movzbl (%rax),%eax
mov    %eax,-0x24(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1040 <dump_x25_addr@plt>
mov    %eax,%edx
mov    $0xb,%edi
lea    0xb4e(%rip),%rsi
mov    $0x0,%al
call   10a0 <lprintf@plt>
mov    -0x24(%rbp),%ecx
mov    -0x8(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x24(%rbp),%ecx
add    $0x1,%ecx
mov    -0x18(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x18(%rbp)
jmp    17e9 <facility+0x669>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movzbl (%rax),%eax
mov    %eax,-0x24(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,-0x128(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x24(%rbp),%eax
jge    160e <facility+0x48e>
cmpl   $0x2a,-0x14(%rbp)
jle    154b <facility+0x3cb>
jmp    160e <facility+0x48e>
mov    -0x128(%rbp),%rax
movsbl 0x6(%rax),%eax
and    $0x80,%eax
cmp    $0x0,%eax
je     15a6 <facility+0x426>
lea    -0x80(%rbp),%rax
mov    %rax,-0x358(%rbp)
mov    -0x128(%rbp),%rdi
mov    $0x7,%esi
mov    $0x0,%al
call   1080 <dump_ax25_call@plt>
mov    -0x358(%rbp),%rdi
movslq %eax,%rsi
call   1090 <strcat@plt>
lea    -0x80(%rbp),%rdi
lea    0xa96(%rip),%rsi
call   1090 <strcat@plt>
jmp    15e9 <facility+0x469>
lea    -0xd0(%rbp),%rax
mov    %rax,-0x360(%rbp)
mov    -0x128(%rbp),%rdi
mov    $0x7,%esi
mov    $0x0,%al
call   1080 <dump_ax25_call@plt>
mov    -0x360(%rbp),%rdi
movslq %eax,%rsi
call   1090 <strcat@plt>
lea    -0xd0(%rbp),%rdi
lea    0xa4e(%rip),%rsi
call   1090 <strcat@plt>
jmp    15ee <facility+0x46e>
mov    -0x14(%rbp),%eax
add    $0x7,%eax
mov    %eax,-0x14(%rbp)
mov    -0x128(%rbp),%rax
add    $0x7,%rax
mov    %rax,-0x128(%rbp)
jmp    1530 <facility+0x3b0>
mov    -0x24(%rbp),%ecx
mov    -0x8(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x24(%rbp),%ecx
add    $0x1,%ecx
mov    -0x18(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x18(%rbp)
movl   $0x1,-0x30(%rbp)
jmp    17e9 <facility+0x669>
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movzbl (%rax),%eax
mov    %eax,-0x24(%rbp)
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
add    $0x3,%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x8(%rbp)
movzbl (%rax),%eax
mov    %eax,-0x28(%rbp)
mov    -0x18(%rbp),%eax
sub    $0x6,%eax
mov    %eax,-0x18(%rbp)
cmpl   $0xcb,-0x1c(%rbp)
jne    16be <facility+0x53e>
lea    -0x100(%rbp),%rax
mov    %rax,-0x368(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1040 <dump_x25_addr@plt>
mov    -0x368(%rbp),%rdi
movslq %eax,%rsi
call   1050 <strcpy@plt>
jmp    16e6 <facility+0x566>
lea    -0x120(%rbp),%rax
mov    %rax,-0x370(%rbp)
mov    -0x8(%rbp),%rdi
mov    $0x0,%al
call   1040 <dump_x25_addr@plt>
mov    -0x370(%rbp),%rdi
movslq %eax,%rsi
call   1050 <strcpy@plt>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x8(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x18(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x18(%rbp)
mov    -0x24(%rbp),%eax
mov    %eax,-0x374(%rbp)
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x374(%rbp),%eax
sub    %ecx,%eax
sub    $0x5,%eax
mov    %eax,-0x2c(%rbp)
cmpl   $0xcb,-0x1c(%rbp)
jne    1775 <facility+0x5f5>
lea    -0xda(%rbp),%rdi
mov    -0x8(%rbp),%rsi
movslq -0x2c(%rbp),%rdx
call   1030 <strncpy@plt>
movslq -0x2c(%rbp),%rax
movb   $0x0,-0xda(%rbp,%rax,1)
jmp    1795 <facility+0x615>
lea    -0xe4(%rbp),%rdi
mov    -0x8(%rbp),%rsi
movslq -0x2c(%rbp),%rdx
call   1030 <strncpy@plt>
movslq -0x2c(%rbp),%rax
movb   $0x0,-0xe4(%rbp,%rax,1)
mov    -0x2c(%rbp),%ecx
mov    -0x8(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x8(%rbp)
mov    -0x2c(%rbp),%ecx
mov    -0x18(%rbp),%eax
sub    %ecx,%eax
mov    %eax,-0x18(%rbp)
jmp    17e9 <facility+0x669>
mov    -0x1c(%rbp),%edx
mov    $0xb,%edi
lea    0x86f(%rip),%rsi
mov    $0x0,%al
call   10a0 <lprintf@plt>
mov    -0x130(%rbp),%rdi
mov    -0xc(%rbp),%esi
mov    $0x1,%edx
mov    $0x0,%al
call   1060 <data_dump@plt>
movl   $0x0,-0x18(%rbp)
mov    -0x338(%rbp),%rdi
call   1070 <strlen@plt>
add    -0x338(%rbp),%rax
mov    %rax,-0x338(%rbp)
jmp    11e6 <facility+0x66>
movsbl -0xda(%rbp),%eax
cmp    $0x0,%eax
je     18d8 <facility+0x758>
movsbl -0xe4(%rbp),%eax
cmp    $0x0,%eax
je     18d8 <facility+0x758>
lea    -0xda(%rbp),%rdx
lea    -0x100(%rbp),%rcx
mov    $0xb,%edi
lea    0x80f(%rip),%rsi
mov    $0x0,%al
call   10a0 <lprintf@plt>
cmpb   $0x0,-0x80(%rbp)
je     186a <facility+0x6ea>
lea    -0x80(%rbp),%rdx
mov    $0xb,%edi
lea    0x7fa(%rip),%rsi
mov    $0x0,%al
call   10a0 <lprintf@plt>
mov    $0xb,%edi
lea    0x7d9(%rip),%rsi
mov    $0x0,%al
call   10a0 <lprintf@plt>
lea    -0xe4(%rbp),%rdx
lea    -0x120(%rbp),%rcx
mov    $0xb,%edi
lea    0x7ce(%rip),%rsi
mov    $0x0,%al
call   10a0 <lprintf@plt>
cmpb   $0x0,-0xd0(%rbp)
je     18c5 <facility+0x745>
lea    -0xd0(%rbp),%rdx
mov    $0xb,%edi
lea    0x79f(%rip),%rsi
mov    $0x0,%al
call   10a0 <lprintf@plt>
mov    $0xb,%edi
lea    0x77e(%rip),%rsi
mov    $0x0,%al
call   10a0 <lprintf@plt>
add    $0x380,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<facility>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x118,%rsp
movzbl (%rdi),%r13d
movb   $0x0,0xc0(%rsp)
movb   $0x0,0x70(%rsp)
movb   $0x0,0x14(%rsp)
movb   $0x0,0x1e(%rsp)
test   %r13d,%r13d
je     1565 <facility+0x3e5>
mov    %esi,0x10(%rsp)
mov    %rdi,0x28(%rsp)
lea    0x1(%rdi),%r14
lea    0xe37(%rip),%r12
movl   $0x0,0xc(%rsp)
jmp    11ee <facility+0x6e>
call   1050 <strcpy@plt>
mov    %ebp,%eax
add    %rax,%r14
not    %ebp
add    %ebp,%r15d
mov    %r15d,%r13d
test   %r13d,%r13d
jle    14ab <facility+0x32b>
mov    (%r14),%bl
lea    0x37(%rbx),%eax
cmp    $0x37,%al
ja     1270 <facility+0xf0>
lea    -0x1(%r13),%r15d
movzbl %al,%eax
movslq (%r12,%rax,4),%rax
add    %r12,%rax
jmp    *%rax
movzbl 0x1(%r14),%r15d
movzbl 0x6(%r14),%r12d
add    $0x7,%r14
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <dump_x25_addr@plt>
movslq %eax,%rsi
cmp    $0xcb,%bl
jne    140b <facility+0x28b>
lea    0x50(%rsp),%rdi
call   1050 <strcpy@plt>
add    $0x1,%r12
shr    %r12
lea    (%r14,%r12,1),%rsi
mov    %r15,%rbx
sub    %r12,%rbx
lea    -0x5(%rbx),%rbp
lea    0x1e(%rsp),%rdi
mov    %rbp,%rdx
call   1030 <strncpy@plt>
lea    (%rsp,%rbx,1),%rax
add    $0x19,%rax
jmp    143f <facility+0x2bf>
cs nopw 0x0(%rax,%rax,1)
nop
cmp    $0x3f,%bl
je     145b <facility+0x2db>
cmp    $0x7f,%bl
jne    1480 <facility+0x300>
movzbl 0x1(%r14),%edx
movzbl 0x2(%r14),%ecx
mov    $0xb,%edi
lea    0xe5a(%rip),%rsi
xor    %eax,%eax
call   10a0 <lprintf@plt>
add    $0x3,%r14
add    $0xfffffffd,%r13d
jmp    11e5 <facility+0x65>
movzbl 0x1(%r14),%ebp
add    $0x2,%r14
cmpl   $0x0,0xc(%rsp)
jne    11d8 <facility+0x58>
mov    %r14,%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1080 <dump_ax25_call@plt>
movslq %eax,%rsi
lea    0x70(%rsp),%rdi
jmp    11d3 <facility+0x53>
movzbl 0x1(%r14),%ebp
add    $0x2,%r14
cmpl   $0x0,0xc(%rsp)
jne    11d8 <facility+0x58>
mov    %r14,%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1080 <dump_ax25_call@plt>
movslq %eax,%rsi
lea    0xc0(%rsp),%rdi
jmp    11d3 <facility+0x53>
lea    0x2(%r14),%rdi
movzbl 0x1(%r14),%ebp
mov    %ebp,%esi
xor    %eax,%eax
call   1080 <dump_ax25_call@plt>
mov    $0xb,%edi
lea    0xddf(%rip),%rsi
mov    %eax,%edx
xor    %eax,%eax
call   10a0 <lprintf@plt>
add    %rbp,%r14
add    $0x2,%r14
not    %ebp
add    %ebp,%r15d
jmp    11e2 <facility+0x62>
movzbl 0x1(%r14),%ebx
lea    0x3(%r14),%rdi
xor    %eax,%eax
call   1040 <dump_x25_addr@plt>
mov    $0xb,%edi
lea    0xdaf(%rip),%rsi
mov    %eax,%edx
xor    %eax,%eax
call   10a0 <lprintf@plt>
add    %rbx,%r14
add    $0x3,%r14
not    %ebx
add    %ebx,%r15d
jmp    11e2 <facility+0x62>
lea    0x2(%r14),%r12
movzbl 0x1(%r14),%r13d
test   %r13d,%r13d
je     13df <facility+0x25f>
xor    %ebx,%ebx
nopw   0x0(%rax,%rax,1)
lea    (%r12,%rbx,1),%rdi
cmpb   $0x0,0x8(%r14,%rbx,1)
lea    0xc0(%rsp),%rbp
lea    0x70(%rsp),%rax
cmovns %rax,%rbp
mov    $0x7,%esi
xor    %eax,%eax
call   1080 <dump_ax25_call@plt>
movslq %eax,%rsi
mov    %rbp,%rdi
call   1090 <strcat@plt>
mov    %rbp,%rdi
call   1070 <strlen@plt>
movw   $0x20,0x0(%rbp,%rax,1)
cmp    $0x23,%ebx
ja     13df <facility+0x25f>
add    $0x7,%rbx
cmp    %r13d,%ebx
jb     1390 <facility+0x210>
mov    %r13d,%eax
add    %rax,%r12
not    %r13d
add    %r13d,%r15d
movl   $0x1,0xc(%rsp)
mov    %r15d,%r13d
mov    %r12,%r14
lea    0xc00(%rip),%r12
jmp    11e5 <facility+0x65>
add    $0x2,%r14
jmp    1477 <facility+0x2f7>
lea    0x30(%rsp),%rdi
call   1050 <strcpy@plt>
add    $0x1,%r12
shr    %r12
lea    (%r14,%r12,1),%rsi
mov    %r15,%rbx
sub    %r12,%rbx
lea    -0x5(%rbx),%rbp
lea    0x14(%rsp),%rdi
mov    %rbp,%rdx
call   1030 <strncpy@plt>
lea    (%rsp,%rbx,1),%rax
add    $0xf,%rax
movb   $0x0,(%rax)
add    %r12,%r14
add    %rbp,%r14
sub    %r15d,%r13d
add    $0xfffffffe,%r13d
lea    0xbaa(%rip),%r12
jmp    11e5 <facility+0x65>
movzbl 0x1(%r14),%edx
add    $0x2,%r14
mov    $0xb,%edi
lea    0xc70(%rip),%rsi
xor    %eax,%eax
call   10a0 <lprintf@plt>
add    $0xfffffffe,%r13d
jmp    11e5 <facility+0x65>
movzbl %bl,%edx
lea    0xc88(%rip),%rsi
mov    $0xb,%edi
xor    %eax,%eax
call   10a0 <lprintf@plt>
mov    0x28(%rsp),%rdi
mov    0x10(%rsp),%esi
mov    $0x1,%edx
xor    %eax,%eax
call   1060 <data_dump@plt>
cmpb   $0x0,0x1e(%rsp)
je     1565 <facility+0x3e5>
cmpb   $0x0,0x14(%rsp)
je     1565 <facility+0x3e5>
lea    0xc67(%rip),%rsi
lea    0x1e(%rsp),%rdx
lea    0x50(%rsp),%rcx
mov    $0xb,%edi
xor    %eax,%eax
call   10a0 <lprintf@plt>
cmpb   $0x0,0xc0(%rsp)
je     1503 <facility+0x383>
lea    0xc4c(%rip),%rsi
lea    0xc0(%rsp),%rdx
mov    $0xb,%edi
xor    %eax,%eax
call   10a0 <lprintf@plt>
lea    0xc23(%rip),%rsi
mov    $0xb,%edi
xor    %eax,%eax
call   10a0 <lprintf@plt>
lea    0xc26(%rip),%rsi
lea    0x14(%rsp),%rdx
lea    0x30(%rsp),%rcx
mov    $0xb,%edi
xor    %eax,%eax
call   10a0 <lprintf@plt>
cmpb   $0x0,0x70(%rsp)
je     1552 <facility+0x3d2>
lea    0xbfa(%rip),%rsi
lea    0x70(%rsp),%rdx
mov    $0xb,%edi
xor    %eax,%eax
call   10a0 <lprintf@plt>
lea    0xbd4(%rip),%rsi
mov    $0xb,%edi
xor    %eax,%eax
call   10a0 <lprintf@plt>
add    $0x118,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [18 x i8] c"Facility 3F%2.2X\0A\00"
@.str.1 = [20 x i8] c"NbAlea: %2.2X%2.2X\0A\00"
@.str.2 = [6 x i8] c"at %s\00"
@.str.3 = [6 x i8] c" @%s\0A\00"
@.str.5 = [29 x i8] c"Unknown Facility Type %2.2X\0A\00"
@.str.6 = [12 x i8] c"fm %-9s @%s\00"
@.str.7 = [8 x i8] c" via %s\00"
@.str.8 = [2 x i8] c"\0A\00"
@.str.9 = [12 x i8] c"to %-9s @%s\00"
define void @facility(i8* %0, i32 %1) {
%3 = alloca [80 x i8]
%4 = alloca [80 x i8]
%5 = alloca [10 x i8]
%6 = alloca [10 x i8]
%7 = alloca [20 x i8]
%8 = alloca [20 x i8]
%9 = getelementptr inbounds [80 x i8], [80 x i8]* %3, i64 0, i64 0
%10 = getelementptr inbounds [80 x i8], [80 x i8]* %4, i64 0, i64 0
%11 = getelementptr inbounds [10 x i8], [10 x i8]* %5, i64 0, i64 0
%12 = getelementptr inbounds [10 x i8], [10 x i8]* %6, i64 0, i64 0
%13 = getelementptr inbounds [20 x i8], [20 x i8]* %7, i64 0, i64 0
%14 = getelementptr inbounds [20 x i8], [20 x i8]* %8, i64 0, i64 0
%15 = load i8, i8* %0
store i8 0, i8* %9
store i8 0, i8* %10
store i8 0, i8* %12
store i8 0, i8* %11
%16 = icmp eq i8 %15, 0
br i1 %16, label %196, label %17
17: ; preds = %2
%18 = zext i8 %15 to i32
%19 = getelementptr inbounds i8, i8* %0, i64 1
br label %20
20: ; preds = %17, %170
%21 = phi i8* [ %173, %170 ], [ %19, %17 ]
%22 = phi i32 [ %172, %170 ], [ 0, %17 ]
%23 = phi i32 [ %171, %170 ], [ %18, %17 ]
%24 = getelementptr inbounds i8, i8* %21, i64 1
%25 = load i8, i8* %21
%26 = add nsw i32 %23, -1
switch i8 %25, label %166 [
i8 0, label %27
i8 63, label %30
i8 127, label %36
i8 -23, label %45
i8 -21, label %60
i8 -19, label %75
i8 -18, label %85
i8 -17, label %95
i8 -55, label %125
i8 -53, label %125
]
27: ; preds = %20
%28 = getelementptr inbounds i8, i8* %21, i64 2
%29 = add nsw i32 %23, -2
br label %170
30: ; preds = %20
%31 = getelementptr inbounds i8, i8* %21, i64 2
%32 = load i8, i8* %24
%33 = zext i8 %32 to i32
%34 = call i32 (i32, i8*, i32, ...) bitcast (i32 (...)* @lprintf to i32 (i32, i8*, i32, ...)*)(i32 11, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str, i64 0, i64 0), i32 %33)
%35 = add nsw i32 %23, -2
br label %170
36: ; preds = %20
%37 = load i8, i8* %24
%38 = zext i8 %37 to i32
%39 = getelementptr inbounds i8, i8* %21, i64 2
%40 = load i8, i8* %39
%41 = zext i8 %40 to i32
%42 = call i32 (i32, i8*, i32, i32, ...) bitcast (i32 (...)* @lprintf to i32 (i32, i8*, i32, i32, ...)*)(i32 11, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.1, i64 0, i64 0), i32 %38, i32 %41)
%43 = getelementptr inbounds i8, i8* %21, i64 3
%44 = add nsw i32 %23, -3
br label %170
45: ; preds = %20
%46 = getelementptr inbounds i8, i8* %21, i64 2
%47 = load i8, i8* %24
%48 = zext i8 %47 to i32
%49 = icmp eq i32 %22, 0
br i1 %49, label %50, label %55
50: ; preds = %45
%51 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @dump_ax25_call to i32 (i8*, i32, ...)*)(i8* %46, i32 %48)
%52 = sext i32 %51 to i64
%53 = inttoptr i64 %52 to i8*
%54 = call i8* @strcpy(i8* %10, i8* dereferenceable(1) %53)
br label %55
55: ; preds = %50, %45
%56 = zext i8 %47 to i64
%57 = getelementptr inbounds i8, i8* %46, i64 %56
%58 = xor i32 %48, -1
%59 = add i32 %26, %58
br label %170
60: ; preds = %20
%61 = getelementptr inbounds i8, i8* %21, i64 2
%62 = load i8, i8* %24
%63 = zext i8 %62 to i32
%64 = icmp eq i32 %22, 0
br i1 %64, label %65, label %70
65: ; preds = %60
%66 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @dump_ax25_call to i32 (i8*, i32, ...)*)(i8* %61, i32 %63)
%67 = sext i32 %66 to i64
%68 = inttoptr i64 %67 to i8*
%69 = call i8* @strcpy(i8* %9, i8* dereferenceable(1) %68)
br label %70
70: ; preds = %65, %60
%71 = zext i8 %62 to i64
%72 = getelementptr inbounds i8, i8* %61, i64 %71
%73 = xor i32 %63, -1
%74 = add i32 %26, %73
br label %170
75: ; preds = %20
%76 = getelementptr inbounds i8, i8* %21, i64 2
%77 = load i8, i8* %24
%78 = zext i8 %77 to i32
%79 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @dump_ax25_call to i32 (i8*, i32, ...)*)(i8* %76, i32 %78)
%80 = call i32 (i32, i8*, i32, ...) bitcast (i32 (...)* @lprintf to i32 (i32, i8*, i32, ...)*)(i32 11, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0), i32 %79)
%81 = zext i8 %77 to i64
%82 = getelementptr inbounds i8, i8* %76, i64 %81
%83 = xor i32 %78, -1
%84 = add i32 %26, %83
br label %170
85: ; preds = %20
%86 = load i8, i8* %24
%87 = zext i8 %86 to i32
%88 = getelementptr inbounds i8, i8* %21, i64 3
%89 = call i32 (i8*, ...) bitcast (i32 (...)* @dump_x25_addr to i32 (i8*, ...)*)(i8* %88)
%90 = call i32 (i32, i8*, i32, ...) bitcast (i32 (...)* @lprintf to i32 (i32, i8*, i32, ...)*)(i32 11, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i32 %89)
%91 = zext i8 %86 to i64
%92 = getelementptr inbounds i8, i8* %88, i64 %91
%93 = xor i32 %87, -1
%94 = add i32 %26, %93
br label %170
95: ; preds = %20
%96 = getelementptr inbounds i8, i8* %21, i64 2
%97 = load i8, i8* %24
%98 = zext i8 %97 to i32
%99 = icmp eq i8 %97, 0
br i1 %99, label %120, label %100
100: ; preds = %95, %100
%101 = phi i8* [ %116, %100 ], [ %96, %95 ]
%102 = phi i32 [ %115, %100 ], [ 0, %95 ]
%103 = getelementptr inbounds i8, i8* %101, i64 6
%104 = load i8, i8* %103
%105 = icmp sgt i8 %104, -1
%106 = call i32 (i8*, i32, ...) bitcast (i32 (...)* @dump_ax25_call to i32 (i8*, i32, ...)*)(i8* %101, i32 7)
%107 = sext i32 %106 to i64
%108 = inttoptr i64 %107 to i8*
%109 = select i1 %105, i8* %10, i8* %9
%110 = select i1 %105, [80 x i8]* %4, [80 x i8]* %3
%111 = call i8* @strcat(i8* %109, i8* dereferenceable(1) %108)
%112 = call i64 @strlen(i8* %109)
%113 = getelementptr [80 x i8], [80 x i8]* %110, i64 0, i64 %112
%114 = bitcast i8* %113 to i16*
store i16 32, i16* %114
%115 = add nuw nsw i32 %102, 7
%116 = getelementptr inbounds i8, i8* %101, i64 7
%117 = icmp uge i32 %115, %98
%118 = icmp ugt i32 %102, 35
%119 = or i1 %118, %117
br i1 %119, label %120, label %100
120: ; preds = %100, %95
%121 = zext i8 %97 to i64
%122 = getelementptr inbounds i8, i8* %96, i64 %121
%123 = xor i32 %98, -1
%124 = add i32 %26, %123
br label %170
125: ; preds = %20, %20
%126 = load i8, i8* %24
%127 = zext i8 %126 to i32
%128 = getelementptr inbounds i8, i8* %21, i64 6
%129 = getelementptr inbounds i8, i8* %21, i64 7
%130 = load i8, i8* %128
%131 = zext i8 %130 to i32
%132 = icmp eq i8 %25, -53
%133 = call i32 (i8*, ...) bitcast (i32 (...)* @dump_x25_addr to i32 (i8*, ...)*)(i8* %129)
%134 = sext i32 %133 to i64
%135 = inttoptr i64 %134 to i8*
br i1 %132, label %136, label %147
136: ; preds = %125
%137 = call i8* @strcpy(i8* %13, i8* dereferenceable(1) %135)
%138 = add nuw nsw i32 %131, 1
%139 = lshr i32 %138, 1
%140 = zext i32 %139 to i64
%141 = getelementptr inbounds i8, i8* %129, i64 %140
%142 = add nsw i32 %127, -5
%143 = sub nsw i32 %142, %139
%144 = sext i32 %143 to i64
%145 = call i8* @strncpy(i8* %11, i8* %141, i64 %144)
%146 = getelementptr inbounds [10 x i8], [10 x i8]* %5, i64 0, i64 %144
br label %158
147: ; preds = %125
%148 = call i8* @strcpy(i8* %14, i8* dereferenceable(1) %135)
%149 = add nuw nsw i32 %131, 1
%150 = lshr i32 %149, 1
%151 = zext i32 %150 to i64
%152 = getelementptr inbounds i8, i8* %129, i64 %151
%153 = add nsw i32 %127, -5
%154 = sub nsw i32 %153, %150
%155 = sext i32 %154 to i64
%156 = call i8* @strncpy(i8* %12, i8* %152, i64 %155)
%157 = getelementptr inbounds [10 x i8], [10 x i8]* %6, i64 0, i64 %155
br label %158
158: ; preds = %147, %136
%159 = phi i8* [ %157, %147 ], [ %146, %136 ]
%160 = phi i64 [ %155, %147 ], [ %144, %136 ]
%161 = phi i64 [ %151, %147 ], [ %140, %136 ]
store i8 0, i8* %159
%162 = getelementptr inbounds i8, i8* %129, i64 %161
%163 = getelementptr inbounds i8, i8* %162, i64 %160
%164 = add nsw i32 %23, -2
%165 = sub nsw i32 %164, %127
br label %170
166: ; preds = %20
%167 = zext i8 %25 to i32
%168 = call i32 (i32, i8*, i32, ...) bitcast (i32 (...)* @lprintf to i32 (i32, i8*, i32, ...)*)(i32 11, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.5, i64 0, i64 0), i32 %167)
%169 = call i32 (i8*, i32, i32, ...) bitcast (i32 (...)* @data_dump to i32 (i8*, i32, i32, ...)*)(i8* %0, i32 %1, i32 1)
br label %175
170: ; preds = %158, %120, %85, %75, %70, %55, %36, %30, %27
%171 = phi i32 [ %165, %158 ], [ %124, %120 ], [ %94, %85 ], [ %84, %75 ], [ %74, %70 ], [ %59, %55 ], [ %44, %36 ], [ %35, %30 ], [ %29, %27 ]
%172 = phi i32 [ %22, %158 ], [ 1, %120 ], [ %22, %85 ], [ %22, %75 ], [ %22, %70 ], [ %22, %55 ], [ %22, %36 ], [ %22, %30 ], [ %22, %27 ]
%173 = phi i8* [ %163, %158 ], [ %122, %120 ], [ %92, %85 ], [ %82, %75 ], [ %72, %70 ], [ %57, %55 ], [ %43, %36 ], [ %31, %30 ], [ %28, %27 ]
%174 = icmp sgt i32 %171, 0
br i1 %174, label %20, label %175
175: ; preds = %170, %166
%176 = load i8, i8* %11
%177 = load i8, i8* %12
%178 = icmp ne i8 %176, 0
%179 = icmp ne i8 %177, 0
%180 = select i1 %178, i1 %179, i1 false
br i1 %180, label %181, label %196
181: ; preds = %175
%182 = call i32 (i32, i8*, i8*, i8*, ...) bitcast (i32 (...)* @lprintf to i32 (i32, i8*, i8*, i8*, ...)*)(i32 11, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.6, i64 0, i64 0), i8* %11, i8* %13)
%183 = load i8, i8* %9
%184 = icmp eq i8 %183, 0
br i1 %184, label %187, label %185
185: ; preds = %181
%186 = call i32 (i32, i8*, i8*, ...) bitcast (i32 (...)* @lprintf to i32 (i32, i8*, i8*, ...)*)(i32 11, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.7, i64 0, i64 0), i8* %9)
br label %187
187: ; preds = %185, %181
%188 = call i32 (i32, i8*, ...) bitcast (i32 (...)* @lprintf to i32 (i32, i8*, ...)*)(i32 11, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0))
%189 = call i32 (i32, i8*, i8*, i8*, ...) bitcast (i32 (...)* @lprintf to i32 (i32, i8*, i8*, i8*, ...)*)(i32 11, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.9, i64 0, i64 0), i8* %12, i8* %14)
%190 = load i8, i8* %10
%191 = icmp eq i8 %190, 0
br i1 %191, label %194, label %192
192: ; preds = %187
%193 = call i32 (i32, i8*, i8*, ...) bitcast (i32 (...)* @lprintf to i32 (i32, i8*, i8*, ...)*)(i32 11, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.7, i64 0, i64 0), i8* %10)
br label %194
194: ; preds = %192, %187
%195 = call i32 (i32, i8*, ...) bitcast (i32 (...)* @lprintf to i32 (i32, i8*, ...)*)(i32 11, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.8, i64 0, i64 0))
br label %196
196: ; preds = %2, %194, %175
ret void
}