#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 */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct tcphdr {
  unsigned short source;
  unsigned short seq;
  int doff;
  int fin;
  int psh;
  int urg;
  void *check;
  scalar_t__ ack;
  scalar_t__ rst;
  scalar_t__ syn;
  void *window;
  scalar_t__ urg_ptr;
  scalar_t__ ack_seq;
  scalar_t__ res2;
  scalar_t__ res1;
  void *dest;
};
struct TYPE_2__ {
  unsigned int s_addr;
};
struct sockaddr_in {
  unsigned short sin_port;
  TYPE_1__ sin_addr;
  int /*<<< orphan*/ sin_family;
};
struct sockaddr {
  int dummy;
};
struct iphdr {
  int ihl;
  int version;
  unsigned short id;
  int ttl;
  unsigned int daddr;
  unsigned int saddr;
  void *tot_len;
  void *check;
  void *protocol;
  scalar_t__ frag_off;
  scalar_t__ tos;
};
typedef int /*<<< orphan*/ one;

/* Variables and functions */
int /*<<< orphan*/ AF_INET;
int /*<<< orphan*/ IPPROTO_IP;
int /*<<< orphan*/ IPPROTO_RAW;
void *IPPROTO_TCP;
int /*<<< orphan*/ IP_HDRINCL;
int /*<<< orphan*/ PF_INET;
int /*<<< orphan*/ SOCK_RAW;
int /*<<< orphan*/ bzero(char *, int);
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
void *htons(int);
void *in_cksum(unsigned short *, int);
int /*<<< orphan*/ inet_pton(int /*<<< orphan*/, char *, unsigned int *);
int /*<<< orphan*/ ntohs(void *);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *);
scalar_t__ sendto(int, char *, int /*<<< orphan*/, int /*<<< orphan*/,
                  struct sockaddr *, int);
scalar_t__ setsockopt(int, int /*<<< orphan*/, int /*<<< orphan*/, int const *,
                      int);
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ strlen(char const *);
int /*<<< orphan*/ strncpy(char *, char const *, int /*<<< orphan*/);
void fazerpacote(char *dest_addr, unsigned short dest_port, char *payload) {
  char packet[sizeof(struct iphdr) + sizeof(struct tcphdr) + 9192];
  struct envio {
    struct iphdr *ip;
    struct tcphdr *tcp;
  } envio;
  struct pseudo_header {
    unsigned int source_address;
    unsigned int dest_address;
    unsigned char placeholder;
    unsigned char protocol;
    unsigned short tcp_length;
    char *data;
  };
  int tcp_socket;
  struct sockaddr_in sin;
  unsigned int destino;
  envio.ip = (struct iphdr *)packet;
  envio.tcp = (struct tcphdr *)(packet + sizeof(struct iphdr));
  struct pseudo_header pseudo_header;
  char *data = packet + sizeof(struct iphdr) + sizeof(struct tcphdr);
  const char *message = payload;
  strncpy(data, message, strlen(message));
  inet_pton(PF_INET, dest_addr, &destino);
  bzero(packet, sizeof(struct iphdr));
  envio.ip->ihl = 5;
  envio.ip->version = 4;
  envio.ip->tos = 0;
  envio.ip->tot_len = htons(sizeof(struct iphdr) + 9192);
  envio.ip->id = dest_port;
  envio.ip->frag_off = 0;
  envio.ip->ttl = 255;
  envio.ip->protocol = IPPROTO_TCP;
  envio.ip->check = 0;
  envio.ip->daddr = destino;
  envio.tcp->source = dest_port;
  envio.tcp->dest = htons(dest_port);
  envio.tcp->seq = dest_port;
  envio.tcp->res1 = 0;
  envio.tcp->res2 = 0;
  envio.tcp->doff = 5;
  envio.tcp->ack = 0;
  envio.tcp->ack_seq = 0;
  envio.tcp->urg_ptr = 0;
  envio.tcp->window = htons(10666);
  envio.tcp->check = 0;
  envio.tcp->fin = 1;
  envio.tcp->syn = 0;
  envio.tcp->rst = 0;
  envio.tcp->psh = 1;
  envio.tcp->urg = 1;
  envio.tcp->ack = 0;
  sin.sin_family = AF_INET;
  sin.sin_port = envio.tcp->source;
  sin.sin_addr.s_addr = envio.ip->daddr;
  tcp_socket = socket(AF_INET, SOCK_RAW, IPPROTO_RAW);
  if (tcp_socket < 0) {
    perror("socket");
    exit(1);
  }
  envio.tcp->source++;
  envio.ip->id++;
  envio.tcp->seq++;
  envio.tcp->check = 0;
  envio.ip->check = 0;
  envio.ip->check = in_cksum((unsigned short *)&envio.ip, sizeof(struct iphdr));
  pseudo_header.source_address = envio.ip->saddr;
  pseudo_header.dest_address = envio.ip->daddr;
  pseudo_header.protocol = IPPROTO_TCP;
  pseudo_header.tcp_length = htons(sizeof(struct tcphdr) + 9192);
  pseudo_header.data = data;
  envio.tcp->check =
      in_cksum((unsigned short *)&pseudo_header,
               sizeof(struct tcphdr) + sizeof(struct pseudo_header) + 9192);
  int one = 1;
  const int *val = &one;
  if (setsockopt(tcp_socket, IPPROTO_IP, IP_HDRINCL, val, sizeof(one)) < 0)
    printf("Warning: Cannot set HDRINCL!\n");
  if (sendto(tcp_socket, packet, ntohs(envio.ip->tot_len), 0,
             (struct sockaddr *)&sin, sizeof(struct sockaddr_in)) < 0) {
    fprintf(stderr, "sendto error...\n");
    perror("ops");
    close(tcp_socket);
    exit(1);
  }
  close(tcp_socket);
}


