#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*/ get32(unsigned char **);
int get8(unsigned char **);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ readData(unsigned char **, int);
int /*<<< orphan*/ readHeaderChecksum(unsigned char **);
int /*<<< orphan*/ readIPvHeaderLen(unsigned char **);
int /*<<< orphan*/ readIp4Address(unsigned char **);
int /*<<< orphan*/ readMacAddress(unsigned char **);
unsigned char *parsePacket(unsigned char *buffer) {
  printf("-----------------Packet Begins-----------------\n");
  unsigned char *head = buffer;
  unsigned char *headerStart;
  get32(&head);
  get32(&head);
  get32(&head);
  get32(&head);
  printf("Destination mac address: ");
  readMacAddress(&head);
  printf("\n");
  printf("Source mac address: ");
  readMacAddress(&head);
  printf("\n");
  printf("Type: ");
  int temp = get16(&head);
  if (temp == 0x0800)
    printf("IP (0x0800)\n");
  else
    printf("Unknown (0x%02x)\n", temp);
  headerStart = head;
  readIPvHeaderLen(&head);
  printf("\n");
  printf("Differentiated Services Code Point: 0x%02x\n", get8(&head));
  int totalLength = get16(&head);
  printf("Total length: %d\n", totalLength);
  temp = get16(&head);
  printf("Identification: %#04x (%d)\n", temp, temp);
  printf("Flags: 0x%02x\n", get8(&head));
  printf("Fragment Offset: %d\n", get8(&head));
  printf("Time to live: %d\n", get8(&head));
  int protocol;
  printf("Protocol: ");
  switch (protocol = get8(&head)) {
  case 0x06:
    printf("TCP (%#02x)", temp);
    break;
  case 0x11:
    printf("UDP (%#02x)", temp);
    break;
  default:
    printf("Unknown (%#02x)", temp);
  }
  printf("\n");
  readHeaderChecksum(&head);
  printf("\n");
  printf("Source IP address: ");
  readIp4Address(&head);
  printf("\n");
  printf("Destination IP address: ");
  readIp4Address(&head);
  printf("\n");
  readData(&head, protocol);
  head = headerStart + totalLength;
  printf("\n------------------Packet Ends------------------\n");
  return head;
}


