#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 */
struct tcphdr {
  int source;
  int dest;
  int seq;
  int ack_seq;
  int res1;
  int doff;
  int fin;
  int syn;
  int rst;
  int psh;
  int ack;
  int urg;
  int res2;
  int window;
  int check;
  int urg_ptr;
};

/* Variables and functions */
int /*<<< orphan*/ printf(char *, int, int, int, int, int, int, int, int, int,
                          int, int, int, int, int, int, int);
int PrintTCP(struct tcphdr *tcp) {
  printf("SOURCE:%02x DEST:%02x SEQ:%04x ACK_SEQ:%04x %x %x FIN:%x SYN:%x "
         "RST:%x PSH:%x ACK:%x URG:%x %x WIN:%x CSUM:%x %x \n",
         tcp->source, tcp->dest, tcp->seq, tcp->ack_seq, tcp->res1, tcp->doff,
         tcp->fin, tcp->syn, tcp->rst, tcp->psh, tcp->ack, tcp->urg, tcp->res2,
         tcp->window, tcp->check, tcp->urg_ptr);
}


x86 assembly (clang, -O0):
<PrintTCP>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x78,%rsp
mov    %rdi,-0x38(%rbp)
mov    -0x38(%rbp),%rax
mov    (%rax),%esi
mov    -0x38(%rbp),%rax
mov    0x4(%rax),%edx
mov    -0x38(%rbp),%rax
mov    0x8(%rax),%ecx
mov    -0x38(%rbp),%rax
mov    0xc(%rax),%r8d
mov    -0x38(%rbp),%rax
mov    0x10(%rax),%r9d
mov    -0x38(%rbp),%rax
mov    0x14(%rax),%eax
mov    -0x38(%rbp),%rdi
mov    0x18(%rdi),%edi
mov    %edi,-0x44(%rbp)
mov    -0x38(%rbp),%rdi
mov    0x1c(%rdi),%edi
mov    %edi,-0x40(%rbp)
mov    -0x38(%rbp),%rdi
mov    0x20(%rdi),%r13d
mov    -0x38(%rbp),%rdi
mov    0x24(%rdi),%r12d
mov    -0x38(%rbp),%rdi
mov    0x28(%rdi),%r15d
mov    -0x38(%rbp),%rdi
mov    0x2c(%rdi),%r14d
mov    -0x38(%rbp),%rdi
mov    0x30(%rdi),%ebx
mov    -0x38(%rbp),%rdi
mov    0x34(%rdi),%r11d
mov    -0x38(%rbp),%rdi
mov    0x38(%rdi),%r10d
mov    -0x38(%rbp),%rdi
mov    0x3c(%rdi),%edi
mov    %edi,-0x3c(%rbp)
lea    0xe54(%rip),%rdi
mov    %eax,(%rsp)
mov    -0x44(%rbp),%eax
mov    %eax,0x8(%rsp)
mov    -0x40(%rbp),%eax
mov    %eax,0x10(%rsp)
mov    -0x3c(%rbp),%eax
mov    %r13d,0x18(%rsp)
mov    %r12d,0x20(%rsp)
mov    %r15d,0x28(%rsp)
mov    %r14d,0x30(%rsp)
mov    %ebx,0x38(%rsp)
mov    %r11d,0x40(%rsp)
mov    %r10d,0x48(%rsp)
mov    %eax,0x50(%rsp)
call   1030 <printf@plt>
mov    -0x2c(%rbp),%eax
add    $0x78,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

