#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 {
  int /*<<< orphan*/ check;
  void *dest;
};
struct TYPE_2__ {
  void *s_addr;
};
struct sockaddr_in {
  TYPE_1__ sin_addr;
  void *sin_port;
  int /*<<< orphan*/ sin_family;
};
struct sockaddr {
  int dummy;
};
struct iphdr {
  int tot_len;
  void *daddr;
  void *saddr;
};
typedef int /*<<< orphan*/ sin;
typedef int /*<<< orphan*/ optVal;

/* Variables and functions */
int /*<<< orphan*/ AF_INET;
int /*<<< orphan*/ IPPROTO_IP;
int /*<<< orphan*/ IPPROTO_TCP;
int /*<<< orphan*/ IP_HDRINCL;
int /*<<< orphan*/ SOCK_RAW;
int /*<<< orphan*/ csum(char *, int);
int errno;
void *htons(int);
void *inet_addr(char *);
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, ...);
scalar_t__ sendto(int, char *, int, int /*<<< orphan*/, struct sockaddr *, int);
scalar_t__ setsockopt(int, int /*<<< orphan*/, int /*<<< orphan*/, int const *,
                      int);
int /*<<< orphan*/ setupIpHeader(struct iphdr *);
int /*<<< orphan*/ setupTcpHeader(struct tcphdr *);
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int main(void) {
  int s;
  int port;
  struct sockaddr_in sin;
  char buff[4096];
  char ipSource[15];
  char ipDest[15];
  struct iphdr *ipH;
  struct tcphdr *tcpH;
  printf("[?]IP source: ");
  scanf("%s", ipSource);
  printf("[?]IP destination: ");
  scanf("%s", ipDest);
  printf("[?]Port: ");
  scanf("%d", &port);
  s = socket(AF_INET, SOCK_RAW, IPPROTO_TCP);
  if (s < 0) {
    printf("[-]Error to open socket.\n");
    return 1;
  }
  sin.sin_family = AF_INET;
  sin.sin_port = htons(port);
  sin.sin_addr.s_addr = inet_addr(ipDest);
  memset(buff, 0, 4096);
  ipH = (struct iphdr *)buff;
  tcpH = (struct tcphdr *)(buff + sizeof(struct iphdr));
  setupIpHeader(ipH);
  setupTcpHeader(tcpH);
  tcpH->dest = htons(port);
  ipH->saddr = inet_addr(ipSource);
  ipH->daddr = inet_addr(ipDest);
  tcpH->check = csum(buff, ipH->tot_len >> 1);
  const int optVal = 1;
  if (setsockopt(s, IPPROTO_IP, IP_HDRINCL, &optVal, sizeof(optVal)) < 0) {
    printf("[-]Error to setsockopt to the socket.\n");
    return 1;
  }
  while (1) {
    if (sendto(s, buff, ipH->tot_len, 0, (struct sockaddr *)&sin, sizeof(sin)) <
        0) {
      printf("[-]Error to sendto : %d.\n", errno);
      return 1;
    }
  }
  printf("\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1070,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe37(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    -0x103f(%rbp),%rsi
lea    0xe31(%rip),%rdi
mov    $0x0,%al
call   10a0 <scanf@plt>
lea    0xe26(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    -0x104e(%rbp),%rsi
lea    0xe0e(%rip),%rdi
mov    $0x0,%al
call   10a0 <scanf@plt>
lea    0xe17(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xe13(%rip),%rdi
lea    -0xc(%rbp),%rsi
mov    $0x0,%al
call   10a0 <scanf@plt>
mov    0x2db1(%rip),%rax
mov    (%rax),%edi
mov    0x2da0(%rip),%rax
mov    (%rax),%esi
mov    0x2d87(%rip),%rax
mov    (%rax),%edx
call   10d0 <socket@plt>
mov    %eax,-0x8(%rbp)
cmpl   $0x0,-0x8(%rbp)
jge    126f <main+0xbf>
lea    0xdd7(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    13ff <main+0x24f>
mov    0x2d6a(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
mov    -0xc(%rbp),%edi
call   1050 <htons@plt>
mov    %rax,-0x20(%rbp)
lea    -0x104e(%rbp),%rdi
call   1090 <inet_addr@plt>
mov    %rax,-0x28(%rbp)
lea    -0x1030(%rbp),%rdi
xor    %esi,%esi
mov    $0x1000,%edx
call   1070 <memset@plt>
lea    -0x1030(%rbp),%rax
mov    %rax,-0x1058(%rbp)
lea    -0x1030(%rbp),%rax
add    $0x18,%rax
mov    %rax,-0x1060(%rbp)
mov    -0x1058(%rbp),%rdi
call   10c0 <setupIpHeader@plt>
mov    -0x1060(%rbp),%rdi
call   10b0 <setupTcpHeader@plt>
mov    -0xc(%rbp),%edi
call   1050 <htons@plt>
mov    %rax,%rcx
mov    -0x1060(%rbp),%rax
mov    %rcx,0x8(%rax)
lea    -0x103f(%rbp),%rdi
call   1090 <inet_addr@plt>
mov    %rax,%rcx
mov    -0x1058(%rbp),%rax
mov    %rcx,0x10(%rax)
lea    -0x104e(%rbp),%rdi
call   1090 <inet_addr@plt>
mov    %rax,%rcx
mov    -0x1058(%rbp),%rax
mov    %rcx,0x8(%rax)
lea    -0x1030(%rbp),%rdi
mov    -0x1058(%rbp),%rax
mov    (%rax),%esi
sar    $0x1,%esi
call   1040 <csum@plt>
mov    %eax,%ecx
mov    -0x1060(%rbp),%rax
mov    %ecx,(%rax)
movl   $0x1,-0x1064(%rbp)
mov    -0x8(%rbp),%edi
mov    0x2c6d(%rip),%rax
mov    (%rax),%esi
mov    0x2c84(%rip),%rax
mov    (%rax),%edx
lea    -0x1064(%rbp),%rcx
mov    $0x4,%r8d
call   1030 <setsockopt@plt>
cmp    $0x0,%rax
jge    13a4 <main+0x1f4>
lea    0xcbc(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    13ff <main+0x24f>
jmp    13a9 <main+0x1f9>
mov    -0x8(%rbp),%edi
lea    -0x1030(%rbp),%rsi
mov    -0x1058(%rbp),%rax
mov    (%rax),%edx
lea    -0x28(%rbp),%r8
xor    %ecx,%ecx
mov    $0x18,%r9d
call   1080 <sendto@plt>
cmp    $0x0,%rax
jge    13fa <main+0x24a>
mov    0x2bda(%rip),%rax
mov    (%rax),%esi
lea    0xc8d(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x1,-0x4(%rbp)
jmp    13ff <main+0x24f>
jmp    13a9 <main+0x1f9>
mov    -0x4(%rbp),%eax
add    $0x1070,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x1040,%rsp
lea    0xe2a(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
lea    0xe2b(%rip),%rbx
lea    0x31(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   10b0 <scanf@plt>
lea    0xe18(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
lea    0x22(%rsp),%rsi
mov    %rbx,%rdi
xor    %eax,%eax
call   10b0 <scanf@plt>
lea    0xe0f(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
lea    0xe0b(%rip),%rdi
mov    %rsp,%rsi
xor    %eax,%eax
call   10b0 <scanf@plt>
mov    0x2daa(%rip),%rbx
mov    (%rbx),%edi
mov    0x2d99(%rip),%rax
mov    (%rax),%esi
mov    0x2d80(%rip),%rax
mov    (%rax),%edx
call   10e0 <socket@plt>
test   %eax,%eax
js     1358 <main+0x198>
mov    %eax,%r12d
mov    (%rbx),%eax
mov    %eax,0x18(%rsp)
mov    (%rsp),%edi
call   1060 <htons@plt>
mov    %rax,0x10(%rsp)
lea    0x22(%rsp),%r15
mov    %r15,%rdi
call   10a0 <inet_addr@plt>
mov    %rax,0x8(%rsp)
lea    0x40(%rsp),%r14
mov    %r14,%rdi
xor    %esi,%esi
mov    $0x1000,%edx
call   1080 <memset@plt>
lea    0x58(%rsp),%rbx
mov    %r14,%rdi
call   10d0 <setupIpHeader@plt>
mov    %rbx,%rdi
call   10c0 <setupTcpHeader@plt>
mov    (%rsp),%edi
call   1060 <htons@plt>
mov    %rax,0x60(%rsp)
lea    0x31(%rsp),%rdi
call   10a0 <inet_addr@plt>
mov    %rax,0x50(%rsp)
mov    %r15,%rdi
call   10a0 <inet_addr@plt>
mov    %rax,0x48(%rsp)
mov    0x40(%rsp),%esi
sar    %esi
mov    %r14,%rdi
call   1050 <csum@plt>
mov    %eax,0x58(%rsp)
movl   $0x1,0x4(%rsp)
mov    0x2cde(%rip),%rax
mov    (%rax),%esi
mov    0x2cf5(%rip),%rax
mov    (%rax),%edx
lea    0x4(%rsp),%rcx
mov    %r12d,%edi
mov    $0x4,%r8d
call   1040 <setsockopt@plt>
test   %rax,%rax
js     1361 <main+0x1a1>
lea    0x40(%rsp),%rbx
lea    0x8(%rsp),%rbp
nop
mov    0x40(%rsp),%edx
mov    %r12d,%edi
mov    %rbx,%rsi
xor    %ecx,%ecx
mov    %rbp,%r8
mov    $0x18,%r9d
call   1090 <sendto@plt>
test   %rax,%rax
jns    1320 <main+0x160>
mov    0x2c72(%rip),%rax
mov    (%rax),%esi
lea    0xce4(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
jmp    136d <main+0x1ad>
lea    0xd14(%rip),%rdi
jmp    1368 <main+0x1a8>
lea    0xce5(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%eax
add    $0x1040,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.sockaddr_in = type { %struct.TYPE_2__, i8*, i32 }
%struct.TYPE_2__ = type { i8* }
%struct.iphdr = type { i32, i8*, i8* }
%struct.tcphdr = type { i32, i8* }
%struct.sockaddr = type { i32 }
@.str = [15 x i8] c"[?]IP source: \00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [20 x i8] c"[?]IP destination: \00"
@.str.3 = [10 x i8] c"[?]Port: \00"
@.str.4 = [3 x i8] c"%d\00"
@AF_INET = global i32 0
@SOCK_RAW = global i32 0
@IPPROTO_TCP = global i32 0
@.str.5 = [26 x i8] c"[-]Error to open socket.\0A\00"
@IPPROTO_IP = global i32 0
@IP_HDRINCL = global i32 0
@.str.6 = [39 x i8] c"[-]Error to setsockopt to the socket.\0A\00"
@.str.7 = [26 x i8] c"[-]Error to sendto : %d.\0A\00"
@errno = global i32 0
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca %struct.sockaddr_in
%5 = alloca [4096 x i8]
%6 = alloca [15 x i8]
%7 = alloca [15 x i8]
%8 = alloca %struct.iphdr*
%9 = alloca %struct.tcphdr*
%10 = alloca i32
store i32 0, i32* %1
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%12 = getelementptr inbounds [15 x i8], [15 x i8]* %6, i64 0, i64 0
%13 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %12)
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0))
%15 = getelementptr inbounds [15 x i8], [15 x i8]* %7, i64 0, i64 0
%16 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %15)
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0))
%18 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32* %3)
%19 = load i32, i32* @AF_INET
%20 = load i32, i32* @SOCK_RAW
%21 = load i32, i32* @IPPROTO_TCP
%22 = call i32 @socket(i32 %19, i32 %20, i32 %21)
store i32 %22, i32* %2
%23 = load i32, i32* %2
%24 = icmp slt i32 %23, 0
br i1 %24, label %25, label %27
25: ; preds = %0
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.5, i64 0, i64 0))
store i32 1, i32* %1
br label %89
27: ; preds = %0
%28 = load i32, i32* @AF_INET
%29 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %4, i32 0, i32 2
store i32 %28, i32* %29
%30 = load i32, i32* %3
%31 = call i8* @htons(i32 %30)
%32 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %4, i32 0, i32 1
store i8* %31, i8** %32
%33 = getelementptr inbounds [15 x i8], [15 x i8]* %7, i64 0, i64 0
%34 = call i8* @inet_addr(i8* %33)
%35 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %4, i32 0, i32 0
%36 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %35, i32 0, i32 0
store i8* %34, i8** %36
%37 = getelementptr inbounds [4096 x i8], [4096 x i8]* %5, i64 0, i64 0
%38 = call i32 @memset(i8* %37, i32 0, i32 4096)
%39 = getelementptr inbounds [4096 x i8], [4096 x i8]* %5, i64 0, i64 0
%40 = bitcast i8* %39 to %struct.iphdr*
store %struct.iphdr* %40, %struct.iphdr** %8
%41 = getelementptr inbounds [4096 x i8], [4096 x i8]* %5, i64 0, i64 0
%42 = getelementptr inbounds i8, i8* %41, i64 24
%43 = bitcast i8* %42 to %struct.tcphdr*
store %struct.tcphdr* %43, %struct.tcphdr** %9
%44 = load %struct.iphdr*, %struct.iphdr** %8
%45 = call i32 @setupIpHeader(%struct.iphdr* %44)
%46 = load %struct.tcphdr*, %struct.tcphdr** %9
%47 = call i32 @setupTcpHeader(%struct.tcphdr* %46)
%48 = load i32, i32* %3
%49 = call i8* @htons(i32 %48)
%50 = load %struct.tcphdr*, %struct.tcphdr** %9
%51 = getelementptr inbounds %struct.tcphdr, %struct.tcphdr* %50, i32 0, i32 1
store i8* %49, i8** %51
%52 = getelementptr inbounds [15 x i8], [15 x i8]* %6, i64 0, i64 0
%53 = call i8* @inet_addr(i8* %52)
%54 = load %struct.iphdr*, %struct.iphdr** %8
%55 = getelementptr inbounds %struct.iphdr, %struct.iphdr* %54, i32 0, i32 2
store i8* %53, i8** %55
%56 = getelementptr inbounds [15 x i8], [15 x i8]* %7, i64 0, i64 0
%57 = call i8* @inet_addr(i8* %56)
%58 = load %struct.iphdr*, %struct.iphdr** %8
%59 = getelementptr inbounds %struct.iphdr, %struct.iphdr* %58, i32 0, i32 1
store i8* %57, i8** %59
%60 = getelementptr inbounds [4096 x i8], [4096 x i8]* %5, i64 0, i64 0
%61 = load %struct.iphdr*, %struct.iphdr** %8
%62 = getelementptr inbounds %struct.iphdr, %struct.iphdr* %61, i32 0, i32 0
%63 = load i32, i32* %62
%64 = ashr i32 %63, 1
%65 = call i32 @csum(i8* %60, i32 %64)
%66 = load %struct.tcphdr*, %struct.tcphdr** %9
%67 = getelementptr inbounds %struct.tcphdr, %struct.tcphdr* %66, i32 0, i32 0
store i32 %65, i32* %67
store i32 1, i32* %10
%68 = load i32, i32* %2
%69 = load i32, i32* @IPPROTO_IP
%70 = load i32, i32* @IP_HDRINCL
%71 = call i64 @setsockopt(i32 %68, i32 %69, i32 %70, i32* %10, i32 4)
%72 = icmp slt i64 %71, 0
br i1 %72, label %73, label %75
73: ; preds = %27
%74 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.6, i64 0, i64 0))
store i32 1, i32* %1
br label %89
75: ; preds = %27
br label %76
76: ; preds = %75, %88
%77 = load i32, i32* %2
%78 = getelementptr inbounds [4096 x i8], [4096 x i8]* %5, i64 0, i64 0
%79 = load %struct.iphdr*, %struct.iphdr** %8
%80 = getelementptr inbounds %struct.iphdr, %struct.iphdr* %79, i32 0, i32 0
%81 = load i32, i32* %80
%82 = bitcast %struct.sockaddr_in* %4 to %struct.sockaddr*
%83 = call i64 @sendto(i32 %77, i8* %78, i32 %81, i32 0, %struct.sockaddr* %82, i32 24)
%84 = icmp slt i64 %83, 0
br i1 %84, label %85, label %88
85: ; preds = %76
%86 = load i32, i32* @errno
%87 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.7, i64 0, i64 0), i32 %86)
store i32 1, i32* %1
br label %89
88: ; preds = %76
br label %76
89: ; preds = %85, %73, %25
%90 = load i32, i32* %1
ret i32 %90
}

