#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*/ time_t;
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 socklen_t;

/* Variables and functions */
int /*<<< orphan*/ AF_INET;
int /*<<< orphan*/ PF_INET;
int /*<<< orphan*/ SOCK_STREAM;
int /*<<< orphan*/ connect(int, struct sockaddr *, int);
int /*<<< orphan*/ htons(int);
int /*<<< orphan*/ inet_addr(char *);
int /*<<< orphan*/ memset(char *, char, int);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ puts(char *);
int rand();
int /*<<< orphan*/ scanf(char *, char *);
scalar_t__ send(int, char *, int, int /*<<< orphan*/);
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ sprintf(char *, char *, int);
int /*<<< orphan*/ srand(unsigned int);
char *strcat(char *, char *);
scalar_t__ strcmp(char *, char *);
int strlen(char *);
scalar_t__ time(int /*<<< orphan*/ *);
int main() {
  int clientSocket;
  char buffer[1000];
  struct sockaddr_in serverAddr;
  socklen_t addr_size;
  char input[1000];
  char message[1000], server_reply[1000];
  time_t t;
  srand((unsigned)time(&t));
  int gamenum = 1;
  char gamenumber[1000];
  char final[1000];
  clientSocket = socket(PF_INET, SOCK_STREAM, 0);
  serverAddr.sin_family = AF_INET;
  serverAddr.sin_port = htons(4501);
  serverAddr.sin_addr.s_addr = inet_addr("127.0.0.1");
  memset(serverAddr.sin_zero, '\0', sizeof serverAddr.sin_zero);
  addr_size = sizeof serverAddr;
  connect(clientSocket, (struct sockaddr *)&serverAddr, addr_size);
  int flag = 0;
  while (strcmp(message, "q") != 0) {
    do {
      flag = 0;
      memset((message), 0, strlen(message));
      printf("Enter your choice\n");
      scanf("%s", message);
      if (strcmp(message, "q") != 0 && strcmp(message, "p") != 0 &&
          strcmp(message, "r") != 0 && strcmp(message, "s") != 0) {
        printf("Choice not accepted. Try again\n");
        flag = 1;
      }
      if (strcmp(message, "q") == 0) {
        send(clientSocket, "quit", strlen("duck"), 0);
        return 1;
      }
    } while (flag == 1);
    int player_choice = 5;
    if (strcmp(message, "q") == 0)
      player_choice = 3;
    if (strcmp(message, "r") == 0)
      player_choice = 0;
    if (strcmp(message, "p") == 0)
      player_choice = 1;
    if (strcmp(message, "s") == 0)
      player_choice = 2;
    int winner = 5;
    sprintf(gamenumber, "%d", gamenum);
    strcat(gamenumber, " ");
    if (player_choice != 5 && player_choice != 3) {
      winner = (3 + player_choice - (rand() % 3)) % 3;
    }
    if (player_choice == 3) {
      winner = 3;
    }
    if (winner == 1) {
      strcat(final, strcat(gamenumber, "player 1 wins!"));
      if (send(clientSocket, final, strlen(final), 0) < 0) {
        puts("Send failed");
        return 1;
      }
    } else if (winner == 2) {
      strcat(final, strcat(gamenumber, "player 2 wins!"));
      if (send(clientSocket, final, strlen(final), 0) < 0) {
        puts("Send failed");
        return 1;
      }
    } else if (winner == 0) {
      strcat(final, strcat(gamenumber, "is a tie!"));
      if (send(clientSocket, final, strlen(final), 0) < 0) {
        puts("Send failed");
        return 1;
      }
    } else if (winner == 3) {
      strcat(final, "quit");
      if (send(clientSocket, final, strlen(final), 0) < 0) {
        puts("Send failed");
        return 1;
      }
    } else {
      printf("Error");
    }
    gamenum++;
    memset((message), 0, strlen(message));
    memset((final), 0, strlen(final));
    memset((gamenumber), 0, strlen(gamenumber));
    memset((server_reply), 0, strlen(server_reply));
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1860,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0xfe4(%rbp),%rdi
call   10c0 <time@plt>
mov    %eax,%edi
call   1090 <srand@plt>
movl   $0x1,-0xfe8(%rbp)
mov    0x2d9a(%rip),%rax
mov    (%rax),%edi
mov    0x2d99(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1120 <socket@plt>
mov    %eax,-0x8(%rbp)
mov    0x2d96(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x3f8(%rbp)
mov    $0x1195,%edi
call   1050 <htons@plt>
mov    %eax,-0x3fc(%rbp)
lea    0xd8f(%rip),%rdi
call   10a0 <inet_addr@plt>
mov    %eax,-0x400(%rbp)
mov    -0x408(%rbp),%rdi
xor    %esi,%esi
mov    $0x8,%edx
call   1080 <memset@plt>
movl   $0x18,-0x40c(%rbp)
mov    -0x8(%rbp),%edi
lea    -0x408(%rbp),%rsi
mov    -0x40c(%rbp),%edx
call   1100 <connect@plt>
movl   $0x0,-0x17c4(%rbp)
lea    -0xbf0(%rbp),%rdi
lea    0xd44(%rip),%rsi
call   10b0 <strcmp@plt>
cmp    $0x0,%rax
je     188c <main+0x68c>
jmp    12da <main+0xda>
movl   $0x0,-0x17c4(%rbp)
lea    -0xbf0(%rbp),%rax
mov    %rax,-0x17d8(%rbp)
lea    -0xbf0(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x17d8(%rbp),%rdi
mov    %eax,%edx
xor    %esi,%esi
call   1080 <memset@plt>
lea    0xcf7(%rip),%rdi
call   1070 <printf@plt>
lea    -0xbf0(%rbp),%rsi
lea    0xcf7(%rip),%rdi
call   10d0 <scanf@plt>
lea    -0xbf0(%rbp),%rdi
lea    0xccf(%rip),%rsi
call   10b0 <strcmp@plt>
cmp    $0x0,%rax
je     13b7 <main+0x1b7>
lea    -0xbf0(%rbp),%rdi
lea    0xcca(%rip),%rsi
call   10b0 <strcmp@plt>
cmp    $0x0,%rax
je     13b7 <main+0x1b7>
lea    -0xbf0(%rbp),%rdi
lea    0xd16(%rip),%rsi
call   10b0 <strcmp@plt>
cmp    $0x0,%rax
je     13b7 <main+0x1b7>
lea    -0xbf0(%rbp),%rdi
lea    0xc8e(%rip),%rsi
call   10b0 <strcmp@plt>
cmp    $0x0,%rax
je     13b7 <main+0x1b7>
lea    0xc7c(%rip),%rdi
call   1070 <printf@plt>
movl   $0x1,-0x17c4(%rbp)
lea    -0xbf0(%rbp),%rdi
lea    0xc45(%rip),%rsi
call   10b0 <strcmp@plt>
cmp    $0x0,%rax
jne    140b <main+0x20b>
mov    -0x8(%rbp),%eax
mov    %eax,-0x17dc(%rbp)
lea    0xc65(%rip),%rdi
call   1040 <strlen@plt>
mov    -0x17dc(%rbp),%edi
mov    %eax,%edx
lea    0xc4c(%rip),%rsi
xor    %ecx,%ecx
call   1060 <send@plt>
movl   $0x1,-0x4(%rbp)
jmp    1893 <main+0x693>
jmp    1410 <main+0x210>
cmpl   $0x1,-0x17c4(%rbp)
je     12da <main+0xda>
movl   $0x5,-0x17c8(%rbp)
lea    -0xbf0(%rbp),%rdi
lea    0xbd5(%rip),%rsi
call   10b0 <strcmp@plt>
cmp    $0x0,%rax
jne    144e <main+0x24e>
movl   $0x3,-0x17c8(%rbp)
lea    -0xbf0(%rbp),%rdi
lea    0xc2f(%rip),%rsi
call   10b0 <strcmp@plt>
cmp    $0x0,%rax
jne    1475 <main+0x275>
movl   $0x0,-0x17c8(%rbp)
lea    -0xbf0(%rbp),%rdi
lea    0xb9f(%rip),%rsi
call   10b0 <strcmp@plt>
cmp    $0x0,%rax
jne    149c <main+0x29c>
movl   $0x1,-0x17c8(%rbp)
lea    -0xbf0(%rbp),%rdi
lea    0xb76(%rip),%rsi
call   10b0 <strcmp@plt>
cmp    $0x0,%rax
jne    14c3 <main+0x2c3>
movl   $0x2,-0x17c8(%rbp)
movl   $0x5,-0x17cc(%rbp)
lea    -0x13d0(%rbp),%rdi
mov    -0xfe8(%rbp),%edx
lea    0xb6d(%rip),%rsi
call   10f0 <sprintf@plt>
lea    -0x13d0(%rbp),%rdi
lea    0xb5d(%rip),%rsi
call   10e0 <strcat@plt>
cmpl   $0x5,-0x17c8(%rbp)
je     1547 <main+0x347>
cmpl   $0x3,-0x17c8(%rbp)
je     1547 <main+0x347>
mov    -0x17c8(%rbp),%eax
add    $0x3,%eax
mov    %eax,-0x17e0(%rbp)
mov    $0x0,%al
call   1110 <rand@plt>
mov    $0x3,%ecx
cltd
idiv   %ecx
mov    -0x17e0(%rbp),%eax
sub    %edx,%eax
mov    $0x3,%ecx
cltd
idiv   %ecx
mov    %edx,-0x17cc(%rbp)
cmpl   $0x3,-0x17c8(%rbp)
jne    155e <main+0x35e>
movl   $0x3,-0x17cc(%rbp)
cmpl   $0x1,-0x17cc(%rbp)
jne    15fb <main+0x3fb>
lea    -0x17c0(%rbp),%rax
mov    %rax,-0x17f8(%rbp)
lea    -0x13d0(%rbp),%rdi
lea    0xacc(%rip),%rsi
call   10e0 <strcat@plt>
mov    -0x17f8(%rbp),%rdi
mov    %rax,%rsi
call   10e0 <strcat@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0x17ec(%rbp)
lea    -0x17c0(%rbp),%rax
mov    %rax,-0x17e8(%rbp)
lea    -0x17c0(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x17ec(%rbp),%edi
mov    -0x17e8(%rbp),%rsi
mov    %eax,%edx
xor    %ecx,%ecx
call   1060 <send@plt>
cmp    $0x0,%rax
jge    15f6 <main+0x3f6>
lea    0xa7d(%rip),%rdi
call   1030 <puts@plt>
movl   $0x1,-0x4(%rbp)
jmp    1893 <main+0x693>
jmp    17d0 <main+0x5d0>
cmpl   $0x2,-0x17cc(%rbp)
jne    1698 <main+0x498>
lea    -0x17c0(%rbp),%rax
mov    %rax,-0x1810(%rbp)
lea    -0x13d0(%rbp),%rdi
lea    0xa4a(%rip),%rsi
call   10e0 <strcat@plt>
mov    -0x1810(%rbp),%rdi
mov    %rax,%rsi
call   10e0 <strcat@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0x1804(%rbp)
lea    -0x17c0(%rbp),%rax
mov    %rax,-0x1800(%rbp)
lea    -0x17c0(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x1804(%rbp),%edi
mov    -0x1800(%rbp),%rsi
mov    %eax,%edx
xor    %ecx,%ecx
call   1060 <send@plt>
cmp    $0x0,%rax
jge    1693 <main+0x493>
lea    0x9e0(%rip),%rdi
call   1030 <puts@plt>
movl   $0x1,-0x4(%rbp)
jmp    1893 <main+0x693>
jmp    17cb <main+0x5cb>
cmpl   $0x0,-0x17cc(%rbp)
jne    1735 <main+0x535>
lea    -0x17c0(%rbp),%rax
mov    %rax,-0x1828(%rbp)
lea    -0x13d0(%rbp),%rdi
lea    0x9bc(%rip),%rsi
call   10e0 <strcat@plt>
mov    -0x1828(%rbp),%rdi
mov    %rax,%rsi
call   10e0 <strcat@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0x181c(%rbp)
lea    -0x17c0(%rbp),%rax
mov    %rax,-0x1818(%rbp)
lea    -0x17c0(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x181c(%rbp),%edi
mov    -0x1818(%rbp),%rsi
mov    %eax,%edx
xor    %ecx,%ecx
call   1060 <send@plt>
cmp    $0x0,%rax
jge    1730 <main+0x530>
lea    0x943(%rip),%rdi
call   1030 <puts@plt>
movl   $0x1,-0x4(%rbp)
jmp    1893 <main+0x693>
jmp    17c6 <main+0x5c6>
cmpl   $0x3,-0x17cc(%rbp)
jne    17b5 <main+0x5b5>
lea    -0x17c0(%rbp),%rdi
lea    0x8f4(%rip),%rsi
call   10e0 <strcat@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0x1834(%rbp)
lea    -0x17c0(%rbp),%rax
mov    %rax,-0x1830(%rbp)
lea    -0x17c0(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x1834(%rbp),%edi
mov    -0x1830(%rbp),%rsi
mov    %eax,%edx
xor    %ecx,%ecx
call   1060 <send@plt>
cmp    $0x0,%rax
jge    17b0 <main+0x5b0>
lea    0x8c3(%rip),%rdi
call   1030 <puts@plt>
movl   $0x1,-0x4(%rbp)
jmp    1893 <main+0x693>
jmp    17c1 <main+0x5c1>
lea    0x8cb(%rip),%rdi
call   1070 <printf@plt>
jmp    17c6 <main+0x5c6>
jmp    17cb <main+0x5cb>
jmp    17d0 <main+0x5d0>
mov    -0xfe8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xfe8(%rbp)
lea    -0xbf0(%rbp),%rax
mov    %rax,-0x1858(%rbp)
lea    -0xbf0(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x1858(%rbp),%rdi
mov    %eax,%edx
xor    %esi,%esi
call   1080 <memset@plt>
lea    -0x17c0(%rbp),%rax
mov    %rax,-0x1850(%rbp)
lea    -0x17c0(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x1850(%rbp),%rdi
mov    %eax,%edx
xor    %esi,%esi
call   1080 <memset@plt>
lea    -0x13d0(%rbp),%rax
mov    %rax,-0x1848(%rbp)
lea    -0x13d0(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x1848(%rbp),%rdi
mov    %eax,%edx
xor    %esi,%esi
call   1080 <memset@plt>
lea    -0xfe0(%rbp),%rax
mov    %rax,-0x1840(%rbp)
lea    -0xfe0(%rbp),%rdi
call   1040 <strlen@plt>
mov    -0x1840(%rbp),%rdi
mov    %eax,%edx
xor    %esi,%esi
call   1080 <memset@plt>
jmp    12b8 <main+0xb8>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x1860,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0xfe8,%rsp
lea    0x14(%rsp),%rdi
call   10c0 <time@plt>
mov    %eax,%edi
call   1090 <srand@plt>
mov    0x2da7(%rip),%rax
mov    (%rax),%edi
mov    0x2da6(%rip),%rax
mov    (%rax),%esi
xor    %r13d,%r13d
xor    %edx,%edx
call   1120 <socket@plt>
mov    %eax,%ebx
mov    0x2da1(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x28(%rsp)
mov    $0x1195,%edi
call   1050 <htons@plt>
mov    %eax,0x24(%rsp)
lea    0xdae(%rip),%rdi
call   10a0 <inet_addr@plt>
mov    %eax,0x20(%rsp)
xor    %esi,%esi
mov    $0x8,%edx
call   1080 <memset@plt>
lea    0x18(%rsp),%rsi
mov    %ebx,0xc(%rsp)
mov    %ebx,%edi
mov    $0x18,%edx
call   1100 <connect@plt>
lea    0xd87(%rip),%rsi
lea    0x810(%rsp),%rdi
call   10b0 <strcmp@plt>
test   %rax,%rax
je     15f9 <main+0x3f9>
lea    0x810(%rsp),%rbx
lea    0xdb0(%rip),%r15
lea    0xd5d(%rip),%r12
lea    0xd54(%rip),%r14
movl   $0x1,0x10(%rsp)
lea    0xd91(%rip),%r13
cs nopw 0x0(%rax,%rax,1)
nop
mov    %rbx,%rdi
call   1040 <strlen@plt>
xor    %ebp,%ebp
mov    %rbx,%rdi
xor    %esi,%esi
mov    %eax,%edx
call   1080 <memset@plt>
mov    %r15,%rdi
call   1030 <puts@plt>
mov    %r12,%rdi
mov    %rbx,%rsi
call   10d0 <scanf@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   10b0 <strcmp@plt>
test   %rax,%rax
je     1372 <main+0x172>
mov    %rbx,%rdi
lea    0xcfc(%rip),%rsi
call   10b0 <strcmp@plt>
test   %rax,%rax
je     1370 <main+0x170>
mov    %rbx,%rdi
mov    %r13,%rsi
call   10b0 <strcmp@plt>
test   %rax,%rax
je     1370 <main+0x170>
mov    %rbx,%rdi
lea    0xcd6(%rip),%rsi
call   10b0 <strcmp@plt>
test   %rax,%rax
je     1370 <main+0x170>
lea    0xd22(%rip),%rdi
call   1030 <puts@plt>
mov    $0x1,%bpl
jmp    1372 <main+0x172>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
xor    %ebp,%ebp
mov    %rbx,%rdi
mov    %r14,%rsi
call   10b0 <strcmp@plt>
test   %rax,%rax
je     15d3 <main+0x3d3>
test   %bpl,%bpl
jne    12e0 <main+0xe0>
mov    %rbx,%rdi
mov    %r14,%rsi
call   10b0 <strcmp@plt>
xor    %ecx,%ecx
test   %rax,%rax
setne  %cl
lea    (%rcx,%rcx,1),%ebp
add    $0x3,%ebp
mov    %rbx,%rdi
mov    %r13,%rsi
call   10b0 <strcmp@plt>
test   %rax,%rax
mov    $0x0,%eax
cmove  %eax,%ebp
mov    %rbx,%rdi
lea    0xc57(%rip),%rsi
call   10b0 <strcmp@plt>
test   %rax,%rax
mov    $0x1,%eax
cmove  %eax,%ebp
mov    %rbx,%rdi
lea    0xc3b(%rip),%rsi
call   10b0 <strcmp@plt>
test   %rax,%rax
mov    $0x2,%eax
cmove  %eax,%ebp
lea    0x30(%rsp),%r13
mov    %r13,%rdi
lea    0xc2a(%rip),%rsi
mov    0x10(%rsp),%edx
call   10f0 <sprintf@plt>
mov    %r13,%rdi
call   1040 <strlen@plt>
movw   $0x20,0x30(%rsp,%rax,1)
mov    $0x5,%al
cmp    $0x3,%ebp
je     145e <main+0x25e>
cmp    $0x5,%ebp
je     145e <main+0x25e>
xor    %eax,%eax
call   1110 <rand@plt>
cltq
imul   $0x55555556,%rax,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
shr    $0x20,%rcx
add    %edx,%ecx
lea    (%rcx,%rcx,2),%ecx
sub    %eax,%ecx
lea    (%rcx,%rbp,1),%eax
add    $0x3,%eax
movzbl %al,%eax
imul   $0xab,%eax,%ecx
shr    $0x9,%ecx
lea    (%rcx,%rcx,2),%ecx
sub    %cl,%al
cmp    $0x3,%ebp
movzbl %al,%eax
cmove  %ebp,%eax
cmp    $0x3,%al
ja     149e <main+0x29e>
movzbl %al,%eax
lea    0xb8b(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    %r13,%rdi
call   1040 <strlen@plt>
movabs $0x6569742061207369,%rcx
74 69 65
mov    %rcx,0x30(%rsp,%rax,1)
movw   $0x21,0x38(%rsp,%rax,1)
jmp    1500 <main+0x300>
lea    0xbbd(%rip),%rdi
call   1070 <printf@plt>
lea    0x420(%rsp),%rbp
jmp    1559 <main+0x359>
mov    %r13,%rdi
call   1040 <strlen@plt>
movabs $0x3120726579616c70,%rcx
72 20 31
mov    %rcx,0x30(%rsp,%rax,1)
movabs $0x21736e69772031,%rcx
jmp    14fb <main+0x2fb>
mov    %r13,%rdi
call   1040 <strlen@plt>
movabs $0x3220726579616c70,%rcx
72 20 32
mov    %rcx,0x30(%rsp,%rax,1)
movabs $0x21736e69772032,%rcx
mov    %rcx,0x37(%rsp,%rax,1)
lea    0x420(%rsp),%rbp
mov    %rbp,%rdi
mov    %r13,%rsi
call   10e0 <strcat@plt>
jmp    1538 <main+0x338>
lea    0x420(%rsp),%rbp
mov    %rbp,%rdi
call   1040 <strlen@plt>
movl   $0x74697571,0x420(%rsp,%rax,1)
71 75 69 74
movb   $0x0,0x424(%rsp,%rax,1)
mov    %rbp,%rdi
call   1040 <strlen@plt>
mov    0xc(%rsp),%edi
mov    %rbp,%rsi
mov    %eax,%edx
xor    %ecx,%ecx
call   1060 <send@plt>
test   %rax,%rax
js     160e <main+0x40e>
addl   $0x1,0x10(%rsp)
mov    %rbx,%rdi
call   1040 <strlen@plt>
xor    %r13d,%r13d
mov    %rbx,%rdi
xor    %esi,%esi
mov    %eax,%edx
call   1080 <memset@plt>
mov    %rbp,%rdi
call   1040 <strlen@plt>
mov    %rbp,%rdi
xor    %esi,%esi
mov    %eax,%edx
call   1080 <memset@plt>
lea    0x30(%rsp),%rdi
call   1040 <strlen@plt>
lea    0x30(%rsp),%rdi
xor    %esi,%esi
mov    %eax,%edx
call   1080 <memset@plt>
lea    0xc00(%rsp),%rbp
mov    %rbp,%rdi
call   1040 <strlen@plt>
mov    %rbp,%rdi
xor    %esi,%esi
mov    %eax,%edx
call   1080 <memset@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   10b0 <strcmp@plt>
test   %rax,%rax
jne    12ce <main+0xce>
jmp    15f9 <main+0x3f9>
lea    0xa4c(%rip),%rdi
call   1040 <strlen@plt>
lea    0xa3b(%rip),%rsi
mov    0xc(%rsp),%edi
mov    %eax,%edx
xor    %ecx,%ecx
call   1060 <send@plt>
mov    $0x1,%r13d
mov    %r13d,%eax
add    $0xfe8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xa28(%rip),%rdi
call   1030 <puts@plt>
jmp    15f3 <main+0x3f3>

LLVM IR (-O0):
%struct.sockaddr_in = type { i8*, %struct.TYPE_2__, i32, i32 }
%struct.TYPE_2__ = type { i32 }
%struct.sockaddr = type { i32 }
@PF_INET = global i32 0
@SOCK_STREAM = global i32 0
@AF_INET = global i32 0
@.str = [10 x i8] c"127.0.0.1\00"
@.str.1 = [2 x i8] c"q\00"
@.str.2 = [19 x i8] c"Enter your choice\0A\00"
@.str.3 = [3 x i8] c"%s\00"
@.str.4 = [2 x i8] c"p\00"
@.str.5 = [2 x i8] c"r\00"
@.str.6 = [2 x i8] c"s\00"
@.str.7 = [32 x i8] c"Choice not accepted. Try again\0A\00"
@.str.8 = [5 x i8] c"quit\00"
@.str.9 = [5 x i8] c"duck\00"
@.str.10 = [3 x i8] c"%d\00"
@.str.11 = [2 x i8] c" \00"
@.str.12 = [15 x i8] c"player 1 wins!\00"
@.str.13 = [12 x i8] c"Send failed\00"
@.str.14 = [15 x i8] c"player 2 wins!\00"
@.str.15 = [10 x i8] c"is a tie!\00"
@.str.16 = [6 x i8] c"Error\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [1000 x i8]
%4 = alloca %struct.sockaddr_in
%5 = alloca i32
%6 = alloca [1000 x i8]
%7 = alloca [1000 x i8]
%8 = alloca [1000 x i8]
%9 = alloca i32
%10 = alloca i32
%11 = alloca [1000 x i8]
%12 = alloca [1000 x i8]
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
store i32 0, i32* %1
%16 = call i64 @time(i32* %9)
%17 = trunc i64 %16 to i32
%18 = call i32 @srand(i32 %17)
store i32 1, i32* %10
%19 = load i32, i32* @PF_INET
%20 = load i32, i32* @SOCK_STREAM
%21 = call i32 @socket(i32 %19, i32 %20, i32 0)
store i32 %21, i32* %2
%22 = load i32, i32* @AF_INET
%23 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %4, i32 0, i32 3
store i32 %22, i32* %23
%24 = call i32 @htons(i32 4501)
%25 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %4, i32 0, i32 2
store i32 %24, i32* %25
%26 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%27 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %4, i32 0, i32 1
%28 = getelementptr inbounds %struct.TYPE_2__, %struct.TYPE_2__* %27, i32 0, i32 0
store i32 %26, i32* %28
%29 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %4, i32 0, i32 0
%30 = load i8*, i8** %29
%31 = call i32 @memset(i8* %30, i8 signext 0, i32 8)
store i32 24, i32* %5
%32 = load i32, i32* %2
%33 = bitcast %struct.sockaddr_in* %4 to %struct.sockaddr*
%34 = load i32, i32* %5
%35 = call i32 @connect(i32 %32, %struct.sockaddr* %33, i32 %34)
store i32 0, i32* %13
br label %36
36: ; preds = %191, %0
%37 = getelementptr inbounds [1000 x i8], [1000 x i8]* %7, i64 0, i64 0
%38 = call i64 @strcmp(i8* %37, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%39 = icmp ne i64 %38, 0
br i1 %39, label %40, label %210
40: ; preds = %36
br label %41
41: ; preds = %75, %40
store i32 0, i32* %13
%42 = getelementptr inbounds [1000 x i8], [1000 x i8]* %7, i64 0, i64 0
%43 = getelementptr inbounds [1000 x i8], [1000 x i8]* %7, i64 0, i64 0
%44 = call i32 @strlen(i8* %43)
%45 = call i32 @memset(i8* %42, i8 signext 0, i32 %44)
%46 = call i32 @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.2, i64 0, i64 0))
%47 = getelementptr inbounds [1000 x i8], [1000 x i8]* %7, i64 0, i64 0
%48 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* %47)
%49 = getelementptr inbounds [1000 x i8], [1000 x i8]* %7, i64 0, i64 0
%50 = call i64 @strcmp(i8* %49, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%51 = icmp ne i64 %50, 0
br i1 %51, label %52, label %66
52: ; preds = %41
%53 = getelementptr inbounds [1000 x i8], [1000 x i8]* %7, i64 0, i64 0
%54 = call i64 @strcmp(i8* %53, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%55 = icmp ne i64 %54, 0
br i1 %55, label %56, label %66
56: ; preds = %52
%57 = getelementptr inbounds [1000 x i8], [1000 x i8]* %7, i64 0, i64 0
%58 = call i64 @strcmp(i8* %57, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%59 = icmp ne i64 %58, 0
br i1 %59, label %60, label %66
60: ; preds = %56
%61 = getelementptr inbounds [1000 x i8], [1000 x i8]* %7, i64 0, i64 0
%62 = call i64 @strcmp(i8* %61, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
%63 = icmp ne i64 %62, 0
br i1 %63, label %64, label %66
64: ; preds = %60
%65 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.7, i64 0, i64 0))
store i32 1, i32* %13
br label %66
66: ; preds = %64, %60, %56, %52, %41
%67 = getelementptr inbounds [1000 x i8], [1000 x i8]* %7, i64 0, i64 0
%68 = call i64 @strcmp(i8* %67, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%69 = icmp eq i64 %68, 0
br i1 %69, label %70, label %74
70: ; preds = %66
%71 = load i32, i32* %2
%72 = call i32 @strlen(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.9, i64 0, i64 0))
%73 = call i64 @send(i32 %71, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0), i32 %72, i32 0)
store i32 1, i32* %1
br label %211
74: ; preds = %66
br label %75
75: ; preds = %74
%76 = load i32, i32* %13
%77 = icmp eq i32 %76, 1
br i1 %77, label %41, label %78
78: ; preds = %75
store i32 5, i32* %14
%79 = getelementptr inbounds [1000 x i8], [1000 x i8]* %7, i64 0, i64 0
%80 = call i64 @strcmp(i8* %79, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%81 = icmp eq i64 %80, 0
br i1 %81, label %82, label %83
82: ; preds = %78
store i32 3, i32* %14
br label %83
83: ; preds = %82, %78
%84 = getelementptr inbounds [1000 x i8], [1000 x i8]* %7, i64 0, i64 0
%85 = call i64 @strcmp(i8* %84, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%86 = icmp eq i64 %85, 0
br i1 %86, label %87, label %88
87: ; preds = %83
store i32 0, i32* %14
br label %88
88: ; preds = %87, %83
%89 = getelementptr inbounds [1000 x i8], [1000 x i8]* %7, i64 0, i64 0
%90 = call i64 @strcmp(i8* %89, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%91 = icmp eq i64 %90, 0
br i1 %91, label %92, label %93
92: ; preds = %88
store i32 1, i32* %14
br label %93
93: ; preds = %92, %88
%94 = getelementptr inbounds [1000 x i8], [1000 x i8]* %7, i64 0, i64 0
%95 = call i64 @strcmp(i8* %94, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
%96 = icmp eq i64 %95, 0
br i1 %96, label %97, label %98
97: ; preds = %93
store i32 2, i32* %14
br label %98
98: ; preds = %97, %93
store i32 5, i32* %15
%99 = getelementptr inbounds [1000 x i8], [1000 x i8]* %11, i64 0, i64 0
%100 = load i32, i32* %10
%101 = call i32 @sprintf(i8* %99, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0), i32 %100)
%102 = getelementptr inbounds [1000 x i8], [1000 x i8]* %11, i64 0, i64 0
%103 = call i8* @strcat(i8* %102, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.11, i64 0, i64 0))
%104 = load i32, i32* %14
%105 = icmp ne i32 %104, 5
br i1 %105, label %106, label %116
106: ; preds = %98
%107 = load i32, i32* %14
%108 = icmp ne i32 %107, 3
br i1 %108, label %109, label %116
109: ; preds = %106
%110 = load i32, i32* %14
%111 = add nsw i32 3, %110
%112 = call i32 (...) @rand()
%113 = srem i32 %112, 3
%114 = sub nsw i32 %111, %113
%115 = srem i32 %114, 3
store i32 %115, i32* %15
br label %116
116: ; preds = %109, %106, %98
%117 = load i32, i32* %14
%118 = icmp eq i32 %117, 3
br i1 %118, label %119, label %120
119: ; preds = %116
store i32 3, i32* %15
br label %120
120: ; preds = %119, %116
%121 = load i32, i32* %15
%122 = icmp eq i32 %121, 1
br i1 %122, label %123, label %137
123: ; preds = %120
%124 = getelementptr inbounds [1000 x i8], [1000 x i8]* %12, i64 0, i64 0
%125 = getelementptr inbounds [1000 x i8], [1000 x i8]* %11, i64 0, i64 0
%126 = call i8* @strcat(i8* %125, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.12, i64 0, i64 0))
%127 = call i8* @strcat(i8* %124, i8* %126)
%128 = load i32, i32* %2
%129 = getelementptr inbounds [1000 x i8], [1000 x i8]* %12, i64 0, i64 0
%130 = getelementptr inbounds [1000 x i8], [1000 x i8]* %12, i64 0, i64 0
%131 = call i32 @strlen(i8* %130)
%132 = call i64 @send(i32 %128, i8* %129, i32 %131, i32 0)
%133 = icmp slt i64 %132, 0
br i1 %133, label %134, label %136
134: ; preds = %123
%135 = call i32 @puts(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.13, i64 0, i64 0))
store i32 1, i32* %1
br label %211
136: ; preds = %123
br label %191
137: ; preds = %120
%138 = load i32, i32* %15
%139 = icmp eq i32 %138, 2
br i1 %139, label %140, label %154
140: ; preds = %137
%141 = getelementptr inbounds [1000 x i8], [1000 x i8]* %12, i64 0, i64 0
%142 = getelementptr inbounds [1000 x i8], [1000 x i8]* %11, i64 0, i64 0
%143 = call i8* @strcat(i8* %142, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.14, i64 0, i64 0))
%144 = call i8* @strcat(i8* %141, i8* %143)
%145 = load i32, i32* %2
%146 = getelementptr inbounds [1000 x i8], [1000 x i8]* %12, i64 0, i64 0
%147 = getelementptr inbounds [1000 x i8], [1000 x i8]* %12, i64 0, i64 0
%148 = call i32 @strlen(i8* %147)
%149 = call i64 @send(i32 %145, i8* %146, i32 %148, i32 0)
%150 = icmp slt i64 %149, 0
br i1 %150, label %151, label %153
151: ; preds = %140
%152 = call i32 @puts(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.13, i64 0, i64 0))
store i32 1, i32* %1
br label %211
153: ; preds = %140
br label %190
154: ; preds = %137
%155 = load i32, i32* %15
%156 = icmp eq i32 %155, 0
br i1 %156, label %157, label %171
157: ; preds = %154
%158 = getelementptr inbounds [1000 x i8], [1000 x i8]* %12, i64 0, i64 0
%159 = getelementptr inbounds [1000 x i8], [1000 x i8]* %11, i64 0, i64 0
%160 = call i8* @strcat(i8* %159, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.15, i64 0, i64 0))
%161 = call i8* @strcat(i8* %158, i8* %160)
%162 = load i32, i32* %2
%163 = getelementptr inbounds [1000 x i8], [1000 x i8]* %12, i64 0, i64 0
%164 = getelementptr inbounds [1000 x i8], [1000 x i8]* %12, i64 0, i64 0
%165 = call i32 @strlen(i8* %164)
%166 = call i64 @send(i32 %162, i8* %163, i32 %165, i32 0)
%167 = icmp slt i64 %166, 0
br i1 %167, label %168, label %170
168: ; preds = %157
%169 = call i32 @puts(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.13, i64 0, i64 0))
store i32 1, i32* %1
br label %211
170: ; preds = %157
br label %189
171: ; preds = %154
%172 = load i32, i32* %15
%173 = icmp eq i32 %172, 3
br i1 %173, label %174, label %186
174: ; preds = %171
%175 = getelementptr inbounds [1000 x i8], [1000 x i8]* %12, i64 0, i64 0
%176 = call i8* @strcat(i8* %175, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0))
%177 = load i32, i32* %2
%178 = getelementptr inbounds [1000 x i8], [1000 x i8]* %12, i64 0, i64 0
%179 = getelementptr inbounds [1000 x i8], [1000 x i8]* %12, i64 0, i64 0
%180 = call i32 @strlen(i8* %179)
%181 = call i64 @send(i32 %177, i8* %178, i32 %180, i32 0)
%182 = icmp slt i64 %181, 0
br i1 %182, label %183, label %185
183: ; preds = %174
%184 = call i32 @puts(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.13, i64 0, i64 0))
store i32 1, i32* %1
br label %211
185: ; preds = %174
br label %188
186: ; preds = %171
%187 = call i32 @printf(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.16, i64 0, i64 0))
br label %188
188: ; preds = %186, %185
br label %189
189: ; preds = %188, %170
br label %190
190: ; preds = %189, %153
br label %191
191: ; preds = %190, %136
%192 = load i32, i32* %10
%193 = add nsw i32 %192, 1
store i32 %193, i32* %10
%194 = getelementptr inbounds [1000 x i8], [1000 x i8]* %7, i64 0, i64 0
%195 = getelementptr inbounds [1000 x i8], [1000 x i8]* %7, i64 0, i64 0
%196 = call i32 @strlen(i8* %195)
%197 = call i32 @memset(i8* %194, i8 signext 0, i32 %196)
%198 = getelementptr inbounds [1000 x i8], [1000 x i8]* %12, i64 0, i64 0
%199 = getelementptr inbounds [1000 x i8], [1000 x i8]* %12, i64 0, i64 0
%200 = call i32 @strlen(i8* %199)
%201 = call i32 @memset(i8* %198, i8 signext 0, i32 %200)
%202 = getelementptr inbounds [1000 x i8], [1000 x i8]* %11, i64 0, i64 0
%203 = getelementptr inbounds [1000 x i8], [1000 x i8]* %11, i64 0, i64 0
%204 = call i32 @strlen(i8* %203)
%205 = call i32 @memset(i8* %202, i8 signext 0, i32 %204)
%206 = getelementptr inbounds [1000 x i8], [1000 x i8]* %8, i64 0, i64 0
%207 = getelementptr inbounds [1000 x i8], [1000 x i8]* %8, i64 0, i64 0
%208 = call i32 @strlen(i8* %207)
%209 = call i32 @memset(i8* %206, i8 signext 0, i32 %208)
br label %36
210: ; preds = %36
store i32 0, i32* %1
br label %211
211: ; preds = %210, %183, %168, %151, %134, %70
%212 = load i32, i32* %1
ret i32 %212
}

LLVM IR (-O2):
%struct.sockaddr_in = type { i8*, %struct.TYPE_2__, i32, i32 }
%struct.TYPE_2__ = type { i32 }
%struct.sockaddr = type { i32 }
@PF_INET = global i32 0
@SOCK_STREAM = global i32 0
@AF_INET = global i32 0
@.str = [10 x i8] c"127.0.0.1\00"
@.str.1 = [2 x i8] c"q\00"
@.str.3 = [3 x i8] c"%s\00"
@.str.4 = [2 x i8] c"p\00"
@.str.5 = [2 x i8] c"r\00"
@.str.6 = [2 x i8] c"s\00"
@.str.8 = [5 x i8] c"quit\00"
@.str.9 = [5 x i8] c"duck\00"
@.str.10 = [3 x i8] c"%d\00"
@.str.12 = [15 x i8] c"player 1 wins!\00"
@.str.13 = [12 x i8] c"Send failed\00"
@.str.14 = [15 x i8] c"player 2 wins!\00"
@.str.15 = [10 x i8] c"is a tie!\00"
@.str.16 = [6 x i8] c"Error\00"
@str = [18 x i8] c"Enter your choice\00"
@str.17 = [31 x i8] c"Choice not accepted. Try again\00"
define i32 @main() {
%1 = alloca %struct.sockaddr_in
%2 = alloca [1000 x i8]
%3 = alloca [1000 x i8]
%4 = alloca i32
%5 = alloca [1000 x i8]
%6 = alloca [1000 x i8]
%7 = bitcast %struct.sockaddr_in* %1 to i8*
%8 = getelementptr inbounds [1000 x i8], [1000 x i8]* %2, i64 0, i64 0
%9 = getelementptr inbounds [1000 x i8], [1000 x i8]* %3, i64 0, i64 0
%10 = bitcast i32* %4 to i8*
%11 = call i64 @time(i32* %4)
%12 = trunc i64 %11 to i32
%13 = call i32 @srand(i32 %12)
%14 = getelementptr inbounds [1000 x i8], [1000 x i8]* %5, i64 0, i64 0
%15 = getelementptr inbounds [1000 x i8], [1000 x i8]* %6, i64 0, i64 0
%16 = load i32, i32* @PF_INET
%17 = load i32, i32* @SOCK_STREAM
%18 = call i32 @socket(i32 %16, i32 %17, i32 0)
%19 = load i32, i32* @AF_INET
%20 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %1, i64 0, i32 3
store i32 %19, i32* %20
%21 = call i32 @htons(i32 4501)
%22 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %1, i64 0, i32 2
store i32 %21, i32* %22
%23 = call i32 @inet_addr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%24 = getelementptr inbounds %struct.sockaddr_in, %struct.sockaddr_in* %1, i64 0, i32 1, i32 0
store i32 %23, i32* %24
%25 = call i32 @memset(i8* undef, i8 signext 0, i32 8)
%26 = bitcast %struct.sockaddr_in* %1 to %struct.sockaddr*
%27 = call i32 @connect(i32 %18, %struct.sockaddr* %26, i32 24)
%28 = call i64 @strcmp(i8* %8, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%29 = icmp eq i64 %28, 0
br i1 %29, label %135, label %30
30: ; preds = %0, %123
%31 = phi i32 [ %124, %123 ], [ 1, %0 ]
br label %32
32: ; preds = %30, %57
%33 = call i32 @strlen(i8* %8)
%34 = call i32 @memset(i8* %8, i8 signext 0, i32 %33)
%35 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @str, i64 0, i64 0))
%36 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i8* %8)
%37 = call i64 @strcmp(i8* %8, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%38 = icmp eq i64 %37, 0
br i1 %38, label %50, label %39
39: ; preds = %32
%40 = call i64 @strcmp(i8* %8, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%41 = icmp eq i64 %40, 0
br i1 %41, label %50, label %42
42: ; preds = %39
%43 = call i64 @strcmp(i8* %8, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%44 = icmp eq i64 %43, 0
br i1 %44, label %50, label %45
45: ; preds = %42
%46 = call i64 @strcmp(i8* %8, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
%47 = icmp eq i64 %46, 0
br i1 %47, label %50, label %48
48: ; preds = %45
%49 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str.17, i64 0, i64 0))
br label %50
50: ; preds = %48, %45, %42, %39, %32
%51 = phi i1 [ true, %48 ], [ false, %45 ], [ false, %42 ], [ false, %39 ], [ false, %32 ]
%52 = call i64 @strcmp(i8* %8, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%53 = icmp eq i64 %52, 0
br i1 %53, label %54, label %57
54: ; preds = %50
%55 = call i32 @strlen(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.9, i64 0, i64 0))
%56 = call i64 @send(i32 %18, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0), i32 %55, i32 0)
br label %135
57: ; preds = %50
br i1 %51, label %32, label %58
58: ; preds = %57
%59 = call i64 @strcmp(i8* %8, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%60 = icmp eq i64 %59, 0
%61 = select i1 %60, i32 3, i32 5
%62 = call i64 @strcmp(i8* %8, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%63 = icmp eq i64 %62, 0
%64 = select i1 %63, i32 0, i32 %61
%65 = call i64 @strcmp(i8* %8, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%66 = icmp eq i64 %65, 0
%67 = select i1 %66, i32 1, i32 %64
%68 = call i64 @strcmp(i8* %8, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.6, i64 0, i64 0))
%69 = icmp eq i64 %68, 0
%70 = select i1 %69, i32 2, i32 %67
%71 = call i32 @sprintf(i8* %14, i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i64 0, i64 0), i32 %31)
%72 = call i64 bitcast (i32 (i8*)* @strlen to i64 (i8*)*)(i8* %14)
%73 = getelementptr [1000 x i8], [1000 x i8]* %5, i64 0, i64 %72
%74 = bitcast i8* %73 to i16*
store i16 32, i16* %74
switch i32 %70, label %75 [
i32 5, label %82
i32 3, label %82
]
75: ; preds = %58
%76 = add nuw nsw i32 %70, 3
%77 = call i32 (...) @rand()
%78 = srem i32 %77, 3
%79 = sub nsw i32 %76, %78
%80 = trunc i32 %79 to i8
%81 = urem i8 %80, 3
br label %82
82: ; preds = %58, %58, %75
%83 = phi i8 [ %81, %75 ], [ 5, %58 ], [ 5, %58 ]
%84 = icmp eq i32 %70, 3
%85 = select i1 %84, i8 3, i8 %83
switch i8 %85, label %121 [
i8 1, label %86
i8 2, label %95
i8 0, label %104
i8 3, label %113
]
86: ; preds = %82
%87 = call i64 bitcast (i32 (i8*)* @strlen to i64 (i8*)*)(i8* %14)
%88 = getelementptr [1000 x i8], [1000 x i8]* %5, i64 0, i64 %87
%89 = call i8* @strcat(i8* %15, i8* %14)
%90 = call i32 @strlen(i8* %15)
%91 = call i64 @send(i32 %18, i8* %15, i32 %90, i32 0)
%92 = icmp slt i64 %91, 0
br i1 %92, label %93, label %123
93: ; preds = %86
%94 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.13, i64 0, i64 0))
br label %135
95: ; preds = %82
%96 = call i64 bitcast (i32 (i8*)* @strlen to i64 (i8*)*)(i8* %14)
%97 = getelementptr [1000 x i8], [1000 x i8]* %5, i64 0, i64 %96
%98 = call i8* @strcat(i8* %15, i8* %14)
%99 = call i32 @strlen(i8* %15)
%100 = call i64 @send(i32 %18, i8* %15, i32 %99, i32 0)
%101 = icmp slt i64 %100, 0
br i1 %101, label %102, label %123
102: ; preds = %95
%103 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.13, i64 0, i64 0))
br label %135
104: ; preds = %82
%105 = call i64 bitcast (i32 (i8*)* @strlen to i64 (i8*)*)(i8* %14)
%106 = getelementptr [1000 x i8], [1000 x i8]* %5, i64 0, i64 %105
%107 = call i8* @strcat(i8* %15, i8* %14)
%108 = call i32 @strlen(i8* %15)
%109 = call i64 @send(i32 %18, i8* %15, i32 %108, i32 0)
%110 = icmp slt i64 %109, 0
br i1 %110, label %111, label %123
111: ; preds = %104
%112 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.13, i64 0, i64 0))
br label %135
113: ; preds = %82
%114 = call i64 bitcast (i32 (i8*)* @strlen to i64 (i8*)*)(i8* %15)
%115 = getelementptr [1000 x i8], [1000 x i8]* %6, i64 0, i64 %114
%116 = call i32 @strlen(i8* %15)
%117 = call i64 @send(i32 %18, i8* %15, i32 %116, i32 0)
%118 = icmp slt i64 %117, 0
br i1 %118, label %119, label %123
119: ; preds = %113
%120 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.13, i64 0, i64 0))
br label %135
121: ; preds = %82
%122 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.16, i64 0, i64 0))
br label %123
123: ; preds = %86, %104, %113, %121, %95
%124 = add nuw nsw i32 %31, 1
%125 = call i32 @strlen(i8* %8)
%126 = call i32 @memset(i8* %8, i8 signext 0, i32 %125)
%127 = call i32 @strlen(i8* %15)
%128 = call i32 @memset(i8* %15, i8 signext 0, i32 %127)
%129 = call i32 @strlen(i8* %14)
%130 = call i32 @memset(i8* %14, i8 signext 0, i32 %129)
%131 = call i32 @strlen(i8* %9)
%132 = call i32 @memset(i8* %9, i8 signext 0, i32 %131)
%133 = call i64 @strcmp(i8* %8, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%134 = icmp eq i64 %133, 0
br i1 %134, label %135, label %30
135: ; preds = %123, %0, %119, %111, %102, %93, %54
%136 = phi i32 [ 1, %54 ], [ 1, %93 ], [ 1, %102 ], [ 1, %111 ], [ 1, %119 ], [ 0, %0 ], [ 0, %123 ]
ret i32 %136
}