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

/* Forward declarations */

/* Type definitions */
struct sockaddr_un {
  int /*<<< orphan*/ sun_path;
  int /*<<< orphan*/ sun_family;
};
struct sockaddr {
  int dummy;
};
typedef int /*<<< orphan*/ serv_addr;

/* Variables and functions */
int /*<<< orphan*/ PF_LOCAL;
int /*<<< orphan*/ SOCK_STREAM;
int /*<<< orphan*/ bzero(char *, int);
int /*<<< orphan*/ close(int);
int connect(int, struct sockaddr *, int);
int /*<<< orphan*/ error(char *);
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *);
int rand();
int /*<<< orphan*/ sleep(int);
int socket(int /*<<< orphan*/, int /*<<< orphan*/, int /*<<< orphan*/);
int /*<<< orphan*/ sprintf(char *, char *, int, ...);
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ stdin;
int /*<<< orphan*/ strcpy(int /*<<< orphan*/, char *);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int /*<<< orphan*/ write(int, char *, int);
int main(int argc, char *argv[]) {
  srand(time(NULL));
  int sockfd, servlen, result;
  struct sockaddr_un serv_addr;
  struct sockaddr *serv_addrPtr;
  char buffer[10];
  int score[7];
  serv_addrPtr = (struct sockaddr *)&serv_addr;
  servlen = sizeof(serv_addr);
  serv_addr.sun_family = PF_LOCAL;
  strcpy(serv_addr.sun_path, "newfile");
  if ((sockfd = socket(PF_LOCAL, SOCK_STREAM, 0)) < 0)
    error("Creating socket");
  do {
    result = connect(sockfd, (struct sockaddr *)serv_addrPtr, servlen);
    if (result == -1)
      sleep(1);
  } while (result == -1);
  printf("Welcome to Rock Paper Scissors\n");
  printf("Inputs:\n \tr = Rock\n\tp = Paper\n\ts = Scissors\n");
  printf("\tq = Quit - Ends the Game\n");
  int computerGuess, rockg, paperg, scissorsg, gamenum;
  int i;
  for (i = 0; i < 7; i++) {
    score[i] = 0;
  }
  computerGuess = 0;
  rockg = 0;
  paperg = 0;
  scissorsg = 0;
  gamenum = 0;
  char *tgamemsg = "Tie Game!";
  char *wgamemsg = "Player 1 Wins!";
  char *lgamemsg = "Player 2 Wins!";
  char *quit = "Quit";
  char str[100];
  while (1) {
    gamenum++;
    computerGuess = (rand() % 3 + 1);
    printf("Please enter your choice: ");
    bzero(buffer, 10);
    fgets(buffer, 10, stdin);
    if (buffer[0] == 'r') {
      rockg++;
      if (computerGuess == 1) {
        score[1]++;
        sprintf(str, "Game Number %d: %s", gamenum, tgamemsg);
        write(sockfd, str, 100);
      } else {
        if (computerGuess == 2) {
          score[2]++;
          sprintf(str, "Game Number %d: %s", gamenum, lgamemsg);
          write(sockfd, str, 100);
        } else {
          if (computerGuess == 3) {
            score[0]++;
            sprintf(str, "Game Number %d: %s", gamenum, wgamemsg);
            write(sockfd, str, 100);
          }
        }
      }
    }
    if (buffer[0] == 'p') {
      paperg++;
      if (computerGuess == 1) {
        score[0]++;
        sprintf(str, "Game Number %d: %s", gamenum, wgamemsg);
        write(sockfd, str, 100);
      } else {
        if (computerGuess == 2) {
          score[1]++;
          sprintf(str, "Game Number %d: %s", gamenum, tgamemsg);
          write(sockfd, str, 100);
        } else {
          if (computerGuess == 3) {
            score[2]++;
            sprintf(str, "Game Number %d: %s", gamenum, lgamemsg);
            write(sockfd, str, 100);
          }
        }
      }
    }
    if (buffer[0] == 's') {
      scissorsg++;
      if (computerGuess == 1) {
        score[2]++;
        sprintf(str, "Game Number %d: %s", gamenum, lgamemsg);
        write(sockfd, str, 100);
      } else {
        if (computerGuess == 2) {
          score[0]++;
          sprintf(str, "Game Number %d: %s", gamenum, wgamemsg);
          write(sockfd, str, 100);
        } else {
          if (computerGuess == 3) {
            score[1]++;
            sprintf(str, "Game Number %d: %s", gamenum, tgamemsg);
            write(sockfd, str, 100);
          }
        }
      }
    }
    if (buffer[0] == 'q') {
      break;
    }
    score[3] = rockg;
    score[4] = paperg;
    score[5] = scissorsg;
    score[6] = gamenum;
  }
  sprintf(str, "q%d %d %d", score[0], score[1], score[2]);
  write(sockfd, str, 100);
  close(sockfd);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x100,%rsp
movl   $0x0,-0x4(%rbp)
mov    %edi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1090 <time@plt>
mov    %eax,%edi
call   1070 <srand@plt>
lea    -0x28(%rbp),%rax
mov    %rax,-0x30(%rbp)
movl   $0x8,-0x18(%rbp)
mov    0x2db1(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x24(%rbp)
mov    -0x28(%rbp),%edi
lea    0xdd2(%rip),%rsi
call   1030 <strcpy@plt>
mov    0x2d96(%rip),%rax
mov    (%rax),%edi
mov    0x2d95(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1100 <socket@plt>
mov    %eax,-0x14(%rbp)
cmp    $0x0,%eax
jge    1264 <main+0x84>
lea    0xda9(%rip),%rdi
call   10a0 <error@plt>
jmp    1269 <main+0x89>
mov    -0x14(%rbp),%edi
mov    -0x30(%rbp),%rsi
mov    -0x18(%rbp),%edx
call   10d0 <connect@plt>
mov    %eax,-0x1c(%rbp)
cmpl   $0xffffffff,-0x1c(%rbp)
jne    128f <main+0xaf>
mov    $0x1,%edi
call   10e0 <sleep@plt>
jmp    1294 <main+0xb4>
cmpl   $0xffffffff,-0x1c(%rbp)
je     1269 <main+0x89>
lea    0xd73(%rip),%rdi
call   1050 <printf@plt>
lea    0xd87(%rip),%rdi
call   1050 <printf@plt>
lea    0xda8(%rip),%rdi
call   1050 <printf@plt>
movl   $0x0,-0x78(%rbp)
cmpl   $0x7,-0x78(%rbp)
jge    12ed <main+0x10d>
movslq -0x78(%rbp),%rax
movl   $0x0,-0x60(%rbp,%rax,4)
mov    -0x78(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x78(%rbp)
jmp    12c9 <main+0xe9>
movl   $0x0,-0x64(%rbp)
movl   $0x0,-0x68(%rbp)
movl   $0x0,-0x6c(%rbp)
movl   $0x0,-0x70(%rbp)
movl   $0x0,-0x74(%rbp)
lea    0xd69(%rip),%rax
mov    %rax,-0x80(%rbp)
lea    0xd68(%rip),%rax
mov    %rax,-0x88(%rbp)
lea    0xd69(%rip),%rax
mov    %rax,-0x90(%rbp)
lea    0xd6a(%rip),%rax
mov    %rax,-0x98(%rbp)
mov    -0x74(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x74(%rbp)
mov    $0x0,%al
call   10f0 <rand@plt>
mov    $0x3,%ecx
cltd
idiv   %ecx
add    $0x1,%edx
mov    %edx,-0x64(%rbp)
lea    0xd43(%rip),%rdi
call   1050 <printf@plt>
lea    -0x3a(%rbp),%rdi
mov    $0xa,%esi
call   10b0 <bzero@plt>
lea    -0x3a(%rbp),%rdi
mov    0x2c60(%rip),%rax
mov    (%rax),%edx
mov    $0xa,%esi
call   1080 <fgets@plt>
movsbl -0x3a(%rbp),%eax
cmp    $0x72,%eax
jne    1492 <main+0x2b2>
mov    -0x68(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x68(%rbp)
cmpl   $0x1,-0x64(%rbp)
jne    13f2 <main+0x212>
mov    -0x5c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x5c(%rbp)
lea    -0x100(%rbp),%rdi
mov    -0x74(%rbp),%edx
mov    -0x80(%rbp),%rcx
lea    0xcf6(%rip),%rsi
mov    $0x0,%al
call   10c0 <sprintf@plt>
mov    -0x14(%rbp),%edi
lea    -0x100(%rbp),%rsi
mov    $0x64,%edx
call   1040 <write@plt>
jmp    148d <main+0x2ad>
cmpl   $0x2,-0x64(%rbp)
jne    143d <main+0x25d>
mov    -0x58(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x58(%rbp)
lea    -0x100(%rbp),%rdi
mov    -0x74(%rbp),%edx
mov    -0x90(%rbp),%rcx
lea    0xcab(%rip),%rsi
mov    $0x0,%al
call   10c0 <sprintf@plt>
mov    -0x14(%rbp),%edi
lea    -0x100(%rbp),%rsi
mov    $0x64,%edx
call   1040 <write@plt>
jmp    1488 <main+0x2a8>
cmpl   $0x3,-0x64(%rbp)
jne    1483 <main+0x2a3>
mov    -0x60(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x60(%rbp)
lea    -0x100(%rbp),%rdi
mov    -0x74(%rbp),%edx
mov    -0x88(%rbp),%rcx
lea    0xc60(%rip),%rsi
mov    $0x0,%al
call   10c0 <sprintf@plt>
mov    -0x14(%rbp),%edi
lea    -0x100(%rbp),%rsi
mov    $0x64,%edx
call   1040 <write@plt>
jmp    1488 <main+0x2a8>
jmp    148d <main+0x2ad>
jmp    1492 <main+0x2b2>
movsbl -0x3a(%rbp),%eax
cmp    $0x70,%eax
jne    1590 <main+0x3b0>
mov    -0x6c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x6c(%rbp)
cmpl   $0x1,-0x64(%rbp)
jne    14f3 <main+0x313>
mov    -0x60(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x60(%rbp)
lea    -0x100(%rbp),%rdi
mov    -0x74(%rbp),%edx
mov    -0x88(%rbp),%rcx
lea    0xbf5(%rip),%rsi
mov    $0x0,%al
call   10c0 <sprintf@plt>
mov    -0x14(%rbp),%edi
lea    -0x100(%rbp),%rsi
mov    $0x64,%edx
call   1040 <write@plt>
jmp    158b <main+0x3ab>
cmpl   $0x2,-0x64(%rbp)
jne    153b <main+0x35b>
mov    -0x5c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x5c(%rbp)
lea    -0x100(%rbp),%rdi
mov    -0x74(%rbp),%edx
mov    -0x80(%rbp),%rcx
lea    0xbad(%rip),%rsi
mov    $0x0,%al
call   10c0 <sprintf@plt>
mov    -0x14(%rbp),%edi
lea    -0x100(%rbp),%rsi
mov    $0x64,%edx
call   1040 <write@plt>
jmp    1586 <main+0x3a6>
cmpl   $0x3,-0x64(%rbp)
jne    1581 <main+0x3a1>
mov    -0x58(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x58(%rbp)
lea    -0x100(%rbp),%rdi
mov    -0x74(%rbp),%edx
mov    -0x90(%rbp),%rcx
lea    0xb62(%rip),%rsi
mov    $0x0,%al
call   10c0 <sprintf@plt>
mov    -0x14(%rbp),%edi
lea    -0x100(%rbp),%rsi
mov    $0x64,%edx
call   1040 <write@plt>
jmp    1586 <main+0x3a6>
jmp    158b <main+0x3ab>
jmp    1590 <main+0x3b0>
movsbl -0x3a(%rbp),%eax
cmp    $0x73,%eax
jne    168e <main+0x4ae>
mov    -0x70(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x70(%rbp)
cmpl   $0x1,-0x64(%rbp)
jne    15f1 <main+0x411>
mov    -0x58(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x58(%rbp)
lea    -0x100(%rbp),%rdi
mov    -0x74(%rbp),%edx
mov    -0x90(%rbp),%rcx
lea    0xaf7(%rip),%rsi
mov    $0x0,%al
call   10c0 <sprintf@plt>
mov    -0x14(%rbp),%edi
lea    -0x100(%rbp),%rsi
mov    $0x64,%edx
call   1040 <write@plt>
jmp    1689 <main+0x4a9>
cmpl   $0x2,-0x64(%rbp)
jne    163c <main+0x45c>
mov    -0x60(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x60(%rbp)
lea    -0x100(%rbp),%rdi
mov    -0x74(%rbp),%edx
mov    -0x88(%rbp),%rcx
lea    0xaac(%rip),%rsi
mov    $0x0,%al
call   10c0 <sprintf@plt>
mov    -0x14(%rbp),%edi
lea    -0x100(%rbp),%rsi
mov    $0x64,%edx
call   1040 <write@plt>
jmp    1684 <main+0x4a4>
cmpl   $0x3,-0x64(%rbp)
jne    167f <main+0x49f>
mov    -0x5c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x5c(%rbp)
lea    -0x100(%rbp),%rdi
mov    -0x74(%rbp),%edx
mov    -0x80(%rbp),%rcx
lea    0xa64(%rip),%rsi
mov    $0x0,%al
call   10c0 <sprintf@plt>
mov    -0x14(%rbp),%edi
lea    -0x100(%rbp),%rsi
mov    $0x64,%edx
call   1040 <write@plt>
jmp    1684 <main+0x4a4>
jmp    1689 <main+0x4a9>
jmp    168e <main+0x4ae>
movsbl -0x3a(%rbp),%eax
cmp    $0x71,%eax
jne    16a0 <main+0x4c0>
jmp    16bd <main+0x4dd>
mov    -0x68(%rbp),%eax
mov    %eax,-0x54(%rbp)
mov    -0x6c(%rbp),%eax
mov    %eax,-0x50(%rbp)
mov    -0x70(%rbp),%eax
mov    %eax,-0x4c(%rbp)
mov    -0x74(%rbp),%eax
mov    %eax,-0x48(%rbp)
jmp    1345 <main+0x165>
lea    -0x100(%rbp),%rdi
mov    -0x60(%rbp),%edx
mov    -0x5c(%rbp),%ecx
mov    -0x58(%rbp),%r8d
lea    0xa06(%rip),%rsi
mov    $0x0,%al
call   10c0 <sprintf@plt>
mov    -0x14(%rbp),%edi
lea    -0x100(%rbp),%rsi
mov    $0x64,%edx
call   1040 <write@plt>
mov    -0x14(%rbp),%edi
call   1060 <close@plt>
xor    %eax,%eax
add    $0x100,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x88,%rsp
xor    %edi,%edi
call   10a0 <time@plt>
mov    %eax,%edi
call   1080 <srand@plt>
mov    0x2dba(%rip),%rbx
mov    (%rbx),%eax
mov    %eax,0x1c(%rsp)
lea    0xddd(%rip),%rsi
call   1030 <strcpy@plt>
mov    (%rbx),%edi
mov    0x2da7(%rip),%rax
mov    (%rax),%esi
xor    %edx,%edx
call   1110 <socket@plt>
mov    %eax,%ebx
test   %eax,%eax
jns    124c <main+0x5c>
lea    0xdc1(%rip),%rdi
call   10b0 <error@plt>
lea    0x18(%rsp),%rsi
mov    %ebx,%edi
mov    $0x8,%edx
call   10e0 <connect@plt>
cmp    $0xffffffff,%eax
jne    128e <main+0x9e>
lea    0x18(%rsp),%rbp
nopw   0x0(%rax,%rax,1)
mov    $0x1,%edi
call   10f0 <sleep@plt>
mov    %ebx,%edi
mov    %rbp,%rsi
mov    $0x8,%edx
call   10e0 <connect@plt>
cmp    $0xffffffff,%eax
je     1270 <main+0x80>
lea    0xde3(%rip),%rdi
call   1040 <puts@plt>
lea    0xdf6(%rip),%rdi
call   1040 <puts@plt>
lea    0xe16(%rip),%rdi
call   1040 <puts@plt>
mov    $0x1,%ebp
lea    0xe(%rsp),%r15
lea    0x20(%rsp),%r12
movl   $0x0,0x8(%rsp)
xor    %r13d,%r13d
movl   $0x0,0x4(%rsp)
jmp    1314 <main+0x124>
addl   $0x1,0x8(%rsp)
lea    0xd36(%rip),%rcx
mov    %r12,%rdi
lea    0xd6f(%rip),%rsi
mov    %ebp,%edx
xor    %eax,%eax
call   10d0 <sprintf@plt>
mov    %ebx,%edi
mov    %r12,%rsi
mov    $0x64,%edx
call   1050 <write@plt>
movzbl 0xe(%rsp),%eax
add    $0x1,%ebp
cmp    $0x71,%al
je     14b7 <main+0x2c7>
xor    %eax,%eax
call   1100 <rand@plt>
movslq %eax,%r14
imul   $0x55555556,%r14,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
shr    $0x20,%rax
add    %ecx,%eax
lea    (%rax,%rax,2),%eax
sub    %eax,%r14d
lea    0xd01(%rip),%rdi
call   1060 <printf@plt>
mov    %r15,%rdi
mov    $0xa,%esi
call   10c0 <bzero@plt>
mov    0x2c90(%rip),%rax
mov    (%rax),%edx
mov    %r15,%rdi
mov    $0xa,%esi
call   1090 <fgets@plt>
movzbl 0xe(%rsp),%eax
cmp    $0x72,%al
je     1380 <main+0x190>
cmp    $0x70,%al
je     13e7 <main+0x1f7>
jmp    1470 <main+0x280>
nopl   0x0(%rax)
cmp    $0x2,%r14d
je     139f <main+0x1af>
cmp    $0x1,%r14d
je     13ad <main+0x1bd>
test   %r14d,%r14d
jne    13da <main+0x1ea>
addl   $0x1,0x8(%rsp)
lea    0xc7b(%rip),%rcx
jmp    13b8 <main+0x1c8>
addl   $0x1,0x4(%rsp)
lea    0xc77(%rip),%rcx
jmp    13b8 <main+0x1c8>
add    $0x1,%r13d
lea    0xc79(%rip),%rcx
mov    %r12,%rdi
lea    0xc99(%rip),%rsi
mov    %ebp,%edx
xor    %eax,%eax
call   10d0 <sprintf@plt>
mov    %ebx,%edi
mov    %r12,%rsi
mov    $0x64,%edx
call   1050 <write@plt>
movzbl 0xe(%rsp),%eax
cmp    $0x70,%al
jne    1470 <main+0x280>
test   %r14d,%r14d
je     1406 <main+0x216>
cmp    $0x2,%r14d
je     1443 <main+0x253>
cmp    $0x1,%r14d
jne    1470 <main+0x280>
addl   $0x1,0x8(%rsp)
lea    0xc14(%rip),%rcx
jmp    144e <main+0x25e>
addl   $0x1,0x4(%rsp)
mov    %r12,%rdi
lea    0xc46(%rip),%rsi
mov    %ebp,%edx
lea    0xc04(%rip),%rcx
xor    %eax,%eax
call   10d0 <sprintf@plt>
mov    %ebx,%edi
mov    %r12,%rsi
mov    $0x64,%edx
call   1050 <write@plt>
movzbl 0xe(%rsp),%eax
cmp    $0x73,%al
jne    1309 <main+0x119>
jmp    1496 <main+0x2a6>
add    $0x1,%r13d
lea    0xbe3(%rip),%rcx
mov    %r12,%rdi
lea    0xc03(%rip),%rsi
mov    %ebp,%edx
xor    %eax,%eax
call   10d0 <sprintf@plt>
mov    %ebx,%edi
mov    %r12,%rsi
mov    $0x64,%edx
call   1050 <write@plt>
movzbl 0xe(%rsp),%eax
cmp    $0x73,%al
jne    1309 <main+0x119>
cmp    $0x2,%r14d
je     12d6 <main+0xe6>
cmp    $0x1,%r14d
je     14a6 <main+0x2b6>
test   %r14d,%r14d
jne    1304 <main+0x114>
add    $0x1,%r13d
lea    0xb90(%rip),%rcx
jmp    12e2 <main+0xf2>
addl   $0x1,0x4(%rsp)
lea    0xb70(%rip),%rcx
jmp    12e2 <main+0xf2>
lea    0xbb0(%rip),%rsi
lea    0x20(%rsp),%rbp
mov    %rbp,%rdi
mov    0x4(%rsp),%edx
mov    0x8(%rsp),%ecx
mov    %r13d,%r8d
xor    %eax,%eax
call   10d0 <sprintf@plt>
mov    %ebx,%edi
mov    %rbp,%rsi
mov    $0x64,%edx
call   1050 <write@plt>
mov    %ebx,%edi
call   1070 <close@plt>
xor    %eax,%eax
add    $0x88,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.sockaddr_un = type { i32, i32 }
%struct.sockaddr = type { i32 }
@PF_LOCAL = global i32 0
@.str = [8 x i8] c"newfile\00"
@SOCK_STREAM = global i32 0
@.str.1 = [16 x i8] c"Creating socket\00"
@.str.2 = [32 x i8] c"Welcome to Rock Paper Scissors\0A\00"
@.str.3 = [45 x i8] c"Inputs:\0A \09r = Rock\0A\09p = Paper\0A\09s = Scissors\0A\00"
@.str.4 = [27 x i8] c"\09q = Quit - Ends the Game\0A\00"
@.str.5 = [10 x i8] c"Tie Game!\00"
@.str.6 = [15 x i8] c"Player 1 Wins!\00"
@.str.7 = [15 x i8] c"Player 2 Wins!\00"
@.str.8 = [5 x i8] c"Quit\00"
@.str.9 = [27 x i8] c"Please enter your choice: \00"
@stdin = global i32 0
@.str.10 = [19 x i8] c"Game Number %d: %s\00"
@.str.11 = [10 x i8] c"q%d %d %d\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 %struct.sockaddr_un
%10 = alloca %struct.sockaddr*
%11 = alloca [10 x i8]
%12 = alloca [7 x i32]
%13 = alloca i32
%14 = alloca i32
%15 = alloca i32
%16 = alloca i32
%17 = alloca i32
%18 = alloca i32
%19 = alloca i8*
%20 = alloca i8*
%21 = alloca i8*
%22 = alloca i8*
%23 = alloca [100 x i8]
store i32 0, i32* %3
store i32 %0, i32* %4
store i8** %1, i8*** %5
%24 = call i32 @time(i32* null)
%25 = call i32 @srand(i32 %24)
%26 = bitcast %struct.sockaddr_un* %9 to %struct.sockaddr*
store %struct.sockaddr* %26, %struct.sockaddr** %10
store i32 8, i32* %7
%27 = load i32, i32* @PF_LOCAL
%28 = getelementptr inbounds %struct.sockaddr_un, %struct.sockaddr_un* %9, i32 0, i32 1
store i32 %27, i32* %28
%29 = getelementptr inbounds %struct.sockaddr_un, %struct.sockaddr_un* %9, i32 0, i32 0
%30 = load i32, i32* %29
%31 = call i32 @strcpy(i32 %30, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%32 = load i32, i32* @PF_LOCAL
%33 = load i32, i32* @SOCK_STREAM
%34 = call i32 @socket(i32 %32, i32 %33, i32 0)
store i32 %34, i32* %6
%35 = icmp slt i32 %34, 0
br i1 %35, label %36, label %38
36: ; preds = %2
%37 = call i32 @error(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
br label %38
38: ; preds = %36, %2
br label %39
39: ; preds = %49, %38
%40 = load i32, i32* %6
%41 = load %struct.sockaddr*, %struct.sockaddr** %10
%42 = load i32, i32* %7
%43 = call i32 @connect(i32 %40, %struct.sockaddr* %41, i32 %42)
store i32 %43, i32* %8
%44 = load i32, i32* %8
%45 = icmp eq i32 %44, -1
br i1 %45, label %46, label %48
46: ; preds = %39
%47 = call i32 @sleep(i32 1)
br label %48
48: ; preds = %46, %39
br label %49
49: ; preds = %48
%50 = load i32, i32* %8
%51 = icmp eq i32 %50, -1
br i1 %51, label %39, label %52
52: ; preds = %49
%53 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0))
%54 = call i32 @printf(i8* getelementptr inbounds ([45 x i8], [45 x i8]* @.str.3, i64 0, i64 0))
%55 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.4, i64 0, i64 0))
store i32 0, i32* %18
br label %56
56: ; preds = %63, %52
%57 = load i32, i32* %18
%58 = icmp slt i32 %57, 7
br i1 %58, label %59, label %66
59: ; preds = %56
%60 = load i32, i32* %18
%61 = sext i32 %60 to i64
%62 = getelementptr inbounds [7 x i32], [7 x i32]* %12, i64 0, i64 %61
store i32 0, i32* %62
br label %63
63: ; preds = %59
%64 = load i32, i32* %18
%65 = add nsw i32 %64, 1
store i32 %65, i32* %18
br label %56
66: ; preds = %56
store i32 0, i32* %13
store i32 0, i32* %14
store i32 0, i32* %15
store i32 0, i32* %16
store i32 0, i32* %17
store i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0), i8** %19
store i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.6, i64 0, i64 0), i8** %20
store i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.7, i64 0, i64 0), i8** %21
store i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0), i8** %22
br label %67
67: ; preds = %66, %240
%68 = load i32, i32* %17
%69 = add nsw i32 %68, 1
store i32 %69, i32* %17
%70 = call i32 (...) @rand()
%71 = srem i32 %70, 3
%72 = add nsw i32 %71, 1
store i32 %72, i32* %13
%73 = call i32 @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.9, i64 0, i64 0))
%74 = getelementptr inbounds [10 x i8], [10 x i8]* %11, i64 0, i64 0
%75 = call i32 @bzero(i8* %74, i32 10)
%76 = getelementptr inbounds [10 x i8], [10 x i8]* %11, i64 0, i64 0
%77 = load i32, i32* @stdin
%78 = call i32 @fgets(i8* %76, i32 10, i32 %77)
%79 = getelementptr inbounds [10 x i8], [10 x i8]* %11, i64 0, i64 0
%80 = load i8, i8* %79
%81 = sext i8 %80 to i32
%82 = icmp eq i32 %81, 114
br i1 %82, label %83, label %130
83: ; preds = %67
%84 = load i32, i32* %14
%85 = add nsw i32 %84, 1
store i32 %85, i32* %14
%86 = load i32, i32* %13
%87 = icmp eq i32 %86, 1
br i1 %87, label %88, label %99
88: ; preds = %83
%89 = getelementptr inbounds [7 x i32], [7 x i32]* %12, i64 0, i64 1
%90 = load i32, i32* %89
%91 = add nsw i32 %90, 1
store i32 %91, i32* %89
%92 = getelementptr inbounds [100 x i8], [100 x i8]* %23, i64 0, i64 0
%93 = load i32, i32* %17
%94 = load i8*, i8** %19
%95 = call i32 (i8*, i8*, i32, ...) @sprintf(i8* %92, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.10, i64 0, i64 0), i32 %93, i8* %94)
%96 = load i32, i32* %6
%97 = getelementptr inbounds [100 x i8], [100 x i8]* %23, i64 0, i64 0
%98 = call i32 @write(i32 %96, i8* %97, i32 100)
br label %129
99: ; preds = %83
%100 = load i32, i32* %13
%101 = icmp eq i32 %100, 2
br i1 %101, label %102, label %113
102: ; preds = %99
%103 = getelementptr inbounds [7 x i32], [7 x i32]* %12, i64 0, i64 2
%104 = load i32, i32* %103
%105 = add nsw i32 %104, 1
store i32 %105, i32* %103
%106 = getelementptr inbounds [100 x i8], [100 x i8]* %23, i64 0, i64 0
%107 = load i32, i32* %17
%108 = load i8*, i8** %21
%109 = call i32 (i8*, i8*, i32, ...) @sprintf(i8* %106, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.10, i64 0, i64 0), i32 %107, i8* %108)
%110 = load i32, i32* %6
%111 = getelementptr inbounds [100 x i8], [100 x i8]* %23, i64 0, i64 0
%112 = call i32 @write(i32 %110, i8* %111, i32 100)
br label %128
113: ; preds = %99
%114 = load i32, i32* %13
%115 = icmp eq i32 %114, 3
br i1 %115, label %116, label %127
116: ; preds = %113
%117 = getelementptr inbounds [7 x i32], [7 x i32]* %12, i64 0, i64 0
%118 = load i32, i32* %117
%119 = add nsw i32 %118, 1
store i32 %119, i32* %117
%120 = getelementptr inbounds [100 x i8], [100 x i8]* %23, i64 0, i64 0
%121 = load i32, i32* %17
%122 = load i8*, i8** %20
%123 = call i32 (i8*, i8*, i32, ...) @sprintf(i8* %120, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.10, i64 0, i64 0), i32 %121, i8* %122)
%124 = load i32, i32* %6
%125 = getelementptr inbounds [100 x i8], [100 x i8]* %23, i64 0, i64 0
%126 = call i32 @write(i32 %124, i8* %125, i32 100)
br label %127
127: ; preds = %116, %113
br label %128
128: ; preds = %127, %102
br label %129
129: ; preds = %128, %88
br label %130
130: ; preds = %129, %67
%131 = getelementptr inbounds [10 x i8], [10 x i8]* %11, i64 0, i64 0
%132 = load i8, i8* %131
%133 = sext i8 %132 to i32
%134 = icmp eq i32 %133, 112
br i1 %134, label %135, label %182
135: ; preds = %130
%136 = load i32, i32* %15
%137 = add nsw i32 %136, 1
store i32 %137, i32* %15
%138 = load i32, i32* %13
%139 = icmp eq i32 %138, 1
br i1 %139, label %140, label %151
140: ; preds = %135
%141 = getelementptr inbounds [7 x i32], [7 x i32]* %12, i64 0, i64 0
%142 = load i32, i32* %141
%143 = add nsw i32 %142, 1
store i32 %143, i32* %141
%144 = getelementptr inbounds [100 x i8], [100 x i8]* %23, i64 0, i64 0
%145 = load i32, i32* %17
%146 = load i8*, i8** %20
%147 = call i32 (i8*, i8*, i32, ...) @sprintf(i8* %144, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.10, i64 0, i64 0), i32 %145, i8* %146)
%148 = load i32, i32* %6
%149 = getelementptr inbounds [100 x i8], [100 x i8]* %23, i64 0, i64 0
%150 = call i32 @write(i32 %148, i8* %149, i32 100)
br label %181
151: ; preds = %135
%152 = load i32, i32* %13
%153 = icmp eq i32 %152, 2
br i1 %153, label %154, label %165
154: ; preds = %151
%155 = getelementptr inbounds [7 x i32], [7 x i32]* %12, i64 0, i64 1
%156 = load i32, i32* %155
%157 = add nsw i32 %156, 1
store i32 %157, i32* %155
%158 = getelementptr inbounds [100 x i8], [100 x i8]* %23, i64 0, i64 0
%159 = load i32, i32* %17
%160 = load i8*, i8** %19
%161 = call i32 (i8*, i8*, i32, ...) @sprintf(i8* %158, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.10, i64 0, i64 0), i32 %159, i8* %160)
%162 = load i32, i32* %6
%163 = getelementptr inbounds [100 x i8], [100 x i8]* %23, i64 0, i64 0
%164 = call i32 @write(i32 %162, i8* %163, i32 100)
br label %180
165: ; preds = %151
%166 = load i32, i32* %13
%167 = icmp eq i32 %166, 3
br i1 %167, label %168, label %179
168: ; preds = %165
%169 = getelementptr inbounds [7 x i32], [7 x i32]* %12, i64 0, i64 2
%170 = load i32, i32* %169
%171 = add nsw i32 %170, 1
store i32 %171, i32* %169
%172 = getelementptr inbounds [100 x i8], [100 x i8]* %23, i64 0, i64 0
%173 = load i32, i32* %17
%174 = load i8*, i8** %21
%175 = call i32 (i8*, i8*, i32, ...) @sprintf(i8* %172, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.10, i64 0, i64 0), i32 %173, i8* %174)
%176 = load i32, i32* %6
%177 = getelementptr inbounds [100 x i8], [100 x i8]* %23, i64 0, i64 0
%178 = call i32 @write(i32 %176, i8* %177, i32 100)
br label %179
179: ; preds = %168, %165
br label %180
180: ; preds = %179, %154
br label %181
181: ; preds = %180, %140
br label %182
182: ; preds = %181, %130
%183 = getelementptr inbounds [10 x i8], [10 x i8]* %11, i64 0, i64 0
%184 = load i8, i8* %183
%185 = sext i8 %184 to i32
%186 = icmp eq i32 %185, 115
br i1 %186, label %187, label %234
187: ; preds = %182
%188 = load i32, i32* %16
%189 = add nsw i32 %188, 1
store i32 %189, i32* %16
%190 = load i32, i32* %13
%191 = icmp eq i32 %190, 1
br i1 %191, label %192, label %203
192: ; preds = %187
%193 = getelementptr inbounds [7 x i32], [7 x i32]* %12, i64 0, i64 2
%194 = load i32, i32* %193
%195 = add nsw i32 %194, 1
store i32 %195, i32* %193
%196 = getelementptr inbounds [100 x i8], [100 x i8]* %23, i64 0, i64 0
%197 = load i32, i32* %17
%198 = load i8*, i8** %21
%199 = call i32 (i8*, i8*, i32, ...) @sprintf(i8* %196, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.10, i64 0, i64 0), i32 %197, i8* %198)
%200 = load i32, i32* %6
%201 = getelementptr inbounds [100 x i8], [100 x i8]* %23, i64 0, i64 0
%202 = call i32 @write(i32 %200, i8* %201, i32 100)
br label %233
203: ; preds = %187
%204 = load i32, i32* %13
%205 = icmp eq i32 %204, 2
br i1 %205, label %206, label %217
206: ; preds = %203
%207 = getelementptr inbounds [7 x i32], [7 x i32]* %12, i64 0, i64 0
%208 = load i32, i32* %207
%209 = add nsw i32 %208, 1
store i32 %209, i32* %207
%210 = getelementptr inbounds [100 x i8], [100 x i8]* %23, i64 0, i64 0
%211 = load i32, i32* %17
%212 = load i8*, i8** %20
%213 = call i32 (i8*, i8*, i32, ...) @sprintf(i8* %210, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.10, i64 0, i64 0), i32 %211, i8* %212)
%214 = load i32, i32* %6
%215 = getelementptr inbounds [100 x i8], [100 x i8]* %23, i64 0, i64 0
%216 = call i32 @write(i32 %214, i8* %215, i32 100)
br label %232
217: ; preds = %203
%218 = load i32, i32* %13
%219 = icmp eq i32 %218, 3
br i1 %219, label %220, label %231
220: ; preds = %217
%221 = getelementptr inbounds [7 x i32], [7 x i32]* %12, i64 0, i64 1
%222 = load i32, i32* %221
%223 = add nsw i32 %222, 1
store i32 %223, i32* %221
%224 = getelementptr inbounds [100 x i8], [100 x i8]* %23, i64 0, i64 0
%225 = load i32, i32* %17
%226 = load i8*, i8** %19
%227 = call i32 (i8*, i8*, i32, ...) @sprintf(i8* %224, i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str.10, i64 0, i64 0), i32 %225, i8* %226)
%228 = load i32, i32* %6
%229 = getelementptr inbounds [100 x i8], [100 x i8]* %23, i64 0, i64 0
%230 = call i32 @write(i32 %228, i8* %229, i32 100)
br label %231
231: ; preds = %220, %217
br label %232
232: ; preds = %231, %206
br label %233
233: ; preds = %232, %192
br label %234
234: ; preds = %233, %182
%235 = getelementptr inbounds [10 x i8], [10 x i8]* %11, i64 0, i64 0
%236 = load i8, i8* %235
%237 = sext i8 %236 to i32
%238 = icmp eq i32 %237, 113
br i1 %238, label %239, label %240
239: ; preds = %234
br label %249
240: ; preds = %234
%241 = load i32, i32* %14
%242 = getelementptr inbounds [7 x i32], [7 x i32]* %12, i64 0, i64 3
store i32 %241, i32* %242
%243 = load i32, i32* %15
%244 = getelementptr inbounds [7 x i32], [7 x i32]* %12, i64 0, i64 4
store i32 %243, i32* %244
%245 = load i32, i32* %16
%246 = getelementptr inbounds [7 x i32], [7 x i32]* %12, i64 0, i64 5
store i32 %245, i32* %246
%247 = load i32, i32* %17
%248 = getelementptr inbounds [7 x i32], [7 x i32]* %12, i64 0, i64 6
store i32 %247, i32* %248
br label %67
249: ; preds = %239
%250 = getelementptr inbounds [100 x i8], [100 x i8]* %23, i64 0, i64 0
%251 = getelementptr inbounds [7 x i32], [7 x i32]* %12, i64 0, i64 0
%252 = load i32, i32* %251
%253 = getelementptr inbounds [7 x i32], [7 x i32]* %12, i64 0, i64 1
%254 = load i32, i32* %253
%255 = getelementptr inbounds [7 x i32], [7 x i32]* %12, i64 0, i64 2
%256 = load i32, i32* %255
%257 = call i32 (i8*, i8*, i32, ...) @sprintf(i8* %250, i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.11, i64 0, i64 0), i32 %252, i32 %254, i32 %256)
%258 = load i32, i32* %6
%259 = getelementptr inbounds [100 x i8], [100 x i8]* %23, i64 0, i64 0
%260 = call i32 @write(i32 %258, i8* %259, i32 100)
%261 = load i32, i32* %6
%262 = call i32 @close(i32 %261)
ret i32 0
}

