#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 /*<<< orphan*/ u_int8_t;
struct iphdr {
  int ihl;
  int version;
  int ttl;
  int protocol;
  int /*<<< orphan*/ check;
  void *daddr;
  void *saddr;
  void *tot_len;
  int /*<<< orphan*/ tos;
};
struct ether_header {
  void *ether_type;
  int /*<<< orphan*/ ether_shost;
  int /*<<< orphan*/ ether_dhost;
};
typedef int /*<<< orphan*/ buf;

/* Variables and functions */
int ETHERTYPE_IP;
int /*<<< orphan*/ ETH_ALEN;
int /*<<< orphan*/ checksum(struct iphdr *, int);
void *htonl(int);
void *htons(int);
int /*<<< orphan*/ memcpy(int /*<<< orphan*/, unsigned char const *,
                          int /*<<< orphan*/);
int /*<<< orphan*/ memset(struct iphdr *, int /*<<< orphan*/, int);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *, char const *, int, unsigned char const,
                          unsigned char const, unsigned char const,
                          unsigned char const, unsigned char const,
                          unsigned char const, unsigned char const,
                          unsigned char const, unsigned char const,
                          unsigned char const, unsigned char const,
                          unsigned char const);
scalar_t__ send(int, char *, int, int /*<<< orphan*/);
void tx(int s, const char *ifname, int ifindex, const unsigned char *src,
        const unsigned char *dst, u_int8_t tos) {
  char buf[1500], *pos;
  struct ether_header *eth;
  struct iphdr *ip;
  int i;
  printf("TX: %s(ifindex=%d) "
         "%02x:%02x:%02x:%02x:%02x:%02x"
         " -> "
         "%02x:%02x:%02x:%02x:%02x:%02x"
         "\n",
         ifname, ifindex, (src)[0], (src)[1], (src)[2], (src)[3], (src)[4],
         (src)[5], (dst)[0], (dst)[1], (dst)[2], (dst)[3], (dst)[4], (dst)[5]);
  eth = (struct ether_header *)buf;
  memcpy(eth->ether_dhost, dst, ETH_ALEN);
  memcpy(eth->ether_shost, src, ETH_ALEN);
  eth->ether_type = htons(ETHERTYPE_IP);
  ip = (struct iphdr *)(eth + 1);
  memset(ip, 0, sizeof(*ip));
  ip->ihl = 5;
  ip->version = 4;
  ip->ttl = 64;
  ip->tos = tos;
  ip->tot_len = htons(1500 - sizeof(*eth));
  ip->protocol = 1;
  ip->saddr = htonl(192 << 24 | 168 << 16 | 1 << 8 | 1);
  ip->daddr = htonl(192 << 24 | 168 << 16 | 1 << 8 | 2);
  ip->check = checksum(ip, sizeof(*ip));
  pos = (char *)(ip + 1);
  for (i = 0; i < sizeof(buf) - sizeof(*eth) - sizeof(*ip); i++)
    *pos++ = i;
  if (send(s, buf, sizeof(buf), 0) < 0)
    perror("send");
}


