#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 timeval {
  int tv_sec;
  scalar_t__ tv_usec;
};
struct TYPE_2__ {
  void *s_addr;
};
struct sockaddr_in {
  TYPE_1__ sin_addr;
  void *sin_port;
  void *sin_family;
};
struct sockaddr {
  int dummy;
};
typedef int socklen_t;
typedef int /*<<< orphan*/ fd_set;
typedef int /*<<< orphan*/ Servidor;
typedef int /*<<< orphan*/ Datos;
typedef int /*<<< orphan*/ Cliente;

/* Variables and functions */
void *AF_INET;
int /*<<< orphan*/ FD_SET(int, int /*<<< orphan*/ *);
int /*<<< orphan*/ FD_ZERO(int /*<<< orphan*/ *);
int /*<<< orphan*/ SOCK_DGRAM;
int bind(int, struct sockaddr *, int);
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ exit(int);
void *htons(int);
void *inet_addr(char *);
int /*<<< orphan*/ printf(char *, ...);
int recvfrom(int, char *, int, int /*<<< orphan*/, struct sockaddr *, int *);
int select(int, int /*<<< orphan*/ *, int /*<<< orphan*/ *,
           int /*<<< orphan*/ *, struct timeval *);
int sendto(int, char *, int, int /*<<< orphan*/, struct sockaddr *, int);
int socket(void *, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ strcpy(char *, char *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
main() {
  struct timeval timeout;
  int c;
  fd_set readfds;
  int Socket_Cliente;
  struct sockaddr_in Cliente;
  char Datos[25];
  struct sockaddr_in Servidor;
  socklen_t Longitud_Servidor;
  Socket_Cliente = socket(AF_INET, SOCK_DGRAM, 0);
  FD_ZERO(&readfds);
  FD_SET(Socket_Cliente, &readfds);
  if (Socket_Cliente == -1) {
    printf("No se puede abrir el socket cliente\n");
    exit(-1);
  }
  Cliente.sin_family = AF_INET;
  Cliente.sin_port = htons(1999);
  Cliente.sin_addr.s_addr = inet_addr("172.16.222.29");
  if (bind(Socket_Cliente, (struct sockaddr *)&Cliente, sizeof(Cliente)) ==
      -1) {
    close(Socket_Cliente);
  }
  Servidor.sin_family = AF_INET;
  Servidor.sin_port = htons(13);
  Servidor.sin_addr.s_addr = inet_addr("150.214.110.21");
  Longitud_Servidor = sizeof(Servidor);
  srand(time(NULL));
  strcpy(Datos, "");
  printf("Envio %s\n", Datos);
  int i = 0, encontrado = 0;
  int recibido;
  int enviado = sendto(Socket_Cliente, Datos, sizeof(Datos), 0,
                       (struct sockaddr *)&Servidor, Longitud_Servidor);
  if (enviado < 0) {
    printf("Error al solicitar el servicio\n");
  }
  timeout.tv_sec = 5;
  timeout.tv_usec = 0;
  while (!encontrado && i < 3) {
    c = select(Socket_Cliente + 1, &readfds, NULL, NULL, &timeout);
    if (c == 0) {
      printf("Error al leer del servidor\n");
    } else if (c == -1) {
      printf("Error en select");
      encontrado = 1;
    } else {
      recibido = recvfrom(Socket_Cliente, Datos, sizeof(Datos), 0,
                          (struct sockaddr *)&Servidor, &Longitud_Servidor);
      printf("Leido %s\n", Datos);
      encontrado = 1;
    }
    i++;
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x90,%rsp
movl   $0x0,-0x4(%rbp)
mov    0x2ddf(%rip),%rax
mov    (%rax),%rdi
mov    0x2dcd(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1110 <socket@plt>
mov    %eax,-0x24(%rbp)
lea    -0x20(%rbp),%rdi
call   10b0 <FD_ZERO@plt>
mov    -0x24(%rbp),%edi
lea    -0x20(%rbp),%rsi
call   1100 <FD_SET@plt>
cmpl   $0xffffffff,-0x24(%rbp)
jne    1256 <main+0x66>
lea    0xdbb(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
mov    $0xffffffff,%edi
call   10f0 <exit@plt>
mov    0x2d8b(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x30(%rbp)
mov    $0x7cf,%edi
call   1040 <htons@plt>
mov    %rax,-0x38(%rbp)
lea    0xdac(%rip),%rdi
call   1090 <inet_addr@plt>
mov    %rax,-0x40(%rbp)
mov    -0x24(%rbp),%edi
lea    -0x40(%rbp),%rsi
mov    $0x18,%edx
call   10e0 <bind@plt>
cmp    $0xffffffff,%eax
jne    12a4 <main+0xb4>
mov    -0x24(%rbp),%edi
call   1070 <close@plt>
mov    0x2d3d(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x68(%rbp)
mov    $0xd,%edi
call   1040 <htons@plt>
mov    %rax,-0x70(%rbp)
lea    0xd6c(%rip),%rdi
call   1090 <inet_addr@plt>
mov    %rax,-0x78(%rbp)
movl   $0x18,-0x7c(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   10a0 <time@plt>
mov    %eax,%edi
call   1080 <srand@plt>
lea    -0x60(%rbp),%rdi
lea    0xd32(%rip),%rsi
call   1030 <strcpy@plt>
lea    -0x60(%rbp),%rsi
lea    0xd40(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x0,-0x80(%rbp)
movl   $0x0,-0x84(%rbp)
mov    -0x24(%rbp),%edi
lea    -0x60(%rbp),%rsi
lea    -0x78(%rbp),%r8
mov    -0x7c(%rbp),%r9d
mov    $0x19,%edx
xor    %ecx,%ecx
call   1060 <sendto@plt>
mov    %eax,-0x8c(%rbp)
cmpl   $0x0,-0x8c(%rbp)
jge    1356 <main+0x166>
lea    0xcfd(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x5,-0x18(%rbp)
movq   $0x0,-0x10(%rbp)
xor    %eax,%eax
cmpl   $0x0,-0x84(%rbp)
mov    %al,-0x8d(%rbp)
jne    1387 <main+0x197>
cmpl   $0x3,-0x80(%rbp)
setl   %al
mov    %al,-0x8d(%rbp)
mov    -0x8d(%rbp),%al
test   $0x1,%al
jne    139a <main+0x1aa>
jmp    144b <main+0x25b>
mov    -0x24(%rbp),%edi
add    $0x1,%edi
lea    -0x20(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%ecx
lea    -0x18(%rbp),%r8
mov    %rcx,%rdx
call   10c0 <select@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jne    13d4 <main+0x1e4>
lea    0xca4(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
jmp    143d <main+0x24d>
cmpl   $0xffffffff,-0x1c(%rbp)
jne    13fb <main+0x20b>
lea    0xca3(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x1,-0x84(%rbp)
jmp    1438 <main+0x248>
mov    -0x24(%rbp),%edi
lea    -0x60(%rbp),%rsi
lea    -0x78(%rbp),%r8
mov    $0x19,%edx
xor    %ecx,%ecx
lea    -0x7c(%rbp),%r9
call   10d0 <recvfrom@plt>
mov    %eax,-0x88(%rbp)
lea    -0x60(%rbp),%rsi
lea    0xc71(%rip),%rdi
mov    $0x0,%al
call   1050 <printf@plt>
movl   $0x1,-0x84(%rbp)
jmp    143d <main+0x24d>
mov    -0x80(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x80(%rbp)
jmp    1365 <main+0x175>
mov    -0x4(%rbp),%eax
add    $0x90,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x78,%rsp
mov    0x2dd7(%rip),%r15
mov    (%r15),%rdi
mov    0x2dc5(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1120 <socket@plt>
mov    %eax,%ebp
lea    0x8(%rsp),%rbx
mov    %rbx,%rdi
call   10c0 <FD_ZERO@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
call   1110 <FD_SET@plt>
cmp    $0xffffffff,%ebp
je     1404 <main+0x204>
mov    %ebp,%r14d
mov    (%r15),%rax
mov    %rax,0x48(%rsp)
mov    $0x7cf,%edi
call   1050 <htons@plt>
mov    %rax,0x40(%rsp)
lea    0xd99(%rip),%rdi
call   10a0 <inet_addr@plt>
mov    %rax,0x38(%rsp)
lea    0x38(%rsp),%rsi
mov    %ebp,%edi
mov    $0x18,%edx
call   10f0 <bind@plt>
cmp    $0xffffffff,%eax
jne    128f <main+0x8f>
mov    %r14d,%edi
call   1080 <close@plt>
mov    (%r15),%rax
mov    %rax,0x30(%rsp)
mov    $0xd,%edi
call   1050 <htons@plt>
mov    %rax,0x28(%rsp)
lea    0xd61(%rip),%rdi
call   10a0 <inet_addr@plt>
mov    %rax,0x20(%rsp)
movl   $0x18,0xc(%rsp)
xor    %edi,%edi
call   10b0 <time@plt>
mov    %eax,%edi
call   1090 <srand@plt>
lea    0xd6c(%rip),%rsi
lea    0x50(%rsp),%rbx
mov    %rbx,%rdi
call   1030 <strcpy@plt>
lea    0xd35(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
lea    0x20(%rsp),%r8
mov    %r14d,%edi
mov    %rbx,%rsi
mov    $0x19,%edx
xor    %ecx,%ecx
mov    $0x18,%r9d
call   1070 <sendto@plt>
test   %eax,%eax
jns    131f <main+0x11f>
lea    0xd42(%rip),%rdi
call   1040 <puts@plt>
movl   $0x5,0x10(%rsp)
movq   $0x0,0x18(%rsp)
add    $0x1,%ebp
lea    0x8(%rsp),%rsi
lea    0x10(%rsp),%r8
mov    %ebp,%edi
xor    %edx,%edx
xor    %ecx,%ecx
call   10d0 <select@plt>
test   %eax,%eax
je     1353 <main+0x153>
cmp    $0xffffffff,%eax
je     13b5 <main+0x1b5>
jmp    13c5 <main+0x1c5>
lea    0xce7(%rip),%rdi
call   1040 <puts@plt>
lea    0x8(%rsp),%rsi
lea    0x10(%rsp),%r8
mov    %ebp,%edi
xor    %edx,%edx
xor    %ecx,%ecx
call   10d0 <select@plt>
cmp    $0xffffffff,%eax
je     13b5 <main+0x1b5>
test   %eax,%eax
jne    13c5 <main+0x1c5>
lea    0xcbd(%rip),%rdi
call   1040 <puts@plt>
lea    0x8(%rsp),%rsi
lea    0x10(%rsp),%r8
mov    %ebp,%edi
xor    %edx,%edx
xor    %ecx,%ecx
call   10d0 <select@plt>
cmp    $0xffffffff,%eax
je     13b5 <main+0x1b5>
test   %eax,%eax
jne    13c5 <main+0x1c5>
lea    0xc93(%rip),%rdi
call   1040 <puts@plt>
jmp    13f7 <main+0x1f7>
lea    0xc6b(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
jmp    13f7 <main+0x1f7>
lea    0x50(%rsp),%rbx
lea    0x20(%rsp),%r8
lea    0xc(%rsp),%r9
mov    %r14d,%edi
mov    %rbx,%rsi
mov    $0x19,%edx
xor    %ecx,%ecx
call   10e0 <recvfrom@plt>
lea    0xc4a(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1060 <printf@plt>
xor    %eax,%eax
add    $0x78,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xc70(%rip),%rdi
call   1040 <puts@plt>
mov    $0xffffffff,%edi
call   1100 <exit@plt>

LLVM IR (-O0):
%struct.timeval = type { i32, i64 }
%struct.sockaddr_in = type { %struct.TYPE_2__, i8*, i8* }
%struct.TYPE_2__ = type { i8* }
%struct.sockaddr = type { i32 }
@AF_INET = global i8* null
@SOCK_DGRAM = global i32 0
@.str = [37 x i8] c"No se puede abrir el socket cliente\0A\00"
@.str.1 = [14 x i8] c"172.16.222.29\00"
@.str.2 = [15 x i8] c"150.214.110.21\00"
@.str.3 = [1 x i8] zeroinitializer
@.str.4 = [10 x i8] c"Envio %s\0A\00"
@.str.5 = [32 x i8] c"Error al solicitar el servicio\0A\00"
@.str.6 = [28 x i8] c"Error al leer del servidor\0A\00"
@.str.7 = [16 x i8] c"Error en select\00"
@.str.8 = [10 x i8] c"Leido %s\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.timeval
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca %struct.sockaddr_in
%7 = alloca [25 x i8]
%8 = alloca %struct.sockaddr_in
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca i32
store i32 0, i32* %1
%14 = load i8*, i8** @AF_INET
%15 = load i32, i32* @SOCK_DGRAM
%16 = call i32 @socket(i8* %14, i32 %15, i32 0)
store i32 %16, i32* %5
%17 = call i32 @FD_ZERO(i32* %4)
%18 = load i32, i32* %5
%19 = call i32 @FD_SET(i32 %18, i32* %4)
%20 = load i32, i32* %5
%21 = icmp eq i32 %20, -1
br i1 %21, label %22, label %25
22: ; preds = %0
%23 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%24 = call i32 @exit(i32 -1)
unreachable
25: ; preds = %0
%26 = load i8*, i8** @AF_INET
%27 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %6, i32 0, i32 2
store i8* %26, i8** %27
%28 = call i8* @htons(i32 1999)
%29 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %6, i32 0, i32 1
store i8* %28, i8** %29
%30 = call i8* @inet_addr(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%31 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %6, i32 0, i32 0
%32 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %31, i32 0, i32 0
store i8* %30, i8** %32
%33 = load i32, i32* %5
%34 = bitcast %struct.sockaddr_in* %6 to %struct.sockaddr*
%35 = call i32 @bind(i32 %33, %struct.sockaddr* %34, i32 24)
%36 = icmp eq i32 %35, -1
br i1 %36, label %37, label %40
37: ; preds = %25
%38 = load i32, i32* %5
%39 = call i32 @close(i32 %38)
br label %40
40: ; preds = %37, %25
%41 = load i8*, i8** @AF_INET
%42 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %8, i32 0, i32 2
store i8* %41, i8** %42
%43 = call i8* @htons(i32 13)
%44 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %8, i32 0, i32 1
store i8* %43, i8** %44
%45 = call i8* @inet_addr(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
%46 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %8, i32 0, i32 0
%47 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %46, i32 0, i32 0
store i8* %45, i8** %47
store i32 24, i32* %9
%48 = call i32 @time(i32* null)
%49 = call i32 @srand(i32 %48)
%50 = getelementptr inbounds [25 x i8], [25 x i8]* %7, i64 0, i64 0
%51 = call i32 @strcpy(i8* %50, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.3, i64 0, i64 0))
%52 = getelementptr inbounds [25 x i8], [25 x i8]* %7, i64 0, i64 0
%53 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0), i8* %52)
store i32 0, i32* %10
store i32 0, i32* %11
%54 = load i32, i32* %5
%55 = getelementptr inbounds [25 x i8], [25 x i8]* %7, i64 0, i64 0
%56 = bitcast %struct.sockaddr_in* %8 to %struct.sockaddr*
%57 = load i32, i32* %9
%58 = call i32 @sendto(i32 %54, i8* %55, i32 25, i32 0, %struct.sockaddr* %56, i32 %57)
store i32 %58, i32* %13
%59 = load i32, i32* %13
%60 = icmp slt i32 %59, 0
br i1 %60, label %61, label %63
61: ; preds = %40
%62 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.5, i64 0, i64 0))
br label %63
63: ; preds = %61, %40
%64 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i32 0, i32 0
store i32 5, i32* %64
%65 = getelementptr inbounds %struct.timeval, %struct.timeval* %2, i32 0, i32 1
store i64 0, i64* %65
br label %66
66: ; preds = %95, %63
%67 = load i32, i32* %11
%68 = icmp ne i32 %67, 0
br i1 %68, label %72, label %69
69: ; preds = %66
%70 = load i32, i32* %10
%71 = icmp slt i32 %70, 3
br label %72
72: ; preds = %69, %66
%73 = phi i1 [ false, %66 ], [ %71, %69 ]
br i1 %73, label %74, label %98
74: ; preds = %72
%75 = load i32, i32* %5
%76 = add nsw i32 %75, 1
%77 = call i32 @select(i32 %76, i32* %4, i32* null, i32* null, %struct.timeval* %2)
store i32 %77, i32* %3
%78 = load i32, i32* %3
%79 = icmp eq i32 %78, 0
br i1 %79, label %80, label %82
80: ; preds = %74
%81 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.6, i64 0, i64 0))
br label %95
82: ; preds = %74
%83 = load i32, i32* %3
%84 = icmp eq i32 %83, -1
br i1 %84, label %85, label %87
85: ; preds = %82
%86 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.7, i64 0, i64 0))
store i32 1, i32* %11
br label %94
87: ; preds = %82
%88 = load i32, i32* %5
%89 = getelementptr inbounds [25 x i8], [25 x i8]* %7, i64 0, i64 0
%90 = bitcast %struct.sockaddr_in* %8 to %struct.sockaddr*
%91 = call i32 @recvfrom(i32 %88, i8* %89, i32 25, i32 0, %struct.sockaddr* %90, i32* %9)
store i32 %91, i32* %12
%92 = getelementptr inbounds [25 x i8], [25 x i8]* %7, i64 0, i64 0
%93 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.8, i64 0, i64 0), i8* %92)
store i32 1, i32* %11
br label %94
94: ; preds = %87, %85
br label %95
95: ; preds = %94, %80
%96 = load i32, i32* %10
%97 = add nsw i32 %96, 1
store i32 %97, i32* %10
br label %66
98: ; preds = %72
%99 = load i32, i32* %1
ret i32 %99
}

LLVM IR (-O2):
%struct.timeval = type { i32, i64 }
%struct.sockaddr_in = type { %struct.TYPE_2__, i8*, i8* }
%struct.TYPE_2__ = type { i8* }
%struct.sockaddr = type { i32 }
@AF_INET = global i8* null
@SOCK_DGRAM = global i32 0
@.str.1 = [14 x i8] c"172.16.222.29\00"
@.str.2 = [15 x i8] c"150.214.110.21\00"
@.str.3 = [1 x i8] zeroinitializer
@.str.4 = [10 x i8] c"Envio %s\0A\00"
@.str.7 = [16 x i8] c"Error en select\00"
@.str.8 = [10 x i8] c"Leido %s\0A\00"
@str = [27 x i8] c"Error al leer del servidor\00"
@str.9 = [31 x i8] c"Error al solicitar el servicio\00"
@str.10 = [36 x i8] c"No se puede abrir el socket cliente\00"
define i32 @main() {
%1 = alloca %struct.timeval
%2 = alloca i32
%3 = alloca %struct.sockaddr_in
%4 = alloca [25 x i8]
%5 = alloca %struct.sockaddr_in
%6 = alloca i32
%7 = bitcast %struct.timeval* %1 to i8*
%8 = bitcast i32* %2 to i8*
%9 = bitcast %struct.sockaddr_in* %3 to i8*
%10 = getelementptr inbounds [25 x i8], [25 x i8]* %4, i64 0, i64 0
%11 = bitcast %struct.sockaddr_in* %5 to i8*
%12 = bitcast i32* %6 to i8*
%13 = load i8*, i8** @AF_INET
%14 = load i32, i32* @SOCK_DGRAM
%15 = tail call i32 @socket(i8* %13, i32 %14, i32 0)
%16 = call i32 @FD_ZERO(i32* %2)
%17 = call i32 @FD_SET(i32 %15, i32* %2)
%18 = icmp eq i32 %15, -1
br i1 %18, label %19, label %22
19: ; preds = %0
%20 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str.10, i64 0, i64 0))
%21 = call i32 @exit(i32 -1)
unreachable
22: ; preds = %0
%23 = load i8*, i8** @AF_INET
%24 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %3, i64 0, i32 2
store i8* %23, i8** %24
%25 = call i8* @htons(i32 1999)
%26 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %3, i64 0, i32 1
store i8* %25, i8** %26
%27 = call i8* @inet_addr(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.1, i64 0, i64 0))
%28 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %3, i64 0, i32 0, i32 0
store i8* %27, i8** %28
%29 = bitcast %struct.sockaddr_in* %3 to %struct.sockaddr*
%30 = call i32 @bind(i32 %15, %struct.sockaddr* %29, i32 24)
%31 = icmp eq i32 %30, -1
br i1 %31, label %32, label %34
32: ; preds = %22
%33 = call i32 @close(i32 %15)
br label %34
34: ; preds = %32, %22
%35 = load i8*, i8** @AF_INET
%36 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %5, i64 0, i32 2
store i8* %35, i8** %36
%37 = call i8* @htons(i32 13)
%38 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %5, i64 0, i32 1
store i8* %37, i8** %38
%39 = call i8* @inet_addr(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.2, i64 0, i64 0))
%40 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %5, i64 0, i32 0, i32 0
store i8* %39, i8** %40
store i32 24, i32* %6
%41 = call i32 @time(i32* null)
%42 = call i32 @srand(i32 %41)
%43 = call i32 @strcpy(i8* %10, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.3, i64 0, i64 0))
%44 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.4, i64 0, i64 0), i8* %10)
%45 = bitcast %struct.sockaddr_in* %5 to %struct.sockaddr*
%46 = call i32 @sendto(i32 %15, i8* %10, i32 25, i32 0, %struct.sockaddr* %45, i32 24)
%47 = icmp slt i32 %46, 0
br i1 %47, label %48, label %50
48: ; preds = %34
%49 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str.9, i64 0, i64 0))
br label %50
50: ; preds = %48, %34
%51 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 0
store i32 5, i32* %51
%52 = getelementptr inbounds %struct.timeval, %struct.timeval* %1, i64 0, i32 1
store i64 0, i64* %52
%53 = add nuw nsw i32 %15, 1
%54 = call i32 @select(i32 %53, i32* %2, i32* null, i32* null, %struct.timeval* %1)
switch i32 %54, label %57 [
i32 0, label %60
i32 -1, label %55
]
55: ; preds = %63, %60, %50
%56 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.7, i64 0, i64 0))
br label %68
57: ; preds = %63, %60, %50
%58 = call i32 @recvfrom(i32 %15, i8* %10, i32 25, i32 0, %struct.sockaddr* %45, i32* %6)
%59 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.8, i64 0, i64 0), i8* %10)
br label %68
60: ; preds = %50
%61 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str, i64 0, i64 0))
%62 = call i32 @select(i32 %53, i32* %2, i32* null, i32* null, %struct.timeval* %1)
switch i32 %62, label %57 [
i32 0, label %63
i32 -1, label %55
]
63: ; preds = %60
%64 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str, i64 0, i64 0))
%65 = call i32 @select(i32 %53, i32* %2, i32* null, i32* null, %struct.timeval* %1)
switch i32 %65, label %57 [
i32 0, label %66
i32 -1, label %55
]
66: ; preds = %63
%67 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @str, i64 0, i64 0))
br label %68
68: ; preds = %66, %57, %55
ret i32 0
}