x86 assembly (clang, -O0):
<parsePacket>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x8(%rbp)
lea    0xe5d(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%rax
mov    %rax,-0x10(%rbp)
lea    -0x10(%rbp),%rdi
call   1080 <get32@plt>
lea    -0x10(%rbp),%rdi
call   1080 <get32@plt>
lea    -0x10(%rbp),%rdi
call   1080 <get32@plt>
lea    -0x10(%rbp),%rdi
call   1080 <get32@plt>
lea    0xe54(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x10(%rbp),%rdi
call   1070 <readMacAddress@plt>
lea    0xe7e(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe49(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x10(%rbp),%rdi
call   1070 <readMacAddress@plt>
lea    0xe59(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe39(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x10(%rbp),%rdi
call   10b0 <get16@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x800,-0x1c(%rbp)
jne    125a <parsePacket+0xca>
lea    0xe19(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    126b <parsePacket+0xdb>
mov    -0x1c(%rbp),%esi
lea    0xe10(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
lea    -0x10(%rbp),%rdi
mov    %rdi,-0x30(%rbp)
call   1090 <readIPvHeaderLen@plt>
lea    0xdeb(%rip),%rdi
xor    %eax,%eax
mov    %al,-0x31(%rbp)
call   1040 <printf@plt>
mov    -0x30(%rbp),%rdi
call   1030 <get8@plt>
mov    %eax,%esi
mov    -0x31(%rbp),%al
lea    0xde0(%rip),%rdi
call   1040 <printf@plt>
mov    -0x30(%rbp),%rdi
call   10b0 <get16@plt>
mov    %eax,%ecx
mov    -0x31(%rbp),%al
mov    %ecx,-0x20(%rbp)
mov    -0x20(%rbp),%esi
lea    0xdec(%rip),%rdi
call   1040 <printf@plt>
mov    -0x30(%rbp),%rdi
call   10b0 <get16@plt>
mov    %eax,%ecx
mov    -0x31(%rbp),%al
mov    %ecx,-0x1c(%rbp)
mov    -0x1c(%rbp),%edx
lea    0xdde(%rip),%rdi
mov    %edx,%esi
call   1040 <printf@plt>
mov    -0x30(%rbp),%rdi
call   1030 <get8@plt>
mov    %eax,%esi
mov    -0x31(%rbp),%al
lea    0xdde(%rip),%rdi
call   1040 <printf@plt>
mov    -0x30(%rbp),%rdi
call   1030 <get8@plt>
mov    %eax,%esi
mov    -0x31(%rbp),%al
lea    0xdd3(%rip),%rdi
call   1040 <printf@plt>
mov    -0x30(%rbp),%rdi
call   1030 <get8@plt>
mov    %eax,%esi
mov    -0x31(%rbp),%al
lea    0xdce(%rip),%rdi
call   1040 <printf@plt>
mov    -0x31(%rbp),%al
lea    0xdd1(%rip),%rdi
call   1040 <printf@plt>
mov    -0x30(%rbp),%rdi
call   1030 <get8@plt>
mov    %eax,-0x24(%rbp)
mov    %eax,%ecx
mov    %ecx,-0x28(%rbp)
sub    $0x6,%eax
je     137a <parsePacket+0x1ea>
jmp    1369 <parsePacket+0x1d9>
mov    -0x28(%rbp),%eax
sub    $0x11,%eax
je     1390 <parsePacket+0x200>
jmp    13a6 <parsePacket+0x216>
mov    -0x1c(%rbp),%esi
lea    0xd9d(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    13b7 <parsePacket+0x227>
mov    -0x1c(%rbp),%esi
lea    0xd93(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    13b7 <parsePacket+0x227>
mov    -0x1c(%rbp),%esi
lea    0xd89(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xcb4(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x10(%rbp),%rdi
call   10a0 <readHeaderChecksum@plt>
lea    0xc9d(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xd66(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x10(%rbp),%rdi
call   1050 <readIp4Address@plt>
lea    0xc78(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xd55(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0x10(%rbp),%rdi
call   1050 <readIp4Address@plt>
lea    0xc53(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x24(%rbp),%esi
lea    -0x10(%rbp),%rdi
call   1060 <readData@plt>
mov    -0x18(%rbp),%rax
movslq -0x20(%rbp),%rcx
add    %rcx,%rax
mov    %rax,-0x10(%rbp)
lea    0xd2e(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%rax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<parsePacket>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x10,%rsp
mov    %rdi,%rbx
lea    0xf72(%rip),%rdi
call   1050 <puts@plt>
mov    %rbx,0x8(%rsp)
lea    0x8(%rsp),%rbx
mov    %rbx,%rdi
call   10a0 <get32@plt>
mov    %rbx,%rdi
call   10a0 <get32@plt>
mov    %rbx,%rdi
call   10a0 <get32@plt>
mov    %rbx,%rdi
call   10a0 <get32@plt>
lea    0xe04(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %rbx,%rdi
call   1090 <readMacAddress@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xdfe(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %rbx,%rdi
call   1090 <readMacAddress@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xdf3(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %rbx,%rdi
call   10d0 <get16@plt>
cmp    $0x800,%eax
jne    1260 <parsePacket+0xb0>
lea    0xf40(%rip),%rdi
call   1050 <puts@plt>
jmp    1270 <parsePacket+0xc0>
lea    0xdcf(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1060 <printf@plt>
mov    0x8(%rsp),%r12
lea    0x8(%rsp),%r15
mov    %r15,%rdi
call   10b0 <readIPvHeaderLen@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %r15,%rdi
call   1040 <get8@plt>
lea    0xdad(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %r15,%rdi
call   10d0 <get16@plt>
mov    %eax,%r14d
lea    0xdbe(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %r15,%rdi
call   10d0 <get16@plt>
mov    %eax,%ebp
lea    0xdb6(%rip),%rdi
mov    %eax,%esi
mov    %eax,%edx
xor    %eax,%eax
call   1060 <printf@plt>
mov    %r15,%rdi
call   1040 <get8@plt>
lea    0xdb8(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %r15,%rdi
call   1040 <get8@plt>
lea    0xdaf(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %r15,%rdi
call   1040 <get8@plt>
lea    0xdac(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0xdae(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %r15,%rdi
call   1040 <get8@plt>
mov    %eax,%ebx
cmp    $0x11,%eax
lea    0xdaa(%rip),%rax
lea    0xdaf(%rip),%rcx
cmove  %rax,%rcx
cmp    $0x6,%ebx
lea    0xd89(%rip),%rdi
cmovne %rcx,%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1060 <printf@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %r15,%rdi
call   10c0 <readHeaderChecksum@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xd81(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %r15,%rdi
call   1070 <readIp4Address@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xd75(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    %r15,%rdi
call   1070 <readIp4Address@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %r15,%rdi
mov    %ebx,%esi
call   1080 <readData@plt>
movslq %r14d,%rax
add    %r12,%rax
mov    %rax,0x8(%rsp)
lea    0xd89(%rip),%rdi
call   1050 <puts@plt>
mov    0x8(%rsp),%rax
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [49 x i8] c"-----------------Packet Begins-----------------\0A\00"
@.str.1 = [26 x i8] c"Destination mac address: \00"
@.str.2 = [2 x i8] c"\0A\00"
@.str.3 = [21 x i8] c"Source mac address: \00"
@.str.4 = [7 x i8] c"Type: \00"
@.str.5 = [13 x i8] c"IP (0x0800)\0A\00"
@.str.6 = [18 x i8] c"Unknown (0x%02x)\0A\00"
@.str.7 = [44 x i8] c"Differentiated Services Code Point: 0x%02x\0A\00"
@.str.8 = [18 x i8] c"Total length: %d\0A\00"
@.str.9 = [28 x i8] c"Identification: %x (%d)\0A\00"
@.str.10 = [15 x i8] c"Flags: 0x%02x\0A\00"
@.str.11 = [21 x i8] c"Fragment Offset: %d\0A\00"
@.str.12 = [18 x i8] c"Time to live: %d\0A\00"
@.str.13 = [11 x i8] c"Protocol: \00"
@.str.14 = [12 x i8] c"TCP (%x)\00"
@.str.15 = [12 x i8] c"UDP (%x)\00"
@.str.16 = [16 x i8] c"Unknown (%x)\00"
@.str.17 = [20 x i8] c"Source IP address: \00"
@.str.18 = [25 x i8] c"Destination IP address: \00"
@.str.19 = [50 x i8] c"\0A------------------Packet Ends------------------\0A\00"
define i8* @parsePacket(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
store i8* %0, i8** %2
%8 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str, i64 0, i64 0))
%9 = load i8*, i8** %2
store i8* %9, i8** %3
%10 = call i32 @get32(i8** %3)
%11 = call i32 @get32(i8** %3)
%12 = call i32 @get32(i8** %3)
%13 = call i32 @get32(i8** %3)
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
%15 = call i32 @readMacAddress(i8** %3)
%16 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0))
%18 = call i32 @readMacAddress(i8** %3)
%19 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0))
%21 = call i32 @get16(i8** %3)
store i32 %21, i32* %5
%22 = load i32, i32* %5
%23 = icmp eq i32 %22, 2048
br i1 %23, label %24, label %26
24: ; preds = %1
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.5, i64 0, i64 0))
br label %29
26: ; preds = %1
%27 = load i32, i32* %5
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.6, i64 0, i64 0), i32 %27)
br label %29
29: ; preds = %26, %24
%30 = load i8*, i8** %3
store i8* %30, i8** %4
%31 = call i32 @readIPvHeaderLen(i8** %3)
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%33 = call i32 @get8(i8** %3)
%34 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.7, i64 0, i64 0), i32 %33)
%35 = call i32 @get16(i8** %3)
store i32 %35, i32* %6
%36 = load i32, i32* %6
%37 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.8, i64 0, i64 0), i32 %36)
%38 = call i32 @get16(i8** %3)
store i32 %38, i32* %5
%39 = load i32, i32* %5
%40 = load i32, i32* %5
%41 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.9, i64 0, i64 0), i32 %39, i32 %40)
%42 = call i32 @get8(i8** %3)
%43 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.10, i64 0, i64 0), i32 %42)
%44 = call i32 @get8(i8** %3)
%45 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.11, i64 0, i64 0), i32 %44)
%46 = call i32 @get8(i8** %3)
%47 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.12, i64 0, i64 0), i32 %46)
%48 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.13, i64 0, i64 0))
%49 = call i32 @get8(i8** %3)
store i32 %49, i32* %7
switch i32 %49, label %56 [
i32 6, label %50
i32 17, label %53
]
50: ; preds = %29
%51 = load i32, i32* %5
%52 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.14, i64 0, i64 0), i32 %51)
br label %59
53: ; preds = %29
%54 = load i32, i32* %5
%55 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.15, i64 0, i64 0), i32 %54)
br label %59
56: ; preds = %29
%57 = load i32, i32* %5
%58 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.16, i64 0, i64 0), i32 %57)
br label %59
59: ; preds = %56, %53, %50
%60 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%61 = call i32 @readHeaderChecksum(i8** %3)
%62 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%63 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.17, i64 0, i64 0))
%64 = call i32 @readIp4Address(i8** %3)
%65 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%66 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.18, i64 0, i64 0))
%67 = call i32 @readIp4Address(i8** %3)
%68 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%69 = load i32, i32* %7
%70 = call i32 @readData(i8** %3, i32 %69)
%71 = load i8*, i8** %4
%72 = load i32, i32* %6
%73 = sext i32 %72 to i64
%74 = getelementptr inbounds i8, i8* %71, i64 %73
store i8* %74, i8** %3
%75 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([50 x i8], [50 x i8]* @.str.19, i64 0, i64 0))
%76 = load i8*, i8** %3
ret i8* %76
}

