#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 */
typedef int /*<<< orphan*/ word;
struct TYPE_2__ {
  int /*<<< orphan*/ s_addr;
};
struct sockaddr_in {
  char sin_zero;
  TYPE_1__ sin_addr;
  int /*<<< orphan*/ sin_port;
  int /*<<< orphan*/ sin_family;
};
struct sockaddr {
  int dummy;
};
typedef int /*<<< orphan*/ newaddr;
typedef int /*<<< orphan*/ localaddr;
typedef int /*<<< orphan*/ fd_set;
typedef int /*<<< orphan*/ bufrack;
typedef int /*<<< orphan*/ buffer;

/* 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 /*<<< orphan*/ FD_ZERO(int /*<<< orphan*/ *);
int /*<<< orphan*/ INADDR_ANY;
int /*<<< orphan*/ PF_INET;
int /*<<< orphan*/ SOCK_STREAM;
int /*<<< orphan*/ SOL_SOCKET;
int /*<<< orphan*/ SO_REUSEADDR;
int accept(int, struct sockaddr *, int *);
int atoi(char *);
int /*<<< orphan*/ bind(int, struct sockaddr *, int);
int /*<<< orphan*/ clearsqarray(int, char **);
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ getpeername(int, struct sockaddr *, int *);
int /*<<< orphan*/ htons(int);
char *inet_ntoa(TYPE_1__);
int /*<<< orphan*/ listen(int, int);
int /*<<< orphan*/ memset(char *, char, int);
char **opendict(char *);
int /*<<< orphan*/ perror(char *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ randomrack(char *, int *, int);
int recv(int, char *, int, int /*<<< orphan*/);
int searchdict(char *);
int /*<<< orphan*/ select(int, int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                          int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int /*<<< orphan*/ send(int, char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ sendboard(int, char *, char *, int);
int /*<<< orphan*/ setsockopt(int, int /*<<< orphan*/, int /*<<< orphan*/,
                              int *, int);
int /*<<< orphan*/ sleep(int);
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ sprintf(char *, char *, char *, ...);
int /*<<< orphan*/ srandom(int /*<<< orphan*/);
scalar_t__ strcmp(char *, char *);
int strlen(char *);
int /*<<< orphan*/ strncpy(char *, char *, int);
int /*<<< orphan*/ strplc_a(int, int, int, char **, char *, int);
int /*<<< orphan*/ strplc_d(int, int, int, char **, char *, int);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main(int argc, char *argv[]) {
  int playerfd[2];
  char playerid = '1';
  char board[15][15];
  char bufrack[8];
  int x, y, num;
  char bufx[3], bufy[3];
  int bag[27] = {9, 2, 2, 4, 12, 2, 3, 2, 9, 1, 1, 4, 2, 6,
                 8, 2, 1, 6, 4,  6, 4, 2, 2, 1, 2, 1, 2};
  char **dict;
  char word[17];
  char bufout[1024];
  dict = opendict("dict");
  srandom(time(NULL));
  clearsqarray(15, board);
  int listens, newsock, sin_size, bigfd, numbytes, i, j;
  char buffer[1024];
  struct sockaddr_in localaddr, newaddr, getaddr;
  fd_set master, tempfd;
  int yes = 1;
  listens = socket(PF_INET, SOCK_STREAM, 0);
  setsockopt(listens, SOL_SOCKET, SO_REUSEADDR, &yes, sizeof(int));
  localaddr.sin_family = AF_INET;
  localaddr.sin_port = htons(3000);
  localaddr.sin_addr.s_addr = INADDR_ANY;
  memset(&(localaddr.sin_zero), '\0', sizeof(localaddr.sin_zero));
  bind(listens, (struct sockaddr *)&localaddr, sizeof(localaddr));
  listen(listens, 10);
  FD_ZERO(&master);
  FD_ZERO(&tempfd);
  FD_SET(listens, &master);
  bigfd = listens;
  for (;;) {
    tempfd = master;
    select(bigfd + 1, &tempfd, NULL, NULL, NULL);
    for (i = 0; i <= bigfd; i++) {
      if (FD_ISSET(i, &tempfd)) {
        if (i == listens) {
          sin_size = sizeof(newaddr);
          newsock = accept(listens, (struct sockaddr *)&newaddr, &sin_size);
          FD_SET(newsock, &master);
          if (newsock > bigfd)
            bigfd = newsock;
          printf("Connection from: %s Socket: %i\n",
                 inet_ntoa(newaddr.sin_addr), newsock);
          if (atoi(&playerid) < 2)
            playerfd[atoi(&playerid) - 1] = newsock;
          send(newsock, &playerid, sizeof(char), 0);
          playerid++;
          randomrack(bufrack, bag, 7);
          send(newsock, bufrack, strlen(bufrack), 0);
        } else {
          if ((numbytes = recv(i, buffer, sizeof(buffer), 0)) == 0) {
            printf("Connection closed: socket %i\n", i);
            if (playerid == '3' || playerid == '1')
              playerid = '1';
            else
              playerid--;
            close(i);
            FD_CLR(i, &master);
          } else if (numbytes < 0) {
            perror("recv");
          } else {
            getpeername(i, (struct sockaddr *)&getaddr, &sin_size);
            if (buffer[0] != 'c' && buffer[0] != 'r' && buffer[0] != 'p')
              printf("DATA From: %s Socket: %i Data: %s\n",
                     inet_ntoa(getaddr.sin_addr), i, buffer);
            send(i, "ACK", 4, 0);
            if (strcmp(buffer, "q") == 0)
              exit(0);
            switch (buffer[0]) {
            case 'c':
              printf("CHAT From: %s Player: %i Message: %s\n",
                     inet_ntoa(getaddr.sin_addr), i - 3, buffer + 1);
              for (j = 0; j <= bigfd; j++)
                if (FD_ISSET(j, &master))
                  if (j != listens && j != i)
                    send(j, buffer, numbytes, 0);
              break;
            case 'r':
              num = atoi(buffer + 1);
              memset(bufrack, '\0', sizeof(bufrack));
              randomrack(bufrack, bag, num);
              sprintf(bufout, "r%s", bufrack);
              send(i, bufout, strlen(bufout), 0);
              printf("RACK From: %s Player: %i Number: %i Letters: %s\n",
                     inet_ntoa(getaddr.sin_addr), i - 3, num, bufrack);
              break;
            case 'p':
              strncpy(bufx, buffer + 2, 2);
              bufx[2] = '\0';
              strncpy(bufy, buffer + 4, 2);
              bufy[2] = '\0';
              x = atoi(bufx);
              y = atoi(bufy);
              strncpy(word, buffer + 6, sizeof(word));
              word[strlen(buffer + 6)] = '\0';
              printf("PLACE From: %s Player: %i Direction: %c X: %i Y: %i "
                     "Word: %s\n",
                     inet_ntoa(getaddr.sin_addr), i - 3, buffer[1], x, y, word);
              if (searchdict(word) != 1) {
                send(i, "c*** Word not found ***", 25, 0);
                printf("DICT %s not found\n", word);
                break;
              }
              switch (buffer[1]) {
              case 'a':
                strplc_a(x, y, 15, board, word, strlen(word));
                break;
              case 'd':
                strplc_d(x, y, 15, board, word, strlen(word));
                break;
              }
              for (j = 0; j <= bigfd; j++)
                if (FD_ISSET(j, &master))
                  if (j != listens)
                    sendboard(j, buffer, *board, 15);
              sleep(1);
              num = strlen(word);
              memset(bufrack, '\0', sizeof(bufrack));
              randomrack(bufrack, bag, num);
              sprintf(bufout, "d%sr%s", word, bufrack);
              send(i, bufout, strlen(bufout), 0);
              printf("RACK From: %s Player: %i Number: %i Letters: %s\n",
                     inet_ntoa(getaddr.sin_addr), i - 3, num, bufrack);
              break;
            }
            memset(buffer, '\0', strlen(buffer));
          }
        }
      }
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa80,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movb   $0x31,-0x19(%rbp)
lea    -0x190(%rbp),%rdi
lea    0xc95(%rip),%rsi
mov    $0x6c,%edx
call   1150 <memcpy@plt>
lea    0xcf0(%rip),%rdi
call   1070 <opendict@plt>
mov    %rax,-0x198(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1160 <time@plt>
mov    %eax,%edi
call   1050 <srandom@plt>
lea    -0x100(%rbp),%rsi
mov    $0xf,%edi
call   1030 <clearsqarray@plt>
movl   $0x1,-0xa0c(%rbp)
mov    0x2c06(%rip),%rax
mov    (%rax),%edi
mov    0x2c05(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1260 <socket@plt>
mov    %eax,-0x5b4(%rbp)
mov    -0x5b4(%rbp),%edi
mov    0x2c09(%rip),%rax
mov    (%rax),%esi
mov    0x2bd0(%rip),%rax
mov    (%rax),%edx
lea    -0xa0c(%rbp),%rcx
mov    $0x4,%r8d
call   1080 <setsockopt@plt>
mov    0x2bdd(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x9d4(%rbp)
mov    $0xbb8,%edi
call   10d0 <htons@plt>
mov    %eax,-0x9d8(%rbp)
mov    0x2bb6(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x9dc(%rbp)
lea    -0x9e0(%rbp),%rdi
xor    %esi,%esi
mov    $0x1,%edx
call   1100 <memset@plt>
mov    -0x5b4(%rbp),%edi
lea    -0x9e0(%rbp),%rsi
mov    $0x10,%edx
call   11c0 <bind@plt>
mov    -0x5b4(%rbp),%edi
mov    $0xa,%esi
call   11a0 <listen@plt>
lea    -0xa04(%rbp),%rdi
call   1170 <FD_ZERO@plt>
lea    -0xa08(%rbp),%rdi
call   1170 <FD_ZERO@plt>
mov    -0x5b4(%rbp),%edi
lea    -0xa04(%rbp),%rsi
call   1240 <FD_SET@plt>
mov    -0x5b4(%rbp),%eax
mov    %eax,-0x5c0(%rbp)
mov    -0xa04(%rbp),%eax
mov    %eax,-0xa08(%rbp)
mov    -0x5c0(%rbp),%edi
add    $0x1,%edi
lea    -0xa08(%rbp),%rsi
xor    %eax,%eax
mov    %eax,%r8d
mov    %r8,%rdx
mov    %r8,%rcx
call   1180 <select@plt>
movl   $0x0,-0x5c8(%rbp)
mov    -0x5c8(%rbp),%eax
cmp    -0x5c0(%rbp),%eax
jg     1d4b <main+0xa0b>
mov    -0x5c8(%rbp),%edi
lea    -0xa08(%rbp),%rsi
call   1090 <FD_ISSET@plt>
cmp    $0x0,%rax
je     1d32 <main+0x9f2>
mov    -0x5c8(%rbp),%eax
cmp    -0x5b4(%rbp),%eax
jne    1638 <main+0x2f8>
movl   $0x10,-0x5bc(%rbp)
mov    -0x5b4(%rbp),%edi
lea    -0x9f0(%rbp),%rsi
lea    -0x5bc(%rbp),%rdx
call   11e0 <accept@plt>
mov    %eax,-0x5b8(%rbp)
mov    -0x5b8(%rbp),%edi
lea    -0xa04(%rbp),%rsi
call   1240 <FD_SET@plt>
mov    -0x5b8(%rbp),%eax
cmp    -0x5c0(%rbp),%eax
jle    1569 <main+0x229>
mov    -0x5b8(%rbp),%eax
mov    %eax,-0x5c0(%rbp)
mov    -0x9ec(%rbp),%edi
call   10a0 <inet_ntoa@plt>
mov    %rax,%rsi
mov    -0x5b8(%rbp),%edx
lea    0xaed(%rip),%rdi
mov    $0x0,%al
call   10f0 <printf@plt>
lea    -0x19(%rbp),%rdi
call   11f0 <atoi@plt>
cmp    $0x2,%eax
jge    15c1 <main+0x281>
mov    -0x5b8(%rbp),%eax
mov    %eax,-0xa10(%rbp)
lea    -0x19(%rbp),%rdi
call   11f0 <atoi@plt>
mov    -0xa10(%rbp),%ecx
sub    $0x1,%eax
cltq
mov    %ecx,-0x18(%rbp,%rax,4)
mov    -0x5b8(%rbp),%edi
lea    -0x19(%rbp),%rsi
mov    $0x1,%edx
xor    %ecx,%ecx
call   10e0 <send@plt>
mov    -0x19(%rbp),%al
add    $0x1,%al
mov    %al,-0x19(%rbp)
lea    -0x108(%rbp),%rdi
lea    -0x190(%rbp),%rsi
mov    $0x7,%edx
call   1190 <randomrack@plt>
mov    -0x5b8(%rbp),%eax
mov    %eax,-0xa1c(%rbp)
lea    -0x108(%rbp),%rax
mov    %rax,-0xa18(%rbp)
lea    -0x108(%rbp),%rdi
call   10c0 <strlen@plt>
mov    -0xa1c(%rbp),%edi
mov    -0xa18(%rbp),%rsi
mov    %eax,%edx
xor    %ecx,%ecx
call   10e0 <send@plt>
jmp    1d2d <main+0x9ed>
mov    -0x5c8(%rbp),%edi
lea    -0x9d0(%rbp),%rsi
mov    $0x400,%edx
xor    %ecx,%ecx
call   1040 <recv@plt>
mov    %eax,-0x5c4(%rbp)
cmp    $0x0,%eax
jne    16c1 <main+0x381>
mov    -0x5c8(%rbp),%esi
lea    0xa24(%rip),%rdi
mov    $0x0,%al
call   10f0 <printf@plt>
movsbl -0x19(%rbp),%eax
cmp    $0x33,%eax
je     168e <main+0x34e>
movsbl -0x19(%rbp),%eax
cmp    $0x31,%eax
jne    1697 <main+0x357>
movb   $0x31,-0x19(%rbp)
jmp    169f <main+0x35f>
mov    -0x19(%rbp),%al
add    $0xff,%al
mov    %al,-0x19(%rbp)
mov    -0x5c8(%rbp),%edi
call   1120 <close@plt>
mov    -0x5c8(%rbp),%edi
lea    -0xa04(%rbp),%rsi
call   1200 <FD_CLR@plt>
jmp    1d28 <main+0x9e8>
cmpl   $0x0,-0x5c4(%rbp)
jge    16df <main+0x39f>
lea    0x9da(%rip),%rdi
call   11d0 <perror@plt>
jmp    1d23 <main+0x9e3>
mov    -0x5c8(%rbp),%edi
lea    -0xa00(%rbp),%rsi
lea    -0x5bc(%rbp),%rdx
call   10b0 <getpeername@plt>
movsbl -0x9d0(%rbp),%eax
cmp    $0x63,%eax
je     1751 <main+0x411>
movsbl -0x9d0(%rbp),%eax
cmp    $0x72,%eax
je     1751 <main+0x411>
movsbl -0x9d0(%rbp),%eax
cmp    $0x70,%eax
je     1751 <main+0x411>
mov    -0x9fc(%rbp),%edi
call   10a0 <inet_ntoa@plt>
mov    %rax,%rsi
mov    -0x5c8(%rbp),%edx
lea    -0x9d0(%rbp),%rcx
lea    0x96a(%rip),%rdi
mov    $0x0,%al
call   10f0 <printf@plt>
mov    -0x5c8(%rbp),%edi
lea    0x979(%rip),%rsi
mov    $0x4,%edx
xor    %ecx,%ecx
call   10e0 <send@plt>
lea    -0x9d0(%rbp),%rdi
lea    0x963(%rip),%rsi
call   1140 <strcmp@plt>
cmp    $0x0,%rax
jne    178e <main+0x44e>
xor    %edi,%edi
call   1230 <exit@plt>
movsbl -0x9d0(%rbp),%eax
mov    %eax,-0xa20(%rbp)
sub    $0x63,%eax
je     17d1 <main+0x491>
jmp    17a9 <main+0x469>
mov    -0xa20(%rbp),%eax
sub    $0x70,%eax
je     196b <main+0x62b>
jmp    17bd <main+0x47d>
mov    -0xa20(%rbp),%eax
sub    $0x72,%eax
je     189a <main+0x55a>
jmp    1cf9 <main+0x9b9>
mov    -0x9fc(%rbp),%edi
call   10a0 <inet_ntoa@plt>
mov    %rax,%rsi
mov    -0x5c8(%rbp),%edx
sub    $0x3,%edx
lea    -0x9d0(%rbp),%rcx
add    $0x1,%rcx
lea    0x8e3(%rip),%rdi
mov    $0x0,%al
call   10f0 <printf@plt>
movl   $0x0,-0x5cc(%rbp)
mov    -0x5cc(%rbp),%eax
cmp    -0x5c0(%rbp),%eax
jg     1895 <main+0x555>
mov    -0x5cc(%rbp),%edi
lea    -0xa04(%rbp),%rsi
call   1090 <FD_ISSET@plt>
cmp    $0x0,%rax
je     187c <main+0x53c>
mov    -0x5cc(%rbp),%eax
cmp    -0x5b4(%rbp),%eax
je     1877 <main+0x537>
mov    -0x5cc(%rbp),%eax
cmp    -0x5c8(%rbp),%eax
je     1877 <main+0x537>
mov    -0x5cc(%rbp),%edi
lea    -0x9d0(%rbp),%rsi
mov    -0x5c4(%rbp),%edx
xor    %ecx,%ecx
call   10e0 <send@plt>
jmp    187c <main+0x53c>
jmp    1881 <main+0x541>
mov    -0x5cc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x5cc(%rbp)
jmp    180b <main+0x4cb>
jmp    1cf9 <main+0x9b9>
lea    -0x9d0(%rbp),%rdi
add    $0x1,%rdi
call   11f0 <atoi@plt>
mov    %eax,-0x114(%rbp)
lea    -0x108(%rbp),%rdi
xor    %esi,%esi
mov    $0x8,%edx
call   1100 <memset@plt>
lea    -0x108(%rbp),%rdi
lea    -0x190(%rbp),%rsi
mov    -0x114(%rbp),%edx
call   1190 <randomrack@plt>
lea    -0x5b0(%rbp),%rdi
lea    -0x108(%rbp),%rdx
lea    0x8af(%rip),%rsi
mov    $0x0,%al
call   1220 <sprintf@plt>
mov    -0x5c8(%rbp),%eax
mov    %eax,-0xa2c(%rbp)
lea    -0x5b0(%rbp),%rax
mov    %rax,-0xa28(%rbp)
lea    -0x5b0(%rbp),%rdi
call   10c0 <strlen@plt>
mov    -0xa2c(%rbp),%edi
mov    -0xa28(%rbp),%rsi
mov    %eax,%edx
xor    %ecx,%ecx
call   10e0 <send@plt>
mov    -0x9fc(%rbp),%edi
call   10a0 <inet_ntoa@plt>
mov    %rax,%rsi
mov    -0x5c8(%rbp),%edx
sub    $0x3,%edx
mov    -0x114(%rbp),%ecx
lea    -0x108(%rbp),%r8
lea    0x7a4(%rip),%rdi
mov    $0x0,%al
call   10f0 <printf@plt>
jmp    1cf9 <main+0x9b9>
lea    -0x117(%rbp),%rdi
lea    -0x9d0(%rbp),%rsi
add    $0x2,%rsi
mov    $0x2,%edx
call   1060 <strncpy@plt>
movb   $0x0,-0x115(%rbp)
lea    -0x11a(%rbp),%rdi
lea    -0x9d0(%rbp),%rsi
add    $0x4,%rsi
mov    $0x2,%edx
call   1060 <strncpy@plt>
movb   $0x0,-0x118(%rbp)
lea    -0x117(%rbp),%rdi
call   11f0 <atoi@plt>
mov    %eax,-0x10c(%rbp)
lea    -0x11a(%rbp),%rdi
call   11f0 <atoi@plt>
mov    %eax,-0x110(%rbp)
lea    -0x1b0(%rbp),%rdi
lea    -0x9d0(%rbp),%rsi
add    $0x6,%rsi
mov    $0x11,%edx
call   1060 <strncpy@plt>
lea    -0x9d0(%rbp),%rdi
add    $0x6,%rdi
call   10c0 <strlen@plt>
cltq
movb   $0x0,-0x1b0(%rbp,%rax,1)
mov    -0x9fc(%rbp),%edi
call   10a0 <inet_ntoa@plt>
mov    %rax,%rsi
mov    -0x5c8(%rbp),%edx
sub    $0x3,%edx
movsbl -0x9cf(%rbp),%ecx
mov    -0x10c(%rbp),%r8d
mov    -0x110(%rbp),%r9d
lea    -0x1b0(%rbp),%rax
lea    0x6ef(%rip),%rdi
mov    %rax,(%rsp)
mov    $0x0,%al
call   10f0 <printf@plt>
lea    -0x1b0(%rbp),%rdi
call   11b0 <searchdict@plt>
cmp    $0x1,%eax
je     1a98 <main+0x758>
mov    -0x5c8(%rbp),%edi
lea    0x700(%rip),%rsi
mov    $0x19,%edx
xor    %ecx,%ecx
call   10e0 <send@plt>
lea    -0x1b0(%rbp),%rsi
lea    0x6fe(%rip),%rdi
mov    $0x0,%al
call   10f0 <printf@plt>
jmp    1cf9 <main+0x9b9>
movsbl -0x9cf(%rbp),%eax
mov    %eax,-0xa30(%rbp)
sub    $0x61,%eax
je     1ac7 <main+0x787>
jmp    1ab3 <main+0x773>
mov    -0xa30(%rbp),%eax
sub    $0x64,%eax
je     1b33 <main+0x7f3>
jmp    1b9a <main+0x85a>
mov    -0x10c(%rbp),%eax
mov    %eax,-0xa48(%rbp)
mov    -0x110(%rbp),%eax
mov    %eax,-0xa44(%rbp)
lea    -0x100(%rbp),%rax
mov    %rax,-0xa40(%rbp)
lea    -0x1b0(%rbp),%rax
mov    %rax,-0xa38(%rbp)
lea    -0x1b0(%rbp),%rdi
call   10c0 <strlen@plt>
mov    -0xa48(%rbp),%edi
mov    -0xa44(%rbp),%esi
mov    -0xa40(%rbp),%rcx
mov    -0xa38(%rbp),%r8
mov    %eax,%r9d
mov    $0xf,%edx
call   1130 <strplc_a@plt>
jmp    1b9a <main+0x85a>
mov    -0x10c(%rbp),%eax
mov    %eax,-0xa60(%rbp)
mov    -0x110(%rbp),%eax
mov    %eax,-0xa5c(%rbp)
lea    -0x100(%rbp),%rax
mov    %rax,-0xa58(%rbp)
lea    -0x1b0(%rbp),%rax
mov    %rax,-0xa50(%rbp)
lea    -0x1b0(%rbp),%rdi
call   10c0 <strlen@plt>
mov    -0xa60(%rbp),%edi
mov    -0xa5c(%rbp),%esi
mov    -0xa58(%rbp),%rcx
mov    -0xa50(%rbp),%r8
mov    %eax,%r9d
mov    $0xf,%edx
call   1210 <strplc_d@plt>
movl   $0x0,-0x5cc(%rbp)
mov    -0x5cc(%rbp),%eax
cmp    -0x5c0(%rbp),%eax
jg     1c20 <main+0x8e0>
mov    -0x5cc(%rbp),%edi
lea    -0xa04(%rbp),%rsi
call   1090 <FD_ISSET@plt>
cmp    $0x0,%rax
je     1c07 <main+0x8c7>
mov    -0x5cc(%rbp),%eax
cmp    -0x5b4(%rbp),%eax
je     1c02 <main+0x8c2>
mov    -0x5cc(%rbp),%edi
lea    -0x9d0(%rbp),%rsi
lea    -0x100(%rbp),%rdx
mov    $0xf,%ecx
call   1110 <sendboard@plt>
jmp    1c07 <main+0x8c7>
jmp    1c0c <main+0x8cc>
mov    -0x5cc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x5cc(%rbp)
jmp    1ba4 <main+0x864>
mov    $0x1,%edi
call   1250 <sleep@plt>
lea    -0x1b0(%rbp),%rdi
call   10c0 <strlen@plt>
mov    %eax,-0x114(%rbp)
lea    -0x108(%rbp),%rdi
xor    %esi,%esi
mov    $0x8,%edx
call   1100 <memset@plt>
lea    -0x108(%rbp),%rdi
lea    -0x190(%rbp),%rsi
mov    -0x114(%rbp),%edx
call   1190 <randomrack@plt>
lea    -0x5b0(%rbp),%rdi
lea    -0x1b0(%rbp),%rdx
lea    -0x108(%rbp),%rcx
lea    0x519(%rip),%rsi
mov    $0x0,%al
call   1220 <sprintf@plt>
mov    -0x5c8(%rbp),%eax
mov    %eax,-0xa6c(%rbp)
lea    -0x5b0(%rbp),%rax
mov    %rax,-0xa68(%rbp)
lea    -0x5b0(%rbp),%rdi
call   10c0 <strlen@plt>
mov    -0xa6c(%rbp),%edi
mov    -0xa68(%rbp),%rsi
mov    %eax,%edx
xor    %ecx,%ecx
call   10e0 <send@plt>
mov    -0x9fc(%rbp),%edi
call   10a0 <inet_ntoa@plt>
mov    %rax,%rsi
mov    -0x5c8(%rbp),%edx
sub    $0x3,%edx
mov    -0x114(%rbp),%ecx
lea    -0x108(%rbp),%r8
lea    0x411(%rip),%rdi
mov    $0x0,%al
call   10f0 <printf@plt>
lea    -0x9d0(%rbp),%rax
mov    %rax,-0xa78(%rbp)
lea    -0x9d0(%rbp),%rdi
call   10c0 <strlen@plt>
mov    -0xa78(%rbp),%rdi
mov    %eax,%edx
xor    %esi,%esi
call   1100 <memset@plt>
jmp    1d28 <main+0x9e8>
jmp    1d2d <main+0x9ed>
jmp    1d32 <main+0x9f2>
jmp    1d37 <main+0x9f7>
mov    -0x5c8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x5c8(%rbp)
jmp    14d0 <main+0x190>
jmp    149a <main+0x15a>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x9f8,%rsp
movb   $0x31,0xf(%rsp)
movups 0xd0f(%rip),%xmm0
movups %xmm0,0xec(%rsp)
movaps 0xcf4(%rip),%xmm0
movaps %xmm0,0xe0(%rsp)
movaps 0xcd5(%rip),%xmm0
movaps %xmm0,0xd0(%rsp)
movaps 0xcb6(%rip),%xmm0
movaps %xmm0,0xc0(%rsp)
movaps 0xc97(%rip),%xmm0
movaps %xmm0,0xb0(%rsp)
movaps 0xc78(%rip),%xmm0
movaps %xmm0,0xa0(%rsp)
movaps 0xc59(%rip),%xmm0
movaps %xmm0,0x90(%rsp)
lea    0xcb6(%rip),%rdi
call   1070 <opendict@plt>
xor    %edi,%edi
call   1150 <time@plt>
mov    %eax,%edi
call   1050 <srandom@plt>
lea    0x100(%rsp),%rsi
mov    $0xf,%edi
call   1030 <clearsqarray@plt>
movl   $0x1,0x34(%rsp)
mov    0x2bd6(%rip),%rax
mov    (%rax),%edi
mov    0x2bd5(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1250 <socket@plt>
mov    %eax,%ebx
mov    0x2be3(%rip),%rax
mov    (%rax),%esi
mov    0x2baa(%rip),%rax
mov    (%rax),%edx
lea    0x34(%rsp),%rcx
mov    %ebx,%edi
mov    $0x4,%r8d
call   1080 <setsockopt@plt>
mov    0x2bb7(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x5c(%rsp)
mov    $0xbb8,%edi
call   10d0 <htons@plt>
mov    %eax,0x58(%rsp)
mov    0x2b94(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x54(%rsp)
lea    0x50(%rsp),%rbp
mov    %rbp,%rdi
xor    %esi,%esi
mov    $0x1,%edx
call   1100 <memset@plt>
mov    %ebx,%edi
mov    %rbp,%rsi
mov    $0x10,%edx
call   11b0 <bind@plt>
mov    %ebx,%edi
mov    $0xa,%esi
call   1190 <listen@plt>
lea    0x10(%rsp),%r14
mov    %r14,%rdi
call   1160 <FD_ZERO@plt>
lea    0x20(%rsp),%r12
mov    %r12,%rdi
call   1160 <FD_ZERO@plt>
mov    %ebx,%edi
mov    %r14,%rsi
call   1230 <FD_SET@plt>
lea    0x24(%rsp),%r15
mov    %ebx,%r14d
mov    %ebx,0x14(%rsp)
nopl   0x0(%rax)
lea    0x1(%r14),%ebx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    0x10(%rsp),%eax
mov    %eax,0x20(%rsp)
mov    %ebx,%edi
mov    %r12,%rsi
xor    %edx,%edx
xor    %ecx,%ecx
xor    %r8d,%r8d
call   1170 <select@plt>
test   %r14d,%r14d
js     14c0 <main+0x190>
xor    %r13d,%r13d
jmp    1592 <main+0x262>
cs nopw 0x0(%rax,%rax,1)
movl   $0x10,0x24(%rsp)
mov    0x14(%rsp),%edi
lea    0x60(%rsp),%rsi
mov    %r15,%rdx
call   11d0 <accept@plt>
mov    %eax,%ebx
mov    %eax,%edi
lea    0x10(%rsp),%rsi
call   1230 <FD_SET@plt>
cmp    %r14d,%ebx
cmovg  %ebx,%r14d
mov    0x64(%rsp),%edi
call   10a0 <inet_ntoa@plt>
lea    0xb43(%rip),%rdi
mov    %rax,%rsi
mov    %ebx,%edx
xor    %eax,%eax
call   10f0 <printf@plt>
mov    %ebx,%edi
lea    0xf(%rsp),%rsi
mov    $0x1,%edx
xor    %ecx,%ecx
call   10e0 <send@plt>
addb   $0x1,0xf(%rsp)
lea    0x48(%rsp),%rbp
mov    %rbp,%rdi
lea    0x90(%rsp),%rsi
mov    $0x7,%edx
call   1180 <randomrack@plt>
mov    %rbp,%rdi
call   10c0 <strlen@plt>
mov    %ebx,%edi
mov    %rbp,%rsi
mov    %eax,%edx
xor    %ecx,%ecx
call   10e0 <send@plt>
lea    0x1(%r13),%eax
cmp    %r14d,%r13d
mov    %eax,%r13d
jge    14b0 <main+0x180>
mov    %r13d,%edi
mov    %r12,%rsi
call   1090 <FD_ISSET@plt>
test   %rax,%rax
je     1582 <main+0x252>
cmp    0x14(%rsp),%r13d
je     14f0 <main+0x1c0>
mov    %r14,0x18(%rsp)
mov    %r13d,%edi
lea    0x1f0(%rsp),%rsi
mov    $0x400,%edx
xor    %ecx,%ecx
call   1040 <recv@plt>
test   %eax,%eax
je     1709 <main+0x3d9>
js     18f7 <main+0x5c7>
mov    %eax,%r14d
mov    %r13d,%edi
lea    0x38(%rsp),%rsi
mov    %r15,%rdx
call   10b0 <getpeername@plt>
mov    0x1f0(%rsp),%al
add    $0x9d,%al
cmp    $0xf,%al
lea    0x1f0(%rsp),%r15
ja     160d <main+0x2dd>
movzbl %al,%eax
mov    $0xa001,%ecx
bt     %rax,%rcx
jb     162d <main+0x2fd>
mov    0x3c(%rsp),%edi
call   10a0 <inet_ntoa@plt>
lea    0xa97(%rip),%rdi
mov    %rax,%rsi
mov    %r13d,%edx
mov    %r15,%rcx
xor    %eax,%eax
call   10f0 <printf@plt>
mov    %r13d,%edi
lea    0xaa0(%rip),%rsi
mov    $0x4,%edx
xor    %ecx,%ecx
call   10e0 <send@plt>
mov    %r15,%rdi
lea    0xa8e(%rip),%rsi
call   1140 <strcmp@plt>
test   %rax,%rax
lea    0x70(%rsp),%r12
je     1a42 <main+0x712>
movsbl 0x1f0(%rsp),%eax
cmp    $0x72,%eax
je     1751 <main+0x421>
cmp    $0x70,%eax
je     17d5 <main+0x4a5>
cmp    $0x63,%eax
jne    1a1a <main+0x6ea>
mov    0x3c(%rsp),%edi
call   10a0 <inet_ntoa@plt>
lea    -0x3(%r13),%edx
lea    0xa46(%rip),%rdi
mov    %rax,%rsi
lea    0x1f1(%rsp),%rcx
xor    %eax,%eax
call   10f0 <printf@plt>
cmpl   $0x0,0x18(%rsp)
js     1a1a <main+0x6ea>
mov    0x18(%rsp),%rax
lea    0x1(%rax),%r12d
xor    %ebx,%ebx
jmp    16dc <main+0x3ac>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
add    $0x1,%ebx
cmp    %ebx,%r12d
je     1a1a <main+0x6ea>
mov    %ebx,%edi
lea    0x10(%rsp),%rsi
call   1090 <FD_ISSET@plt>
test   %rax,%rax
je     16d0 <main+0x3a0>
cmp    %ebx,0x14(%rsp)
je     16d0 <main+0x3a0>
cmp    %ebx,%r13d
je     16d0 <main+0x3a0>
mov    %ebx,%edi
mov    %r15,%rsi
mov    %r14d,%edx
xor    %ecx,%ecx
call   10e0 <send@plt>
jmp    16d0 <main+0x3a0>
lea    0x981(%rip),%rdi
mov    %r13d,%esi
xor    %eax,%eax
call   10f0 <printf@plt>
mov    0xf(%rsp),%al
mov    %eax,%ecx
and    $0xfd,%cl
add    $0xff,%al
cmp    $0x31,%cl
movzbl %al,%eax
mov    $0x31,%ecx
cmove  %ecx,%eax
mov    %al,0xf(%rsp)
mov    %r13d,%edi
call   1120 <close@plt>
mov    %r13d,%edi
lea    0x10(%rsp),%rsi
call   11f0 <FD_CLR@plt>
jmp    1a38 <main+0x708>
lea    0x1f1(%rsp),%rdi
call   11e0 <atoi@plt>
mov    %eax,%ebx
lea    0x48(%rsp),%r14
mov    %r14,%rdi
xor    %esi,%esi
mov    $0x8,%edx
call   1100 <memset@plt>
mov    %r14,%rdi
lea    0x90(%rsp),%rsi
mov    %ebx,%edx
call   1180 <randomrack@plt>
lea    0x5f0(%rsp),%rbp
mov    %rbp,%rdi
lea    0xa08(%rip),%rsi
mov    %r14,%rdx
xor    %eax,%eax
call   1210 <sprintf@plt>
mov    %rbp,%rdi
call   10c0 <strlen@plt>
mov    %r13d,%edi
mov    %rbp,%rsi
mov    %eax,%edx
xor    %ecx,%ecx
call   10e0 <send@plt>
mov    0x3c(%rsp),%edi
call   10a0 <inet_ntoa@plt>
lea    -0x3(%r13),%edx
lea    0x936(%rip),%rdi
mov    %rax,%rsi
jmp    1a0e <main+0x6de>
lea    0x2d(%rsp),%rbx
mov    %rbx,%rdi
lea    0x1f2(%rsp),%rsi
mov    $0x2,%edx
call   1060 <strncpy@plt>
movb   $0x0,0x2f(%rsp)
lea    0x2a(%rsp),%rbp
mov    %rbp,%rdi
lea    0x1f4(%rsp),%rsi
mov    $0x2,%edx
call   1060 <strncpy@plt>
movb   $0x0,0x2c(%rsp)
mov    %rbx,%rdi
call   11e0 <atoi@plt>
mov    %rbp,%rdi
mov    %eax,%ebp
call   11e0 <atoi@plt>
mov    %eax,%r14d
mov    %r12,%rdi
lea    0x1f6(%rsp),%rbx
mov    %rbx,%rsi
mov    $0x11,%edx
call   1060 <strncpy@plt>
mov    %rbx,%rdi
call   10c0 <strlen@plt>
cltq
movb   $0x0,0x70(%rsp,%rax,1)
mov    0x3c(%rsp),%edi
call   10a0 <inet_ntoa@plt>
lea    -0x3(%r13),%ebx
movsbl 0x1f1(%rsp),%ecx
mov    %r12,(%rsp)
lea    0x8c5(%rip),%rdi
mov    %rax,%rsi
mov    %ebx,%edx
mov    %ebp,%r8d
mov    %r14d,%r9d
xor    %eax,%eax
call   10f0 <printf@plt>
mov    %r12,%rdi
call   11a0 <searchdict@plt>
cmp    $0x1,%eax
jne    18cb <main+0x59b>
movsbl 0x1f1(%rsp),%eax
cmp    $0x64,%eax
je     1908 <main+0x5d8>
cmp    $0x61,%eax
jne    192d <main+0x5fd>
mov    %r12,%rdi
call   10c0 <strlen@plt>
mov    %ebp,%edi
mov    %r14d,%esi
mov    $0xf,%edx
lea    0x100(%rsp),%rcx
mov    %r12,%r8
mov    %eax,%r9d
call   1130 <strplc_a@plt>
jmp    192d <main+0x5fd>
mov    %r13d,%edi
lea    0x89d(%rip),%rsi
mov    $0x19,%edx
xor    %ecx,%ecx
call   10e0 <send@plt>
lea    0x8a2(%rip),%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   10f0 <printf@plt>
jmp    1a1a <main+0x6ea>
lea    0x7b1(%rip),%rdi
call   11c0 <perror@plt>
jmp    1a38 <main+0x708>
mov    %r12,%rdi
call   10c0 <strlen@plt>
mov    %ebp,%edi
mov    %r14d,%esi
mov    $0xf,%edx
lea    0x100(%rsp),%rcx
mov    %r12,%r8
mov    %eax,%r9d
call   1200 <strplc_d@plt>
mov    %ebx,0x30(%rsp)
mov    0x18(%rsp),%rax
test   %eax,%eax
js     1987 <main+0x657>
lea    0x1(%rax),%ebp
xor    %ebx,%ebx
jmp    1957 <main+0x627>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
add    $0x1,%ebx
cmp    %ebx,%ebp
je     1987 <main+0x657>
mov    %ebx,%edi
lea    0x10(%rsp),%rsi
call   1090 <FD_ISSET@plt>
test   %rax,%rax
je     1950 <main+0x620>
cmp    %ebx,0x14(%rsp)
je     1950 <main+0x620>
mov    %ebx,%edi
mov    %r15,%rsi
lea    0x100(%rsp),%rdx
mov    $0xf,%ecx
call   1110 <sendboard@plt>
jmp    1950 <main+0x620>
mov    $0x1,%edi
call   1240 <sleep@plt>
mov    %r12,%rdi
call   10c0 <strlen@plt>
mov    %eax,%ebx
lea    0x48(%rsp),%r14
mov    %r14,%rdi
xor    %esi,%esi
mov    $0x8,%edx
call   1100 <memset@plt>
mov    %r14,%rdi
lea    0x90(%rsp),%rsi
mov    %ebx,%edx
call   1180 <randomrack@plt>
lea    0x5f0(%rsp),%rbp
mov    %rbp,%rdi
lea    0x7ca(%rip),%rsi
mov    %r12,%rdx
mov    %r14,%rcx
xor    %eax,%eax
call   1210 <sprintf@plt>
mov    %rbp,%rdi
call   10c0 <strlen@plt>
mov    %r13d,%edi
mov    %rbp,%rsi
mov    %eax,%edx
xor    %ecx,%ecx
call   10e0 <send@plt>
mov    0x3c(%rsp),%edi
call   10a0 <inet_ntoa@plt>
lea    0x6fc(%rip),%rdi
mov    %rax,%rsi
mov    0x30(%rsp),%edx
mov    %ebx,%ecx
mov    %r14,%r8
xor    %eax,%eax
call   10f0 <printf@plt>
mov    %r15,%rdi
call   10c0 <strlen@plt>
mov    %r15,%rdi
xor    %esi,%esi
mov    %eax,%edx
call   1100 <memset@plt>
lea    0x20(%rsp),%r12
lea    0x24(%rsp),%r15
mov    0x18(%rsp),%r14
jmp    1582 <main+0x252>
xor    %edi,%edi
call   1220 <exit@plt>

LLVM IR (-O0):
%struct.sockaddr_in = type { i8, %struct.TYPE_2__, i32, i32 }
%struct.TYPE_2__ = type { i32 }
%struct.sockaddr = type { i32 }
@__const.main.bag = [27 x i32] [i32 9, i32 2, i32 2, i32 4, i32 12, i32 2, i32 3, i32 2, i32 9, i32 1, i32 1, i32 4, i32 2, i32 6, i32 8, i32 2, i32 1, i32 6, i32 4, i32 6, i32 4, i32 2, i32 2, i32 1, i32 2, i32 1, i32 2]
@.str = [5 x i8] c"dict\00"
@PF_INET = global i32 0
@SOCK_STREAM = global i32 0
@SOL_SOCKET = global i32 0
@SO_REUSEADDR = global i32 0
@AF_INET = global i32 0
@INADDR_ANY = global i32 0
@.str.1 = [32 x i8] c"Connection from: %s Socket: %i\0A\00"
@.str.2 = [30 x i8] c"Connection closed: socket %i\0A\00"
@.str.3 = [5 x i8] c"recv\00"
@.str.4 = [35 x i8] c"DATA From: %s Socket: %i Data: %s\0A\00"
@.str.5 = [4 x i8] c"ACK\00"
@.str.6 = [2 x i8] c"q\00"
@.str.7 = [38 x i8] c"CHAT From: %s Player: %i Message: %s\0A\00"
@.str.8 = [4 x i8] c"r%s\00"
@.str.9 = [49 x i8] c"RACK From: %s Player: %i Number: %i Letters: %s\0A\00"
@.str.10 = [62 x i8] c"PLACE From: %s Player: %i Direction: %c X: %i Y: %i Word: %s\0A\00"
@.str.11 = [24 x i8] c"c*** Word not found ***\00"
@.str.12 = [19 x i8] c"DICT %s not found\0A\00"
@.str.13 = [7 x i8] c"d%sr%s\00"
define i32 @main(i32 %0, i8** %1) {
%3 = alloca i32
%4 = alloca i32
%5 = alloca i8**
%6 = alloca [2 x i32]
%7 = alloca i8
%8 = alloca [15 x [15 x i8]]
%9 = alloca [8 x i8]
%10 = alloca i32
%11 = alloca i32
%12 = alloca i32
%13 = alloca [3 x i8]
%14 = alloca [3 x i8]
%15 = alloca [27 x i32]
%16 = alloca i8**
%17 = alloca [17 x i8]
%18 = alloca [1024 x i8]
%19 = alloca i32
%20 = alloca i32
%21 = alloca i32
%22 = alloca i32
%23 = alloca i32
%24 = alloca i32
%25 = alloca i32
%26 = alloca [1024 x i8]
%27 = alloca %struct.sockaddr_in
%28 = alloca %struct.sockaddr_in
%29 = alloca %struct.sockaddr_in
%30 = alloca i32
%31 = alloca i32
%32 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
store i8 49, i8* %7
%33 = bitcast [27 x i32]* %15 to i8*
%34 = call i8** @opendict(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
store i8** %34, i8*** %16
%35 = call i32 @time(i32* null)
%36 = call i32 @srandom(i32 %35)
%37 = getelementptr inbounds [15 x [15 x i8]], [15 x [15 x i8]]* %8, i64 0, i64 0
%38 = bitcast [15 x i8]* %37 to i8**
%39 = call i32 @clearsqarray(i32 15, i8** %38)
store i32 1, i32* %32
%40 = load i32, i32* @PF_INET
%41 = load i32, i32* @SOCK_STREAM
%42 = call i32 @socket(i32 %40, i32 %41, i32 0)
store i32 %42, i32* %19
%43 = load i32, i32* %19
%44 = load i32, i32* @SOL_SOCKET
%45 = load i32, i32* @SO_REUSEADDR
%46 = call i32 @setsockopt(i32 %43, i32 %44, i32 %45, i32* %32, i32 4)
%47 = load i32, i32* @AF_INET
%48 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %27, i32 0, i32 3
store i32 %47, i32* %48
%49 = call i32 @htons(i32 3000)
%50 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %27, i32 0, i32 2
store i32 %49, i32* %50
%51 = load i32, i32* @INADDR_ANY
%52 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %27, i32 0, i32 1
%53 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %52, i32 0, i32 0
store i32 %51, i32* %53
%54 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %27, i32 0, i32 0
%55 = call i32 @memset(i8* %54, i8 signext 0, i32 1)
%56 = load i32, i32* %19
%57 = bitcast %struct.sockaddr_in* %27 to %struct.sockaddr*
%58 = call i32 @bind(i32 %56, %struct.sockaddr* %57, i32 16)
%59 = load i32, i32* %19
%60 = call i32 @listen(i32 %59, i32 10)
%61 = call i32 @FD_ZERO(i32* %30)
%62 = call i32 @FD_ZERO(i32* %31)
%63 = load i32, i32* %19
%64 = call i32 @FD_SET(i32 %63, i32* %30)
%65 = load i32, i32* %19
store i32 %65, i32* %22
br label %66
66: ; preds = %384, %2
%67 = load i32, i32* %30
store i32 %67, i32* %31
%68 = load i32, i32* %22
%69 = add nsw i32 %68, 1
%70 = call i32 @select(i32 %69, i32* %31, i32* null, i32* null, i32* null)
store i32 0, i32* %24
br label %71
71: ; preds = %381, %66
%72 = load i32, i32* %24
%73 = load i32, i32* %22
%74 = icmp sle i32 %72, %73
br i1 %74, label %75, label %384
75: ; preds = %71
%76 = load i32, i32* %24
%77 = call i64 @FD_ISSET(i32 %76, i32* %31)
%78 = icmp ne i64 %77, 0
br i1 %78, label %79, label %380
79: ; preds = %75
%80 = load i32, i32* %24
%81 = load i32, i32* %19
%82 = icmp eq i32 %80, %81
br i1 %82, label %83, label %122
83: ; preds = %79
store i32 16, i32* %21
%84 = load i32, i32* %19
%85 = bitcast %struct.sockaddr_in* %28 to %struct.sockaddr*
%86 = call i32 @accept(i32 %84, %struct.sockaddr* %85, i32* %21)
store i32 %86, i32* %20
%87 = load i32, i32* %20
%88 = call i32 @FD_SET(i32 %87, i32* %30)
%89 = load i32, i32* %20
%90 = load i32, i32* %22
%91 = icmp sgt i32 %89, %90
br i1 %91, label %92, label %94
92: ; preds = %83
%93 = load i32, i32* %20
store i32 %93, i32* %22
br label %94
94: ; preds = %92, %83
%95 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %28, i32 0, i32 1
%96 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %95, i32 0, i32 0
%97 = load i32, i32* %96
%98 = call i8* @inet_ntoa(i32 %97)
%99 = load i32, i32* %20
%100 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), i8* %98, i32 %99)
%101 = call i32 @atoi(i8* %7)
%102 = icmp slt i32 %101, 2
br i1 %102, label %103, label %109
103: ; preds = %94
%104 = load i32, i32* %20
%105 = call i32 @atoi(i8* %7)
%106 = sub nsw i32 %105, 1
%107 = sext i32 %106 to i64
%108 = getelementptr inbounds [2 x i32], [2 x i32]* %6, i64 0, i64 %107
store i32 %104, i32* %108
br label %109
109: ; preds = %103, %94
%110 = load i32, i32* %20
%111 = call i32 @send(i32 %110, i8* %7, i32 1, i32 0)
%112 = load i8, i8* %7
%113 = add i8 %112, 1
store i8 %113, i8* %7
%114 = getelementptr inbounds [8 x i8], [8 x i8]* %9, i64 0, i64 0
%115 = getelementptr inbounds [27 x i32], [27 x i32]* %15, i64 0, i64 0
%116 = call i32 @randomrack(i8* %114, i32* %115, i32 7)
%117 = load i32, i32* %20
%118 = getelementptr inbounds [8 x i8], [8 x i8]* %9, i64 0, i64 0
%119 = getelementptr inbounds [8 x i8], [8 x i8]* %9, i64 0, i64 0
%120 = call i32 @strlen(i8* %119)
%121 = call i32 @send(i32 %117, i8* %118, i32 %120, i32 0)
br label %379
122: ; preds = %79
%123 = load i32, i32* %24
%124 = getelementptr inbounds [1024 x i8], [1024 x i8]* %26, i64 0, i64 0
%125 = call i32 @recv(i32 %123, i8* %124, i32 1024, i32 0)
store i32 %125, i32* %23
%126 = icmp eq i32 %125, 0
br i1 %126, label %127, label %146
127: ; preds = %122
%128 = load i32, i32* %24
%129 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0), i32 %128)
%130 = load i8, i8* %7
%131 = sext i8 %130 to i32
%132 = icmp eq i32 %131, 51
br i1 %132, label %137, label %133
133: ; preds = %127
%134 = load i8, i8* %7
%135 = sext i8 %134 to i32
%136 = icmp eq i32 %135, 49
br i1 %136, label %137, label %138
137: ; preds = %133, %127
store i8 49, i8* %7
br label %141
138: ; preds = %133
%139 = load i8, i8* %7
%140 = add i8 %139, -1
store i8 %140, i8* %7
br label %141
141: ; preds = %138, %137
%142 = load i32, i32* %24
%143 = call i32 @close(i32 %142)
%144 = load i32, i32* %24
%145 = call i32 @FD_CLR(i32 %144, i32* %30)
br label %378
146: ; preds = %122
%147 = load i32, i32* %23
%148 = icmp slt i32 %147, 0
br i1 %148, label %149, label %151
149: ; preds = %146
%150 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
br label %377
151: ; preds = %146
%152 = load i32, i32* %24
%153 = bitcast %struct.sockaddr_in* %29 to %struct.sockaddr*
%154 = call i32 @getpeername(i32 %152, %struct.sockaddr* %153, i32* %21)
%155 = getelementptr inbounds [1024 x i8], [1024 x i8]* %26, i64 0, i64 0
%156 = load i8, i8* %155
%157 = sext i8 %156 to i32
%158 = icmp ne i32 %157, 99
br i1 %158, label %159, label %177
159: ; preds = %151
%160 = getelementptr inbounds [1024 x i8], [1024 x i8]* %26, i64 0, i64 0
%161 = load i8, i8* %160
%162 = sext i8 %161 to i32
%163 = icmp ne i32 %162, 114
br i1 %163, label %164, label %177
164: ; preds = %159
%165 = getelementptr inbounds [1024 x i8], [1024 x i8]* %26, i64 0, i64 0
%166 = load i8, i8* %165
%167 = sext i8 %166 to i32
%168 = icmp ne i32 %167, 112
br i1 %168, label %169, label %177
169: ; preds = %164
%170 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %29, i32 0, i32 1
%171 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %170, i32 0, i32 0
%172 = load i32, i32* %171
%173 = call i8* @inet_ntoa(i32 %172)
%174 = load i32, i32* %24
%175 = getelementptr inbounds [1024 x i8], [1024 x i8]* %26, i64 0, i64 0
%176 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.4, i64 0, i64 0), i8* %173, i32 %174, i8* %175)
br label %177
177: ; preds = %169, %164, %159, %151
%178 = load i32, i32* %24
%179 = call i32 @send(i32 %178, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i32 4, i32 0)
%180 = getelementptr inbounds [1024 x i8], [1024 x i8]* %26, i64 0, i64 0
%181 = call i64 @strcmp(i8* %180, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
%182 = icmp eq i64 %181, 0
br i1 %182, label %183, label %185
183: ; preds = %177
%184 = call i32 @exit(i32 0)
unreachable
185: ; preds = %177
%186 = getelementptr inbounds [1024 x i8], [1024 x i8]* %26, i64 0, i64 0
%187 = load i8, i8* %186
%188 = sext i8 %187 to i32
switch i32 %188, label %372 [
i32 99, label %189
i32 114, label %226
i32 112, label %253
]
189: ; preds = %185
%190 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %29, i32 0, i32 1
%191 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %190, i32 0, i32 0
%192 = load i32, i32* %191
%193 = call i8* @inet_ntoa(i32 %192)
%194 = load i32, i32* %24
%195 = sub nsw i32 %194, 3
%196 = getelementptr inbounds [1024 x i8], [1024 x i8]* %26, i64 0, i64 0
%197 = getelementptr inbounds i8, i8* %196, i64 1
%198 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.7, i64 0, i64 0), i8* %193, i32 %195, i8* %197)
store i32 0, i32* %25
br label %199
199: ; preds = %222, %189
%200 = load i32, i32* %25
%201 = load i32, i32* %22
%202 = icmp sle i32 %200, %201
br i1 %202, label %203, label %225
203: ; preds = %199
%204 = load i32, i32* %25
%205 = call i64 @FD_ISSET(i32 %204, i32* %30)
%206 = icmp ne i64 %205, 0
br i1 %206, label %207, label %221
207: ; preds = %203
%208 = load i32, i32* %25
%209 = load i32, i32* %19
%210 = icmp ne i32 %208, %209
br i1 %210, label %211, label %220
211: ; preds = %207
%212 = load i32, i32* %25
%213 = load i32, i32* %24
%214 = icmp ne i32 %212, %213
br i1 %214, label %215, label %220
215: ; preds = %211
%216 = load i32, i32* %25
%217 = getelementptr inbounds [1024 x i8], [1024 x i8]* %26, i64 0, i64 0
%218 = load i32, i32* %23
%219 = call i32 @send(i32 %216, i8* %217, i32 %218, i32 0)
br label %220
220: ; preds = %215, %211, %207
br label %221
221: ; preds = %220, %203
br label %222
222: ; preds = %221
%223 = load i32, i32* %25
%224 = add nsw i32 %223, 1
store i32 %224, i32* %25
br label %199
225: ; preds = %199
br label %372
226: ; preds = %185
%227 = getelementptr inbounds [1024 x i8], [1024 x i8]* %26, i64 0, i64 0
%228 = getelementptr inbounds i8, i8* %227, i64 1
%229 = call i32 @atoi(i8* %228)
store i32 %229, i32* %12
%230 = getelementptr inbounds [8 x i8], [8 x i8]* %9, i64 0, i64 0
%231 = call i32 @memset(i8* %230, i8 signext 0, i32 8)
%232 = getelementptr inbounds [8 x i8], [8 x i8]* %9, i64 0, i64 0
%233 = getelementptr inbounds [27 x i32], [27 x i32]* %15, i64 0, i64 0
%234 = load i32, i32* %12
%235 = call i32 @randomrack(i8* %232, i32* %233, i32 %234)
%236 = getelementptr inbounds [1024 x i8], [1024 x i8]* %18, i64 0, i64 0
%237 = getelementptr inbounds [8 x i8], [8 x i8]* %9, i64 0, i64 0
%238 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %236, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0), i8* %237)
%239 = load i32, i32* %24
%240 = getelementptr inbounds [1024 x i8], [1024 x i8]* %18, i64 0, i64 0
%241 = getelementptr inbounds [1024 x i8], [1024 x i8]* %18, i64 0, i64 0
%242 = call i32 @strlen(i8* %241)
%243 = call i32 @send(i32 %239, i8* %240, i32 %242, i32 0)
%244 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %29, i32 0, i32 1
%245 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %244, i32 0, i32 0
%246 = load i32, i32* %245
%247 = call i8* @inet_ntoa(i32 %246)
%248 = load i32, i32* %24
%249 = sub nsw i32 %248, 3
%250 = load i32, i32* %12
%251 = getelementptr inbounds [8 x i8], [8 x i8]* %9, i64 0, i64 0
%252 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.9, i64 0, i64 0), i8* %247, i32 %249, i32 %250, i8* %251)
br label %372
253: ; preds = %185
%254 = getelementptr inbounds [3 x i8], [3 x i8]* %13, i64 0, i64 0
%255 = getelementptr inbounds [1024 x i8], [1024 x i8]* %26, i64 0, i64 0
%256 = getelementptr inbounds i8, i8* %255, i64 2
%257 = call i32 @strncpy(i8* %254, i8* %256, i32 2)
%258 = getelementptr inbounds [3 x i8], [3 x i8]* %13, i64 0, i64 2
store i8 0, i8* %258
%259 = getelementptr inbounds [3 x i8], [3 x i8]* %14, i64 0, i64 0
%260 = getelementptr inbounds [1024 x i8], [1024 x i8]* %26, i64 0, i64 0
%261 = getelementptr inbounds i8, i8* %260, i64 4
%262 = call i32 @strncpy(i8* %259, i8* %261, i32 2)
%263 = getelementptr inbounds [3 x i8], [3 x i8]* %14, i64 0, i64 2
store i8 0, i8* %263
%264 = getelementptr inbounds [3 x i8], [3 x i8]* %13, i64 0, i64 0
%265 = call i32 @atoi(i8* %264)
store i32 %265, i32* %10
%266 = getelementptr inbounds [3 x i8], [3 x i8]* %14, i64 0, i64 0
%267 = call i32 @atoi(i8* %266)
store i32 %267, i32* %11
%268 = getelementptr inbounds [17 x i8], [17 x i8]* %17, i64 0, i64 0
%269 = getelementptr inbounds [1024 x i8], [1024 x i8]* %26, i64 0, i64 0
%270 = getelementptr inbounds i8, i8* %269, i64 6
%271 = call i32 @strncpy(i8* %268, i8* %270, i32 17)
%272 = getelementptr inbounds [1024 x i8], [1024 x i8]* %26, i64 0, i64 0
%273 = getelementptr inbounds i8, i8* %272, i64 6
%274 = call i32 @strlen(i8* %273)
%275 = sext i32 %274 to i64
%276 = getelementptr inbounds [17 x i8], [17 x i8]* %17, i64 0, i64 %275
store i8 0, i8* %276
%277 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %29, i32 0, i32 1
%278 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %277, i32 0, i32 0
%279 = load i32, i32* %278
%280 = call i8* @inet_ntoa(i32 %279)
%281 = load i32, i32* %24
%282 = sub nsw i32 %281, 3
%283 = getelementptr inbounds [1024 x i8], [1024 x i8]* %26, i64 0, i64 1
%284 = load i8, i8* %283
%285 = sext i8 %284 to i32
%286 = load i32, i32* %10
%287 = load i32, i32* %11
%288 = getelementptr inbounds [17 x i8], [17 x i8]* %17, i64 0, i64 0
%289 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([62 x i8], [62 x i8]* @.str.10, i64 0, i64 0), i8* %280, i32 %282, i32 %285, i32 %286, i32 %287, i8* %288)
%290 = getelementptr inbounds [17 x i8], [17 x i8]* %17, i64 0, i64 0
%291 = call i32 @searchdict(i8* %290)
%292 = icmp ne i32 %291, 1
br i1 %292, label %293, label %298
293: ; preds = %253
%294 = load i32, i32* %24
%295 = call i32 @send(i32 %294, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.11, i64 0, i64 0), i32 25, i32 0)
%296 = getelementptr inbounds [17 x i8], [17 x i8]* %17, i64 0, i64 0
%297 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.12, i64 0, i64 0), i8* %296)
br label %372
298: ; preds = %253
%299 = getelementptr inbounds [1024 x i8], [1024 x i8]* %26, i64 0, i64 1
%300 = load i8, i8* %299
%301 = sext i8 %300 to i32
switch i32 %301, label %320 [
i32 97, label %302
i32 100, label %311
]
302: ; preds = %298
%303 = load i32, i32* %10
%304 = load i32, i32* %11
%305 = getelementptr inbounds [15 x [15 x i8]], [15 x [15 x i8]]* %8, i64 0, i64 0
%306 = bitcast [15 x i8]* %305 to i8**
%307 = getelementptr inbounds [17 x i8], [17 x i8]* %17, i64 0, i64 0
%308 = getelementptr inbounds [17 x i8], [17 x i8]* %17, i64 0, i64 0
%309 = call i32 @strlen(i8* %308)
%310 = call i32 @strplc_a(i32 %303, i32 %304, i32 15, i8** %306, i8* %307, i32 %309)
br label %320
311: ; preds = %298
%312 = load i32, i32* %10
%313 = load i32, i32* %11
%314 = getelementptr inbounds [15 x [15 x i8]], [15 x [15 x i8]]* %8, i64 0, i64 0
%315 = bitcast [15 x i8]* %314 to i8**
%316 = getelementptr inbounds [17 x i8], [17 x i8]* %17, i64 0, i64 0
%317 = getelementptr inbounds [17 x i8], [17 x i8]* %17, i64 0, i64 0
%318 = call i32 @strlen(i8* %317)
%319 = call i32 @strplc_d(i32 %312, i32 %313, i32 15, i8** %315, i8* %316, i32 %318)
br label %320
320: ; preds = %298, %311, %302
store i32 0, i32* %25
br label %321
321: ; preds = %341, %320
%322 = load i32, i32* %25
%323 = load i32, i32* %22
%324 = icmp sle i32 %322, %323
br i1 %324, label %325, label %344
325: ; preds = %321
%326 = load i32, i32* %25
%327 = call i64 @FD_ISSET(i32 %326, i32* %30)
%328 = icmp ne i64 %327, 0
br i1 %328, label %329, label %340
329: ; preds = %325
%330 = load i32, i32* %25
%331 = load i32, i32* %19
%332 = icmp ne i32 %330, %331
br i1 %332, label %333, label %339
333: ; preds = %329
%334 = load i32, i32* %25
%335 = getelementptr inbounds [1024 x i8], [1024 x i8]* %26, i64 0, i64 0
%336 = getelementptr inbounds [15 x [15 x i8]], [15 x [15 x i8]]* %8, i64 0, i64 0
%337 = getelementptr inbounds [15 x i8], [15 x i8]* %336, i64 0, i64 0
%338 = call i32 @sendboard(i32 %334, i8* %335, i8* %337, i32 15)
br label %339
339: ; preds = %333, %329
br label %340
340: ; preds = %339, %325
br label %341
341: ; preds = %340
%342 = load i32, i32* %25
%343 = add nsw i32 %342, 1
store i32 %343, i32* %25
br label %321
344: ; preds = %321
%345 = call i32 @sleep(i32 1)
%346 = getelementptr inbounds [17 x i8], [17 x i8]* %17, i64 0, i64 0
%347 = call i32 @strlen(i8* %346)
store i32 %347, i32* %12
%348 = getelementptr inbounds [8 x i8], [8 x i8]* %9, i64 0, i64 0
%349 = call i32 @memset(i8* %348, i8 signext 0, i32 8)
%350 = getelementptr inbounds [8 x i8], [8 x i8]* %9, i64 0, i64 0
%351 = getelementptr inbounds [27 x i32], [27 x i32]* %15, i64 0, i64 0
%352 = load i32, i32* %12
%353 = call i32 @randomrack(i8* %350, i32* %351, i32 %352)
%354 = getelementptr inbounds [1024 x i8], [1024 x i8]* %18, i64 0, i64 0
%355 = getelementptr inbounds [17 x i8], [17 x i8]* %17, i64 0, i64 0
%356 = getelementptr inbounds [8 x i8], [8 x i8]* %9, i64 0, i64 0
%357 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %354, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.13, i64 0, i64 0), i8* %355, i8* %356)
%358 = load i32, i32* %24
%359 = getelementptr inbounds [1024 x i8], [1024 x i8]* %18, i64 0, i64 0
%360 = getelementptr inbounds [1024 x i8], [1024 x i8]* %18, i64 0, i64 0
%361 = call i32 @strlen(i8* %360)
%362 = call i32 @send(i32 %358, i8* %359, i32 %361, i32 0)
%363 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %29, i32 0, i32 1
%364 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %363, i32 0, i32 0
%365 = load i32, i32* %364
%366 = call i8* @inet_ntoa(i32 %365)
%367 = load i32, i32* %24
%368 = sub nsw i32 %367, 3
%369 = load i32, i32* %12
%370 = getelementptr inbounds [8 x i8], [8 x i8]* %9, i64 0, i64 0
%371 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([49 x i8], [49 x i8]* @.str.9, i64 0, i64 0), i8* %366, i32 %368, i32 %369, i8* %370)
br label %372
372: ; preds = %185, %344, %293, %226, %225
%373 = getelementptr inbounds [1024 x i8], [1024 x i8]* %26, i64 0, i64 0
%374 = getelementptr inbounds [1024 x i8], [1024 x i8]* %26, i64 0, i64 0
%375 = call i32 @strlen(i8* %374)
%376 = call i32 @memset(i8* %373, i8 signext 0, i32 %375)
br label %377
377: ; preds = %372, %149
br label %378
378: ; preds = %377, %141
br label %379
379: ; preds = %378, %109
br label %380
380: ; preds = %379, %75
br label %381
381: ; preds = %380
%382 = load i32, i32* %24
%383 = add nsw i32 %382, 1
store i32 %383, i32* %24
br label %71
384: ; preds = %71
br label %66
}