x86 assembly (clang, -O2):
<PrintTCP>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    (%rdi),%esi
mov    0x4(%rdi),%edx
mov    0x8(%rdi),%ecx
mov    0xc(%rdi),%r8d
mov    0x10(%rdi),%r9d
mov    0x14(%rdi),%eax
mov    %rax,0x10(%rsp)
mov    0x18(%rdi),%eax
mov    %rax,0x8(%rsp)
mov    0x1c(%rdi),%r14d
mov    0x20(%rdi),%r15d
mov    0x24(%rdi),%r12d
mov    0x28(%rdi),%r13d
mov    0x2c(%rdi),%r11d
mov    0x30(%rdi),%ebx
mov    0x34(%rdi),%ebp
mov    0x38(%rdi),%r10d
mov    0x3c(%rdi),%eax
sub    $0x8,%rsp
lea    0xe96(%rip),%rdi
push   %rax
push   %r10
push   %rbp
push   %rbx
push   %r11
push   %r13
push   %r12
push   %r15
push   %r14
push   0x58(%rsp)
push   0x68(%rsp)
call   1030 <printf@plt>
add    $0x78,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.tcphdr = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32 }
@.str = [115 x i8] c"SOURCE:%02x DEST:%02x SEQ:%04x ACK_SEQ:%04x %x %x FIN:%x SYN:%x RST:%x PSH:%x ACK:%x URG:%x %x WIN:%x CSUM:%x %x \0A\00"
define i32 @PrintTCP(%struct.tcphdr* %0) {
%2 = alloca i32
%3 = alloca %struct.tcphdr*
store %struct.tcphdr* %0, %struct.tcphdr** %3
%4 = load %struct.tcphdr*, %struct.tcphdr** %3
%5 = getelementptr inbounds %struct.tcphdr, %struct.tcphdr* %4, i32 0, i32 0
%6 = load i32, i32* %5
%7 = load %struct.tcphdr*, %struct.tcphdr** %3
%8 = getelementptr inbounds %struct.tcphdr, %struct.tcphdr* %7, i32 0, i32 1
%9 = load i32, i32* %8
%10 = load %struct.tcphdr*, %struct.tcphdr** %3
%11 = getelementptr inbounds %struct.tcphdr, %struct.tcphdr* %10, i32 0, i32 2
%12 = load i32, i32* %11
%13 = load %struct.tcphdr*, %struct.tcphdr** %3
%14 = getelementptr inbounds %struct.tcphdr, %struct.tcphdr* %13, i32 0, i32 3
%15 = load i32, i32* %14
%16 = load %struct.tcphdr*, %struct.tcphdr** %3
%17 = getelementptr inbounds %struct.tcphdr, %struct.tcphdr* %16, i32 0, i32 4
%18 = load i32, i32* %17
%19 = load %struct.tcphdr*, %struct.tcphdr** %3
%20 = getelementptr inbounds %struct.tcphdr, %struct.tcphdr* %19, i32 0, i32 5
%21 = load i32, i32* %20
%22 = load %struct.tcphdr*, %struct.tcphdr** %3
%23 = getelementptr inbounds %struct.tcphdr, %struct.tcphdr* %22, i32 0, i32 6
%24 = load i32, i32* %23
%25 = load %struct.tcphdr*, %struct.tcphdr** %3
%26 = getelementptr inbounds %struct.tcphdr, %struct.tcphdr* %25, i32 0, i32 7
%27 = load i32, i32* %26
%28 = load %struct.tcphdr*, %struct.tcphdr** %3
%29 = getelementptr inbounds %struct.tcphdr, %struct.tcphdr* %28, i32 0, i32 8
%30 = load i32, i32* %29
%31 = load %struct.tcphdr*, %struct.tcphdr** %3
%32 = getelementptr inbounds %struct.tcphdr, %struct.tcphdr* %31, i32 0, i32 9
%33 = load i32, i32* %32
%34 = load %struct.tcphdr*, %struct.tcphdr** %3
%35 = getelementptr inbounds %struct.tcphdr, %struct.tcphdr* %34, i32 0, i32 10
%36 = load i32, i32* %35
%37 = load %struct.tcphdr*, %struct.tcphdr** %3
%38 = getelementptr inbounds %struct.tcphdr, %struct.tcphdr* %37, i32 0, i32 11
%39 = load i32, i32* %38
%40 = load %struct.tcphdr*, %struct.tcphdr** %3
%41 = getelementptr inbounds %struct.tcphdr, %struct.tcphdr* %40, i32 0, i32 12
%42 = load i32, i32* %41
%43 = load %struct.tcphdr*, %struct.tcphdr** %3
%44 = getelementptr inbounds %struct.tcphdr, %struct.tcphdr* %43, i32 0, i32 13
%45 = load i32, i32* %44
%46 = load %struct.tcphdr*, %struct.tcphdr** %3
%47 = getelementptr inbounds %struct.tcphdr, %struct.tcphdr* %46, i32 0, i32 14
%48 = load i32, i32* %47
%49 = load %struct.tcphdr*, %struct.tcphdr** %3
%50 = getelementptr inbounds %struct.tcphdr, %struct.tcphdr* %49, i32 0, i32 15
%51 = load i32, i32* %50
%52 = call i32 @printf(i8* getelementptr inbounds ([115 x i8], [115 x i8]* @.str, i64 0, i64 0), i32 %6, i32 %9, i32 %12, i32 %15, i32 %18, i32 %21, i32 %24, i32 %27, i32 %30, i32 %33, i32 %36, i32 %39, i32 %42, i32 %45, i32 %48, i32 %51)
%53 = load i32, i32* %2
ret i32 %53
}