x86 assembly (clang, -O0):
<tx>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x678,%rsp
mov    %edi,-0x2c(%rbp)
mov    %rsi,-0x38(%rbp)
mov    %edx,-0x3c(%rbp)
mov    %rcx,-0x48(%rbp)
mov    %r8,-0x50(%rbp)
mov    %r9d,-0x54(%rbp)
mov    -0x38(%rbp),%rsi
mov    -0x3c(%rbp),%edx
mov    -0x48(%rbp),%rax
mov    (%rax),%cl
mov    -0x48(%rbp),%rax
mov    0x1(%rax),%r8b
mov    -0x48(%rbp),%rax
mov    0x2(%rax),%r9b
mov    -0x48(%rbp),%rax
mov    0x3(%rax),%al
mov    -0x48(%rbp),%rdi
mov    0x4(%rdi),%r13b
mov    -0x48(%rbp),%rdi
mov    0x5(%rdi),%r12b
mov    -0x50(%rbp),%rdi
mov    (%rdi),%r15b
mov    -0x50(%rbp),%rdi
mov    0x1(%rdi),%r14b
mov    -0x50(%rbp),%rdi
mov    0x2(%rdi),%bl
mov    -0x50(%rbp),%rdi
mov    0x3(%rdi),%r11b
mov    -0x50(%rbp),%rdi
mov    0x4(%rdi),%r10b
mov    -0x50(%rbp),%rdi
mov    %rdi,-0x658(%rbp)
lea    0xdea(%rip),%rdi
movzbl %cl,%ecx
movzbl %r8b,%r8d
movzbl %r9b,%r9d
movzbl %al,%eax
mov    %eax,(%rsp)
mov    -0x658(%rbp),%rax
movzbl %r13b,%r13d
mov    %r13d,0x8(%rsp)
movzbl %r12b,%r12d
mov    %r12d,0x10(%rsp)
movzbl %r15b,%r15d
mov    %r15d,0x18(%rsp)
movzbl %r14b,%r14d
mov    %r14d,0x20(%rsp)
movzbl %bl,%ebx
mov    %ebx,0x28(%rsp)
movzbl %r11b,%r11d
mov    %r11d,0x30(%rsp)
movzbl %r10b,%r10d
mov    %r10d,0x38(%rsp)
movzbl 0x5(%rax),%eax
mov    %eax,0x40(%rsp)
call   1050 <printf@plt>
lea    -0x630(%rbp),%rax
mov    %rax,-0x640(%rbp)
mov    -0x640(%rbp),%rax
mov    0xc(%rax),%edi
mov    -0x50(%rbp),%rsi
mov    0x2d45(%rip),%rax
mov    (%rax),%edx
call   1090 <memcpy@plt>
mov    -0x640(%rbp),%rax
mov    0x8(%rax),%edi
mov    -0x48(%rbp),%rsi
mov    0x2d29(%rip),%rax
mov    (%rax),%edx
call   1090 <memcpy@plt>
mov    0x2d23(%rip),%rax
mov    (%rax),%edi
call   1030 <htons@plt>
mov    %rax,%rcx
mov    -0x640(%rbp),%rax
mov    %rcx,(%rax)
mov    -0x640(%rbp),%rax
add    $0x10,%rax
mov    %rax,-0x648(%rbp)
mov    -0x648(%rbp),%rdi
xor    %esi,%esi
mov    $0x38,%edx
call   1080 <memset@plt>
mov    -0x648(%rbp),%rax
movl   $0x5,(%rax)
mov    -0x648(%rbp),%rax
movl   $0x4,0x4(%rax)
mov    -0x648(%rbp),%rax
movl   $0x40,0x8(%rax)
mov    -0x54(%rbp),%ecx
mov    -0x648(%rbp),%rax
mov    %ecx,0x30(%rax)
mov    $0x5cc,%edi
call   1030 <htons@plt>
mov    %rax,%rcx
mov    -0x648(%rbp),%rax
mov    %rcx,0x28(%rax)
mov    -0x648(%rbp),%rax
movl   $0x1,0xc(%rax)
mov    $0xc0a80101,%edi
call   1070 <htonl@plt>
mov    %rax,%rcx
mov    -0x648(%rbp),%rax
mov    %rcx,0x20(%rax)
mov    $0xc0a80102,%edi
call   1070 <htonl@plt>
mov    %rax,%rcx
mov    -0x648(%rbp),%rax
mov    %rcx,0x18(%rax)
mov    -0x648(%rbp),%rdi
mov    $0x38,%esi
call   1060 <checksum@plt>
mov    %eax,%ecx
mov    -0x648(%rbp),%rax
mov    %ecx,0x10(%rax)
mov    -0x648(%rbp),%rax
add    $0x38,%rax
mov    %rax,-0x638(%rbp)
movl   $0x0,-0x64c(%rbp)
movslq -0x64c(%rbp),%rax
cmp    $0x594,%rax
jae    1409 <tx+0x289>
mov    -0x64c(%rbp),%eax
mov    %al,%cl
mov    -0x638(%rbp),%rax
mov    %rax,%rdx
add    $0x1,%rdx
mov    %rdx,-0x638(%rbp)
mov    %cl,(%rax)
mov    -0x64c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x64c(%rbp)
jmp    13c3 <tx+0x243>
mov    -0x2c(%rbp),%edi
lea    -0x630(%rbp),%rsi
mov    $0x5dc,%edx
xor    %ecx,%ecx
call   1040 <send@plt>
cmp    $0x0,%rax
jge    1435 <tx+0x2b5>
lea    0xc23(%rip),%rdi
call   10a0 <perror@plt>
add    $0x678,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