LLVM IR (-O2):
%struct.sockaddr_in = type { i8, %struct.TYPE_2__, i32, i32 }
%struct.TYPE_2__ = type { i32 }
%struct.sockaddr = type { i32 }
@__const.main.bag = [27 x i32] [i32 9, i32 2, i32 2, i32 4, i32 12, i32 2, i32 3, i32 2, i32 9, i32 1, i32 1, i32 4, i32 2, i32 6, i32 8, i32 2, i32 1, i32 6, i32 4, i32 6, i32 4, i32 2, i32 2, i32 1, i32 2, i32 1, i32 2]
@.str = [5 x i8] c"dict\00"
@PF_INET = global i32 0
@SOCK_STREAM = global i32 0
@SOL_SOCKET = global i32 0
@SO_REUSEADDR = global i32 0
@AF_INET = global i32 0
@INADDR_ANY = global i32 0
@.str.1 = [32 x i8] c"Connection from: %s Socket: %i\0A\00"
@.str.2 = [30 x i8] c"Connection closed: socket %i\0A\00"
@.str.3 = [5 x i8] c"recv\00"
@.str.4 = [35 x i8] c"DATA From: %s Socket: %i Data: %s\0A\00"
@.str.5 = [4 x i8] c"ACK\00"
@.str.6 = [2 x i8] c"q\00"
@.str.7 = [38 x i8] c"CHAT From: %s Player: %i Message: %s\0A\00"
@.str.8 = [4 x i8] c"r%s\00"
@.str.9 = [49 x i8] c"RACK From: %s Player: %i Number: %i Letters: %s\0A\00"
@.str.10 = [62 x i8] c"PLACE From: %s Player: %i Direction: %c X: %i Y: %i Word: %s\0A\00"
@.str.11 = [24 x i8] c"c*** Word not found ***\00"
@.str.12 = [19 x i8] c"DICT %s not found\0A\00"
@.str.13 = [7 x i8] c"d%sr%s\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca i8
%4 = alloca [15 x [15 x i8]]
%5 = alloca [8 x i8]
%6 = alloca [3 x i8]
%7 = alloca [3 x i8]
%8 = alloca [27 x i32]
%9 = alloca [17 x i8]
%10 = alloca [1024 x i8]
%11 = alloca i32
%12 = alloca [1024 x i8]
%13 = alloca %struct.sockaddr_in
%14 = alloca %struct.sockaddr_in
%15 = alloca %struct.sockaddr_in
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
store i8 49, i8* %3
%19 = getelementptr inbounds [15 x [15 x i8]], [15 x [15 x i8]]* %4, i64 0, i64 0, i64 0
%20 = getelementptr inbounds [8 x i8], [8 x i8]* %5, i64 0, i64 0
%21 = getelementptr inbounds [3 x i8], [3 x i8]* %6, i64 0, i64 0
%22 = getelementptr inbounds [3 x i8], [3 x i8]* %7, i64 0, i64 0
%23 = bitcast [27 x i32]* %8 to i8*
%24 = getelementptr inbounds [17 x i8], [17 x i8]* %9, i64 0, i64 0
%25 = getelementptr inbounds [1024 x i8], [1024 x i8]* %10, i64 0, i64 0
%26 = tail call i8** @opendict(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0))
%27 = tail call i32 @time(i32* null)
%28 = tail call i32 @srandom(i32 %27)
%29 = bitcast [15 x [15 x i8]]* %4 to i8**
%30 = call i32 @clearsqarray(i32 15, i8** %29)
%31 = bitcast i32* %11 to i8*
%32 = getelementptr inbounds [1024 x i8], [1024 x i8]* %12, i64 0, i64 0
%33 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %13, i64 0, i32 0
%34 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %14, i64 0, i32 0
%35 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %15, i64 0, i32 0
%36 = bitcast i32* %16 to i8*
%37 = bitcast i32* %17 to i8*
%38 = bitcast i32* %18 to i8*
store i32 1, i32* %18
%39 = load i32, i32* @PF_INET
%40 = load i32, i32* @SOCK_STREAM
%41 = call i32 @socket(i32 %39, i32 %40, i32 0)
%42 = load i32, i32* @SOL_SOCKET
%43 = load i32, i32* @SO_REUSEADDR
%44 = call i32 @setsockopt(i32 %41, i32 %42, i32 %43, i32* %18, i32 4)
%45 = load i32, i32* @AF_INET
%46 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %13, i64 0, i32 3
store i32 %45, i32* %46
%47 = call i32 @htons(i32 3000)
%48 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %13, i64 0, i32 2
store i32 %47, i32* %48
%49 = load i32, i32* @INADDR_ANY
%50 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %13, i64 0, i32 1, i32 0
store i32 %49, i32* %50
%51 = call i32 @memset(i8* %33, i8 signext 0, i32 1)
%52 = bitcast %struct.sockaddr_in* %13 to %struct.sockaddr*
%53 = call i32 @bind(i32 %41, %struct.sockaddr* %52, i32 16)
%54 = call i32 @listen(i32 %41, i32 10)
%55 = call i32 @FD_ZERO(i32* %16)
%56 = call i32 @FD_ZERO(i32* %17)
%57 = call i32 @FD_SET(i32 %41, i32* %16)
%58 = bitcast %struct.sockaddr_in* %15 to %struct.sockaddr*
%59 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %15, i64 0, i32 1, i32 0
%60 = getelementptr inbounds [1024 x i8], [1024 x i8]* %12, i64 0, i64 2
%61 = getelementptr inbounds [3 x i8], [3 x i8]* %6, i64 0, i64 2
%62 = getelementptr inbounds [1024 x i8], [1024 x i8]* %12, i64 0, i64 4
%63 = getelementptr inbounds [3 x i8], [3 x i8]* %7, i64 0, i64 2
%64 = getelementptr inbounds [1024 x i8], [1024 x i8]* %12, i64 0, i64 6
%65 = getelementptr inbounds [1024 x i8], [1024 x i8]* %12, i64 0, i64 1
%66 = getelementptr inbounds [27 x i32], [27 x i32]* %8, i64 0, i64 0
%67 = bitcast %struct.sockaddr_in* %14 to %struct.sockaddr*
%68 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %14, i64 0, i32 1, i32 0
br label %69
69: ; preds = %215, %2
%70 = phi i32 [ %41, %2 ], [ %216, %215 ]
%71 = add nsw i32 %70, 1
%72 = icmp slt i32 %70, 0
br label %73
73: ; preds = %69, %73
%74 = load i32, i32* %16
store i32 %74, i32* %17
%75 = call i32 @select(i32 %71, i32* %17, i32* null, i32* null, i32* null)
br i1 %72, label %73, label %76
76: ; preds = %73, %215
%77 = phi i32 [ %217, %215 ], [ 0, %73 ]
%78 = phi i32 [ %216, %215 ], [ %70, %73 ]
%79 = call i64 @FD_ISSET(i32 %77, i32* %17)
%80 = icmp eq i64 %79, 0
br i1 %80, label %215, label %81
81: ; preds = %76
%82 = icmp eq i32 %77, %41
br i1 %82, label %83, label %97
83: ; preds = %81
store i32 16, i32* %11
%84 = call i32 @accept(i32 %41, %struct.sockaddr* %67, i32* %11)
%85 = call i32 @FD_SET(i32 %84, i32* %16)
%86 = icmp sgt i32 %84, %78
%87 = select i1 %86, i32 %84, i32 %78
%88 = load i32, i32* %68
%89 = call i8* @inet_ntoa(i32 %88)
%90 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0), i8* %89, i32 %84)
%91 = call i32 @send(i32 %84, i8* %3, i32 1, i32 0)
%92 = load i8, i8* %3
%93 = add i8 %92, 1
store i8 %93, i8* %3
%94 = call i32 @randomrack(i8* %20, i32* %66, i32 7)
%95 = call i32 @strlen(i8* %20)
%96 = call i32 @send(i32 %84, i8* %20, i32 %95, i32 0)
br label %215
97: ; preds = %81
%98 = call i32 @recv(i32 %77, i8* %32, i32 1024, i32 0)
%99 = icmp eq i32 %98, 0
br i1 %99, label %100, label %109
100: ; preds = %97
%101 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.2, i64 0, i64 0), i32 %77)
%102 = load i8, i8* %3
%103 = and i8 %102, -3
%104 = icmp eq i8 %103, 49
%105 = add i8 %102, -1
%106 = select i1 %104, i8 49, i8 %105
store i8 %106, i8* %3
%107 = call i32 @close(i32 %77)
%108 = call i32 @FD_CLR(i32 %77, i32* %16)
br label %215
109: ; preds = %97
%110 = icmp slt i32 %98, 0
br i1 %110, label %111, label %113
111: ; preds = %109
%112 = call i32 @perror(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
br label %215
113: ; preds = %109
%114 = call i32 @getpeername(i32 %77, %struct.sockaddr* %58, i32* %11)
%115 = load i8, i8* %32
switch i8 %115, label %116 [
i8 114, label %120
i8 112, label %120
i8 99, label %120
]
116: ; preds = %113
%117 = load i32, i32* %59
%118 = call i8* @inet_ntoa(i32 %117)
%119 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.4, i64 0, i64 0), i8* %118, i32 %77, i8* %32)
br label %120
120: ; preds = %113, %113, %113, %116
%121 = call i32 @send(i32 %77, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i32 4, i32 0)
%122 = call i64 @strcmp(i8* %32, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
%123 = icmp eq i64 %122, 0
br i1 %123, label %124, label %126
124: ; preds = %120
%125 = call i32 @exit(i32 0)
unreachable
126: ; preds = %120
%127 = load i8, i8* %32
%128 = sext i8 %127 to i32
switch i32 %128, label %212 [
i32 99, label %129
i32 114, label %148
i32 112, label %159
]
129: ; preds = %126
%130 = load i32, i32* %59
%131 = call i8* @inet_ntoa(i32 %130)
%132 = add nsw i32 %77, -3
%133 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.7, i64 0, i64 0), i8* %131, i32 %132, i8* %65)
%134 = icmp slt i32 %78, 0
br i1 %134, label %212, label %135
135: ; preds = %129, %145
%136 = phi i32 [ %146, %145 ], [ 0, %129 ]
%137 = call i64 @FD_ISSET(i32 %136, i32* %16)
%138 = icmp eq i64 %137, 0
%139 = icmp eq i32 %136, %41
%140 = or i1 %138, %139
%141 = icmp eq i32 %136, %77
%142 = or i1 %140, %141
br i1 %142, label %145, label %143
143: ; preds = %135
%144 = call i32 @send(i32 %136, i8* %32, i32 %98, i32 0)
br label %145
145: ; preds = %135, %143
%146 = add nuw i32 %136, 1
%147 = icmp eq i32 %136, %78
br i1 %147, label %212, label %135
148: ; preds = %126
%149 = call i32 @atoi(i8* %65)
%150 = call i32 @memset(i8* %20, i8 signext 0, i32 8)
%151 = call i32 @randomrack(i8* %20, i32* %66, i32 %149)
%152 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %25, i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.8, i64 0, i64 0), i8* %20)
%153 = call i32 @strlen(i8* %25)
%154 = call i32 @send(i32 %77, i8* %25, i32 %153, i32 0)
%155 = load i32, i32* %59
%156 = call i8* @inet_ntoa(i32 %155)
%157 = add nsw i32 %77, -3
%158 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @.str.9, i64 0, i64 0), i8* %156, i32 %157, i32 %149, i8* %20)
br label %212
159: ; preds = %126
%160 = call i32 @strncpy(i8* %21, i8* %60, i32 2)
store i8 0, i8* %61
%161 = call i32 @strncpy(i8* %22, i8* %62, i32 2)
store i8 0, i8* %63
%162 = call i32 @atoi(i8* %21)
%163 = call i32 @atoi(i8* %22)
%164 = call i32 @strncpy(i8* %24, i8* %64, i32 17)
%165 = call i32 @strlen(i8* %64)
%166 = sext i32 %165 to i64
%167 = getelementptr inbounds [17 x i8], [17 x i8]* %9, i64 0, i64 %166
store i8 0, i8* %167
%168 = load i32, i32* %59
%169 = call i8* @inet_ntoa(i32 %168)
%170 = add nsw i32 %77, -3
%171 = load i8, i8* %65
%172 = sext i8 %171 to i32
%173 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([62 x i8], [62 x i8]* @.str.10, i64 0, i64 0), i8* %169, i32 %170, i32 %172, i32 %162, i32 %163, i8* %24)
%174 = call i32 @searchdict(i8* %24)
%175 = icmp eq i32 %174, 1
br i1 %175, label %179, label %176
176: ; preds = %159
%177 = call i32 @send(i32 %77, i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.11, i64 0, i64 0), i32 25, i32 0)
%178 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.12, i64 0, i64 0), i8* %24)
br label %212
179: ; preds = %159
%180 = load i8, i8* %65
%181 = sext i8 %180 to i32
switch i32 %181, label %188 [
i32 97, label %182
i32 100, label %185
]
182: ; preds = %179
%183 = call i32 @strlen(i8* %24)
%184 = call i32 @strplc_a(i32 %162, i32 %163, i32 15, i8** %29, i8* %24, i32 %183)
br label %188
185: ; preds = %179
%186 = call i32 @strlen(i8* %24)
%187 = call i32 @strplc_d(i32 %162, i32 %163, i32 15, i8** %29, i8* %24, i32 %186)
br label %188
188: ; preds = %179, %185, %182
%189 = icmp slt i32 %78, 0
br i1 %189, label %201, label %190
190: ; preds = %188, %198
%191 = phi i32 [ %199, %198 ], [ 0, %188 ]
%192 = call i64 @FD_ISSET(i32 %191, i32* %16)
%193 = icmp eq i64 %192, 0
%194 = icmp eq i32 %191, %41
%195 = or i1 %193, %194
br i1 %195, label %198, label %196
196: ; preds = %190
%197 = call i32 @sendboard(i32 %191, i8* %32, i8* %19, i32 15)
br label %198
198: ; preds = %190, %196
%199 = add nuw i32 %191, 1
%200 = icmp eq i32 %191, %78
br i1 %200, label %201, label %190
201: ; preds = %198, %188
%202 = call i32 @sleep(i32 1)
%203 = call i32 @strlen(i8* %24)
%204 = call i32 @memset(i8* %20, i8 signext 0, i32 8)
%205 = call i32 @randomrack(i8* %20, i32* %66, i32 %203)
%206 = call i32 (i8*, i8*, i8*, ...) @sprintf(i8* %25, i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.13, i64 0, i64 0), i8* %24, i8* %20)
%207 = call i32 @strlen(i8* %25)
%208 = call i32 @send(i32 %77, i8* %25, i32 %207, i32 0)
%209 = load i32, i32* %59
%210 = call i8* @inet_ntoa(i32 %209)
%211 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([49 x i8], [49 x i8]* @.str.9, i64 0, i64 0), i8* %210, i32 %170, i32 %203, i8* %20)
br label %212
212: ; preds = %145, %129, %126, %201, %176, %148
%213 = call i32 @strlen(i8* %32)
%214 = call i32 @memset(i8* %32, i8 signext 0, i32 %213)
br label %215
215: ; preds = %76, %100, %212, %111, %83
%216 = phi i32 [ %87, %83 ], [ %78, %100 ], [ %78, %111 ], [ %78, %212 ], [ %78, %76 ]
%217 = add nuw nsw i32 %77, 1
%218 = icmp slt i32 %77, %216
br i1 %218, label %76, label %69
}