#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 */
struct in_addr {
  int dummy;
};
struct sockaddr_in {
  struct in_addr sin_addr;
  int /*<<< orphan*/ sin_port;
  int /*<<< orphan*/ sin_family;
};
struct sockaddr {
  int dummy;
};
struct hostent {
  scalar_t__ h_addr;
};
typedef int /*<<< orphan*/ sockname;
typedef int socklen_t;
typedef int /*<<< orphan*/ cadena;
typedef int /*<<< orphan*/ buffer;
typedef int /*<<< orphan*/ auxFin;
typedef int /*<<< orphan*/ aux;

/* Variables and functions */
int /*<<< orphan*/ AF_INET;
int /*<<< orphan*/ SOCK_STREAM;
int /*<<< orphan*/ bzero(char *, int);
int /*<<< orphan*/ close(int);
int connect(int, struct sockaddr *, int);
int /*<<< orphan*/ exit(int);
int /*<<< orphan*/ getchar();
struct hostent *gethostbyname(char *);
char *getpass(char *);
int /*<<< orphan*/ htons(int);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *, ...);
int recv(int, char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ scanf(char *, ...);
int send(int, char *, int /*<<< orphan*/, int /*<<< orphan*/);
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ strcat(char *, char *);
int /*<<< orphan*/ strcmp(char *, char *);
int /*<<< orphan*/ strcpy(char *, char *);
int /*<<< orphan*/ strlen(char *);
main() {
  int i, sd, opcion, salir = 0;
  char cadena[25], log[25] = "user ", pas[25] = "pass ", *password, aux[4];
  char fin[] = "\r\n.\r\n", auxFin[10];
  struct sockaddr_in sockname;
  char buffer[1000];
  socklen_t len_sockname;
  struct hostent *host;
  host = gethostbyname("lucano110.uco.es");
  sd = socket(AF_INET, SOCK_STREAM, 0);
  if (sd == -1) {
    perror("No se puede abrir el socket cliente\n");
    exit(1);
  }
  sockname.sin_family = AF_INET;
  sockname.sin_port = htons(110);
  sockname.sin_addr = *(struct in_addr *)host->h_addr;
  len_sockname = sizeof(sockname);
  if (connect(sd, (struct sockaddr *)&sockname, len_sockname) == -1) {
    perror("Error de conexión");
    exit(1);
  }
  bzero(buffer, sizeof(buffer));
  if (recv(sd, buffer, sizeof(buffer), 0) == -1) {
    perror("Error en la operación de recv del servidor");
  }
  printf("%s", buffer);
  printf("Login: ");
  scanf("%s", cadena);
  strcat(log, cadena);
  strcat(log, "\n");
  if (send(sd, log, strlen(log), 0) == -1) {
    perror("Error enviando datos");
  }
  bzero(buffer, sizeof(buffer));
  if (recv(sd, buffer, sizeof(buffer), 0) == -1) {
    perror("Error en la operación de recv del servidor");
  }
  printf("%s", buffer);
  bzero(cadena, sizeof(cadena));
  password = getpass("Pass: ");
  strcat(pas, password);
  strcat(pas, "\n");
  if (send(sd, pas, strlen(pas), 0) == -1) {
    perror("Error enviando datos");
  }
  bzero(buffer, sizeof(buffer));
  if (recv(sd, buffer, sizeof(buffer), 0) == -1) {
    perror("Error en la operación de recv del servidor");
  }
  printf("%s", buffer);
  do {
    printf("\nMenu:\n");
    printf("  Opcion 1: Ver los mensajes\n");
    printf("  Opcion 2: Leer un mensaje\n");
    printf("  Opcion 3: Borrar un mensaje\n");
    printf("  Opcion 4: Salir\n");
    printf("\nOpcion: ");
    scanf("%d", &opcion);
    switch (opcion) {
    case 1:
      bzero(cadena, sizeof(cadena));
      strcpy(cadena, "LIST\n");
      if (send(sd, cadena, strlen(cadena), 0) == -1) {
        perror("Error enviando datos");
      }
      do {
        bzero(buffer, sizeof(buffer));
        if (recv(sd, buffer, sizeof(buffer), 0) == -1) {
          perror("Error en la operación de recv del servidor");
        }
        printf("%s", buffer);
        bzero(auxFin, sizeof(auxFin));
        strcpy(auxFin, &buffer[strlen(buffer) - 5]);
      } while (strcmp(fin, auxFin) != 0);
      break;
    case 2:
      bzero(cadena, sizeof(cadena));
      bzero(aux, sizeof(aux));
      printf("Numero: ");
      scanf("%s", aux);
      strcpy(cadena, "RETR ");
      strcat(cadena, aux);
      strcat(cadena, "\n");
      if (send(sd, cadena, strlen(cadena), 0) == -1) {
        perror("Error enviando datos");
      }
      do {
        bzero(buffer, sizeof(buffer));
        if (recv(sd, buffer, sizeof(buffer), 0) == -1) {
          perror("Error en la operación de recv del servidor");
        }
        printf("%s", buffer);
        bzero(auxFin, sizeof(auxFin));
        strcpy(auxFin, &buffer[strlen(buffer) - 5]);
      } while (strcmp(fin, auxFin) != 0);
      break;
    case 3:
      bzero(cadena, sizeof(cadena));
      bzero(aux, sizeof(aux));
      printf("Numero: ");
      scanf("%s", aux);
      strcpy(cadena, "DELE ");
      strcat(cadena, aux);
      strcat(cadena, "\n");
      if (send(sd, cadena, strlen(cadena), 0) == -1) {
        perror("Error enviando datos");
      }
      bzero(buffer, sizeof(buffer));
      if (recv(sd, buffer, sizeof(buffer), 0) == -1) {
        perror("Error en la operación de recv del servidor");
      }
      printf("%s", buffer);
      break;
    case 4:
      bzero(cadena, sizeof(cadena));
      strcpy(cadena, "QUIT\n");
      if (send(sd, cadena, strlen(cadena), 0) == -1) {
        perror("Error enviando datos");
      }
      bzero(buffer, sizeof(buffer));
      if (recv(sd, buffer, sizeof(buffer), 0) == -1) {
        perror("Error en la operación de recv del servidor");
      }
      printf("%s", buffer);
      salir = 1;
      break;
    default:
      printf("\nOpcion incorrecta, pulse ENTER para continuar...\n");
      getchar();
      break;
    }
  } while (salir == 0);
  close(sd);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x510,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x14(%rbp)
mov    0xdd0(%rip),%rax
mov    %rax,-0x50(%rbp)
mov    0xdcd(%rip),%rax
mov    %rax,-0x48(%rbp)
mov    0xdca(%rip),%rax
mov    %rax,-0x40(%rbp)
mov    0xdc8(%rip),%al
mov    %al,-0x38(%rbp)
mov    0xdc6(%rip),%rax
mov    %rax,-0x70(%rbp)
mov    0xdc3(%rip),%rax
mov    %rax,-0x68(%rbp)
mov    0xdc0(%rip),%rax
mov    %rax,-0x60(%rbp)
mov    0xdbe(%rip),%al
mov    %al,-0x58(%rbp)
mov    0xdb6(%rip),%eax
mov    %eax,-0x82(%rbp)
mov    0xdad(%rip),%ax
mov    %ax,-0x7e(%rbp)
lea    0xda4(%rip),%rdi
call   10c0 <gethostbyname@plt>
mov    %rax,-0x490(%rbp)
mov    0x2d2a(%rip),%rax
mov    (%rax),%edi
mov    0x2d11(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1140 <socket@plt>
mov    %eax,-0xc(%rbp)
cmpl   $0xffffffff,-0xc(%rbp)
jne    12f3 <main+0xd3>
lea    0xd7c(%rip),%rdi
call   10f0 <perror@plt>
mov    $0x1,%edi
call   1120 <exit@plt>
mov    0x2cee(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x90(%rbp)
mov    $0x6e,%edi
call   1060 <htons@plt>
mov    %eax,-0x94(%rbp)
mov    -0x490(%rbp),%rax
mov    (%rax),%rax
mov    (%rax),%eax
mov    %eax,-0x98(%rbp)
movl   $0xc,-0x484(%rbp)
mov    -0xc(%rbp),%edi
lea    -0x98(%rbp),%rsi
mov    -0x484(%rbp),%edx
call   1130 <connect@plt>
cmp    $0xffffffff,%eax
jne    1362 <main+0x142>
lea    0xd32(%rip),%rdi
call   10f0 <perror@plt>
mov    $0x1,%edi
call   1120 <exit@plt>
lea    -0x480(%rbp),%rdi
mov    $0x3e8,%esi
call   1100 <bzero@plt>
mov    -0xc(%rbp),%edi
lea    -0x480(%rbp),%rsi
mov    $0x3e8,%edx
xor    %ecx,%ecx
call   1030 <recv@plt>
cmp    $0xffffffff,%eax
jne    139e <main+0x17e>
lea    0xcff(%rip),%rdi
call   10f0 <perror@plt>
lea    -0x480(%rbp),%rsi
lea    0xd18(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
lea    0xd0d(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
lea    -0x30(%rbp),%rsi
lea    0xcf8(%rip),%rdi
mov    $0x0,%al
call   10d0 <scanf@plt>
lea    -0x50(%rbp),%rdi
lea    -0x30(%rbp),%rsi
call   1110 <strcat@plt>
lea    -0x50(%rbp),%rdi
lea    0xc62(%rip),%rsi
call   1110 <strcat@plt>
mov    -0xc(%rbp),%eax
mov    %eax,-0x49c(%rbp)
lea    -0x50(%rbp),%rax
mov    %rax,-0x498(%rbp)
lea    -0x50(%rbp),%rdi
call   1050 <strlen@plt>
mov    -0x49c(%rbp),%edi
mov    -0x498(%rbp),%rsi
mov    %eax,%edx
xor    %ecx,%ecx
call   1070 <send@plt>
cmp    $0xffffffff,%eax
jne    1438 <main+0x218>
lea    0xc9c(%rip),%rdi
call   10f0 <perror@plt>
lea    -0x480(%rbp),%rdi
mov    $0x3e8,%esi
call   1100 <bzero@plt>
mov    -0xc(%rbp),%edi
lea    -0x480(%rbp),%rsi
mov    $0x3e8,%edx
xor    %ecx,%ecx
call   1030 <recv@plt>
cmp    $0xffffffff,%eax
jne    1474 <main+0x254>
lea    0xc29(%rip),%rdi
call   10f0 <perror@plt>
lea    -0x480(%rbp),%rsi
lea    0xc42(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
lea    -0x30(%rbp),%rdi
mov    $0x19,%esi
call   1100 <bzero@plt>
lea    0xc46(%rip),%rdi
call   10e0 <getpass@plt>
mov    %rax,-0x78(%rbp)
lea    -0x70(%rbp),%rdi
mov    -0x78(%rbp),%rsi
call   1110 <strcat@plt>
lea    -0x70(%rbp),%rdi
lea    0xb8e(%rip),%rsi
call   1110 <strcat@plt>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4ac(%rbp)
lea    -0x70(%rbp),%rax
mov    %rax,-0x4a8(%rbp)
lea    -0x70(%rbp),%rdi
call   1050 <strlen@plt>
mov    -0x4ac(%rbp),%edi
mov    -0x4a8(%rbp),%rsi
mov    %eax,%edx
xor    %ecx,%ecx
call   1070 <send@plt>
cmp    $0xffffffff,%eax
jne    150c <main+0x2ec>
lea    0xbc8(%rip),%rdi
call   10f0 <perror@plt>
lea    -0x480(%rbp),%rdi
mov    $0x3e8,%esi
call   1100 <bzero@plt>
mov    -0xc(%rbp),%edi
lea    -0x480(%rbp),%rsi
mov    $0x3e8,%edx
xor    %ecx,%ecx
call   1030 <recv@plt>
cmp    $0xffffffff,%eax
jne    1548 <main+0x328>
lea    0xb55(%rip),%rdi
call   10f0 <perror@plt>
lea    -0x480(%rbp),%rsi
lea    0xb6e(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
lea    0xb87(%rip),%rdi
xor    %eax,%eax
mov    %al,-0x4b9(%rbp)
call   1080 <printf@plt>
mov    -0x4b9(%rbp),%al
lea    0xb75(%rip),%rdi
call   1080 <printf@plt>
mov    -0x4b9(%rbp),%al
lea    0xb81(%rip),%rdi
call   1080 <printf@plt>
mov    -0x4b9(%rbp),%al
lea    0xb8c(%rip),%rdi
call   1080 <printf@plt>
mov    -0x4b9(%rbp),%al
lea    0xb99(%rip),%rdi
call   1080 <printf@plt>
mov    -0x4b9(%rbp),%al
lea    0xb9a(%rip),%rdi
call   1080 <printf@plt>
mov    -0x4b9(%rbp),%al
lea    0xb92(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   10d0 <scanf@plt>
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x4b8(%rbp)
sub    $0x3,%eax
ja     1a6b <main+0x84b>
mov    -0x4b8(%rbp),%rax
lea    0x9f9(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    -0x30(%rbp),%rdi
mov    $0x19,%esi
call   1100 <bzero@plt>
lea    -0x30(%rbp),%rdi
lea    0xb44(%rip),%rsi
call   1040 <strcpy@plt>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4cc(%rbp)
lea    -0x30(%rbp),%rax
mov    %rax,-0x4c8(%rbp)
lea    -0x30(%rbp),%rdi
call   1050 <strlen@plt>
mov    -0x4cc(%rbp),%edi
mov    -0x4c8(%rbp),%rsi
mov    %eax,%edx
xor    %ecx,%ecx
call   1070 <send@plt>
cmp    $0xffffffff,%eax
jne    1676 <main+0x456>
lea    0xa5e(%rip),%rdi
call   10f0 <perror@plt>
jmp    167b <main+0x45b>
lea    -0x480(%rbp),%rdi
mov    $0x3e8,%esi
call   1100 <bzero@plt>
mov    -0xc(%rbp),%edi
lea    -0x480(%rbp),%rsi
mov    $0x3e8,%edx
xor    %ecx,%ecx
call   1030 <recv@plt>
cmp    $0xffffffff,%eax
jne    16b7 <main+0x497>
lea    0x9e6(%rip),%rdi
call   10f0 <perror@plt>
lea    -0x480(%rbp),%rsi
lea    0x9ff(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
lea    -0x8c(%rbp),%rdi
mov    $0xa,%esi
call   1100 <bzero@plt>
lea    -0x8c(%rbp),%rax
mov    %rax,-0x4d8(%rbp)
lea    -0x480(%rbp),%rdi
call   1050 <strlen@plt>
mov    -0x4d8(%rbp),%rdi
sub    $0x5,%eax
cltq
lea    -0x480(%rbp),%rsi
add    %rax,%rsi
call   1040 <strcpy@plt>
lea    -0x82(%rbp),%rdi
lea    -0x8c(%rbp),%rsi
call   10a0 <strcmp@plt>
cmp    $0x0,%eax
jne    167b <main+0x45b>
jmp    1a80 <main+0x860>
lea    -0x30(%rbp),%rdi
mov    $0x19,%esi
call   1100 <bzero@plt>
lea    -0x7c(%rbp),%rdi
mov    $0x4,%esi
call   1100 <bzero@plt>
lea    0xa1d(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
lea    -0x7c(%rbp),%rsi
lea    0x95c(%rip),%rdi
mov    $0x0,%al
call   10d0 <scanf@plt>
lea    -0x30(%rbp),%rdi
lea    0xa02(%rip),%rsi
call   1040 <strcpy@plt>
lea    -0x30(%rbp),%rdi
lea    -0x7c(%rbp),%rsi
call   1110 <strcat@plt>
lea    -0x30(%rbp),%rdi
lea    0x8b6(%rip),%rsi
call   1110 <strcat@plt>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4e4(%rbp)
lea    -0x30(%rbp),%rax
mov    %rax,-0x4e0(%rbp)
lea    -0x30(%rbp),%rdi
call   1050 <strlen@plt>
mov    -0x4e4(%rbp),%edi
mov    -0x4e0(%rbp),%rsi
mov    %eax,%edx
xor    %ecx,%ecx
call   1070 <send@plt>
cmp    $0xffffffff,%eax
jne    17e4 <main+0x5c4>
lea    0x8f0(%rip),%rdi
call   10f0 <perror@plt>
jmp    17e9 <main+0x5c9>
lea    -0x480(%rbp),%rdi
mov    $0x3e8,%esi
call   1100 <bzero@plt>
mov    -0xc(%rbp),%edi
lea    -0x480(%rbp),%rsi
mov    $0x3e8,%edx
xor    %ecx,%ecx
call   1030 <recv@plt>
cmp    $0xffffffff,%eax
jne    1825 <main+0x605>
lea    0x878(%rip),%rdi
call   10f0 <perror@plt>
lea    -0x480(%rbp),%rsi
lea    0x891(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
lea    -0x8c(%rbp),%rdi
mov    $0xa,%esi
call   1100 <bzero@plt>
lea    -0x8c(%rbp),%rax
mov    %rax,-0x4f0(%rbp)
lea    -0x480(%rbp),%rdi
call   1050 <strlen@plt>
mov    -0x4f0(%rbp),%rdi
sub    $0x5,%eax
cltq
lea    -0x480(%rbp),%rsi
add    %rax,%rsi
call   1040 <strcpy@plt>
lea    -0x82(%rbp),%rdi
lea    -0x8c(%rbp),%rsi
call   10a0 <strcmp@plt>
cmp    $0x0,%eax
jne    17e9 <main+0x5c9>
jmp    1a80 <main+0x860>
lea    -0x30(%rbp),%rdi
mov    $0x19,%esi
call   1100 <bzero@plt>
lea    -0x7c(%rbp),%rdi
mov    $0x4,%esi
call   1100 <bzero@plt>
lea    0x8af(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
lea    -0x7c(%rbp),%rsi
lea    0x7ee(%rip),%rdi
mov    $0x0,%al
call   10d0 <scanf@plt>
lea    -0x30(%rbp),%rdi
lea    0x89a(%rip),%rsi
call   1040 <strcpy@plt>
lea    -0x30(%rbp),%rdi
lea    -0x7c(%rbp),%rsi
call   1110 <strcat@plt>
lea    -0x30(%rbp),%rdi
lea    0x748(%rip),%rsi
call   1110 <strcat@plt>
mov    -0xc(%rbp),%eax
mov    %eax,-0x4fc(%rbp)
lea    -0x30(%rbp),%rax
mov    %rax,-0x4f8(%rbp)
lea    -0x30(%rbp),%rdi
call   1050 <strlen@plt>
mov    -0x4fc(%rbp),%edi
mov    -0x4f8(%rbp),%rsi
mov    %eax,%edx
xor    %ecx,%ecx
call   1070 <send@plt>
cmp    $0xffffffff,%eax
jne    1952 <main+0x732>
lea    0x782(%rip),%rdi
call   10f0 <perror@plt>
lea    -0x480(%rbp),%rdi
mov    $0x3e8,%esi
call   1100 <bzero@plt>
mov    -0xc(%rbp),%edi
lea    -0x480(%rbp),%rsi
mov    $0x3e8,%edx
xor    %ecx,%ecx
call   1030 <recv@plt>
cmp    $0xffffffff,%eax
jne    198e <main+0x76e>
lea    0x70f(%rip),%rdi
call   10f0 <perror@plt>
lea    -0x480(%rbp),%rsi
lea    0x728(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
jmp    1a80 <main+0x860>
lea    -0x30(%rbp),%rdi
mov    $0x19,%esi
call   1100 <bzero@plt>
lea    -0x30(%rbp),%rdi
lea    0x7c7(%rip),%rsi
call   1040 <strcpy@plt>
mov    -0xc(%rbp),%eax
mov    %eax,-0x50c(%rbp)
lea    -0x30(%rbp),%rax
mov    %rax,-0x508(%rbp)
lea    -0x30(%rbp),%rdi
call   1050 <strlen@plt>
mov    -0x50c(%rbp),%edi
mov    -0x508(%rbp),%rsi
mov    %eax,%edx
xor    %ecx,%ecx
call   1070 <send@plt>
cmp    $0xffffffff,%eax
jne    1a0e <main+0x7ee>
lea    0x6c6(%rip),%rdi
call   10f0 <perror@plt>
lea    -0x480(%rbp),%rdi
mov    $0x3e8,%esi
call   1100 <bzero@plt>
mov    -0xc(%rbp),%edi
lea    -0x480(%rbp),%rsi
mov    $0x3e8,%edx
xor    %ecx,%ecx
call   1030 <recv@plt>
cmp    $0xffffffff,%eax
jne    1a4a <main+0x82a>
lea    0x653(%rip),%rdi
call   10f0 <perror@plt>
lea    -0x480(%rbp),%rsi
lea    0x66c(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
movl   $0x1,-0x14(%rbp)
jmp    1a80 <main+0x860>
lea    0x71c(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
mov    $0x0,%al
call   10b0 <getchar@plt>
jmp    1a85 <main+0x865>
cmpl   $0x0,-0x14(%rbp)
je     155d <main+0x33d>
mov    -0xc(%rbp),%edi
call   1090 <close@plt>
mov    -0x4(%rbp),%eax
add    $0x510,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x478,%rsp
movups 0xde1(%rip),%xmm0
movups %xmm0,0x79(%rsp)
movaps 0xdcc(%rip),%xmm0
movaps %xmm0,0x70(%rsp)
movups 0xde9(%rip),%xmm0
movups %xmm0,0x59(%rsp)
movaps 0xdd4(%rip),%xmm0
movaps %xmm0,0x50(%rsp)
lea    0xde7(%rip),%rdi
call   10c0 <gethostbyname@plt>
mov    %rax,%rbx
mov    0x2d71(%rip),%r14
mov    (%r14),%edi
mov    0x2d57(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1140 <socket@plt>
cmp    $0xffffffff,%eax
je     18df <main+0x6bf>
mov    %eax,%ebp
mov    (%r14),%eax
mov    %eax,0x28(%rsp)
mov    $0x6e,%edi
call   1070 <htons@plt>
mov    %eax,0x24(%rsp)
mov    (%rbx),%rax
mov    (%rax),%eax
mov    %eax,0x20(%rsp)
lea    0x20(%rsp),%rsi
mov    %ebp,%edi
mov    $0xc,%edx
call   1130 <connect@plt>
cmp    $0xffffffff,%eax
je     18e8 <main+0x6c8>
lea    0x90(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x3e8,%esi
call   1100 <bzero@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    $0x3e8,%edx
xor    %ecx,%ecx
call   1030 <recv@plt>
cmp    $0xffffffff,%eax
je     1868 <main+0x648>
lea    0xdc1(%rip),%r14
lea    0x90(%rsp),%rsi
mov    %r14,%rdi
xor    %eax,%eax
call   1090 <printf@plt>
lea    0xdab(%rip),%rdi
xor    %eax,%eax
call   1090 <printf@plt>
lea    0x30(%rsp),%r15
mov    %r14,%rdi
mov    %r15,%rsi
xor    %eax,%eax
call   10d0 <scanf@plt>
lea    0x70(%rsp),%rbx
mov    %rbx,%rdi
mov    %r15,%rsi
call   1110 <strcat@plt>
lea    0xd01(%rip),%rsi
mov    %rbx,%rdi
call   1110 <strcat@plt>
mov    %rbx,%rdi
call   1060 <strlen@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %eax,%edx
xor    %ecx,%ecx
call   1080 <send@plt>
cmp    $0xffffffff,%eax
je     1879 <main+0x659>
lea    0x90(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x3e8,%esi
call   1100 <bzero@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    $0x3e8,%edx
xor    %ecx,%ecx
call   1030 <recv@plt>
cmp    $0xffffffff,%eax
je     188a <main+0x66a>
lea    0xd1b(%rip),%rdi
lea    0x90(%rsp),%rsi
xor    %eax,%eax
call   1090 <printf@plt>
lea    0x30(%rsp),%rdi
mov    $0x19,%esi
call   1100 <bzero@plt>
lea    0xd16(%rip),%rdi
call   10e0 <getpass@plt>
lea    0x50(%rsp),%rbx
mov    %rbx,%rdi
mov    %rax,%rsi
call   1110 <strcat@plt>
lea    0xc63(%rip),%rsi
mov    %rbx,%rdi
call   1110 <strcat@plt>
mov    %rbx,%rdi
call   1060 <strlen@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %eax,%edx
xor    %ecx,%ecx
call   1080 <send@plt>
cmp    $0xffffffff,%eax
je     189b <main+0x67b>
lea    0x90(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x3e8,%esi
call   1100 <bzero@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    $0x3e8,%edx
xor    %ecx,%ecx
call   1030 <recv@plt>
cmp    $0xffffffff,%eax
je     18ac <main+0x68c>
lea    0xc7d(%rip),%r14
mov    %r14,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1090 <printf@plt>
lea    0x16(%rsp),%r15
mov    $0xd2e0a0d,%r12d
jmp    1483 <main+0x263>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
lea    0xd12(%rip),%rdi
call   1050 <puts@plt>
xor    %eax,%eax
call   10b0 <getchar@plt>
lea    0xc8f(%rip),%rdi
call   1050 <puts@plt>
lea    0xc8a(%rip),%rdi
call   1050 <puts@plt>
lea    0xc9b(%rip),%rdi
call   1050 <puts@plt>
lea    0xcab(%rip),%rdi
call   1050 <puts@plt>
lea    0xcbd(%rip),%rdi
call   1050 <puts@plt>
lea    0xc25(%rip),%rdi
xor    %eax,%eax
call   1090 <printf@plt>
lea    0xc21(%rip),%rdi
lea    0x10(%rsp),%rsi
xor    %eax,%eax
call   10d0 <scanf@plt>
mov    0x10(%rsp),%eax
add    $0xffffffff,%eax
cmp    $0x3,%eax
ja     1470 <main+0x250>
lea    0xb0d(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0x30(%rsp),%r13
mov    %r13,%rdi
mov    $0x19,%esi
call   1100 <bzero@plt>
mov    %r13,%rdi
lea    0xbe0(%rip),%rsi
call   1040 <strcpy@plt>
mov    %r13,%rdi
call   1060 <strlen@plt>
mov    %ebp,%edi
mov    %r13,%rsi
mov    %eax,%edx
xor    %ecx,%ecx
call   1080 <send@plt>
cmp    $0xffffffff,%eax
jne    159b <main+0x37b>
lea    0xb90(%rip),%rdi
call   10f0 <perror@plt>
jmp    159b <main+0x37b>
cs nopw 0x0(%rax,%rax,1)
mov    %r14,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1090 <printf@plt>
mov    %r15,%rdi
mov    $0xa,%esi
call   1100 <bzero@plt>
mov    %rbx,%rdi
call   1060 <strlen@plt>
cltq
lea    (%rax,%rbx,1),%rsi
add    $0xfffffffffffffffb,%rsi
mov    %r15,%rdi
call   1040 <strcpy@plt>
mov    0x16(%rsp),%eax
xor    %r12d,%eax
movzwl 0x1a(%rsp),%ecx
xor    $0xa,%ecx
or     %eax,%ecx
je     1483 <main+0x263>
mov    %rbx,%rdi
mov    $0x3e8,%esi
call   1100 <bzero@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    $0x3e8,%edx
xor    %ecx,%ecx
call   1030 <recv@plt>
cmp    $0xffffffff,%eax
jne    1550 <main+0x330>
lea    0xad3(%rip),%rdi
call   10f0 <perror@plt>
jmp    1550 <main+0x330>
nopl   0x0(%rax)
lea    0x30(%rsp),%rdi
mov    $0x19,%esi
call   1100 <bzero@plt>
lea    0xc(%rsp),%r13
mov    %r13,%rdi
mov    $0x4,%esi
call   1100 <bzero@plt>
lea    0xb06(%rip),%rdi
xor    %eax,%eax
call   1090 <printf@plt>
mov    %r14,%rdi
mov    %r13,%rsi
xor    %eax,%eax
call   10d0 <scanf@plt>
lea    0x30(%rsp),%r13
mov    %r13,%rdi
lea    0xaec(%rip),%rsi
call   1040 <strcpy@plt>
mov    %r13,%rdi
lea    0xc(%rsp),%rsi
call   1110 <strcat@plt>
mov    %r13,%rdi
lea    0xa16(%rip),%rsi
call   1110 <strcat@plt>
mov    %r13,%rdi
call   1060 <strlen@plt>
mov    %ebp,%edi
mov    %r13,%rsi
mov    %eax,%edx
xor    %ecx,%ecx
call   1080 <send@plt>
cmp    $0xffffffff,%eax
jne    16bb <main+0x49b>
lea    0xa71(%rip),%rdi
call   10f0 <perror@plt>
jmp    16bb <main+0x49b>
cs nopw 0x0(%rax,%rax,1)
nop
mov    %r14,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1090 <printf@plt>
mov    %r15,%rdi
mov    $0xa,%esi
call   1100 <bzero@plt>
mov    %rbx,%rdi
call   1060 <strlen@plt>
cltq
lea    (%rax,%rbx,1),%rsi
add    $0xfffffffffffffffb,%rsi
mov    %r15,%rdi
call   1040 <strcpy@plt>
mov    0x16(%rsp),%eax
xor    %r12d,%eax
movzwl 0x1a(%rsp),%ecx
xor    $0xa,%ecx
or     %eax,%ecx
je     1483 <main+0x263>
mov    %rbx,%rdi
mov    $0x3e8,%esi
call   1100 <bzero@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    $0x3e8,%edx
xor    %ecx,%ecx
call   1030 <recv@plt>
cmp    $0xffffffff,%eax
jne    1670 <main+0x450>
lea    0x9b3(%rip),%rdi
call   10f0 <perror@plt>
jmp    1670 <main+0x450>
nopl   0x0(%rax)
lea    0x30(%rsp),%rdi
mov    $0x19,%esi
call   1100 <bzero@plt>
lea    0xc(%rsp),%r13
mov    %r13,%rdi
mov    $0x4,%esi
call   1100 <bzero@plt>
lea    0x9e6(%rip),%rdi
xor    %eax,%eax
call   1090 <printf@plt>
mov    %r14,%rdi
mov    %r13,%rsi
xor    %eax,%eax
call   10d0 <scanf@plt>
lea    0x30(%rsp),%r13
mov    %r13,%rdi
lea    0x9d2(%rip),%rsi
call   1040 <strcpy@plt>
mov    %r13,%rdi
lea    0xc(%rsp),%rsi
call   1110 <strcat@plt>
mov    %r13,%rdi
lea    0x8f6(%rip),%rsi
call   1110 <strcat@plt>
mov    %r13,%rdi
call   1060 <strlen@plt>
mov    %ebp,%edi
mov    %r13,%rsi
mov    %eax,%edx
xor    %ecx,%ecx
call   1080 <send@plt>
cmp    $0xffffffff,%eax
je     17ac <main+0x58c>
mov    %rbx,%rdi
mov    $0x3e8,%esi
call   1100 <bzero@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    $0x3e8,%edx
xor    %ecx,%ecx
call   1030 <recv@plt>
cmp    $0xffffffff,%eax
je     17ba <main+0x59a>
mov    %r14,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1090 <printf@plt>
jmp    1483 <main+0x263>
lea    0x91c(%rip),%rdi
call   10f0 <perror@plt>
jmp    1777 <main+0x557>
lea    0x8d7(%rip),%rdi
call   10f0 <perror@plt>
jmp    179a <main+0x57a>
lea    0x30(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x19,%esi
call   1100 <bzero@plt>
lea    0x932(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcpy@plt>
mov    %rbx,%rdi
call   1060 <strlen@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    %eax,%edx
xor    %ecx,%ecx
call   1080 <send@plt>
cmp    $0xffffffff,%eax
je     18bd <main+0x69d>
lea    0x90(%rsp),%rbx
mov    %rbx,%rdi
mov    $0x3e8,%esi
call   1100 <bzero@plt>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    $0x3e8,%edx
xor    %ecx,%ecx
call   1030 <recv@plt>
cmp    $0xffffffff,%eax
je     18ce <main+0x6ae>
lea    0x886(%rip),%rdi
lea    0x90(%rsp),%rsi
xor    %eax,%eax
call   1090 <printf@plt>
mov    %ebp,%edi
call   10a0 <close@plt>
xor    %eax,%eax
add    $0x478,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0x829(%rip),%rdi
call   10f0 <perror@plt>
jmp    12fc <main+0xdc>
lea    0x84f(%rip),%rdi
call   10f0 <perror@plt>
jmp    1373 <main+0x153>
lea    0x807(%rip),%rdi
call   10f0 <perror@plt>
jmp    13a2 <main+0x182>
lea    0x82d(%rip),%rdi
call   10f0 <perror@plt>
jmp    1411 <main+0x1f1>
lea    0x7e5(%rip),%rdi
call   10f0 <perror@plt>
jmp    1440 <main+0x220>
lea    0x80b(%rip),%rdi
call   10f0 <perror@plt>
jmp    1808 <main+0x5e8>
lea    0x7c3(%rip),%rdi
call   10f0 <perror@plt>
jmp    1837 <main+0x617>
lea    0x77a(%rip),%rdi
jmp    18ef <main+0x6cf>
lea    0x796(%rip),%rdi
call   10f0 <perror@plt>
mov    $0x1,%edi
call   1120 <exit@plt>

LLVM IR (-O0):
%struct.sockaddr_in = type { %struct.in_addr, i32, i32 }
%struct.in_addr = type { i32 }
%struct.hostent = type { i64 }
%struct.sockaddr = type { i32 }
@__const.main.log = [25 x i8] c"user \00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@__const.main.pas = [25 x i8] c"pass \00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@__const.main.fin = [6 x i8] c"\0D\0A.\0D\0A\00"
@.str = [17 x i8] c"lucano110.uco.es\00"
@AF_INET = global i32 0
@SOCK_STREAM = global i32 0
@.str.1 = [37 x i8] c"No se puede abrir el socket cliente\0A\00"
@.str.2 = [19 x i8] c"Error de conexi\C3\B3n\00"
@.str.3 = [44 x i8] c"Error en la operaci\C3\B3n de recv del servidor\00"
@.str.4 = [3 x i8] c"%s\00"
@.str.5 = [8 x i8] c"Login: \00"
@.str.6 = [2 x i8] c"\0A\00"
@.str.7 = [21 x i8] c"Error enviando datos\00"
@.str.8 = [7 x i8] c"Pass: \00"
@.str.9 = [8 x i8] c"\0AMenu:\0A\00"
@.str.10 = [30 x i8] c" Opcion 1: Ver los mensajes\0A\00"
@.str.11 = [29 x i8] c" Opcion 2: Leer un mensaje\0A\00"
@.str.12 = [31 x i8] c" Opcion 3: Borrar un mensaje\0A\00"
@.str.13 = [19 x i8] c" Opcion 4: Salir\0A\00"
@.str.14 = [10 x i8] c"\0AOpcion: \00"
@.str.15 = [3 x i8] c"%d\00"
@.str.16 = [6 x i8] c"LIST\0A\00"
@.str.17 = [9 x i8] c"Numero: \00"
@.str.18 = [6 x i8] c"RETR \00"
@.str.19 = [6 x i8] c"DELE \00"
@.str.20 = [6 x i8] c"QUIT\0A\00"
@.str.21 = [51 x i8] c"\0AOpcion incorrecta, pulse ENTER para continuar...\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca [25 x i8]
%7 = alloca [25 x i8]
%8 = alloca [25 x i8]
%9 = alloca i8*
%10 = alloca [4 x i8]
%11 = alloca [6 x i8]
%12 = alloca [10 x i8]
%13 = alloca %struct.sockaddr_in
%14 = alloca [1000 x i8]
%15 = alloca i32
%16 = alloca %struct.hostent*
store i32 0, i32* %1
store i32 0, i32* %5
%17 = bitcast [25 x i8]* %7 to i8*
%18 = bitcast [25 x i8]* %8 to i8*
%19 = bitcast [6 x i8]* %11 to i8*
%20 = call %struct.hostent* @gethostbyname(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
store %struct.hostent* %20, %struct.hostent** %16
%21 = load i32, i32* @AF_INET
%22 = load i32, i32* @SOCK_STREAM
%23 = call i32 @socket(i32 %21, i32 %22, i32 0)
store i32 %23, i32* %3
%24 = load i32, i32* %3
%25 = icmp eq i32 %24, -1
br i1 %25, label %26, label %29
26: ; preds = %0
%27 = call i32 @perror(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0))
%28 = call i32 @exit(i32 1)
unreachable
29: ; preds = %0
%30 = load i32, i32* @AF_INET
%31 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %13, i32 0, i32 2
store i32 %30, i32* %31
%32 = call i32 @htons(i32 110)
%33 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %13, i32 0, i32 1
store i32 %32, i32* %33
%34 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %13, i32 0, i32 0
%35 = load %struct.hostent*, %struct.hostent** %16
%36 = getelementptr inbounds %struct.hostent, %struct.hostent* %35, i32 0, i32 0
%37 = load i64, i64* %36
%38 = inttoptr i64 %37 to %struct.in_addr*
%39 = bitcast %struct.in_addr* %34 to i8*
%40 = bitcast %struct.in_addr* %38 to i8*
store i32 12, i32* %15
%41 = load i32, i32* %3
%42 = bitcast %struct.sockaddr_in* %13 to %struct.sockaddr*
%43 = load i32, i32* %15
%44 = call i32 @connect(i32 %41, %struct.sockaddr* %42, i32 %43)
%45 = icmp eq i32 %44, -1
br i1 %45, label %46, label %49
46: ; preds = %29
%47 = call i32 @perror(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0))
%48 = call i32 @exit(i32 1)
unreachable
49: ; preds = %29
%50 = getelementptr inbounds [1000 x i8], [1000 x i8]* %14, i64 0, i64 0
%51 = call i32 @bzero(i8* %50, i32 1000)
%52 = load i32, i32* %3
%53 = getelementptr inbounds [1000 x i8], [1000 x i8]* %14, i64 0, i64 0
%54 = call i32 @recv(i32 %52, i8* %53, i32 1000, i32 0)
%55 = icmp eq i32 %54, -1
br i1 %55, label %56, label %58
56: ; preds = %49
%57 = call i32 @perror(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.3, i64 0, i64 0))
br label %58
58: ; preds = %56, %49
%59 = getelementptr inbounds [1000 x i8], [1000 x i8]* %14, i64 0, i64 0
%60 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* %59)
%61 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0))
%62 = getelementptr inbounds [25 x i8], [25 x i8]* %6, i64 0, i64 0
%63 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* %62)
%64 = getelementptr inbounds [25 x i8], [25 x i8]* %7, i64 0, i64 0
%65 = getelementptr inbounds [25 x i8], [25 x i8]* %6, i64 0, i64 0
%66 = call i32 @strcat(i8* %64, i8* %65)
%67 = getelementptr inbounds [25 x i8], [25 x i8]* %7, i64 0, i64 0
%68 = call i32 @strcat(i8* %67, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
%69 = load i32, i32* %3
%70 = getelementptr inbounds [25 x i8], [25 x i8]* %7, i64 0, i64 0
%71 = getelementptr inbounds [25 x i8], [25 x i8]* %7, i64 0, i64 0
%72 = call i32 @strlen(i8* %71)
%73 = call i32 @send(i32 %69, i8* %70, i32 %72, i32 0)
%74 = icmp eq i32 %73, -1
br i1 %74, label %75, label %77
75: ; preds = %58
%76 = call i32 @perror(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.7, i64 0, i64 0))
br label %77
77: ; preds = %75, %58
%78 = getelementptr inbounds [1000 x i8], [1000 x i8]* %14, i64 0, i64 0
%79 = call i32 @bzero(i8* %78, i32 1000)
%80 = load i32, i32* %3
%81 = getelementptr inbounds [1000 x i8], [1000 x i8]* %14, i64 0, i64 0
%82 = call i32 @recv(i32 %80, i8* %81, i32 1000, i32 0)
%83 = icmp eq i32 %82, -1
br i1 %83, label %84, label %86
84: ; preds = %77
%85 = call i32 @perror(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.3, i64 0, i64 0))
br label %86
86: ; preds = %84, %77
%87 = getelementptr inbounds [1000 x i8], [1000 x i8]* %14, i64 0, i64 0
%88 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* %87)
%89 = getelementptr inbounds [25 x i8], [25 x i8]* %6, i64 0, i64 0
%90 = call i32 @bzero(i8* %89, i32 25)
%91 = call i8* @getpass(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i64 0, i64 0))
store i8* %91, i8** %9
%92 = getelementptr inbounds [25 x i8], [25 x i8]* %8, i64 0, i64 0
%93 = load i8*, i8** %9
%94 = call i32 @strcat(i8* %92, i8* %93)
%95 = getelementptr inbounds [25 x i8], [25 x i8]* %8, i64 0, i64 0
%96 = call i32 @strcat(i8* %95, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
%97 = load i32, i32* %3
%98 = getelementptr inbounds [25 x i8], [25 x i8]* %8, i64 0, i64 0
%99 = getelementptr inbounds [25 x i8], [25 x i8]* %8, i64 0, i64 0
%100 = call i32 @strlen(i8* %99)
%101 = call i32 @send(i32 %97, i8* %98, i32 %100, i32 0)
%102 = icmp eq i32 %101, -1
br i1 %102, label %103, label %105
103: ; preds = %86
%104 = call i32 @perror(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.7, i64 0, i64 0))
br label %105
105: ; preds = %103, %86
%106 = getelementptr inbounds [1000 x i8], [1000 x i8]* %14, i64 0, i64 0
%107 = call i32 @bzero(i8* %106, i32 1000)
%108 = load i32, i32* %3
%109 = getelementptr inbounds [1000 x i8], [1000 x i8]* %14, i64 0, i64 0
%110 = call i32 @recv(i32 %108, i8* %109, i32 1000, i32 0)
%111 = icmp eq i32 %110, -1
br i1 %111, label %112, label %114
112: ; preds = %105
%113 = call i32 @perror(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.3, i64 0, i64 0))
br label %114
114: ; preds = %112, %105
%115 = getelementptr inbounds [1000 x i8], [1000 x i8]* %14, i64 0, i64 0
%116 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* %115)
br label %117
117: ; preds = %282, %114
%118 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.9, i64 0, i64 0))
%119 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.10, i64 0, i64 0))
%120 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.11, i64 0, i64 0))
%121 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.12, i64 0, i64 0))
%122 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.13, i64 0, i64 0))
%123 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.14, i64 0, i64 0))
%124 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.15, i64 0, i64 0), i32* %4)
%125 = load i32, i32* %4
switch i32 %125, label %278 [
i32 1, label %126
i32 2, label %167
i32 3, label %218
i32 4, label %253
]
126: ; preds = %117
%127 = getelementptr inbounds [25 x i8], [25 x i8]* %6, i64 0, i64 0
%128 = call i32 @bzero(i8* %127, i32 25)
%129 = getelementptr inbounds [25 x i8], [25 x i8]* %6, i64 0, i64 0
%130 = call i32 @strcpy(i8* %129, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.16, i64 0, i64 0))
%131 = load i32, i32* %3
%132 = getelementptr inbounds [25 x i8], [25 x i8]* %6, i64 0, i64 0
%133 = getelementptr inbounds [25 x i8], [25 x i8]* %6, i64 0, i64 0
%134 = call i32 @strlen(i8* %133)
%135 = call i32 @send(i32 %131, i8* %132, i32 %134, i32 0)
%136 = icmp eq i32 %135, -1
br i1 %136, label %137, label %139
137: ; preds = %126
%138 = call i32 @perror(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.7, i64 0, i64 0))
br label %139
139: ; preds = %137, %126
br label %140
140: ; preds = %161, %139
%141 = getelementptr inbounds [1000 x i8], [1000 x i8]* %14, i64 0, i64 0
%142 = call i32 @bzero(i8* %141, i32 1000)
%143 = load i32, i32* %3
%144 = getelementptr inbounds [1000 x i8], [1000 x i8]* %14, i64 0, i64 0
%145 = call i32 @recv(i32 %143, i8* %144, i32 1000, i32 0)
%146 = icmp eq i32 %145, -1
br i1 %146, label %147, label %149
147: ; preds = %140
%148 = call i32 @perror(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.3, i64 0, i64 0))
br label %149
149: ; preds = %147, %140
%150 = getelementptr inbounds [1000 x i8], [1000 x i8]* %14, i64 0, i64 0
%151 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* %150)
%152 = getelementptr inbounds [10 x i8], [10 x i8]* %12, i64 0, i64 0
%153 = call i32 @bzero(i8* %152, i32 10)
%154 = getelementptr inbounds [10 x i8], [10 x i8]* %12, i64 0, i64 0
%155 = getelementptr inbounds [1000 x i8], [1000 x i8]* %14, i64 0, i64 0
%156 = call i32 @strlen(i8* %155)
%157 = sub nsw i32 %156, 5
%158 = sext i32 %157 to i64
%159 = getelementptr inbounds [1000 x i8], [1000 x i8]* %14, i64 0, i64 %158
%160 = call i32 @strcpy(i8* %154, i8* %159)
br label %161
161: ; preds = %149
%162 = getelementptr inbounds [6 x i8], [6 x i8]* %11, i64 0, i64 0
%163 = getelementptr inbounds [10 x i8], [10 x i8]* %12, i64 0, i64 0
%164 = call i32 @strcmp(i8* %162, i8* %163)
%165 = icmp ne i32 %164, 0
br i1 %165, label %140, label %166
166: ; preds = %161
br label %281
167: ; preds = %117
%168 = getelementptr inbounds [25 x i8], [25 x i8]* %6, i64 0, i64 0
%169 = call i32 @bzero(i8* %168, i32 25)
%170 = getelementptr inbounds [4 x i8], [4 x i8]* %10, i64 0, i64 0
%171 = call i32 @bzero(i8* %170, i32 4)
%172 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.17, i64 0, i64 0))
%173 = getelementptr inbounds [4 x i8], [4 x i8]* %10, i64 0, i64 0
%174 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* %173)
%175 = getelementptr inbounds [25 x i8], [25 x i8]* %6, i64 0, i64 0
%176 = call i32 @strcpy(i8* %175, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.18, i64 0, i64 0))
%177 = getelementptr inbounds [25 x i8], [25 x i8]* %6, i64 0, i64 0
%178 = getelementptr inbounds [4 x i8], [4 x i8]* %10, i64 0, i64 0
%179 = call i32 @strcat(i8* %177, i8* %178)
%180 = getelementptr inbounds [25 x i8], [25 x i8]* %6, i64 0, i64 0
%181 = call i32 @strcat(i8* %180, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
%182 = load i32, i32* %3
%183 = getelementptr inbounds [25 x i8], [25 x i8]* %6, i64 0, i64 0
%184 = getelementptr inbounds [25 x i8], [25 x i8]* %6, i64 0, i64 0
%185 = call i32 @strlen(i8* %184)
%186 = call i32 @send(i32 %182, i8* %183, i32 %185, i32 0)
%187 = icmp eq i32 %186, -1
br i1 %187, label %188, label %190
188: ; preds = %167
%189 = call i32 @perror(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.7, i64 0, i64 0))
br label %190
190: ; preds = %188, %167
br label %191
191: ; preds = %212, %190
%192 = getelementptr inbounds [1000 x i8], [1000 x i8]* %14, i64 0, i64 0
%193 = call i32 @bzero(i8* %192, i32 1000)
%194 = load i32, i32* %3
%195 = getelementptr inbounds [1000 x i8], [1000 x i8]* %14, i64 0, i64 0
%196 = call i32 @recv(i32 %194, i8* %195, i32 1000, i32 0)
%197 = icmp eq i32 %196, -1
br i1 %197, label %198, label %200
198: ; preds = %191
%199 = call i32 @perror(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.3, i64 0, i64 0))
br label %200
200: ; preds = %198, %191
%201 = getelementptr inbounds [1000 x i8], [1000 x i8]* %14, i64 0, i64 0
%202 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* %201)
%203 = getelementptr inbounds [10 x i8], [10 x i8]* %12, i64 0, i64 0
%204 = call i32 @bzero(i8* %203, i32 10)
%205 = getelementptr inbounds [10 x i8], [10 x i8]* %12, i64 0, i64 0
%206 = getelementptr inbounds [1000 x i8], [1000 x i8]* %14, i64 0, i64 0
%207 = call i32 @strlen(i8* %206)
%208 = sub nsw i32 %207, 5
%209 = sext i32 %208 to i64
%210 = getelementptr inbounds [1000 x i8], [1000 x i8]* %14, i64 0, i64 %209
%211 = call i32 @strcpy(i8* %205, i8* %210)
br label %212
212: ; preds = %200
%213 = getelementptr inbounds [6 x i8], [6 x i8]* %11, i64 0, i64 0
%214 = getelementptr inbounds [10 x i8], [10 x i8]* %12, i64 0, i64 0
%215 = call i32 @strcmp(i8* %213, i8* %214)
%216 = icmp ne i32 %215, 0
br i1 %216, label %191, label %217
217: ; preds = %212
br label %281
218: ; preds = %117
%219 = getelementptr inbounds [25 x i8], [25 x i8]* %6, i64 0, i64 0
%220 = call i32 @bzero(i8* %219, i32 25)
%221 = getelementptr inbounds [4 x i8], [4 x i8]* %10, i64 0, i64 0
%222 = call i32 @bzero(i8* %221, i32 4)
%223 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.17, i64 0, i64 0))
%224 = getelementptr inbounds [4 x i8], [4 x i8]* %10, i64 0, i64 0
%225 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* %224)
%226 = getelementptr inbounds [25 x i8], [25 x i8]* %6, i64 0, i64 0
%227 = call i32 @strcpy(i8* %226, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.19, i64 0, i64 0))
%228 = getelementptr inbounds [25 x i8], [25 x i8]* %6, i64 0, i64 0
%229 = getelementptr inbounds [4 x i8], [4 x i8]* %10, i64 0, i64 0
%230 = call i32 @strcat(i8* %228, i8* %229)
%231 = getelementptr inbounds [25 x i8], [25 x i8]* %6, i64 0, i64 0
%232 = call i32 @strcat(i8* %231, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
%233 = load i32, i32* %3
%234 = getelementptr inbounds [25 x i8], [25 x i8]* %6, i64 0, i64 0
%235 = getelementptr inbounds [25 x i8], [25 x i8]* %6, i64 0, i64 0
%236 = call i32 @strlen(i8* %235)
%237 = call i32 @send(i32 %233, i8* %234, i32 %236, i32 0)
%238 = icmp eq i32 %237, -1
br i1 %238, label %239, label %241
239: ; preds = %218
%240 = call i32 @perror(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.7, i64 0, i64 0))
br label %241
241: ; preds = %239, %218
%242 = getelementptr inbounds [1000 x i8], [1000 x i8]* %14, i64 0, i64 0
%243 = call i32 @bzero(i8* %242, i32 1000)
%244 = load i32, i32* %3
%245 = getelementptr inbounds [1000 x i8], [1000 x i8]* %14, i64 0, i64 0
%246 = call i32 @recv(i32 %244, i8* %245, i32 1000, i32 0)
%247 = icmp eq i32 %246, -1
br i1 %247, label %248, label %250
248: ; preds = %241
%249 = call i32 @perror(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.3, i64 0, i64 0))
br label %250
250: ; preds = %248, %241
%251 = getelementptr inbounds [1000 x i8], [1000 x i8]* %14, i64 0, i64 0
%252 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* %251)
br label %281
253: ; preds = %117
%254 = getelementptr inbounds [25 x i8], [25 x i8]* %6, i64 0, i64 0
%255 = call i32 @bzero(i8* %254, i32 25)
%256 = getelementptr inbounds [25 x i8], [25 x i8]* %6, i64 0, i64 0
%257 = call i32 @strcpy(i8* %256, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.20, i64 0, i64 0))
%258 = load i32, i32* %3
%259 = getelementptr inbounds [25 x i8], [25 x i8]* %6, i64 0, i64 0
%260 = getelementptr inbounds [25 x i8], [25 x i8]* %6, i64 0, i64 0
%261 = call i32 @strlen(i8* %260)
%262 = call i32 @send(i32 %258, i8* %259, i32 %261, i32 0)
%263 = icmp eq i32 %262, -1
br i1 %263, label %264, label %266
264: ; preds = %253
%265 = call i32 @perror(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.7, i64 0, i64 0))
br label %266
266: ; preds = %264, %253
%267 = getelementptr inbounds [1000 x i8], [1000 x i8]* %14, i64 0, i64 0
%268 = call i32 @bzero(i8* %267, i32 1000)
%269 = load i32, i32* %3
%270 = getelementptr inbounds [1000 x i8], [1000 x i8]* %14, i64 0, i64 0
%271 = call i32 @recv(i32 %269, i8* %270, i32 1000, i32 0)
%272 = icmp eq i32 %271, -1
br i1 %272, label %273, label %275
273: ; preds = %266
%274 = call i32 @perror(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.3, i64 0, i64 0))
br label %275
275: ; preds = %273, %266
%276 = getelementptr inbounds [1000 x i8], [1000 x i8]* %14, i64 0, i64 0
%277 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* %276)
store i32 1, i32* %5
br label %281
278: ; preds = %117
%279 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.21, i64 0, i64 0))
%280 = call i32 (...) @getchar()
br label %281
281: ; preds = %278, %275, %250, %217, %166
br label %282
282: ; preds = %281
%283 = load i32, i32* %5
%284 = icmp eq i32 %283, 0
br i1 %284, label %117, label %285
285: ; preds = %282
%286 = load i32, i32* %3
%287 = call i32 @close(i32 %286)
%288 = load i32, i32* %1
ret i32 %288
}

