#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 sockaddr_storage {
  int dummy;
};
struct sockaddr {
  int dummy;
};
struct addrinfo {
  int /*<<< orphan*/ ai_addrlen;
  int /*<<< orphan*/ 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*/ sock;

/* Variables and functions */
int /*<<< orphan*/ AF_UNSPEC;
int /*<<< orphan*/ AI_PASSIVE;
int NI_MAXHOST;
int NI_MAXSERV;
int NI_NUMERICHOST;
int NI_NUMERICSERV;
int /*<<< orphan*/ SOCK_DGRAM;
int /*<<< orphan*/ _exit(int);
int /*<<< orphan*/ bind(int, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ freeaddrinfo(struct addrinfo *);
int getaddrinfo(char *, char *, struct addrinfo *, struct addrinfo **);
int /*<<< orphan*/ getnameinfo(struct sockaddr *, int, char *, int, char *, int,
                               int);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *, char *, char *);
int recvfrom(int, char *, int, int /*<<< orphan*/, struct sockaddr *, int *);
int /*<<< orphan*/ sendto(int, char *, int, int /*<<< orphan*/,
                          struct sockaddr *, int);
int socket(int /*<<< orphan*/, int /*<<< orphan*/, scalar_t__);
scalar_t__ strcmp(char *, char *);
int strlen(char *);
int main(int argc, char **argv) {
  struct addrinfo hints;
  struct addrinfo *res;
  int info, sd;
  int nread;
  char buf[256];
  hints.ai_family = AF_UNSPEC;
  hints.ai_socktype = SOCK_DGRAM;
  hints.ai_flags = AI_PASSIVE;
  hints.ai_protocol = 0;
  if (argc < 1)
    perror("Error de argumentos.\n");
  info = getaddrinfo("::", argv[1], &hints, &res);
  if (info != 0)
    perror("Error getaddrinfo.\n");
  sd = socket(res->ai_family, res->ai_socktype, res->ai_protocol);
  bind(sd, res->ai_addr, res->ai_addrlen);
  while (1) {
    struct sockaddr_storage sock;
    socklen_t sock_len = sizeof(sock);
    char host[NI_MAXHOST];
    char serv[NI_MAXSERV];
    nread = recvfrom(sd, buf, 256, 0, (struct sockaddr *)&sock, &sock_len);
    buf[nread] = '\0';
    getnameinfo((struct sockaddr *)&sock, sock_len, host, NI_MAXHOST, serv,
                NI_MAXSERV, NI_NUMERICHOST | NI_NUMERICSERV);
    if (strcmp(buf, "a") == 0 || strcmp(buf, "a\n") == 0) {
      sendto(sd, host, strlen(host), 0, (struct sockaddr *)&sock, sock_len);
    } else if (strcmp(buf, "p") == 0 || strcmp(buf, "p\n") == 0) {
      sendto(sd, serv, strlen(serv), 0, (struct sockaddr *)&sock, sock_len);
    } else if (strcmp(buf, "q") == 0 || strcmp(buf, "q\n") == 0) {
      sendto(sd, "ADIÓS\n", 6, 0, (struct sockaddr *)&sock, sock_len);
      freeaddrinfo(res);
      close(sd);
      _exit(1);
    }
    printf("Host: %s, Puerto: %s\n", host, serv);
  }
  freeaddrinfo(res);
  close(sd);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x190,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    0x2de8(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x1c(%rbp)
mov    0x2dcc(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x20(%rbp)
mov    0x2dd8(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x18(%rbp)
movq   $0x0,-0x28(%rbp)
cmpl   $0x1,-0x8(%rbp)
jge    122b <main+0x5b>
lea    0xdda(%rip),%rdi
call   10c0 <perror@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rsi
lea    0xddc(%rip),%rdi
lea    -0x30(%rbp),%rdx
lea    -0x38(%rbp),%rcx
call   10d0 <getaddrinfo@plt>
mov    %eax,-0x3c(%rbp)
cmpl   $0x0,-0x3c(%rbp)
je     1260 <main+0x90>
lea    0xdbe(%rip),%rdi
call   10c0 <perror@plt>
mov    -0x38(%rbp),%rax
mov    0x14(%rax),%edi
mov    -0x38(%rbp),%rax
mov    0x10(%rax),%esi
mov    -0x38(%rbp),%rax
mov    0x8(%rax),%rdx
call   10f0 <socket@plt>
mov    %eax,-0x40(%rbp)
mov    -0x40(%rbp),%edi
mov    -0x38(%rbp),%rax
mov    0x4(%rax),%esi
mov    -0x38(%rbp),%rax
mov    (%rax),%edx
call   10b0 <bind@plt>
movl   $0x4,-0x15c(%rbp)
mov    0x2d0c(%rip),%rax
mov    (%rax),%eax
mov    %rsp,%rcx
mov    %rcx,-0x168(%rbp)
mov    %rax,%rdx
add    $0xf,%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x188(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x170(%rbp)
mov    0x2cf7(%rip),%rax
mov    (%rax),%eax
mov    %rax,%rdx
add    $0xf,%rdx
and    $0xfffffffffffffff0,%rdx
mov    %rsp,%rcx
sub    %rdx,%rcx
mov    %rcx,-0x180(%rbp)
mov    %rcx,%rsp
mov    %rax,-0x178(%rbp)
mov    -0x40(%rbp),%edi
lea    -0x150(%rbp),%rsi
lea    -0x158(%rbp),%r8
mov    $0x100,%edx
xor    %ecx,%ecx
lea    -0x15c(%rbp),%r9
call   10a0 <recvfrom@plt>
mov    -0x188(%rbp),%rdx
mov    -0x180(%rbp),%r8
mov    %eax,-0x44(%rbp)
movslq -0x44(%rbp),%rax
movb   $0x0,-0x150(%rbp,%rax,1)
lea    -0x158(%rbp),%rdi
mov    -0x15c(%rbp),%esi
mov    0x2c5e(%rip),%rax
mov    (%rax),%ecx
mov    0x2c75(%rip),%rax
mov    (%rax),%r9d
mov    0x2c53(%rip),%rax
mov    (%rax),%eax
mov    0x2c7a(%rip),%r10
or     (%r10),%eax
sub    $0x10,%rsp
mov    %eax,(%rsp)
call   1080 <getnameinfo@plt>
add    $0x10,%rsp
lea    -0x150(%rbp),%rdi
lea    0xc9e(%rip),%rsi
call   1090 <strcmp@plt>
cmp    $0x0,%rax
je     13bb <main+0x1eb>
lea    -0x150(%rbp),%rdi
lea    0xc83(%rip),%rsi
call   1090 <strcmp@plt>
cmp    $0x0,%rax
jne    13f9 <main+0x229>
mov    -0x188(%rbp),%rdi
mov    -0x40(%rbp),%eax
mov    %eax,-0x18c(%rbp)
call   1040 <strlen@plt>
mov    -0x18c(%rbp),%edi
mov    -0x188(%rbp),%rsi
mov    %eax,%edx
lea    -0x158(%rbp),%r8
mov    -0x15c(%rbp),%r9d
xor    %ecx,%ecx
call   1060 <sendto@plt>
jmp    14f4 <main+0x324>
lea    -0x150(%rbp),%rdi
lea    0xc2b(%rip),%rsi
call   1090 <strcmp@plt>
cmp    $0x0,%rax
je     1433 <main+0x263>
lea    -0x150(%rbp),%rdi
lea    0xc10(%rip),%rsi
call   1090 <strcmp@plt>
cmp    $0x0,%rax
jne    1471 <main+0x2a1>
mov    -0x180(%rbp),%rdi
mov    -0x40(%rbp),%eax
mov    %eax,-0x190(%rbp)
call   1040 <strlen@plt>
mov    -0x190(%rbp),%edi
mov    -0x180(%rbp),%rsi
mov    %eax,%edx
lea    -0x158(%rbp),%r8
mov    -0x15c(%rbp),%r9d
xor    %ecx,%ecx
call   1060 <sendto@plt>
jmp    14ef <main+0x31f>
lea    -0x150(%rbp),%rdi
lea    0xbb8(%rip),%rsi
call   1090 <strcmp@plt>
cmp    $0x0,%rax
je     14ab <main+0x2db>
lea    -0x150(%rbp),%rdi
lea    0xb9d(%rip),%rsi
call   1090 <strcmp@plt>
cmp    $0x0,%rax
jne    14ea <main+0x31a>
mov    -0x40(%rbp),%edi
lea    -0x158(%rbp),%r8
mov    -0x15c(%rbp),%r9d
lea    0xb79(%rip),%rsi
mov    $0x6,%edx
xor    %ecx,%ecx
call   1060 <sendto@plt>
mov    -0x38(%rbp),%rdi
call   10e0 <freeaddrinfo@plt>
mov    -0x40(%rbp),%edi
call   1070 <close@plt>
mov    $0x1,%edi
call   1030 <_exit@plt>
jmp    14ef <main+0x31f>
jmp    14f4 <main+0x324>
mov    -0x180(%rbp),%rdx
mov    -0x188(%rbp),%rsi
lea    0xb3b(%rip),%rdi
call   1050 <printf@plt>
mov    -0x168(%rbp),%rax
mov    %rax,%rsp
jmp    1293 <main+0xc3>

x86 assembly (clang, -O2):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x148,%rsp
mov    %rsi,%rbx
mov    0x2dea(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x54(%rbp)
mov    0x2dce(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x58(%rbp)
mov    0x2dda(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x50(%rbp)
movq   $0x0,-0x60(%rbp)
test   %edi,%edi
jg     1223 <main+0x53>
lea    0xde2(%rip),%rdi
call   10c0 <perror@plt>
mov    0x8(%rbx),%rsi
lea    0xde8(%rip),%rdi
lea    -0x68(%rbp),%rdx
lea    -0x40(%rbp),%rcx
call   10d0 <getaddrinfo@plt>
test   %eax,%eax
je     124b <main+0x7b>
lea    0xdd3(%rip),%rdi
call   10c0 <perror@plt>
mov    -0x40(%rbp),%rax
mov    0x14(%rax),%edi
mov    0x10(%rax),%esi
mov    0x8(%rax),%rdx
call   10f0 <socket@plt>
mov    %eax,%edi
mov    -0x40(%rbp),%rax
mov    (%rax),%edx
mov    0x4(%rax),%esi
mov    %edi,-0x30(%rbp)
call   10b0 <bind@plt>
jmp    12b5 <main+0xe5>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r13,%rdi
call   1040 <strlen@plt>
mov    -0x2c(%rbp),%r9d
mov    -0x30(%rbp),%edi
mov    %r13,%rsi
mov    %eax,%edx
xor    %ecx,%ecx
lea    -0x38(%rbp),%r8
call   1060 <sendto@plt>
lea    0xd9e(%rip),%rdi
mov    %r13,%rsi
mov    %r12,%rdx
call   1050 <printf@plt>
mov    -0x48(%rbp),%rsp
mov    %rsp,-0x48(%rbp)
movl   $0x4,-0x2c(%rbp)
mov    0x2ce9(%rip),%r14
mov    (%r14),%eax
mov    %rsp,%r13
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%r13
mov    %r13,%rsp
mov    0x2cee(%rip),%r15
mov    (%r15),%eax
mov    %rsp,%r12
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%r12
mov    %r12,%rsp
mov    -0x30(%rbp),%edi
lea    -0x170(%rbp),%rbx
mov    %rbx,%rsi
mov    $0x100,%edx
xor    %ecx,%ecx
lea    -0x38(%rbp),%r14
mov    %r14,%r8
lea    -0x2c(%rbp),%r9
call   10a0 <recvfrom@plt>
cltq
movb   $0x0,-0x170(%rbp,%rax,1)
mov    -0x2c(%rbp),%esi
mov    0x2c82(%rip),%rax
mov    (%rax),%ecx
mov    (%r15),%r9d
mov    0x2cae(%rip),%rax
mov    (%rax),%eax
mov    0x2c75(%rip),%rdx
or     (%rdx),%eax
sub    $0x8,%rsp
mov    %r14,%rdi
mov    %r13,%rdx
mov    %r12,%r8
push   %rax
call   1080 <getnameinfo@plt>
add    $0x10,%rsp
mov    %rbx,%rdi
lea    0xcc7(%rip),%rsi
call   1090 <strcmp@plt>
test   %rax,%rax
je     1280 <main+0xb0>
mov    %rbx,%rdi
lea    0xcb1(%rip),%rsi
call   1090 <strcmp@plt>
test   %rax,%rax
je     1280 <main+0xb0>
mov    %rbx,%rdi
lea    0xc9c(%rip),%rsi
call   1090 <strcmp@plt>
test   %rax,%rax
je     13f0 <main+0x220>
mov    %rbx,%rdi
lea    0xc8a(%rip),%rsi
call   1090 <strcmp@plt>
test   %rax,%rax
je     13f0 <main+0x220>
mov    %rbx,%rdi
lea    0xc79(%rip),%rsi
call   1090 <strcmp@plt>
test   %rax,%rax
je     1407 <main+0x237>
mov    %rbx,%rdi
lea    0xc67(%rip),%rsi
call   1090 <strcmp@plt>
test   %rax,%rax
jne    129f <main+0xcf>
jmp    1407 <main+0x237>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    %r12,%rdi
call   1040 <strlen@plt>
mov    -0x2c(%rbp),%r9d
mov    -0x30(%rbp),%edi
mov    %r12,%rsi
jmp    1292 <main+0xc2>
mov    -0x2c(%rbp),%r9d
lea    0xc2a(%rip),%rsi
lea    -0x38(%rbp),%r8
mov    -0x30(%rbp),%ebx
mov    %ebx,%edi
mov    $0x6,%edx
xor    %ecx,%ecx
call   1060 <sendto@plt>
mov    -0x40(%rbp),%rdi
call   10e0 <freeaddrinfo@plt>
mov    %ebx,%edi
call   1070 <close@plt>
mov    $0x1,%edi
call   1030 <_exit@plt>

LLVM IR (-O0):
%struct.addrinfo = type { i32, i32, i64, i32, i32, i32 }
%struct.sockaddr_storage = type { i32 }
%struct.sockaddr = type { i32 }
@AF_UNSPEC = global i32 0
@SOCK_DGRAM = global i32 0
@AI_PASSIVE = global i32 0
@.str = [22 x i8] c"Error de argumentos.\0A\00"
@.str.1 = [3 x i8] c"::\00"
@.str.2 = [20 x i8] c"Error getaddrinfo.\0A\00"
@NI_MAXHOST = global i32 0
@NI_MAXSERV = global i32 0
@NI_NUMERICHOST = global i32 0
@NI_NUMERICSERV = global i32 0
@.str.3 = [2 x i8] c"a\00"
@.str.4 = [3 x i8] c"a\0A\00"
@.str.5 = [2 x i8] c"p\00"
@.str.6 = [3 x i8] c"p\0A\00"
@.str.7 = [2 x i8] c"q\00"
@.str.8 = [3 x i8] c"q\0A\00"
@.str.9 = [8 x i8] c"ADI\C3\93S\0A\00"
@.str.10 = [22 x i8] c"Host: %s, Puerto: %s\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca %struct.addrinfo
%7 = alloca %struct.addrinfo*
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca [256 x i8]
%12 = alloca %struct.sockaddr_storage
%13 = alloca i32
%14 = alloca i8*
%15 = alloca i64
%16 = alloca i64
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%17 = load i32, i32* @AF_UNSPEC
%18 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %6, i32 0, i32 4
store i32 %17, i32* %18
%19 = load i32, i32* @SOCK_DGRAM
%20 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %6, i32 0, i32 3
store i32 %19, i32* %20
%21 = load i32, i32* @AI_PASSIVE
%22 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %6, i32 0, i32 5
store i32 %21, i32* %22
%23 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %6, i32 0, i32 2
store i64 0, i64* %23
%24 = load i32, i32* %4
%25 = icmp slt i32 %24, 1
br i1 %25, label %26, label %28
26: ; preds = %2
%27 = call i32 @perror(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
br label %28
28: ; preds = %26, %2
%29 = load i8**, i8*** %5
%30 = getelementptr inbounds i8*, i8** %29, i64 1
%31 = load i8*, i8** %30
%32 = call i32 @getaddrinfo(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %31, %struct.addrinfo* %6, %struct.addrinfo** %7)
store i32 %32, i32* %8
%33 = load i32, i32* %8
%34 = icmp ne i32 %33, 0
br i1 %34, label %35, label %37
35: ; preds = %28
%36 = call i32 @perror(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0))
br label %37
37: ; preds = %35, %28
%38 = load %struct.addrinfo*, %struct.addrinfo** %7
%39 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %38, i32 0, i32 4
%40 = load i32, i32* %39
%41 = load %struct.addrinfo*, %struct.addrinfo** %7
%42 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %41, i32 0, i32 3
%43 = load i32, i32* %42
%44 = load %struct.addrinfo*, %struct.addrinfo** %7
%45 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %44, i32 0, i32 2
%46 = load i64, i64* %45
%47 = call i32 @socket(i32 %40, i32 %43, i64 %46)
store i32 %47, i32* %9
%48 = load i32, i32* %9
%49 = load %struct.addrinfo*, %struct.addrinfo** %7
%50 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %49, i32 0, i32 1
%51 = load i32, i32* %50
%52 = load %struct.addrinfo*, %struct.addrinfo** %7
%53 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %52, i32 0, i32 0
%54 = load i32, i32* %53
%55 = call i32 @bind(i32 %48, i32 %51, i32 %54)
br label %56
56: ; preds = %37, %126
store i32 4, i32* %13
%57 = load i32, i32* @NI_MAXHOST
%58 = zext i32 %57 to i64
%59 = call i8* @llvm.stacksave()
store i8* %59, i8** %14
%60 = alloca i8, i64 %58
store i64 %58, i64* %15
%61 = load i32, i32* @NI_MAXSERV
%62 = zext i32 %61 to i64
%63 = alloca i8, i64 %62
store i64 %62, i64* %16
%64 = load i32, i32* %9
%65 = getelementptr inbounds [256 x i8], [256 x i8]* %11, i64 0, i64 0
%66 = bitcast %struct.sockaddr_storage* %12 to %struct.sockaddr*
%67 = call i32 @recvfrom(i32 %64, i8* %65, i32 256, i32 0, %struct.sockaddr* %66, i32* %13)
store i32 %67, i32* %10
%68 = load i32, i32* %10
%69 = sext i32 %68 to i64
%70 = getelementptr inbounds [256 x i8], [256 x i8]* %11, i64 0, i64 %69
store i8 0, i8* %70
%71 = bitcast %struct.sockaddr_storage* %12 to %struct.sockaddr*
%72 = load i32, i32* %13
%73 = load i32, i32* @NI_MAXHOST
%74 = load i32, i32* @NI_MAXSERV
%75 = load i32, i32* @NI_NUMERICHOST
%76 = load i32, i32* @NI_NUMERICSERV
%77 = or i32 %75, %76
%78 = call i32 @getnameinfo(%struct.sockaddr* %71, i32 %72, i8* %60, i32 %73, i8* %63, i32 %74, i32 %77)
%79 = getelementptr inbounds [256 x i8], [256 x i8]* %11, i64 0, i64 0
%80 = call i64 @strcmp(i8* %79, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%81 = icmp eq i64 %80, 0
br i1 %81, label %86, label %82
82: ; preds = %56
%83 = getelementptr inbounds [256 x i8], [256 x i8]* %11, i64 0, i64 0
%84 = call i64 @strcmp(i8* %83, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%85 = icmp eq i64 %84, 0
br i1 %85, label %86, label %92
86: ; preds = %82, %56
%87 = load i32, i32* %9
%88 = call i32 @strlen(i8* %60)
%89 = bitcast %struct.sockaddr_storage* %12 to %struct.sockaddr*
%90 = load i32, i32* %13
%91 = call i32 @sendto(i32 %87, i8* %60, i32 %88, i32 0, %struct.sockaddr* %89, i32 %90)
br label %126
92: ; preds = %82
%93 = getelementptr inbounds [256 x i8], [256 x i8]* %11, i64 0, i64 0
%94 = call i64 @strcmp(i8* %93, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%95 = icmp eq i64 %94, 0
br i1 %95, label %100, label %96
96: ; preds = %92
%97 = getelementptr inbounds [256 x i8], [256 x i8]* %11, i64 0, i64 0
%98 = call i64 @strcmp(i8* %97, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
%99 = icmp eq i64 %98, 0
br i1 %99, label %100, label %106
100: ; preds = %96, %92
%101 = load i32, i32* %9
%102 = call i32 @strlen(i8* %63)
%103 = bitcast %struct.sockaddr_storage* %12 to %struct.sockaddr*
%104 = load i32, i32* %13
%105 = call i32 @sendto(i32 %101, i8* %63, i32 %102, i32 0, %struct.sockaddr* %103, i32 %104)
br label %125
106: ; preds = %96
%107 = getelementptr inbounds [256 x i8], [256 x i8]* %11, i64 0, i64 0
%108 = call i64 @strcmp(i8* %107, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
%109 = icmp eq i64 %108, 0
br i1 %109, label %114, label %110
110: ; preds = %106
%111 = getelementptr inbounds [256 x i8], [256 x i8]* %11, i64 0, i64 0
%112 = call i64 @strcmp(i8* %111, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0))
%113 = icmp eq i64 %112, 0
br i1 %113, label %114, label %124
114: ; preds = %110, %106
%115 = load i32, i32* %9
%116 = bitcast %struct.sockaddr_storage* %12 to %struct.sockaddr*
%117 = load i32, i32* %13
%118 = call i32 @sendto(i32 %115, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.9, i64 0, i64 0), i32 6, i32 0, %struct.sockaddr* %116, i32 %117)
%119 = load %struct.addrinfo*, %struct.addrinfo** %7
%120 = call i32 @freeaddrinfo(%struct.addrinfo* %119)
%121 = load i32, i32* %9
%122 = call i32 @close(i32 %121)
%123 = call i32 @_exit(i32 1)
unreachable
124: ; preds = %110
br label %125
125: ; preds = %124, %100
br label %126
126: ; preds = %125, %86
%127 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.10, i64 0, i64 0), i8* %60, i8* %63)
%128 = load i8*, i8** %14
br label %56
}

LLVM IR (-O2):
%struct.addrinfo = type { i32, i32, i64, i32, i32, i32 }
%struct.sockaddr_storage = type { i32 }
%struct.sockaddr = type { i32 }
@AF_UNSPEC = global i32 0
@SOCK_DGRAM = global i32 0
@AI_PASSIVE = global i32 0
@.str = [22 x i8] c"Error de argumentos.\0A\00"
@.str.1 = [3 x i8] c"::\00"
@.str.2 = [20 x i8] c"Error getaddrinfo.\0A\00"
@NI_MAXHOST = global i32 0
@NI_MAXSERV = global i32 0
@NI_NUMERICHOST = global i32 0
@NI_NUMERICSERV = global i32 0
@.str.3 = [2 x i8] c"a\00"
@.str.4 = [3 x i8] c"a\0A\00"
@.str.5 = [2 x i8] c"p\00"
@.str.6 = [3 x i8] c"p\0A\00"
@.str.7 = [2 x i8] c"q\00"
@.str.8 = [3 x i8] c"q\0A\00"
@.str.9 = [8 x i8] c"ADI\C3\93S\0A\00"
@.str.10 = [22 x i8] c"Host: %s, Puerto: %s\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca %struct.addrinfo
%4 = alloca %struct.addrinfo*
%5 = alloca [256 x i8]
%6 = alloca %struct.sockaddr_storage
%7 = alloca i32
%8 = bitcast %struct.addrinfo* %3 to i8*
%9 = bitcast %struct.addrinfo** %4 to i8*
%10 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 0
%11 = load i32, i32* @AF_UNSPEC
%12 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %3, i64 0, i32 4
store i32 %11, i32* %12
%13 = load i32, i32* @SOCK_DGRAM
%14 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %3, i64 0, i32 3
store i32 %13, i32* %14
%15 = load i32, i32* @AI_PASSIVE
%16 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %3, i64 0, i32 5
store i32 %15, i32* %16
%17 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %3, i64 0, i32 2
store i64 0, i64* %17
%18 = icmp slt i32 %0, 1
br i1 %18, label %19, label %21
19: ; preds = %2
%20 = tail call i32 @perror(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str, i64 0, i64 0))
br label %21
21: ; preds = %19, %2
%22 = getelementptr inbounds i8*, i8** %1, i64 1
%23 = load i8*, i8** %22
%24 = call i32 @getaddrinfo(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %23, %struct.addrinfo* %3, %struct.addrinfo** %4)
%25 = icmp eq i32 %24, 0
br i1 %25, label %28, label %26
26: ; preds = %21
%27 = call i32 @perror(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0))
br label %28
28: ; preds = %26, %21
%29 = load %struct.addrinfo*, %struct.addrinfo** %4
%30 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %29, i64 0, i32 4
%31 = load i32, i32* %30
%32 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %29, i64 0, i32 3
%33 = load i32, i32* %32
%34 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %29, i64 0, i32 2
%35 = load i64, i64* %34
%36 = call i32 @socket(i32 %31, i32 %33, i64 %35)
%37 = load %struct.addrinfo*, %struct.addrinfo** %4
%38 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %37, i64 0, i32 1
%39 = load i32, i32* %38
%40 = getelementptr inbounds %struct.addrinfo, %struct.addrinfo* %37, i64 0, i32 0
%41 = load i32, i32* %40
%42 = call i32 @bind(i32 %36, i32 %39, i32 %41)
%43 = bitcast %struct.sockaddr_storage* %6 to i8*
%44 = bitcast i32* %7 to i8*
%45 = bitcast %struct.sockaddr_storage* %6 to %struct.sockaddr*
br label %46
46: ; preds = %96, %28
store i32 4, i32* %7
%47 = load i32, i32* @NI_MAXHOST
%48 = zext i32 %47 to i64
%49 = call i8* @llvm.stacksave()
%50 = alloca i8, i64 %48
%51 = load i32, i32* @NI_MAXSERV
%52 = zext i32 %51 to i64
%53 = alloca i8, i64 %52
%54 = call i32 @recvfrom(i32 %36, i8* %10, i32 256, i32 0, %struct.sockaddr* %45, i32* %7)
%55 = sext i32 %54 to i64
%56 = getelementptr inbounds [256 x i8], [256 x i8]* %5, i64 0, i64 %55
store i8 0, i8* %56
%57 = load i32, i32* %7
%58 = load i32, i32* @NI_MAXHOST
%59 = load i32, i32* @NI_MAXSERV
%60 = load i32, i32* @NI_NUMERICHOST
%61 = load i32, i32* @NI_NUMERICSERV
%62 = or i32 %61, %60
%63 = call i32 @getnameinfo(%struct.sockaddr* %45, i32 %57, i8* %50, i32 %58, i8* %53, i32 %59, i32 %62)
%64 = call i64 @strcmp(i8* %10, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%65 = icmp eq i64 %64, 0
br i1 %65, label %69, label %66
66: ; preds = %46
%67 = call i64 @strcmp(i8* %10, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0))
%68 = icmp eq i64 %67, 0
br i1 %68, label %69, label %73
69: ; preds = %66, %46
%70 = call i32 @strlen(i8* %50)
%71 = load i32, i32* %7
%72 = call i32 @sendto(i32 %36, i8* %50, i32 %70, i32 0, %struct.sockaddr* %45, i32 %71)
br label %96
73: ; preds = %66
%74 = call i64 @strcmp(i8* %10, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%75 = icmp eq i64 %74, 0
br i1 %75, label %79, label %76
76: ; preds = %73
%77 = call i64 @strcmp(i8* %10, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0))
%78 = icmp eq i64 %77, 0
br i1 %78, label %79, label %83
79: ; preds = %76, %73
%80 = call i32 @strlen(i8* %53)
%81 = load i32, i32* %7
%82 = call i32 @sendto(i32 %36, i8* %53, i32 %80, i32 0, %struct.sockaddr* %45, i32 %81)
br label %96
83: ; preds = %76
%84 = call i64 @strcmp(i8* %10, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.7, i64 0, i64 0))
%85 = icmp eq i64 %84, 0
br i1 %85, label %89, label %86
86: ; preds = %83
%87 = call i64 @strcmp(i8* %10, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i64 0, i64 0))
%88 = icmp eq i64 %87, 0
br i1 %88, label %89, label %96
89: ; preds = %86, %83
%90 = load i32, i32* %7
%91 = call i32 @sendto(i32 %36, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.9, i64 0, i64 0), i32 6, i32 0, %struct.sockaddr* %45, i32 %90)
%92 = load %struct.addrinfo*, %struct.addrinfo** %4
%93 = call i32 @freeaddrinfo(%struct.addrinfo* %92)
%94 = call i32 @close(i32 %36)
%95 = call i32 @_exit(i32 1)
unreachable
96: ; preds = %79, %86, %69
%97 = call i32 @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.10, i64 0, i64 0), i8* %50, i8* %53)
br label %46
}