#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */
typedef struct TYPE_2__ TYPE_1__;

/* Type definitions */
struct TYPE_2__ {
  int /*<<< orphan*/ s_addr;
};
struct sockaddr_in {
  int /*<<< orphan*/ sin_port;
  TYPE_1__ sin_addr;
  int /*<<< orphan*/ sin_family;
};
struct sockaddr {
  int dummy;
};
typedef int socklen_t;
typedef int /*<<< orphan*/ serv_addr;
typedef int /*<<< orphan*/ fd_set;
typedef int /*<<< orphan*/ cli_addr;

/* Variables and functions */
int /*<<< orphan*/ AF_INET;
int /*<<< orphan*/ FD_CLR(int, int /*<<< orphan*/ *);
scalar_t__ FD_ISSET(int, int /*<<< orphan*/ *);
int /*<<< orphan*/ FD_SET(int, int /*<<< orphan*/ *);
int FD_SETSIZE;
int /*<<< orphan*/ FD_ZERO(int /*<<< orphan*/ *);
int /*<<< orphan*/ INADDR_ANY;
int /*<<< orphan*/ IPPROTO_TCP;
int /*<<< orphan*/ SOCK_STREAM;
int accept(int, struct sockaddr *, int *);
int atoi(char *);
scalar_t__ bind(int, struct sockaddr *, int);
int /*<<< orphan*/ bzero(char *, int);
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ error(char *);
int /*<<< orphan*/ exit(int);
size_t find_index(char *, int, char);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ htons(int);
int /*<<< orphan*/ listen(int, int);
int /*<<< orphan*/ printf(char *, ...);
int recv(int, char *, int, int /*<<< orphan*/);
int select(int, int /*<<< orphan*/ *, int /*<<< orphan*/ *,
           int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int send(int, char *, int, int /*<<< orphan*/);
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
scalar_t__ strncmp(char *, char *, int);
int main(int argc, char *argv[]) {
  fd_set rfds;
  fd_set master;
  int sockfd, newsockfd, portno;
  int count = 0;
  socklen_t clilen;
  char buffer[256];
  struct sockaddr_in serv_addr, cli_addr;
  int ret, text;
  int soc[26];
  int soc_count = 0;
  char name[26];
  int name_count = 0;
  if (argc < 2) {
    fprintf(stderr, "ERROR, no port provided\n");
    exit(1);
  }
  sockfd = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP);
  if (sockfd < 0) {
    error("ERROR opening socket");
  }
  FD_ZERO(&master);
  FD_SET(sockfd, &master);
  FD_ZERO(&rfds);
  FD_SET(sockfd, &rfds);
  bzero((char *)&serv_addr, sizeof(serv_addr));
  portno = atoi(argv[1]);
  serv_addr.sin_family = AF_INET;
  serv_addr.sin_addr.s_addr = INADDR_ANY;
  serv_addr.sin_port = htons(portno);
  if (bind(sockfd, (struct sockaddr *)&serv_addr, sizeof(serv_addr)) < 0)
    error("ERROR on binding");
  listen(sockfd, 5);
  while (1) {
    rfds = master;
    ret = select(FD_SETSIZE, &rfds, NULL, NULL, NULL);
    printf("Events = %d\n", ret);
    if (FD_ISSET(sockfd, &rfds)) {
      clilen = sizeof(cli_addr);
      newsockfd = accept(sockfd, (struct sockaddr *)&cli_addr, &clilen);
      printf("Newsockfd = %d\n", newsockfd);
      if (newsockfd < 0) {
        error("ERROR on accept");
      }
      soc[soc_count] = newsockfd;
      if (soc_count > 26) {
        error("ERROR maximum cilent");
      }
      soc_count++;
      FD_SET(newsockfd, &master);
    }
    for (int i = 0; i < FD_SETSIZE && ret > 0; ++i) {
      if (FD_ISSET(i, &rfds) && (i != sockfd)) {
        ret--;
        if (ret < 0) {
          error("ERROR reading from socket");
        } else {
          bzero(buffer, 256);
          text = recv(i, buffer, 255, 0);
          printf("Here is the message: %s\n", buffer);
          if (strncmp(buffer, "!!", 2) == 0) {
            send(soc[find_index(name, 26, buffer[4])], buffer, 5, 0);
            printf("send ack to : %c\n", buffer[4]);
          } else if (strncmp(buffer, "/", 1) == 0) {
            if (strncmp(buffer, "/exit", 5) == 0) {
              FD_CLR(i, &master);
              bzero(buffer, 256);
            } else {
              send(soc[find_index(name, 26, buffer[1])], buffer, 255, 0);
              printf("send direct to : %c\n", buffer[1]);
              printf("message = %s\n", buffer);
            }
          } else if (strncmp(buffer, "->", 2) == 0) {
            printf("add user : %c\n", buffer[2]);
            name[name_count] = buffer[2];
            name_count++;
            printf("user number = %d\n", name_count);
          } else {
            text = send(i, "Server got your message\n", 18, 0);
            if (text < 0) {
              error("ERROR writing to socket");
            }
            for (int x = 0; x < FD_SETSIZE; ++x) {
              if (x != i && FD_ISSET(x, &master) && (x != sockfd)) {
                printf("send broadcast message\n");
                text = send(x, buffer, 18, 0);
                if (text < 0) {
                  error("ERROR writing to socket");
                }
              }
            }
          }
        }
      }
    }
    count++;
  }
  close(newsockfd);
  close(sockfd);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1f0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x28(%rbp)
movl   $0x0,-0x1c4(%rbp)
movl   $0x0,-0x1e4(%rbp)
cmpl   $0x2,-0x8(%rbp)
jge    129d <main+0x5d>
mov    0x2d43(%rip),%rax
mov    (%rax),%edi
lea    0xd72(%rip),%rsi
call   1090 <fprintf@plt>
mov    $0x1,%edi
call   1140 <exit@plt>
mov    0x2d44(%rip),%rax
mov    (%rax),%edi
mov    0x2d13(%rip),%rax
mov    (%rax),%esi
mov    0x2d22(%rip),%rax
mov    (%rax),%edx
call   1160 <socket@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0x0,-0x1c(%rbp)
jge    12d6 <main+0x96>
lea    0xd48(%rip),%rdi
call   10f0 <error@plt>
lea    -0x18(%rbp),%rdi
call   10a0 <FD_ZERO@plt>
mov    -0x1c(%rbp),%edi
lea    -0x18(%rbp),%rsi
call   1150 <FD_SET@plt>
lea    -0x14(%rbp),%rdi
call   10a0 <FD_ZERO@plt>
mov    -0x1c(%rbp),%edi
lea    -0x14(%rbp),%rsi
call   1150 <FD_SET@plt>
lea    -0x140(%rbp),%rdi
mov    $0xc,%esi
call   1100 <bzero@plt>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1120 <atoi@plt>
mov    %eax,-0x24(%rbp)
mov    0x2cc0(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x138(%rbp)
mov    0x2ca9(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x13c(%rbp)
mov    -0x24(%rbp),%edi
call   1060 <htons@plt>
mov    %eax,-0x140(%rbp)
mov    -0x1c(%rbp),%edi
lea    -0x140(%rbp),%rsi
mov    $0xc,%edx
call   10e0 <bind@plt>
cmp    $0x0,%rax
jge    1377 <main+0x137>
lea    0xcbc(%rip),%rdi
call   10f0 <error@plt>
mov    -0x1c(%rbp),%edi
mov    $0x5,%esi
call   10c0 <listen@plt>
mov    -0x18(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    0x2c27(%rip),%rax
mov    (%rax),%edi
lea    -0x14(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%r8d
mov    %r8,%rdx
mov    %r8,%rcx
call   10b0 <select@plt>
mov    %eax,-0x154(%rbp)
mov    -0x154(%rbp),%esi
lea    0xc85(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
mov    -0x1c(%rbp),%edi
lea    -0x14(%rbp),%rsi
call   1050 <FD_ISSET@plt>
cmp    $0x0,%rax
je     1460 <main+0x220>
movl   $0xc,-0x2c(%rbp)
mov    -0x1c(%rbp),%edi
lea    -0x150(%rbp),%rsi
lea    -0x2c(%rbp),%rdx
call   1110 <accept@plt>
mov    %eax,-0x20(%rbp)
mov    -0x20(%rbp),%esi
lea    0xc4e(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
cmpl   $0x0,-0x20(%rbp)
jge    141b <main+0x1db>
lea    0xc46(%rip),%rdi
call   10f0 <error@plt>
mov    -0x20(%rbp),%ecx
movslq -0x1c4(%rbp),%rax
mov    %ecx,-0x1c0(%rbp,%rax,4)
cmpl   $0x1a,-0x1c4(%rbp)
jle    1445 <main+0x205>
lea    0xc2c(%rip),%rdi
call   10f0 <error@plt>
mov    -0x1c4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1c4(%rbp)
mov    -0x20(%rbp),%edi
lea    -0x18(%rbp),%rsi
call   1150 <FD_SET@plt>
movl   $0x0,-0x1e8(%rbp)
mov    -0x1e8(%rbp),%ecx
xor    %eax,%eax
mov    0x2b3f(%rip),%rdx
cmp    (%rdx),%ecx
mov    %al,-0x1ed(%rbp)
jge    1497 <main+0x257>
cmpl   $0x0,-0x154(%rbp)
setg   %al
mov    %al,-0x1ed(%rbp)
mov    -0x1ed(%rbp),%al
test   $0x1,%al
jne    14aa <main+0x26a>
jmp    1816 <main+0x5d6>
mov    -0x1e8(%rbp),%edi
lea    -0x14(%rbp),%rsi
call   1050 <FD_ISSET@plt>
cmp    $0x0,%rax
je     17fd <main+0x5bd>
mov    -0x1e8(%rbp),%eax
cmp    -0x1c(%rbp),%eax
je     17fd <main+0x5bd>
mov    -0x154(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x154(%rbp)
cmpl   $0x0,-0x154(%rbp)
jge    14ff <main+0x2bf>
lea    0xb8c(%rip),%rdi
call   10f0 <error@plt>
jmp    17f8 <main+0x5b8>
lea    -0x130(%rbp),%rdi
mov    $0x100,%esi
call   1100 <bzero@plt>
mov    -0x1e8(%rbp),%edi
lea    -0x130(%rbp),%rsi
mov    $0xff,%edx
xor    %ecx,%ecx
call   1030 <recv@plt>
mov    %eax,-0x158(%rbp)
lea    -0x130(%rbp),%rsi
lea    0xb5e(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
lea    -0x130(%rbp),%rdi
lea    0xb62(%rip),%rsi
mov    $0x2,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%rax
jne    15b2 <main+0x372>
lea    -0x1e0(%rbp),%rdi
mov    $0x1a,%esi
movsbl -0x12c(%rbp),%edx
call   10d0 <find_index@plt>
mov    -0x1c0(%rbp,%rax,4),%edi
lea    -0x130(%rbp),%rsi
mov    $0x5,%edx
xor    %ecx,%ecx
call   1070 <send@plt>
movsbl -0x12c(%rbp),%esi
lea    0xb11(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
jmp    17f3 <main+0x5b3>
lea    -0x130(%rbp),%rdi
lea    0xb09(%rip),%rsi
mov    $0x1,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%rax
jne    167c <main+0x43c>
lea    -0x130(%rbp),%rdi
lea    0xae9(%rip),%rsi
mov    $0x5,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%rax
jne    161b <main+0x3db>
mov    -0x1e8(%rbp),%edi
lea    -0x18(%rbp),%rsi
call   1130 <FD_CLR@plt>
lea    -0x130(%rbp),%rdi
mov    $0x100,%esi
call   1100 <bzero@plt>
jmp    1677 <main+0x437>
lea    -0x1e0(%rbp),%rdi
mov    $0x1a,%esi
movsbl -0x12f(%rbp),%edx
call   10d0 <find_index@plt>
mov    -0x1c0(%rbp,%rax,4),%edi
lea    -0x130(%rbp),%rsi
mov    $0xff,%edx
xor    %ecx,%ecx
call   1070 <send@plt>
movsbl -0x12f(%rbp),%esi
lea    0xa76(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
lea    -0x130(%rbp),%rsi
lea    0xa76(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
jmp    17ee <main+0x5ae>
lea    -0x130(%rbp),%rdi
lea    0xa6a(%rip),%rsi
mov    $0x2,%edx
call   1040 <strncmp@plt>
cmp    $0x0,%rax
jne    16ef <main+0x4af>
movsbl -0x12e(%rbp),%esi
lea    0xa4b(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
mov    -0x12e(%rbp),%cl
movslq -0x1e4(%rbp),%rax
mov    %cl,-0x1e0(%rbp,%rax,1)
mov    -0x1e4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1e4(%rbp)
mov    -0x1e4(%rbp),%esi
lea    0xa23(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
jmp    17e9 <main+0x5a9>
mov    -0x1e8(%rbp),%edi
lea    0xa1c(%rip),%rsi
mov    $0x12,%edx
xor    %ecx,%ecx
call   1070 <send@plt>
mov    %eax,-0x158(%rbp)
cmpl   $0x0,-0x158(%rbp)
jge    1727 <main+0x4e7>
lea    0xa0f(%rip),%rdi
call   10f0 <error@plt>
movl   $0x0,-0x1ec(%rbp)
mov    -0x1ec(%rbp),%eax
mov    0x287a(%rip),%rcx
cmp    (%rcx),%eax
jge    17e4 <main+0x5a4>
mov    -0x1ec(%rbp),%eax
cmp    -0x1e8(%rbp),%eax
je     17cb <main+0x58b>
mov    -0x1ec(%rbp),%edi
lea    -0x18(%rbp),%rsi
call   1050 <FD_ISSET@plt>
cmp    $0x0,%rax
je     17cb <main+0x58b>
mov    -0x1ec(%rbp),%eax
cmp    -0x1c(%rbp),%eax
je     17cb <main+0x58b>
lea    0x9c2(%rip),%rdi
mov    $0x0,%al
call   1080 <printf@plt>
mov    -0x1ec(%rbp),%edi
lea    -0x130(%rbp),%rsi
mov    $0x12,%edx
xor    %ecx,%ecx
call   1070 <send@plt>
mov    %eax,-0x158(%rbp)
cmpl   $0x0,-0x158(%rbp)
jge    17c6 <main+0x586>
lea    0x970(%rip),%rdi
call   10f0 <error@plt>
jmp    17cb <main+0x58b>
jmp    17d0 <main+0x590>
mov    -0x1ec(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1ec(%rbp)
jmp    1731 <main+0x4f1>
jmp    17e9 <main+0x5a9>
jmp    17ee <main+0x5ae>
jmp    17f3 <main+0x5b3>
jmp    17f8 <main+0x5b8>
jmp    17fd <main+0x5bd>
jmp    1802 <main+0x5c2>
mov    -0x1e8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x1e8(%rbp)
jmp    146a <main+0x22a>
mov    -0x28(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x28(%rbp)
jmp    1384 <main+0x144>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x1c8,%rsp
cmp    $0x1,%edi
jle    16c5 <main+0x475>
mov    %rsi,%rbp
mov    0x2d74(%rip),%r15
mov    (%r15),%edi
mov    0x2d42(%rip),%rax
mov    (%rax),%esi
mov    0x2d51(%rip),%rax
mov    (%rax),%edx
call   1170 <socket@plt>
mov    %eax,%r14d
test   %eax,%eax
jns    12a1 <main+0x51>
lea    0xd7d(%rip),%rdi
call   1100 <error@plt>
lea    0x8(%rsp),%rbx
mov    %rbx,%rdi
call   10b0 <FD_ZERO@plt>
mov    %r14d,%edi
mov    %rbx,%rsi
call   1160 <FD_SET@plt>
lea    0x10(%rsp),%rbx
mov    %rbx,%rdi
call   10b0 <FD_ZERO@plt>
mov    %r14d,%edi
mov    %rbx,%rsi
call   1160 <FD_SET@plt>
lea    0x20(%rsp),%rbx
mov    %rbx,%rdi
mov    $0xc,%esi
call   1110 <bzero@plt>
mov    0x8(%rbp),%rdi
call   1130 <atoi@plt>
mov    (%r15),%ecx
mov    %ecx,0x28(%rsp)
mov    0x2ce6(%rip),%rcx
mov    (%rcx),%ecx
mov    %ecx,0x24(%rsp)
mov    %eax,%edi
call   1070 <htons@plt>
mov    %eax,0x20(%rsp)
mov    %r14d,%edi
mov    %rbx,%rsi
mov    $0xc,%edx
call   10f0 <bind@plt>
test   %rax,%rax
jns    132c <main+0xdc>
lea    0xd07(%rip),%rdi
call   1100 <error@plt>
mov    %r14d,%edi
mov    $0x5,%esi
call   10d0 <listen@plt>
mov    0x2c78(%rip),%r12
mov    (%r12),%edi
lea    0x10(%rsp),%r13
lea    0xcef(%rip),%r15
lea    0x60(%rsp),%rbx
movl   $0x0,0xc(%rsp)
xor    %eax,%eax
mov    %rax,0x18(%rsp)
jmp    1370 <main+0x120>
lea    0xcd2(%rip),%r15
nopl   (%rax)
mov    0x8(%rsp),%eax
mov    %eax,0x10(%rsp)
mov    %r13,%rsi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
call   10c0 <select@plt>
mov    %eax,%ebp
mov    %r15,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1090 <printf@plt>
mov    %r14d,%edi
mov    %r13,%rsi
call   1060 <FD_ISSET@plt>
test   %rax,%rax
je     141c <main+0x1cc>
movl   $0xc,0x14(%rsp)
mov    %r14d,%edi
lea    0x50(%rsp),%rsi
lea    0x14(%rsp),%rdx
call   1120 <accept@plt>
mov    %eax,%ebx
lea    0xc84(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1090 <printf@plt>
test   %ebx,%ebx
jns    13e1 <main+0x191>
lea    0xc80(%rip),%rdi
call   1100 <error@plt>
mov    0xc(%rsp),%ecx
movslq %ecx,%rax
mov    %ebx,0x160(%rsp,%rax,4)
cmp    $0x1b,%eax
jl     1404 <main+0x1b4>
lea    0xc71(%rip),%rdi
call   1100 <error@plt>
mov    0xc(%rsp),%ecx
add    $0x1,%ecx
mov    %ecx,0xc(%rsp)
mov    %ebx,%edi
lea    0x8(%rsp),%rsi
call   1160 <FD_SET@plt>
lea    0x60(%rsp),%rbx
mov    (%r12),%edi
test   %edi,%edi
jle    1370 <main+0x120>
test   %ebp,%ebp
jle    1370 <main+0x120>
xor    %r15d,%r15d
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
mov    %r15d,%edi
mov    %r13,%rsi
call   1060 <FD_ISSET@plt>
test   %rax,%rax
je     16a0 <main+0x450>
cmp    %r14d,%r15d
je     16a0 <main+0x450>
add    $0xffffffff,%ebp
mov    %rbx,%rdi
mov    $0x100,%esi
call   1110 <bzero@plt>
mov    %r15d,%edi
mov    %rbx,%rsi
mov    $0xff,%edx
xor    %ecx,%ecx
call   1030 <recv@plt>
lea    0xbfb(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1090 <printf@plt>
mov    %rbx,%rdi
lea    0xc00(%rip),%rsi
mov    $0x2,%edx
call   1040 <strncmp@plt>
test   %rax,%rax
je     1511 <main+0x2c1>
mov    %rbx,%rdi
lea    0xbfc(%rip),%rsi
mov    $0x1,%edx
call   1040 <strncmp@plt>
mov    %rbx,%rdi
test   %rax,%rax
je     154c <main+0x2fc>
lea    0xc0a(%rip),%rsi
mov    $0x2,%edx
call   1040 <strncmp@plt>
test   %rax,%rax
je     15b9 <main+0x369>
mov    %r15d,%edi
lea    0xc11(%rip),%rsi
mov    $0x12,%edx
xor    %ecx,%ecx
call   1080 <send@plt>
test   %eax,%eax
js     15f7 <main+0x3a7>
cmpl   $0x0,(%r12)
jg     160e <main+0x3be>
jmp    16a0 <main+0x450>
movsbl 0x64(%rsp),%edx
lea    0x30(%rsp),%rdi
mov    $0x1a,%esi
call   10e0 <find_index@plt>
mov    0x160(%rsp,%rax,4),%edi
mov    %rbx,%rsi
mov    $0x5,%edx
xor    %ecx,%ecx
call   1080 <send@plt>
movsbl 0x64(%rsp),%esi
lea    0xb56(%rip),%rdi
jmp    15eb <main+0x39b>
lea    0xb5e(%rip),%rsi
mov    $0x5,%edx
call   1040 <strncmp@plt>
test   %rax,%rax
je     1682 <main+0x432>
movsbl 0x61(%rsp),%edx
lea    0x30(%rsp),%rdi
mov    $0x1a,%esi
call   10e0 <find_index@plt>
mov    0x160(%rsp,%rax,4),%edi
mov    %rbx,%rsi
mov    $0xff,%edx
xor    %ecx,%ecx
call   1080 <send@plt>
movsbl 0x61(%rsp),%esi
lea    0xb1b(%rip),%rdi
xor    %eax,%eax
call   1090 <printf@plt>
lea    0xb22(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1090 <printf@plt>
jmp    16a0 <main+0x450>
movsbl 0x62(%rsp),%esi
lea    0xb18(%rip),%rdi
xor    %eax,%eax
call   1090 <printf@plt>
mov    0x62(%rsp),%al
mov    0x18(%rsp),%rsi
movslq %esi,%rsi
mov    %al,0x30(%rsp,%rsi,1)
add    $0x1,%esi
lea    0xb06(%rip),%rdi
mov    %rsi,0x18(%rsp)
xor    %eax,%eax
call   1090 <printf@plt>
jmp    16a0 <main+0x450>
lea    0xb19(%rip),%rdi
call   1100 <error@plt>
cmpl   $0x0,(%r12)
jle    16a0 <main+0x450>
mov    %r13,%rbx
xor    %r13d,%r13d
jmp    162a <main+0x3da>
cs nopw 0x0(%rax,%rax,1)
add    $0x1,%r13d
cmp    (%r12),%r13d
jge    1678 <main+0x428>
cmp    %r13d,%r15d
je     1620 <main+0x3d0>
mov    %r13d,%edi
lea    0x8(%rsp),%rsi
call   1060 <FD_ISSET@plt>
test   %rax,%rax
je     1620 <main+0x3d0>
cmp    %r13d,%r14d
je     1620 <main+0x3d0>
lea    0xae2(%rip),%rdi
call   1050 <puts@plt>
mov    %r13d,%edi
lea    0x60(%rsp),%rsi
mov    $0x12,%edx
xor    %ecx,%ecx
call   1080 <send@plt>
test   %eax,%eax
jns    1620 <main+0x3d0>
lea    0xaa6(%rip),%rdi
call   1100 <error@plt>
jmp    1620 <main+0x3d0>
mov    %rbx,%r13
lea    0x60(%rsp),%rbx
jmp    16a0 <main+0x450>
mov    %r15d,%edi
lea    0x8(%rsp),%rsi
call   1140 <FD_CLR@plt>
mov    %rbx,%rdi
mov    $0x100,%esi
call   1110 <bzero@plt>
nopl   0x0(%rax)
add    $0x1,%r15d
mov    (%r12),%edi
cmp    %edi,%r15d
jge    1366 <main+0x116>
test   %ebp,%ebp
jg     1440 <main+0x1f0>
lea    0x97f(%rip),%r15
jmp    1370 <main+0x120>
mov    0x28fc(%rip),%rax
mov    (%rax),%edi
lea    0x92b(%rip),%rsi
call   10a0 <fprintf@plt>
mov    $0x1,%edi
call   1150 <exit@plt>

LLVM IR (-O0):
%struct.sockaddr_in = type { i32, %struct.TYPE_2__, i32 }
%struct.TYPE_2__ = type { i32 }
%struct.sockaddr = type { i32 }
@stderr = global i32 0
@.str = [25 x i8] c"ERROR, no port provided\0A\00"
@AF_INET = global i32 0
@SOCK_STREAM = global i32 0
@IPPROTO_TCP = global i32 0
@.str.1 = [21 x i8] c"ERROR opening socket\00"
@INADDR_ANY = global i32 0
@.str.2 = [17 x i8] c"ERROR on binding\00"
@FD_SETSIZE = global i32 0
@.str.3 = [13 x i8] c"Events = %d\0A\00"
@.str.4 = [16 x i8] c"Newsockfd = %d\0A\00"
@.str.5 = [16 x i8] c"ERROR on accept\00"
@.str.6 = [21 x i8] c"ERROR maximum cilent\00"
@.str.7 = [26 x i8] c"ERROR reading from socket\00"
@.str.8 = [25 x i8] c"Here is the message: %s\0A\00"
@.str.9 = [3 x i8] c"!!\00"
@.str.10 = [18 x i8] c"send ack to : %c\0A\00"
@.str.11 = [2 x i8] c"/\00"
@.str.12 = [6 x i8] c"/exit\00"
@.str.13 = [21 x i8] c"send direct to : %c\0A\00"
@.str.14 = [14 x i8] c"message = %s\0A\00"
@.str.15 = [3 x i8] c"->\00"
@.str.16 = [15 x i8] c"add user : %c\0A\00"
@.str.17 = [18 x i8] c"user number = %d\0A\00"
@.str.18 = [25 x i8] c"Server got your message\0A\00"
@.str.19 = [24 x i8] c"ERROR writing to socket\00"
@.str.20 = [24 x i8] c"send broadcast message\0A\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca [256 x i8]
%14 = alloca %struct.sockaddr_in
%15 = alloca %struct.sockaddr_in
%16 = alloca i32
%17 = alloca i32
%18 = alloca [26 x i32]
%19 = alloca i32
%20 = alloca [26 x i8]
%21 = alloca i32
%22 = alloca i32
%23 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i32 0, i32* %11
store i32 0, i32* %19
store i32 0, i32* %21
%24 = load i32, i32* %4
%25 = icmp slt i32 %24, 2
br i1 %25, label %26, label %30
26: ; preds = %2
%27 = load i32, i32* @stderr
%28 = call i32 @fprintf(i32 %27, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%29 = call i32 @exit(i32 1)
unreachable
30: ; preds = %2
%31 = load i32, i32* @AF_INET
%32 = load i32, i32* @SOCK_STREAM
%33 = load i32, i32* @IPPROTO_TCP
%34 = call i32 @socket(i32 %31, i32 %32, i32 %33)
store i32 %34, i32* %8
%35 = load i32, i32* %8
%36 = icmp slt i32 %35, 0
br i1 %36, label %37, label %39
37: ; preds = %30
%38 = call i32 @error(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
br label %39
39: ; preds = %37, %30
%40 = call i32 @FD_ZERO(i32* %7)
%41 = load i32, i32* %8
%42 = call i32 @FD_SET(i32 %41, i32* %7)
%43 = call i32 @FD_ZERO(i32* %6)
%44 = load i32, i32* %8
%45 = call i32 @FD_SET(i32 %44, i32* %6)
%46 = bitcast %struct.sockaddr_in* %14 to i8*
%47 = call i32 @bzero(i8* %46, i32 12)
%48 = load i8**, i8*** %5
%49 = getelementptr inbounds i8*, i8** %48, i64 1
%50 = load i8*, i8** %49
%51 = call i32 @atoi(i8* %50)
store i32 %51, i32* %10
%52 = load i32, i32* @AF_INET
%53 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %14, i32 0, i32 2
store i32 %52, i32* %53
%54 = load i32, i32* @INADDR_ANY
%55 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %14, i32 0, i32 1
%56 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %55, i32 0, i32 0
store i32 %54, i32* %56
%57 = load i32, i32* %10
%58 = call i32 @htons(i32 %57)
%59 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %14, i32 0, i32 0
store i32 %58, i32* %59
%60 = load i32, i32* %8
%61 = bitcast %struct.sockaddr_in* %14 to %struct.sockaddr*
%62 = call i64 @bind(i32 %60, %struct.sockaddr* %61, i32 12)
%63 = icmp slt i64 %62, 0
br i1 %63, label %64, label %66
64: ; preds = %39
%65 = call i32 @error(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0))
br label %66
66: ; preds = %64, %39
%67 = load i32, i32* %8
%68 = call i32 @listen(i32 %67, i32 5)
br label %69
69: ; preds = %66, %245
%70 = load i32, i32* %7
store i32 %70, i32* %6
%71 = load i32, i32* @FD_SETSIZE
%72 = call i32 @select(i32 %71, i32* %6, i32* null, i32* null, i32* null)
store i32 %72, i32* %16
%73 = load i32, i32* %16
%74 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), i32 %73)
%75 = load i32, i32* %8
%76 = call i64 @FD_ISSET(i32 %75, i32* %6)
%77 = icmp ne i64 %76, 0
br i1 %77, label %78, label %102
78: ; preds = %69
store i32 12, i32* %12
%79 = load i32, i32* %8
%80 = bitcast %struct.sockaddr_in* %15 to %struct.sockaddr*
%81 = call i32 @accept(i32 %79, %struct.sockaddr* %80, i32* %12)
store i32 %81, i32* %9
%82 = load i32, i32* %9
%83 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0), i32 %82)
%84 = load i32, i32* %9
%85 = icmp slt i32 %84, 0
br i1 %85, label %86, label %88
86: ; preds = %78
%87 = call i32 @error(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.5, i64 0, i64 0))
br label %88
88: ; preds = %86, %78
%89 = load i32, i32* %9
%90 = load i32, i32* %19
%91 = sext i32 %90 to i64
%92 = getelementptr inbounds [26 x i32], [26 x i32]* %18, i64 0, i64 %91
store i32 %89, i32* %92
%93 = load i32, i32* %19
%94 = icmp sgt i32 %93, 26
br i1 %94, label %95, label %97
95: ; preds = %88
%96 = call i32 @error(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.6, i64 0, i64 0))
br label %97
97: ; preds = %95, %88
%98 = load i32, i32* %19
%99 = add nsw i32 %98, 1
store i32 %99, i32* %19
%100 = load i32, i32* %9
%101 = call i32 @FD_SET(i32 %100, i32* %7)
br label %102
102: ; preds = %97, %69
store i32 0, i32* %22
br label %103
103: ; preds = %242, %102
%104 = load i32, i32* %22
%105 = load i32, i32* @FD_SETSIZE
%106 = icmp slt i32 %104, %105
br i1 %106, label %107, label %110
107: ; preds = %103
%108 = load i32, i32* %16
%109 = icmp sgt i32 %108, 0
br label %110
110: ; preds = %107, %103
%111 = phi i1 [ false, %103 ], [ %109, %107 ]
br i1 %111, label %112, label %245
112: ; preds = %110
%113 = load i32, i32* %22
%114 = call i64 @FD_ISSET(i32 %113, i32* %6)
%115 = icmp ne i64 %114, 0
br i1 %115, label %116, label %241
116: ; preds = %112
%117 = load i32, i32* %22
%118 = load i32, i32* %8
%119 = icmp ne i32 %117, %118
br i1 %119, label %120, label %241
120: ; preds = %116
%121 = load i32, i32* %16
%122 = add nsw i32 %121, -1
store i32 %122, i32* %16
%123 = load i32, i32* %16
%124 = icmp slt i32 %123, 0
br i1 %124, label %125, label %127
125: ; preds = %120
%126 = call i32 @error(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.7, i64 0, i64 0))
br label %240
127: ; preds = %120
%128 = getelementptr inbounds [256 x i8], [256 x i8]* %13, i64 0, i64 0
%129 = call i32 @bzero(i8* %128, i32 256)
%130 = load i32, i32* %22
%131 = getelementptr inbounds [256 x i8], [256 x i8]* %13, i64 0, i64 0
%132 = call i32 @recv(i32 %130, i8* %131, i32 255, i32 0)
store i32 %132, i32* %17
%133 = getelementptr inbounds [256 x i8], [256 x i8]* %13, i64 0, i64 0
%134 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.8, i64 0, i64 0), i8* %133)
%135 = getelementptr inbounds [256 x i8], [256 x i8]* %13, i64 0, i64 0
%136 = call i64 @strncmp(i8* %135, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0), i32 2)
%137 = icmp eq i64 %136, 0
br i1 %137, label %138, label %151
138: ; preds = %127
%139 = getelementptr inbounds [26 x i8], [26 x i8]* %20, i64 0, i64 0
%140 = getelementptr inbounds [256 x i8], [256 x i8]* %13, i64 0, i64 4
%141 = load i8, i8* %140
%142 = call i64 @find_index(i8* %139, i32 26, i8 signext %141)
%143 = getelementptr inbounds [26 x i32], [26 x i32]* %18, i64 0, i64 %142
%144 = load i32, i32* %143
%145 = getelementptr inbounds [256 x i8], [256 x i8]* %13, i64 0, i64 0
%146 = call i32 @send(i32 %144, i8* %145, i32 5, i32 0)
%147 = getelementptr inbounds [256 x i8], [256 x i8]* %13, i64 0, i64 4
%148 = load i8, i8* %147
%149 = sext i8 %148 to i32
%150 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.10, i64 0, i64 0), i32 %149)
br label %239
151: ; preds = %127
%152 = getelementptr inbounds [256 x i8], [256 x i8]* %13, i64 0, i64 0
%153 = call i64 @strncmp(i8* %152, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.11, i64 0, i64 0), i32 1)
%154 = icmp eq i64 %153, 0
br i1 %154, label %155, label %180
155: ; preds = %151
%156 = getelementptr inbounds [256 x i8], [256 x i8]* %13, i64 0, i64 0
%157 = call i64 @strncmp(i8* %156, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.12, i64 0, i64 0), i32 5)
%158 = icmp eq i64 %157, 0
br i1 %158, label %159, label %164
159: ; preds = %155
%160 = load i32, i32* %22
%161 = call i32 @FD_CLR(i32 %160, i32* %7)
%162 = getelementptr inbounds [256 x i8], [256 x i8]* %13, i64 0, i64 0
%163 = call i32 @bzero(i8* %162, i32 256)
br label %179
164: ; preds = %155
%165 = getelementptr inbounds [26 x i8], [26 x i8]* %20, i64 0, i64 0
%166 = getelementptr inbounds [256 x i8], [256 x i8]* %13, i64 0, i64 1
%167 = load i8, i8* %166
%168 = call i64 @find_index(i8* %165, i32 26, i8 signext %167)
%169 = getelementptr inbounds [26 x i32], [26 x i32]* %18, i64 0, i64 %168
%170 = load i32, i32* %169
%171 = getelementptr inbounds [256 x i8], [256 x i8]* %13, i64 0, i64 0
%172 = call i32 @send(i32 %170, i8* %171, i32 255, i32 0)
%173 = getelementptr inbounds [256 x i8], [256 x i8]* %13, i64 0, i64 1
%174 = load i8, i8* %173
%175 = sext i8 %174 to i32
%176 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.13, i64 0, i64 0), i32 %175)
%177 = getelementptr inbounds [256 x i8], [256 x i8]* %13, i64 0, i64 0
%178 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.14, i64 0, i64 0), i8* %177)
br label %179
179: ; preds = %164, %159
br label %238
180: ; preds = %151
%181 = getelementptr inbounds [256 x i8], [256 x i8]* %13, i64 0, i64 0
%182 = call i64 @strncmp(i8* %181, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.15, i64 0, i64 0), i32 2)
%183 = icmp eq i64 %182, 0
br i1 %183, label %184, label %198
184: ; preds = %180
%185 = getelementptr inbounds [256 x i8], [256 x i8]* %13, i64 0, i64 2
%186 = load i8, i8* %185
%187 = sext i8 %186 to i32
%188 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.16, i64 0, i64 0), i32 %187)
%189 = getelementptr inbounds [256 x i8], [256 x i8]* %13, i64 0, i64 2
%190 = load i8, i8* %189
%191 = load i32, i32* %21
%192 = sext i32 %191 to i64
%193 = getelementptr inbounds [26 x i8], [26 x i8]* %20, i64 0, i64 %192
store i8 %190, i8* %193
%194 = load i32, i32* %21
%195 = add nsw i32 %194, 1
store i32 %195, i32* %21
%196 = load i32, i32* %21
%197 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.17, i64 0, i64 0), i32 %196)
br label %237
198: ; preds = %180
%199 = load i32, i32* %22
%200 = call i32 @send(i32 %199, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.18, i64 0, i64 0), i32 18, i32 0)
store i32 %200, i32* %17
%201 = load i32, i32* %17
%202 = icmp slt i32 %201, 0
br i1 %202, label %203, label %205
203: ; preds = %198
%204 = call i32 @error(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.19, i64 0, i64 0))
br label %205
205: ; preds = %203, %198
store i32 0, i32* %23
br label %206
206: ; preds = %233, %205
%207 = load i32, i32* %23
%208 = load i32, i32* @FD_SETSIZE
%209 = icmp slt i32 %207, %208
br i1 %209, label %210, label %236
210: ; preds = %206
%211 = load i32, i32* %23
%212 = load i32, i32* %22
%213 = icmp ne i32 %211, %212
br i1 %213, label %214, label %232
214: ; preds = %210
%215 = load i32, i32* %23
%216 = call i64 @FD_ISSET(i32 %215, i32* %7)
%217 = icmp ne i64 %216, 0
br i1 %217, label %218, label %232
218: ; preds = %214
%219 = load i32, i32* %23
%220 = load i32, i32* %8
%221 = icmp ne i32 %219, %220
br i1 %221, label %222, label %232
222: ; preds = %218
%223 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.20, i64 0, i64 0))
%224 = load i32, i32* %23
%225 = getelementptr inbounds [256 x i8], [256 x i8]* %13, i64 0, i64 0
%226 = call i32 @send(i32 %224, i8* %225, i32 18, i32 0)
store i32 %226, i32* %17
%227 = load i32, i32* %17
%228 = icmp slt i32 %227, 0
br i1 %228, label %229, label %231
229: ; preds = %222
%230 = call i32 @error(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.19, i64 0, i64 0))
br label %231
231: ; preds = %229, %222
br label %232
232: ; preds = %231, %218, %214, %210
br label %233
233: ; preds = %232
%234 = load i32, i32* %23
%235 = add nsw i32 %234, 1
store i32 %235, i32* %23
br label %206
236: ; preds = %206
br label %237
237: ; preds = %236, %184
br label %238
238: ; preds = %237, %179
br label %239
239: ; preds = %238, %138
br label %240
240: ; preds = %239, %125
br label %241
241: ; preds = %240, %116, %112
br label %242
242: ; preds = %241
%243 = load i32, i32* %22
%244 = add nsw i32 %243, 1
store i32 %244, i32* %22
br label %103
245: ; preds = %110
%246 = load i32, i32* %11
%247 = add nsw i32 %246, 1
store i32 %247, i32* %11
br label %69
}