x86 assembly (clang, -O0):
<fazerpacote>:
push   %rbp
mov    %rsp,%rbp
sub    $0x2530,%rsp
mov    %si,%ax
mov    %rdi,-0x8(%rbp)
mov    %ax,-0xa(%rbp)
mov    %rdx,-0x18(%rbp)
lea    -0x24b0(%rbp),%rax
mov    %rax,-0x24c0(%rbp)
lea    -0x24b0(%rbp),%rax
add    $0x40,%rax
mov    %rax,-0x24b8(%rbp)
lea    -0x24b0(%rbp),%rax
add    $0x40,%rax
add    $0x68,%rax
mov    %rax,-0x24f8(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x2500(%rbp)
mov    -0x24f8(%rbp),%rax
mov    %rax,-0x2520(%rbp)
mov    -0x2500(%rbp),%rax
mov    %rax,-0x2518(%rbp)
mov    -0x2500(%rbp),%rdi
call   1060 <strlen@plt>
mov    -0x2520(%rbp),%rdi
mov    -0x2518(%rbp),%rsi
mov    %eax,%edx
call   1030 <strncpy@plt>
mov    0x2d19(%rip),%rax
mov    (%rax),%edi
mov    -0x8(%rbp),%rsi
lea    -0x24d4(%rbp),%rdx
call   10c0 <inet_pton@plt>
lea    -0x24b0(%rbp),%rdi
mov    $0x40,%esi
call   10f0 <bzero@plt>
mov    -0x24c0(%rbp),%rax
movl   $0x5,(%rax)
mov    -0x24c0(%rbp),%rax
movl   $0x4,0x4(%rax)
mov    -0x24c0(%rbp),%rax
movq   $0x0,0x38(%rax)
mov    $0x2428,%edi
call   1070 <htons@plt>
mov    %rax,%rcx
mov    -0x24c0(%rbp),%rax
mov    %rcx,0x18(%rax)
mov    -0xa(%rbp),%cx
mov    -0x24c0(%rbp),%rax
mov    %cx,0x8(%rax)
mov    -0x24c0(%rbp),%rax
movq   $0x0,0x30(%rax)
mov    -0x24c0(%rbp),%rax
movl   $0xff,0xc(%rax)
mov    0x2ca1(%rip),%rax
mov    (%rax),%rcx
mov    -0x24c0(%rbp),%rax
mov    %rcx,0x28(%rax)
mov    -0x24c0(%rbp),%rax
movq   $0x0,0x20(%rax)
mov    -0x24d4(%rbp),%ecx
mov    -0x24c0(%rbp),%rax
mov    %ecx,0x10(%rax)
mov    -0xa(%rbp),%cx
mov    -0x24b8(%rbp),%rax
mov    %cx,(%rax)
movzwl -0xa(%rbp),%edi
call   1070 <htons@plt>
mov    %rax,%rcx
mov    -0x24b8(%rbp),%rax
mov    %rcx,0x60(%rax)
mov    -0xa(%rbp),%cx
mov    -0x24b8(%rbp),%rax
mov    %cx,0x2(%rax)
mov    -0x24b8(%rbp),%rax
movq   $0x0,0x58(%rax)
mov    -0x24b8(%rbp),%rax
movq   $0x0,0x50(%rax)
mov    -0x24b8(%rbp),%rax
movl   $0x5,0x4(%rax)
mov    -0x24b8(%rbp),%rax
movq   $0x0,0x20(%rax)
mov    -0x24b8(%rbp),%rax
movq   $0x0,0x48(%rax)
mov    -0x24b8(%rbp),%rax
movq   $0x0,0x40(%rax)
mov    $0x29aa,%edi
call   1070 <htons@plt>
mov    %rax,%rcx
mov    -0x24b8(%rbp),%rax
mov    %rcx,0x38(%rax)
mov    -0x24b8(%rbp),%rax
movq   $0x0,0x18(%rax)
mov    -0x24b8(%rbp),%rax
movl   $0x1,0x8(%rax)
mov    -0x24b8(%rbp),%rax
movq   $0x0,0x30(%rax)
mov    -0x24b8(%rbp),%rax
movq   $0x0,0x28(%rax)
mov    -0x24b8(%rbp),%rax
movl   $0x1,0xc(%rax)
mov    -0x24b8(%rbp),%rax
movl   $0x1,0x10(%rax)
mov    -0x24b8(%rbp),%rax
movq   $0x0,0x20(%rax)
mov    0x2b7a(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x24c8(%rbp)
mov    -0x24b8(%rbp),%rax
mov    (%rax),%ax
mov    %ax,-0x24d0(%rbp)
mov    -0x24c0(%rbp),%rax
mov    0x10(%rax),%eax
mov    %eax,-0x24cc(%rbp)
mov    0x2b4a(%rip),%rax
mov    (%rax),%edi
mov    0x2b39(%rip),%rax
mov    (%rax),%esi
mov    0x2b08(%rip),%rax
mov    (%rax),%edx
call   1110 <socket@plt>
mov    %eax,-0x24c4(%rbp)
cmpl   $0x0,-0x24c4(%rbp)
jge    14d8 <fazerpacote+0x2e8>
lea    0xb37(%rip),%rdi
call   10e0 <perror@plt>
mov    $0x1,%edi
call   1100 <exit@plt>
mov    -0x24b8(%rbp),%rax
mov    (%rax),%cx
add    $0x1,%cx
mov    %cx,(%rax)
mov    -0x24c0(%rbp),%rax
mov    0x8(%rax),%cx
add    $0x1,%cx
mov    %cx,0x8(%rax)
mov    -0x24b8(%rbp),%rax
mov    0x2(%rax),%cx
add    $0x1,%cx
mov    %cx,0x2(%rax)
mov    -0x24b8(%rbp),%rax
movq   $0x0,0x18(%rax)
mov    -0x24c0(%rbp),%rax
movq   $0x0,0x20(%rax)
lea    -0x24c0(%rbp),%rdi
mov    $0x40,%esi
call   1050 <in_cksum@plt>
mov    %rax,%rcx
mov    -0x24c0(%rbp),%rax
mov    %rcx,0x20(%rax)
mov    -0x24c0(%rbp),%rax
mov    0x14(%rax),%eax
mov    %eax,-0x24f0(%rbp)
mov    -0x24c0(%rbp),%rax
mov    0x10(%rax),%eax
mov    %eax,-0x24ec(%rbp)
mov    0x2a55(%rip),%rax
mov    (%rax),%rax
mov    %al,-0x24e7(%rbp)
mov    $0x2450,%edi
call   1070 <htons@plt>
mov    %ax,-0x24e6(%rbp)
mov    -0x24f8(%rbp),%rax
mov    %rax,-0x24e0(%rbp)
lea    -0x24f0(%rbp),%rdi
mov    $0x2468,%esi
call   1050 <in_cksum@plt>
mov    %rax,%rcx
mov    -0x24b8(%rbp),%rax
mov    %rcx,0x18(%rax)
movl   $0x1,-0x2504(%rbp)
lea    -0x2504(%rbp),%rax
mov    %rax,-0x2510(%rbp)
mov    -0x24c4(%rbp),%edi
mov    0x29f1(%rip),%rax
mov    (%rax),%esi
mov    0x2a08(%rip),%rax
mov    (%rax),%edx
mov    -0x2510(%rbp),%rcx
mov    $0x4,%r8d
call   1040 <setsockopt@plt>
cmp    $0x0,%rax
jge    1612 <fazerpacote+0x422>
lea    0x9fa(%rip),%rdi
call   1080 <printf@plt>
mov    -0x24c4(%rbp),%eax
mov    %eax,-0x252c(%rbp)
lea    -0x24b0(%rbp),%rax
mov    %rax,-0x2528(%rbp)
mov    -0x24c0(%rbp),%rax
mov    0x18(%rax),%rdi
call   10d0 <ntohs@plt>
mov    -0x252c(%rbp),%edi
mov    -0x2528(%rbp),%rsi
mov    %eax,%edx
lea    -0x24d0(%rbp),%r8
xor    %ecx,%ecx
mov    $0xc,%r9d
call   1090 <sendto@plt>
cmp    $0x0,%rax
jge    169f <fazerpacote+0x4af>
mov    0x2948(%rip),%rax
mov    (%rax),%edi
lea    0x9ac(%rip),%rsi
call   10b0 <fprintf@plt>
lea    0x9b1(%rip),%rdi
call   10e0 <perror@plt>
mov    -0x24c4(%rbp),%edi
call   10a0 <close@plt>
mov    $0x1,%edi
call   1100 <exit@plt>
mov    -0x24c4(%rbp),%edi
call   10a0 <close@plt>
add    $0x2530,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fazerpacote>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x24d0,%rsp
mov    %rdx,%rbx
mov    %esi,%ebp
mov    %rdi,%r15
lea    0x40(%rsp),%r12
mov    %r12,0x8(%rsp)
lea    0x80(%rsp),%rax
mov    %rax,0x10(%rsp)
lea    0xe8(%rsp),%r14
mov    %rdx,%rdi
call   1070 <strlen@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    %eax,%edx
call   1030 <strncpy@plt>
mov    0x2d66(%rip),%rax
mov    (%rax),%edi
lea    0x4(%rsp),%rdx
mov    %r15,%rsi
call   10c0 <inet_pton@plt>
mov    %r12,%rdi
mov    $0x40,%esi
call   10f0 <bzero@plt>
movabs $0x400000005,%rax
mov    %rax,0x40(%rsp)
movq   $0x0,0x78(%rsp)
mov    $0x2428,%edi
call   1080 <htons@plt>
mov    %rax,0x58(%rsp)
mov    %bp,0x48(%rsp)
movq   $0x0,0x70(%rsp)
movl   $0xff,0x4c(%rsp)
mov    0x2d26(%rip),%rbx
mov    (%rbx),%rax
mov    %rax,0x68(%rsp)
movq   $0x0,0x60(%rsp)
mov    0x4(%rsp),%eax
mov    %eax,0x50(%rsp)
mov    %bp,0x80(%rsp)
mov    %ebp,%edi
call   1080 <htons@plt>
mov    %rax,0xe0(%rsp)
mov    %bp,0x82(%rsp)
xorps  %xmm0,%xmm0
movaps %xmm0,0xd0(%rsp)
movl   $0x5,0x84(%rsp)
movq   $0x0,0xa0(%rsp)
movaps %xmm0,0xc0(%rsp)
mov    $0x29aa,%edi
call   1080 <htons@plt>
mov    %rax,0xb8(%rsp)
xorps  %xmm0,%xmm0
movups %xmm0,0x98(%rsp)
movl   $0x1,0x88(%rsp)
movups %xmm0,0xa8(%rsp)
movabs $0x100000001,%rax
mov    %rax,0x8c(%rsp)
mov    0x2c93(%rip),%rax
mov    (%rax),%edi
mov    %edi,0x20(%rsp)
movzwl 0x80(%rsp),%eax
mov    %ax,0x18(%rsp)
mov    0x50(%rsp),%eax
mov    %eax,0x1c(%rsp)
mov    0x2c69(%rip),%rax
mov    (%rax),%esi
mov    0x2c38(%rip),%rax
mov    (%rax),%edx
call   1110 <socket@plt>
test   %eax,%eax
js     148d <fazerpacote+0x29d>
mov    %eax,%ebp
addw   $0x1,0x80(%rsp)
addw   $0x1,0x48(%rsp)
addw   $0x1,0x82(%rsp)
movq   $0x0,0x98(%rsp)
movq   $0x0,0x60(%rsp)
lea    0x8(%rsp),%rdi
mov    $0x40,%esi
call   1060 <in_cksum@plt>
mov    0x8(%rsp),%rcx
mov    %rax,0x20(%rcx)
mov    0x14(%rcx),%eax
mov    %eax,0x28(%rsp)
mov    0x10(%rcx),%eax
mov    %eax,0x2c(%rsp)
mov    (%rbx),%al
mov    %al,0x31(%rsp)
mov    $0x2450,%edi
call   1080 <htons@plt>
mov    %ax,0x32(%rsp)
mov    %r14,0x38(%rsp)
lea    0x28(%rsp),%rdi
mov    $0x2468,%esi
call   1060 <in_cksum@plt>
mov    0x10(%rsp),%rcx
mov    %rax,0x18(%rcx)
movl   $0x1,(%rsp)
mov    0x2bb4(%rip),%rax
mov    (%rax),%esi
mov    0x2bcb(%rip),%rax
mov    (%rax),%edx
mov    %rsp,%rcx
mov    %ebp,%edi
mov    $0x4,%r8d
call   1050 <setsockopt@plt>
test   %rax,%rax
jns    1448 <fazerpacote+0x258>
lea    0xbd9(%rip),%rdi
call   1040 <puts@plt>
mov    0x8(%rsp),%rax
mov    0x18(%rax),%rdi
call   10d0 <ntohs@plt>
lea    0x40(%rsp),%rsi
lea    0x18(%rsp),%r8
mov    %ebp,%edi
mov    %eax,%edx
xor    %ecx,%ecx
mov    $0xc,%r9d
call   1090 <sendto@plt>
test   %rax,%rax
js     14a3 <fazerpacote+0x2b3>
mov    %ebp,%edi
call   10a0 <close@plt>
add    $0x24d0,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xb6c(%rip),%rdi
call   10e0 <perror@plt>
mov    $0x1,%edi
call   1100 <exit@plt>
mov    0x2b0e(%rip),%rax
mov    (%rax),%edi
lea    0xb54(%rip),%rsi
call   10b0 <fprintf@plt>
lea    0xb59(%rip),%rdi
call   10e0 <perror@plt>
mov    %ebp,%edi
call   10a0 <close@plt>
mov    $0x1,%edi
call   1100 <exit@plt>

LLVM IR (-O0):
%struct.envio = type { %struct.iphdr*, %struct.tcphdr* }
%struct.iphdr = type { i32, i32, i16, i32, i32, i32, i8*, i8*, i8*, i64, i64 }
%struct.tcphdr = type { i16, i16, i32, i32, i32, i32, i8*, i64, i64, i64, i8*, i64, i64, i64, i64, i8* }
%struct.sockaddr_in = type { i16, %struct.TYPE_2__, i32 }
%struct.TYPE_2__ = type { i32 }
%struct.pseudo_header = type { i32, i32, i8, i8, i16, i8* }
%struct.sockaddr = type { i32 }
@PF_INET = global i32 0
@IPPROTO_TCP = global i8* null
@AF_INET = global i32 0
@SOCK_RAW = global i32 0
@IPPROTO_RAW = global i32 0
@.str = [7 x i8] c"socket\00"
@IPPROTO_IP = global i32 0
@IP_HDRINCL = global i32 0
@.str.1 = [30 x i8] c"Warning: Cannot set HDRINCL!\0A\00"
@stderr = global i32 0
@.str.2 = [17 x i8] c"sendto error...\0A\00"
@.str.3 = [4 x i8] c"ops\00"
define void @fazerpacote(i8* %0, i16 zeroext %1, i8* %2) {
%4 = alloca i8*
%5 = alloca i16
%6 = alloca i8*
%7 = alloca [9360 x i8]
%8 = alloca %struct.envio
%9 = alloca i32
%10 = alloca %struct.sockaddr_in
%11 = alloca i32
%12 = alloca %struct.pseudo_header
%13 = alloca i8*
%14 = alloca i8*
%15 = alloca i32
%16 = alloca i32*
store i8* %0, i8** %4
store i16 %1, i16* %5
store i8* %2, i8** %6
%17 = getelementptr inbounds [9360 x i8], [9360 x i8]* %7, i64 0, i64 0
%18 = bitcast i8* %17 to %struct.iphdr*
%19 = getelementptr inbounds %struct.envio, %struct.envio* %8, i32 0, i32 0
store %struct.iphdr* %18, %struct.iphdr** %19
%20 = getelementptr inbounds [9360 x i8], [9360 x i8]* %7, i64 0, i64 0
%21 = getelementptr inbounds i8, i8* %20, i64 64
%22 = bitcast i8* %21 to %struct.tcphdr*
%23 = getelementptr inbounds %struct.envio, %struct.envio* %8, i32 0, i32 1
store %struct.tcphdr* %22, %struct.tcphdr** %23
%24 = getelementptr inbounds [9360 x i8], [9360 x i8]* %7, i64 0, i64 0
%25 = getelementptr inbounds i8, i8* %24, i64 64
%26 = getelementptr inbounds i8, i8* %25, i64 104
store i8* %26, i8** %13
%27 = load i8*, i8** %6
store i8* %27, i8** %14
%28 = load i8*, i8** %13
%29 = load i8*, i8** %14
%30 = load i8*, i8** %14
%31 = call i32 @strlen(i8* %30)
%32 = call i32 @strncpy(i8* %28, i8* %29, i32 %31)
%33 = load i32, i32* @PF_INET
%34 = load i8*, i8** %4
%35 = call i32 @inet_pton(i32 %33, i8* %34, i32* %11)
%36 = getelementptr inbounds [9360 x i8], [9360 x i8]* %7, i64 0, i64 0
%37 = call i32 @bzero(i8* %36, i32 64)
%38 = getelementptr inbounds %struct.envio, %struct.envio* %8, i32 0, i32 0
%39 = load %struct.iphdr*, %struct.iphdr** %38
%40 = getelementptr inbounds %struct.iphdr, %struct.iphdr* %39, i32 0, i32 0
store i32 5, i32* %40
%41 = getelementptr inbounds %struct.envio, %struct.envio* %8, i32 0, i32 0
%42 = load %struct.iphdr*, %struct.iphdr** %41
%43 = getelementptr inbounds %struct.iphdr, %struct.iphdr* %42, i32 0, i32 1
store i32 4, i32* %43
%44 = getelementptr inbounds %struct.envio, %struct.envio* %8, i32 0, i32 0
%45 = load %struct.iphdr*, %struct.iphdr** %44
%46 = getelementptr inbounds %struct.iphdr, %struct.iphdr* %45, i32 0, i32 10
store i64 0, i64* %46
%47 = call i8* @htons(i32 9256)
%48 = getelementptr inbounds %struct.envio, %struct.envio* %8, i32 0, i32 0
%49 = load %struct.iphdr*, %struct.iphdr** %48
%50 = getelementptr inbounds %struct.iphdr, %struct.iphdr* %49, i32 0, i32 6
store i8* %47, i8** %50
%51 = load i16, i16* %5
%52 = getelementptr inbounds %struct.envio, %struct.envio* %8, i32 0, i32 0
%53 = load %struct.iphdr*, %struct.iphdr** %52
%54 = getelementptr inbounds %struct.iphdr, %struct.iphdr* %53, i32 0, i32 2
store i16 %51, i16* %54
%55 = getelementptr inbounds %struct.envio, %struct.envio* %8, i32 0, i32 0
%56 = load %struct.iphdr*, %struct.iphdr** %55
%57 = getelementptr inbounds %struct.iphdr, %struct.iphdr* %56, i32 0, i32 9
store i64 0, i64* %57
%58 = getelementptr inbounds %struct.envio, %struct.envio* %8, i32 0, i32 0
%59 = load %struct.iphdr*, %struct.iphdr** %58
%60 = getelementptr inbounds %struct.iphdr, %struct.iphdr* %59, i32 0, i32 3
store i32 255, i32* %60
%61 = load i8*, i8** @IPPROTO_TCP
%62 = getelementptr inbounds %struct.envio, %struct.envio* %8, i32 0, i32 0
%63 = load %struct.iphdr*, %struct.iphdr** %62
%64 = getelementptr inbounds %struct.iphdr, %struct.iphdr* %63, i32 0, i32 8
store i8* %61, i8** %64
%65 = getelementptr inbounds %struct.envio, %struct.envio* %8, i32 0, i32 0
%66 = load %struct.iphdr*, %struct.iphdr** %65
%67 = getelementptr inbounds %struct.iphdr, %struct.iphdr* %66, i32 0, i32 7
store i8* null, i8** %67
%68 = load i32, i32* %11
%69 = getelementptr inbounds %struct.envio, %struct.envio* %8, i32 0, i32 0
%70 = load %struct.iphdr*, %struct.iphdr** %69
%71 = getelementptr inbounds %struct.iphdr, %struct.iphdr* %70, i32 0, i32 4
store i32 %68, i32* %71
%72 = load i16, i16* %5
%73 = getelementptr inbounds %struct.envio, %struct.envio* %8, i32 0, i32 1
%74 = load %struct.tcphdr*, %struct.tcphdr** %73
%75 = getelementptr inbounds %struct.tcphdr, %struct.tcphdr* %74, i32 0, i32 0
store i16 %72, i16* %75
%76 = load i16, i16* %5
%77 = zext i16 %76 to i32
%78 = call i8* @htons(i32 %77)
%79 = getelementptr inbounds %struct.envio, %struct.envio* %8, i32 0, i32 1
%80 = load %struct.tcphdr*, %struct.tcphdr** %79
%81 = getelementptr inbounds %struct.tcphdr, %struct.tcphdr* %80, i32 0, i32 15
store i8* %78, i8** %81
%82 = load i16, i16* %5
%83 = getelementptr inbounds %struct.envio, %struct.envio* %8, i32 0, i32 1
%84 = load %struct.tcphdr*, %struct.tcphdr** %83
%85 = getelementptr inbounds %struct.tcphdr, %struct.tcphdr* %84, i32 0, i32 1
store i16 %82, i16* %85
%86 = getelementptr inbounds %struct.envio, %struct.envio* %8, i32 0, i32 1
%87 = load %struct.tcphdr*, %struct.tcphdr** %86
%88 = getelementptr inbounds %struct.tcphdr, %struct.tcphdr* %87, i32 0, i32 14
store i64 0, i64* %88
%89 = getelementptr inbounds %struct.envio, %struct.envio* %8, i32 0, i32 1
%90 = load %struct.tcphdr*, %struct.tcphdr** %89
%91 = getelementptr inbounds %struct.tcphdr, %struct.tcphdr* %90, i32 0, i32 13
store i64 0, i64* %91
%92 = getelementptr inbounds %struct.envio, %struct.envio* %8, i32 0, i32 1
%93 = load %struct.tcphdr*, %struct.tcphdr** %92
%94 = getelementptr inbounds %struct.tcphdr, %struct.tcphdr* %93, i32 0, i32 2
store i32 5, i32* %94
%95 = getelementptr inbounds %struct.envio, %struct.envio* %8, i32 0, i32 1
%96 = load %struct.tcphdr*, %struct.tcphdr** %95
%97 = getelementptr inbounds %struct.tcphdr, %struct.tcphdr* %96, i32 0, i32 7
store i64 0, i64* %97
%98 = getelementptr inbounds %struct.envio, %struct.envio* %8, i32 0, i32 1
%99 = load %struct.tcphdr*, %struct.tcphdr** %98
%100 = getelementptr inbounds %struct.tcphdr, %struct.tcphdr* %99, i32 0, i32 12
store i64 0, i64* %100
%101 = getelementptr inbounds %struct.envio, %struct.envio* %8, i32 0, i32 1
%102 = load %struct.tcphdr*, %struct.tcphdr** %101
%103 = getelementptr inbounds %struct.tcphdr, %struct.tcphdr* %102, i32 0, i32 11
store i64 0, i64* %103
%104 = call i8* @htons(i32 10666)
%105 = getelementptr inbounds %struct.envio, %struct.envio* %8, i32 0, i32 1
%106 = load %struct.tcphdr*, %struct.tcphdr** %105
%107 = getelementptr inbounds %struct.tcphdr, %struct.tcphdr* %106, i32 0, i32 10
store i8* %104, i8** %107
%108 = getelementptr inbounds %struct.envio, %struct.envio* %8, i32 0, i32 1
%109 = load %struct.tcphdr*, %struct.tcphdr** %108
%110 = getelementptr inbounds %struct.tcphdr, %struct.tcphdr* %109, i32 0, i32 6
store i8* null, i8** %110
%111 = getelementptr inbounds %struct.envio, %struct.envio* %8, i32 0, i32 1
%112 = load %struct.tcphdr*, %struct.tcphdr** %111
%113 = getelementptr inbounds %struct.tcphdr, %struct.tcphdr* %112, i32 0, i32 3
store i32 1, i32* %113
%114 = getelementptr inbounds %struct.envio, %struct.envio* %8, i32 0, i32 1
%115 = load %struct.tcphdr*, %struct.tcphdr** %114
%116 = getelementptr inbounds %struct.tcphdr, %struct.tcphdr* %115, i32 0, i32 9
store i64 0, i64* %116
%117 = getelementptr inbounds %struct.envio, %struct.envio* %8, i32 0, i32 1
%118 = load %struct.tcphdr*, %struct.tcphdr** %117
%119 = getelementptr inbounds %struct.tcphdr, %struct.tcphdr* %118, i32 0, i32 8
store i64 0, i64* %119
%120 = getelementptr inbounds %struct.envio, %struct.envio* %8, i32 0, i32 1
%121 = load %struct.tcphdr*, %struct.tcphdr** %120
%122 = getelementptr inbounds %struct.tcphdr, %struct.tcphdr* %121, i32 0, i32 4
store i32 1, i32* %122
%123 = getelementptr inbounds %struct.envio, %struct.envio* %8, i32 0, i32 1
%124 = load %struct.tcphdr*, %struct.tcphdr** %123
%125 = getelementptr inbounds %struct.tcphdr, %struct.tcphdr* %124, i32 0, i32 5
store i32 1, i32* %125
%126 = getelementptr inbounds %struct.envio, %struct.envio* %8, i32 0, i32 1
%127 = load %struct.tcphdr*, %struct.tcphdr** %126
%128 = getelementptr inbounds %struct.tcphdr, %struct.tcphdr* %127, i32 0, i32 7
store i64 0, i64* %128
%129 = load i32, i32* @AF_INET
%130 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %10, i32 0, i32 2
store i32 %129, i32* %130
%131 = getelementptr inbounds %struct.envio, %struct.envio* %8, i32 0, i32 1
%132 = load %struct.tcphdr*, %struct.tcphdr** %131
%133 = getelementptr inbounds %struct.tcphdr, %struct.tcphdr* %132, i32 0, i32 0
%134 = load i16, i16* %133
%135 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %10, i32 0, i32 0
store i16 %134, i16* %135
%136 = getelementptr inbounds %struct.envio, %struct.envio* %8, i32 0, i32 0
%137 = load %struct.iphdr*, %struct.iphdr** %136
%138 = getelementptr inbounds %struct.iphdr, %struct.iphdr* %137, i32 0, i32 4
%139 = load i32, i32* %138
%140 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %10, i32 0, i32 1
%141 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %140, i32 0, i32 0
store i32 %139, i32* %141
%142 = load i32, i32* @AF_INET
%143 = load i32, i32* @SOCK_RAW
%144 = load i32, i32* @IPPROTO_RAW
%145 = call i32 @socket(i32 %142, i32 %143, i32 %144)
store i32 %145, i32* %9
%146 = load i32, i32* %9
%147 = icmp slt i32 %146, 0
br i1 %147, label %148, label %151
148: ; preds = %3
%149 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%150 = call i32 @exit(i32 1)
unreachable
151: ; preds = %3
%152 = getelementptr inbounds %struct.envio, %struct.envio* %8, i32 0, i32 1
%153 = load %struct.tcphdr*, %struct.tcphdr** %152
%154 = getelementptr inbounds %struct.tcphdr, %struct.tcphdr* %153, i32 0, i32 0
%155 = load i16, i16* %154
%156 = add i16 %155, 1
store i16 %156, i16* %154
%157 = getelementptr inbounds %struct.envio, %struct.envio* %8, i32 0, i32 0
%158 = load %struct.iphdr*, %struct.iphdr** %157
%159 = getelementptr inbounds %struct.iphdr, %struct.iphdr* %158, i32 0, i32 2
%160 = load i16, i16* %159
%161 = add i16 %160, 1
store i16 %161, i16* %159
%162 = getelementptr inbounds %struct.envio, %struct.envio* %8, i32 0, i32 1
%163 = load %struct.tcphdr*, %struct.tcphdr** %162
%164 = getelementptr inbounds %struct.tcphdr, %struct.tcphdr* %163, i32 0, i32 1
%165 = load i16, i16* %164
%166 = add i16 %165, 1
store i16 %166, i16* %164
%167 = getelementptr inbounds %struct.envio, %struct.envio* %8, i32 0, i32 1
%168 = load %struct.tcphdr*, %struct.tcphdr** %167
%169 = getelementptr inbounds %struct.tcphdr, %struct.tcphdr* %168, i32 0, i32 6
store i8* null, i8** %169
%170 = getelementptr inbounds %struct.envio, %struct.envio* %8, i32 0, i32 0
%171 = load %struct.iphdr*, %struct.iphdr** %170
%172 = getelementptr inbounds %struct.iphdr, %struct.iphdr* %171, i32 0, i32 7
store i8* null, i8** %172
%173 = getelementptr inbounds %struct.envio, %struct.envio* %8, i32 0, i32 0
%174 = bitcast %struct.iphdr** %173 to i16*
%175 = call i8* @in_cksum(i16* %174, i32 64)
%176 = getelementptr inbounds %struct.envio, %struct.envio* %8, i32 0, i32 0
%177 = load %struct.iphdr*, %struct.iphdr** %176
%178 = getelementptr inbounds %struct.iphdr, %struct.iphdr* %177, i32 0, i32 7
store i8* %175, i8** %178
%179 = getelementptr inbounds %struct.envio, %struct.envio* %8, i32 0, i32 0
%180 = load %struct.iphdr*, %struct.iphdr** %179
%181 = getelementptr inbounds %struct.iphdr, %struct.iphdr* %180, i32 0, i32 5
%182 = load i32, i32* %181
%183 = getelementptr inbounds %struct.pseudo_header, %struct.pseudo_header* %12, i32 0, i32 0
store i32 %182, i32* %183
%184 = getelementptr inbounds %struct.envio, %struct.envio* %8, i32 0, i32 0
%185 = load %struct.iphdr*, %struct.iphdr** %184
%186 = getelementptr inbounds %struct.iphdr, %struct.iphdr* %185, i32 0, i32 4
%187 = load i32, i32* %186
%188 = getelementptr inbounds %struct.pseudo_header, %struct.pseudo_header* %12, i32 0, i32 1
store i32 %187, i32* %188
%189 = load i8*, i8** @IPPROTO_TCP
%190 = ptrtoint i8* %189 to i8
%191 = getelementptr inbounds %struct.pseudo_header, %struct.pseudo_header* %12, i32 0, i32 3
store i8 %190, i8* %191
%192 = call i8* @htons(i32 9296)
%193 = ptrtoint i8* %192 to i16
%194 = getelementptr inbounds %struct.pseudo_header, %struct.pseudo_header* %12, i32 0, i32 4
store i16 %193, i16* %194
%195 = load i8*, i8** %13
%196 = getelementptr inbounds %struct.pseudo_header, %struct.pseudo_header* %12, i32 0, i32 5
store i8* %195, i8** %196
%197 = bitcast %struct.pseudo_header* %12 to i16*
%198 = call i8* @in_cksum(i16* %197, i32 9320)
%199 = getelementptr inbounds %struct.envio, %struct.envio* %8, i32 0, i32 1
%200 = load %struct.tcphdr*, %struct.tcphdr** %199
%201 = getelementptr inbounds %struct.tcphdr, %struct.tcphdr* %200, i32 0, i32 6
store i8* %198, i8** %201
store i32 1, i32* %15
store i32* %15, i32** %16
%202 = load i32, i32* %9
%203 = load i32, i32* @IPPROTO_IP
%204 = load i32, i32* @IP_HDRINCL
%205 = load i32*, i32** %16
%206 = call i64 @setsockopt(i32 %202, i32 %203, i32 %204, i32* %205, i32 4)
%207 = icmp slt i64 %206, 0
br i1 %207, label %208, label %210
208: ; preds = %151
%209 = call i32 @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.1, i64 0, i64 0))
br label %210
210: ; preds = %208, %151
%211 = load i32, i32* %9
%212 = getelementptr inbounds [9360 x i8], [9360 x i8]* %7, i64 0, i64 0
%213 = getelementptr inbounds %struct.envio, %struct.envio* %8, i32 0, i32 0
%214 = load %struct.iphdr*, %struct.iphdr** %213
%215 = getelementptr inbounds %struct.iphdr, %struct.iphdr* %214, i32 0, i32 6
%216 = load i8*, i8** %215
%217 = call i32 @ntohs(i8* %216)
%218 = bitcast %struct.sockaddr_in* %10 to %struct.sockaddr*
%219 = call i64 @sendto(i32 %211, i8* %212, i32 %217, i32 0, %struct.sockaddr* %218, i32 12)
%220 = icmp slt i64 %219, 0
br i1 %220, label %221, label %228
221: ; preds = %210
%222 = load i32, i32* @stderr
%223 = call i32 @fprintf(i32 %222, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0))
%224 = call i32 @perror(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
%225 = load i32, i32* %9
%226 = call i32 @close(i32 %225)
%227 = call i32 @exit(i32 1)
unreachable
228: ; preds = %210
%229 = load i32, i32* %9
%230 = call i32 @close(i32 %229)
ret void
}

