#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 uint32_t;
struct tcphdr {
  int th_seq;
  int th_ack;
  int th_off;
  int /*<<< orphan*/ th_urp;
  int /*<<< orphan*/ th_sum;
  int /*<<< orphan*/ th_win;
  int /*<<< orphan*/ th_flags;
  int /*<<< orphan*/ th_dport;
  int /*<<< orphan*/ th_sport;
};

/* Variables and functions */
int ETHER_HDR_LEN;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
scalar_t__ isprint(int const);
int ntohs(int /*<<< orphan*/);
int /*<<< orphan*/ stdout;
int /*<<< orphan*/ tcp_print_flags(int /*<<< orphan*/);
void tcp_complete_analysis(const unsigned char *packet, uint8_t ihl,
                           const uint32_t len) {
  const struct tcphdr *tcp_header;
  const uint8_t *data;
  tcp_header = (const struct tcphdr *)(packet + ETHER_HDR_LEN + (ihl * 4));
  fprintf(stdout, "\t+----------------------------+\n");
  fprintf(stdout, "\t| Transport control protocol |\n");
  fprintf(stdout, "\t+----------------------------+\n");
  fprintf(stdout, "\tSource port: %u\n", ntohs(tcp_header->th_sport));
  fprintf(stdout, "\tDestination port: %u\n", ntohs(tcp_header->th_dport));
  fprintf(stdout, "\tSequence number: %u\n", tcp_header->th_seq);
  fprintf(stdout, "\tACK number: %u\n", tcp_header->th_ack);
  fprintf(stdout, "\tData offset: %u\n", tcp_header->th_off);
  tcp_print_flags(tcp_header->th_flags);
  fprintf(stdout, "\tWindow: %u\n", ntohs(tcp_header->th_win));
  fprintf(stdout, "\tChecksum: %x\n", ntohs(tcp_header->th_sum));
  fprintf(stdout, "\tUrgent pointer: %u\n", ntohs(tcp_header->th_urp));
  data = packet + ETHER_HDR_LEN + (ihl * 4) + (tcp_header->th_off * 4);
  fprintf(stdout, "\tData:\n\t");
  unsigned int bound = len - (ihl * 4);
  for (size_t i = 0; i < bound; i++) {
    if (isprint(data[i]))
      fprintf(stdout, "%c", data[i]);
    else
      fprintf(stdout, ".");
  }
  fprintf(stdout, "\n");
}


