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

/* Forward declarations */

/* Type definitions */
typedef int uint8_t;
typedef int /*<<< orphan*/ uint32_t;
struct udphdr {
  scalar_t__ dest;
  scalar_t__ source;
};
struct tcphdr {
  int /*<<< orphan*/ ack_seq;
  int /*<<< orphan*/ ack;
  int /*<<< orphan*/ seq;
  int /*<<< orphan*/ rst;
  int /*<<< orphan*/ fin;
  int /*<<< orphan*/ syn;
};
struct iphdr {
  int ihl;
  int protocol;
  int ttl;
  scalar_t__ check;
  int /*<<< orphan*/ daddr;
  int /*<<< orphan*/ saddr;
};
struct ethhdr {
  int *h_source;
  int *h_dest;
  scalar_t__ h_proto;
};
typedef scalar_t__ __sum16;

/* Variables and functions */
scalar_t__ ETH_P_IP;
#define IPPROTO_TCP 129
#define IPPROTO_UDP 128
scalar_t__ ip_fast_csum(struct iphdr *, int);
int ntohl(int /*<<< orphan*/);
int ntohs(scalar_t__);
int /*<<< orphan*/ printf(char *, ...);
void dump_packet(char *buf, int len) {
  struct ethhdr *ethh;
  struct iphdr *iph;
  struct udphdr *udph;
  struct tcphdr *tcph;
  uint8_t *t;
  ethh = (struct ethhdr *)buf;
  printf("%02X:%02X:%02X:%02X:%02X:%02X -> %02X:%02X:%02X:%02X:%02X:%02X ",
         ethh->h_source[0], ethh->h_source[1], ethh->h_source[2],
         ethh->h_source[3], ethh->h_source[4], ethh->h_source[5],
         ethh->h_dest[0], ethh->h_dest[1], ethh->h_dest[2], ethh->h_dest[3],
         ethh->h_dest[4], ethh->h_dest[5]);
  if (ntohs(ethh->h_proto) != ETH_P_IP) {
    printf("protocol %04hx  ", ntohs(ethh->h_proto));
    goto done;
  }
  printf(" ");
  iph = (struct iphdr *)(ethh + 1);
  udph = (struct udphdr *)((uint32_t *)iph + iph->ihl);
  tcph = (struct tcphdr *)((uint32_t *)iph + iph->ihl);
  t = (uint8_t *)&iph->saddr;
  printf("%u.%u.%u.%u", t[0], t[1], t[2], t[3]);
  if (iph->protocol == IPPROTO_TCP || iph->protocol == IPPROTO_UDP)
    printf("(%d)", ntohs(udph->source));
  printf(" -> ");
  t = (uint8_t *)&iph->daddr;
  printf("%u.%u.%u.%u", t[0], t[1], t[2], t[3]);
  if (iph->protocol == IPPROTO_TCP || iph->protocol == IPPROTO_UDP)
    printf("(%d)", ntohs(udph->dest));
  printf(" TTL=%d ", iph->ttl);
  if (ip_fast_csum(iph, iph->ihl)) {
    __sum16 org_csum, correct_csum;
    org_csum = iph->check;
    iph->check = 0;
    correct_csum = ip_fast_csum(iph, iph->ihl);
    printf("(bad checksum %04x should be %04x) ", ntohs(org_csum),
           ntohs(correct_csum));
    iph->check = org_csum;
  }
  switch (iph->protocol) {
  case IPPROTO_TCP:
    printf("TCP ");
    if (tcph->syn)
      printf("S ");
    if (tcph->fin)
      printf("F ");
    if (tcph->ack)
      printf("A ");
    if (tcph->rst)
      printf("R ");
    printf("seq %u ", ntohl(tcph->seq));
    if (tcph->ack)
      printf("ack %u ", ntohl(tcph->ack_seq));
    break;
  case IPPROTO_UDP:
    printf("UDP ");
    break;
  default:
    printf("protocol %d ", iph->protocol);
    goto done;
  }
done:
  printf("len=%d\n", len);
}


