#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_in {
  int dummy;
};
typedef int /*<<< orphan*/ fd_set;

/* Variables and functions */
scalar_t__ FD_ISSET(int, int /*<<< orphan*/ *);
int /*<<< orphan*/ FD_SET(int, int /*<<< orphan*/ *);
int /*<<< orphan*/ FD_ZERO(int /*<<< orphan*/ *);
int /*<<< orphan*/ LC_ALL;
int /*<<< orphan*/ bind_textdomain_codeset(char *, char *);
int /*<<< orphan*/ bindtextdomain(char *, char *);
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ connect_request(int *, struct sockaddr_in *, char *, char *);
int /*<<< orphan*/ exit(int);
char *gettext(char *);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *);
int select(int, int /*<<< orphan*/ *, int /*<<< orphan*/ *,
           int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int /*<<< orphan*/ send_recv(int, int);
int /*<<< orphan*/ setlocale(int /*<<< orphan*/, char *);
int /*<<< orphan*/ textdomain(char *);
int main(int argc, char *argv[]) {
  int sockfd, fdmax, i;
  struct sockaddr_in server_addr;
  fd_set master;
  fd_set read_fds;
  bind_textdomain_codeset("fuentes", "UTF-8");
  setlocale(LC_ALL, "");
  bindtextdomain("fuentes", "idioma");
  textdomain("fuentes");
  if (argc == 3) {
    connect_request(&sockfd, &server_addr, argv[1], argv[2]);
    FD_ZERO(&master);
    FD_ZERO(&read_fds);
    FD_SET(0, &master);
    FD_SET(sockfd, &master);
    fdmax = sockfd;
    while (1) {
      read_fds = master;
      if (select(fdmax + 1, &read_fds, NULL, NULL, NULL) == -1) {
        perror(gettext("Seleccionar"));
        exit(4);
      }
      for (i = 0; i <= fdmax; i++)
        if (FD_ISSET(i, &read_fds))
          send_recv(i, sockfd);
    }
    printf(gettext("Cliente eliminado\n"));
    close(sockfd);
    return 0;
  } else {
    printf(gettext("Número de argumentos invalido\n"));
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
lea    0xe0a(%rip),%rdi
lea    0xe0b(%rip),%rsi
call   10c0 <bind_textdomain_codeset@plt>
mov    0x2dd7(%rip),%rax
mov    (%rax),%edi
lea    0xe2e(%rip),%rsi
call   10d0 <setlocale@plt>
lea    0xde2(%rip),%rdi
lea    0xde9(%rip),%rsi
call   1060 <bindtextdomain@plt>
lea    0xdcf(%rip),%rdi
call   1050 <textdomain@plt>
cmpl   $0x3,-0x4(%rbp)
jne    131f <main+0x13f>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdx
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rcx
lea    -0x14(%rbp),%rdi
lea    -0x20(%rbp),%rsi
call   1030 <connect_request@plt>
lea    -0x24(%rbp),%rdi
call   10a0 <FD_ZERO@plt>
lea    -0x28(%rbp),%rdi
call   10a0 <FD_ZERO@plt>
xor    %edi,%edi
lea    -0x24(%rbp),%rsi
call   1100 <FD_SET@plt>
mov    -0x14(%rbp),%edi
lea    -0x24(%rbp),%rsi
call   1100 <FD_SET@plt>
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x24(%rbp),%eax
mov    %eax,-0x28(%rbp)
mov    -0x18(%rbp),%edi
add    $0x1,%edi
lea    -0x28(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%r8d
mov    %r8,%rdx
mov    %r8,%rcx
call   10b0 <select@plt>
cmp    $0xffffffff,%eax
jne    12d3 <main+0xf3>
lea    0xd59(%rip),%rdi
call   1070 <gettext@plt>
mov    %rax,%rdi
call   10e0 <perror@plt>
mov    $0x4,%edi
call   10f0 <exit@plt>
movl   $0x0,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x18(%rbp),%eax
jg     131a <main+0x13a>
mov    -0x1c(%rbp),%edi
lea    -0x28(%rbp),%rsi
call   1040 <FD_ISSET@plt>
cmp    $0x0,%rax
je     1307 <main+0x127>
mov    -0x1c(%rbp),%edi
mov    -0x14(%rbp),%esi
call   1090 <send_recv@plt>
jmp    130c <main+0x12c>
mov    -0x1c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c(%rbp)
jmp    12da <main+0xfa>
jmp    128c <main+0xac>
lea    0xcfb(%rip),%rdi
call   1070 <gettext@plt>
mov    %rax,%rdi
call   1080 <printf@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x18,%rsp
mov    %rsi,%r14
mov    %edi,%ebp
lea    0xe0a(%rip),%rbx
lea    0xe0b(%rip),%rsi
mov    %rbx,%rdi
call   10c0 <bind_textdomain_codeset@plt>
mov    0x2dd4(%rip),%rax
mov    (%rax),%edi
lea    0xe2b(%rip),%rsi
call   10d0 <setlocale@plt>
lea    0xded(%rip),%rsi
mov    %rbx,%rdi
call   1060 <bindtextdomain@plt>
mov    %rbx,%rdi
call   1050 <textdomain@plt>
cmp    $0x3,%ebp
je     1257 <main+0x77>
lea    0xde4(%rip),%rdi
call   1070 <gettext@plt>
mov    %rax,%rdi
call   1080 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x8(%r14),%rdx
mov    0x10(%r14),%rcx
lea    0x8(%rsp),%rdi
lea    0x10(%rsp),%rsi
call   1030 <connect_request@plt>
lea    0xc(%rsp),%rbx
mov    %rbx,%rdi
call   10a0 <FD_ZERO@plt>
lea    0x4(%rsp),%rbp
mov    %rbp,%rdi
call   10a0 <FD_ZERO@plt>
xor    %edi,%edi
mov    %rbx,%rsi
call   1100 <FD_SET@plt>
mov    0x8(%rsp),%edi
mov    %rbx,%rsi
call   1100 <FD_SET@plt>
mov    0x8(%rsp),%r15d
lea    0x1(%r15),%ebx
mov    0xc(%rsp),%eax
mov    %eax,0x4(%rsp)
mov    %ebx,%edi
mov    %rbp,%rsi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
call   10b0 <select@plt>
cmp    $0xffffffff,%eax
jne    12e3 <main+0x103>
lea    0xd49(%rip),%rdi
call   1070 <gettext@plt>
mov    %rax,%rdi
call   10e0 <perror@plt>
mov    $0x4,%edi
call   10f0 <exit@plt>
lea    0x4(%rsp),%r14
jmp    130e <main+0x12e>
nopw   0x0(%rax,%rax,1)
mov    0xc(%rsp),%eax
mov    %eax,0x4(%rsp)
mov    %ebx,%edi
mov    %r14,%rsi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
call   10b0 <select@plt>
cmp    $0xffffffff,%eax
je     12c5 <main+0xe5>
test   %r15d,%r15d
js     12f0 <main+0x110>
xor    %ebp,%ebp
jmp    1327 <main+0x147>
nopw   0x0(%rax,%rax,1)
add    $0x1,%ebp
cmp    %ebp,%ebx
je     12f0 <main+0x110>
mov    %ebp,%edi
mov    %r14,%rsi
call   1040 <FD_ISSET@plt>
test   %rax,%rax
je     1320 <main+0x140>
mov    0x8(%rsp),%esi
mov    %ebp,%edi
call   1090 <send_recv@plt>
jmp    1320 <main+0x140>

LLVM IR (-O0):
%struct.sockaddr_in = type { i32 }
@.str = [8 x i8] c"fuentes\00"
@.str.1 = [6 x i8] c"UTF-8\00"
@LC_ALL = global i32 0
@.str.2 = [1 x i8] zeroinitializer
@.str.3 = [7 x i8] c"idioma\00"
@.str.4 = [12 x i8] c"Seleccionar\00"
@.str.5 = [32 x i8] c"N\C3\BAmero de argumentos invalido\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i8**
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca %struct.sockaddr_in
%9 = alloca i32
%10 = alloca i32
store i32 %0, i32* %3
store i8** %1, i8*** %4
%11 = call i32 @bind_textdomain_codeset(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%12 = load i32, i32* @LC_ALL
%13 = call i32 @setlocale(i32 %12, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0))
%14 = call i32 @bindtextdomain(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
%15 = call i32 @textdomain(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%16 = load i32, i32* %3
%17 = icmp eq i32 %16, 3
br i1 %17, label %18, label %60
18: ; preds = %2
%19 = load i8**, i8*** %4
%20 = getelementptr inbounds i8*, i8** %19, i64 1
%21 = load i8*, i8** %20
%22 = load i8**, i8*** %4
%23 = getelementptr inbounds i8*, i8** %22, i64 2
%24 = load i8*, i8** %23
%25 = call i32 @connect_request(i32* %5, %struct.sockaddr_in* %8, i8* %21, i8* %24)
%26 = call i32 @FD_ZERO(i32* %9)
%27 = call i32 @FD_ZERO(i32* %10)
%28 = call i32 @FD_SET(i32 0, i32* %9)
%29 = load i32, i32* %5
%30 = call i32 @FD_SET(i32 %29, i32* %9)
%31 = load i32, i32* %5
store i32 %31, i32* %6
br label %32
32: ; preds = %18, %59
%33 = load i32, i32* %9
store i32 %33, i32* %10
%34 = load i32, i32* %6
%35 = add nsw i32 %34, 1
%36 = call i32 @select(i32 %35, i32* %10, i32* null, i32* null, i32* null)
%37 = icmp eq i32 %36, -1
br i1 %37, label %38, label %42
38: ; preds = %32
%39 = call i8* @gettext(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0))
%40 = call i32 @perror(i8* %39)
%41 = call i32 @exit(i32 4)
unreachable
42: ; preds = %32
store i32 0, i32* %7
br label %43
43: ; preds = %56, %42
%44 = load i32, i32* %7
%45 = load i32, i32* %6
%46 = icmp sle i32 %44, %45
br i1 %46, label %47, label %59
47: ; preds = %43
%48 = load i32, i32* %7
%49 = call i64 @FD_ISSET(i32 %48, i32* %10)
%50 = icmp ne i64 %49, 0
br i1 %50, label %51, label %55
51: ; preds = %47
%52 = load i32, i32* %7
%53 = load i32, i32* %5
%54 = call i32 @send_recv(i32 %52, i32 %53)
br label %55
55: ; preds = %51, %47
br label %56
56: ; preds = %55
%57 = load i32, i32* %7
%58 = add nsw i32 %57, 1
store i32 %58, i32* %7
br label %43
59: ; preds = %43
br label %32
60: ; preds = %2
%61 = call i8* @gettext(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.5, i64 0, i64 0))
%62 = call i32 @printf(i8* %61)
br label %63
63: ; preds = %60
ret i32 0
}

LLVM IR (-O2):
%struct.sockaddr_in = type { i32 }
@.str = [8 x i8] c"fuentes\00"
@.str.1 = [6 x i8] c"UTF-8\00"
@LC_ALL = global i32 0
@.str.2 = [1 x i8] zeroinitializer
@.str.3 = [7 x i8] c"idioma\00"
@.str.4 = [12 x i8] c"Seleccionar\00"
@.str.5 = [32 x i8] c"N\C3\BAmero de argumentos invalido\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca i32
%4 = alloca %struct.sockaddr_in
%5 = alloca i32
%6 = alloca i32
%7 = bitcast i32* %3 to i8*
%8 = bitcast %struct.sockaddr_in* %4 to i8*
%9 = bitcast i32* %5 to i8*
%10 = bitcast i32* %6 to i8*
%11 = tail call i32 @bind_textdomain_codeset(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%12 = load i32, i32* @LC_ALL
%13 = tail call i32 @setlocale(i32 %12, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.2, i64 0, i64 0))
%14 = tail call i32 @bindtextdomain(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
%15 = tail call i32 @textdomain(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%16 = icmp eq i32 %0, 3
br i1 %16, label %17, label %54
17: ; preds = %2
%18 = getelementptr inbounds i8*, i8** %1, i64 1
%19 = load i8*, i8** %18
%20 = getelementptr inbounds i8*, i8** %1, i64 2
%21 = load i8*, i8** %20
%22 = call i32 @connect_request(i32* %3, %struct.sockaddr_in* %4, i8* %19, i8* %21)
%23 = call i32 @FD_ZERO(i32* %5)
%24 = call i32 @FD_ZERO(i32* %6)
%25 = call i32 @FD_SET(i32 0, i32* %5)
%26 = load i32, i32* %3
%27 = call i32 @FD_SET(i32 %26, i32* %5)
%28 = load i32, i32* %3
%29 = add i32 %28, 1
%30 = load i32, i32* %5
store i32 %30, i32* %6
%31 = call i32 @select(i32 %29, i32* %6, i32* null, i32* null, i32* null)
%32 = icmp eq i32 %31, -1
br i1 %32, label %40, label %33
33: ; preds = %17
%34 = icmp slt i32 %28, 0
br label %39
35: ; preds = %51, %39
%36 = load i32, i32* %5
store i32 %36, i32* %6
%37 = call i32 @select(i32 %29, i32* %6, i32* null, i32* null, i32* null)
%38 = icmp eq i32 %37, -1
br i1 %38, label %40, label %39
39: ; preds = %33, %35
br i1 %34, label %35, label %44
40: ; preds = %35, %17
%41 = call i8* @gettext(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.4, i64 0, i64 0))
%42 = call i32 @perror(i8* %41)
%43 = call i32 @exit(i32 4)
unreachable
44: ; preds = %39, %51
%45 = phi i32 [ %52, %51 ], [ 0, %39 ]
%46 = call i64 @FD_ISSET(i32 %45, i32* %6)
%47 = icmp eq i64 %46, 0
br i1 %47, label %51, label %48
48: ; preds = %44
%49 = load i32, i32* %3
%50 = call i32 @send_recv(i32 %45, i32 %49)
br label %51
51: ; preds = %44, %48
%52 = add nuw i32 %45, 1
%53 = icmp eq i32 %45, %28
br i1 %53, label %35, label %44
54: ; preds = %2
%55 = tail call i8* @gettext(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.5, i64 0, i64 0))
%56 = tail call i32 @printf(i8* dereferenceable(1) %55)
ret i32 0
}