x86 assembly (clang, -O2):
<tx>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x608,%rsp
mov    %r9d,0x8(%rsp)
mov    %r8,%rbp
mov    %rcx,%rbx
mov    %edi,0xc(%rsp)
movzbl (%rcx),%ecx
movzbl 0x1(%rbx),%r8d
movzbl 0x2(%rbx),%r9d
movzbl 0x3(%rbx),%eax
mov    %rax,0x18(%rsp)
movzbl 0x4(%rbx),%eax
mov    %rax,0x10(%rsp)
movzbl 0x5(%rbx),%r12d
movzbl 0x0(%rbp),%r13d
movzbl 0x1(%rbp),%r15d
movzbl 0x2(%rbp),%r14d
movzbl 0x3(%rbp),%r11d
movzbl 0x4(%rbp),%r10d
movzbl 0x5(%rbp),%eax
sub    $0x8,%rsp
lea    0xea4(%rip),%rdi
push   %rax
push   %r10
push   %r11
push   %r14
push   %r15
push   %r13
push   %r12
push   0x50(%rsp)
push   0x60(%rsp)
call   1050 <printf@plt>
add    $0x50,%rsp
mov    0x2dcf(%rip),%r14
mov    (%r14),%edx
mov    %rbp,%rsi
call   1090 <memcpy@plt>
mov    (%r14),%edx
mov    %rbx,%rsi
call   1090 <memcpy@plt>
mov    0x2dba(%rip),%rax
mov    (%rax),%edi
call   1030 <htons@plt>
mov    %rax,0x20(%rsp)
lea    0x30(%rsp),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x38,%edx
call   1080 <memset@plt>
movabs $0x400000005,%rax
mov    %rax,0x30(%rsp)
movl   $0x40,0x38(%rsp)
mov    0x8(%rsp),%eax
mov    %eax,0x60(%rsp)
mov    $0x5cc,%edi
call   1030 <htons@plt>
mov    %rax,0x58(%rsp)
movl   $0x1,0x3c(%rsp)
mov    $0xc0a80101,%edi
call   1070 <htonl@plt>
mov    %rax,0x50(%rsp)
mov    $0xc0a80102,%edi
call   1070 <htonl@plt>
mov    %rax,0x48(%rsp)
mov    %rbx,%rdi
mov    $0x38,%esi
call   1060 <checksum@plt>
mov    %eax,0x40(%rsp)
movdqa 0xd45(%rip),%xmm2
mov    $0xb8,%eax
movdqa 0xd47(%rip),%xmm8
movdqa 0xd4e(%rip),%xmm9
movdqa 0xd56(%rip),%xmm3
movdqa 0xd5e(%rip),%xmm4
movdqa 0xd66(%rip),%xmm5
movdqa 0xd6e(%rip),%xmm6
movdqa 0xd76(%rip),%xmm7
movdqa 0xd7e(%rip),%xmm1
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movdqu %xmm2,-0x50(%rsp,%rax,1)
cmp    $0x638,%rax
je     138b <tx+0x20b>
movdqa %xmm2,%xmm0
paddb  %xmm8,%xmm0
movdqu %xmm0,-0x40(%rsp,%rax,1)
movdqa %xmm2,%xmm0
paddb  %xmm9,%xmm0
movdqu %xmm0,-0x30(%rsp,%rax,1)
movdqa %xmm2,%xmm0
paddb  %xmm3,%xmm0
movdqu %xmm0,-0x20(%rsp,%rax,1)
movdqa %xmm2,%xmm0
paddb  %xmm4,%xmm0
movdqu %xmm0,-0x10(%rsp,%rax,1)
movdqa %xmm2,%xmm0
paddb  %xmm5,%xmm0
movdqu %xmm0,(%rsp,%rax,1)
movdqa %xmm2,%xmm0
paddb  %xmm6,%xmm0
movdqu %xmm0,0x10(%rsp,%rax,1)
movdqa %xmm2,%xmm0
paddb  %xmm7,%xmm0
movdqu %xmm0,0x20(%rsp,%rax,1)
pxor   %xmm1,%xmm2
sub    $0xffffffffffffff80,%rax
jmp    1310 <tx+0x190>
movl   $0x93929190,0x5f8(%rsp)
90 91 92 93
lea    0x20(%rsp),%rsi
mov    0xc(%rsp),%edi
mov    $0x5dc,%edx
xor    %ecx,%ecx
call   1040 <send@plt>
test   %rax,%rax
js     13c2 <tx+0x242>
add    $0x608,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xd1a(%rip),%rdi
call   10a0 <perror@plt>
jmp    13b0 <tx+0x230>