LLVM IR (-O2):
%struct.envio = type { %struct.iphdr*, %struct.tcphdr* }
%struct.iphdr = type { i32, i32, i16, i32, i32, i32, i8*, i8*, i8*, i64, i64 }
%struct.tcphdr = type { i16, i16, i32, i32, i32, i32, i8*, i64, i64, i64, i8*, i64, i64, i64, i64, i8* }
%struct.sockaddr_in = type { i16, %struct.TYPE_2__, i32 }
%struct.TYPE_2__ = type { i32 }
%struct.pseudo_header = type { i32, i32, i8, i8, i16, i8* }
%struct.sockaddr = type { i32 }
@PF_INET = global i32 0
@IPPROTO_TCP = global i8* null
@AF_INET = global i32 0
@SOCK_RAW = global i32 0
@IPPROTO_RAW = global i32 0
@.str = [7 x i8] c"socket\00"
@IPPROTO_IP = global i32 0
@IP_HDRINCL = global i32 0
@stderr = global i32 0
@.str.2 = [17 x i8] c"sendto error...\0A\00"
@.str.3 = [4 x i8] c"ops\00"
@str = [29 x i8] c"Warning: Cannot set HDRINCL!\00"
define void @fazerpacote(i8* %0, i16 zeroext %1, i8* %2) {
%4 = alloca [9360 x i8]
%5 = alloca %struct.envio
%6 = alloca %struct.sockaddr_in
%7 = alloca i32
%8 = alloca %struct.pseudo_header
%9 = alloca i32
%10 = getelementptr inbounds [9360 x i8], [9360 x i8]* %4, i64 0, i64 0
%11 = bitcast %struct.envio* %5 to i8*
%12 = bitcast %struct.sockaddr_in* %6 to i8*
%13 = bitcast i32* %7 to i8*
%14 = getelementptr inbounds %struct.envio, %struct.envio* %5, i64 0, i32 0
%15 = bitcast %struct.envio* %5 to [9360 x i8]**
store [9360 x i8]* %4, [9360 x i8]** %15
%16 = getelementptr inbounds [9360 x i8], [9360 x i8]* %4, i64 0, i64 64
%17 = getelementptr inbounds %struct.envio, %struct.envio* %5, i64 0, i32 1
%18 = bitcast %struct.tcphdr** %17 to i8**
store i8* %16, i8** %18
%19 = bitcast %struct.pseudo_header* %8 to i8*
%20 = getelementptr inbounds [9360 x i8], [9360 x i8]* %4, i64 0, i64 168
%21 = call i32 @strlen(i8* %2)
%22 = call i32 @strncpy(i8* %20, i8* %2, i32 %21)
%23 = load i32, i32* @PF_INET
%24 = call i32 @inet_pton(i32 %23, i8* %0, i32* %7)
%25 = call i32 @bzero(i8* %10, i32 64)
%26 = bitcast [9360 x i8]* %4 to i32*
store i32 5, i32* %26
%27 = getelementptr inbounds [9360 x i8], [9360 x i8]* %4, i64 0, i64 4
%28 = bitcast i8* %27 to i32*
store i32 4, i32* %28
%29 = getelementptr inbounds [9360 x i8], [9360 x i8]* %4, i64 0, i64 56
%30 = bitcast i8* %29 to i64*
store i64 0, i64* %30
%31 = call i8* @htons(i32 9256)
%32 = getelementptr inbounds [9360 x i8], [9360 x i8]* %4, i64 0, i64 24
%33 = bitcast i8* %32 to i8**
store i8* %31, i8** %33
%34 = getelementptr inbounds [9360 x i8], [9360 x i8]* %4, i64 0, i64 8
%35 = bitcast i8* %34 to i16*
store i16 %1, i16* %35
%36 = getelementptr inbounds [9360 x i8], [9360 x i8]* %4, i64 0, i64 48
%37 = bitcast i8* %36 to i64*
store i64 0, i64* %37
%38 = getelementptr inbounds [9360 x i8], [9360 x i8]* %4, i64 0, i64 12
%39 = bitcast i8* %38 to i32*
store i32 255, i32* %39
%40 = load i8*, i8** @IPPROTO_TCP
%41 = getelementptr inbounds [9360 x i8], [9360 x i8]* %4, i64 0, i64 40
%42 = bitcast i8* %41 to i8**
store i8* %40, i8** %42
%43 = getelementptr inbounds [9360 x i8], [9360 x i8]* %4, i64 0, i64 32
%44 = bitcast i8* %43 to i8**
store i8* null, i8** %44
%45 = load i32, i32* %7
%46 = getelementptr inbounds [9360 x i8], [9360 x i8]* %4, i64 0, i64 16
%47 = bitcast i8* %46 to i32*
store i32 %45, i32* %47
%48 = bitcast i8* %16 to i16*
store i16 %1, i16* %48
%49 = zext i16 %1 to i32
%50 = call i8* @htons(i32 %49)
%51 = getelementptr inbounds [9360 x i8], [9360 x i8]* %4, i64 0, i64 160
%52 = bitcast i8* %51 to i8**
store i8* %50, i8** %52
%53 = getelementptr inbounds [9360 x i8], [9360 x i8]* %4, i64 0, i64 66
%54 = bitcast i8* %53 to i16*
store i16 %1, i16* %54
%55 = getelementptr inbounds [9360 x i8], [9360 x i8]* %4, i64 0, i64 144
%56 = getelementptr inbounds [9360 x i8], [9360 x i8]* %4, i64 0, i64 68
%57 = bitcast i8* %56 to i32*
store i32 5, i32* %57
%58 = getelementptr inbounds [9360 x i8], [9360 x i8]* %4, i64 0, i64 96
%59 = bitcast i8* %58 to i64*
store i64 0, i64* %59
%60 = getelementptr inbounds [9360 x i8], [9360 x i8]* %4, i64 0, i64 128
%61 = call i8* @htons(i32 10666)
%62 = getelementptr inbounds [9360 x i8], [9360 x i8]* %4, i64 0, i64 120
%63 = bitcast i8* %62 to i8**
store i8* %61, i8** %63
%64 = getelementptr inbounds [9360 x i8], [9360 x i8]* %4, i64 0, i64 88
%65 = bitcast i8* %64 to i8**
store i8* null, i8** %65
%66 = getelementptr inbounds [9360 x i8], [9360 x i8]* %4, i64 0, i64 72
%67 = bitcast i8* %66 to i32*
store i32 1, i32* %67
%68 = getelementptr inbounds [9360 x i8], [9360 x i8]* %4, i64 0, i64 104
%69 = getelementptr inbounds [9360 x i8], [9360 x i8]* %4, i64 0, i64 76
%70 = bitcast i8* %69 to i32*
store i32 1, i32* %70
%71 = getelementptr inbounds [9360 x i8], [9360 x i8]* %4, i64 0, i64 80
%72 = bitcast i8* %71 to i32*
store i32 1, i32* %72
store i64 0, i64* %59
%73 = load i32, i32* @AF_INET
%74 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %6, i64 0, i32 2
store i32 %73, i32* %74
%75 = load i16, i16* %48
%76 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %6, i64 0, i32 0
store i16 %75, i16* %76
%77 = load i32, i32* %47
%78 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %6, i64 0, i32 1, i32 0
store i32 %77, i32* %78
%79 = load i32, i32* @SOCK_RAW
%80 = load i32, i32* @IPPROTO_RAW
%81 = call i32 @socket(i32 %73, i32 %79, i32 %80)
%82 = icmp slt i32 %81, 0
br i1 %82, label %83, label %86
83: ; preds = %3
%84 = call i32 @perror(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0))
%85 = call i32 @exit(i32 1)
unreachable
86: ; preds = %3
%87 = load i16, i16* %48
%88 = add i16 %87, 1
store i16 %88, i16* %48
%89 = load i16, i16* %35
%90 = add i16 %89, 1
store i16 %90, i16* %35
%91 = load i16, i16* %54
%92 = add i16 %91, 1
store i16 %92, i16* %54
store i8* null, i8** %65
store i8* null, i8** %44
%93 = bitcast %struct.envio* %5 to i16*
%94 = call i8* @in_cksum(i16* %93, i32 64)
%95 = load %struct.iphdr*, %struct.iphdr** %14
%96 = getelementptr inbounds %struct.iphdr, %struct.iphdr* %95, i64 0, i32 7
store i8* %94, i8** %96
%97 = getelementptr inbounds %struct.iphdr, %struct.iphdr* %95, i64 0, i32 5
%98 = load i32, i32* %97
%99 = getelementptr inbounds %struct.pseudo_header, %struct.pseudo_header* %8, i64 0, i32 0
store i32 %98, i32* %99
%100 = getelementptr inbounds %struct.iphdr, %struct.iphdr* %95, i64 0, i32 4
%101 = load i32, i32* %100
%102 = getelementptr inbounds %struct.pseudo_header, %struct.pseudo_header* %8, i64 0, i32 1
store i32 %101, i32* %102
%103 = load i8*, i8** @IPPROTO_TCP
%104 = ptrtoint i8* %103 to i64
%105 = trunc i64 %104 to i8
%106 = getelementptr inbounds %struct.pseudo_header, %struct.pseudo_header* %8, i64 0, i32 3
store i8 %105, i8* %106
%107 = call i8* @htons(i32 9296)
%108 = ptrtoint i8* %107 to i64
%109 = trunc i64 %108 to i16
%110 = getelementptr inbounds %struct.pseudo_header, %struct.pseudo_header* %8, i64 0, i32 4
store i16 %109, i16* %110
%111 = getelementptr inbounds %struct.pseudo_header, %struct.pseudo_header* %8, i64 0, i32 5
store i8* %20, i8** %111
%112 = bitcast %struct.pseudo_header* %8 to i16*
%113 = call i8* @in_cksum(i16* %112, i32 9320)
%114 = load %struct.tcphdr*, %struct.tcphdr** %17
%115 = getelementptr inbounds %struct.tcphdr, %struct.tcphdr* %114, i64 0, i32 6
store i8* %113, i8** %115
%116 = bitcast i32* %9 to i8*
store i32 1, i32* %9
%117 = load i32, i32* @IPPROTO_IP
%118 = load i32, i32* @IP_HDRINCL
%119 = call i64 @setsockopt(i32 %81, i32 %117, i32 %118, i32* %9, i32 4)
%120 = icmp slt i64 %119, 0
br i1 %120, label %121, label %123
121: ; preds = %86
%122 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str, i64 0, i64 0))
br label %123
123: ; preds = %121, %86
%124 = load %struct.iphdr*, %struct.iphdr** %14
%125 = getelementptr inbounds %struct.iphdr, %struct.iphdr* %124, i64 0, i32 6
%126 = load i8*, i8** %125
%127 = call i32 @ntohs(i8* %126)
%128 = bitcast %struct.sockaddr_in* %6 to %struct.sockaddr*
%129 = call i64 @sendto(i32 %81, i8* %10, i32 %127, i32 0, %struct.sockaddr* %128, i32 12)
%130 = icmp slt i64 %129, 0
br i1 %130, label %131, label %137
131: ; preds = %123
%132 = load i32, i32* @stderr
%133 = call i32 @fprintf(i32 %132, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0))
%134 = call i32 @perror(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0))
%135 = call i32 @close(i32 %81)
%136 = call i32 @exit(i32 1)
unreachable
137: ; preds = %123
%138 = call i32 @close(i32 %81)
ret void
}