#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 /*<<< orphan*/ time_t;
struct tm {
  int dummy;
};
struct timeval {
  int tv_sec;
  scalar_t__ tv_usec;
};
struct sockaddr_storage {
  int dummy;
};
struct sockaddr {
  int dummy;
};
struct addrinfo {
  int /*<<< orphan*/ ai_addrlen;
  scalar_t__ ai_addr;
  scalar_t__ ai_protocol;
  int /*<<< orphan*/ ai_socktype;
  int /*<<< orphan*/ ai_family;
  int /*<<< orphan*/ ai_flags;
};
typedef int socklen_t;
typedef int /*<<< orphan*/ fd_set;
typedef int /*<<< orphan*/ cliente;

/* Variables and functions */
int /*<<< orphan*/ AF_UNSPEC;
int /*<<< orphan*/ AI_PASSIVE;
scalar_t__ FD_ISSET(int, int /*<<< orphan*/ *);
int /*<<< orphan*/ FD_SET(int, int /*<<< orphan*/ *);
int /*<<< orphan*/ FD_ZERO(int /*<<< orphan*/ *);
int NI_MAXHOST;
int NI_MAXSERV;
int NI_NUMERICHOST;
int NI_NUMERICSERV;
int /*<<< orphan*/ SOCK_DGRAM;
int /*<<< orphan*/ _exit(int);
int /*<<< orphan*/ bind(int, struct sockaddr *, int /*<<< orphan*/);
int /*<<< orphan*/ close(int);
char *ctime(int /*<<< orphan*/ *);
int /*<<< orphan*/ freeaddrinfo(struct addrinfo *);
int /*<<< orphan*/ getaddrinfo(char *, char *, struct addrinfo *,
                               struct addrinfo **);
int /*<<< orphan*/ getnameinfo(struct sockaddr *, int, char *, int, char *, int,
                               int);
struct tm *localtime(int /*<<< orphan*/ *);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *, ...);
int recvfrom(int, char *, int, int /*<<< orphan*/, struct sockaddr *, int *);
int /*<<< orphan*/ scanf(char *, char *);
int /*<<< orphan*/ select(int, int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                          int /*<<< orphan*/ *, struct timeval *);
int /*<<< orphan*/ sendto(int, char *, int, int /*<<< orphan*/,
                          struct sockaddr *, int);
