#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 get_lci(unsigned char const *);
int /*<<< orphan*/ printd(char *, char const *, int, ...);
void print_x25(const char *head, const unsigned char *packet, int len) {
  int gfi = *packet;
  int extended = (gfi & 0x30) == 0x20;
  int lci = get_lci(packet);
  int pti = packet[2];
  if (!(pti & 1)) {
    int ps = pti >> 1, pr, m;
    if (extended) {
      pr = packet[3];
      m = pr & 1;
      pr >>= 1;
    } else {
      ps &= 0x7;
      m = pti & 0x10;
      pr = pti >> 5;
    }
    printd("%s lci=%d DATA (ps=%d, pr=%d%s%s%s)", head, lci, ps, pr,
           m ? ", M" : "", (gfi & 0x80) ? ", Q" : "",
           (gfi & 0x40) ? ". D" : "");
  } else
    switch (pti) {
    case (0x01 + (0 << 5)):
      if (extended) {
        printd("%s lci=%d RR (pr=%d)", head, lci, packet[3] >> 1);
        break;
      }
    case (0x01 + (1 << 5)):
    case (0x01 + (2 << 5)):
    case (0x01 + (3 << 5)):
    case (0x01 + (4 << 5)):
    case (0x01 + (5 << 5)):
    case (0x01 + (6 << 5)):
    case (0x01 + (7 << 5)):
      printd("%s lci=%d RR (pr=%d)", head, lci, pti >> 5);
      break;
    case (0x05 + (0 << 5)):
      if (extended) {
        printd("%s lci=%d RNR(pr=%d)", head, lci, packet[3] >> 1);
        break;
      }
    case (0x05 + (1 << 5)):
    case (0x05 + (2 << 5)):
    case (0x05 + (3 << 5)):
    case (0x05 + (4 << 5)):
    case (0x05 + (5 << 5)):
    case (0x05 + (6 << 5)):
    case (0x05 + (7 << 5)):
      printd("%s lci=%d RNR (pr=%d)", head, lci, pti >> 5);
      break;
    case (0x09 + (0 << 5)):
      if (extended) {
        printd("%s lci=%d REJ (pr=%d)", head, lci, packet[3] >> 1);
        break;
      }
    case (0x09 + (1 << 5)):
    case (0x09 + (2 << 5)):
    case (0x09 + (3 << 5)):
    case (0x09 + (4 << 5)):
    case (0x09 + (5 << 5)):
    case (0x09 + (6 << 5)):
    case (0x09 + (7 << 5)):
      printd("%s lci=%d REJ (pr=%d)", head, lci, pti >> 5);
      break;
    case 0x0B:
      printd("%s lci=%d CALL REQUEST", head, lci);
      break;
    case 0x0F:
      printd("%s lci=%d CALL ACCEPT", head, lci);
      break;
    case 0x13:
      printd("%s lci=%d CLEAR REQUEST", head, lci);
      break;
    case 0x17:
      printd("%s lci=%d CLEAR CONFIRMATION", head, lci);
      break;
    case 0xFB:
      printd("%s lci=%d RESTART REQUEST", head, lci);
      break;
    case 0xFF:
      printd("%s lci=%d RESTART CONFIRMATION", head, lci);
      break;
    default:
      printd("%s lci=%d pti=0x%02x", head, lci, pti);
    }
}