LLVM IR (-O0):
%struct.ether_header = type { i8*, i32, i32 }
%struct.iphdr = type { i32, i32, i32, i32, i32, i8*, i8*, i8*, i32 }
@.str = [83 x i8] c"TX: %s(ifindex=%d) %02x:%02x:%02x:%02x:%02x:%02x -> %02x:%02x:%02x:%02x:%02x:%02x\0A\00"
@ETH_ALEN = global i32 0
@ETHERTYPE_IP = global i32 0
@.str.1 = [5 x i8] c"send\00"
define void @tx(i32 %0, i8* %1, i32 %2, i8* %3, i8* %4, i32 %5) {
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca i32
%13 = alloca [1500 x i8]
%14 = alloca i8*
%15 = alloca %struct.ether_header*
%16 = alloca %struct.iphdr*
%17 = alloca i32
store i32 %0, i32* %7
store i8* %1, i8** %8
store i32 %2, i32* %9
store i8* %3, i8** %10
store i8* %4, i8** %11
store i32 %5, i32* %12
%18 = load i8*, i8** %8
%19 = load i32, i32* %9
%20 = load i8*, i8** %10
%21 = getelementptr inbounds i8, i8* %20, i64 0
%22 = load i8, i8* %21
%23 = load i8*, i8** %10
%24 = getelementptr inbounds i8, i8* %23, i64 1
%25 = load i8, i8* %24
%26 = load i8*, i8** %10
%27 = getelementptr inbounds i8, i8* %26, i64 2
%28 = load i8, i8* %27
%29 = load i8*, i8** %10
%30 = getelementptr inbounds i8, i8* %29, i64 3
%31 = load i8, i8* %30
%32 = load i8*, i8** %10
%33 = getelementptr inbounds i8, i8* %32, i64 4
%34 = load i8, i8* %33
%35 = load i8*, i8** %10
%36 = getelementptr inbounds i8, i8* %35, i64 5
%37 = load i8, i8* %36
%38 = load i8*, i8** %11
%39 = getelementptr inbounds i8, i8* %38, i64 0
%40 = load i8, i8* %39
%41 = load i8*, i8** %11
%42 = getelementptr inbounds i8, i8* %41, i64 1
%43 = load i8, i8* %42
%44 = load i8*, i8** %11
%45 = getelementptr inbounds i8, i8* %44, i64 2
%46 = load i8, i8* %45
%47 = load i8*, i8** %11
%48 = getelementptr inbounds i8, i8* %47, i64 3
%49 = load i8, i8* %48
%50 = load i8*, i8** %11
%51 = getelementptr inbounds i8, i8* %50, i64 4
%52 = load i8, i8* %51
%53 = load i8*, i8** %11
%54 = getelementptr inbounds i8, i8* %53, i64 5
%55 = load i8, i8* %54
%56 = call i32 @printf(i8* getelementptr inbounds ([83 x i8], [83 x i8]* @.str, i64 0, i64 0), i8* %18, i32 %19, i8 zeroext %22, i8 zeroext %25, i8 zeroext %28, i8 zeroext %31, i8 zeroext %34, i8 zeroext %37, i8 zeroext %40, i8 zeroext %43, i8 zeroext %46, i8 zeroext %49, i8 zeroext %52, i8 zeroext %55)
%57 = getelementptr inbounds [1500 x i8], [1500 x i8]* %13, i64 0, i64 0
%58 = bitcast i8* %57 to %struct.ether_header*
store %struct.ether_header* %58, %struct.ether_header** %15
%59 = load %struct.ether_header*, %struct.ether_header** %15
%60 = getelementptr inbounds %struct.ether_header, %struct.ether_header* %59, i32 0, i32 2
%61 = load i32, i32* %60
%62 = load i8*, i8** %11
%63 = load i32, i32* @ETH_ALEN
%64 = call i32 @memcpy(i32 %61, i8* %62, i32 %63)
%65 = load %struct.ether_header*, %struct.ether_header** %15
%66 = getelementptr inbounds %struct.ether_header, %struct.ether_header* %65, i32 0, i32 1
%67 = load i32, i32* %66
%68 = load i8*, i8** %10
%69 = load i32, i32* @ETH_ALEN
%70 = call i32 @memcpy(i32 %67, i8* %68, i32 %69)
%71 = load i32, i32* @ETHERTYPE_IP
%72 = call i8* @htons(i32 %71)
%73 = load %struct.ether_header*, %struct.ether_header** %15
%74 = getelementptr inbounds %struct.ether_header, %struct.ether_header* %73, i32 0, i32 0
store i8* %72, i8** %74
%75 = load %struct.ether_header*, %struct.ether_header** %15
%76 = getelementptr inbounds %struct.ether_header, %struct.ether_header* %75, i64 1
%77 = bitcast %struct.ether_header* %76 to %struct.iphdr*
store %struct.iphdr* %77, %struct.iphdr** %16
%78 = load %struct.iphdr*, %struct.iphdr** %16
%79 = call i32 @memset(%struct.iphdr* %78, i32 0, i32 56)
%80 = load %struct.iphdr*, %struct.iphdr** %16
%81 = getelementptr inbounds %struct.iphdr, %struct.iphdr* %80, i32 0, i32 0
store i32 5, i32* %81
%82 = load %struct.iphdr*, %struct.iphdr** %16
%83 = getelementptr inbounds %struct.iphdr, %struct.iphdr* %82, i32 0, i32 1
store i32 4, i32* %83
%84 = load %struct.iphdr*, %struct.iphdr** %16
%85 = getelementptr inbounds %struct.iphdr, %struct.iphdr* %84, i32 0, i32 2
store i32 64, i32* %85
%86 = load i32, i32* %12
%87 = load %struct.iphdr*, %struct.iphdr** %16
%88 = getelementptr inbounds %struct.iphdr, %struct.iphdr* %87, i32 0, i32 8
store i32 %86, i32* %88
%89 = call i8* @htons(i32 1484)
%90 = load %struct.iphdr*, %struct.iphdr** %16
%91 = getelementptr inbounds %struct.iphdr, %struct.iphdr* %90, i32 0, i32 7
store i8* %89, i8** %91
%92 = load %struct.iphdr*, %struct.iphdr** %16
%93 = getelementptr inbounds %struct.iphdr, %struct.iphdr* %92, i32 0, i32 3
store i32 1, i32* %93
%94 = call i8* @htonl(i32 -1062731519)
%95 = load %struct.iphdr*, %struct.iphdr** %16
%96 = getelementptr inbounds %struct.iphdr, %struct.iphdr* %95, i32 0, i32 6
store i8* %94, i8** %96
%97 = call i8* @htonl(i32 -1062731518)
%98 = load %struct.iphdr*, %struct.iphdr** %16
%99 = getelementptr inbounds %struct.iphdr, %struct.iphdr* %98, i32 0, i32 5
store i8* %97, i8** %99
%100 = load %struct.iphdr*, %struct.iphdr** %16
%101 = call i32 @checksum(%struct.iphdr* %100, i32 56)
%102 = load %struct.iphdr*, %struct.iphdr** %16
%103 = getelementptr inbounds %struct.iphdr, %struct.iphdr* %102, i32 0, i32 4
store i32 %101, i32* %103
%104 = load %struct.iphdr*, %struct.iphdr** %16
%105 = getelementptr inbounds %struct.iphdr, %struct.iphdr* %104, i64 1
%106 = bitcast %struct.iphdr* %105 to i8*
store i8* %106, i8** %14
store i32 0, i32* %17
br label %107
107: ; preds = %116, %6
%108 = load i32, i32* %17
%109 = sext i32 %108 to i64
%110 = icmp ult i64 %109, 1428
br i1 %110, label %111, label %119
111: ; preds = %107
%112 = load i32, i32* %17
%113 = trunc i32 %112 to i8
%114 = load i8*, i8** %14
%115 = getelementptr inbounds i8, i8* %114, i32 1
store i8* %115, i8** %14
store i8 %113, i8* %114
br label %116
116: ; preds = %111
%117 = load i32, i32* %17
%118 = add nsw i32 %117, 1
store i32 %118, i32* %17
br label %107
119: ; preds = %107
%120 = load i32, i32* %7
%121 = getelementptr inbounds [1500 x i8], [1500 x i8]* %13, i64 0, i64 0
%122 = call i64 @send(i32 %120, i8* %121, i32 1500, i32 0)
%123 = icmp slt i64 %122, 0
br i1 %123, label %124, label %126
124: ; preds = %119
%125 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
br label %126
126: ; preds = %124, %119
ret void
}