int /*<<< orphan*/ sleep(int);
int socket(int /*<<< orphan*/, int /*<<< orphan*/, scalar_t__);
scalar_t__ strcmp(char *, char *);
int /*<<< orphan*/ strftime(char *, int, char *, struct tm *);
int strlen(char *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main(int argc, char **argv) {
  int udp_socket;
  struct addrinfo hints;
  struct addrinfo *res;
  char buffer[80];
  fd_set set;
  int recv = 0;
  struct timeval t;
  t.tv_sec = 2;
  t.tv_usec = 0;
  hints.ai_flags = AI_PASSIVE;
  hints.ai_family = AF_UNSPEC;
  hints.ai_socktype = SOCK_DGRAM;
  hints.ai_protocol = 0;
  printf("argc: %d\n", argc);
  if (argc < 2) {
    perror("Error de argumentos.\n");
  }
  getaddrinfo(argv[1], argv[2], &hints, &res);
  udp_socket = socket(res->ai_family, res->ai_socktype, res->ai_protocol);
  bind(udp_socket, (struct sockaddr *)res->ai_addr, res->ai_addrlen);
  while (1) {
    struct sockaddr_storage cliente;
    socklen_t cliente_len = sizeof(cliente);
    char host[NI_MAXHOST];
    char serv[NI_MAXSERV];
    FD_ZERO(&set);
    FD_SET(udp_socket, &set);
    FD_SET(0, &set);
    select(udp_socket + 1, &set, NULL, NULL, &t);
    if (FD_ISSET(0, &set)) {
      scanf("%s", buffer);
    } else if (FD_ISSET(udp_socket, &set)) {
      printf("Recibiendo mensajes.\n");
      recv = recvfrom(udp_socket, buffer, 80, 0, (struct sockaddr *)&cliente,
                      &cliente_len);
      buffer[recv] = '\0';
    }
    if (strcmp(buffer, "t") == 0 || strcmp(buffer, "t\n") == 0) {
      time_t t = time(NULL);
      if (FD_ISSET(0, &set)) {
        printf("%s\n", ctime(&t));
      } else if (FD_ISSET(udp_socket, &set)) {
        sendto(udp_socket, ctime(&t), strlen(ctime(&t)), 0,
               (struct sockaddr *)&cliente, cliente_len);
      }
    } else if (strcmp(buffer, "d") == 0 || strcmp(buffer, "d\n") == 0) {
      time_t t = time(NULL);
      struct tm *lc;
      lc = localtime(&t);
      strftime(buffer, 50, "Hoy es %A", lc);
      if (FD_ISSET(0, &set)) {
        printf("%s\n", buffer);
      } else if (FD_ISSET(udp_socket, &set)) {
        sendto(udp_socket, buffer, strlen(buffer), 0,
               (struct sockaddr *)&cliente, cliente_len);
      }
    } else if (strcmp(buffer, "q") == 0 || strcmp(buffer, "q\n") == 0) {
      if (FD_ISSET(0, &set)) {
        printf("Salir.\n");
      } else if (FD_ISSET(udp_socket, &set)) {
        sendto(udp_socket, "CERRANDO CONEXION..", 20, 0,
               (struct sockaddr *)&cliente, cliente_len);
      }
      freeaddrinfo(res);
      close(udp_socket);
      _exit(1);
    }
    if (recv > 0) {
      getnameinfo((struct sockaddr *)&cliente, cliente_len, host, NI_MAXHOST,
                  serv, NI_MAXSERV, NI_NUMERICHOST | NI_NUMERICSERV);
      printf("Host: %s, Puerto: %s\n", host, serv);
      printf("Mensaje (%i): %s\n", recv, buffer);
      recv = 0;
      sleep(3);
    }
  }
  freeaddrinfo(res);
  close(udp_socket);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0xa8(%rbp)
movl   $0x2,-0xb8(%rbp)
movq   $0x0,-0xb0(%rbp)
mov    0x2d31(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x20(%rbp)
mov    0x2d1d(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x24(%rbp)
mov    0x2d01(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x28(%rbp)
movq   $0x0,-0x30(%rbp)
mov    -0x8(%rbp),%esi
lea    0xd22(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
cmpl   $0x2,-0x8(%rbp)
jge    12fb <main+0x8b>
lea    0xd14(%rip),%rdi
call   1140 <perror@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rsi
lea    -0x40(%rbp),%rdx
lea    -0x48(%rbp),%rcx
call   1150 <getaddrinfo@plt>
mov    -0x48(%rbp),%rax
mov    0x1c(%rax),%edi
mov    -0x48(%rbp),%rax
mov    0x18(%rax),%esi
mov    -0x48(%rbp),%rax
mov    0x10(%rax),%rdx
call   1190 <socket@plt>
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%edi
mov    -0x48(%rbp),%rax
mov    0x8(%rax),%rsi
mov    -0x48(%rbp),%rax
mov    (%rax),%edx
call   1120 <bind@plt>
movl   $0x4,-0xc4(%rbp)
mov    0x2c53(%rip),%rax
mov    (%rax),%eax
mov    %rsp,%rcx
mov    %rcx,-0xd0(%rbp)
mov    %rax,%rdx
add    $0xf,%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x100(%rbp)
mov    %rcx,%rsp
mov    %rax,-0xd8(%rbp)
mov    0x2c3e(%rip),%rax
mov    (%rax),%eax
mov    %rax,%rdx
add    $0xf,%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0xf8(%rbp)
mov    %rcx,%rsp
mov    %rax,-0xe0(%rbp)
lea    -0xa4(%rbp),%rdi
call   10e0 <FD_ZERO@plt>
mov    -0x14(%rbp),%edi
lea    -0xa4(%rbp),%rsi
call   1160 <FD_SET@plt>
xor    %edi,%edi
lea    -0xa4(%rbp),%rsi
call   1160 <FD_SET@plt>
mov    -0x14(%rbp),%edi
add    $0x1,%edi
lea    -0xa4(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%ecx
lea    -0xb8(%rbp),%r8
mov    %rcx,%rdx
call   10f0 <select@plt>
xor    %edi,%edi
lea    -0xa4(%rbp),%rsi
call   1050 <FD_ISSET@plt>
cmp    $0x0,%rax
je     142f <main+0x1bf>
lea    -0xa0(%rbp),%rsi
lea    0xbfb(%rip),%rdi
call   1110 <scanf@plt>
jmp    1494 <main+0x224>
mov    -0x14(%rbp),%edi
lea    -0xa4(%rbp),%rsi
call   1050 <FD_ISSET@plt>
cmp    $0x0,%rax
je     148f <main+0x21f>
lea    0xbd4(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
mov    -0x14(%rbp),%edi
lea    -0xa0(%rbp),%rsi
lea    -0xc0(%rbp),%r8
mov    $0x50,%edx
xor    %ecx,%ecx
lea    -0xc4(%rbp),%r9
call   1100 <recvfrom@plt>
mov    %eax,-0xa8(%rbp)
movslq -0xa8(%rbp),%rax
movb   $0x0,-0xa0(%rbp,%rax,1)
jmp    1494 <main+0x224>
lea    -0xa0(%rbp),%rdi
lea    0xb97(%rip),%rsi
call   10c0 <strcmp@plt>
cmp    $0x0,%rax
je     14ce <main+0x25e>
lea    -0xa0(%rbp),%rdi
lea    0xb7c(%rip),%rsi
call   10c0 <strcmp@plt>
cmp    $0x0,%rax
jne    158e <main+0x31e>
xor    %eax,%eax
mov    %eax,%edi
call   10d0 <time@plt>
mov    %eax,-0xe4(%rbp)
xor    %edi,%edi
lea    -0xa4(%rbp),%rsi
call   1050 <FD_ISSET@plt>
cmp    $0x0,%rax
je     1517 <main+0x2a7>
lea    -0xe4(%rbp),%rdi
call   1060 <ctime@plt>
mov    %rax,%rsi
lea    0xb84(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
jmp    1589 <main+0x319>
mov    -0x14(%rbp),%edi
lea    -0xa4(%rbp),%rsi
call   1050 <FD_ISSET@plt>
cmp    $0x0,%rax
je     1584 <main+0x314>
mov    -0x14(%rbp),%eax
mov    %eax,-0x10c(%rbp)
lea    -0xe4(%rbp),%rdi
call   1060 <ctime@plt>
mov    %rax,-0x108(%rbp)
lea    -0xe4(%rbp),%rdi
call   1060 <ctime@plt>
mov    %rax,%rdi
call   1070 <strlen@plt>
mov    -0x10c(%rbp),%edi
mov    -0x108(%rbp),%rsi
mov    %eax,%edx
lea    -0xc0(%rbp),%r8
mov    -0xc4(%rbp),%r9d
xor    %ecx,%ecx
call   1090 <sendto@plt>
jmp    1589 <main+0x319>
jmp    1771 <main+0x501>
lea    -0xa0(%rbp),%rdi
lea    0xaa2(%rip),%rsi
call   10c0 <strcmp@plt>
cmp    $0x0,%rax
je     15c8 <main+0x358>
lea    -0xa0(%rbp),%rdi
lea    0xa4e(%rip),%rsi
call   10c0 <strcmp@plt>
cmp    $0x0,%rax
jne    16a5 <main+0x435>
xor    %eax,%eax
mov    %eax,%edi
call   10d0 <time@plt>
mov    %eax,-0xe8(%rbp)
lea    -0xe8(%rbp),%rdi
call   1030 <localtime@plt>
mov    %rax,-0xf0(%rbp)
lea    -0xa0(%rbp),%rdi
mov    -0xf0(%rbp),%rcx
mov    $0x32,%esi
lea    0xa3c(%rip),%rdx
call   1130 <strftime@plt>
xor    %edi,%edi
lea    -0xa4(%rbp),%rsi
call   1050 <FD_ISSET@plt>
cmp    $0x0,%rax
je     163b <main+0x3cb>
lea    -0xa0(%rbp),%rsi
lea    0xa60(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
jmp    16a0 <main+0x430>
mov    -0x14(%rbp),%edi
lea    -0xa4(%rbp),%rsi
call   1050 <FD_ISSET@plt>
cmp    $0x0,%rax
je     169b <main+0x42b>
mov    -0x14(%rbp),%eax
mov    %eax,-0x11c(%rbp)
lea    -0xa0(%rbp),%rax
mov    %rax,-0x118(%rbp)
lea    -0xa0(%rbp),%rdi
call   1070 <strlen@plt>
mov    -0x11c(%rbp),%edi
mov    -0x118(%rbp),%rsi
mov    %eax,%edx
lea    -0xc0(%rbp),%r8
mov    -0xc4(%rbp),%r9d
xor    %ecx,%ecx
call   1090 <sendto@plt>
jmp    16a0 <main+0x430>
jmp    176c <main+0x4fc>
lea    -0xa0(%rbp),%rdi
lea    0x997(%rip),%rsi
call   10c0 <strcmp@plt>
cmp    $0x0,%rax
je     16df <main+0x46f>
lea    -0xa0(%rbp),%rdi
lea    0x97c(%rip),%rsi
call   10c0 <strcmp@plt>
cmp    $0x0,%rax
jne    1767 <main+0x4f7>
xor    %edi,%edi
lea    -0xa4(%rbp),%rsi
call   1050 <FD_ISSET@plt>
cmp    $0x0,%rax
je     170a <main+0x49a>
lea    0x951(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
jmp    174c <main+0x4dc>
mov    -0x14(%rbp),%edi
lea    -0xa4(%rbp),%rsi
call   1050 <FD_ISSET@plt>
cmp    $0x0,%rax
je     1747 <main+0x4d7>
mov    -0x14(%rbp),%edi
lea    -0xc0(%rbp),%r8
mov    -0xc4(%rbp),%r9d
lea    0x91c(%rip),%rsi
mov    $0x14,%edx
xor    %ecx,%ecx
call   1090 <sendto@plt>
jmp    174c <main+0x4dc>
mov    -0x48(%rbp),%rdi
call   1180 <freeaddrinfo@plt>
mov    -0x14(%rbp),%edi
call   10a0 <close@plt>
mov    $0x1,%edi
call   1040 <_exit@plt>
jmp    176c <main+0x4fc>
jmp    1771 <main+0x501>
cmpl   $0x0,-0xa8(%rbp)
jle    181a <main+0x5aa>
mov    -0xf8(%rbp),%r8
mov    -0x100(%rbp),%rdx
lea    -0xc0(%rbp),%rdi
mov    -0xc4(%rbp),%esi
mov    0x2810(%rip),%rax
mov    (%rax),%ecx
mov    0x2827(%rip),%rax
mov    (%rax),%r9d
mov    0x2805(%rip),%rax
mov    (%rax),%eax
mov    0x282c(%rip),%r10
or     (%r10),%eax
sub    $0x10,%rsp
mov    %eax,(%rsp)
call   10b0 <getnameinfo@plt>
mov    -0x100(%rbp),%rsi
mov    -0xf8(%rbp),%rdx
add    $0x10,%rsp
lea    0x887(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
mov    -0xa8(%rbp),%esi
lea    -0xa0(%rbp),%rdx
lea    0x882(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
movl   $0x0,-0xa8(%rbp)
mov    $0x3,%edi
call   1170 <sleep@plt>
mov    -0xd0(%rbp),%rax
mov    %rax,%rsp
jmp    134c <main+0xdc>

x86 assembly (clang, -O2):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xc8,%rsp
mov    %rsi,%r14
mov    %edi,%ebx
movl   $0x2,-0x70(%rbp)
movq   $0x0,-0x68(%rbp)
mov    0x2d31(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x78(%rbp)
mov    0x2d1d(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x7c(%rbp)
mov    0x2d01(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x80(%rbp)
movq   $0x0,-0x88(%rbp)
lea    0xd22(%rip),%rdi
xor    %r13d,%r13d
mov    %ebx,%esi
xor    %eax,%eax
call   1090 <printf@plt>
cmp    $0x1,%ebx
jg     12fb <main+0x7b>
lea    0xd14(%rip),%rdi
call   1150 <perror@plt>
mov    0x8(%r14),%rdi
mov    0x10(%r14),%rsi
lea    -0x98(%rbp),%rdx
lea    -0x48(%rbp),%rcx
call   1160 <getaddrinfo@plt>
mov    -0x48(%rbp),%rax
mov    0x1c(%rax),%edi
mov    0x18(%rax),%esi
mov    0x10(%rax),%rdx
call   11a0 <socket@plt>
mov    %eax,%ebx
mov    -0x48(%rbp),%rax
mov    0x8(%rax),%rsi
mov    (%rax),%edx
mov    %ebx,%edi
call   1130 <bind@plt>
mov    %ebx,-0x2c(%rbp)
add    $0x1,%ebx
mov    %ebx,-0x4c(%rbp)
lea    -0x40(%rbp),%rbx
jmp    1354 <main+0xd4>
nopl   0x0(%rax,%rax,1)
mov    -0x60(%rbp),%rsp
mov    %rsp,-0x60(%rbp)
movl   $0x4,-0x30(%rbp)
mov    0x2c4a(%rip),%rax
mov    (%rax),%eax
mov    %rsp,%r15
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%r15
mov    %r15,%rsp
mov    0x2c50(%rip),%rax
mov    (%rax),%eax
mov    %rsp,%r14
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%r14
mov    %r14,%rsp
mov    %rbx,%rdi
call   10f0 <FD_ZERO@plt>
mov    -0x2c(%rbp),%edi
mov    %rbx,%rsi
call   1170 <FD_SET@plt>
xor    %edi,%edi
mov    %rbx,%rsi
call   1170 <FD_SET@plt>
mov    -0x4c(%rbp),%edi
mov    %rbx,%rsi
xor    %edx,%edx
xor    %ecx,%ecx
lea    -0x70(%rbp),%r8
call   1100 <select@plt>
xor    %edi,%edi
mov    %rbx,%rsi
call   1060 <FD_ISSET@plt>
test   %rax,%rax
je     13f0 <main+0x170>
lea    0xc47(%rip),%rdi
lea    -0xf0(%rbp),%r12
mov    %r12,%rsi
call   1120 <scanf@plt>
jmp    143a <main+0x1ba>
nopw   0x0(%rax,%rax,1)
mov    -0x2c(%rbp),%edi
mov    %rbx,%rsi
call   1060 <FD_ISSET@plt>
test   %rax,%rax
lea    -0xf0(%rbp),%r12
je     143a <main+0x1ba>
lea    0xc6e(%rip),%rdi
call   1050 <puts@plt>
mov    -0x2c(%rbp),%edi
mov    %r12,%rsi
mov    $0x50,%edx
xor    %ecx,%ecx
lea    -0x38(%rbp),%r8
lea    -0x30(%rbp),%r9
call   1110 <recvfrom@plt>
mov    %eax,%r13d
cltq
movb   $0x0,-0xf0(%rbp,%rax,1)
mov    %r12,%rdi
lea    0xbdf(%rip),%rsi
call   10d0 <strcmp@plt>
test   %rax,%rax
je     14d0 <main+0x250>
mov    %r12,%rdi
lea    0xbc9(%rip),%rsi
call   10d0 <strcmp@plt>
test   %rax,%rax
je     14d0 <main+0x250>
mov    %r12,%rdi
lea    0xbb8(%rip),%rsi
call   10d0 <strcmp@plt>
test   %rax,%rax
je     1500 <main+0x280>
mov    %r12,%rdi
lea    0xb7f(%rip),%rsi
call   10d0 <strcmp@plt>
test   %rax,%rax
je     1500 <main+0x280>
mov    %r12,%rdi
lea    0xb98(%rip),%rsi
call   10d0 <strcmp@plt>
test   %rax,%rax
je     1657 <main+0x3d7>
lea    -0xf0(%rbp),%rdi
lea    0xb7e(%rip),%rsi
call   10d0 <strcmp@plt>
test   %rax,%rax
jne    15d0 <main+0x350>
jmp    1657 <main+0x3d7>
nopl   0x0(%rax,%rax,1)
xor    %edi,%edi
call   10e0 <time@plt>
mov    %eax,-0x3c(%rbp)
xor    %edi,%edi
mov    %rbx,%rsi
call   1060 <FD_ISSET@plt>
test   %rax,%rax
je     1550 <main+0x2d0>
lea    -0x3c(%rbp),%rdi
call   1070 <ctime@plt>
mov    %rax,%rdi
jmp    153c <main+0x2bc>
nopw   0x0(%rax,%rax,1)
xor    %edi,%edi
call   10e0 <time@plt>
mov    %eax,-0x3c(%rbp)
lea    -0x3c(%rbp),%rdi
call   1030 <localtime@plt>
mov    %r12,%rdi
mov    $0x32,%esi
lea    0xb08(%rip),%rdx
mov    %rax,%rcx
call   1140 <strftime@plt>
xor    %edi,%edi
mov    %rbx,%rsi
call   1060 <FD_ISSET@plt>
test   %rax,%rax
je     1593 <main+0x313>
mov    %r12,%rdi
call   1050 <puts@plt>
jmp    15d0 <main+0x350>
cs nopw 0x0(%rax,%rax,1)
mov    -0x2c(%rbp),%edi
mov    %rbx,%rsi
call   1060 <FD_ISSET@plt>
test   %rax,%rax
je     15d0 <main+0x350>
lea    -0x3c(%rbp),%r12
mov    %r12,%rdi
call   1070 <ctime@plt>
mov    %r13,-0x58(%rbp)
mov    %rax,%r13
mov    %r12,%rdi
call   1070 <ctime@plt>
mov    %rax,%rdi
call   1080 <strlen@plt>
mov    -0x30(%rbp),%r9d
mov    -0x2c(%rbp),%edi
mov    %r13,%rsi
mov    -0x58(%rbp),%r13
jmp    15bc <main+0x33c>
mov    -0x2c(%rbp),%edi
mov    %rbx,%rsi
call   1060 <FD_ISSET@plt>
test   %rax,%rax
je     15d0 <main+0x350>
lea    -0xf0(%rbp),%r12
mov    %r12,%rdi
call   1080 <strlen@plt>
mov    -0x30(%rbp),%r9d
mov    -0x2c(%rbp),%edi
mov    %r12,%rsi
mov    %eax,%edx
xor    %ecx,%ecx
lea    -0x38(%rbp),%r8
call   10a0 <sendto@plt>
nopl   0x0(%rax)
test   %r13d,%r13d
jle    1350 <main+0xd0>
mov    -0x30(%rbp),%esi
mov    0x29cd(%rip),%rax
mov    (%rax),%ecx
mov    0x29e4(%rip),%rax
mov    (%rax),%r9d
mov    0x29f2(%rip),%rax
mov    (%rax),%eax
mov    0x29b9(%rip),%rdx
or     (%rdx),%eax
sub    $0x8,%rsp
lea    -0x38(%rbp),%rdi
mov    %r15,%rdx
mov    %r14,%r8
push   %rax
call   10c0 <getnameinfo@plt>
add    $0x10,%rsp
lea    0xa2d(%rip),%rdi
mov    %r15,%rsi
mov    %r14,%rdx
xor    %eax,%eax
call   1090 <printf@plt>
lea    0xa2f(%rip),%rdi
mov    %r13d,%esi
lea    -0xf0(%rbp),%rdx
xor    %eax,%eax
call   1090 <printf@plt>
mov    $0x3,%edi
call   1180 <sleep@plt>
xor    %r13d,%r13d
jmp    1350 <main+0xd0>
lea    -0x40(%rbp),%rsi
xor    %edi,%edi
call   1060 <FD_ISSET@plt>
test   %rax,%rax
jne    1698 <main+0x418>
lea    -0x40(%rbp),%rsi
mov    -0x2c(%rbp),%edi
call   1060 <FD_ISSET@plt>
test   %rax,%rax
je     16a4 <main+0x424>
mov    -0x30(%rbp),%r9d
lea    0x9b6(%rip),%rsi
lea    -0x38(%rbp),%r8
mov    -0x2c(%rbp),%edi
mov    $0x14,%edx
xor    %ecx,%ecx
call   10a0 <sendto@plt>
jmp    16a4 <main+0x424>
lea    0x9d6(%rip),%rdi
call   1050 <puts@plt>
mov    -0x48(%rbp),%rdi
call   1190 <freeaddrinfo@plt>
mov    -0x2c(%rbp),%edi
call   10b0 <close@plt>
mov    $0x1,%edi
call   1040 <_exit@plt>

LLVM IR (-O0):
%struct.addrinfo = type { i32, i64, i64, i32, i32, i32 }
%struct.timeval = type { i32, i64 }
%struct.sockaddr_storage = type { i32 }
%struct.tm = type { i32 }
%struct.sockaddr = type { i32 }
@AI_PASSIVE = global i32 0
@AF_UNSPEC = global i32 0
@SOCK_DGRAM = global i32 0
@.str = [10 x i8] c"argc: %d\0A\00"
@.str.1 = [22 x i8] c"Error de argumentos.\0A\00"
@NI_MAXHOST = global i32 0
@NI_MAXSERV = global i32 0
@.str.2 = [3 x i8] c"%s\00"
@.str.3 = [22 x i8] c"Recibiendo mensajes.\0A\00"
@.str.4 = [2 x i8] c"t\00"
@.str.5 = [3 x i8] c"t\0A\00"
@.str.6 = [4 x i8] c"%s\0A\00"
@.str.7 = [2 x i8] c"d\00"
@.str.8 = [3 x i8] c"d\0A\00"
@.str.9 = [10 x i8] c"Hoy es %A\00"
@.str.10 = [2 x i8] c"q\00"
@.str.11 = [3 x i8] c"q\0A\00"
@.str.12 = [8 x i8] c"Salir.\0A\00"
@.str.13 = [20 x i8] c"CERRANDO CONEXION..\00"
@NI_NUMERICHOST = global i32 0
@NI_NUMERICSERV = global i32 0
@.str.14 = [22 x i8] c"Host: %s, Puerto: %s\0A\00"
@.str.15 = [18 x i8] c"Mensaje (%i): %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 [80 x i8]
%10 = alloca i32
%11 = alloca i32
%12 = alloca %struct.timeval
%13 = alloca %struct.sockaddr_storage
%14 = alloca i32
%15 = alloca i8*
%16 = alloca i64
%17 = alloca i64
%18 = alloca i32
%19 = alloca i32
%20 = alloca %struct.tm*
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %11
%21 = getelementptr inbounds %struct.timeval, %struct.timeval* %12, i32 0, i32 0
store i32 2, i32* %21
%22 = getelementptr inbounds %struct.timeval, %struct.timeval* %12, i32 0, i32 1
store i64 0, i64* %22
%23 = load i32, i32* @AI_PASSIVE
%24 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %7, i32 0, i32 5
store i32 %23, i32* %24
%25 = load i32, i32* @AF_UNSPEC
%26 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %7, i32 0, i32 4
store i32 %25, i32* %26
%27 = load i32, i32* @SOCK_DGRAM
%28 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %7, i32 0, i32 3
store i32 %27, i32* %28
%29 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %7, i32 0, i32 2
store i64 0, i64* %29
%30 = load i32, i32* %4
%31 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %30)
%32 = load i32, i32* %4
%33 = icmp slt i32 %32, 2
br i1 %33, label %34, label %36
34: ; preds = %2
%35 = call i32 @perror(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0))
br label %36
36: ; preds = %34, %2
%37 = load i8**, i8*** %5
%38 = getelementptr inbounds i8*, i8** %37, i64 1
%39 = load i8*, i8** %38
%40 = load i8**, i8*** %5
%41 = getelementptr inbounds i8*, i8** %40, i64 2
%42 = load i8*, i8** %41
%43 = call i32 @getaddrinfo(i8* %39, i8* %42, %struct.addrinfo* %7, %struct.addrinfo** %8)
%44 = load %struct.addrinfo*, %struct.addrinfo** %8
%45 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %44, i32 0, i32 4
%46 = load i32, i32* %45
%47 = load %struct.addrinfo*, %struct.addrinfo** %8
%48 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %47, i32 0, i32 3
%49 = load i32, i32* %48
%50 = load %struct.addrinfo*, %struct.addrinfo** %8
%51 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %50, i32 0, i32 2
%52 = load i64, i64* %51
%53 = call i32 @socket(i32 %46, i32 %49, i64 %52)
store i32 %53, i32* %6
%54 = load i32, i32* %6
%55 = load %struct.addrinfo*, %struct.addrinfo** %8
%56 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %55, i32 0, i32 1
%57 = load i64, i64* %56
%58 = inttoptr i64 %57 to %struct.sockaddr*
%59 = load %struct.addrinfo*, %struct.addrinfo** %8
%60 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %59, i32 0, i32 0
%61 = load i32, i32* %60
%62 = call i32 @bind(i32 %54, %struct.sockaddr* %58, i32 %61)
br label %63
63: ; preds = %36, %207
store i32 4, i32* %14
%64 = load i32, i32* @NI_MAXHOST
%65 = zext i32 %64 to i64
%66 = call i8* @llvm.stacksave()
store i8* %66, i8** %15
%67 = alloca i8, i64 %65
store i64 %65, i64* %16
%68 = load i32, i32* @NI_MAXSERV
%69 = zext i32 %68 to i64
%70 = alloca i8, i64 %69
store i64 %69, i64* %17
%71 = call i32 @FD_ZERO(i32* %10)
%72 = load i32, i32* %6
%73 = call i32 @FD_SET(i32 %72, i32* %10)
%74 = call i32 @FD_SET(i32 0, i32* %10)
%75 = load i32, i32* %6
%76 = add nsw i32 %75, 1
%77 = call i32 @select(i32 %76, i32* %10, i32* null, i32* null, %struct.timeval* %12)
%78 = call i64 @FD_ISSET(i32 0, i32* %10)
%79 = icmp ne i64 %78, 0
br i1 %79, label %80, label %83
80: ; preds = %63
%81 = getelementptr inbounds [80 x i8], [80 x i8]* %9, i64 0, i64 0
%82 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %81)
br label %97
83: ; preds = %63
%84 = load i32, i32* %6
%85 = call i64 @FD_ISSET(i32 %84, i32* %10)
%86 = icmp ne i64 %85, 0
br i1 %86, label %87, label %96
87: ; preds = %83
%88 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.3, i64 0, i64 0))
%89 = load i32, i32* %6
%90 = getelementptr inbounds [80 x i8], [80 x i8]* %9, i64 0, i64 0
%91 = bitcast %struct.sockaddr_storage* %13 to %struct.sockaddr*
%92 = call i32 @recvfrom(i32 %89, i8* %90, i32 80, i32 0, %struct.sockaddr* %91, i32* %14)
store i32 %92, i32* %11
%93 = load i32, i32* %11
%94 = sext i32 %93 to i64
%95 = getelementptr inbounds [80 x i8], [80 x i8]* %9, i64 0, i64 %94
store i8 0, i8* %95
br label %96
96: ; preds = %87, %83
br label %97
97: ; preds = %96, %80
%98 = getelementptr inbounds [80 x i8], [80 x i8]* %9, i64 0, i64 0
%99 = call i64 @strcmp(i8* %98, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%100 = icmp eq i64 %99, 0
br i1 %100, label %105, label %101
101: ; preds = %97
%102 = getelementptr inbounds [80 x i8], [80 x i8]* %9, i64 0, i64 0
%103 = call i64 @strcmp(i8* %102, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
%104 = icmp eq i64 %103, 0
br i1 %104, label %105, label %126
105: ; preds = %101, %97
%106 = call i32 @time(i32* null)
store i32 %106, i32* %18
%107 = call i64 @FD_ISSET(i32 0, i32* %10)
%108 = icmp ne i64 %107, 0
br i1 %108, label %109, label %112
109: ; preds = %105
%110 = call i8* @ctime(i32* %18)
%111 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), i8* %110)
br label %125
112: ; preds = %105
%113 = load i32, i32* %6
%114 = call i64 @FD_ISSET(i32 %113, i32* %10)
%115 = icmp ne i64 %114, 0
br i1 %115, label %116, label %124
116: ; preds = %112
%117 = load i32, i32* %6
%118 = call i8* @ctime(i32* %18)
%119 = call i8* @ctime(i32* %18)
%120 = call i32 @strlen(i8* %119)
%121 = bitcast %struct.sockaddr_storage* %13 to %struct.sockaddr*
%122 = load i32, i32* %14
%123 = call i32 @sendto(i32 %117, i8* %118, i32 %120, i32 0, %struct.sockaddr* %121, i32 %122)
br label %124
124: ; preds = %116, %112
br label %125
125: ; preds = %124, %109
br label %190
126: ; preds = %101
%127 = getelementptr inbounds [80 x i8], [80 x i8]* %9, i64 0, i64 0
%128 = call i64 @strcmp(i8* %127, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
%129 = icmp eq i64 %128, 0
br i1 %129, label %134, label %130
130: ; preds = %126
%131 = getelementptr inbounds [80 x i8], [80 x i8]* %9, i64 0, i64 0
%132 = call i64 @strcmp(i8* %131, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0))
%133 = icmp eq i64 %132, 0
br i1 %133, label %134, label %159
134: ; preds = %130, %126
%135 = call i32 @time(i32* null)
store i32 %135, i32* %19
%136 = call %struct.tm* @localtime(i32* %19)
store %struct.tm* %136, %struct.tm** %20
%137 = getelementptr inbounds [80 x i8], [80 x i8]* %9, i64 0, i64 0
%138 = load %struct.tm*, %struct.tm** %20
%139 = call i32 @strftime(i8* %137, i32 50, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.9, i64 0, i64 0), %struct.tm* %138)
%140 = call i64 @FD_ISSET(i32 0, i32* %10)
%141 = icmp ne i64 %140, 0
br i1 %141, label %142, label %145
142: ; preds = %134
%143 = getelementptr inbounds [80 x i8], [80 x i8]* %9, i64 0, i64 0
%144 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.6, i64 0, i64 0), i8* %143)
br label %158
145: ; preds = %134
%146 = load i32, i32* %6
%147 = call i64 @FD_ISSET(i32 %146, i32* %10)
%148 = icmp ne i64 %147, 0
br i1 %148, label %149, label %157
149: ; preds = %145
%150 = load i32, i32* %6
%151 = getelementptr inbounds [80 x i8], [80 x i8]* %9, i64 0, i64 0
%152 = getelementptr inbounds [80 x i8], [80 x i8]* %9, i64 0, i64 0
%153 = call i32 @strlen(i8* %152)
%154 = bitcast %struct.sockaddr_storage* %13 to %struct.sockaddr*
%155 = load i32, i32* %14
%156 = call i32 @sendto(i32 %150, i8* %151, i32 %153, i32 0, %struct.sockaddr* %154, i32 %155)
br label %157
157: ; preds = %149, %145
br label %158
158: ; preds = %157, %142
br label %189
159: ; preds = %130
%160 = getelementptr inbounds [80 x i8], [80 x i8]* %9, i64 0, i64 0
%161 = call i64 @strcmp(i8* %160, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.10, i64 0, i64 0))
%162 = icmp eq i64 %161, 0
br i1 %162, label %167, label %163
163: ; preds = %159
%164 = getelementptr inbounds [80 x i8], [80 x i8]* %9, i64 0, i64 0
%165 = call i64 @strcmp(i8* %164, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i64 0, i64 0))
%166 = icmp eq i64 %165, 0
br i1 %166, label %167, label %188
167: ; preds = %163, %159
%168 = call i64 @FD_ISSET(i32 0, i32* %10)
%169 = icmp ne i64 %168, 0
br i1 %169, label %170, label %172
170: ; preds = %167
%171 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.12, i64 0, i64 0))
br label %182
172: ; preds = %167
%173 = load i32, i32* %6
%174 = call i64 @FD_ISSET(i32 %173, i32* %10)
%175 = icmp ne i64 %174, 0
br i1 %175, label %176, label %181
176: ; preds = %172
%177 = load i32, i32* %6
%178 = bitcast %struct.sockaddr_storage* %13 to %struct.sockaddr*
%179 = load i32, i32* %14
%180 = call i32 @sendto(i32 %177, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.13, i64 0, i64 0), i32 20, i32 0, %struct.sockaddr* %178, i32 %179)
br label %181
181: ; preds = %176, %172
br label %182
182: ; preds = %181, %170
%183 = load %struct.addrinfo*, %struct.addrinfo** %8
%184 = call i32 @freeaddrinfo(%struct.addrinfo* %183)
%185 = load i32, i32* %6
%186 = call i32 @close(i32 %185)
%187 = call i32 @_exit(i32 1)
unreachable
188: ; preds = %163
br label %189
189: ; preds = %188, %158
br label %190
190: ; preds = %189, %125
%191 = load i32, i32* %11
%192 = icmp sgt i32 %191, 0
br i1 %192, label %193, label %207
193: ; preds = %190
%194 = bitcast %struct.sockaddr_storage* %13 to %struct.sockaddr*
%195 = load i32, i32* %14
%196 = load i32, i32* @NI_MAXHOST
%197 = load i32, i32* @NI_MAXSERV
%198 = load i32, i32* @NI_NUMERICHOST
%199 = load i32, i32* @NI_NUMERICSERV
%200 = or i32 %198, %199
%201 = call i32 @getnameinfo(%struct.sockaddr* %194, i32 %195, i8* %67, i32 %196, i8* %70, i32 %197, i32 %200)
%202 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.14, i64 0, i64 0), i8* %67, i8* %70)
%203 = load i32, i32* %11
%204 = getelementptr inbounds [80 x i8], [80 x i8]* %9, i64 0, i64 0
%205 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.15, i64 0, i64 0), i32 %203, i8* %204)
store i32 0, i32* %11
%206 = call i32 @sleep(i32 3)
br label %207
207: ; preds = %193, %190
%208 = load i8*, i8** %15
br label %63
}