LLVM IR (-O2):
%struct.sockaddr_in = type { %struct.TYPE_2__, i8*, i32 }
%struct.TYPE_2__ = type { i8* }
%struct.iphdr = type { i32, i8*, i8* }
%struct.tcphdr = type { i32, i8* }
%struct.sockaddr = type { i32 }
@.str = [15 x i8] c"[?]IP source: \00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [20 x i8] c"[?]IP destination: \00"
@.str.3 = [10 x i8] c"[?]Port: \00"
@.str.4 = [3 x i8] c"%d\00"
@AF_INET = global i32 0
@SOCK_RAW = global i32 0
@IPPROTO_TCP = global i32 0
@IPPROTO_IP = global i32 0
@IP_HDRINCL = global i32 0
@.str.7 = [26 x i8] c"[-]Error to sendto : %d.\0A\00"
@errno = global i32 0
@str = [38 x i8] c"[-]Error to setsockopt to the socket.\00"
@str.8 = [25 x i8] c"[-]Error to open socket.\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.sockaddr_in
%3 = alloca [4096 x i8]
%4 = alloca [15 x i8]
%5 = alloca [15 x i8]
%6 = alloca i32
%7 = bitcast i32* %1 to i8*
%8 = bitcast %struct.sockaddr_in* %2 to i8*
%9 = getelementptr inbounds [4096 x i8], [4096 x i8]* %3, i64 0, i64 0
%10 = getelementptr inbounds [15 x i8], [15 x i8]* %4, i64 0, i64 0
%11 = getelementptr inbounds [15 x i8], [15 x i8]* %5, i64 0, i64 0
%12 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str, i64 0, i64 0))
%13 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %10)
%14 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0))
%15 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %11)
%16 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0))
%17 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32* %1)
%18 = load i32, i32* @AF_INET
%19 = load i32, i32* @SOCK_RAW
%20 = load i32, i32* @IPPROTO_TCP
%21 = call i32 @socket(i32 %18, i32 %19, i32 %20)
%22 = icmp slt i32 %21, 0
br i1 %22, label %23, label %25
23: ; preds = %0
%24 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str.8, i64 0, i64 0))
br label %71
25: ; preds = %0
%26 = load i32, i32* @AF_INET
%27 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %2, i64 0, i32 2
store i32 %26, i32* %27
%28 = load i32, i32* %1
%29 = call i8* @htons(i32 %28)
%30 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %2, i64 0, i32 1
store i8* %29, i8** %30
%31 = call i8* @inet_addr(i8* %11)
%32 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %2, i64 0, i32 0, i32 0
store i8* %31, i8** %32
%33 = call i32 @memset(i8* %9, i32 0, i32 4096)
%34 = bitcast [4096 x i8]* %3 to %struct.iphdr*
%35 = getelementptr inbounds [4096 x i8], [4096 x i8]* %3, i64 0, i64 24
%36 = bitcast i8* %35 to %struct.tcphdr*
%37 = call i32 @setupIpHeader(%struct.iphdr* %34)
%38 = call i32 @setupTcpHeader(%struct.tcphdr* %36)
%39 = load i32, i32* %1
%40 = call i8* @htons(i32 %39)
%41 = getelementptr inbounds [4096 x i8], [4096 x i8]* %3, i64 0, i64 32
%42 = bitcast i8* %41 to i8**
store i8* %40, i8** %42
%43 = call i8* @inet_addr(i8* %10)
%44 = getelementptr inbounds [4096 x i8], [4096 x i8]* %3, i64 0, i64 16
%45 = bitcast i8* %44 to i8**
store i8* %43, i8** %45
%46 = call i8* @inet_addr(i8* %11)
%47 = getelementptr inbounds [4096 x i8], [4096 x i8]* %3, i64 0, i64 8
%48 = bitcast i8* %47 to i8**
store i8* %46, i8** %48
%49 = bitcast [4096 x i8]* %3 to i32*
%50 = load i32, i32* %49
%51 = ashr i32 %50, 1
%52 = call i32 @csum(i8* %9, i32 %51)
%53 = bitcast i8* %35 to i32*
store i32 %52, i32* %53
%54 = bitcast i32* %6 to i8*
store i32 1, i32* %6
%55 = load i32, i32* @IPPROTO_IP
%56 = load i32, i32* @IP_HDRINCL
%57 = call i64 @setsockopt(i32 %21, i32 %55, i32 %56, i32* %6, i32 4)
%58 = icmp slt i64 %57, 0
br i1 %58, label %61, label %59
59: ; preds = %25
%60 = bitcast %struct.sockaddr_in* %2 to %struct.sockaddr*
br label %63
61: ; preds = %25
%62 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @str, i64 0, i64 0))
br label %70
63: ; preds = %59, %63
%64 = load i32, i32* %49
%65 = call i64 @sendto(i32 %21, i8* %9, i32 %64, i32 0, %struct.sockaddr* %60, i32 24)
%66 = icmp slt i64 %65, 0
br i1 %66, label %67, label %63
67: ; preds = %63
%68 = load i32, i32* @errno
%69 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.7, i64 0, i64 0), i32 %68)
br label %70
70: ; preds = %67, %61
br label %71
71: ; preds = %70, %23
ret i32 1
}