LLVM IR (-O2):
%struct.tcphdr = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32 }
@.str = [115 x i8] c"SOURCE:%02x DEST:%02x SEQ:%04x ACK_SEQ:%04x %x %x FIN:%x SYN:%x RST:%x PSH:%x ACK:%x URG:%x %x WIN:%x CSUM:%x %x \0A\00"
define i32 @PrintTCP(%struct.tcphdr* nocapture %0) {
%2 = getelementptr inbounds %struct.tcphdr, %struct.tcphdr* %0, i64 0, i32 0
%3 = load i32, i32* %2
%4 = getelementptr inbounds %struct.tcphdr, %struct.tcphdr* %0, i64 0, i32 1
%5 = load i32, i32* %4
%6 = getelementptr inbounds %struct.tcphdr, %struct.tcphdr* %0, i64 0, i32 2
%7 = load i32, i32* %6
%8 = getelementptr inbounds %struct.tcphdr, %struct.tcphdr* %0, i64 0, i32 3
%9 = load i32, i32* %8
%10 = getelementptr inbounds %struct.tcphdr, %struct.tcphdr* %0, i64 0, i32 4
%11 = load i32, i32* %10
%12 = getelementptr inbounds %struct.tcphdr, %struct.tcphdr* %0, i64 0, i32 5
%13 = load i32, i32* %12
%14 = getelementptr inbounds %struct.tcphdr, %struct.tcphdr* %0, i64 0, i32 6
%15 = load i32, i32* %14
%16 = getelementptr inbounds %struct.tcphdr, %struct.tcphdr* %0, i64 0, i32 7
%17 = load i32, i32* %16
%18 = getelementptr inbounds %struct.tcphdr, %struct.tcphdr* %0, i64 0, i32 8
%19 = load i32, i32* %18
%20 = getelementptr inbounds %struct.tcphdr, %struct.tcphdr* %0, i64 0, i32 9
%21 = load i32, i32* %20
%22 = getelementptr inbounds %struct.tcphdr, %struct.tcphdr* %0, i64 0, i32 10
%23 = load i32, i32* %22
%24 = getelementptr inbounds %struct.tcphdr, %struct.tcphdr* %0, i64 0, i32 11
%25 = load i32, i32* %24
%26 = getelementptr inbounds %struct.tcphdr, %struct.tcphdr* %0, i64 0, i32 12
%27 = load i32, i32* %26
%28 = getelementptr inbounds %struct.tcphdr, %struct.tcphdr* %0, i64 0, i32 13
%29 = load i32, i32* %28
%30 = getelementptr inbounds %struct.tcphdr, %struct.tcphdr* %0, i64 0, i32 14
%31 = load i32, i32* %30
%32 = getelementptr inbounds %struct.tcphdr, %struct.tcphdr* %0, i64 0, i32 15
%33 = load i32, i32* %32
%34 = tail call i32 @printf(i8* getelementptr inbounds ([115 x i8], [115 x i8]* @.str, i64 0, i64 0), i32 %3, i32 %5, i32 %7, i32 %9, i32 %11, i32 %13, i32 %15, i32 %17, i32 %19, i32 %21, i32 %23, i32 %25, i32 %27, i32 %29, i32 %31, i32 %33)
ret i32 undef
}