LLVM IR (-O2):
%struct.sockaddr_un = type { i32, i32 }
%struct.sockaddr = type { i32 }
@PF_LOCAL = global i32 0
@.str = [8 x i8] c"newfile\00"
@SOCK_STREAM = global i32 0
@.str.1 = [16 x i8] c"Creating socket\00"
@.str.5 = [10 x i8] c"Tie Game!\00"
@.str.6 = [15 x i8] c"Player 1 Wins!\00"
@.str.7 = [15 x i8] c"Player 2 Wins!\00"
@.str.9 = [27 x i8] c"Please enter your choice: \00"
@stdin = global i32 0
@.str.10 = [19 x i8] c"Game Number %d: %s\00"
@.str.11 = [10 x i8] c"q%d %d %d\00"
@str = [31 x i8] c"Welcome to Rock Paper Scissors\00"
@str.12 = [44 x i8] c"Inputs:\0A \09r = Rock\0A\09p = Paper\0A\09s = Scissors\00"
@str.13 = [26 x i8] c"\09q = Quit - Ends the Game\00"
define i32 @main(i32 %0, i8** nocapture readnone %1) {
%3 = alloca %struct.sockaddr_un
%4 = alloca [10 x i8]
%5 = alloca [100 x i8]
%6 = tail call i32 @time(i32* null)
%7 = tail call i32 @srand(i32 %6)
%8 = bitcast %struct.sockaddr_un* %3 to i8*
%9 = getelementptr inbounds [10 x i8], [10 x i8]* %4, i64 0, i64 0
%10 = bitcast %struct.sockaddr_un* %3 to %struct.sockaddr*
%11 = load i32, i32* @PF_LOCAL
%12 = getelementptr inbounds %struct.sockaddr_un, %struct.sockaddr_un* %3, i64 0, i32 1
store i32 %11, i32* %12
%13 = tail call i32 @strcpy(i32 undef, i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%14 = load i32, i32* @PF_LOCAL
%15 = load i32, i32* @SOCK_STREAM
%16 = tail call i32 @socket(i32 %14, i32 %15, i32 0)
%17 = icmp slt i32 %16, 0
br i1 %17, label %18, label %20
18: ; preds = %2
%19 = tail call i32 @error(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.1, i64 0, i64 0))
br label %20
20: ; preds = %18, %2
%21 = call i32 @connect(i32 %16, %struct.sockaddr* %10, i32 8)
%22 = icmp eq i32 %21, -1
br i1 %22, label %23, label %27
23: ; preds = %20, %23
%24 = call i32 @sleep(i32 1)
%25 = call i32 @connect(i32 %16, %struct.sockaddr* %10, i32 8)
%26 = icmp eq i32 %25, -1
br i1 %26, label %23, label %27
27: ; preds = %23, %20
%28 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str, i64 0, i64 0))
%29 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @str.12, i64 0, i64 0))
%30 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @str.13, i64 0, i64 0))
%31 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 0
br label %32
32: ; preds = %115, %27
%33 = phi i32 [ 0, %27 ], [ %37, %115 ]
%34 = phi i32 [ 0, %27 ], [ %116, %115 ]
%35 = phi i32 [ 0, %27 ], [ %117, %115 ]
%36 = phi i32 [ 0, %27 ], [ %118, %115 ]
%37 = add nuw nsw i32 %33, 1
%38 = call i32 (...) @rand()
%39 = srem i32 %38, 3
%40 = call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.9, i64 0, i64 0))
%41 = call i32 @bzero(i8* %9, i32 10)
%42 = load i32, i32* @stdin
%43 = call i32 @fgets(i8* %9, i32 10, i32 %42)
%44 = load i8, i8* %9
%45 = icmp eq i8 %44, 114
br i1 %45, label %46, label %65
46: ; preds = %32
switch i32 %39, label %60 [
i32 0, label %47
i32 1, label %49
i32 2, label %51
]
47: ; preds = %46
%48 = add nsw i32 %34, 1
br label %53
49: ; preds = %46
%50 = add nsw i32 %35, 1
br label %53
51: ; preds = %46
%52 = add nsw i32 %36, 1
br label %53
53: ; preds = %47, %51, %49
%54 = phi i8* [ getelementptr inbounds ([15 x i8], [15 x i8]* @.str.7, i64 0, i64 0), %49 ], [ getelementptr inbounds ([15 x i8], [15 x i8]* @.str.6, i64 0, i64 0), %51 ], [ getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0), %47 ]
%55 = phi i32 [ %34, %49 ], [ %34, %51 ], [ %48, %47 ]
%56 = phi i32 [ %50, %49 ], [ %35, %51 ], [ %35, %47 ]
%57 = phi i32 [ %36, %49 ], [ %52, %51 ], [ %36, %47 ]
%58 = call i32 (i8*, i8*, i32, ...) @sprintf(i8* %31, i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.10, i64 0, i64 0), i32 %37, i8* %54)
%59 = call i32 @write(i32 %16, i8* %31, i32 100)
br label %60
60: ; preds = %53, %46
%61 = phi i32 [ %34, %46 ], [ %55, %53 ]
%62 = phi i32 [ %35, %46 ], [ %56, %53 ]
%63 = phi i32 [ %36, %46 ], [ %57, %53 ]
%64 = load i8, i8* %9
br label %65
65: ; preds = %60, %32
%66 = phi i32 [ %61, %60 ], [ %34, %32 ]
%67 = phi i32 [ %62, %60 ], [ %35, %32 ]
%68 = phi i32 [ %63, %60 ], [ %36, %32 ]
%69 = phi i8 [ %64, %60 ], [ %44, %32 ]
%70 = icmp eq i8 %69, 112
br i1 %70, label %71, label %82
71: ; preds = %65
switch i32 %39, label %82 [
i32 0, label %87
i32 1, label %72
i32 2, label %74
]
72: ; preds = %71
%73 = add nsw i32 %66, 1
br label %76
74: ; preds = %71
%75 = add nsw i32 %67, 1
br label %76
76: ; preds = %72, %74
%77 = phi i8* [ getelementptr inbounds ([15 x i8], [15 x i8]* @.str.7, i64 0, i64 0), %74 ], [ getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0), %72 ]
%78 = phi i32 [ %66, %74 ], [ %73, %72 ]
%79 = phi i32 [ %75, %74 ], [ %67, %72 ]
%80 = call i32 (i8*, i8*, i32, ...) @sprintf(i8* %31, i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.10, i64 0, i64 0), i32 %37, i8* %77)
%81 = call i32 @write(i32 %16, i8* %31, i32 100)
br label %82
82: ; preds = %76, %71, %65
%83 = phi i32 [ %66, %65 ], [ %66, %71 ], [ %78, %76 ]
%84 = phi i32 [ %67, %65 ], [ %67, %71 ], [ %79, %76 ]
%85 = load i8, i8* %9
%86 = icmp eq i8 %85, 115
br i1 %86, label %93, label %115
87: ; preds = %71
%88 = add nsw i32 %68, 1
%89 = call i32 (i8*, i8*, i32, ...) @sprintf(i8* %31, i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.10, i64 0, i64 0), i32 %37, i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.6, i64 0, i64 0))
%90 = call i32 @write(i32 %16, i8* %31, i32 100)
%91 = load i8, i8* %9
%92 = icmp eq i8 %91, 115
br i1 %92, label %94, label %115
93: ; preds = %82
switch i32 %39, label %110 [
i32 0, label %94
i32 1, label %99
i32 2, label %101
]
94: ; preds = %87, %93
%95 = phi i32 [ %83, %93 ], [ %66, %87 ]
%96 = phi i32 [ %84, %93 ], [ %67, %87 ]
%97 = phi i32 [ %68, %93 ], [ %88, %87 ]
%98 = add nsw i32 %96, 1
br label %103
99: ; preds = %93
%100 = add nsw i32 %68, 1
br label %103
101: ; preds = %93
%102 = add nsw i32 %83, 1
br label %103
103: ; preds = %94, %101, %99
%104 = phi i8* [ getelementptr inbounds ([15 x i8], [15 x i8]* @.str.6, i64 0, i64 0), %99 ], [ getelementptr inbounds ([10 x i8], [10 x i8]* @.str.5, i64 0, i64 0), %101 ], [ getelementptr inbounds ([15 x i8], [15 x i8]* @.str.7, i64 0, i64 0), %94 ]
%105 = phi i32 [ %83, %99 ], [ %102, %101 ], [ %95, %94 ]
%106 = phi i32 [ %84, %99 ], [ %84, %101 ], [ %98, %94 ]
%107 = phi i32 [ %100, %99 ], [ %68, %101 ], [ %97, %94 ]
%108 = call i32 (i8*, i8*, i32, ...) @sprintf(i8* %31, i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @.str.10, i64 0, i64 0), i32 %37, i8* %104)
%109 = call i32 @write(i32 %16, i8* %31, i32 100)
br label %110
110: ; preds = %103, %93
%111 = phi i32 [ %83, %93 ], [ %105, %103 ]
%112 = phi i32 [ %84, %93 ], [ %106, %103 ]
%113 = phi i32 [ %68, %93 ], [ %107, %103 ]
%114 = load i8, i8* %9
br label %115
115: ; preds = %110, %87, %82
%116 = phi i32 [ %111, %110 ], [ %66, %87 ], [ %83, %82 ]
%117 = phi i32 [ %112, %110 ], [ %67, %87 ], [ %84, %82 ]
%118 = phi i32 [ %113, %110 ], [ %88, %87 ], [ %68, %82 ]
%119 = phi i8 [ %114, %110 ], [ %91, %87 ], [ %85, %82 ]
%120 = icmp eq i8 %119, 113
br i1 %120, label %121, label %32
121: ; preds = %115
%122 = call i32 (i8*, i8*, i32, ...) @sprintf(i8* %31, i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.11, i64 0, i64 0), i32 %118, i32 %116, i32 %117)
%123 = call i32 @write(i32 %16, i8* %31, i32 100)
%124 = call i32 @close(i32 %16)
ret i32 0
}