x86 assembly (clang, -O0):
<tcp_complete_analysis>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0x8(%rbp),%rax
mov    0x2e7b(%rip),%rcx
movslq (%rcx),%rcx
add    %rcx,%rax
mov    -0xc(%rbp),%ecx
shl    $0x2,%ecx
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    0x2e66(%rip),%rax
mov    (%rax),%edi
lea    0xe7d(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e4f(%rip),%rax
mov    (%rax),%edi
lea    0xe87(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e38(%rip),%rax
mov    (%rax),%edi
lea    0xe4f(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2e21(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x44(%rbp)
mov    -0x18(%rbp),%rax
mov    0x20(%rax),%edi
call   1040 <ntohs@plt>
mov    -0x44(%rbp),%edi
mov    %eax,%edx
lea    0xe66(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2df6(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x40(%rbp)
mov    -0x18(%rbp),%rax
mov    0x1c(%rax),%edi
call   1040 <ntohs@plt>
mov    -0x40(%rbp),%edi
mov    %eax,%edx
lea    0xe4d(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2dcb(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%rax
mov    (%rax),%edx
lea    0xe47(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2dae(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%rax
mov    0x4(%rax),%edx
lea    0xe3f(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2d90(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%rax
mov    0x8(%rax),%edx
lea    0xe32(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x18(%rbp),%rax
mov    0x18(%rax),%edi
call   1060 <tcp_print_flags@plt>
mov    0x2d66(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x3c(%rbp)
mov    -0x18(%rbp),%rax
mov    0x14(%rax),%edi
call   1040 <ntohs@plt>
mov    -0x3c(%rbp),%edi
mov    %eax,%edx
lea    0xe0d(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2d3b(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x38(%rbp)
mov    -0x18(%rbp),%rax
mov    0x10(%rax),%edi
call   1040 <ntohs@plt>
mov    -0x38(%rbp),%edi
mov    %eax,%edx
lea    0xdef(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    0x2d10(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x34(%rbp)
mov    -0x18(%rbp),%rax
mov    0xc(%rax),%edi
call   1040 <ntohs@plt>
mov    -0x34(%rbp),%edi
mov    %eax,%edx
lea    0xdd3(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x8(%rbp),%rax
mov    0x2cd9(%rip),%rcx
movslq (%rcx),%rcx
add    %rcx,%rax
mov    -0xc(%rbp),%ecx
shl    $0x2,%ecx
movslq %ecx,%rcx
add    %rcx,%rax
mov    -0x18(%rbp),%rcx
mov    0x8(%rcx),%ecx
shl    $0x2,%ecx
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x20(%rbp)
mov    0x2cb4(%rip),%rax
mov    (%rax),%edi
lea    0xda0(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
mov    -0x10(%rbp),%eax
mov    -0xc(%rbp),%ecx
shl    $0x2,%ecx
sub    %ecx,%eax
mov    %eax,-0x24(%rbp)
movq   $0x0,-0x30(%rbp)
mov    -0x30(%rbp),%rax
mov    -0x24(%rbp),%ecx
cmp    %rcx,%rax
jae    13d0 <tcp_complete_analysis+0x290>
mov    -0x20(%rbp),%rax
mov    -0x30(%rbp),%rcx
mov    (%rax,%rcx,4),%edi
call   1050 <isprint@plt>
cmp    $0x0,%rax
je     13a3 <tcp_complete_analysis+0x263>
mov    0x2c5d(%rip),%rax
mov    (%rax),%edi
mov    -0x20(%rbp),%rax
mov    -0x30(%rbp),%rcx
mov    (%rax,%rcx,4),%edx
lea    0xd47(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
jmp    13ba <tcp_complete_analysis+0x27a>
mov    0x2c36(%rip),%rax
mov    (%rax),%edi
lea    0xd2e(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
jmp    13bf <tcp_complete_analysis+0x27f>
mov    -0x30(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x30(%rbp)
jmp    1352 <tcp_complete_analysis+0x212>
mov    0x2c09(%rip),%rax
mov    (%rax),%edi
lea    0xc3f(%rip),%rsi
mov    $0x0,%al
call   1030 <fprintf@plt>
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<tcp_complete_analysis>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %edx,%r14d
mov    %rdi,%rbx
mov    0x2e80(%rip),%rax
movslq (%rax),%r13
add    %rdi,%r13
movslq %esi,%r12
lea    0x0(,%r12,4),%rax
mov    %rax,(%rsp)
mov    0x2e6c(%rip),%r15
mov    (%r15),%edi
lea    0xe82(%rip),%rbp
mov    %rbp,%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%r15),%edi
lea    0xe8f(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%r15),%edi
mov    %rbp,%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%r15),%ebp
mov    0x20(%r13,%r12,4),%edi
call   1040 <ntohs@plt>
lea    0xe88(%rip),%rsi
mov    %ebp,%edi
mov    %eax,%edx
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%r15),%ebp
mov    0x1c(%r13,%r12,4),%edi
call   1040 <ntohs@plt>
lea    0xe7b(%rip),%rsi
mov    %ebp,%edi
mov    %eax,%edx
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%r15),%edi
mov    0x0(%r13,%r12,4),%edx
lea    0xe78(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%r15),%edi
mov    0x4(%r13,%r12,4),%edx
lea    0xe78(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%r15),%edi
mov    0x8(%r13,%r12,4),%edx
lea    0xe73(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    0x18(%r13,%r12,4),%edi
call   1060 <tcp_print_flags@plt>
mov    (%r15),%ebp
mov    0x14(%r13,%r12,4),%edi
call   1040 <ntohs@plt>
lea    0xe60(%rip),%rsi
mov    %ebp,%edi
mov    %eax,%edx
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%r15),%ebp
mov    0x10(%r13,%r12,4),%edi
call   1040 <ntohs@plt>
lea    0xe4e(%rip),%rsi
mov    %ebp,%edi
mov    %eax,%edx
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%r15),%ebp
mov    0xc(%r13,%r12,4),%edi
call   1040 <ntohs@plt>
lea    0xe3e(%rip),%rsi
mov    %ebp,%edi
mov    %eax,%edx
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    0x2d44(%rip),%rax
movslq (%rax),%rbp
movslq 0x8(%r13,%r12,4),%r12
mov    (%r15),%edi
lea    0xe2f(%rip),%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
mov    (%rsp),%rax
sub    %eax,%r14d
je     1312 <tcp_complete_analysis+0x1d2>
shl    $0x2,%r12
add    %rax,%rbp
add    %r12,%rbp
add    %rbp,%rbx
lea    0xe17(%rip),%r13
lea    0xe0d(%rip),%r12
xor    %ebp,%ebp
jmp    12f3 <tcp_complete_analysis+0x1b3>
cs nopw 0x0(%rax,%rax,1)
nop
mov    %r13,%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
add    $0x1,%rbp
cmp    %rbp,%r14
je     1312 <tcp_complete_analysis+0x1d2>
mov    (%rbx,%rbp,4),%edi
call   1050 <isprint@plt>
mov    (%r15),%edi
test   %rax,%rax
je     12e0 <tcp_complete_analysis+0x1a0>
mov    (%rbx,%rbp,4),%edx
mov    %r12,%rsi
xor    %eax,%eax
call   1030 <fprintf@plt>
jmp    12ea <tcp_complete_analysis+0x1aa>
mov    (%r15),%edi
lea    0xd03(%rip),%rsi
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <fprintf@plt>

LLVM IR (-O0):
%struct.tcphdr = type { i32, i32, i32, i32, i32, i32, i32, i32, i32 }
@ETHER_HDR_LEN = global i32 0
@stdout = global i32 0
@.str = [33 x i8] c"\09+----------------------------+\0A\00"
@.str.1 = [33 x i8] c"\09| Transport control protocol |\0A\00"
@.str.2 = [18 x i8] c"\09Source port: %u\0A\00"
@.str.3 = [23 x i8] c"\09Destination port: %u\0A\00"
@.str.4 = [22 x i8] c"\09Sequence number: %u\0A\00"
@.str.5 = [17 x i8] c"\09ACK number: %u\0A\00"
@.str.6 = [18 x i8] c"\09Data offset: %u\0A\00"
@.str.7 = [13 x i8] c"\09Window: %u\0A\00"
@.str.8 = [15 x i8] c"\09Checksum: %x\0A\00"
@.str.9 = [21 x i8] c"\09Urgent pointer: %u\0A\00"
@.str.10 = [9 x i8] c"\09Data:\0A\09\00"
@.str.11 = [3 x i8] c"%c\00"
@.str.12 = [2 x i8] c".\00"
@.str.13 = [2 x i8] c"\0A\00"
define void @tcp_complete_analysis(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
%7 = alloca %struct.tcphdr*
%8 = alloca i32*
%9 = alloca i32
%10 = alloca i64
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%11 = load i8*, i8** %4
%12 = load i32, i32* @ETHER_HDR_LEN
%13 = sext i32 %12 to i64
%14 = getelementptr inbounds i8, i8* %11, i64 %13
%15 = load i32, i32* %5
%16 = mul nsw i32 %15, 4
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i8, i8* %14, i64 %17
%19 = bitcast i8* %18 to %struct.tcphdr*
store %struct.tcphdr* %19, %struct.tcphdr** %7
%20 = load i32, i32* @stdout
%21 = call i32 (i32, i8*, ...) @fprintf(i32 %20, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%22 = load i32, i32* @stdout
%23 = call i32 (i32, i8*, ...) @fprintf(i32 %22, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0))
%24 = load i32, i32* @stdout
%25 = call i32 (i32, i8*, ...) @fprintf(i32 %24, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%26 = load i32, i32* @stdout
%27 = load %struct.tcphdr*, %struct.tcphdr** %7
%28 = getelementptr inbounds %struct.tcphdr, %struct.tcphdr* %27, i32 0, i32 8
%29 = load i32, i32* %28
%30 = call i32 @ntohs(i32 %29)
%31 = call i32 (i32, i8*, ...) @fprintf(i32 %26, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i32 %30)
%32 = load i32, i32* @stdout
%33 = load %struct.tcphdr*, %struct.tcphdr** %7
%34 = getelementptr inbounds %struct.tcphdr, %struct.tcphdr* %33, i32 0, i32 7
%35 = load i32, i32* %34
%36 = call i32 @ntohs(i32 %35)
%37 = call i32 (i32, i8*, ...) @fprintf(i32 %32, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0), i32 %36)
%38 = load i32, i32* @stdout
%39 = load %struct.tcphdr*, %struct.tcphdr** %7
%40 = getelementptr inbounds %struct.tcphdr, %struct.tcphdr* %39, i32 0, i32 0
%41 = load i32, i32* %40
%42 = call i32 (i32, i8*, ...) @fprintf(i32 %38, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.4, i64 0, i64 0), i32 %41)
%43 = load i32, i32* @stdout
%44 = load %struct.tcphdr*, %struct.tcphdr** %7
%45 = getelementptr inbounds %struct.tcphdr, %struct.tcphdr* %44, i32 0, i32 1
%46 = load i32, i32* %45
%47 = call i32 (i32, i8*, ...) @fprintf(i32 %43, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.5, i64 0, i64 0), i32 %46)
%48 = load i32, i32* @stdout
%49 = load %struct.tcphdr*, %struct.tcphdr** %7
%50 = getelementptr inbounds %struct.tcphdr, %struct.tcphdr* %49, i32 0, i32 2
%51 = load i32, i32* %50
%52 = call i32 (i32, i8*, ...) @fprintf(i32 %48, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.6, i64 0, i64 0), i32 %51)
%53 = load %struct.tcphdr*, %struct.tcphdr** %7
%54 = getelementptr inbounds %struct.tcphdr, %struct.tcphdr* %53, i32 0, i32 6
%55 = load i32, i32* %54
%56 = call i32 @tcp_print_flags(i32 %55)
%57 = load i32, i32* @stdout
%58 = load %struct.tcphdr*, %struct.tcphdr** %7
%59 = getelementptr inbounds %struct.tcphdr, %struct.tcphdr* %58, i32 0, i32 5
%60 = load i32, i32* %59
%61 = call i32 @ntohs(i32 %60)
%62 = call i32 (i32, i8*, ...) @fprintf(i32 %57, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.7, i64 0, i64 0), i32 %61)
%63 = load i32, i32* @stdout
%64 = load %struct.tcphdr*, %struct.tcphdr** %7
%65 = getelementptr inbounds %struct.tcphdr, %struct.tcphdr* %64, i32 0, i32 4
%66 = load i32, i32* %65
%67 = call i32 @ntohs(i32 %66)
%68 = call i32 (i32, i8*, ...) @fprintf(i32 %63, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.8, i64 0, i64 0), i32 %67)
%69 = load i32, i32* @stdout
%70 = load %struct.tcphdr*, %struct.tcphdr** %7
%71 = getelementptr inbounds %struct.tcphdr, %struct.tcphdr* %70, i32 0, i32 3
%72 = load i32, i32* %71
%73 = call i32 @ntohs(i32 %72)
%74 = call i32 (i32, i8*, ...) @fprintf(i32 %69, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.9, i64 0, i64 0), i32 %73)
%75 = load i8*, i8** %4
%76 = load i32, i32* @ETHER_HDR_LEN
%77 = sext i32 %76 to i64
%78 = getelementptr inbounds i8, i8* %75, i64 %77
%79 = load i32, i32* %5
%80 = mul nsw i32 %79, 4
%81 = sext i32 %80 to i64
%82 = getelementptr inbounds i8, i8* %78, i64 %81
%83 = load %struct.tcphdr*, %struct.tcphdr** %7
%84 = getelementptr inbounds %struct.tcphdr, %struct.tcphdr* %83, i32 0, i32 2
%85 = load i32, i32* %84
%86 = mul nsw i32 %85, 4
%87 = sext i32 %86 to i64
%88 = getelementptr inbounds i8, i8* %82, i64 %87
%89 = bitcast i8* %88 to i32*
store i32* %89, i32** %8
%90 = load i32, i32* @stdout
%91 = call i32 (i32, i8*, ...) @fprintf(i32 %90, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.10, i64 0, i64 0))
%92 = load i32, i32* %6
%93 = load i32, i32* %5
%94 = mul nsw i32 %93, 4
%95 = sub nsw i32 %92, %94
store i32 %95, i32* %9
store i64 0, i64* %10
br label %96
96: ; preds = %119, %3
%97 = load i64, i64* %10
%98 = load i32, i32* %9
%99 = zext i32 %98 to i64
%100 = icmp ult i64 %97, %99
br i1 %100, label %101, label %122
101: ; preds = %96
%102 = load i32*, i32** %8
%103 = load i64, i64* %10
%104 = getelementptr inbounds i32, i32* %102, i64 %103
%105 = load i32, i32* %104
%106 = call i64 @isprint(i32 %105)
%107 = icmp ne i64 %106, 0
br i1 %107, label %108, label %115
108: ; preds = %101
%109 = load i32, i32* @stdout
%110 = load i32*, i32** %8
%111 = load i64, i64* %10
%112 = getelementptr inbounds i32, i32* %110, i64 %111
%113 = load i32, i32* %112
%114 = call i32 (i32, i8*, ...) @fprintf(i32 %109, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i64 0, i64 0), i32 %113)
br label %118
115: ; preds = %101
%116 = load i32, i32* @stdout
%117 = call i32 (i32, i8*, ...) @fprintf(i32 %116, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.12, i64 0, i64 0))
br label %118
118: ; preds = %115, %108
br label %119
119: ; preds = %118
%120 = load i64, i64* %10
%121 = add i64 %120, 1
store i64 %121, i64* %10
br label %96
122: ; preds = %96
%123 = load i32, i32* @stdout
%124 = call i32 (i32, i8*, ...) @fprintf(i32 %123, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.13, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
@ETHER_HDR_LEN = global i32 0
@stdout = global i32 0
@.str = [33 x i8] c"\09+----------------------------+\0A\00"
@.str.1 = [33 x i8] c"\09| Transport control protocol |\0A\00"
@.str.2 = [18 x i8] c"\09Source port: %u\0A\00"
@.str.3 = [23 x i8] c"\09Destination port: %u\0A\00"
@.str.4 = [22 x i8] c"\09Sequence number: %u\0A\00"
@.str.5 = [17 x i8] c"\09ACK number: %u\0A\00"
@.str.6 = [18 x i8] c"\09Data offset: %u\0A\00"
@.str.7 = [13 x i8] c"\09Window: %u\0A\00"
@.str.8 = [15 x i8] c"\09Checksum: %x\0A\00"
@.str.9 = [21 x i8] c"\09Urgent pointer: %u\0A\00"
@.str.10 = [9 x i8] c"\09Data:\0A\09\00"
@.str.11 = [3 x i8] c"%c\00"
@.str.12 = [2 x i8] c".\00"
@.str.13 = [2 x i8] c"\0A\00"
define void @tcp_complete_analysis(i8* nocapture %0, i32 %1, i32 %2) {
%4 = load i32, i32* @ETHER_HDR_LEN
%5 = sext i32 %4 to i64
%6 = getelementptr inbounds i8, i8* %0, i64 %5
%7 = shl nsw i32 %1, 2
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %6, i64 %8
%10 = load i32, i32* @stdout
%11 = tail call i32 (i32, i8*, ...) @fprintf(i32 %10, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%12 = load i32, i32* @stdout
%13 = tail call i32 (i32, i8*, ...) @fprintf(i32 %12, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.1, i64 0, i64 0))
%14 = load i32, i32* @stdout
%15 = tail call i32 (i32, i8*, ...) @fprintf(i32 %14, i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str, i64 0, i64 0))
%16 = load i32, i32* @stdout
%17 = getelementptr inbounds i8, i8* %9, i64 32
%18 = bitcast i8* %17 to i32*
%19 = load i32, i32* %18
%20 = tail call i32 @ntohs(i32 %19)
%21 = tail call i32 (i32, i8*, ...) @fprintf(i32 %16, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.2, i64 0, i64 0), i32 %20)
%22 = load i32, i32* @stdout
%23 = getelementptr inbounds i8, i8* %9, i64 28
%24 = bitcast i8* %23 to i32*
%25 = load i32, i32* %24
%26 = tail call i32 @ntohs(i32 %25)
%27 = tail call i32 (i32, i8*, ...) @fprintf(i32 %22, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0), i32 %26)
%28 = load i32, i32* @stdout
%29 = bitcast i8* %9 to i32*
%30 = load i32, i32* %29
%31 = tail call i32 (i32, i8*, ...) @fprintf(i32 %28, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.4, i64 0, i64 0), i32 %30)
%32 = load i32, i32* @stdout
%33 = getelementptr inbounds i8, i8* %9, i64 4
%34 = bitcast i8* %33 to i32*
%35 = load i32, i32* %34
%36 = tail call i32 (i32, i8*, ...) @fprintf(i32 %32, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.5, i64 0, i64 0), i32 %35)
%37 = load i32, i32* @stdout
%38 = getelementptr inbounds i8, i8* %9, i64 8
%39 = bitcast i8* %38 to i32*
%40 = load i32, i32* %39
%41 = tail call i32 (i32, i8*, ...) @fprintf(i32 %37, i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.6, i64 0, i64 0), i32 %40)
%42 = getelementptr inbounds i8, i8* %9, i64 24
%43 = bitcast i8* %42 to i32*
%44 = load i32, i32* %43
%45 = tail call i32 @tcp_print_flags(i32 %44)
%46 = load i32, i32* @stdout
%47 = getelementptr inbounds i8, i8* %9, i64 20
%48 = bitcast i8* %47 to i32*
%49 = load i32, i32* %48
%50 = tail call i32 @ntohs(i32 %49)
%51 = tail call i32 (i32, i8*, ...) @fprintf(i32 %46, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.7, i64 0, i64 0), i32 %50)
%52 = load i32, i32* @stdout
%53 = getelementptr inbounds i8, i8* %9, i64 16
%54 = bitcast i8* %53 to i32*
%55 = load i32, i32* %54
%56 = tail call i32 @ntohs(i32 %55)
%57 = tail call i32 (i32, i8*, ...) @fprintf(i32 %52, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.8, i64 0, i64 0), i32 %56)
%58 = load i32, i32* @stdout
%59 = getelementptr inbounds i8, i8* %9, i64 12
%60 = bitcast i8* %59 to i32*
%61 = load i32, i32* %60
%62 = tail call i32 @ntohs(i32 %61)
%63 = tail call i32 (i32, i8*, ...) @fprintf(i32 %58, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.9, i64 0, i64 0), i32 %62)
%64 = load i32, i32* @ETHER_HDR_LEN
%65 = sext i32 %64 to i64
%66 = getelementptr inbounds i8, i8* %0, i64 %65
%67 = getelementptr inbounds i8, i8* %66, i64 %8
%68 = load i32, i32* %39
%69 = shl nsw i32 %68, 2
%70 = sext i32 %69 to i64
%71 = getelementptr inbounds i8, i8* %67, i64 %70
%72 = bitcast i8* %71 to i32*
%73 = load i32, i32* @stdout
%74 = tail call i32 (i32, i8*, ...) @fprintf(i32 %73, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.10, i64 0, i64 0))
%75 = sub nsw i32 %2, %7
%76 = zext i32 %75 to i64
%77 = icmp eq i32 %75, 0
br i1 %77, label %78, label %81
78: ; preds = %93, %3
%79 = load i32, i32* @stdout
%80 = tail call i32 (i32, i8*, ...) @fprintf(i32 %79, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.13, i64 0, i64 0))
ret void
81: ; preds = %3, %93
%82 = phi i64 [ %94, %93 ], [ 0, %3 ]
%83 = getelementptr inbounds i32, i32* %72, i64 %82
%84 = load i32, i32* %83
%85 = tail call i64 @isprint(i32 %84)
%86 = icmp eq i64 %85, 0
%87 = load i32, i32* @stdout
br i1 %86, label %91, label %88
88: ; preds = %81
%89 = load i32, i32* %83
%90 = tail call i32 (i32, i8*, ...) @fprintf(i32 %87, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i64 0, i64 0), i32 %89)
br label %93
91: ; preds = %81
%92 = tail call i32 (i32, i8*, ...) @fprintf(i32 %87, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.12, i64 0, i64 0))
br label %93
93: ; preds = %88, %91
%94 = add nuw nsw i64 %82, 1
%95 = icmp eq i64 %94, %76
br i1 %95, label %78, label %81
}