x86 assembly (clang, -O0):
<dump_packet>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x90,%rsp
mov    %rdi,-0x28(%rbp)
mov    %esi,-0x2c(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x38(%rbp)
mov    -0x38(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%esi
mov    -0x38(%rbp),%rax
mov    (%rax),%rax
mov    0x4(%rax),%edx
mov    -0x38(%rbp),%rax
mov    (%rax),%rax
mov    0x8(%rax),%ecx
mov    -0x38(%rbp),%rax
mov    (%rax),%rax
mov    0xc(%rax),%r8d
mov    -0x38(%rbp),%rax
mov    (%rax),%rax
mov    0x10(%rax),%r9d
mov    -0x38(%rbp),%rax
mov    (%rax),%rax
mov    0x14(%rax),%r12d
mov    -0x38(%rbp),%rax
mov    0x8(%rax),%rax
mov    (%rax),%r15d
mov    -0x38(%rbp),%rax
mov    0x8(%rax),%rax
mov    0x4(%rax),%r14d
mov    -0x38(%rbp),%rax
mov    0x8(%rax),%rax
mov    0x8(%rax),%ebx
mov    -0x38(%rbp),%rax
mov    0x8(%rax),%rax
mov    0xc(%rax),%r11d
mov    -0x38(%rbp),%rax
mov    0x8(%rax),%rax
mov    0x10(%rax),%r10d
mov    -0x38(%rbp),%rax
mov    0x8(%rax),%rax
mov    0x14(%rax),%eax
lea    0xe15(%rip),%rdi
mov    %r12d,(%rsp)
mov    %r15d,0x8(%rsp)
mov    %r14d,0x10(%rsp)
mov    %ebx,0x18(%rsp)
mov    %r11d,0x20(%rsp)
mov    %r10d,0x28(%rsp)
mov    %eax,0x30(%rsp)
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x38(%rbp),%rax
mov    0x10(%rax),%rdi
call   1050 <ntohs@plt>
cltq
mov    0x2db8(%rip),%rcx
cmp    (%rcx),%rax
je     1253 <dump_packet+0x113>
mov    -0x38(%rbp),%rax
mov    0x10(%rax),%rdi
call   1050 <ntohs@plt>
mov    %eax,%esi
lea    0xdf9(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1544 <dump_packet+0x404>
lea    0xdf5(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x38(%rbp),%rax
add    $0x18,%rax
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rax
mov    -0x40(%rbp),%rcx
movslq (%rcx),%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    %rax,-0x48(%rbp)
mov    -0x40(%rbp),%rax
mov    -0x40(%rbp),%rcx
movslq (%rcx),%rcx
shl    $0x2,%rcx
add    %rcx,%rax
mov    %rax,-0x50(%rbp)
mov    -0x40(%rbp),%rax
add    $0x1c,%rax
mov    %rax,-0x58(%rbp)
mov    -0x58(%rbp),%rax
mov    (%rax),%esi
mov    -0x58(%rbp),%rax
mov    0x4(%rax),%edx
mov    -0x58(%rbp),%rax
mov    0x8(%rax),%ecx
mov    -0x58(%rbp),%rax
mov    0xc(%rax),%r8d
lea    0xd89(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x40(%rbp),%rax
cmpl   $0x81,0x4(%rax)
je     12f1 <dump_packet+0x1b1>
mov    -0x40(%rbp),%rax
cmpl   $0x80,0x4(%rax)
jne    130e <dump_packet+0x1ce>
mov    -0x48(%rbp),%rax
mov    0x8(%rax),%rdi
call   1050 <ntohs@plt>
mov    %eax,%esi
lea    0xd56(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xd4d(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x40(%rbp),%rax
add    $0x18,%rax
mov    %rax,-0x58(%rbp)
mov    -0x58(%rbp),%rax
mov    (%rax),%esi
mov    -0x58(%rbp),%rax
mov    0x4(%rax),%edx
mov    -0x58(%rbp),%rax
mov    0x8(%rax),%ecx
mov    -0x58(%rbp),%rax
mov    0xc(%rax),%r8d
lea    0xd06(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x40(%rbp),%rax
cmpl   $0x81,0x4(%rax)
je     1374 <dump_packet+0x234>
mov    -0x40(%rbp),%rax
cmpl   $0x80,0x4(%rax)
jne    1390 <dump_packet+0x250>
mov    -0x48(%rbp),%rax
mov    (%rax),%rdi
call   1050 <ntohs@plt>
mov    %eax,%esi
lea    0xcd4(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x40(%rbp),%rax
mov    0x8(%rax),%esi
lea    0xcc9(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x40(%rbp),%rdi
mov    -0x40(%rbp),%rax
mov    (%rax),%esi
call   1030 <ip_fast_csum@plt>
cmp    $0x0,%rax
je     141d <dump_packet+0x2dd>
mov    -0x40(%rbp),%rax
mov    0x10(%rax),%rax
mov    %rax,-0x60(%rbp)
mov    -0x40(%rbp),%rax
movq   $0x0,0x10(%rax)
mov    -0x40(%rbp),%rdi
mov    -0x40(%rbp),%rax
mov    (%rax),%esi
call   1030 <ip_fast_csum@plt>
mov    %rax,-0x68(%rbp)
mov    -0x60(%rbp),%rdi
call   1050 <ntohs@plt>
mov    %eax,-0x6c(%rbp)
mov    -0x68(%rbp),%rdi
call   1050 <ntohs@plt>
mov    -0x6c(%rbp),%esi
mov    %eax,%edx
lea    0xc66(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x60(%rbp),%rcx
mov    -0x40(%rbp),%rax
mov    %rcx,0x10(%rax)
mov    -0x40(%rbp),%rax
mov    0x4(%rax),%eax
mov    %eax,-0x70(%rbp)
sub    $0x80,%eax
je     1512 <dump_packet+0x3d2>
jmp    1437 <dump_packet+0x2f7>
mov    -0x70(%rbp),%eax
sub    $0x81,%eax
jne    1525 <dump_packet+0x3e5>
jmp    144a <dump_packet+0x30a>
lea    0xc43(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x50(%rbp),%rax
cmpl   $0x0,0x14(%rax)
je     1474 <dump_packet+0x334>
lea    0xc2c(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x50(%rbp),%rax
cmpl   $0x0,0x10(%rax)
je     1490 <dump_packet+0x350>
lea    0xc13(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x50(%rbp),%rax
cmpl   $0x0,0x4(%rax)
je     14ac <dump_packet+0x36c>
lea    0xbfa(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x50(%rbp),%rax
cmpl   $0x0,0xc(%rax)
je     14c8 <dump_packet+0x388>
lea    0xbe1(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x50(%rbp),%rax
mov    0x8(%rax),%edi
call   1060 <ntohl@plt>
mov    %eax,%esi
lea    0xbc8(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x50(%rbp),%rax
cmpl   $0x0,0x4(%rax)
je     150d <dump_packet+0x3cd>
mov    -0x50(%rbp),%rax
mov    (%rax),%edi
call   1060 <ntohl@plt>
mov    %eax,%esi
lea    0xba7(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    153f <dump_packet+0x3ff>
lea    0xb9c(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    153f <dump_packet+0x3ff>
mov    -0x40(%rbp),%rax
mov    0x4(%rax),%esi
lea    0xb87(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1544 <dump_packet+0x404>
jmp    1544 <dump_packet+0x404>
mov    -0x2c(%rbp),%esi
lea    0xb79(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
add    $0x90,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

x86 assembly (clang, -O2):
<dump_packet>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %esi,0x4(%rsp)
mov    %rdi,%rbp
mov    (%rdi),%rax
mov    0x8(%rdi),%rdi
mov    (%rax),%esi
mov    0x4(%rax),%edx
mov    0x8(%rax),%ecx
mov    0xc(%rax),%r8d
mov    0x10(%rax),%r9d
mov    0x14(%rax),%r10d
mov    (%rdi),%r11d
mov    0x4(%rdi),%r14d
mov    0x8(%rdi),%r15d
mov    0xc(%rdi),%r12d
mov    0x10(%rdi),%r13d
mov    0x14(%rdi),%ebx
sub    $0x8,%rsp
lea    0xe62(%rip),%rdi
xor    %eax,%eax
push   %rbx
push   %r13
push   %r12
push   %r15
push   %r14
push   %r11
push   %r10
call   1050 <printf@plt>
add    $0x40,%rsp
mov    0x10(%rbp),%rdi
call   1060 <ntohs@plt>
cltq
mov    0x2e18(%rip),%rcx
cmp    %rax,(%rcx)
jne    139b <dump_packet+0x24b>
mov    $0x20,%edi
call   1030 <putchar@plt>
lea    0x18(%rbp),%r15
movslq 0x18(%rbp),%r14
mov    0x34(%rbp),%esi
mov    0x38(%rbp),%edx
mov    0x3c(%rbp),%ecx
mov    0x40(%rbp),%r8d
lea    0xe5a(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x1c(%rbp),%eax
and    $0xfffffffe,%eax
cmp    $0x80,%eax
jne    1225 <dump_packet+0xd5>
mov    0x8(%r15,%r14,4),%rdi
call   1060 <ntohs@plt>
lea    0xe41(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe36(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x30(%rbp),%esi
mov    0x34(%rbp),%edx
mov    0x38(%rbp),%ecx
mov    0x3c(%rbp),%r8d
lea    0xe0a(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x1c(%rbp),%eax
and    $0xfffffffe,%eax
cmp    $0x80,%eax
jne    1274 <dump_packet+0x124>
mov    (%r15,%r14,4),%rdi
call   1060 <ntohs@plt>
lea    0xdf2(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x20(%rbp),%esi
lea    0xde9(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x18(%rbp),%esi
mov    %r15,%rdi
call   1040 <ip_fast_csum@plt>
test   %rax,%rax
je     12d9 <dump_packet+0x189>
mov    0x28(%rbp),%r12
movq   $0x0,0x28(%rbp)
mov    0x18(%rbp),%esi
mov    %r15,%rdi
call   1040 <ip_fast_csum@plt>
mov    %rax,%rbx
mov    %r12,%rdi
call   1060 <ntohs@plt>
mov    %eax,%r13d
mov    %rbx,%rdi
call   1060 <ntohs@plt>
lea    0xda7(%rip),%rdi
mov    %r13d,%esi
mov    %eax,%edx
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r12,0x28(%rbp)
mov    0x1c(%rbp),%esi
cmp    $0x80,%esi
je     13af <dump_packet+0x25f>
cmp    $0x81,%esi
jne    13bf <dump_packet+0x26f>
lea    0xd99(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
cmpl   $0x0,0x14(%r15,%r14,4)
je     1318 <dump_packet+0x1c8>
lea    0xd88(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
cmpl   $0x0,0x10(%r15,%r14,4)
je     132e <dump_packet+0x1de>
lea    0xd75(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
cmpl   $0x0,0x4(%r15,%r14,4)
mov    0x4(%rsp),%ebx
je     1348 <dump_packet+0x1f8>
lea    0xd5e(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
cmpl   $0x0,0xc(%r15,%r14,4)
je     135e <dump_packet+0x20e>
lea    0xd4b(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x8(%r15,%r14,4),%edi
call   1070 <ntohl@plt>
lea    0xd36(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
cmpl   $0x0,0x4(%r15,%r14,4)
je     13d1 <dump_packet+0x281>
mov    (%r15,%r14,4),%edi
call   1070 <ntohl@plt>
lea    0xd1d(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
jmp    13d1 <dump_packet+0x281>
mov    0x10(%rbp),%rdi
call   1060 <ntohs@plt>
lea    0xc95(%rip),%rdi
mov    %eax,%esi
jmp    13c6 <dump_packet+0x276>
lea    0xcff(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
jmp    13cd <dump_packet+0x27d>
lea    0xcf4(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x4(%rsp),%ebx
lea    0xcef(%rip),%rdi
mov    %ebx,%esi
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1050 <printf@plt>

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

LLVM IR (-O2):
%struct.iphdr = type { i32, i32, i32, i64, i32, i32 }
@.str = [64 x i8] c"%02X:%02X:%02X:%02X:%02X:%02X -> %02X:%02X:%02X:%02X:%02X:%02X \00"
@ETH_P_IP = global i64 0
@.str.1 = [17 x i8] c"protocol %04hx \00"
@.str.3 = [12 x i8] c"%u.%u.%u.%u\00"
@.str.4 = [5 x i8] c"(%d)\00"
@.str.5 = [5 x i8] c" -> \00"
@.str.6 = [9 x i8] c" TTL=%d \00"
@.str.7 = [36 x i8] c"(bad checksum %04x should be %04x) \00"
@.str.8 = [5 x i8] c"TCP \00"
@.str.9 = [3 x i8] c"S \00"
@.str.10 = [3 x i8] c"F \00"
@.str.11 = [3 x i8] c"A \00"
@.str.12 = [3 x i8] c"R \00"
@.str.13 = [8 x i8] c"seq %u \00"
@.str.14 = [8 x i8] c"ack %u \00"
@.str.15 = [5 x i8] c"UDP \00"
@.str.16 = [13 x i8] c"protocol %d \00"
@.str.17 = [8 x i8] c"len=%d\0A\00"
define void @dump_packet(i8* %0, i32 %1) {
%3 = bitcast i8* %0 to i32**
%4 = load i32*, i32** %3
%5 = load i32, i32* %4
%6 = getelementptr inbounds i32, i32* %4, i64 1
%7 = load i32, i32* %6
%8 = getelementptr inbounds i32, i32* %4, i64 2
%9 = load i32, i32* %8
%10 = getelementptr inbounds i32, i32* %4, i64 3
%11 = load i32, i32* %10
%12 = getelementptr inbounds i32, i32* %4, i64 4
%13 = load i32, i32* %12
%14 = getelementptr inbounds i32, i32* %4, i64 5
%15 = load i32, i32* %14
%16 = getelementptr inbounds i8, i8* %0, i64 8
%17 = bitcast i8* %16 to i32**
%18 = load i32*, i32** %17
%19 = load i32, i32* %18
%20 = getelementptr inbounds i32, i32* %18, i64 1
%21 = load i32, i32* %20
%22 = getelementptr inbounds i32, i32* %18, i64 2
%23 = load i32, i32* %22
%24 = getelementptr inbounds i32, i32* %18, i64 3
%25 = load i32, i32* %24
%26 = getelementptr inbounds i32, i32* %18, i64 4
%27 = load i32, i32* %26
%28 = getelementptr inbounds i32, i32* %18, i64 5
%29 = load i32, i32* %28
%30 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([64 x i8], [64 x i8]* @.str, i64 0, i64 0), i32 %5, i32 %7, i32 %9, i32 %11, i32 %13, i32 %15, i32 %19, i32 %21, i32 %23, i32 %25, i32 %27, i32 %29)
%31 = getelementptr inbounds i8, i8* %0, i64 16
%32 = bitcast i8* %31 to i64*
%33 = load i64, i64* %32
%34 = tail call i32 @ntohs(i64 %33)
%35 = sext i32 %34 to i64
%36 = load i64, i64* @ETH_P_IP
%37 = icmp eq i64 %36, %35
br i1 %37, label %42, label %38
38: ; preds = %2
%39 = load i64, i64* %32
%40 = tail call i32 @ntohs(i64 %39)
%41 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0), i32 %40)
br label %150
42: ; preds = %2
%43 = tail call i32 @putchar(i32 32)
%44 = getelementptr inbounds i8, i8* %0, i64 24
%45 = bitcast i8* %44 to %struct.iphdr*
%46 = bitcast i8* %44 to i32*
%47 = load i32, i32* %46
%48 = sext i32 %47 to i64
%49 = getelementptr inbounds i32, i32* %46, i64 %48
%50 = getelementptr inbounds i8, i8* %0, i64 52
%51 = bitcast i8* %50 to i32*
%52 = load i32, i32* %51
%53 = getelementptr inbounds i8, i8* %0, i64 56
%54 = bitcast i8* %53 to i32*
%55 = load i32, i32* %54
%56 = getelementptr inbounds i8, i8* %0, i64 60
%57 = bitcast i8* %56 to i32*
%58 = load i32, i32* %57
%59 = getelementptr inbounds i8, i8* %0, i64 64
%60 = bitcast i8* %59 to i32*
%61 = load i32, i32* %60
%62 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), i32 %52, i32 %55, i32 %58, i32 %61)
%63 = getelementptr inbounds i8, i8* %0, i64 28
%64 = bitcast i8* %63 to i32*
%65 = load i32, i32* %64
%66 = and i32 %65, -2
%67 = icmp eq i32 %66, 128
br i1 %67, label %68, label %74
68: ; preds = %42
%69 = getelementptr inbounds i32, i32* %49, i64 2
%70 = bitcast i32* %69 to i64*
%71 = load i64, i64* %70
%72 = tail call i32 @ntohs(i64 %71)
%73 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i32 %72)
br label %74
74: ; preds = %42, %68
%75 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
%76 = getelementptr inbounds i8, i8* %0, i64 48
%77 = bitcast i8* %76 to i32*
%78 = load i32, i32* %77
%79 = load i32, i32* %51
%80 = load i32, i32* %54
%81 = load i32, i32* %57
%82 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.3, i64 0, i64 0), i32 %78, i32 %79, i32 %80, i32 %81)
%83 = load i32, i32* %64
%84 = and i32 %83, -2
%85 = icmp eq i32 %84, 128
br i1 %85, label %86, label %91
86: ; preds = %74
%87 = bitcast i32* %49 to i64*
%88 = load i64, i64* %87
%89 = tail call i32 @ntohs(i64 %88)
%90 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0), i32 %89)
br label %91
91: ; preds = %74, %86
%92 = getelementptr inbounds i8, i8* %0, i64 32
%93 = bitcast i8* %92 to i32*
%94 = load i32, i32* %93
%95 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.6, i64 0, i64 0), i32 %94)
%96 = load i32, i32* %46
%97 = tail call i64 @ip_fast_csum(%struct.iphdr* %45, i32 %96)
%98 = icmp eq i64 %97, 0
br i1 %98, label %108, label %99
99: ; preds = %91
%100 = getelementptr inbounds i8, i8* %0, i64 40
%101 = bitcast i8* %100 to i64*
%102 = load i64, i64* %101
store i64 0, i64* %101
%103 = load i32, i32* %46
%104 = tail call i64 @ip_fast_csum(%struct.iphdr* %45, i32 %103)
%105 = tail call i32 @ntohs(i64 %102)
%106 = tail call i32 @ntohs(i64 %104)
%107 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @.str.7, i64 0, i64 0), i32 %105, i32 %106)
store i64 %102, i64* %101
br label %108
108: ; preds = %99, %91
%109 = load i32, i32* %64
switch i32 %109, label %148 [
i32 129, label %110
i32 128, label %146
]
110: ; preds = %108
%111 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0))
%112 = getelementptr inbounds i32, i32* %49, i64 5
%113 = load i32, i32* %112
%114 = icmp eq i32 %113, 0
br i1 %114, label %117, label %115
115: ; preds = %110
%116 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0))
br label %117
117: ; preds = %115, %110
%118 = getelementptr inbounds i32, i32* %49, i64 4
%119 = load i32, i32* %118
%120 = icmp eq i32 %119, 0
br i1 %120, label %123, label %121
121: ; preds = %117
%122 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0))
br label %123
123: ; preds = %121, %117
%124 = getelementptr inbounds i32, i32* %49, i64 1
%125 = load i32, i32* %124
%126 = icmp eq i32 %125, 0
br i1 %126, label %129, label %127
127: ; preds = %123
%128 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i64 0, i64 0))
br label %129
129: ; preds = %127, %123
%130 = getelementptr inbounds i32, i32* %49, i64 3
%131 = load i32, i32* %130
%132 = icmp eq i32 %131, 0
br i1 %132, label %135, label %133
133: ; preds = %129
%134 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.12, i64 0, i64 0))
br label %135
135: ; preds = %133, %129
%136 = getelementptr inbounds i32, i32* %49, i64 2
%137 = load i32, i32* %136
%138 = tail call i32 @ntohl(i32 %137)
%139 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.13, i64 0, i64 0), i32 %138)
%140 = load i32, i32* %124
%141 = icmp eq i32 %140, 0
br i1 %141, label %150, label %142
142: ; preds = %135
%143 = load i32, i32* %49
%144 = tail call i32 @ntohl(i32 %143)
%145 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.14, i64 0, i64 0), i32 %144)
br label %150
146: ; preds = %108
%147 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.15, i64 0, i64 0))
br label %150
148: ; preds = %108
%149 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.16, i64 0, i64 0), i32 %109)
br label %150
150: ; preds = %146, %142, %135, %148, %38
%151 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.17, i64 0, i64 0), i32 %1)
ret void
}