LLVM IR (-O2):
@.str.1 = [26 x i8] c"Destination mac address: \00"
@.str.3 = [21 x i8] c"Source mac address: \00"
@.str.4 = [7 x i8] c"Type: \00"
@.str.6 = [18 x i8] c"Unknown (0x%02x)\0A\00"
@.str.7 = [44 x i8] c"Differentiated Services Code Point: 0x%02x\0A\00"
@.str.8 = [18 x i8] c"Total length: %d\0A\00"
@.str.9 = [28 x i8] c"Identification: %x (%d)\0A\00"
@.str.10 = [15 x i8] c"Flags: 0x%02x\0A\00"
@.str.11 = [21 x i8] c"Fragment Offset: %d\0A\00"
@.str.12 = [18 x i8] c"Time to live: %d\0A\00"
@.str.13 = [11 x i8] c"Protocol: \00"
@.str.14 = [12 x i8] c"TCP (%x)\00"
@.str.15 = [12 x i8] c"UDP (%x)\00"
@.str.16 = [16 x i8] c"Unknown (%x)\00"
@.str.17 = [20 x i8] c"Source IP address: \00"
@.str.18 = [25 x i8] c"Destination IP address: \00"
@str = [48 x i8] c"-----------------Packet Begins-----------------\00"
@str.20 = [49 x i8] c"\0A------------------Packet Ends------------------\00"
@str.21 = [12 x i8] c"IP (0x0800)\00"
define i8* @parsePacket(i8* %0) {
%2 = alloca i8*
%3 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([48 x i8], [48 x i8]* @str, i64 0, i64 0))
%4 = bitcast i8** %2 to i8*
store i8* %0, i8** %2
%5 = call i32 @get32(i8** %2)
%6 = call i32 @get32(i8** %2)
%7 = call i32 @get32(i8** %2)
%8 = call i32 @get32(i8** %2)
%9 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.1, i64 0, i64 0))
%10 = call i32 @readMacAddress(i8** %2)
%11 = call i32 @putchar(i32 10)
%12 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0))
%13 = call i32 @readMacAddress(i8** %2)
%14 = call i32 @putchar(i32 10)
%15 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.4, i64 0, i64 0))
%16 = call i32 @get16(i8** %2)
%17 = icmp eq i32 %16, 2048
br i1 %17, label %18, label %20
18: ; preds = %1
%19 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @str.21, i64 0, i64 0))
br label %22
20: ; preds = %1
%21 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.6, i64 0, i64 0), i32 %16)
br label %22
22: ; preds = %20, %18
%23 = load i8*, i8** %2
%24 = call i32 @readIPvHeaderLen(i8** %2)
%25 = call i32 @putchar(i32 10)
%26 = call i32 @get8(i8** %2)
%27 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @.str.7, i64 0, i64 0), i32 %26)
%28 = call i32 @get16(i8** %2)
%29 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.8, i64 0, i64 0), i32 %28)
%30 = call i32 @get16(i8** %2)
%31 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.9, i64 0, i64 0), i32 %30, i32 %30)
%32 = call i32 @get8(i8** %2)
%33 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.10, i64 0, i64 0), i32 %32)
%34 = call i32 @get8(i8** %2)
%35 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.11, i64 0, i64 0), i32 %34)
%36 = call i32 @get8(i8** %2)
%37 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.12, i64 0, i64 0), i32 %36)
%38 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.13, i64 0, i64 0))
%39 = call i32 @get8(i8** %2)
%40 = icmp eq i32 %39, 17
%41 = select i1 %40, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.15, i64 0, i64 0), i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.16, i64 0, i64 0)
%42 = icmp eq i32 %39, 6
%43 = select i1 %42, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.14, i64 0, i64 0), i8* %41
%44 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) %43, i32 %30)
%45 = call i32 @putchar(i32 10)
%46 = call i32 @readHeaderChecksum(i8** %2)
%47 = call i32 @putchar(i32 10)
%48 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.17, i64 0, i64 0))
%49 = call i32 @readIp4Address(i8** %2)
%50 = call i32 @putchar(i32 10)
%51 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.18, i64 0, i64 0))
%52 = call i32 @readIp4Address(i8** %2)
%53 = call i32 @putchar(i32 10)
%54 = call i32 @readData(i8** %2, i32 %39)
%55 = sext i32 %28 to i64
%56 = getelementptr inbounds i8, i8* %23, i64 %55
store i8* %56, i8** %2
%57 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @str.20, i64 0, i64 0))
%58 = load i8*, i8** %2
ret i8* %58
}