#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 get16(unsigned char *);
int /*<<< orphan*/ lprintf(int, char *, ...);
int /*<<< orphan*/ pax25(char *, unsigned char *);
void arp_dump(unsigned char *data, int length) {
  int is_ip = 0;
  int hardware;
  int protocol;
  int hwlen;
  int pralen;
  int operation;
  unsigned char *shwaddr, *sprotaddr;
  unsigned char *thwaddr, *tprotaddr;
  char tmp[25];
  lprintf(6, "ARP: ");
  lprintf(9, "len %d", length);
  if (length < 16) {
    lprintf(1, " bad packet\n");
    return;
  }
  hardware = get16(data + 0);
  protocol = get16(data + 2);
  hwlen = data[4];
  pralen = data[5];
  operation = get16(data + 6);
  if (hardware != 3) {
    lprintf(9, " non-AX25 ARP packet\n");
    return;
  }
  lprintf(9, " hwtype AX25");
  if (hwlen != 7)
    lprintf(9, " hwlen %d", hwlen);
  if (protocol == 0xCC) {
    lprintf(9, " prot IP");
    is_ip = 1;
  } else {
    lprintf(9, " prot 0x%x prlen %d", protocol, pralen);
  }
  switch (operation) {
  case 1:
    lprintf(9, " op REQUEST");
    break;
  case 2:
    lprintf(9, " op REPLY");
    break;
  case 3:
    lprintf(9, " op REVERSE REQUEST");
    break;
  case 4:
    lprintf(9, " op REVERSE REPLY");
    break;
  default:
    lprintf(9, " op %d", operation);
    break;
  }
  shwaddr = data + 8;
  sprotaddr = shwaddr + hwlen;
  thwaddr = sprotaddr + pralen;
  tprotaddr = thwaddr + hwlen;
  lprintf(9, "\nsender");
  if (is_ip)
    lprintf(8, " IPaddr %d.%d.%d.%d", sprotaddr[0], sprotaddr[1], sprotaddr[2],
            sprotaddr[3]);
  lprintf(9, " hwaddr %s\n", pax25(tmp, shwaddr));
  lprintf(9, "target");
  if (is_ip)
    lprintf(8, " IPaddr %d.%d.%d.%d", tprotaddr[0], tprotaddr[1], tprotaddr[2],
            tprotaddr[3]);
  if (*thwaddr != 0)
    lprintf(8, " hwaddr %s", pax25(tmp, thwaddr));
  lprintf(9, "\n");
}