LLVM IR (-O2):
%struct.sockaddr_in = type { %struct.in_addr, i32, i32 }
%struct.in_addr = type { i32 }
%struct.hostent = type { i64 }
%struct.sockaddr = type { i32 }
@__const.main.log = [25 x i8] c"user \00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@__const.main.pas = [25 x i8] c"pass \00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00\00"
@__const.main.fin = [6 x i8] c"\0D\0A.\0D\0A\00"
@.str = [17 x i8] c"lucano110.uco.es\00"
@AF_INET = global i32 0
@SOCK_STREAM = global i32 0
@.str.1 = [37 x i8] c"No se puede abrir el socket cliente\0A\00"
@.str.2 = [19 x i8] c"Error de conexi\C3\B3n\00"
@.str.3 = [44 x i8] c"Error en la operaci\C3\B3n de recv del servidor\00"
@.str.4 = [3 x i8] c"%s\00"
@.str.5 = [8 x i8] c"Login: \00"
@.str.6 = [2 x i8] c"\0A\00"
@.str.7 = [21 x i8] c"Error enviando datos\00"
@.str.8 = [7 x i8] c"Pass: \00"
@.str.14 = [10 x i8] c"\0AOpcion: \00"
@.str.15 = [3 x i8] c"%d\00"
@.str.16 = [6 x i8] c"LIST\0A\00"
@.str.17 = [9 x i8] c"Numero: \00"
@.str.18 = [6 x i8] c"RETR \00"
@.str.19 = [6 x i8] c"DELE \00"
@.str.20 = [6 x i8] c"QUIT\0A\00"
@str = [7 x i8] c"\0AMenu:\00"
@str.22 = [29 x i8] c" Opcion 1: Ver los mensajes\00"
@str.23 = [28 x i8] c" Opcion 2: Leer un mensaje\00"
@str.24 = [30 x i8] c" Opcion 3: Borrar un mensaje\00"
@str.25 = [18 x i8] c" Opcion 4: Salir\00"
@str.26 = [50 x i8] c"\0AOpcion incorrecta, pulse ENTER para continuar...\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [25 x i8]
%3 = alloca [25 x i8]
%4 = alloca [25 x i8]
%5 = alloca [4 x i8]
%6 = alloca [10 x i8]
%7 = alloca %struct.sockaddr_in
%8 = alloca [1000 x i8]
%9 = bitcast i32* %1 to i8*
%10 = getelementptr inbounds [25 x i8], [25 x i8]* %2, i64 0, i64 0
%11 = getelementptr inbounds [25 x i8], [25 x i8]* %3, i64 0, i64 0
%12 = getelementptr inbounds [25 x i8], [25 x i8]* %4, i64 0, i64 0
%13 = getelementptr inbounds [4 x i8], [4 x i8]* %5, i64 0, i64 0
%14 = getelementptr inbounds [10 x i8], [10 x i8]* %6, i64 0, i64 0
%15 = bitcast %struct.sockaddr_in* %7 to i8*
%16 = getelementptr inbounds [1000 x i8], [1000 x i8]* %8, i64 0, i64 0
%17 = tail call %struct.hostent* @gethostbyname(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str, i64 0, i64 0))
%18 = load i32, i32* @AF_INET
%19 = load i32, i32* @SOCK_STREAM
%20 = tail call i32 @socket(i32 %18, i32 %19, i32 0)
%21 = icmp eq i32 %20, -1
br i1 %21, label %22, label %25
22: ; preds = %0
%23 = tail call i32 @perror(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.1, i64 0, i64 0))
%24 = tail call i32 @exit(i32 1)
unreachable
25: ; preds = %0
%26 = load i32, i32* @AF_INET
%27 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %7, i64 0, i32 2
store i32 %26, i32* %27
%28 = tail call i32 @htons(i32 110)
%29 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %7, i64 0, i32 1
store i32 %28, i32* %29
%30 = getelementptr inbounds %struct.hostent, %struct.hostent* %17, i64 0, i32 0
%31 = load i64, i64* %30
%32 = inttoptr i64 %31 to i32*
%33 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %7, i64 0, i32 0, i32 0
%34 = load i32, i32* %32
store i32 %34, i32* %33
%35 = bitcast %struct.sockaddr_in* %7 to %struct.sockaddr*
%36 = call i32 @connect(i32 %20, %struct.sockaddr* %35, i32 12)
%37 = icmp eq i32 %36, -1
br i1 %37, label %38, label %41
38: ; preds = %25
%39 = call i32 @perror(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0))
%40 = call i32 @exit(i32 1)
unreachable
41: ; preds = %25
%42 = call i32 @bzero(i8* %16, i32 1000)
%43 = call i32 @recv(i32 %20, i8* %16, i32 1000, i32 0)
%44 = icmp eq i32 %43, -1
br i1 %44, label %45, label %47
45: ; preds = %41
%46 = call i32 @perror(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.3, i64 0, i64 0))
br label %47
47: ; preds = %45, %41
%48 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* %16)
%49 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.5, i64 0, i64 0))
%50 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* %10)
%51 = call i32 @strcat(i8* %11, i8* %10)
%52 = call i32 @strcat(i8* %11, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
%53 = call i32 @strlen(i8* %11)
%54 = call i32 @send(i32 %20, i8* %11, i32 %53, i32 0)
%55 = icmp eq i32 %54, -1
br i1 %55, label %56, label %58
56: ; preds = %47
%57 = call i32 @perror(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.7, i64 0, i64 0))
br label %58
58: ; preds = %56, %47
%59 = call i32 @bzero(i8* %16, i32 1000)
%60 = call i32 @recv(i32 %20, i8* %16, i32 1000, i32 0)
%61 = icmp eq i32 %60, -1
br i1 %61, label %62, label %64
62: ; preds = %58
%63 = call i32 @perror(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.3, i64 0, i64 0))
br label %64
64: ; preds = %62, %58
%65 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* %16)
%66 = call i32 @bzero(i8* %10, i32 25)
%67 = call i8* @getpass(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.8, i64 0, i64 0))
%68 = call i32 @strcat(i8* %12, i8* %67)
%69 = call i32 @strcat(i8* %12, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
%70 = call i32 @strlen(i8* %12)
%71 = call i32 @send(i32 %20, i8* %12, i32 %70, i32 0)
%72 = icmp eq i32 %71, -1
br i1 %72, label %73, label %75
73: ; preds = %64
%74 = call i32 @perror(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.7, i64 0, i64 0))
br label %75
75: ; preds = %73, %64
%76 = call i32 @bzero(i8* %16, i32 1000)
%77 = call i32 @recv(i32 %20, i8* %16, i32 1000, i32 0)
%78 = icmp eq i32 %77, -1
br i1 %78, label %79, label %81
79: ; preds = %75
%80 = call i32 @perror(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.3, i64 0, i64 0))
br label %81
81: ; preds = %79, %75
%82 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* %16)
br label %83
83: ; preds = %188, %81
%84 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str, i64 0, i64 0))
%85 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str.22, i64 0, i64 0))
%86 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str.23, i64 0, i64 0))
%87 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str.24, i64 0, i64 0))
%88 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str.25, i64 0, i64 0))
%89 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.14, i64 0, i64 0))
%90 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.15, i64 0, i64 0), i32* %1)
%91 = load i32, i32* %1
switch i32 %91, label %185 [
i32 1, label %92
i32 2, label %117
i32 3, label %147
i32 4, label %168
]
92: ; preds = %83
%93 = call i32 @bzero(i8* %10, i32 25)
%94 = call i32 @strcpy(i8* %10, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.16, i64 0, i64 0))
%95 = call i32 @strlen(i8* %10)
%96 = call i32 @send(i32 %20, i8* %10, i32 %95, i32 0)
%97 = icmp eq i32 %96, -1
br i1 %97, label %98, label %100
98: ; preds = %92
%99 = call i32 @perror(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.7, i64 0, i64 0))
br label %100
100: ; preds = %98, %92
br label %101
101: ; preds = %100, %107
%102 = call i32 @bzero(i8* %16, i32 1000)
%103 = call i32 @recv(i32 %20, i8* %16, i32 1000, i32 0)
%104 = icmp eq i32 %103, -1
br i1 %104, label %105, label %107
105: ; preds = %101
%106 = call i32 @perror(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.3, i64 0, i64 0))
br label %107
107: ; preds = %105, %101
%108 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* %16)
%109 = call i32 @bzero(i8* %14, i32 10)
%110 = call i32 @strlen(i8* %16)
%111 = add nsw i32 %110, -5
%112 = sext i32 %111 to i64
%113 = getelementptr inbounds [1000 x i8], [1000 x i8]* %8, i64 0, i64 %112
%114 = call i32 @strcpy(i8* %14, i8* %113)
%115 = call i32 @bcmp(i8* dereferenceable(6) getelementptr inbounds ([6 x i8], [6 x i8]* @__const.main.fin, i64 0, i64 0), i8* dereferenceable(6) %14, i64 6)
%116 = icmp eq i32 %115, 0
br i1 %116, label %188, label %101
117: ; preds = %83
%118 = call i32 @bzero(i8* %10, i32 25)
%119 = call i32 @bzero(i8* %13, i32 4)
%120 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.17, i64 0, i64 0))
%121 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* %13)
%122 = call i32 @strcpy(i8* %10, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.18, i64 0, i64 0))
%123 = call i32 @strcat(i8* %10, i8* %13)
%124 = call i32 @strcat(i8* %10, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
%125 = call i32 @strlen(i8* %10)
%126 = call i32 @send(i32 %20, i8* %10, i32 %125, i32 0)
%127 = icmp eq i32 %126, -1
br i1 %127, label %128, label %130
128: ; preds = %117
%129 = call i32 @perror(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.7, i64 0, i64 0))
br label %130
130: ; preds = %128, %117
br label %131
131: ; preds = %130, %137
%132 = call i32 @bzero(i8* %16, i32 1000)
%133 = call i32 @recv(i32 %20, i8* %16, i32 1000, i32 0)
%134 = icmp eq i32 %133, -1
br i1 %134, label %135, label %137
135: ; preds = %131
%136 = call i32 @perror(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.3, i64 0, i64 0))
br label %137
137: ; preds = %135, %131
%138 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* %16)
%139 = call i32 @bzero(i8* %14, i32 10)
%140 = call i32 @strlen(i8* %16)
%141 = add nsw i32 %140, -5
%142 = sext i32 %141 to i64
%143 = getelementptr inbounds [1000 x i8], [1000 x i8]* %8, i64 0, i64 %142
%144 = call i32 @strcpy(i8* %14, i8* %143)
%145 = call i32 @bcmp(i8* dereferenceable(6) getelementptr inbounds ([6 x i8], [6 x i8]* @__const.main.fin, i64 0, i64 0), i8* dereferenceable(6) %14, i64 6)
%146 = icmp eq i32 %145, 0
br i1 %146, label %188, label %131
147: ; preds = %83
%148 = call i32 @bzero(i8* %10, i32 25)
%149 = call i32 @bzero(i8* %13, i32 4)
%150 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.17, i64 0, i64 0))
%151 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* %13)
%152 = call i32 @strcpy(i8* %10, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.19, i64 0, i64 0))
%153 = call i32 @strcat(i8* %10, i8* %13)
%154 = call i32 @strcat(i8* %10, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
%155 = call i32 @strlen(i8* %10)
%156 = call i32 @send(i32 %20, i8* %10, i32 %155, i32 0)
%157 = icmp eq i32 %156, -1
br i1 %157, label %158, label %160
158: ; preds = %147
%159 = call i32 @perror(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.7, i64 0, i64 0))
br label %160
160: ; preds = %158, %147
%161 = call i32 @bzero(i8* %16, i32 1000)
%162 = call i32 @recv(i32 %20, i8* %16, i32 1000, i32 0)
%163 = icmp eq i32 %162, -1
br i1 %163, label %164, label %166
164: ; preds = %160
%165 = call i32 @perror(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.3, i64 0, i64 0))
br label %166
166: ; preds = %164, %160
%167 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* %16)
br label %188
168: ; preds = %83
%169 = call i32 @bzero(i8* %10, i32 25)
%170 = call i32 @strcpy(i8* %10, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.20, i64 0, i64 0))
%171 = call i32 @strlen(i8* %10)
%172 = call i32 @send(i32 %20, i8* %10, i32 %171, i32 0)
%173 = icmp eq i32 %172, -1
br i1 %173, label %174, label %176
174: ; preds = %168
%175 = call i32 @perror(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.7, i64 0, i64 0))
br label %176
176: ; preds = %174, %168
%177 = call i32 @bzero(i8* %16, i32 1000)
%178 = call i32 @recv(i32 %20, i8* %16, i32 1000, i32 0)
%179 = icmp eq i32 %178, -1
br i1 %179, label %180, label %182
180: ; preds = %176
%181 = call i32 @perror(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str.3, i64 0, i64 0))
br label %182
182: ; preds = %180, %176
%183 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* %16)
%184 = call i32 @close(i32 %20)
ret i32 0
185: ; preds = %83
%186 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([50 x i8], [50 x i8]* @str.26, i64 0, i64 0))
%187 = call i32 (...) @getchar()
br label %188
188: ; preds = %137, %107, %185, %166
br label %83
}