#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*/ struct_server;
typedef int /*<<< orphan*/ struct_client;
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 pid_t;

/* Variables and functions */
int /*<<< orphan*/ AF_INET;
int /*<<< orphan*/ INADDR_ANY;
int /*<<< orphan*/ PATH_MAX;
int /*<<< orphan*/ SOCK_STREAM;
int accept(int, struct sockaddr *, int *);
int atoi(char *);
scalar_t__ bind(int, struct sockaddr *, int);
int /*<<< orphan*/ close(int);
int /*<<< orphan*/ execl(char *, char *, char *, char *, int /*<<< orphan*/ *);
int /*<<< orphan*/ exit(int);
int fork();
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, ...);
int /*<<< orphan*/ free(char *);
int getpid();
int /*<<< orphan*/ htons(int);
int /*<<< orphan*/ isdigit(char);
scalar_t__ listen(int, int);
int /*<<< orphan*/ printf(char *, ...);
int rand();
char *realpath(char *, char *);
int send(int, int *, int, int /*<<< orphan*/);
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ sprintf(char *, char *, int);
int /*<<< orphan*/ srand(int);
int /*<<< orphan*/ stderr;
int strlen(char *);
int /*<<< orphan*/ waitpid(int, int *, int /*<<< orphan*/);
int main(int argc, char **argv) {
  if (argc != 3) {
    printf("Usage: %s [ port # ] [ # ]\n", argv[0]);
    return (-1);
  }
  int pid = getpid();
  for (int i = 1; i < 3; ++i) {
    int str_size = strlen(argv[i]);
    for (int o = 0; o < str_size; ++o) {
      if (!(isdigit(argv[i][o]))) {
        fprintf(stderr, "%s process [%d]: %s is not a valid input.\n", argv[0],
                pid, argv[i]);
        return (2);
      }
    }
  }
  int r_val[2];
  int nbytes[2];
  int port_v[2];
  int socket_desc[2][2];
  struct sockaddr_in struct_server[2];
  struct sockaddr_in struct_client[2];
  pid_t child_id[2];
  srand(atoi(argv[1]));
  for (int i = 0; i < 2; i++) {
    port_v[i] = atoi(argv[1]) + i;
    if (port_v[i] < 100 || port_v[i] > 65000) {
      fprintf(stderr, "error: invalid port.\n");
      exit(1);
    }
    socket_desc[i][0] = socket(AF_INET, SOCK_STREAM, 0);
    if (socket_desc[i][0] == -1) {
      fprintf(stderr, "Error: pipe() failed.\n");
      exit(1);
    }
    struct_server[i].sin_family = AF_INET;
    struct_server[i].sin_addr.s_addr = INADDR_ANY;
    struct_server[i].sin_port = htons(port_v[i]);
    if (bind(socket_desc[i][0], (struct sockaddr *)struct_server + i,
             sizeof(struct_server[i])) < 0) {
      close(socket_desc[i][0]);
      fprintf(stderr, "Error: bind() failed.\n");
      exit(1);
    }
    if (listen(socket_desc[i][0], 1) < 0) {
      close(socket_desc[i][0]);
      fprintf(stderr, "Error: listen() failed.\n");
      exit(1);
    }
    if ((child_id[i] = fork()) == -1) {
      fprintf(stderr, "Error: fork() failed.\n");
      return (1);
    }
    if (child_id[i] == 0) {
      char buf[PATH_MAX + 1];
      char *full_path = realpath("Beta", buf);
      if (full_path == NULL) {
        fprintf(stderr, "Error: %s can not be found.\n", "Beta");
        exit(1);
      }
      char sock_buf[21];
      sprintf(sock_buf, "%d", port_v[i]);
      execl(full_path, "Beta", sock_buf, argv[2], NULL);
      free(full_path);
    } else {
      printf("%s: forked process with ID %d\n", argv[0], child_id[i]);
    }
  }
  for (int i = 0; i < 2; i++) {
    r_val[i] = rand() % 100000;
    socklen_t len = sizeof(struct_client[i]);
    socket_desc[i][1] =
        accept(socket_desc[i][0], (struct sockaddr *)struct_client + i, &len);
    if (socket_desc[i][1] < 0) {
      fprintf(stderr, "Error: accept() failed.\n");
      return 1;
    }
    nbytes[i] = send(socket_desc[i][1], &r_val[i], sizeof(int), 0);
    if (nbytes[i] < 0) {
      fprintf(stderr, "error: send failed.\n");
      return 1;
    }
    printf("%s: wrote number %d to socket (%d bytes)\n", argv[0], r_val[i],
           nbytes[i]);
    int status = 0;
    printf("%s: waiting on child process ID %d...\n", argv[0], child_id[i]);
    waitpid(child_id[i], &status, 0);
    int val = r_val[i] * atoi(argv[2]);
    if (status) {
      printf("%d is not even as %s returned %d.\n", val, "Beta", status);
    } else {
      printf("%d is even as %s returned %d.\n", val, "Beta", status);
    }
  }
  printf("%s: exiting.\n", argv[0]);
  return (0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xf0,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
cmpl   $0x3,-0x8(%rbp)
je     12a4 <main+0x44>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0xd6f(%rip),%rdi
mov    $0x0,%al
call   1090 <printf@plt>
movl   $0xffffffff,-0x4(%rbp)
jmp    1913 <main+0x6b3>
mov    $0x0,%al
call   1050 <getpid@plt>
mov    %eax,-0x14(%rbp)
movl   $0x1,-0x18(%rbp)
cmpl   $0x3,-0x18(%rbp)
jge    1367 <main+0x107>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,8),%rdi
call   1060 <strlen@plt>
mov    %eax,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
mov    -0x20(%rbp),%eax
cmp    -0x1c(%rbp),%eax
jge    1354 <main+0xf4>
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rcx
mov    (%rax,%rcx,8),%rax
movslq -0x20(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1040 <isdigit@plt>
cmp    $0x0,%eax
jne    1341 <main+0xe1>
mov    0x2cb9(%rip),%rax
mov    (%rax),%edi
mov    -0x10(%rbp),%rax
mov    (%rax),%rdx
mov    -0x14(%rbp),%ecx
mov    -0x10(%rbp),%rax
movslq -0x18(%rbp),%rsi
mov    (%rax,%rsi,8),%r8
lea    0xcee(%rip),%rsi
mov    $0x0,%al
call   10c0 <fprintf@plt>
movl   $0x2,-0x4(%rbp)
jmp    1913 <main+0x6b3>
jmp    1346 <main+0xe6>
mov    -0x20(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x20(%rbp)
jmp    12da <main+0x7a>
jmp    1359 <main+0xf9>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    12b5 <main+0x55>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1120 <atoi@plt>
mov    %eax,%edi
call   10b0 <srand@plt>
movl   $0x0,-0x9c(%rbp)
cmpl   $0x2,-0x9c(%rbp)
jge    16d3 <main+0x473>
mov    -0x10(%rbp),%rax
mov    0x8(%rax),%rdi
call   1120 <atoi@plt>
mov    %eax,%ecx
add    -0x9c(%rbp),%ecx
movslq -0x9c(%rbp),%rax
mov    %ecx,-0x38(%rbp,%rax,4)
movslq -0x9c(%rbp),%rax
cmpl   $0x64,-0x38(%rbp,%rax,4)
jl     13d9 <main+0x179>
movslq -0x9c(%rbp),%rax
cmpl   $0xfde8,-0x38(%rbp,%rax,4)
jle    13fa <main+0x19a>
mov    0x2be8(%rip),%rax
mov    (%rax),%edi
lea    0xc5e(%rip),%rsi
mov    $0x0,%al
call   10c0 <fprintf@plt>
mov    $0x1,%edi
call   1140 <exit@plt>
mov    0x2bdf(%rip),%rax
mov    (%rax),%edi
mov    0x2bb6(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1180 <socket@plt>
mov    %eax,%ecx
movslq -0x9c(%rbp),%rax
mov    %ecx,-0x50(%rbp,%rax,8)
movslq -0x9c(%rbp),%rax
cmpl   $0xffffffff,-0x50(%rbp,%rax,8)
jne    1453 <main+0x1f3>
mov    0x2b8f(%rip),%rax
mov    (%rax),%edi
lea    0xc1b(%rip),%rsi
mov    $0x0,%al
call   10c0 <fprintf@plt>
mov    $0x1,%edi
call   1140 <exit@plt>
mov    0x2b86(%rip),%rax
mov    (%rax),%ecx
movslq -0x9c(%rbp),%rdx
lea    -0x70(%rbp),%rax
imul   $0xc,%rdx,%rdx
add    %rdx,%rax
mov    %ecx,0x8(%rax)
mov    0x2b60(%rip),%rax
mov    (%rax),%ecx
movslq -0x9c(%rbp),%rdx
lea    -0x70(%rbp),%rax
imul   $0xc,%rdx,%rdx
add    %rdx,%rax
mov    %ecx,0x4(%rax)
movslq -0x9c(%rbp),%rax
mov    -0x38(%rbp,%rax,4),%edi
call   1070 <htons@plt>
mov    %eax,%ecx
movslq -0x9c(%rbp),%rdx
lea    -0x70(%rbp),%rax
imul   $0xc,%rdx,%rdx
add    %rdx,%rax
mov    %ecx,(%rax)
movslq -0x9c(%rbp),%rax
mov    -0x50(%rbp,%rax,8),%edi
lea    -0x70(%rbp),%rsi
movslq -0x9c(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
mov    $0xc,%edx
call   10f0 <bind@plt>
cmp    $0x0,%rax
jge    1517 <main+0x2b7>
movslq -0x9c(%rbp),%rax
mov    -0x50(%rbp,%rax,8),%edi
call   10a0 <close@plt>
mov    0x2acb(%rip),%rax
mov    (%rax),%edi
lea    0xb6e(%rip),%rsi
mov    $0x0,%al
call   10c0 <fprintf@plt>
mov    $0x1,%edi
call   1140 <exit@plt>
movslq -0x9c(%rbp),%rax
mov    -0x50(%rbp,%rax,8),%edi
mov    $0x1,%esi
call   10e0 <listen@plt>
cmp    $0x0,%rax
jge    1567 <main+0x307>
movslq -0x9c(%rbp),%rax
mov    -0x50(%rbp,%rax,8),%edi
call   10a0 <close@plt>
mov    0x2a7b(%rip),%rax
mov    (%rax),%edi
lea    0xb35(%rip),%rsi
mov    $0x0,%al
call   10c0 <fprintf@plt>
mov    $0x1,%edi
call   1140 <exit@plt>
mov    $0x0,%al
call   1160 <fork@plt>
movslq -0x9c(%rbp),%rcx
mov    %eax,-0x98(%rbp,%rcx,4)
cmp    $0xffffffff,%eax
jne    15a8 <main+0x348>
mov    0x2a3c(%rip),%rax
mov    (%rax),%edi
lea    0xb0f(%rip),%rsi
mov    $0x0,%al
call   10c0 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1913 <main+0x6b3>
movslq -0x9c(%rbp),%rax
cmpl   $0x0,-0x98(%rbp,%rax,4)
jne    1697 <main+0x437>
mov    0x2a2c(%rip),%rax
mov    (%rax),%eax
add    $0x1,%eax
mov    %rsp,%rcx
mov    %rcx,-0xa8(%rbp)
mov    %rax,%rcx
add    $0xf,%rcx
and    $0xfffffffffffffff0,%rcx
mov    %rsp,%rsi
sub    %rcx,%rsi
mov    %rsi,%rsp
mov    %rax,-0xb0(%rbp)
lea    0xac6(%rip),%rdi
call   10d0 <realpath@plt>
mov    %rax,-0xb8(%rbp)
cmpq   $0x0,-0xb8(%rbp)
jne    1637 <main+0x3d7>
mov    0x29b2(%rip),%rax
mov    (%rax),%edi
lea    0xaa1(%rip),%rsi
lea    0xa95(%rip),%rdx
mov    $0x0,%al
call   10c0 <fprintf@plt>
mov    $0x1,%edi
call   1140 <exit@plt>
lea    -0xd0(%rbp),%rdi
movslq -0x9c(%rbp),%rax
mov    -0x38(%rbp,%rax,4),%edx
lea    0xa8d(%rip),%rsi
call   1130 <sprintf@plt>
mov    -0xb8(%rbp),%rdi
lea    -0xd0(%rbp),%rdx
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rcx
lea    0xa49(%rip),%rsi
xor    %eax,%eax
mov    %eax,%r8d
call   1150 <execl@plt>
mov    -0xb8(%rbp),%rdi
call   1030 <free@plt>
mov    -0xa8(%rbp),%rax
mov    %rax,%rsp
jmp    16ba <main+0x45a>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
movslq -0x9c(%rbp),%rax
mov    -0x98(%rbp,%rax,4),%edx
lea    0xa2d(%rip),%rdi
mov    $0x0,%al
call   1090 <printf@plt>
jmp    16bf <main+0x45f>
mov    -0x9c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x9c(%rbp)
jmp    1385 <main+0x125>
movl   $0x0,-0xd4(%rbp)
cmpl   $0x2,-0xd4(%rbp)
jge    18f7 <main+0x697>
mov    $0x0,%al
call   1170 <rand@plt>
mov    $0x186a0,%ecx
cltd
idiv   %ecx
movslq -0xd4(%rbp),%rax
mov    %edx,-0x28(%rbp,%rax,4)
movl   $0xc,-0xd8(%rbp)
movslq -0xd4(%rbp),%rax
mov    -0x50(%rbp,%rax,8),%edi
lea    -0x90(%rbp),%rsi
movslq -0xd4(%rbp),%rax
shl    $0x2,%rax
add    %rax,%rsi
lea    -0xd8(%rbp),%rdx
call   1110 <accept@plt>
mov    %eax,%ecx
movslq -0xd4(%rbp),%rax
mov    %ecx,-0x4c(%rbp,%rax,8)
movslq -0xd4(%rbp),%rax
cmpl   $0x0,-0x4c(%rbp,%rax,8)
jge    177c <main+0x51c>
mov    0x2868(%rip),%rax
mov    (%rax),%edi
lea    0x996(%rip),%rsi
mov    $0x0,%al
call   10c0 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1913 <main+0x6b3>
movslq -0xd4(%rbp),%rax
mov    -0x4c(%rbp,%rax,8),%edi
movslq -0xd4(%rbp),%rax
lea    -0x28(%rbp),%rsi
shl    $0x2,%rax
add    %rax,%rsi
mov    $0x4,%edx
xor    %ecx,%ecx
call   1080 <send@plt>
mov    %eax,%ecx
movslq -0xd4(%rbp),%rax
mov    %ecx,-0x30(%rbp,%rax,4)
movslq -0xd4(%rbp),%rax
cmpl   $0x0,-0x30(%rbp,%rax,4)
jge    17e7 <main+0x587>
mov    0x27fd(%rip),%rax
mov    (%rax),%edi
lea    0x944(%rip),%rsi
mov    $0x0,%al
call   10c0 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
jmp    1913 <main+0x6b3>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
movslq -0xd4(%rbp),%rax
mov    -0x28(%rbp,%rax,4),%edx
movslq -0xd4(%rbp),%rax
mov    -0x30(%rbp,%rax,4),%ecx
lea    0x922(%rip),%rdi
mov    $0x0,%al
call   1090 <printf@plt>
movl   $0x0,-0xdc(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
movslq -0xd4(%rbp),%rax
mov    -0x98(%rbp,%rax,4),%edx
lea    0x91f(%rip),%rdi
mov    $0x0,%al
call   1090 <printf@plt>
movslq -0xd4(%rbp),%rax
mov    -0x98(%rbp,%rax,4),%edi
lea    -0xdc(%rbp),%rsi
xor    %edx,%edx
call   1100 <waitpid@plt>
movslq -0xd4(%rbp),%rax
mov    -0x28(%rbp,%rax,4),%eax
mov    %eax,-0xe4(%rbp)
mov    -0x10(%rbp),%rax
mov    0x10(%rax),%rdi
call   1120 <atoi@plt>
mov    %eax,%ecx
mov    -0xe4(%rbp),%eax
imul   %ecx,%eax
mov    %eax,-0xe0(%rbp)
cmpl   $0x0,-0xdc(%rbp)
je     18bd <main+0x65d>
mov    -0xe0(%rbp),%esi
mov    -0xdc(%rbp),%ecx
lea    0x8d4(%rip),%rdi
lea    0x80a(%rip),%rdx
mov    $0x0,%al
call   1090 <printf@plt>
jmp    18de <main+0x67e>
mov    -0xe0(%rbp),%esi
mov    -0xdc(%rbp),%ecx
lea    0x8d1(%rip),%rdi
lea    0x7e4(%rip),%rdx
mov    $0x0,%al
call   1090 <printf@plt>
jmp    18e3 <main+0x683>
mov    -0xd4(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xd4(%rbp)
jmp    16dd <main+0x47d>
mov    -0x10(%rbp),%rax
mov    (%rax),%rsi
lea    0x8bb(%rip),%rdi
mov    $0x0,%al
call   1090 <printf@plt>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
mov    %rbp,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
mov    %rsp,%rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x78,%rsp
mov    %rsi,%r15
cmp    $0x3,%edi
jne    13d3 <main+0x173>
xor    %eax,%eax
call   1050 <getpid@plt>
mov    %eax,%r14d
lea    0x8(%r15),%r13
mov    0x8(%r15),%rdi
call   1060 <strlen@plt>
test   %eax,%eax
jle    12be <main+0x5e>
mov    %eax,%r12d
xor    %ebx,%ebx
nopl   (%rax)
mov    0x0(%r13),%rax
movsbl (%rax,%rbx,1),%edi
call   1040 <isdigit@plt>
test   %eax,%eax
je     13f5 <main+0x195>
add    $0x1,%rbx
cmp    %rbx,%r12
jne    12a0 <main+0x40>
lea    0x10(%r15),%r12
mov    %r15,-0x48(%rbp)
mov    0x10(%r15),%rdi
call   1060 <strlen@plt>
test   %eax,%eax
jle    12ff <main+0x9f>
mov    %eax,%ebx
xor    %r15d,%r15d
nopl   0x0(%rax,%rax,1)
mov    (%r12),%rax
movsbl (%rax,%r15,1),%edi
call   1040 <isdigit@plt>
test   %eax,%eax
je     13ee <main+0x18e>
add    $0x1,%r15
cmp    %r15,%rbx
jne    12e0 <main+0x80>
mov    0x0(%r13),%rdi
call   1120 <atoi@plt>
mov    %eax,%edi
call   10b0 <srand@plt>
mov    0x0(%r13),%rdi
call   1120 <atoi@plt>
mov    %eax,%r14d
lea    -0xfde9(%r14),%eax
cmp    $0xffff027b,%eax
jb     180b <main+0x5ab>
mov    0x2cac(%rip),%r15
mov    (%r15),%edi
mov    0x2c82(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1180 <socket@plt>
mov    %eax,-0x60(%rbp)
cmp    $0xffffffff,%eax
je     181d <main+0x5bd>
mov    %eax,%ebx
mov    (%r15),%eax
mov    %eax,-0x78(%rbp)
mov    0x2c76(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x7c(%rbp)
mov    %r14d,%edi
call   1070 <htons@plt>
mov    %eax,-0x80(%rbp)
lea    -0x80(%rbp),%rsi
mov    %ebx,%edi
mov    $0xc,%edx
call   10f0 <bind@plt>
test   %rax,%rax
js     182f <main+0x5cf>
mov    %ebx,%edi
mov    $0x1,%esi
call   10e0 <listen@plt>
test   %rax,%rax
mov    -0x48(%rbp),%r15
js     1848 <main+0x5e8>
xor    %eax,%eax
call   1160 <fork@plt>
mov    %eax,-0x50(%rbp)
test   %eax,%eax
je     1420 <main+0x1c0>
cmp    $0xffffffff,%eax
je     15c4 <main+0x364>
mov    (%r15),%rsi
lea    0xd1b(%rip),%rdi
mov    %eax,%edx
xor    %eax,%eax
call   1090 <printf@plt>
jmp    1497 <main+0x237>
mov    (%r15),%rsi
lea    0xc23(%rip),%rdi
xor    %eax,%eax
call   1090 <printf@plt>
mov    $0xffffffff,%ebx
jmp    17cc <main+0x56c>
mov    %r12,%r13
mov    -0x48(%rbp),%r15
mov    0x2bcc(%rip),%rax
mov    (%rax),%edi
mov    (%r15),%rdx
mov    0x0(%r13),%r8
lea    0xc10(%rip),%rsi
mov    %r14d,%ecx
xor    %eax,%eax
call   10c0 <fprintf@plt>
mov    $0x2,%ebx
jmp    17cc <main+0x56c>
mov    %rsp,-0x40(%rbp)
mov    0x2bc5(%rip),%rax
mov    (%rax),%eax
add    $0x1,%eax
mov    %rsp,%rsi
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rsi
mov    %rsi,%rsp
lea    0xc73(%rip),%rdi
call   10d0 <realpath@plt>
test   %rax,%rax
je     1870 <main+0x610>
mov    %rax,%rbx
lea    0xc7d(%rip),%rsi
lea    -0xa0(%rbp),%r15
mov    %r15,%rdi
mov    %r14d,%edx
call   1130 <sprintf@plt>
mov    (%r12),%rcx
lea    0xc3e(%rip),%rsi
mov    %rbx,%rdi
mov    %r15,%rdx
xor    %r8d,%r8d
call   1150 <execl@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    -0x40(%rbp),%rsp
mov    0x2b42(%rip),%r15
mov    0x0(%r13),%rdi
call   1120 <atoi@plt>
mov    %eax,%r14d
lea    -0xfde8(%r14),%eax
cmp    $0xffff027b,%eax
jb     180b <main+0x5ab>
mov    (%r15),%edi
mov    0x2afa(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1180 <socket@plt>
mov    %eax,-0x58(%rbp)
cmp    $0xffffffff,%eax
je     181d <main+0x5bd>
mov    %eax,%ebx
add    $0x1,%r14d
mov    (%r15),%eax
mov    %eax,-0x6c(%rbp)
mov    0x2aea(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x70(%rbp)
mov    %r14d,%edi
call   1070 <htons@plt>
mov    %eax,-0x74(%rbp)
lea    -0x7c(%rbp),%rsi
mov    %ebx,%edi
mov    $0xc,%edx
call   10f0 <bind@plt>
test   %rax,%rax
js     182f <main+0x5cf>
mov    %ebx,%edi
mov    $0x1,%esi
call   10e0 <listen@plt>
test   %rax,%rax
mov    -0x48(%rbp),%r15
js     1848 <main+0x5e8>
xor    %eax,%eax
call   1160 <fork@plt>
mov    %eax,-0x4c(%rbp)
cmp    $0xffffffff,%eax
je     15c4 <main+0x364>
test   %eax,%eax
jne    15d9 <main+0x379>
mov    %rsp,-0x40(%rbp)
mov    0x2a9a(%rip),%rax
mov    (%rax),%eax
add    $0x1,%eax
mov    %rsp,%rsi
add    $0xf,%rax
and    $0xfffffffffffffff0,%rax
sub    %rax,%rsi
mov    %rsi,%rsp
lea    0xb48(%rip),%rdi
call   10d0 <realpath@plt>
test   %rax,%rax
je     1870 <main+0x610>
mov    %rax,%rbx
lea    0xb52(%rip),%rsi
lea    -0xa0(%rbp),%r13
mov    %r13,%rdi
mov    %r14d,%edx
call   1130 <sprintf@plt>
mov    (%r12),%rcx
lea    0xb13(%rip),%rsi
mov    %rbx,%rdi
mov    %r13,%rdx
xor    %r8d,%r8d
call   1150 <execl@plt>
mov    %rbx,%rdi
call   1030 <free@plt>
mov    -0x40(%rbp),%rsp
jmp    15ec <main+0x38c>
mov    0x29fd(%rip),%rax
mov    (%rax),%edi
lea    0xad0(%rip),%rsi
jmp    17c0 <main+0x560>
mov    (%r15),%rsi
lea    0xafd(%rip),%rdi
mov    %eax,%edx
xor    %eax,%eax
call   1090 <printf@plt>
xor    %eax,%eax
call   1170 <rand@plt>
cltq
imul   $0x14f8b589,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x2d,%rcx
add    %edx,%ecx
imul   $0x186a0,%ecx,%ecx
sub    %ecx,%eax
mov    %eax,-0x38(%rbp)
movl   $0xc,-0x30(%rbp)
mov    -0x60(%rbp),%edi
lea    -0xa0(%rbp),%rsi
lea    -0x30(%rbp),%rdx
call   1110 <accept@plt>
mov    %eax,-0x5c(%rbp)
lea    0xac7(%rip),%r14
test   %eax,%eax
js     17b4 <main+0x554>
lea    -0x38(%rbp),%rsi
mov    %eax,%edi
mov    $0x4,%edx
xor    %ecx,%ecx
call   1080 <send@plt>
lea    0xabf(%rip),%r12
test   %eax,%eax
js     16c5 <main+0x465>
mov    (%r15),%rsi
mov    -0x38(%rbp),%edx
lea    0xac3(%rip),%rdi
mov    %eax,%ecx
xor    %eax,%eax
call   1090 <printf@plt>
movl   $0x0,-0x2c(%rbp)
mov    (%r15),%rsi
mov    -0x50(%rbp),%ebx
lea    0xad0(%rip),%rdi
mov    %ebx,%edx
xor    %eax,%eax
call   1090 <printf@plt>
lea    -0x2c(%rbp),%rsi
mov    %ebx,%edi
xor    %edx,%edx
call   1100 <waitpid@plt>
mov    -0x38(%rbp),%ebx
mov    0x10(%r15),%rdi
call   1120 <atoi@plt>
imul   %ebx,%eax
mov    -0x2c(%rbp),%ecx
test   %ecx,%ecx
je     16cd <main+0x46d>
lea    0xac4(%rip),%rdi
lea    0x9fa(%rip),%rdx
mov    %eax,%esi
jmp    16df <main+0x47f>
mov    %r12,%r14
jmp    17b4 <main+0x554>
lea    0xacd(%rip),%rdi
lea    0x9e0(%rip),%rdx
mov    %eax,%esi
xor    %ecx,%ecx
xor    %eax,%eax
call   1090 <printf@plt>
xor    %eax,%eax
call   1170 <rand@plt>
cltq
imul   $0x14f8b589,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x2d,%rcx
add    %edx,%ecx
imul   $0x186a0,%ecx,%ecx
sub    %ecx,%eax
mov    %eax,-0x34(%rbp)
movl   $0xc,-0x30(%rbp)
mov    -0x58(%rbp),%edi
lea    -0x9c(%rbp),%rsi
lea    -0x30(%rbp),%rdx
call   1110 <accept@plt>
mov    %eax,-0x54(%rbp)
test   %eax,%eax
js     17b4 <main+0x554>
lea    -0x34(%rbp),%rsi
mov    %eax,%edi
mov    $0x4,%edx
xor    %ecx,%ecx
call   1080 <send@plt>
mov    %r12,%r14
test   %eax,%eax
js     17b4 <main+0x554>
mov    (%r15),%rsi
mov    -0x34(%rbp),%edx
lea    0x9d4(%rip),%rdi
mov    %eax,%ecx
xor    %eax,%eax
call   1090 <printf@plt>
movl   $0x0,-0x2c(%rbp)
mov    (%r15),%rsi
mov    -0x4c(%rbp),%ebx
lea    0x9e1(%rip),%rdi
mov    %ebx,%edx
xor    %eax,%eax
call   1090 <printf@plt>
lea    -0x2c(%rbp),%rsi
mov    %ebx,%edi
xor    %edx,%edx
call   1100 <waitpid@plt>
mov    -0x34(%rbp),%ebx
mov    0x10(%r15),%rdi
call   1120 <atoi@plt>
imul   %ebx,%eax
mov    -0x2c(%rbp),%ecx
test   %ecx,%ecx
je     17dd <main+0x57d>
lea    0x9d5(%rip),%rdi
lea    0x90b(%rip),%rdx
mov    %eax,%esi
jmp    17ef <main+0x58f>
mov    0x280d(%rip),%rax
mov    (%rax),%edi
mov    %r14,%rsi
xor    %eax,%eax
call   10c0 <fprintf@plt>
mov    $0x1,%ebx
mov    %ebx,%eax
lea    -0x28(%rbp),%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0x9bd(%rip),%rdi
lea    0x8d0(%rip),%rdx
mov    %eax,%esi
xor    %ecx,%ecx
xor    %eax,%eax
call   1090 <printf@plt>
mov    (%r15),%rsi
lea    0x9c0(%rip),%rdi
xor    %ebx,%ebx
xor    %eax,%eax
call   1090 <printf@plt>
jmp    17cc <main+0x56c>
mov    0x27b6(%rip),%rax
mov    (%rax),%edi
lea    0x82c(%rip),%rsi
jmp    185f <main+0x5ff>
mov    0x27a4(%rip),%rax
mov    (%rax),%edi
lea    0x830(%rip),%rsi
jmp    185f <main+0x5ff>
mov    %ebx,%edi
call   10a0 <close@plt>
mov    0x278b(%rip),%rax
mov    (%rax),%edi
lea    0x82e(%rip),%rsi
jmp    185f <main+0x5ff>
mov    %ebx,%edi
call   10a0 <close@plt>
mov    0x2772(%rip),%rax
mov    (%rax),%edi
lea    0x82c(%rip),%rsi
xor    %eax,%eax
call   10c0 <fprintf@plt>
mov    $0x1,%edi
call   1140 <exit@plt>
mov    0x2751(%rip),%rax
mov    (%rax),%edi
lea    0x840(%rip),%rsi
lea    0x834(%rip),%rdx
xor    %eax,%eax
call   10c0 <fprintf@plt>
mov    $0x1,%edi
call   1140 <exit@plt>

LLVM IR (-O0):
%struct.sockaddr_in = type { i32, %struct.TYPE_2__, i32 }
%struct.TYPE_2__ = type { i32 }
%struct.sockaddr = type { i32 }
@.str = [28 x i8] c"Usage: %s [ port # ] [ # ]\0A\00"
@stderr = global i32 0
@.str.1 = [43 x i8] c"%s process [%d]: %s is not a valid input.\0A\00"
@.str.2 = [22 x i8] c"error: invalid port.\0A\00"
@AF_INET = global i32 0
@SOCK_STREAM = global i32 0
@.str.3 = [23 x i8] c"Error: pipe() failed.\0A\00"
@INADDR_ANY = global i32 0
@.str.4 = [23 x i8] c"Error: bind() failed.\0A\00"
@.str.5 = [25 x i8] c"Error: listen() failed.\0A\00"
@.str.6 = [23 x i8] c"Error: fork() failed.\0A\00"
@PATH_MAX = global i32 0
@.str.7 = [5 x i8] c"Beta\00"
@.str.8 = [29 x i8] c"Error: %s can not be found.\0A\00"
@.str.9 = [3 x i8] c"%d\00"
@.str.10 = [31 x i8] c"%s: forked process with ID %d\0A\00"
@.str.11 = [25 x i8] c"Error: accept() failed.\0A\00"
@.str.12 = [21 x i8] c"error: send failed.\0A\00"
@.str.13 = [42 x i8] c"%s: wrote number %d to socket (%d bytes)\0A\00"
@.str.14 = [39 x i8] c"%s: waiting on child process ID %d...\0A\00"
@.str.15 = [35 x i8] c"%d is not even as %s returned %d.\0A\00"
@.str.16 = [31 x i8] c"%d is even as %s returned %d.\0A\00"
@.str.17 = [14 x i8] c"%s: exiting.\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 [2 x i32]
%11 = alloca [2 x i32]
%12 = alloca [2 x i32]
%13 = alloca [2 x [2 x i32]]
%14 = alloca [2 x %struct.sockaddr_in]
%15 = alloca [2 x %struct.sockaddr_in]
%16 = alloca [2 x i32]
%17 = alloca i32
%18 = alloca i8*
%19 = alloca i64
%20 = alloca i8*
%21 = alloca [21 x i8]
%22 = alloca i32
%23 = alloca i32
%24 = alloca i32
%25 = alloca i32
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%26 = load i32, i32* %4
%27 = icmp ne i32 %26, 3
br i1 %27, label %28, label %33
28: ; preds = %2
%29 = load i8**, i8*** %5
%30 = getelementptr inbounds i8*, i8** %29, i64 0
%31 = load i8*, i8** %30
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %31)
store i32 -1, i32* %3
br label %360
33: ; preds = %2
%34 = call i32 (...) @getpid()
store i32 %34, i32* %6
store i32 1, i32* %7
br label %35
35: ; preds = %78, %33
%36 = load i32, i32* %7
%37 = icmp slt i32 %36, 3
br i1 %37, label %38, label %81
38: ; preds = %35
%39 = load i8**, i8*** %5
%40 = load i32, i32* %7
%41 = sext i32 %40 to i64
%42 = getelementptr inbounds i8*, i8** %39, i64 %41
%43 = load i8*, i8** %42
%44 = call i32 @strlen(i8* %43)
store i32 %44, i32* %8
store i32 0, i32* %9
br label %45
45: ; preds = %74, %38
%46 = load i32, i32* %9
%47 = load i32, i32* %8
%48 = icmp slt i32 %46, %47
br i1 %48, label %49, label %77
49: ; preds = %45
%50 = load i8**, i8*** %5
%51 = load i32, i32* %7
%52 = sext i32 %51 to i64
%53 = getelementptr inbounds i8*, i8** %50, i64 %52
%54 = load i8*, i8** %53
%55 = load i32, i32* %9
%56 = sext i32 %55 to i64
%57 = getelementptr inbounds i8, i8* %54, i64 %56
%58 = load i8, i8* %57
%59 = call i32 @isdigit(i8 signext %58)
%60 = icmp ne i32 %59, 0
br i1 %60, label %73, label %61
61: ; preds = %49
%62 = load i32, i32* @stderr
%63 = load i8**, i8*** %5
%64 = getelementptr inbounds i8*, i8** %63, i64 0
%65 = load i8*, i8** %64
%66 = load i32, i32* %6
%67 = load i8**, i8*** %5
%68 = load i32, i32* %7
%69 = sext i32 %68 to i64
%70 = getelementptr inbounds i8*, i8** %67, i64 %69
%71 = load i8*, i8** %70
%72 = call i32 (i32, i8*, ...) @fprintf(i32 %62, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.1, i64 0, i64 0), i8* %65, i32 %66, i8* %71)
store i32 2, i32* %3
br label %360
73: ; preds = %49
br label %74
74: ; preds = %73
%75 = load i32, i32* %9
%76 = add nsw i32 %75, 1
store i32 %76, i32* %9
br label %45
77: ; preds = %45
br label %78
78: ; preds = %77
%79 = load i32, i32* %7
%80 = add nsw i32 %79, 1
store i32 %80, i32* %7
br label %35
81: ; preds = %35
%82 = load i8**, i8*** %5
%83 = getelementptr inbounds i8*, i8** %82, i64 1
%84 = load i8*, i8** %83
%85 = call i32 @atoi(i8* %84)
%86 = call i32 @srand(i32 %85)
store i32 0, i32* %17
br label %87
87: ; preds = %248, %81
%88 = load i32, i32* %17
%89 = icmp slt i32 %88, 2
br i1 %89, label %90, label %251
90: ; preds = %87
%91 = load i8**, i8*** %5
%92 = getelementptr inbounds i8*, i8** %91, i64 1
%93 = load i8*, i8** %92
%94 = call i32 @atoi(i8* %93)
%95 = load i32, i32* %17
%96 = add nsw i32 %94, %95
%97 = load i32, i32* %17
%98 = sext i32 %97 to i64
%99 = getelementptr inbounds [2 x i32], [2 x i32]* %12, i64 0, i64 %98
store i32 %96, i32* %99
%100 = load i32, i32* %17
%101 = sext i32 %100 to i64
%102 = getelementptr inbounds [2 x i32], [2 x i32]* %12, i64 0, i64 %101
%103 = load i32, i32* %102
%104 = icmp slt i32 %103, 100
br i1 %104, label %111, label %105
105: ; preds = %90
%106 = load i32, i32* %17
%107 = sext i32 %106 to i64
%108 = getelementptr inbounds [2 x i32], [2 x i32]* %12, i64 0, i64 %107
%109 = load i32, i32* %108
%110 = icmp sgt i32 %109, 65000
br i1 %110, label %111, label %115
111: ; preds = %105, %90
%112 = load i32, i32* @stderr
%113 = call i32 (i32, i8*, ...) @fprintf(i32 %112, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0))
%114 = call i32 @exit(i32 1)
unreachable
115: ; preds = %105
%116 = load i32, i32* @AF_INET
%117 = load i32, i32* @SOCK_STREAM
%118 = call i32 @socket(i32 %116, i32 %117, i32 0)
%119 = load i32, i32* %17
%120 = sext i32 %119 to i64
%121 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %13, i64 0, i64 %120
%122 = getelementptr inbounds [2 x i32], [2 x i32]* %121, i64 0, i64 0
store i32 %118, i32* %122
%123 = load i32, i32* %17
%124 = sext i32 %123 to i64
%125 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %13, i64 0, i64 %124
%126 = getelementptr inbounds [2 x i32], [2 x i32]* %125, i64 0, i64 0
%127 = load i32, i32* %126
%128 = icmp eq i32 %127, -1
br i1 %128, label %129, label %133
129: ; preds = %115
%130 = load i32, i32* @stderr
%131 = call i32 (i32, i8*, ...) @fprintf(i32 %130, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0))
%132 = call i32 @exit(i32 1)
unreachable
133: ; preds = %115
%134 = load i32, i32* @AF_INET
%135 = load i32, i32* %17
%136 = sext i32 %135 to i64
%137 = getelementptr inbounds [2 x %struct.sockaddr_in], [2 x %struct.sockaddr_in]* %14, i64 0, i64 %136
%138 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %137, i32 0, i32 2
store i32 %134, i32* %138
%139 = load i32, i32* @INADDR_ANY
%140 = load i32, i32* %17
%141 = sext i32 %140 to i64
%142 = getelementptr inbounds [2 x %struct.sockaddr_in], [2 x %struct.sockaddr_in]* %14, i64 0, i64 %141
%143 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %142, i32 0, i32 1
%144 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %143, i32 0, i32 0
store i32 %139, i32* %144
%145 = load i32, i32* %17
%146 = sext i32 %145 to i64
%147 = getelementptr inbounds [2 x i32], [2 x i32]* %12, i64 0, i64 %146
%148 = load i32, i32* %147
%149 = call i32 @htons(i32 %148)
%150 = load i32, i32* %17
%151 = sext i32 %150 to i64
%152 = getelementptr inbounds [2 x %struct.sockaddr_in], [2 x %struct.sockaddr_in]* %14, i64 0, i64 %151
%153 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %152, i32 0, i32 0
store i32 %149, i32* %153
%154 = load i32, i32* %17
%155 = sext i32 %154 to i64
%156 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %13, i64 0, i64 %155
%157 = getelementptr inbounds [2 x i32], [2 x i32]* %156, i64 0, i64 0
%158 = load i32, i32* %157
%159 = getelementptr inbounds [2 x %struct.sockaddr_in], [2 x %struct.sockaddr_in]* %14, i64 0, i64 0
%160 = bitcast %struct.sockaddr_in* %159 to %struct.sockaddr*
%161 = load i32, i32* %17
%162 = sext i32 %161 to i64
%163 = getelementptr inbounds %struct.sockaddr, %struct.sockaddr* %160, i64 %162
%164 = call i64 @bind(i32 %158, %struct.sockaddr* %163, i32 12)
%165 = icmp slt i64 %164, 0
br i1 %165, label %166, label %176
166: ; preds = %133
%167 = load i32, i32* %17
%168 = sext i32 %167 to i64
%169 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %13, i64 0, i64 %168
%170 = getelementptr inbounds [2 x i32], [2 x i32]* %169, i64 0, i64 0
%171 = load i32, i32* %170
%172 = call i32 @close(i32 %171)
%173 = load i32, i32* @stderr
%174 = call i32 (i32, i8*, ...) @fprintf(i32 %173, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.4, i64 0, i64 0))
%175 = call i32 @exit(i32 1)
unreachable
176: ; preds = %133
%177 = load i32, i32* %17
%178 = sext i32 %177 to i64
%179 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %13, i64 0, i64 %178
%180 = getelementptr inbounds [2 x i32], [2 x i32]* %179, i64 0, i64 0
%181 = load i32, i32* %180
%182 = call i64 @listen(i32 %181, i32 1)
%183 = icmp slt i64 %182, 0
br i1 %183, label %184, label %194
184: ; preds = %176
%185 = load i32, i32* %17
%186 = sext i32 %185 to i64
%187 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %13, i64 0, i64 %186
%188 = getelementptr inbounds [2 x i32], [2 x i32]* %187, i64 0, i64 0
%189 = load i32, i32* %188
%190 = call i32 @close(i32 %189)
%191 = load i32, i32* @stderr
%192 = call i32 (i32, i8*, ...) @fprintf(i32 %191, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.5, i64 0, i64 0))
%193 = call i32 @exit(i32 1)
unreachable
194: ; preds = %176
%195 = call i32 (...) @fork()
%196 = load i32, i32* %17
%197 = sext i32 %196 to i64
%198 = getelementptr inbounds [2 x i32], [2 x i32]* %16, i64 0, i64 %197
store i32 %195, i32* %198
%199 = icmp eq i32 %195, -1
br i1 %199, label %200, label %203
200: ; preds = %194
%201 = load i32, i32* @stderr
%202 = call i32 (i32, i8*, ...) @fprintf(i32 %201, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.6, i64 0, i64 0))
store i32 1, i32* %3
br label %360
203: ; preds = %194
%204 = load i32, i32* %17
%205 = sext i32 %204 to i64
%206 = getelementptr inbounds [2 x i32], [2 x i32]* %16, i64 0, i64 %205
%207 = load i32, i32* %206
%208 = icmp eq i32 %207, 0
br i1 %208, label %209, label %238
209: ; preds = %203
%210 = load i32, i32* @PATH_MAX
%211 = add nsw i32 %210, 1
%212 = zext i32 %211 to i64
%213 = call i8* @llvm.stacksave()
store i8* %213, i8** %18
%214 = alloca i8, i64 %212
store i64 %212, i64* %19
%215 = call i8* @realpath(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0), i8* %214)
store i8* %215, i8** %20
%216 = load i8*, i8** %20
%217 = icmp eq i8* %216, null
br i1 %217, label %218, label %222
218: ; preds = %209
%219 = load i32, i32* @stderr
%220 = call i32 (i32, i8*, ...) @fprintf(i32 %219, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0))
%221 = call i32 @exit(i32 1)
unreachable
222: ; preds = %209
%223 = getelementptr inbounds [21 x i8], [21 x i8]* %21, i64 0, i64 0
%224 = load i32, i32* %17
%225 = sext i32 %224 to i64
%226 = getelementptr inbounds [2 x i32], [2 x i32]* %12, i64 0, i64 %225
%227 = load i32, i32* %226
%228 = call i32 @sprintf(i8* %223, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0), i32 %227)
%229 = load i8*, i8** %20
%230 = getelementptr inbounds [21 x i8], [21 x i8]* %21, i64 0, i64 0
%231 = load i8**, i8*** %5
%232 = getelementptr inbounds i8*, i8** %231, i64 2
%233 = load i8*, i8** %232
%234 = call i32 @execl(i8* %229, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0), i8* %230, i8* %233, i32* null)
%235 = load i8*, i8** %20
%236 = call i32 @free(i8* %235)
%237 = load i8*, i8** %18
br label %247
238: ; preds = %203
%239 = load i8**, i8*** %5
%240 = getelementptr inbounds i8*, i8** %239, i64 0
%241 = load i8*, i8** %240
%242 = load i32, i32* %17
%243 = sext i32 %242 to i64
%244 = getelementptr inbounds [2 x i32], [2 x i32]* %16, i64 0, i64 %243
%245 = load i32, i32* %244
%246 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.10, i64 0, i64 0), i8* %241, i32 %245)
br label %247
247: ; preds = %238, %222
br label %248
248: ; preds = %247
%249 = load i32, i32* %17
%250 = add nsw i32 %249, 1
store i32 %250, i32* %17
br label %87
251: ; preds = %87
store i32 0, i32* %22
br label %252
252: ; preds = %352, %251
%253 = load i32, i32* %22
%254 = icmp slt i32 %253, 2
br i1 %254, label %255, label %355
255: ; preds = %252
%256 = call i32 (...) @rand()
%257 = srem i32 %256, 100000
%258 = load i32, i32* %22
%259 = sext i32 %258 to i64
%260 = getelementptr inbounds [2 x i32], [2 x i32]* %10, i64 0, i64 %259
store i32 %257, i32* %260
store i32 12, i32* %23
%261 = load i32, i32* %22
%262 = sext i32 %261 to i64
%263 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %13, i64 0, i64 %262
%264 = getelementptr inbounds [2 x i32], [2 x i32]* %263, i64 0, i64 0
%265 = load i32, i32* %264
%266 = getelementptr inbounds [2 x %struct.sockaddr_in], [2 x %struct.sockaddr_in]* %15, i64 0, i64 0
%267 = bitcast %struct.sockaddr_in* %266 to %struct.sockaddr*
%268 = load i32, i32* %22
%269 = sext i32 %268 to i64
%270 = getelementptr inbounds %struct.sockaddr, %struct.sockaddr* %267, i64 %269
%271 = call i32 @accept(i32 %265, %struct.sockaddr* %270, i32* %23)
%272 = load i32, i32* %22
%273 = sext i32 %272 to i64
%274 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %13, i64 0, i64 %273
%275 = getelementptr inbounds [2 x i32], [2 x i32]* %274, i64 0, i64 1
store i32 %271, i32* %275
%276 = load i32, i32* %22
%277 = sext i32 %276 to i64
%278 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %13, i64 0, i64 %277
%279 = getelementptr inbounds [2 x i32], [2 x i32]* %278, i64 0, i64 1
%280 = load i32, i32* %279
%281 = icmp slt i32 %280, 0
br i1 %281, label %282, label %285
282: ; preds = %255
%283 = load i32, i32* @stderr
%284 = call i32 (i32, i8*, ...) @fprintf(i32 %283, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.11, i64 0, i64 0))
store i32 1, i32* %3
br label %360
285: ; preds = %255
%286 = load i32, i32* %22
%287 = sext i32 %286 to i64
%288 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %13, i64 0, i64 %287
%289 = getelementptr inbounds [2 x i32], [2 x i32]* %288, i64 0, i64 1
%290 = load i32, i32* %289
%291 = load i32, i32* %22
%292 = sext i32 %291 to i64
%293 = getelementptr inbounds [2 x i32], [2 x i32]* %10, i64 0, i64 %292
%294 = call i32 @send(i32 %290, i32* %293, i32 4, i32 0)
%295 = load i32, i32* %22
%296 = sext i32 %295 to i64
%297 = getelementptr inbounds [2 x i32], [2 x i32]* %11, i64 0, i64 %296
store i32 %294, i32* %297
%298 = load i32, i32* %22
%299 = sext i32 %298 to i64
%300 = getelementptr inbounds [2 x i32], [2 x i32]* %11, i64 0, i64 %299
%301 = load i32, i32* %300
%302 = icmp slt i32 %301, 0
br i1 %302, label %303, label %306
303: ; preds = %285
%304 = load i32, i32* @stderr
%305 = call i32 (i32, i8*, ...) @fprintf(i32 %304, i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.12, i64 0, i64 0))
store i32 1, i32* %3
br label %360
306: ; preds = %285
%307 = load i8**, i8*** %5
%308 = getelementptr inbounds i8*, i8** %307, i64 0
%309 = load i8*, i8** %308
%310 = load i32, i32* %22
%311 = sext i32 %310 to i64
%312 = getelementptr inbounds [2 x i32], [2 x i32]* %10, i64 0, i64 %311
%313 = load i32, i32* %312
%314 = load i32, i32* %22
%315 = sext i32 %314 to i64
%316 = getelementptr inbounds [2 x i32], [2 x i32]* %11, i64 0, i64 %315
%317 = load i32, i32* %316
%318 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.13, i64 0, i64 0), i8* %309, i32 %313, i32 %317)
store i32 0, i32* %24
%319 = load i8**, i8*** %5
%320 = getelementptr inbounds i8*, i8** %319, i64 0
%321 = load i8*, i8** %320
%322 = load i32, i32* %22
%323 = sext i32 %322 to i64
%324 = getelementptr inbounds [2 x i32], [2 x i32]* %16, i64 0, i64 %323
%325 = load i32, i32* %324
%326 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.14, i64 0, i64 0), i8* %321, i32 %325)
%327 = load i32, i32* %22
%328 = sext i32 %327 to i64
%329 = getelementptr inbounds [2 x i32], [2 x i32]* %16, i64 0, i64 %328
%330 = load i32, i32* %329
%331 = call i32 @waitpid(i32 %330, i32* %24, i32 0)
%332 = load i32, i32* %22
%333 = sext i32 %332 to i64
%334 = getelementptr inbounds [2 x i32], [2 x i32]* %10, i64 0, i64 %333
%335 = load i32, i32* %334
%336 = load i8**, i8*** %5
%337 = getelementptr inbounds i8*, i8** %336, i64 2
%338 = load i8*, i8** %337
%339 = call i32 @atoi(i8* %338)
%340 = mul nsw i32 %335, %339
store i32 %340, i32* %25
%341 = load i32, i32* %24
%342 = icmp ne i32 %341, 0
br i1 %342, label %343, label %347
343: ; preds = %306
%344 = load i32, i32* %25
%345 = load i32, i32* %24
%346 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.15, i64 0, i64 0), i32 %344, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0), i32 %345)
br label %351
347: ; preds = %306
%348 = load i32, i32* %25
%349 = load i32, i32* %24
%350 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.16, i64 0, i64 0), i32 %348, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0), i32 %349)
br label %351
351: ; preds = %347, %343
br label %352
352: ; preds = %351
%353 = load i32, i32* %22
%354 = add nsw i32 %353, 1
store i32 %354, i32* %22
br label %252
355: ; preds = %252
%356 = load i8**, i8*** %5
%357 = getelementptr inbounds i8*, i8** %356, i64 0
%358 = load i8*, i8** %357
%359 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.17, i64 0, i64 0), i8* %358)
store i32 0, i32* %3
br label %360
360: ; preds = %355, %303, %282, %200, %61, %28
%361 = load i32, i32* %3
ret i32 %361
}