x86 assembly (clang, -O0):
<arp_dump>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
mov    $0x6,%edi
lea    0xebb(%rip),%rsi
mov    $0x0,%al
call   1050 <lprintf@plt>
mov    -0xc(%rbp),%edx
mov    $0x9,%edi
lea    0xefb(%rip),%rsi
mov    $0x0,%al
call   1050 <lprintf@plt>
cmpl   $0x10,-0xc(%rbp)
jge    1194 <arp_dump+0x64>
mov    $0x1,%edi
lea    0xe8e(%rip),%rsi
mov    $0x0,%al
call   1050 <lprintf@plt>
jmp    1451 <arp_dump+0x321>
mov    -0x8(%rbp),%rdi
call   1040 <get16@plt>
mov    %eax,-0x14(%rbp)
mov    -0x8(%rbp),%rdi
add    $0x2,%rdi
call   1040 <get16@plt>
mov    %eax,-0x18(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x4(%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    -0x8(%rbp),%rax
movzbl 0x5(%rax),%eax
mov    %eax,-0x20(%rbp)
mov    -0x8(%rbp),%rdi
add    $0x6,%rdi
call   1040 <get16@plt>
mov    %eax,-0x24(%rbp)
cmpl   $0x3,-0x14(%rbp)
je     11f8 <arp_dump+0xc8>
mov    $0x9,%edi
lea    0xe37(%rip),%rsi
mov    $0x0,%al
call   1050 <lprintf@plt>
jmp    1451 <arp_dump+0x321>
mov    $0x9,%edi
lea    0xe35(%rip),%rsi
mov    $0x0,%al
call   1050 <lprintf@plt>
cmpl   $0x7,-0x1c(%rbp)
je     122b <arp_dump+0xfb>
mov    -0x1c(%rbp),%edx
mov    $0x9,%edi
lea    0xe22(%rip),%rsi
mov    $0x0,%al
call   1050 <lprintf@plt>
cmpl   $0xcc,-0x18(%rbp)
jne    1257 <arp_dump+0x127>
mov    $0x9,%edi
lea    0xe0c(%rip),%rsi
mov    $0x0,%al
call   1050 <lprintf@plt>
movl   $0x1,-0x10(%rbp)
jmp    1270 <arp_dump+0x140>
mov    -0x18(%rbp),%edx
mov    -0x20(%rbp),%ecx
mov    $0x9,%edi
lea    0xdf0(%rip),%rsi
mov    $0x0,%al
call   1050 <lprintf@plt>
mov    -0x24(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x78(%rbp)
sub    $0x3,%eax
ja     12f9 <arp_dump+0x1c9>
mov    -0x78(%rbp),%rax
lea    0xd70(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    $0x9,%edi
lea    0xdc8(%rip),%rsi
mov    $0x0,%al
call   1050 <lprintf@plt>
jmp    130f <arp_dump+0x1df>
mov    $0x9,%edi
lea    0xdbc(%rip),%rsi
mov    $0x0,%al
call   1050 <lprintf@plt>
jmp    130f <arp_dump+0x1df>
mov    $0x9,%edi
lea    0xdae(%rip),%rsi
mov    $0x0,%al
call   1050 <lprintf@plt>
jmp    130f <arp_dump+0x1df>
mov    $0x9,%edi
lea    0xdaa(%rip),%rsi
mov    $0x0,%al
call   1050 <lprintf@plt>
jmp    130f <arp_dump+0x1df>
mov    -0x24(%rbp),%edx
mov    $0x9,%edi
lea    0xda1(%rip),%rsi
mov    $0x0,%al
call   1050 <lprintf@plt>
mov    -0x8(%rbp),%rax
add    $0x8,%rax
mov    %rax,-0x30(%rbp)
mov    -0x30(%rbp),%rax
movslq -0x1c(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rax
movslq -0x20(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rax
movslq -0x1c(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x48(%rbp)
mov    $0x9,%edi
lea    0xd5c(%rip),%rsi
mov    $0x0,%al
call   1050 <lprintf@plt>
cmpl   $0x0,-0x10(%rbp)
je     1399 <arp_dump+0x269>
mov    -0x38(%rbp),%rax
movzbl (%rax),%edx
mov    -0x38(%rbp),%rax
movzbl 0x1(%rax),%ecx
mov    -0x38(%rbp),%rax
movzbl 0x2(%rax),%r8d
mov    -0x38(%rbp),%rax
movzbl 0x3(%rax),%r9d
mov    $0x8,%edi
lea    0xd26(%rip),%rsi
mov    $0x0,%al
call   1050 <lprintf@plt>
lea    -0x70(%rbp),%rdi
mov    -0x30(%rbp),%rsi
call   1030 <pax25@plt>
mov    %eax,%edx
mov    $0x9,%edi
lea    0xd18(%rip),%rsi
mov    $0x0,%al
call   1050 <lprintf@plt>
mov    $0x9,%edi
lea    0xd11(%rip),%rsi
mov    $0x0,%al
call   1050 <lprintf@plt>
cmpl   $0x0,-0x10(%rbp)
je     140c <arp_dump+0x2dc>
mov    -0x48(%rbp),%rax
movzbl (%rax),%edx
mov    -0x48(%rbp),%rax
movzbl 0x1(%rax),%ecx
mov    -0x48(%rbp),%rax
movzbl 0x2(%rax),%r8d
mov    -0x48(%rbp),%rax
movzbl 0x3(%rax),%r9d
mov    $0x8,%edi
lea    0xcb3(%rip),%rsi
mov    $0x0,%al
call   1050 <lprintf@plt>
mov    -0x40(%rbp),%rax
movzbl (%rax),%eax
cmp    $0x0,%eax
je     143e <arp_dump+0x30e>
lea    -0x70(%rbp),%rdi
mov    -0x40(%rbp),%rsi
call   1030 <pax25@plt>
mov    %eax,%edx
mov    $0x8,%edi
lea    0xca8(%rip),%rsi
mov    $0x0,%al
call   1050 <lprintf@plt>
mov    $0x9,%edi
lea    0xc8c(%rip),%rsi
mov    $0x0,%al
call   1050 <lprintf@plt>
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<arp_dump>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %esi,%ebp
mov    %rdi,%rbx
lea    0xec6(%rip),%rsi
mov    $0x6,%edi
xor    %eax,%eax
call   1050 <lprintf@plt>
lea    0xf09(%rip),%rsi
mov    $0x9,%edi
mov    %ebp,%edx
xor    %eax,%eax
call   1050 <lprintf@plt>
cmp    $0xf,%ebp
jg     1181 <arp_dump+0x51>
lea    0xe9f(%rip),%rsi
mov    $0x1,%edi
jmp    120b <arp_dump+0xdb>
mov    %rbx,%rdi
call   1040 <get16@plt>
mov    %eax,%ebp
lea    0x2(%rbx),%rdi
call   1040 <get16@plt>
mov    %eax,%r15d
movzbl 0x4(%rbx),%r12d
movzbl 0x5(%rbx),%r14d
lea    0x6(%rbx),%rdi
call   1040 <get16@plt>
cmp    $0x3,%ebp
jne    11ff <arp_dump+0xcf>
mov    %eax,%r13d
lea    0xe80(%rip),%rsi
mov    $0x9,%edi
xor    %eax,%eax
call   1050 <lprintf@plt>
cmp    $0x7,%r12b
je     11e1 <arp_dump+0xb1>
lea    0xe74(%rip),%rsi
mov    $0x9,%edi
mov    %r12d,%edx
xor    %eax,%eax
call   1050 <lprintf@plt>
cmp    $0xcc,%r15d
jne    1220 <arp_dump+0xf0>
lea    0xe5f(%rip),%rsi
mov    $0x9,%edi
xor    %eax,%eax
call   1050 <lprintf@plt>
jmp    1239 <arp_dump+0x109>
lea    0xe1d(%rip),%rsi
mov    $0x9,%edi
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1050 <lprintf@plt>
lea    0xe32(%rip),%rsi
mov    $0x9,%edi
mov    %r15d,%edx
mov    %r14d,%ecx
xor    %eax,%eax
call   1050 <lprintf@plt>
lea    -0x1(%r13),%eax
cmp    $0x3,%eax
ja     125b <arp_dump+0x12b>
lea    0xdb7(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xe14(%rip),%rsi
jmp    128c <arp_dump+0x15c>
lea    0xe47(%rip),%rsi
mov    $0x9,%edi
mov    %r13d,%edx
xor    %eax,%eax
call   1050 <lprintf@plt>
jmp    1298 <arp_dump+0x168>
lea    0xdff(%rip),%rsi
jmp    128c <arp_dump+0x15c>
lea    0xe00(%rip),%rsi
jmp    128c <arp_dump+0x15c>
lea    0xe0b(%rip),%rsi
mov    $0x9,%edi
xor    %eax,%eax
call   1050 <lprintf@plt>
mov    %r12d,%ebp
lea    (%rbx,%rbp,1),%rax
add    $0x8,%rax
add    $0x8,%rbx
mov    %r14d,%r12d
add    %rax,%r12
lea    0xdfc(%rip),%rsi
mov    $0x9,%edi
xor    %eax,%eax
call   1050 <lprintf@plt>
cmp    $0xcc,%r15d
jne    135a <arp_dump+0x22a>
movzbl (%rbx,%rbp,1),%edx
movzbl 0x1(%rbx,%rbp,1),%ecx
movzbl 0x2(%rbx,%rbp,1),%r8d
movzbl 0x3(%rbx,%rbp,1),%r9d
lea    0xdcf(%rip),%r14
mov    $0x8,%edi
mov    %r14,%rsi
xor    %eax,%eax
call   1050 <lprintf@plt>
mov    %rsp,%rdi
mov    %rbx,%rsi
call   1030 <pax25@plt>
lea    0xdc2(%rip),%rsi
mov    $0x9,%edi
mov    %eax,%edx
xor    %eax,%eax
call   1050 <lprintf@plt>
lea    0xdb9(%rip),%rsi
mov    $0x9,%edi
xor    %eax,%eax
call   1050 <lprintf@plt>
movzbl (%r12,%rbp,1),%edx
movzbl 0x1(%r12,%rbp,1),%ecx
movzbl 0x2(%r12,%rbp,1),%r8d
movzbl 0x3(%r12,%rbp,1),%r9d
mov    $0x8,%edi
mov    %r14,%rsi
xor    %eax,%eax
call   1050 <lprintf@plt>
cmpb   $0x0,(%r12)
jne    1394 <arp_dump+0x264>
jmp    13b4 <arp_dump+0x284>
mov    %rsp,%rdi
mov    %rbx,%rsi
call   1030 <pax25@plt>
lea    0xd60(%rip),%rsi
mov    $0x9,%edi
mov    %eax,%edx
xor    %eax,%eax
call   1050 <lprintf@plt>
lea    0xd57(%rip),%rsi
mov    $0x9,%edi
xor    %eax,%eax
call   1050 <lprintf@plt>
cmpb   $0x0,(%r12)
je     13b4 <arp_dump+0x284>
mov    %rsp,%rdi
mov    %r12,%rsi
call   1030 <pax25@plt>
lea    0xd39(%rip),%rsi
mov    $0x8,%edi
mov    %eax,%edx
xor    %eax,%eax
call   1050 <lprintf@plt>
lea    0xd1b(%rip),%rsi
mov    $0x9,%edi
xor    %eax,%eax
call   1050 <lprintf@plt>
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [6 x i8] c"ARP: \00"
@.str.1 = [7 x i8] c"len %d\00"
@.str.2 = [13 x i8] c" bad packet\0A\00"
@.str.3 = [22 x i8] c" non-AX25 ARP packet\0A\00"
@.str.4 = [13 x i8] c" hwtype AX25\00"
@.str.5 = [10 x i8] c" hwlen %d\00"
@.str.6 = [9 x i8] c" prot IP\00"
@.str.7 = [20 x i8] c" prot 0x%x prlen %d\00"
@.str.8 = [12 x i8] c" op REQUEST\00"
@.str.9 = [10 x i8] c" op REPLY\00"
@.str.10 = [20 x i8] c" op REVERSE REQUEST\00"
@.str.11 = [18 x i8] c" op REVERSE REPLY\00"
@.str.12 = [7 x i8] c" op %d\00"
@.str.13 = [8 x i8] c"\0Asender\00"
@.str.14 = [20 x i8] c" IPaddr %d.%d.%d.%d\00"
@.str.15 = [12 x i8] c" hwaddr %s\0A\00"
@.str.16 = [7 x i8] c"target\00"
@.str.17 = [11 x i8] c" hwaddr %s\00"
@.str.18 = [2 x i8] c"\0A\00"
define void @arp_dump(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 i8*
%12 = alloca i8*
%13 = alloca i8*
%14 = alloca i8*
%15 = alloca [25 x i8]
store i8* %0, i8** %3
store i32 %1, i32* %4
store i32 0, i32* %5
%16 = call i32 (i32, i8*, ...) @lprintf(i32 6, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%17 = load i32, i32* %4
%18 = call i32 (i32, i8*, ...) @lprintf(i32 9, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %17)
%19 = load i32, i32* %4
%20 = icmp slt i32 %19, 16
br i1 %20, label %21, label %23
21: ; preds = %2
%22 = call i32 (i32, i8*, ...) @lprintf(i32 1, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
br label %148
23: ; preds = %2
%24 = load i8*, i8** %3
%25 = getelementptr inbounds i8, i8* %24, i64 0
%26 = call i32 @get16(i8* %25)
store i32 %26, i32* %6
%27 = load i8*, i8** %3
%28 = getelementptr inbounds i8, i8* %27, i64 2
%29 = call i32 @get16(i8* %28)
store i32 %29, i32* %7
%30 = load i8*, i8** %3
%31 = getelementptr inbounds i8, i8* %30, i64 4
%32 = load i8, i8* %31
%33 = zext i8 %32 to i32
store i32 %33, i32* %8
%34 = load i8*, i8** %3
%35 = getelementptr inbounds i8, i8* %34, i64 5
%36 = load i8, i8* %35
%37 = zext i8 %36 to i32
store i32 %37, i32* %9
%38 = load i8*, i8** %3
%39 = getelementptr inbounds i8, i8* %38, i64 6
%40 = call i32 @get16(i8* %39)
store i32 %40, i32* %10
%41 = load i32, i32* %6
%42 = icmp ne i32 %41, 3
br i1 %42, label %43, label %45
43: ; preds = %23
%44 = call i32 (i32, i8*, ...) @lprintf(i32 9, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.3, i64 0, i64 0))
br label %148
45: ; preds = %23
%46 = call i32 (i32, i8*, ...) @lprintf(i32 9, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0))
%47 = load i32, i32* %8
%48 = icmp ne i32 %47, 7
br i1 %48, label %49, label %52
49: ; preds = %45
%50 = load i32, i32* %8
%51 = call i32 (i32, i8*, ...) @lprintf(i32 9, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0), i32 %50)
br label %52
52: ; preds = %49, %45
%53 = load i32, i32* %7
%54 = icmp eq i32 %53, 204
br i1 %54, label %55, label %57
55: ; preds = %52
%56 = call i32 (i32, i8*, ...) @lprintf(i32 9, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0))
store i32 1, i32* %5
br label %61
57: ; preds = %52
%58 = load i32, i32* %7
%59 = load i32, i32* %9
%60 = call i32 (i32, i8*, ...) @lprintf(i32 9, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.7, i64 0, i64 0), i32 %58, i32 %59)
br label %61
61: ; preds = %57, %55
%62 = load i32, i32* %10
switch i32 %62, label %71 [
i32 1, label %63
i32 2, label %65
i32 3, label %67
i32 4, label %69
]
63: ; preds = %61
%64 = call i32 (i32, i8*, ...) @lprintf(i32 9, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.8, i64 0, i64 0))
br label %74
65: ; preds = %61
%66 = call i32 (i32, i8*, ...) @lprintf(i32 9, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.9, i64 0, i64 0))
br label %74
67: ; preds = %61
%68 = call i32 (i32, i8*, ...) @lprintf(i32 9, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.10, i64 0, i64 0))
br label %74
69: ; preds = %61
%70 = call i32 (i32, i8*, ...) @lprintf(i32 9, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.11, i64 0, i64 0))
br label %74
71: ; preds = %61
%72 = load i32, i32* %10
%73 = call i32 (i32, i8*, ...) @lprintf(i32 9, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.12, i64 0, i64 0), i32 %72)
br label %74
74: ; preds = %71, %69, %67, %65, %63
%75 = load i8*, i8** %3
%76 = getelementptr inbounds i8, i8* %75, i64 8
store i8* %76, i8** %11
%77 = load i8*, i8** %11
%78 = load i32, i32* %8
%79 = sext i32 %78 to i64
%80 = getelementptr inbounds i8, i8* %77, i64 %79
store i8* %80, i8** %12
%81 = load i8*, i8** %12
%82 = load i32, i32* %9
%83 = sext i32 %82 to i64
%84 = getelementptr inbounds i8, i8* %81, i64 %83
store i8* %84, i8** %13
%85 = load i8*, i8** %13
%86 = load i32, i32* %8
%87 = sext i32 %86 to i64
%88 = getelementptr inbounds i8, i8* %85, i64 %87
store i8* %88, i8** %14
%89 = call i32 (i32, i8*, ...) @lprintf(i32 9, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.13, i64 0, i64 0))
%90 = load i32, i32* %5
%91 = icmp ne i32 %90, 0
br i1 %91, label %92, label %110
92: ; preds = %74
%93 = load i8*, i8** %12
%94 = getelementptr inbounds i8, i8* %93, i64 0
%95 = load i8, i8* %94
%96 = zext i8 %95 to i32
%97 = load i8*, i8** %12
%98 = getelementptr inbounds i8, i8* %97, i64 1
%99 = load i8, i8* %98
%100 = zext i8 %99 to i32
%101 = load i8*, i8** %12
%102 = getelementptr inbounds i8, i8* %101, i64 2
%103 = load i8, i8* %102
%104 = zext i8 %103 to i32
%105 = load i8*, i8** %12
%106 = getelementptr inbounds i8, i8* %105, i64 3
%107 = load i8, i8* %106
%108 = zext i8 %107 to i32
%109 = call i32 (i32, i8*, ...) @lprintf(i32 8, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.14, i64 0, i64 0), i32 %96, i32 %100, i32 %104, i32 %108)
br label %110
110: ; preds = %92, %74
%111 = getelementptr inbounds [25 x i8], [25 x i8]* %15, i64 0, i64 0
%112 = load i8*, i8** %11
%113 = call i32 @pax25(i8* %111, i8* %112)
%114 = call i32 (i32, i8*, ...) @lprintf(i32 9, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.15, i64 0, i64 0), i32 %113)
%115 = call i32 (i32, i8*, ...) @lprintf(i32 9, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.16, i64 0, i64 0))
%116 = load i32, i32* %5
%117 = icmp ne i32 %116, 0
br i1 %117, label %118, label %136
118: ; preds = %110
%119 = load i8*, i8** %14
%120 = getelementptr inbounds i8, i8* %119, i64 0
%121 = load i8, i8* %120
%122 = zext i8 %121 to i32
%123 = load i8*, i8** %14
%124 = getelementptr inbounds i8, i8* %123, i64 1
%125 = load i8, i8* %124
%126 = zext i8 %125 to i32
%127 = load i8*, i8** %14
%128 = getelementptr inbounds i8, i8* %127, i64 2
%129 = load i8, i8* %128
%130 = zext i8 %129 to i32
%131 = load i8*, i8** %14
%132 = getelementptr inbounds i8, i8* %131, i64 3
%133 = load i8, i8* %132
%134 = zext i8 %133 to i32
%135 = call i32 (i32, i8*, ...) @lprintf(i32 8, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.14, i64 0, i64 0), i32 %122, i32 %126, i32 %130, i32 %134)
br label %136
136: ; preds = %118, %110
%137 = load i8*, i8** %13
%138 = load i8, i8* %137
%139 = zext i8 %138 to i32
%140 = icmp ne i32 %139, 0
br i1 %140, label %141, label %146
141: ; preds = %136
%142 = getelementptr inbounds [25 x i8], [25 x i8]* %15, i64 0, i64 0
%143 = load i8*, i8** %13
%144 = call i32 @pax25(i8* %142, i8* %143)
%145 = call i32 (i32, i8*, ...) @lprintf(i32 8, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.17, i64 0, i64 0), i32 %144)
br label %146
146: ; preds = %141, %136
%147 = call i32 (i32, i8*, ...) @lprintf(i32 9, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.18, i64 0, i64 0))
br label %148
148: ; preds = %146, %43, %21
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"ARP: \00"
@.str.1 = [7 x i8] c"len %d\00"
@.str.2 = [13 x i8] c" bad packet\0A\00"
@.str.3 = [22 x i8] c" non-AX25 ARP packet\0A\00"
@.str.4 = [13 x i8] c" hwtype AX25\00"
@.str.5 = [10 x i8] c" hwlen %d\00"
@.str.6 = [9 x i8] c" prot IP\00"
@.str.7 = [20 x i8] c" prot 0x%x prlen %d\00"
@.str.8 = [12 x i8] c" op REQUEST\00"
@.str.9 = [10 x i8] c" op REPLY\00"
@.str.10 = [20 x i8] c" op REVERSE REQUEST\00"
@.str.11 = [18 x i8] c" op REVERSE REPLY\00"
@.str.12 = [7 x i8] c" op %d\00"
@.str.13 = [8 x i8] c"\0Asender\00"
@.str.14 = [20 x i8] c" IPaddr %d.%d.%d.%d\00"
@.str.15 = [12 x i8] c" hwaddr %s\0A\00"
@.str.16 = [7 x i8] c"target\00"
@.str.17 = [11 x i8] c" hwaddr %s\00"
@.str.18 = [2 x i8] c"\0A\00"
define void @arp_dump(i8* %0, i32 %1) {
%3 = alloca [25 x i8]
%4 = getelementptr inbounds [25 x i8], [25 x i8]* %3, i64 0, i64 0
%5 = tail call i32 (i32, i8*, ...) @lprintf(i32 6, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 (i32, i8*, ...) @lprintf(i32 9, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), i32 %1)
%7 = icmp slt i32 %1, 16
br i1 %7, label %8, label %10
8: ; preds = %2
%9 = tail call i32 (i32, i8*, ...) @lprintf(i32 1, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
br label %95
10: ; preds = %2
%11 = tail call i32 @get16(i8* %0)
%12 = getelementptr inbounds i8, i8* %0, i64 2
%13 = tail call i32 @get16(i8* %12)
%14 = getelementptr inbounds i8, i8* %0, i64 4
%15 = load i8, i8* %14
%16 = zext i8 %15 to i32
%17 = getelementptr inbounds i8, i8* %0, i64 5
%18 = load i8, i8* %17
%19 = zext i8 %18 to i32
%20 = getelementptr inbounds i8, i8* %0, i64 6
%21 = tail call i32 @get16(i8* %20)
%22 = icmp eq i32 %11, 3
br i1 %22, label %25, label %23
23: ; preds = %10
%24 = tail call i32 (i32, i8*, ...) @lprintf(i32 9, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.3, i64 0, i64 0))
br label %95
25: ; preds = %10
%26 = tail call i32 (i32, i8*, ...) @lprintf(i32 9, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0))
%27 = icmp eq i8 %15, 7
br i1 %27, label %30, label %28
28: ; preds = %25
%29 = tail call i32 (i32, i8*, ...) @lprintf(i32 9, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0), i32 %16)
br label %30
30: ; preds = %28, %25
%31 = icmp eq i32 %13, 204
br i1 %31, label %32, label %34
32: ; preds = %30
%33 = tail call i32 (i32, i8*, ...) @lprintf(i32 9, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0))
br label %36
34: ; preds = %30
%35 = tail call i32 (i32, i8*, ...) @lprintf(i32 9, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.7, i64 0, i64 0), i32 %13, i32 %19)
br label %36
36: ; preds = %34, %32
switch i32 %21, label %45 [
i32 1, label %37
i32 2, label %39
i32 3, label %41
i32 4, label %43
]
37: ; preds = %36
%38 = tail call i32 (i32, i8*, ...) @lprintf(i32 9, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.8, i64 0, i64 0))
br label %47
39: ; preds = %36
%40 = tail call i32 (i32, i8*, ...) @lprintf(i32 9, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.9, i64 0, i64 0))
br label %47
41: ; preds = %36
%42 = tail call i32 (i32, i8*, ...) @lprintf(i32 9, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.10, i64 0, i64 0))
br label %47
43: ; preds = %36
%44 = tail call i32 (i32, i8*, ...) @lprintf(i32 9, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.11, i64 0, i64 0))
br label %47
45: ; preds = %36
%46 = tail call i32 (i32, i8*, ...) @lprintf(i32 9, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.12, i64 0, i64 0), i32 %21)
br label %47
47: ; preds = %45, %43, %41, %39, %37
%48 = getelementptr inbounds i8, i8* %0, i64 8
%49 = zext i8 %15 to i64
%50 = getelementptr inbounds i8, i8* %48, i64 %49
%51 = zext i8 %18 to i64
%52 = getelementptr inbounds i8, i8* %50, i64 %51
%53 = getelementptr inbounds i8, i8* %52, i64 %49
%54 = tail call i32 (i32, i8*, ...) @lprintf(i32 9, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.13, i64 0, i64 0))
br i1 %31, label %55, label %83
55: ; preds = %47
%56 = load i8, i8* %50
%57 = zext i8 %56 to i32
%58 = getelementptr inbounds i8, i8* %50, i64 1
%59 = load i8, i8* %58
%60 = zext i8 %59 to i32
%61 = getelementptr inbounds i8, i8* %50, i64 2
%62 = load i8, i8* %61
%63 = zext i8 %62 to i32
%64 = getelementptr inbounds i8, i8* %50, i64 3
%65 = load i8, i8* %64
%66 = zext i8 %65 to i32
%67 = tail call i32 (i32, i8*, ...) @lprintf(i32 8, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.14, i64 0, i64 0), i32 %57, i32 %60, i32 %63, i32 %66)
%68 = call i32 @pax25(i8* %4, i8* %48)
%69 = call i32 (i32, i8*, ...) @lprintf(i32 9, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.15, i64 0, i64 0), i32 %68)
%70 = call i32 (i32, i8*, ...) @lprintf(i32 9, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.16, i64 0, i64 0))
%71 = load i8, i8* %53
%72 = zext i8 %71 to i32
%73 = getelementptr inbounds i8, i8* %53, i64 1
%74 = load i8, i8* %73
%75 = zext i8 %74 to i32
%76 = getelementptr inbounds i8, i8* %53, i64 2
%77 = load i8, i8* %76
%78 = zext i8 %77 to i32
%79 = getelementptr inbounds i8, i8* %53, i64 3
%80 = load i8, i8* %79
%81 = zext i8 %80 to i32
%82 = call i32 (i32, i8*, ...) @lprintf(i32 8, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.14, i64 0, i64 0), i32 %72, i32 %75, i32 %78, i32 %81)
br label %87
83: ; preds = %47
%84 = call i32 @pax25(i8* %4, i8* %48)
%85 = call i32 (i32, i8*, ...) @lprintf(i32 9, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.15, i64 0, i64 0), i32 %84)
%86 = call i32 (i32, i8*, ...) @lprintf(i32 9, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.16, i64 0, i64 0))
br label %87
87: ; preds = %83, %55
%88 = load i8, i8* %52
%89 = icmp eq i8 %88, 0
br i1 %89, label %93, label %90
90: ; preds = %87
%91 = call i32 @pax25(i8* %4, i8* %52)
%92 = call i32 (i32, i8*, ...) @lprintf(i32 8, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.17, i64 0, i64 0), i32 %91)
br label %93
93: ; preds = %90, %87
%94 = call i32 (i32, i8*, ...) @lprintf(i32 9, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.18, i64 0, i64 0))
br label %95
95: ; preds = %93, %23, %8
ret void
}