#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 uint16_t;
struct addrinfo {
  int /*<<< orphan*/ ai_addrlen;
  int /*<<< orphan*/ ai_addr;
  int /*<<< orphan*/ ai_protocol;
  int /*<<< orphan*/ ai_socktype;
  int /*<<< orphan*/ ai_family;
  struct addrinfo *ai_next;
};
typedef int /*<<< orphan*/ packet;

/* Variables and functions */
int /*<<< orphan*/ AF_UNSPEC;
int /*<<< orphan*/ SOCK_DGRAM;
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ freeaddrinfo(struct addrinfo *);
char *gai_strerror(int);
int getaddrinfo(char *, char *, struct addrinfo *, struct addrinfo **);
int /*<<< orphan*/ memset(struct addrinfo *, int /*<<< orphan*/, int);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *, ...);
int rand();
int sendto(int, int *, int, int /*<<< orphan*/, int /*<<< orphan*/,
           int /*<<< orphan*/);
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ srand(unsigned int);
int /*<<< orphan*/ stderr;
scalar_t__ time(int /*<<< orphan*/ *);
int /*<<< orphan*/ usleep(int);
int main(int argc, char *argv[]) {
  int sockfd;
  struct addrinfo hints, *servinfo, *p;
  int rv;
  int numbytes;
  uint16_t packet[1470 / 2];
  int i = 0;
  int j = 0;
  int k = 0;
  int go = 1;
  unsigned int iseed = 0;
  uint16_t p_count = 0;
  iseed = (unsigned int)time(NULL);
  srand(iseed);
  memset(&hints, 0, sizeof hints);
  hints.ai_family = AF_UNSPEC;
  hints.ai_socktype = SOCK_DGRAM;
  if ((rv = getaddrinfo("127.0.0.1", "60000", &hints, &servinfo)) != 0) {
    fprintf(stderr, "getaddrinfo: %s\n", gai_strerror(rv));
    return 1;
  }
  for (p = servinfo; p != NULL; p = p->ai_next) {
    if ((sockfd = socket(p->ai_family, p->ai_socktype, p->ai_protocol)) == -1) {
      perror("talker: socket");
      continue;
    }
    break;
  }
  if (p == NULL) {
    fprintf(stderr, "talker: failed to bind socket\n");
    return 2;
  }
  printf("About to loop the datas\n");
  printf("PACKET ROWS:%i \n", 1470 / 2 / 3);
  while (go) {
    packet[0 * 3 + 0] = 244;
    packet[0 * 3 + 1] = p_count;
    packet[0 * 3 + 2] = 0x0000;
    for (i = 1; i < 1470 / 2 / 3; i++) {
      packet[i * 3 + 0] = rand() % 16384;
      packet[i * 3 + 1] = rand() % 16384;
      packet[i * 3 + 2] = rand() % 64;
    }
    if ((numbytes = sendto(sockfd, packet, sizeof(packet), 0, p->ai_addr,
                           p->ai_addrlen)) == -1) {
      perror("talker: sendto");
      exit(1);
    }
    p_count++;
    usleep(500);
  }
  freeaddrinfo(servinfo);
  printf("talker: sent %d bytes to %s\n", numbytes, "127.0.0.1");
  close(sockfd);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xbf0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0xbd4(%rbp)
movl   $0x0,-0xbd8(%rbp)
movl   $0x0,-0xbdc(%rbp)
movl   $0x1,-0xbe0(%rbp)
movl   $0x0,-0xbe4(%rbp)
movl   $0x0,-0xbe8(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   10a0 <time@plt>
mov    %eax,-0xbe4(%rbp)
mov    -0xbe4(%rbp),%edi
call   1080 <srand@plt>
lea    -0x38(%rbp),%rdi
xor    %esi,%esi
mov    $0x20,%edx
call   1050 <memset@plt>
mov    0x2d72(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x28(%rbp)
mov    0x2d5e(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x2c(%rbp)
lea    0xd72(%rip),%rdi
lea    0xd75(%rip),%rsi
lea    -0x38(%rbp),%rdx
lea    -0x40(%rbp),%rcx
call   10d0 <getaddrinfo@plt>
mov    %eax,-0x4c(%rbp)
cmp    $0x0,%eax
je     12e8 <main+0xf8>
mov    0x2d1b(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0xbec(%rbp)
mov    -0x4c(%rbp),%edi
call   1040 <gai_strerror@plt>
mov    -0xbec(%rbp),%edi
mov    %rax,%rdx
lea    0xd3b(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    14ed <main+0x2fd>
mov    -0x40(%rbp),%rax
mov    %rax,-0x48(%rbp)
cmpq   $0x0,-0x48(%rbp)
je     1348 <main+0x158>
mov    -0x48(%rbp),%rax
mov    0x10(%rax),%edi
mov    -0x48(%rbp),%rax
mov    0xc(%rax),%esi
mov    -0x48(%rbp),%rax
mov    0x8(%rax),%edx
call   1110 <socket@plt>
mov    %eax,-0x14(%rbp)
cmp    $0xffffffff,%eax
jne    1332 <main+0x142>
lea    0xcf9(%rip),%rdi
call   10b0 <perror@plt>
jmp    1337 <main+0x147>
jmp    1348 <main+0x158>
mov    -0x48(%rbp),%rax
mov    0x18(%rax),%rax
mov    %rax,-0x48(%rbp)
jmp    12f0 <main+0x100>
cmpq   $0x0,-0x48(%rbp)
jne    1376 <main+0x186>
mov    0x2c76(%rip),%rax
mov    (%rax),%edi
lea    0xccd(%rip),%rsi
mov    $0x0,%al
call   1090 <fprintf@plt>
movl   $0x2,-0x4(%rbp)
jmp    14ed <main+0x2fd>
lea    0xcd2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xcdd(%rip),%rdi
mov    $0xf5,%esi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0x0,-0xbe0(%rbp)
je     14bd <main+0x2cd>
movl   $0xf4,-0xbd0(%rbp)
mov    -0xbe8(%rbp),%eax
mov    %eax,-0xbcc(%rbp)
movl   $0x0,-0xbc8(%rbp)
movl   $0x1,-0xbd4(%rbp)
cmpl   $0xf5,-0xbd4(%rbp)
jge    1458 <main+0x268>
mov    $0x0,%al
call   10e0 <rand@plt>
mov    $0x4000,%ecx
cltd
idiv   %ecx
imul   $0x3,-0xbd4(%rbp),%eax
add    $0x0,%eax
cltq
mov    %edx,-0xbd0(%rbp,%rax,4)
mov    $0x0,%al
call   10e0 <rand@plt>
mov    $0x4000,%ecx
cltd
idiv   %ecx
imul   $0x3,-0xbd4(%rbp),%eax
add    $0x1,%eax
cltq
mov    %edx,-0xbd0(%rbp,%rax,4)
mov    $0x0,%al
call   10e0 <rand@plt>
mov    $0x40,%ecx
cltd
idiv   %ecx
imul   $0x3,-0xbd4(%rbp),%eax
add    $0x2,%eax
cltq
mov    %edx,-0xbd0(%rbp,%rax,4)
mov    -0xbd4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xbd4(%rbp)
jmp    13ce <main+0x1de>
mov    -0x14(%rbp),%edi
lea    -0xbd0(%rbp),%rsi
mov    -0x48(%rbp),%rax
mov    0x4(%rax),%r8d
mov    -0x48(%rbp),%rax
mov    (%rax),%r9d
mov    $0xb7c,%edx
xor    %ecx,%ecx
call   1060 <sendto@plt>
mov    %eax,-0x50(%rbp)
cmp    $0xffffffff,%eax
jne    149f <main+0x2af>
lea    0xbe9(%rip),%rdi
call   10b0 <perror@plt>
mov    $0x1,%edi
call   10c0 <exit@plt>
mov    -0xbe8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xbe8(%rbp)
mov    $0x1f4,%edi
call   10f0 <usleep@plt>
jmp    1397 <main+0x1a7>
mov    -0x40(%rbp),%rdi
call   1100 <freeaddrinfo@plt>
mov    -0x50(%rbp),%esi
lea    0xbb8(%rip),%rdi
lea    0xb29(%rip),%rdx
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%edi
call   1070 <close@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xbf0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0xbb0,%rsp
xor    %edi,%edi
call   10a0 <time@plt>
mov    %eax,%edi
call   1080 <srand@plt>
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
xor    %esi,%esi
mov    $0x20,%edx
call   1060 <memset@plt>
mov    0x2dd0(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x20(%rsp)
mov    0x2dbb(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x1c(%rsp)
lea    0xdce(%rip),%rdi
lea    0xdd1(%rip),%rsi
lea    0x8(%rsp),%rcx
mov    %rbx,%rdx
call   10d0 <getaddrinfo@plt>
test   %eax,%eax
je     1274 <main+0x94>
mov    0x2d7f(%rip),%rcx
mov    (%rcx),%ebx
mov    %eax,%edi
call   1050 <gai_strerror@plt>
lea    0xdaf(%rip),%rsi
mov    %ebx,%edi
mov    %rax,%rdx
xor    %eax,%eax
call   1090 <fprintf@plt>
mov    $0x1,%eax
jmp    12cc <main+0xec>
mov    0x8(%rsp),%r12
test   %r12,%r12
je     12b0 <main+0xd0>
lea    0xd9c(%rip),%r14
mov    0x10(%r12),%edi
mov    0x8(%r12),%edx
mov    0xc(%r12),%esi
call   1100 <socket@plt>
cmp    $0xffffffff,%eax
jne    12dc <main+0xfc>
mov    %r14,%rdi
call   10b0 <perror@plt>
mov    0x18(%r12),%r12
test   %r12,%r12
jne    1285 <main+0xa5>
mov    0x2d19(%rip),%rax
mov    (%rax),%edi
lea    0xd70(%rip),%rsi
xor    %eax,%eax
call   1090 <fprintf@plt>
mov    $0x2,%eax
add    $0xbb0,%rsp
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret
mov    %eax,%r15d
lea    0xd89(%rip),%rdi
call   1030 <puts@plt>
lea    0xd5d(%rip),%rdi
mov    $0xf5,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0x30(%rsp),%r14
xor    %ebp,%ebp
cs nopw 0x0(%rax,%rax,1)
nop
movl   $0xf4,0x30(%rsp)
mov    %ebp,0x34(%rsp)
movl   $0x0,0x38(%rsp)
mov    $0x14,%ebx
nopl   0x0(%rax)
xor    %eax,%eax
call   10e0 <rand@plt>
lea    0x3fff(%rax),%ecx
test   %eax,%eax
cmovns %eax,%ecx
and    $0xffffc000,%ecx
sub    %ecx,%eax
mov    %eax,0x28(%rsp,%rbx,1)
xor    %eax,%eax
call   10e0 <rand@plt>
lea    0x3fff(%rax),%ecx
test   %eax,%eax
cmovns %eax,%ecx
and    $0xffffc000,%ecx
sub    %ecx,%eax
mov    %eax,0x2c(%rsp,%rbx,1)
xor    %eax,%eax
call   10e0 <rand@plt>
lea    0x3f(%rax),%ecx
test   %eax,%eax
cmovns %eax,%ecx
and    $0xffffffc0,%ecx
sub    %ecx,%eax
mov    %eax,0x30(%rsp,%rbx,1)
add    $0xc,%rbx
cmp    $0xb84,%rbx
jne    1330 <main+0x150>
mov    (%r12),%r9d
mov    0x4(%r12),%r8d
mov    %r15d,%edi
mov    %r14,%rsi
mov    $0xb7c,%edx
xor    %ecx,%ecx
call   1070 <sendto@plt>
cmp    $0xffffffff,%eax
je     13c3 <main+0x1e3>
add    $0x1,%ebp
mov    $0x1f4,%edi
call   10f0 <usleep@plt>
jmp    1310 <main+0x130>
lea    0xc96(%rip),%rdi
call   10b0 <perror@plt>
mov    $0x1,%edi
call   10c0 <exit@plt>

LLVM IR (-O0):
%struct.addrinfo = type { i32, i32, i32, i32, i32, %struct.addrinfo* }
@AF_UNSPEC = global i32 0
@SOCK_DGRAM = global i32 0
@.str = [10 x i8] c"127.0.0.1\00"
@.str.1 = [6 x i8] c"60000\00"
@stderr = global i32 0
@.str.2 = [17 x i8] c"getaddrinfo: %s\0A\00"
@.str.3 = [15 x i8] c"talker: socket\00"
@.str.4 = [31 x i8] c"talker: failed to bind socket\0A\00"
@.str.5 = [25 x i8] c"About to loop the datas\0A\00"
@.str.6 = [17 x i8] c"PACKET ROWS:%i \0A\00"
@.str.7 = [15 x i8] c"talker: sendto\00"
@.str.8 = [29 x i8] c"talker: sent %d bytes to %s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca %struct.addrinfo
%8 = alloca %struct.addrinfo*
%9 = alloca %struct.addrinfo*
%10 = alloca i32
%11 = alloca i32
%12 = alloca [735 x i32]
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %13
store i32 0, i32* %14
store i32 0, i32* %15
store i32 1, i32* %16
store i32 0, i32* %17
store i32 0, i32* %18
%19 = call i64 @time(i32* null)
%20 = trunc i64 %19 to i32
store i32 %20, i32* %17
%21 = load i32, i32* %17
%22 = call i32 @srand(i32 %21)
%23 = call i32 @memset(%struct.addrinfo* %7, i32 0, i32 32)
%24 = load i32, i32* @AF_UNSPEC
%25 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %7, i32 0, i32 4
store i32 %24, i32* %25
%26 = load i32, i32* @SOCK_DGRAM
%27 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %7, i32 0, i32 3
store i32 %26, i32* %27
%28 = call i32 @getaddrinfo(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), %struct.addrinfo* %7, %struct.addrinfo** %8)
store i32 %28, i32* %10
%29 = icmp ne i32 %28, 0
br i1 %29, label %30, label %35
30: ; preds = %2
%31 = load i32, i32* @stderr
%32 = load i32, i32* %10
%33 = call i8* @gai_strerror(i32 %32)
%34 = call i32 (i32, i8*, ...) @fprintf(i32 %31, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i8* %33)
store i32 1, i32* %3
br label %129
35: ; preds = %2
%36 = load %struct.addrinfo*, %struct.addrinfo** %8
store %struct.addrinfo* %36, %struct.addrinfo** %9
br label %37
37: ; preds = %55, %35
%38 = load %struct.addrinfo*, %struct.addrinfo** %9
%39 = icmp ne %struct.addrinfo* %38, null
br i1 %39, label %40, label %59
40: ; preds = %37
%41 = load %struct.addrinfo*, %struct.addrinfo** %9
%42 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %41, i32 0, i32 4
%43 = load i32, i32* %42
%44 = load %struct.addrinfo*, %struct.addrinfo** %9
%45 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %44, i32 0, i32 3
%46 = load i32, i32* %45
%47 = load %struct.addrinfo*, %struct.addrinfo** %9
%48 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %47, i32 0, i32 2
%49 = load i32, i32* %48
%50 = call i32 @socket(i32 %43, i32 %46, i32 %49)
store i32 %50, i32* %6
%51 = icmp eq i32 %50, -1
br i1 %51, label %52, label %54
52: ; preds = %40
%53 = call i32 @perror(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0))
br label %55
54: ; preds = %40
br label %59
55: ; preds = %52
%56 = load %struct.addrinfo*, %struct.addrinfo** %9
%57 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %56, i32 0, i32 5
%58 = load %struct.addrinfo*, %struct.addrinfo** %57
store %struct.addrinfo* %58, %struct.addrinfo** %9
br label %37
59: ; preds = %54, %37
%60 = load %struct.addrinfo*, %struct.addrinfo** %9
%61 = icmp eq %struct.addrinfo* %60, null
br i1 %61, label %62, label %65
62: ; preds = %59
%63 = load i32, i32* @stderr
%64 = call i32 (i32, i8*, ...) @fprintf(i32 %63, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.4, i64 0, i64 0))
store i32 2, i32* %3
br label %129
65: ; preds = %59
%66 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.5, i64 0, i64 0))
%67 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.6, i64 0, i64 0), i32 245)
br label %68
68: ; preds = %118, %65
%69 = load i32, i32* %16
%70 = icmp ne i32 %69, 0
br i1 %70, label %71, label %122
71: ; preds = %68
%72 = getelementptr inbounds [735 x i32], [735 x i32]* %12, i64 0, i64 0
store i32 244, i32* %72
%73 = load i32, i32* %18
%74 = getelementptr inbounds [735 x i32], [735 x i32]* %12, i64 0, i64 1
store i32 %73, i32* %74
%75 = getelementptr inbounds [735 x i32], [735 x i32]* %12, i64 0, i64 2
store i32 0, i32* %75
store i32 1, i32* %13
br label %76
76: ; preds = %101, %71
%77 = load i32, i32* %13
%78 = icmp slt i32 %77, 245
br i1 %78, label %79, label %104
79: ; preds = %76
%80 = call i32 (...) @rand()
%81 = srem i32 %80, 16384
%82 = load i32, i32* %13
%83 = mul nsw i32 %82, 3
%84 = add nsw i32 %83, 0
%85 = sext i32 %84 to i64
%86 = getelementptr inbounds [735 x i32], [735 x i32]* %12, i64 0, i64 %85
store i32 %81, i32* %86
%87 = call i32 (...) @rand()
%88 = srem i32 %87, 16384
%89 = load i32, i32* %13
%90 = mul nsw i32 %89, 3
%91 = add nsw i32 %90, 1
%92 = sext i32 %91 to i64
%93 = getelementptr inbounds [735 x i32], [735 x i32]* %12, i64 0, i64 %92
store i32 %88, i32* %93
%94 = call i32 (...) @rand()
%95 = srem i32 %94, 64
%96 = load i32, i32* %13
%97 = mul nsw i32 %96, 3
%98 = add nsw i32 %97, 2
%99 = sext i32 %98 to i64
%100 = getelementptr inbounds [735 x i32], [735 x i32]* %12, i64 0, i64 %99
store i32 %95, i32* %100
br label %101
101: ; preds = %79
%102 = load i32, i32* %13
%103 = add nsw i32 %102, 1
store i32 %103, i32* %13
br label %76
104: ; preds = %76
%105 = load i32, i32* %6
%106 = getelementptr inbounds [735 x i32], [735 x i32]* %12, i64 0, i64 0
%107 = load %struct.addrinfo*, %struct.addrinfo** %9
%108 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %107, i32 0, i32 1
%109 = load i32, i32* %108
%110 = load %struct.addrinfo*, %struct.addrinfo** %9
%111 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %110, i32 0, i32 0
%112 = load i32, i32* %111
%113 = call i32 @sendto(i32 %105, i32* %106, i32 2940, i32 0, i32 %109, i32 %112)
store i32 %113, i32* %11
%114 = icmp eq i32 %113, -1
br i1 %114, label %115, label %118
115: ; preds = %104
%116 = call i32 @perror(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.7, i64 0, i64 0))
%117 = call i32 @exit(i32 1)
unreachable
118: ; preds = %104
%119 = load i32, i32* %18
%120 = add nsw i32 %119, 1
store i32 %120, i32* %18
%121 = call i32 @usleep(i32 500)
br label %68
122: ; preds = %68
%123 = load %struct.addrinfo*, %struct.addrinfo** %8
%124 = call i32 @freeaddrinfo(%struct.addrinfo* %123)
%125 = load i32, i32* %11
%126 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.8, i64 0, i64 0), i32 %125, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%127 = load i32, i32* %6
%128 = call i32 @close(i32 %127)
store i32 0, i32* %3
br label %129
129: ; preds = %122, %62, %30
%130 = load i32, i32* %3
ret i32 %130
}