LLVM IR (-O2):
%struct.sockaddr_in = type { i32, %struct.TYPE_2__, i32 }
%struct.TYPE_2__ = type { i32 }
%struct.sockaddr = type { i32 }
@.str = [28 x i8] c"Usage: %s [ port # ] [ # ]\0A\00"
@stderr = global i32 0
@.str.1 = [43 x i8] c"%s process [%d]: %s is not a valid input.\0A\00"
@.str.2 = [22 x i8] c"error: invalid port.\0A\00"
@AF_INET = global i32 0
@SOCK_STREAM = global i32 0
@.str.3 = [23 x i8] c"Error: pipe() failed.\0A\00"
@INADDR_ANY = global i32 0
@.str.4 = [23 x i8] c"Error: bind() failed.\0A\00"
@.str.5 = [25 x i8] c"Error: listen() failed.\0A\00"
@.str.6 = [23 x i8] c"Error: fork() failed.\0A\00"
@PATH_MAX = global i32 0
@.str.7 = [5 x i8] c"Beta\00"
@.str.8 = [29 x i8] c"Error: %s can not be found.\0A\00"
@.str.9 = [3 x i8] c"%d\00"
@.str.10 = [31 x i8] c"%s: forked process with ID %d\0A\00"
@.str.11 = [25 x i8] c"Error: accept() failed.\0A\00"
@.str.12 = [21 x i8] c"error: send failed.\0A\00"
@.str.13 = [42 x i8] c"%s: wrote number %d to socket (%d bytes)\0A\00"
@.str.14 = [39 x i8] c"%s: waiting on child process ID %d...\0A\00"
@.str.15 = [35 x i8] c"%d is not even as %s returned %d.\0A\00"
@.str.16 = [31 x i8] c"%d is even as %s returned %d.\0A\00"
@.str.17 = [14 x i8] c"%s: exiting.\0A\00"
define i32 @main(i32 %0, i8** nocapture %1) {
%3 = alloca [2 x i32]
%4 = alloca [2 x [2 x i32]]
%5 = alloca [2 x %struct.sockaddr_in]
%6 = alloca [2 x %struct.sockaddr_in]
%7 = alloca [2 x i32]
%8 = alloca [21 x i8]
%9 = alloca i32
%10 = alloca i32
%11 = icmp eq i32 %0, 3
br i1 %11, label %15, label %12
12: ; preds = %2
%13 = load i8*, i8** %1
%14 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str, i64 0, i64 0), i8* %13)
br label %256
15: ; preds = %2
%16 = tail call i32 (...) @getpid()
%17 = getelementptr inbounds i8*, i8** %1, i64 1
%18 = load i8*, i8** %17
%19 = tail call i32 @strlen(i8* %18)
%20 = icmp sgt i32 %19, 0
br i1 %20, label %21, label %33
21: ; preds = %15
%22 = zext i32 %19 to i64
br label %25
23: ; preds = %25
%24 = icmp eq i64 %32, %22
br i1 %24, label %33, label %25
25: ; preds = %21, %23
%26 = phi i64 [ 0, %21 ], [ %32, %23 ]
%27 = load i8*, i8** %17
%28 = getelementptr inbounds i8, i8* %27, i64 %26
%29 = load i8, i8* %28
%30 = tail call i32 @isdigit(i8 signext %29)
%31 = icmp eq i32 %30, 0
%32 = add nuw nsw i64 %26, 1
br i1 %31, label %65, label %23
33: ; preds = %23, %15
%34 = getelementptr inbounds i8*, i8** %1, i64 2
%35 = load i8*, i8** %34
%36 = tail call i32 @strlen(i8* %35)
%37 = icmp sgt i32 %36, 0
br i1 %37, label %38, label %50
38: ; preds = %33
%39 = zext i32 %36 to i64
br label %40
40: ; preds = %48, %38
%41 = phi i64 [ 0, %38 ], [ %47, %48 ]
%42 = load i8*, i8** %34
%43 = getelementptr inbounds i8, i8* %42, i64 %41
%44 = load i8, i8* %43
%45 = tail call i32 @isdigit(i8 signext %44)
%46 = icmp eq i32 %45, 0
%47 = add nuw nsw i64 %41, 1
br i1 %46, label %65, label %48
48: ; preds = %40
%49 = icmp eq i64 %47, %39
br i1 %49, label %50, label %40
50: ; preds = %48, %33
%51 = bitcast [2 x i32]* %3 to i8*
%52 = bitcast [2 x [2 x i32]]* %4 to i8*
%53 = bitcast [2 x %struct.sockaddr_in]* %5 to i8*
%54 = bitcast [2 x %struct.sockaddr_in]* %6 to i8*
%55 = bitcast [2 x i32]* %7 to i8*
%56 = load i8*, i8** %17
%57 = tail call i32 @atoi(i8* %56)
%58 = tail call i32 @srand(i32 %57)
%59 = bitcast [2 x %struct.sockaddr_in]* %5 to %struct.sockaddr*
%60 = getelementptr inbounds [21 x i8], [21 x i8]* %8, i64 0, i64 0
%61 = load i8*, i8** %17
%62 = call i32 @atoi(i8* %61)
%63 = add i32 %62, -65001
%64 = icmp ult i32 %63, -64901
br i1 %64, label %71, label %75
65: ; preds = %25, %40
%66 = phi i8** [ %34, %40 ], [ %17, %25 ]
%67 = load i32, i32* @stderr
%68 = load i8*, i8** %1
%69 = load i8*, i8** %66
%70 = tail call i32 (i32, i8*, ...) @fprintf(i32 %67, i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.1, i64 0, i64 0), i8* %68, i32 %16, i8* %69)
br label %256
71: ; preds = %135, %50
%72 = load i32, i32* @stderr
%73 = call i32 (i32, i8*, ...) @fprintf(i32 %72, i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.2, i64 0, i64 0))
%74 = call i32 @exit(i32 1)
unreachable
75: ; preds = %50
%76 = load i32, i32* @AF_INET
%77 = load i32, i32* @SOCK_STREAM
%78 = call i32 @socket(i32 %76, i32 %77, i32 0)
%79 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %4, i64 0, i64 0, i64 0
store i32 %78, i32* %79
%80 = icmp eq i32 %78, -1
br i1 %80, label %81, label %85
81: ; preds = %141, %75
%82 = load i32, i32* @stderr
%83 = call i32 (i32, i8*, ...) @fprintf(i32 %82, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.3, i64 0, i64 0))
%84 = call i32 @exit(i32 1)
unreachable
85: ; preds = %75
%86 = load i32, i32* @AF_INET
%87 = getelementptr inbounds [2 x %struct.sockaddr_in], [2 x %struct.sockaddr_in]* %5, i64 0, i64 0, i32 2
store i32 %86, i32* %87
%88 = load i32, i32* @INADDR_ANY
%89 = getelementptr inbounds [2 x %struct.sockaddr_in], [2 x %struct.sockaddr_in]* %5, i64 0, i64 0, i32 1, i32 0
store i32 %88, i32* %89
%90 = call i32 @htons(i32 %62)
%91 = getelementptr inbounds [2 x %struct.sockaddr_in], [2 x %struct.sockaddr_in]* %5, i64 0, i64 0, i32 0
store i32 %90, i32* %91
%92 = call i64 @bind(i32 %78, %struct.sockaddr* %59, i32 12)
%93 = icmp slt i64 %92, 0
br i1 %93, label %94, label %100
94: ; preds = %147, %85
%95 = phi i32 [ %78, %85 ], [ %144, %147 ]
%96 = call i32 @close(i32 %95)
%97 = load i32, i32* @stderr
%98 = call i32 (i32, i8*, ...) @fprintf(i32 %97, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.4, i64 0, i64 0))
%99 = call i32 @exit(i32 1)
unreachable
100: ; preds = %85
%101 = call i64 @listen(i32 %78, i32 1)
%102 = icmp slt i64 %101, 0
br i1 %102, label %103, label %109
103: ; preds = %158, %100
%104 = phi i32 [ %78, %100 ], [ %144, %158 ]
%105 = call i32 @close(i32 %104)
%106 = load i32, i32* @stderr
%107 = call i32 (i32, i8*, ...) @fprintf(i32 %106, i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.5, i64 0, i64 0))
%108 = call i32 @exit(i32 1)
unreachable
109: ; preds = %100
%110 = call i32 (...) @fork()
%111 = getelementptr inbounds [2 x i32], [2 x i32]* %7, i64 0, i64 0
store i32 %110, i32* %111
switch i32 %110, label %132 [
i32 -1, label %112
i32 0, label %115
]
112: ; preds = %161, %109
%113 = load i32, i32* @stderr
%114 = call i32 (i32, i8*, ...) @fprintf(i32 %113, i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.6, i64 0, i64 0))
br label %254
115: ; preds = %109
%116 = load i32, i32* @PATH_MAX
%117 = add nsw i32 %116, 1
%118 = zext i32 %117 to i64
%119 = call i8* @llvm.stacksave()
%120 = alloca i8, i64 %118
%121 = call i8* @realpath(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0), i8* %120)
%122 = icmp eq i8* %121, null
br i1 %122, label %123, label %127
123: ; preds = %164, %115
%124 = load i32, i32* @stderr
%125 = call i32 (i32, i8*, ...) @fprintf(i32 %124, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.8, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0))
%126 = call i32 @exit(i32 1)
unreachable
127: ; preds = %115
%128 = call i32 @sprintf(i8* %60, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0), i32 %62)
%129 = load i8*, i8** %34
%130 = call i32 @execl(i8* %121, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0), i8* %60, i8* %129, i32* null)
%131 = call i32 @free(i8* %121)
br label %135
132: ; preds = %109
%133 = load i8*, i8** %1
%134 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.10, i64 0, i64 0), i8* %133, i32 %110)
br label %135
135: ; preds = %127, %132
%136 = load i8*, i8** %17
%137 = call i32 @atoi(i8* %136)
%138 = add nsw i32 %137, 1
%139 = add i32 %137, -65000
%140 = icmp ult i32 %139, -64901
br i1 %140, label %71, label %141
141: ; preds = %135
%142 = load i32, i32* @AF_INET
%143 = load i32, i32* @SOCK_STREAM
%144 = call i32 @socket(i32 %142, i32 %143, i32 0)
%145 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %4, i64 0, i64 1, i64 0
store i32 %144, i32* %145
%146 = icmp eq i32 %144, -1
br i1 %146, label %81, label %147
147: ; preds = %141
%148 = load i32, i32* @AF_INET
%149 = getelementptr inbounds [2 x %struct.sockaddr_in], [2 x %struct.sockaddr_in]* %5, i64 0, i64 1, i32 2
store i32 %148, i32* %149
%150 = load i32, i32* @INADDR_ANY
%151 = getelementptr inbounds [2 x %struct.sockaddr_in], [2 x %struct.sockaddr_in]* %5, i64 0, i64 1, i32 1, i32 0
store i32 %150, i32* %151
%152 = call i32 @htons(i32 %138)
%153 = getelementptr inbounds [2 x %struct.sockaddr_in], [2 x %struct.sockaddr_in]* %5, i64 0, i64 1, i32 0
store i32 %152, i32* %153
%154 = getelementptr inbounds [2 x %struct.sockaddr_in], [2 x %struct.sockaddr_in]* %5, i64 0, i64 0, i32 1
%155 = bitcast %struct.TYPE_2__* %154 to %struct.sockaddr*
%156 = call i64 @bind(i32 %144, %struct.sockaddr* %155, i32 12)
%157 = icmp slt i64 %156, 0
br i1 %157, label %94, label %158
158: ; preds = %147
%159 = call i64 @listen(i32 %144, i32 1)
%160 = icmp slt i64 %159, 0
br i1 %160, label %103, label %161
161: ; preds = %158
%162 = call i32 (...) @fork()
%163 = getelementptr inbounds [2 x i32], [2 x i32]* %7, i64 0, i64 1
store i32 %162, i32* %163
switch i32 %162, label %177 [
i32 -1, label %112
i32 0, label %164
]
164: ; preds = %161
%165 = load i32, i32* @PATH_MAX
%166 = add nsw i32 %165, 1
%167 = zext i32 %166 to i64
%168 = call i8* @llvm.stacksave()
%169 = alloca i8, i64 %167
%170 = call i8* @realpath(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0), i8* %169)
%171 = icmp eq i8* %170, null
br i1 %171, label %123, label %172
172: ; preds = %164
%173 = call i32 @sprintf(i8* %60, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i64 0, i64 0), i32 %138)
%174 = load i8*, i8** %34
%175 = call i32 @execl(i8* %170, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0), i8* %60, i8* %174, i32* null)
%176 = call i32 @free(i8* %170)
br label %180
177: ; preds = %161
%178 = load i8*, i8** %1
%179 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.10, i64 0, i64 0), i8* %178, i32 %162)
br label %180
180: ; preds = %177, %172
%181 = bitcast i32* %9 to i8*
%182 = bitcast [2 x %struct.sockaddr_in]* %6 to %struct.sockaddr*
%183 = bitcast i32* %10 to i8*
%184 = call i32 (...) @rand()
%185 = srem i32 %184, 100000
%186 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 0
store i32 %185, i32* %186
store i32 12, i32* %9
%187 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %4, i64 0, i64 0, i64 0
%188 = load i32, i32* %187
%189 = call i32 @accept(i32 %188, %struct.sockaddr* %182, i32* %9)
%190 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %4, i64 0, i64 0, i64 1
store i32 %189, i32* %190
%191 = icmp slt i32 %189, 0
br i1 %191, label %214, label %192
192: ; preds = %180
%193 = call i32 @send(i32 %189, i32* %186, i32 4, i32 0)
%194 = icmp slt i32 %193, 0
br i1 %194, label %214, label %195
195: ; preds = %192
%196 = load i8*, i8** %1
%197 = load i32, i32* %186
%198 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @.str.13, i64 0, i64 0), i8* %196, i32 %197, i32 %193)
store i32 0, i32* %10
%199 = load i8*, i8** %1
%200 = getelementptr inbounds [2 x i32], [2 x i32]* %7, i64 0, i64 0
%201 = load i32, i32* %200
%202 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @.str.14, i64 0, i64 0), i8* %199, i32 %201)
%203 = call i32 @waitpid(i32 %201, i32* %10, i32 0)
%204 = load i32, i32* %186
%205 = load i8*, i8** %34
%206 = call i32 @atoi(i8* %205)
%207 = mul nsw i32 %206, %204
%208 = load i32, i32* %10
%209 = icmp eq i32 %208, 0
br i1 %209, label %212, label %210
210: ; preds = %195
%211 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.15, i64 0, i64 0), i32 %207, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0), i32 %208)
br label %218
212: ; preds = %195
%213 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.16, i64 0, i64 0), i32 %207, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0), i32 0)
br label %218
214: ; preds = %192, %229, %180, %218
%215 = phi i8* [ getelementptr inbounds ([25 x i8], [25 x i8]* @.str.11, i64 0, i64 0), %218 ], [ getelementptr inbounds ([25 x i8], [25 x i8]* @.str.11, i64 0, i64 0), %180 ], [ getelementptr inbounds ([21 x i8], [21 x i8]* @.str.12, i64 0, i64 0), %229 ], [ getelementptr inbounds ([21 x i8], [21 x i8]* @.str.12, i64 0, i64 0), %192 ]
%216 = load i32, i32* @stderr
%217 = call i32 (i32, i8*, ...) @fprintf(i32 %216, i8* %215)
br label %254
218: ; preds = %212, %210
%219 = call i32 (...) @rand()
%220 = srem i32 %219, 100000
%221 = getelementptr inbounds [2 x i32], [2 x i32]* %3, i64 0, i64 1
store i32 %220, i32* %221
store i32 12, i32* %9
%222 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %4, i64 0, i64 1, i64 0
%223 = load i32, i32* %222
%224 = getelementptr inbounds [2 x %struct.sockaddr_in], [2 x %struct.sockaddr_in]* %6, i64 0, i64 0, i32 1
%225 = bitcast %struct.TYPE_2__* %224 to %struct.sockaddr*
%226 = call i32 @accept(i32 %223, %struct.sockaddr* %225, i32* %9)
%227 = getelementptr inbounds [2 x [2 x i32]], [2 x [2 x i32]]* %4, i64 0, i64 1, i64 1
store i32 %226, i32* %227
%228 = icmp slt i32 %226, 0
br i1 %228, label %214, label %229
229: ; preds = %218
%230 = call i32 @send(i32 %226, i32* %221, i32 4, i32 0)
%231 = icmp slt i32 %230, 0
br i1 %231, label %214, label %232
232: ; preds = %229
%233 = load i8*, i8** %1
%234 = load i32, i32* %221
%235 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @.str.13, i64 0, i64 0), i8* %233, i32 %234, i32 %230)
store i32 0, i32* %10
%236 = load i8*, i8** %1
%237 = getelementptr inbounds [2 x i32], [2 x i32]* %7, i64 0, i64 1
%238 = load i32, i32* %237
%239 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @.str.14, i64 0, i64 0), i8* %236, i32 %238)
%240 = call i32 @waitpid(i32 %238, i32* %10, i32 0)
%241 = load i32, i32* %221
%242 = load i8*, i8** %34
%243 = call i32 @atoi(i8* %242)
%244 = mul nsw i32 %243, %241
%245 = load i32, i32* %10
%246 = icmp eq i32 %245, 0
br i1 %246, label %249, label %247
247: ; preds = %232
%248 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @.str.15, i64 0, i64 0), i32 %244, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0), i32 %245)
br label %251
249: ; preds = %232
%250 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @.str.16, i64 0, i64 0), i32 %244, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0), i32 0)
br label %251
251: ; preds = %249, %247
%252 = load i8*, i8** %1
%253 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.17, i64 0, i64 0), i8* %252)
br label %254
254: ; preds = %214, %112, %251
%255 = phi i32 [ 0, %251 ], [ 1, %112 ], [ 1, %214 ]
br label %256
256: ; preds = %65, %254, %12
%257 = phi i32 [ -1, %12 ], [ %255, %254 ], [ 2, %65 ]
ret i32 %257
}