x86 assembly (clang, -O0):
<print_x25>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movzbl (%rax),%eax
mov    %eax,-0x18(%rbp)
mov    -0x18(%rbp),%eax
and    $0x30,%eax
cmp    $0x20,%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x1c(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <get_lci@plt>
mov    %eax,-0x20(%rbp)
mov    -0x10(%rbp),%rax
movzbl 0x2(%rax),%eax
mov    %eax,-0x24(%rbp)
mov    -0x24(%rbp),%eax
and    $0x1,%eax
cmp    $0x0,%eax
jne    1245 <print_x25+0x125>
mov    -0x24(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x28(%rbp)
cmpl   $0x0,-0x1c(%rbp)
je     11ac <print_x25+0x8c>
mov    -0x10(%rbp),%rax
movzbl 0x3(%rax),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x2c(%rbp),%eax
and    $0x1,%eax
mov    %eax,-0x30(%rbp)
mov    -0x2c(%rbp),%eax
sar    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    11c7 <print_x25+0xa7>
mov    -0x28(%rbp),%eax
and    $0x7,%eax
mov    %eax,-0x28(%rbp)
mov    -0x24(%rbp),%eax
and    $0x10,%eax
mov    %eax,-0x30(%rbp)
mov    -0x24(%rbp),%eax
sar    $0x5,%eax
mov    %eax,-0x2c(%rbp)
mov    -0x8(%rbp),%rsi
mov    -0x20(%rbp),%edx
mov    -0x28(%rbp),%ecx
mov    -0x2c(%rbp),%r8d
mov    -0x30(%rbp),%edi
lea    0x12a2(%rip),%r9
lea    0x123a(%rip),%rax
cmp    $0x0,%edi
cmovne %rax,%r9
mov    -0x18(%rbp),%edi
and    $0x80,%edi
lea    0x1284(%rip),%r10
lea    0x1220(%rip),%rax
cmp    $0x0,%edi
cmovne %rax,%r10
mov    -0x18(%rbp),%r11d
and    $0x40,%r11d
lea    0x1267(%rip),%rax
lea    0x1207(%rip),%rdi
cmp    $0x0,%r11d
cmovne %rdi,%rax
lea    0x11cc(%rip),%rdi
mov    %r10,(%rsp)
mov    %rax,0x8(%rsp)
mov    $0x0,%al
call   1040 <printd@plt>
jmp    1425 <print_x25+0x305>
mov    -0x24(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x38(%rbp)
sub    $0xfe,%eax
ja     1408 <print_x25+0x2e8>
mov    -0x38(%rbp),%rax
lea    0xd99(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
cmpl   $0x0,-0x1c(%rbp)
je     129f <print_x25+0x17f>
mov    -0x8(%rbp),%rsi
mov    -0x20(%rbp),%edx
mov    -0x10(%rbp),%rax
movzbl 0x3(%rax),%ecx
sar    $0x1,%ecx
lea    0x1199(%rip),%rdi
mov    $0x0,%al
call   1040 <printd@plt>
jmp    1420 <print_x25+0x300>
jmp    12a4 <print_x25+0x184>
mov    -0x8(%rbp),%rsi
mov    -0x20(%rbp),%edx
mov    -0x24(%rbp),%ecx
sar    $0x5,%ecx
lea    0x1174(%rip),%rdi
mov    $0x0,%al
call   1040 <printd@plt>
jmp    1420 <print_x25+0x300>
cmpl   $0x0,-0x1c(%rbp)
je     12f3 <print_x25+0x1d3>
mov    -0x8(%rbp),%rsi
mov    -0x20(%rbp),%edx
mov    -0x10(%rbp),%rax
movzbl 0x3(%rax),%ecx
sar    $0x1,%ecx
lea    0x115a(%rip),%rdi
mov    $0x0,%al
call   1040 <printd@plt>
jmp    1420 <print_x25+0x300>
jmp    12f8 <print_x25+0x1d8>
mov    -0x8(%rbp),%rsi
mov    -0x20(%rbp),%edx
mov    -0x24(%rbp),%ecx
sar    $0x5,%ecx
lea    0x114a(%rip),%rdi
mov    $0x0,%al
call   1040 <printd@plt>
jmp    1420 <print_x25+0x300>
cmpl   $0x0,-0x1c(%rbp)
je     1347 <print_x25+0x227>
mov    -0x8(%rbp),%rsi
mov    -0x20(%rbp),%edx
mov    -0x10(%rbp),%rax
movzbl 0x3(%rax),%ecx
sar    $0x1,%ecx
lea    0x1131(%rip),%rdi
mov    $0x0,%al
call   1040 <printd@plt>
jmp    1420 <print_x25+0x300>
jmp    134c <print_x25+0x22c>
mov    -0x8(%rbp),%rsi
mov    -0x20(%rbp),%edx
mov    -0x24(%rbp),%ecx
sar    $0x5,%ecx
lea    0x110c(%rip),%rdi
mov    $0x0,%al
call   1040 <printd@plt>
jmp    1420 <print_x25+0x300>
mov    -0x8(%rbp),%rsi
mov    -0x20(%rbp),%edx
lea    0x1108(%rip),%rdi
mov    $0x0,%al
call   1040 <printd@plt>
jmp    1420 <print_x25+0x300>
mov    -0x8(%rbp),%rsi
mov    -0x20(%rbp),%edx
lea    0x1105(%rip),%rdi
mov    $0x0,%al
call   1040 <printd@plt>
jmp    1420 <print_x25+0x300>
mov    -0x8(%rbp),%rsi
mov    -0x20(%rbp),%edx
lea    0x1101(%rip),%rdi
mov    $0x0,%al
call   1040 <printd@plt>
jmp    1420 <print_x25+0x300>
mov    -0x8(%rbp),%rsi
mov    -0x20(%rbp),%edx
lea    0x10ff(%rip),%rdi
mov    $0x0,%al
call   1040 <printd@plt>
jmp    1420 <print_x25+0x300>
mov    -0x8(%rbp),%rsi
mov    -0x20(%rbp),%edx
lea    0x1102(%rip),%rdi
mov    $0x0,%al
call   1040 <printd@plt>
jmp    1420 <print_x25+0x300>
mov    -0x8(%rbp),%rsi
mov    -0x20(%rbp),%edx
lea    0x1102(%rip),%rdi
mov    $0x0,%al
call   1040 <printd@plt>
jmp    1420 <print_x25+0x300>
mov    -0x8(%rbp),%rsi
mov    -0x20(%rbp),%edx
mov    -0x24(%rbp),%ecx
lea    0x1104(%rip),%rdi
mov    $0x0,%al
call   1040 <printd@plt>
jmp    1425 <print_x25+0x305>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<print_x25>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rsi,%rbx
mov    %rdi,%r14
movzbl (%rsi),%r15d
mov    %r15d,%ebp
and    $0x30,%ebp
mov    %rsi,%rdi
call   1030 <get_lci@plt>
movzbl 0x2(%rbx),%r8d
test   $0x1,%r8b
jne    1164 <print_x25+0x44>
mov    %r8d,%ecx
shr    %ecx
cmp    $0x20,%ebp
jne    1194 <print_x25+0x74>
movzbl 0x3(%rbx),%r8d
mov    %r8d,%edx
and    $0x1,%edx
shr    %r8d
jmp    11a1 <print_x25+0x81>
lea    0x7f(%r8),%ecx
cmp    $0xe8,%cl
ja     11f3 <print_x25+0xd3>
movzbl %cl,%ecx
lea    0xe85(%rip),%rdx
movslq (%rdx,%rcx,4),%rcx
add    %rdx,%rcx
jmp    *%rcx
shr    $0x5,%r8d
lea    0x1245(%rip),%rdi
jmp    1286 <print_x25+0x166>
and    $0x7,%ecx
mov    %r8d,%edx
and    $0x10,%edx
shr    $0x5,%r8d
test   %edx,%edx
lea    0x127f(%rip),%rdx
lea    0x1217(%rip),%r9
cmove  %rdx,%r9
test   $0x80,%r15b
lea    0x120c(%rip),%rbp
cmove  %rdx,%rbp
test   $0x40,%r15b
lea    0x1201(%rip),%rbx
cmove  %rdx,%rbx
lea    0x11ca(%rip),%rdi
mov    %r14,%rsi
mov    %eax,%edx
xor    %eax,%eax
push   %rbx
push   %rbp
call   1040 <printd@plt>
add    $0x18,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0x12cb(%rip),%rdi
jmp    1286 <print_x25+0x166>
lea    0x1286(%rip),%rdi
jmp    12af <print_x25+0x18f>
lea    0x1294(%rip),%rdi
jmp    12af <print_x25+0x18f>
cmp    $0x20,%ebp
jne    1184 <print_x25+0x64>
movzbl 0x3(%rbx),%ecx
shr    %ecx
lea    0x11a7(%rip),%rdi
jmp    1274 <print_x25+0x154>
cmp    $0x20,%ebp
jne    1243 <print_x25+0x123>
movzbl 0x3(%rbx),%ecx
shr    %ecx
lea    0x11d3(%rip),%rdi
jmp    1274 <print_x25+0x154>
shr    $0x5,%r8d
lea    0x11c6(%rip),%rdi
jmp    1286 <print_x25+0x166>
lea    0x1200(%rip),%rdi
jmp    12af <print_x25+0x18f>
lea    0x120f(%rip),%rdi
jmp    12af <print_x25+0x18f>
cmp    $0x20,%ebp
jne    127b <print_x25+0x15b>
movzbl 0x3(%rbx),%ecx
shr    %ecx
lea    0x1175(%rip),%rdi
mov    %r14,%rsi
mov    %eax,%edx
jmp    128e <print_x25+0x16e>
shr    $0x5,%r8d
lea    0x1178(%rip),%rdi
mov    %r14,%rsi
mov    %eax,%edx
mov    %r8d,%ecx
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <printd@plt>
lea    0x1184(%rip),%rdi
jmp    12af <print_x25+0x18f>
lea    0x1192(%rip),%rdi
mov    %r14,%rsi
mov    %eax,%edx
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1040 <printd@plt>

LLVM IR (-O0):
@.str = [36 x i8] c"%s lci=%d DATA (ps=%d, pr=%d%s%s%s)\00"
@.str.1 = [4 x i8] c", M\00"
@.str.2 = [1 x i8] zeroinitializer
@.str.3 = [4 x i8] c", Q\00"
@.str.4 = [4 x i8] c". D\00"
@.str.5 = [21 x i8] c"%s lci=%d RR (pr=%d)\00"
@.str.6 = [21 x i8] c"%s lci=%d RNR(pr=%d)\00"
@.str.7 = [22 x i8] c"%s lci=%d RNR (pr=%d)\00"
@.str.8 = [22 x i8] c"%s lci=%d REJ (pr=%d)\00"
@.str.9 = [23 x i8] c"%s lci=%d CALL REQUEST\00"
@.str.10 = [22 x i8] c"%s lci=%d CALL ACCEPT\00"
@.str.11 = [24 x i8] c"%s lci=%d CLEAR REQUEST\00"
@.str.12 = [29 x i8] c"%s lci=%d CLEAR CONFIRMATION\00"
@.str.13 = [26 x i8] c"%s lci=%d RESTART REQUEST\00"
@.str.14 = [31 x i8] c"%s lci=%d RESTART CONFIRMATION\00"
@.str.15 = [21 x i8] c"%s lci=%d pti=0x%02x\00"
define void @print_x25(i8* %0, i8* %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
store i8* %0, i8** %4
store i8* %1, i8** %5
store i32 %2, i32* %6
%14 = load i8*, i8** %5
%15 = load i8, i8* %14
%16 = zext i8 %15 to i32
store i32 %16, i32* %7
%17 = load i32, i32* %7
%18 = and i32 %17, 48
%19 = icmp eq i32 %18, 32
%20 = zext i1 %19 to i32
store i32 %20, i32* %8
%21 = load i8*, i8** %5
%22 = call i32 @get_lci(i8* %21)
store i32 %22, i32* %9
%23 = load i8*, i8** %5
%24 = getelementptr inbounds i8, i8* %23, i64 2
%25 = load i8, i8* %24
%26 = zext i8 %25 to i32
store i32 %26, i32* %10
%27 = load i32, i32* %10
%28 = and i32 %27, 1
%29 = icmp ne i32 %28, 0
br i1 %29, label %71, label %30
30: ; preds = %3
%31 = load i32, i32* %10
%32 = ashr i32 %31, 1
store i32 %32, i32* %11
%33 = load i32, i32* %8
%34 = icmp ne i32 %33, 0
br i1 %34, label %35, label %44
35: ; preds = %30
%36 = load i8*, i8** %5
%37 = getelementptr inbounds i8, i8* %36, i64 3
%38 = load i8, i8* %37
%39 = zext i8 %38 to i32
store i32 %39, i32* %12
%40 = load i32, i32* %12
%41 = and i32 %40, 1
store i32 %41, i32* %13
%42 = load i32, i32* %12
%43 = ashr i32 %42, 1
store i32 %43, i32* %12
br label %51
44: ; preds = %30
%45 = load i32, i32* %11
%46 = and i32 %45, 7
store i32 %46, i32* %11
%47 = load i32, i32* %10
%48 = and i32 %47, 16
store i32 %48, i32* %13
%49 = load i32, i32* %10
%50 = ashr i32 %49, 5
store i32 %50, i32* %12
br label %51
51: ; preds = %44, %35
%52 = load i8*, i8** %4
%53 = load i32, i32* %9
%54 = load i32, i32* %11
%55 = load i32, i32* %12
%56 = load i32, i32* %13
%57 = icmp ne i32 %56, 0
%58 = zext i1 %57 to i64
%59 = select i1 %57, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0)
%60 = load i32, i32* %7
%61 = and i32 %60, 128
%62 = icmp ne i32 %61, 0
%63 = zext i1 %62 to i64
%64 = select i1 %62, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0)
%65 = load i32, i32* %7
%66 = and i32 %65, 64
%67 = icmp ne i32 %66, 0
%68 = zext i1 %67 to i64
%69 = select i1 %67, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0)
%70 = call i32 (i8*, i8*, i32, ...) @printd(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i8* %52, i32 %53, i32 %54, i32 %55, i8* %59, i8* %64, i8* %69)
br label %160
71: ; preds = %3
%72 = load i32, i32* %10
switch i32 %72, label %154 [
i32 1, label %73
i32 33, label %86
i32 65, label %86
i32 97, label %86
i32 129, label %86
i32 161, label %86
i32 193, label %86
i32 225, label %86
i32 5, label %92
i32 37, label %105
i32 69, label %105
i32 101, label %105
i32 133, label %105
i32 165, label %105
i32 197, label %105
i32 229, label %105
i32 9, label %111
i32 41, label %124
i32 73, label %124
i32 105, label %124
i32 137, label %124
i32 169, label %124
i32 201, label %124
i32 233, label %124
i32 11, label %130
i32 15, label %134
i32 19, label %138
i32 23, label %142
i32 251, label %146
i32 255, label %150
]
73: ; preds = %71
%74 = load i32, i32* %8
%75 = icmp ne i32 %74, 0
br i1 %75, label %76, label %85
76: ; preds = %73
%77 = load i8*, i8** %4
%78 = load i32, i32* %9
%79 = load i8*, i8** %5
%80 = getelementptr inbounds i8, i8* %79, i64 3
%81 = load i8, i8* %80
%82 = zext i8 %81 to i32
%83 = ashr i32 %82, 1
%84 = call i32 (i8*, i8*, i32, ...) @printd(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.5, i64 0, i64 0), i8* %77, i32 %78, i32 %83)
br label %159
85: ; preds = %73
br label %86
86: ; preds = %71, %71, %71, %71, %71, %71, %71, %85
%87 = load i8*, i8** %4
%88 = load i32, i32* %9
%89 = load i32, i32* %10
%90 = ashr i32 %89, 5
%91 = call i32 (i8*, i8*, i32, ...) @printd(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.5, i64 0, i64 0), i8* %87, i32 %88, i32 %90)
br label %159
92: ; preds = %71
%93 = load i32, i32* %8
%94 = icmp ne i32 %93, 0
br i1 %94, label %95, label %104
95: ; preds = %92
%96 = load i8*, i8** %4
%97 = load i32, i32* %9
%98 = load i8*, i8** %5
%99 = getelementptr inbounds i8, i8* %98, i64 3
%100 = load i8, i8* %99
%101 = zext i8 %100 to i32
%102 = ashr i32 %101, 1
%103 = call i32 (i8*, i8*, i32, ...) @printd(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.6, i64 0, i64 0), i8* %96, i32 %97, i32 %102)
br label %159
104: ; preds = %92
br label %105
105: ; preds = %71, %71, %71, %71, %71, %71, %71, %104
%106 = load i8*, i8** %4
%107 = load i32, i32* %9
%108 = load i32, i32* %10
%109 = ashr i32 %108, 5
%110 = call i32 (i8*, i8*, i32, ...) @printd(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.7, i64 0, i64 0), i8* %106, i32 %107, i32 %109)
br label %159
111: ; preds = %71
%112 = load i32, i32* %8
%113 = icmp ne i32 %112, 0
br i1 %113, label %114, label %123
114: ; preds = %111
%115 = load i8*, i8** %4
%116 = load i32, i32* %9
%117 = load i8*, i8** %5
%118 = getelementptr inbounds i8, i8* %117, i64 3
%119 = load i8, i8* %118
%120 = zext i8 %119 to i32
%121 = ashr i32 %120, 1
%122 = call i32 (i8*, i8*, i32, ...) @printd(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.8, i64 0, i64 0), i8* %115, i32 %116, i32 %121)
br label %159
123: ; preds = %111
br label %124
124: ; preds = %71, %71, %71, %71, %71, %71, %71, %123
%125 = load i8*, i8** %4
%126 = load i32, i32* %9
%127 = load i32, i32* %10
%128 = ashr i32 %127, 5
%129 = call i32 (i8*, i8*, i32, ...) @printd(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.8, i64 0, i64 0), i8* %125, i32 %126, i32 %128)
br label %159
130: ; preds = %71
%131 = load i8*, i8** %4
%132 = load i32, i32* %9
%133 = call i32 (i8*, i8*, i32, ...) @printd(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.9, i64 0, i64 0), i8* %131, i32 %132)
br label %159
134: ; preds = %71
%135 = load i8*, i8** %4
%136 = load i32, i32* %9
%137 = call i32 (i8*, i8*, i32, ...) @printd(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.10, i64 0, i64 0), i8* %135, i32 %136)
br label %159
138: ; preds = %71
%139 = load i8*, i8** %4
%140 = load i32, i32* %9
%141 = call i32 (i8*, i8*, i32, ...) @printd(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.11, i64 0, i64 0), i8* %139, i32 %140)
br label %159
142: ; preds = %71
%143 = load i8*, i8** %4
%144 = load i32, i32* %9
%145 = call i32 (i8*, i8*, i32, ...) @printd(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.12, i64 0, i64 0), i8* %143, i32 %144)
br label %159
146: ; preds = %71
%147 = load i8*, i8** %4
%148 = load i32, i32* %9
%149 = call i32 (i8*, i8*, i32, ...) @printd(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.13, i64 0, i64 0), i8* %147, i32 %148)
br label %159
150: ; preds = %71
%151 = load i8*, i8** %4
%152 = load i32, i32* %9
%153 = call i32 (i8*, i8*, i32, ...) @printd(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.14, i64 0, i64 0), i8* %151, i32 %152)
br label %159
154: ; preds = %71
%155 = load i8*, i8** %4
%156 = load i32, i32* %9
%157 = load i32, i32* %10
%158 = call i32 (i8*, i8*, i32, ...) @printd(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.15, i64 0, i64 0), i8* %155, i32 %156, i32 %157)
br label %159
159: ; preds = %154, %150, %146, %142, %138, %134, %130, %124, %114, %105, %95, %86, %76
br label %160
160: ; preds = %159, %51
ret void
}