LLVM IR (-O2):
%struct.iphdr = type { i32, i32, i32, i32, i32, i8*, i8*, i8*, i32 }
@.str = [83 x i8] c"TX: %s(ifindex=%d) %02x:%02x:%02x:%02x:%02x:%02x -> %02x:%02x:%02x:%02x:%02x:%02x\0A\00"
@ETH_ALEN = global i32 0
@ETHERTYPE_IP = global i32 0
@.str.1 = [5 x i8] c"send\00"
define void @tx(i32 %0, i8* %1, i32 %2, i8* %3, i8* %4, i32 %5) {
%7 = alloca [1500 x i8]
%8 = getelementptr inbounds [1500 x i8], [1500 x i8]* %7, i64 0, i64 0
%9 = load i8, i8* %3
%10 = getelementptr inbounds i8, i8* %3, i64 1
%11 = load i8, i8* %10
%12 = getelementptr inbounds i8, i8* %3, i64 2
%13 = load i8, i8* %12
%14 = getelementptr inbounds i8, i8* %3, i64 3
%15 = load i8, i8* %14
%16 = getelementptr inbounds i8, i8* %3, i64 4
%17 = load i8, i8* %16
%18 = getelementptr inbounds i8, i8* %3, i64 5
%19 = load i8, i8* %18
%20 = load i8, i8* %4
%21 = getelementptr inbounds i8, i8* %4, i64 1
%22 = load i8, i8* %21
%23 = getelementptr inbounds i8, i8* %4, i64 2
%24 = load i8, i8* %23
%25 = getelementptr inbounds i8, i8* %4, i64 3
%26 = load i8, i8* %25
%27 = getelementptr inbounds i8, i8* %4, i64 4
%28 = load i8, i8* %27
%29 = getelementptr inbounds i8, i8* %4, i64 5
%30 = load i8, i8* %29
%31 = tail call i32 @printf(i8* getelementptr inbounds ([83 x i8], [83 x i8]* @.str, i64 0, i64 0), i8* %1, i32 %2, i8 zeroext %9, i8 zeroext %11, i8 zeroext %13, i8 zeroext %15, i8 zeroext %17, i8 zeroext %19, i8 zeroext %20, i8 zeroext %22, i8 zeroext %24, i8 zeroext %26, i8 zeroext %28, i8 zeroext %30)
%32 = load i32, i32* @ETH_ALEN
%33 = tail call i32 @memcpy(i32 undef, i8* %4, i32 %32)
%34 = load i32, i32* @ETH_ALEN
%35 = tail call i32 @memcpy(i32 undef, i8* %3, i32 %34)
%36 = load i32, i32* @ETHERTYPE_IP
%37 = tail call i8* @htons(i32 %36)
%38 = bitcast [1500 x i8]* %7 to i8**
store i8* %37, i8** %38
%39 = getelementptr inbounds [1500 x i8], [1500 x i8]* %7, i64 0, i64 16
%40 = bitcast i8* %39 to %struct.iphdr*
%41 = call i32 @memset(%struct.iphdr* %40, i32 0, i32 56)
%42 = bitcast i8* %39 to i32*
store i32 5, i32* %42
%43 = getelementptr inbounds [1500 x i8], [1500 x i8]* %7, i64 0, i64 20
%44 = bitcast i8* %43 to i32*
store i32 4, i32* %44
%45 = getelementptr inbounds [1500 x i8], [1500 x i8]* %7, i64 0, i64 24
%46 = bitcast i8* %45 to i32*
store i32 64, i32* %46
%47 = getelementptr inbounds [1500 x i8], [1500 x i8]* %7, i64 0, i64 64
%48 = bitcast i8* %47 to i32*
store i32 %5, i32* %48
%49 = call i8* @htons(i32 1484)
%50 = getelementptr inbounds [1500 x i8], [1500 x i8]* %7, i64 0, i64 56
%51 = bitcast i8* %50 to i8**
store i8* %49, i8** %51
%52 = getelementptr inbounds [1500 x i8], [1500 x i8]* %7, i64 0, i64 28
%53 = bitcast i8* %52 to i32*
store i32 1, i32* %53
%54 = call i8* @htonl(i32 -1062731519)
%55 = getelementptr inbounds [1500 x i8], [1500 x i8]* %7, i64 0, i64 48
%56 = bitcast i8* %55 to i8**
store i8* %54, i8** %56
%57 = call i8* @htonl(i32 -1062731518)
%58 = getelementptr inbounds [1500 x i8], [1500 x i8]* %7, i64 0, i64 40
%59 = bitcast i8* %58 to i8**
store i8* %57, i8** %59
%60 = call i32 @checksum(%struct.iphdr* %40, i32 56)
%61 = getelementptr inbounds [1500 x i8], [1500 x i8]* %7, i64 0, i64 32
%62 = bitcast i8* %61 to i32*
store i32 %60, i32* %62
%63 = getelementptr inbounds [1500 x i8], [1500 x i8]* %7, i64 0, i64 72
%64 = getelementptr inbounds [1500 x i8], [1500 x i8]* %7, i64 0, i64 1496
br label %65
65: ; preds = %72, %6
%66 = phi i64 [ 0, %6 ], [ %100, %72 ]
%67 = phi <16 x i8> [ <i8 0, i8 1, i8 2, i8 3, i8 4, i8 5, i8 6, i8 7, i8 8, i8 9, i8 10, i8 11, i8 12, i8 13, i8 14, i8 15>, %6 ], [ %101, %72 ]
%68 = getelementptr i8, i8* %63, i64 %66
%69 = bitcast i8* %68 to <16 x i8>*
store <16 x i8> %67, <16 x i8>* %69
%70 = or i64 %66, 16
%71 = icmp eq i64 %70, 1424
br i1 %71, label %102, label %72
72: ; preds = %65
%73 = add <16 x i8> %67, <i8 16, i8 16, i8 16, i8 16, i8 16, i8 16, i8 16, i8 16, i8 16, i8 16, i8 16, i8 16, i8 16, i8 16, i8 16, i8 16>
%74 = getelementptr i8, i8* %63, i64 %70
%75 = bitcast i8* %74 to <16 x i8>*
store <16 x i8> %73, <16 x i8>* %75
%76 = or i64 %66, 32
%77 = add <16 x i8> %67, <i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32, i8 32>
%78 = getelementptr i8, i8* %63, i64 %76
%79 = bitcast i8* %78 to <16 x i8>*
store <16 x i8> %77, <16 x i8>* %79
%80 = or i64 %66, 48
%81 = add <16 x i8> %67, <i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48, i8 48>
%82 = getelementptr i8, i8* %63, i64 %80
%83 = bitcast i8* %82 to <16 x i8>*
store <16 x i8> %81, <16 x i8>* %83
%84 = or i64 %66, 64
%85 = add <16 x i8> %67, <i8 64, i8 64, i8 64, i8 64, i8 64, i8 64, i8 64, i8 64, i8 64, i8 64, i8 64, i8 64, i8 64, i8 64, i8 64, i8 64>
%86 = getelementptr i8, i8* %63, i64 %84
%87 = bitcast i8* %86 to <16 x i8>*
store <16 x i8> %85, <16 x i8>* %87
%88 = or i64 %66, 80
%89 = add <16 x i8> %67, <i8 80, i8 80, i8 80, i8 80, i8 80, i8 80, i8 80, i8 80, i8 80, i8 80, i8 80, i8 80, i8 80, i8 80, i8 80, i8 80>
%90 = getelementptr i8, i8* %63, i64 %88
%91 = bitcast i8* %90 to <16 x i8>*
store <16 x i8> %89, <16 x i8>* %91
%92 = or i64 %66, 96
%93 = add <16 x i8> %67, <i8 96, i8 96, i8 96, i8 96, i8 96, i8 96, i8 96, i8 96, i8 96, i8 96, i8 96, i8 96, i8 96, i8 96, i8 96, i8 96>
%94 = getelementptr i8, i8* %63, i64 %92
%95 = bitcast i8* %94 to <16 x i8>*
store <16 x i8> %93, <16 x i8>* %95
%96 = or i64 %66, 112
%97 = add <16 x i8> %67, <i8 112, i8 112, i8 112, i8 112, i8 112, i8 112, i8 112, i8 112, i8 112, i8 112, i8 112, i8 112, i8 112, i8 112, i8 112, i8 112>
%98 = getelementptr i8, i8* %63, i64 %96
%99 = bitcast i8* %98 to <16 x i8>*
store <16 x i8> %97, <16 x i8>* %99
%100 = add nuw nsw i64 %66, 128
%101 = xor <16 x i8> %67, <i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128, i8 -128>
br label %65
102: ; preds = %65
%103 = getelementptr inbounds [1500 x i8], [1500 x i8]* %7, i64 0, i64 1497
store i8 -112, i8* %64
%104 = getelementptr inbounds [1500 x i8], [1500 x i8]* %7, i64 0, i64 1498
store i8 -111, i8* %103
%105 = getelementptr inbounds [1500 x i8], [1500 x i8]* %7, i64 0, i64 1499
store i8 -110, i8* %104
store i8 -109, i8* %105
%106 = call i64 @send(i32 %0, i8* %8, i32 1500, i32 0)
%107 = icmp slt i64 %106, 0
br i1 %107, label %108, label %110
108: ; preds = %102
%109 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
br label %110
110: ; preds = %108, %102
ret void
}