LLVM IR (-O2):
%struct.addrinfo = type { i32, i64, i64, i32, i32, i32 }
%struct.timeval = type { i32, i64 }
%struct.sockaddr_storage = type { i32 }
%struct.sockaddr = type { i32 }
%struct.tm = type { i32 }
@AI_PASSIVE = global i32 0
@AF_UNSPEC = global i32 0
@SOCK_DGRAM = global i32 0
@.str = [10 x i8] c"argc: %d\0A\00"
@.str.1 = [22 x i8] c"Error de argumentos.\0A\00"
@NI_MAXHOST = global i32 0
@NI_MAXSERV = global i32 0
@.str.2 = [3 x i8] c"%s\00"
@.str.4 = [2 x i8] c"t\00"
@.str.5 = [3 x i8] c"t\0A\00"
@.str.7 = [2 x i8] c"d\00"
@.str.8 = [3 x i8] c"d\0A\00"
@.str.9 = [10 x i8] c"Hoy es %A\00"
@.str.10 = [2 x i8] c"q\00"
@.str.11 = [3 x i8] c"q\0A\00"
@.str.13 = [20 x i8] c"CERRANDO CONEXION..\00"
@NI_NUMERICHOST = global i32 0
@NI_NUMERICSERV = global i32 0
@.str.14 = [22 x i8] c"Host: %s, Puerto: %s\0A\00"
@.str.15 = [18 x i8] c"Mensaje (%i): %s\0A\00"
@str = [7 x i8] c"Salir.\00"
@str.16 = [21 x i8] c"Recibiendo mensajes.\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca %struct.addrinfo
%4 = alloca %struct.addrinfo*
%5 = alloca [80 x i8]
%6 = alloca i32
%7 = alloca %struct.timeval
%8 = alloca %struct.sockaddr_storage
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = bitcast %struct.addrinfo* %3 to i8*
%13 = bitcast %struct.addrinfo** %4 to i8*
%14 = getelementptr inbounds [80 x i8], [80 x i8]* %5, i64 0, i64 0
%15 = bitcast i32* %6 to i8*
%16 = bitcast %struct.timeval* %7 to i8*
%17 = getelementptr inbounds %struct.timeval, %struct.timeval* %7, i64 0, i32 0
store i32 2, i32* %17
%18 = getelementptr inbounds %struct.timeval, %struct.timeval* %7, i64 0, i32 1
store i64 0, i64* %18
%19 = load i32, i32* @AI_PASSIVE
%20 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %3, i64 0, i32 5
store i32 %19, i32* %20
%21 = load i32, i32* @AF_UNSPEC
%22 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %3, i64 0, i32 4
store i32 %21, i32* %22
%23 = load i32, i32* @SOCK_DGRAM
%24 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %3, i64 0, i32 3
store i32 %23, i32* %24
%25 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %3, i64 0, i32 2
store i64 0, i64* %25
%26 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %0)
%27 = icmp slt i32 %0, 2
br i1 %27, label %28, label %30
28: ; preds = %2
%29 = tail call i32 @perror(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.1, i64 0, i64 0))
br label %30
30: ; preds = %28, %2
%31 = getelementptr inbounds i8*, i8** %1, i64 1
%32 = load i8*, i8** %31
%33 = getelementptr inbounds i8*, i8** %1, i64 2
%34 = load i8*, i8** %33
%35 = call i32 @getaddrinfo(i8* %32, i8* %34, %struct.addrinfo* %3, %struct.addrinfo** %4)
%36 = load %struct.addrinfo*, %struct.addrinfo** %4
%37 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %36, i64 0, i32 4
%38 = load i32, i32* %37
%39 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %36, i64 0, i32 3
%40 = load i32, i32* %39
%41 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %36, i64 0, i32 2
%42 = load i64, i64* %41
%43 = call i32 @socket(i32 %38, i32 %40, i64 %42)
%44 = load %struct.addrinfo*, %struct.addrinfo** %4
%45 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %44, i64 0, i32 1
%46 = load i64, i64* %45
%47 = inttoptr i64 %46 to %struct.sockaddr*
%48 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %44, i64 0, i32 0
%49 = load i32, i32* %48
%50 = call i32 @bind(i32 %43, %struct.sockaddr* %47, i32 %49)
%51 = bitcast %struct.sockaddr_storage* %8 to i8*
%52 = bitcast i32* %9 to i8*
%53 = add nsw i32 %43, 1
%54 = bitcast %struct.sockaddr_storage* %8 to %struct.sockaddr*
%55 = bitcast i32* %11 to i8*
%56 = bitcast i32* %10 to i8*
br label %57
57: ; preds = %163, %30
%58 = phi i32 [ 0, %30 ], [ %164, %163 ]
store i32 4, i32* %9
%59 = load i32, i32* @NI_MAXHOST
%60 = zext i32 %59 to i64
%61 = call i8* @llvm.stacksave()
%62 = alloca i8, i64 %60
%63 = load i32, i32* @NI_MAXSERV
%64 = zext i32 %63 to i64
%65 = alloca i8, i64 %64
%66 = call i32 @FD_ZERO(i32* %6)
%67 = call i32 @FD_SET(i32 %43, i32* %6)
%68 = call i32 @FD_SET(i32 0, i32* %6)
%69 = call i32 @select(i32 %53, i32* %6, i32* null, i32* null, %struct.timeval* %7)
%70 = call i64 @FD_ISSET(i32 0, i32* %6)
%71 = icmp eq i64 %70, 0
br i1 %71, label %74, label %72
72: ; preds = %57
%73 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i64 0, i64 0), i8* %14)
br label %82
74: ; preds = %57
%75 = call i64 @FD_ISSET(i32 %43, i32* %6)
%76 = icmp eq i64 %75, 0
br i1 %76, label %82, label %77
77: ; preds = %74
%78 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str.16, i64 0, i64 0))
%79 = call i32 @recvfrom(i32 %43, i8* %14, i32 80, i32 0, %struct.sockaddr* %54, i32* %9)
%80 = sext i32 %79 to i64
%81 = getelementptr inbounds [80 x i8], [80 x i8]* %5, i64 0, i64 %80
store i8 0, i8* %81
br label %82
82: ; preds = %74, %77, %72
%83 = phi i32 [ %58, %72 ], [ %79, %77 ], [ %58, %74 ]
%84 = call i64 @strcmp(i8* %14, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%85 = icmp eq i64 %84, 0
br i1 %85, label %89, label %86
86: ; preds = %82
%87 = call i64 @strcmp(i8* %14, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0))
%88 = icmp eq i64 %87, 0
br i1 %88, label %89, label %106
89: ; preds = %86, %82
%90 = call i32 @time(i32* null)
store i32 %90, i32* %10
%91 = call i64 @FD_ISSET(i32 0, i32* %6)
%92 = icmp eq i64 %91, 0
br i1 %92, label %96, label %93
93: ; preds = %89
%94 = call i8* @ctime(i32* %10)
%95 = call i32 @puts(i8* dereferenceable(1) %94)
br label %105
96: ; preds = %89
%97 = call i64 @FD_ISSET(i32 %43, i32* %6)
%98 = icmp eq i64 %97, 0
br i1 %98, label %105, label %99
99: ; preds = %96
%100 = call i8* @ctime(i32* %10)
%101 = call i8* @ctime(i32* %10)
%102 = call i32 @strlen(i8* %101)
%103 = load i32, i32* %9
%104 = call i32 @sendto(i32 %43, i8* %100, i32 %102, i32 0, %struct.sockaddr* %54, i32 %103)
br label %105
105: ; preds = %96, %99, %93
br label %150
106: ; preds = %86
%107 = call i64 @strcmp(i8* %14, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
%108 = icmp eq i64 %107, 0
br i1 %108, label %112, label %109
109: ; preds = %106
%110 = call i64 @strcmp(i8* %14, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0))
%111 = icmp eq i64 %110, 0
br i1 %111, label %112, label %128
112: ; preds = %109, %106
%113 = call i32 @time(i32* null)
store i32 %113, i32* %11
%114 = call %struct.tm* @localtime(i32* %11)
%115 = call i32 @strftime(i8* %14, i32 50, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.9, i64 0, i64 0), %struct.tm* %114)
%116 = call i64 @FD_ISSET(i32 0, i32* %6)
%117 = icmp eq i64 %116, 0
br i1 %117, label %120, label %118
118: ; preds = %112
%119 = call i32 @puts(i8* %14)
br label %127
120: ; preds = %112
%121 = call i64 @FD_ISSET(i32 %43, i32* %6)
%122 = icmp eq i64 %121, 0
br i1 %122, label %127, label %123
123: ; preds = %120
%124 = call i32 @strlen(i8* %14)
%125 = load i32, i32* %9
%126 = call i32 @sendto(i32 %43, i8* %14, i32 %124, i32 0, %struct.sockaddr* %54, i32 %125)
br label %127
127: ; preds = %120, %123, %118
br label %150
128: ; preds = %109
%129 = call i64 @strcmp(i8* %14, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.10, i64 0, i64 0))
%130 = icmp eq i64 %129, 0
br i1 %130, label %134, label %131
131: ; preds = %128
%132 = call i64 @strcmp(i8* %14, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i64 0, i64 0))
%133 = icmp eq i64 %132, 0
br i1 %133, label %134, label %150
134: ; preds = %131, %128
%135 = call i64 @FD_ISSET(i32 0, i32* %6)
%136 = icmp eq i64 %135, 0
br i1 %136, label %139, label %137
137: ; preds = %134
%138 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
br label %145
139: ; preds = %134
%140 = call i64 @FD_ISSET(i32 %43, i32* %6)
%141 = icmp eq i64 %140, 0
br i1 %141, label %145, label %142
142: ; preds = %139
%143 = load i32, i32* %9
%144 = call i32 @sendto(i32 %43, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.13, i64 0, i64 0), i32 20, i32 0, %struct.sockaddr* %54, i32 %143)
br label %145
145: ; preds = %139, %142, %137
%146 = load %struct.addrinfo*, %struct.addrinfo** %4
%147 = call i32 @freeaddrinfo(%struct.addrinfo* %146)
%148 = call i32 @close(i32 %43)
%149 = call i32 @_exit(i32 1)
unreachable
150: ; preds = %127, %131, %105
%151 = icmp sgt i32 %83, 0
br i1 %151, label %152, label %163
152: ; preds = %150
%153 = load i32, i32* %9
%154 = load i32, i32* @NI_MAXHOST
%155 = load i32, i32* @NI_MAXSERV
%156 = load i32, i32* @NI_NUMERICHOST
%157 = load i32, i32* @NI_NUMERICSERV
%158 = or i32 %157, %156
%159 = call i32 @getnameinfo(%struct.sockaddr* %54, i32 %153, i8* %62, i32 %154, i8* %65, i32 %155, i32 %158)
%160 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.14, i64 0, i64 0), i8* %62, i8* %65)
%161 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.15, i64 0, i64 0), i32 %83, i8* %14)
%162 = call i32 @sleep(i32 3)
br label %163
163: ; preds = %152, %150
%164 = phi i32 [ 0, %152 ], [ %83, %150 ]
br label %57
}