LLVM IR (-O2):
%struct.sockaddr_in = type { i32, %struct.TYPE_2__, i32 }
%struct.TYPE_2__ = type { i32 }
%struct.sockaddr = type { i32 }
@stderr = global i32 0
@.str = [25 x i8] c"ERROR, no port provided\0A\00"
@AF_INET = global i32 0
@SOCK_STREAM = global i32 0
@IPPROTO_TCP = global i32 0
@.str.1 = [21 x i8] c"ERROR opening socket\00"
@INADDR_ANY = global i32 0
@.str.2 = [17 x i8] c"ERROR on binding\00"
@FD_SETSIZE = global i32 0
@.str.3 = [13 x i8] c"Events = %d\0A\00"
@.str.4 = [16 x i8] c"Newsockfd = %d\0A\00"
@.str.5 = [16 x i8] c"ERROR on accept\00"
@.str.6 = [21 x i8] c"ERROR maximum cilent\00"
@.str.8 = [25 x i8] c"Here is the message: %s\0A\00"
@.str.9 = [3 x i8] c"!!\00"
@.str.10 = [18 x i8] c"send ack to : %c\0A\00"
@.str.11 = [2 x i8] c"/\00"
@.str.12 = [6 x i8] c"/exit\00"
@.str.13 = [21 x i8] c"send direct to : %c\0A\00"
@.str.14 = [14 x i8] c"message = %s\0A\00"
@.str.15 = [3 x i8] c"->\00"
@.str.16 = [15 x i8] c"add user : %c\0A\00"
@.str.17 = [18 x i8] c"user number = %d\0A\00"
@.str.18 = [25 x i8] c"Server got your message\0A\00"
@.str.19 = [24 x i8] c"ERROR writing to socket\00"
@str = [23 x i8] c"send broadcast message\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca [256 x i8]
%7 = alloca %struct.sockaddr_in
%8 = alloca %struct.sockaddr_in
%9 = alloca [26 x i32]
%10 = alloca [26 x i8]
%11 = bitcast i32* %3 to i8*
%12 = bitcast i32* %4 to i8*
%13 = bitcast i32* %5 to i8*
%14 = getelementptr inbounds [256 x i8], [256 x i8]* %6, i64 0, i64 0
%15 = bitcast %struct.sockaddr_in* %7 to i8*
%16 = bitcast %struct.sockaddr_in* %8 to i8*
%17 = bitcast [26 x i32]* %9 to i8*
%18 = getelementptr inbounds [26 x i8], [26 x i8]* %10, i64 0, i64 0
%19 = icmp slt i32 %0, 2
br i1 %19, label %20, label %24
20: ; preds = %2
%21 = load i32, i32* @stderr
%22 = tail call i32 @fprintf(i32 %21, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0))
%23 = tail call i32 @exit(i32 1)
unreachable
24: ; preds = %2
%25 = load i32, i32* @AF_INET
%26 = load i32, i32* @SOCK_STREAM
%27 = load i32, i32* @IPPROTO_TCP
%28 = tail call i32 @socket(i32 %25, i32 %26, i32 %27)
%29 = icmp slt i32 %28, 0
br i1 %29, label %30, label %32
30: ; preds = %24
%31 = tail call i32 @error(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.1, i64 0, i64 0))
br label %32
32: ; preds = %30, %24
%33 = call i32 @FD_ZERO(i32* %4)
%34 = call i32 @FD_SET(i32 %28, i32* %4)
%35 = call i32 @FD_ZERO(i32* %3)
%36 = call i32 @FD_SET(i32 %28, i32* %3)
%37 = call i32 @bzero(i8* %15, i32 12)
%38 = getelementptr inbounds i8*, i8** %1, i64 1
%39 = load i8*, i8** %38
%40 = call i32 @atoi(i8* %39)
%41 = load i32, i32* @AF_INET
%42 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %7, i64 0, i32 2
store i32 %41, i32* %42
%43 = load i32, i32* @INADDR_ANY
%44 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %7, i64 0, i32 1, i32 0
store i32 %43, i32* %44
%45 = call i32 @htons(i32 %40)
%46 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %7, i64 0, i32 0
store i32 %45, i32* %46
%47 = bitcast %struct.sockaddr_in* %7 to %struct.sockaddr*
%48 = call i64 @bind(i32 %28, %struct.sockaddr* %47, i32 12)
%49 = icmp slt i64 %48, 0
br i1 %49, label %50, label %52
50: ; preds = %32
%51 = call i32 @error(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.2, i64 0, i64 0))
br label %52
52: ; preds = %50, %32
%53 = call i32 @listen(i32 %28, i32 5)
%54 = bitcast %struct.sockaddr_in* %8 to %struct.sockaddr*
%55 = getelementptr inbounds [256 x i8], [256 x i8]* %6, i64 0, i64 2
%56 = getelementptr inbounds [256 x i8], [256 x i8]* %6, i64 0, i64 1
%57 = getelementptr inbounds [256 x i8], [256 x i8]* %6, i64 0, i64 4
%58 = load i32, i32* @FD_SETSIZE
br label %59
59: ; preds = %173, %52
%60 = phi i32 [ %58, %52 ], [ %177, %173 ]
%61 = phi i32 [ 0, %52 ], [ %87, %173 ]
%62 = phi i32 [ 0, %52 ], [ %175, %173 ]
br label %63
63: ; preds = %59, %86
%64 = phi i32 [ %88, %86 ], [ %60, %59 ]
%65 = phi i32 [ %87, %86 ], [ %61, %59 ]
%66 = load i32, i32* %4
store i32 %66, i32* %3
%67 = call i32 @select(i32 %64, i32* %3, i32* null, i32* null, i32* null)
%68 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), i32 %67)
%69 = call i64 @FD_ISSET(i32 %28, i32* %3)
%70 = icmp eq i64 %69, 0
br i1 %70, label %86, label %71
71: ; preds = %63
store i32 12, i32* %5
%72 = call i32 @accept(i32 %28, %struct.sockaddr* %54, i32* %5)
%73 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.4, i64 0, i64 0), i32 %72)
%74 = icmp slt i32 %72, 0
br i1 %74, label %75, label %77
75: ; preds = %71
%76 = call i32 @error(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.5, i64 0, i64 0))
br label %77
77: ; preds = %75, %71
%78 = sext i32 %65 to i64
%79 = getelementptr inbounds [26 x i32], [26 x i32]* %9, i64 0, i64 %78
store i32 %72, i32* %79
%80 = icmp sgt i32 %65, 26
br i1 %80, label %81, label %83
81: ; preds = %77
%82 = call i32 @error(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.6, i64 0, i64 0))
br label %83
83: ; preds = %81, %77
%84 = add nsw i32 %65, 1
%85 = call i32 @FD_SET(i32 %72, i32* %4)
br label %86
86: ; preds = %83, %63
%87 = phi i32 [ %84, %83 ], [ %65, %63 ]
%88 = load i32, i32* @FD_SETSIZE
%89 = icmp sgt i32 %88, 0
%90 = icmp sgt i32 %67, 0
%91 = and i1 %89, %90
br i1 %91, label %92, label %63
92: ; preds = %86, %173
%93 = phi i32 [ %176, %173 ], [ 0, %86 ]
%94 = phi i32 [ %175, %173 ], [ %62, %86 ]
%95 = phi i32 [ %174, %173 ], [ %67, %86 ]
%96 = call i64 @FD_ISSET(i32 %93, i32* %3)
%97 = icmp eq i64 %96, 0
%98 = icmp eq i32 %93, %28
%99 = select i1 %97, i1 true, i1 %98
br i1 %99, label %173, label %100
100: ; preds = %92
%101 = add nsw i32 %95, -1
%102 = call i32 @bzero(i8* %14, i32 256)
%103 = call i32 @recv(i32 %93, i8* %14, i32 255, i32 0)
%104 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.8, i64 0, i64 0), i8* %14)
%105 = call i64 @strncmp(i8* %14, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0), i32 2)
%106 = icmp eq i64 %105, 0
br i1 %106, label %107, label %116
107: ; preds = %100
%108 = load i8, i8* %57
%109 = call i64 @find_index(i8* %18, i32 26, i8 signext %108)
%110 = getelementptr inbounds [26 x i32], [26 x i32]* %9, i64 0, i64 %109
%111 = load i32, i32* %110
%112 = call i32 @send(i32 %111, i8* %14, i32 5, i32 0)
%113 = load i8, i8* %57
%114 = sext i8 %113 to i32
%115 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.10, i64 0, i64 0), i32 %114)
br label %173
116: ; preds = %100
%117 = call i64 @strncmp(i8* %14, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.11, i64 0, i64 0), i32 1)
%118 = icmp eq i64 %117, 0
br i1 %118, label %119, label %135
119: ; preds = %116
%120 = call i64 @strncmp(i8* %14, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.12, i64 0, i64 0), i32 5)
%121 = icmp eq i64 %120, 0
br i1 %121, label %122, label %125
122: ; preds = %119
%123 = call i32 @FD_CLR(i32 %93, i32* %4)
%124 = call i32 @bzero(i8* %14, i32 256)
br label %173
125: ; preds = %119
%126 = load i8, i8* %56
%127 = call i64 @find_index(i8* %18, i32 26, i8 signext %126)
%128 = getelementptr inbounds [26 x i32], [26 x i32]* %9, i64 0, i64 %127
%129 = load i32, i32* %128
%130 = call i32 @send(i32 %129, i8* %14, i32 255, i32 0)
%131 = load i8, i8* %56
%132 = sext i8 %131 to i32
%133 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.13, i64 0, i64 0), i32 %132)
%134 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.14, i64 0, i64 0), i8* %14)
br label %173
135: ; preds = %116
%136 = call i64 @strncmp(i8* %14, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.15, i64 0, i64 0), i32 2)
%137 = icmp eq i64 %136, 0
br i1 %137, label %138, label %147
138: ; preds = %135
%139 = load i8, i8* %55
%140 = sext i8 %139 to i32
%141 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.16, i64 0, i64 0), i32 %140)
%142 = load i8, i8* %55
%143 = sext i32 %94 to i64
%144 = getelementptr inbounds [26 x i8], [26 x i8]* %10, i64 0, i64 %143
store i8 %142, i8* %144
%145 = add nsw i32 %94, 1
%146 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.17, i64 0, i64 0), i32 %145)
br label %173
147: ; preds = %135
%148 = call i32 @send(i32 %93, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.18, i64 0, i64 0), i32 18, i32 0)
%149 = icmp slt i32 %148, 0
br i1 %149, label %150, label %152
150: ; preds = %147
%151 = call i32 @error(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.19, i64 0, i64 0))
br label %152
152: ; preds = %150, %147
%153 = load i32, i32* @FD_SETSIZE
%154 = icmp sgt i32 %153, 0
br i1 %154, label %155, label %173
155: ; preds = %152, %169
%156 = phi i32 [ %170, %169 ], [ 0, %152 ]
%157 = icmp eq i32 %156, %93
br i1 %157, label %169, label %158
158: ; preds = %155
%159 = call i64 @FD_ISSET(i32 %156, i32* %4)
%160 = icmp eq i64 %159, 0
%161 = icmp eq i32 %156, %28
%162 = select i1 %160, i1 true, i1 %161
br i1 %162, label %169, label %163
163: ; preds = %158
%164 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str, i64 0, i64 0))
%165 = call i32 @send(i32 %156, i8* %14, i32 18, i32 0)
%166 = icmp slt i32 %165, 0
br i1 %166, label %167, label %169
167: ; preds = %163
%168 = call i32 @error(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.19, i64 0, i64 0))
br label %169
169: ; preds = %155, %158, %167, %163
%170 = add nuw nsw i32 %156, 1
%171 = load i32, i32* @FD_SETSIZE
%172 = icmp slt i32 %170, %171
br i1 %172, label %155, label %173
173: ; preds = %169, %152, %92, %107, %138, %122, %125
%174 = phi i32 [ %101, %107 ], [ %101, %122 ], [ %101, %125 ], [ %101, %138 ], [ %95, %92 ], [ %101, %152 ], [ %101, %169 ]
%175 = phi i32 [ %94, %107 ], [ %94, %122 ], [ %94, %125 ], [ %145, %138 ], [ %94, %92 ], [ %94, %152 ], [ %94, %169 ]
%176 = add nuw nsw i32 %93, 1
%177 = load i32, i32* @FD_SETSIZE
%178 = icmp slt i32 %176, %177
%179 = icmp sgt i32 %174, 0
%180 = select i1 %178, i1 %179, i1 false
br i1 %180, label %92, label %59
}