LLVM IR (-O2):
@.str = [36 x i8] c"%s lci=%d DATA (ps=%d, pr=%d%s%s%s)\00"
@.str.1 = [4 x i8] c", M\00"
@.str.2 = [1 x i8] zeroinitializer
@.str.3 = [4 x i8] c", Q\00"
@.str.4 = [4 x i8] c". D\00"
@.str.5 = [21 x i8] c"%s lci=%d RR (pr=%d)\00"
@.str.6 = [21 x i8] c"%s lci=%d RNR(pr=%d)\00"
@.str.7 = [22 x i8] c"%s lci=%d RNR (pr=%d)\00"
@.str.8 = [22 x i8] c"%s lci=%d REJ (pr=%d)\00"
@.str.9 = [23 x i8] c"%s lci=%d CALL REQUEST\00"
@.str.10 = [22 x i8] c"%s lci=%d CALL ACCEPT\00"
@.str.11 = [24 x i8] c"%s lci=%d CLEAR REQUEST\00"
@.str.12 = [29 x i8] c"%s lci=%d CLEAR CONFIRMATION\00"
@.str.13 = [26 x i8] c"%s lci=%d RESTART REQUEST\00"
@.str.14 = [31 x i8] c"%s lci=%d RESTART CONFIRMATION\00"
@.str.15 = [21 x i8] c"%s lci=%d pti=0x%02x\00"
define void @print_x25(i8* %0, i8* %1, i32 %2) {
%4 = load i8, i8* %1
%5 = zext i8 %4 to i32
%6 = and i32 %5, 48
%7 = icmp eq i32 %6, 32
%8 = tail call i32 @get_lci(i8* %1)
%9 = getelementptr inbounds i8, i8* %1, i64 2
%10 = load i8, i8* %9
%11 = zext i8 %10 to i32
%12 = and i32 %11, 1
%13 = icmp eq i32 %12, 0
br i1 %13, label %14, label %39
14: ; preds = %3
%15 = lshr i32 %11, 1
br i1 %7, label %16, label %22
16: ; preds = %14
%17 = getelementptr inbounds i8, i8* %1, i64 3
%18 = load i8, i8* %17
%19 = zext i8 %18 to i32
%20 = and i32 %19, 1
%21 = lshr i32 %19, 1
br label %26
22: ; preds = %14
%23 = and i32 %15, 7
%24 = and i32 %11, 16
%25 = lshr i32 %11, 5
br label %26
26: ; preds = %22, %16
%27 = phi i32 [ %15, %16 ], [ %23, %22 ]
%28 = phi i32 [ %21, %16 ], [ %25, %22 ]
%29 = phi i32 [ %20, %16 ], [ %24, %22 ]
%30 = icmp eq i32 %29, 0
%31 = select i1 %30, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0)
%32 = and i32 %5, 128
%33 = icmp eq i32 %32, 0
%34 = select i1 %33, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0)
%35 = and i32 %5, 64
%36 = icmp eq i32 %35, 0
%37 = select i1 %36, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0)
%38 = tail call i32 (i8*, i8*, i32, ...) @printd(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str, i64 0, i64 0), i8* %0, i32 %8, i32 %27, i32 %28, i8* %31, i8* %34, i8* %37)
br label %84
39: ; preds = %3
switch i8 %10, label %82 [
i8 1, label %40
i8 33, label %47
i8 65, label %47
i8 97, label %47
i8 -127, label %47
i8 -95, label %47
i8 -63, label %47
i8 -31, label %47
i8 5, label %50
i8 37, label %57
i8 69, label %57
i8 101, label %57
i8 -123, label %57
i8 -91, label %57
i8 -59, label %57
i8 -27, label %57
i8 9, label %60
i8 41, label %67
i8 73, label %67
i8 105, label %67
i8 -119, label %67
i8 -87, label %67
i8 -55, label %67
i8 -23, label %67
i8 11, label %70
i8 15, label %72
i8 19, label %74
i8 23, label %76
i8 -5, label %78
i8 -1, label %80
]
40: ; preds = %39
br i1 %7, label %41, label %47
41: ; preds = %40
%42 = getelementptr inbounds i8, i8* %1, i64 3
%43 = load i8, i8* %42
%44 = lshr i8 %43, 1
%45 = zext i8 %44 to i32
%46 = tail call i32 (i8*, i8*, i32, ...) @printd(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.5, i64 0, i64 0), i8* %0, i32 %8, i32 %45)
br label %84
47: ; preds = %40, %39, %39, %39, %39, %39, %39, %39
%48 = lshr i32 %11, 5
%49 = tail call i32 (i8*, i8*, i32, ...) @printd(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.5, i64 0, i64 0), i8* %0, i32 %8, i32 %48)
br label %84
50: ; preds = %39
br i1 %7, label %51, label %57
51: ; preds = %50
%52 = getelementptr inbounds i8, i8* %1, i64 3
%53 = load i8, i8* %52
%54 = lshr i8 %53, 1
%55 = zext i8 %54 to i32
%56 = tail call i32 (i8*, i8*, i32, ...) @printd(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.6, i64 0, i64 0), i8* %0, i32 %8, i32 %55)
br label %84
57: ; preds = %50, %39, %39, %39, %39, %39, %39, %39
%58 = lshr i32 %11, 5
%59 = tail call i32 (i8*, i8*, i32, ...) @printd(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.7, i64 0, i64 0), i8* %0, i32 %8, i32 %58)
br label %84
60: ; preds = %39
br i1 %7, label %61, label %67
61: ; preds = %60
%62 = getelementptr inbounds i8, i8* %1, i64 3
%63 = load i8, i8* %62
%64 = lshr i8 %63, 1
%65 = zext i8 %64 to i32
%66 = tail call i32 (i8*, i8*, i32, ...) @printd(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.8, i64 0, i64 0), i8* %0, i32 %8, i32 %65)
br label %84
67: ; preds = %60, %39, %39, %39, %39, %39, %39, %39
%68 = lshr i32 %11, 5
%69 = tail call i32 (i8*, i8*, i32, ...) @printd(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.8, i64 0, i64 0), i8* %0, i32 %8, i32 %68)
br label %84
70: ; preds = %39
%71 = tail call i32 (i8*, i8*, i32, ...) @printd(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.9, i64 0, i64 0), i8* %0, i32 %8)
br label %84
72: ; preds = %39
%73 = tail call i32 (i8*, i8*, i32, ...) @printd(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.10, i64 0, i64 0), i8* %0, i32 %8)
br label %84
74: ; preds = %39
%75 = tail call i32 (i8*, i8*, i32, ...) @printd(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.11, i64 0, i64 0), i8* %0, i32 %8)
br label %84
76: ; preds = %39
%77 = tail call i32 (i8*, i8*, i32, ...) @printd(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.12, i64 0, i64 0), i8* %0, i32 %8)
br label %84
78: ; preds = %39
%79 = tail call i32 (i8*, i8*, i32, ...) @printd(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.13, i64 0, i64 0), i8* %0, i32 %8)
br label %84
80: ; preds = %39
%81 = tail call i32 (i8*, i8*, i32, ...) @printd(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.14, i64 0, i64 0), i8* %0, i32 %8)
br label %84
82: ; preds = %39
%83 = tail call i32 (i8*, i8*, i32, ...) @printd(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.15, i64 0, i64 0), i8* %0, i32 %8, i32 %11)
br label %84
84: ; preds = %41, %47, %51, %57, %61, %67, %70, %72, %74, %76, %78, %80, %82, %26
ret void
}