LLVM IR (-O2):
%struct.addrinfo = type { i32, i32, i32, i32, i32, %struct.addrinfo* }
@AF_UNSPEC = global i32 0
@SOCK_DGRAM = global i32 0
@.str = [10 x i8] c"127.0.0.1\00"
@.str.1 = [6 x i8] c"60000\00"
@stderr = global i32 0
@.str.2 = [17 x i8] c"getaddrinfo: %s\0A\00"
@.str.3 = [15 x i8] c"talker: socket\00"
@.str.4 = [31 x i8] c"talker: failed to bind socket\0A\00"
@.str.6 = [17 x i8] c"PACKET ROWS:%i \0A\00"
@.str.7 = [15 x i8] c"talker: sendto\00"
@str = [24 x i8] c"About to loop the datas\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca %struct.addrinfo
%4 = alloca %struct.addrinfo*
%5 = alloca [735 x i32]
%6 = bitcast %struct.addrinfo* %3 to i8*
%7 = bitcast %struct.addrinfo** %4 to i8*
%8 = bitcast [735 x i32]* %5 to i8*
%9 = tail call i64 @time(i32* null)
%10 = trunc i64 %9 to i32
%11 = tail call i32 @srand(i32 %10)
%12 = call i32 @memset(%struct.addrinfo* %3, i32 0, i32 32)
%13 = load i32, i32* @AF_UNSPEC
%14 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %3, i64 0, i32 4
store i32 %13, i32* %14
%15 = load i32, i32* @SOCK_DGRAM
%16 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %3, i64 0, i32 3
store i32 %15, i32* %16
%17 = call i32 @getaddrinfo(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), %struct.addrinfo* %3, %struct.addrinfo** %4)
%18 = icmp eq i32 %17, 0
br i1 %18, label %19, label %22
19: ; preds = %2
%20 = load %struct.addrinfo*, %struct.addrinfo** %4
%21 = icmp eq %struct.addrinfo* %20, null
br i1 %21, label %41, label %26
22: ; preds = %2
%23 = load i32, i32* @stderr
%24 = call i8* @gai_strerror(i32 %17)
%25 = call i32 (i32, i8*, ...) @fprintf(i32 %23, i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0), i8* %24)
br label %81
26: ; preds = %19, %36
%27 = phi %struct.addrinfo* [ %39, %36 ], [ %20, %19 ]
%28 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %27, i64 0, i32 4
%29 = load i32, i32* %28
%30 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %27, i64 0, i32 3
%31 = load i32, i32* %30
%32 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %27, i64 0, i32 2
%33 = load i32, i32* %32
%34 = call i32 @socket(i32 %29, i32 %31, i32 %33)
%35 = icmp eq i32 %34, -1
br i1 %35, label %36, label %44
36: ; preds = %26
%37 = call i32 @perror(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0))
%38 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %27, i64 0, i32 5
%39 = load %struct.addrinfo*, %struct.addrinfo** %38
%40 = icmp eq %struct.addrinfo* %39, null
br i1 %40, label %41, label %26
41: ; preds = %36, %19
%42 = load i32, i32* @stderr
%43 = call i32 (i32, i8*, ...) @fprintf(i32 %42, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.4, i64 0, i64 0))
br label %81
44: ; preds = %26
%45 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str, i64 0, i64 0))
%46 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.6, i64 0, i64 0), i32 245)
%47 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %27, i64 0, i32 1
%48 = getelementptr inbounds [735 x i32], [735 x i32]* %5, i64 0, i64 0
%49 = getelementptr inbounds [735 x i32], [735 x i32]* %5, i64 0, i64 1
%50 = getelementptr inbounds [735 x i32], [735 x i32]* %5, i64 0, i64 2
%51 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %27, i64 0, i32 0
br label %52
52: ; preds = %78, %44
%53 = phi i32 [ 0, %44 ], [ %79, %78 ]
store i32 244, i32* %48
store i32 %53, i32* %49
store i32 0, i32* %50
br label %54
54: ; preds = %52, %54
%55 = phi i64 [ 1, %52 ], [ %68, %54 ]
%56 = call i32 (...) @rand()
%57 = srem i32 %56, 16384
%58 = mul nuw nsw i64 %55, 3
%59 = getelementptr inbounds [735 x i32], [735 x i32]* %5, i64 0, i64 %58
store i32 %57, i32* %59
%60 = call i32 (...) @rand()
%61 = srem i32 %60, 16384
%62 = add nuw nsw i64 %58, 1
%63 = getelementptr inbounds [735 x i32], [735 x i32]* %5, i64 0, i64 %62
store i32 %61, i32* %63
%64 = call i32 (...) @rand()
%65 = srem i32 %64, 64
%66 = add nuw nsw i64 %58, 2
%67 = getelementptr inbounds [735 x i32], [735 x i32]* %5, i64 0, i64 %66
store i32 %65, i32* %67
%68 = add nuw nsw i64 %55, 1
%69 = icmp eq i64 %68, 245
br i1 %69, label %70, label %54
70: ; preds = %54
%71 = load i32, i32* %47
%72 = load i32, i32* %51
%73 = call i32 @sendto(i32 %34, i32* %48, i32 2940, i32 0, i32 %71, i32 %72)
%74 = icmp eq i32 %73, -1
br i1 %74, label %75, label %78
75: ; preds = %70
%76 = call i32 @perror(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.7, i64 0, i64 0))
%77 = call i32 @exit(i32 1)
unreachable
78: ; preds = %70
%79 = add nuw nsw i32 %53, 1
%80 = call i32 @usleep(i32 500)
br label %52
81: ; preds = %41, %22
%82 = phi i32 [ 1, %22 ], [ 2, %41 ]
ret i32 %82
}