#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 */

/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int rand();
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main() {
  int timesToLoop = 0;
  int playerScore = 0;
  int compScore = 0;
  int tieCount = 0;
  int playerChoice = 0;
  int compChoice = 0;
  int gameType = 0;
  do {
    printf("What type of game would you like to play?\nRegular "
           "rock-paper-scissors = 1 OR rock-paper-scissors-lizard-Spock = 2\n");
    scanf("%d", &gameType);
  } while (gameType == 0 || gameType >= 3);
  printf("How many times would you like to play? ");
  scanf("%d", &timesToLoop);
  for (int i = 0; i < timesToLoop; i++) {
    playerChoice = 0;
    compChoice = 0;
    printf("\n");
    printf("Game %d\n", i + 1);
    switch (gameType) {
    case 1:
      do {
        printf("3=Rock, 2=Scissors, 1=Paper\n");
        printf("Whats your choice? ");
        scanf("%d", &playerChoice);
      } while (playerChoice == 0 || playerChoice >= 4);
      break;
    case 2:
      do {
        printf("5=Spock, 4=Lizard, 3=Rock, 2=Scissors, 1=Paper\n");
        printf("Whats your choice? ");
        scanf("%d", &playerChoice);
      } while (playerChoice == 0 || playerChoice >= 6);
      break;
    }
    printf("What I chose was ");
    switch (gameType) {
    case 1:
      srand(time(NULL));
      compChoice = (rand() % 3) + 1;
      break;
    case 2:
      srand(time(NULL));
      compChoice = (rand() % 5) + 1;
      break;
    }
    switch (compChoice) {
    case 1:
      printf("Paper.\n");
      break;
    case 2:
      printf("Scissors.\n");
      break;
    case 3:
      printf("Rock.\n");
      break;
    case 4:
      printf("Lizard.\n");
      break;
    case 5:
      printf("Spock.\n");
      break;
    }
    printf("CALCULATING WINNER.\n");
    if (playerChoice == 1) {
      switch (compChoice) {
      case 1:
        printf("Tie game - no winner\n");
        tieCount += 1;
        break;
      case 2:
        printf("Scissors cuts paper\nYou Lose...\n");
        compScore += 1;
        break;
      case 3:
        printf("Paper covers rock\nYou Win!!!!\n");
        playerScore += 1;
        break;
      case 4:
        printf("Lizard eats Paper\nYou Lose...\n");
        compScore += 1;
        break;
      case 5:
        printf("Paper disproves Spock\nYou Win!!!!\n");
        playerScore += 1;
        break;
      }
    } else if (playerChoice == 2) {
      switch (compChoice) {
      case 1:
        printf("Scissors cuts paper\nYou win!!!\n");
        playerScore += 1;
        break;
      case 2:
        printf("Tie game - no winner\n");
        tieCount += 1;
        break;
      case 3:
        printf("Rock crushes scissors\nYou Lose...\n");
        compScore += 1;
        break;
      case 4:
        printf("Scissors decapitates lizard\nYou Win!!!\n");
        playerScore += 1;
        break;
      case 5:
        printf("Spock smashes scissors\nYou lose...\n");
        compScore += 1;
        break;
      }
    } else if (playerChoice == 3) {
      switch (compChoice) {
      case 1:
        printf("Paper covers rock\nYou lose...\n");
        compScore += 1;
        break;
      case 2:
        printf("Rock crushes scissors\nYou Win!!\n");
        playerScore += 1;
        break;
      case 3:
        printf("Tie game - no winner\n");
        tieCount += 1;
        break;
      case 4:
        printf("Rock crushes lizard\nYou Lose...\n");
        compScore += 1;
        break;
      case 5:
        printf("Spock vaporizes rock\nYou lose...\n");
        compScore += 1;
        break;
      }
    } else if (playerChoice == 4) {
      switch (compChoice) {
      case 1:
        printf("Lizard eats paper\nYou Win!!!!\n");
        playerScore += 1;
        break;
      case 2:
        printf("Scissors decapitates Lizard\nYou lose...\n");
        compScore += 1;
        break;
      case 3:
        printf("Rock crushes lizard\nYou lose...\n");
        compScore += 1;
        break;
      case 4:
        printf("Tie game - no winner\n");
        tieCount += 1;
        break;
      case 5:
        printf("Lizard poisons Spock\nYou win!!!\n");
        playerScore += 1;
        break;
      }
    } else if (playerChoice == 5) {
      switch (compChoice) {
      case 1:
        printf("Paper disproves Spock\nYou lose...\n");
        compScore += 1;
        break;
      case 2:
        printf("Spock crushes scissors\nYou win!!!\n");
        playerScore += 1;
        break;
      case 3:
        printf("Spock vaporizes rock\nYou win!!!\n");
        playerScore += 1;
        break;
      case 4:
        printf("Lizard poisons Spock\nYou lose!!!\n");
        compScore += 1;
        break;
      case 5:
        printf("Tie game - no winner\n");
        tieCount += 1;
        break;
      }
    }
  }
  printf("\nHere is the final score\n");
  printf("I have won %d game(s).\n", compScore);
  printf("You have won %d game(s).\n", playerScore);
  printf("We have tied %d game(s)\n", tieCount);
  printf("Thanks for playing!\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
lea    0xee1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf46(%rip),%rdi
lea    -0x20(%rbp),%rsi
call   1060 <scanf@plt>
mov    $0x1,%al
cmpl   $0x0,-0x20(%rbp)
mov    %al,-0x25(%rbp)
je     11c7 <main+0x77>
cmpl   $0x3,-0x20(%rbp)
setge  %al
mov    %al,-0x25(%rbp)
mov    -0x25(%rbp),%al
test   $0x1,%al
jne    1190 <main+0x40>
lea    0xf15(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf04(%rip),%rdi
lea    -0x8(%rbp),%rsi
call   1060 <scanf@plt>
movl   $0x0,-0x24(%rbp)
mov    -0x24(%rbp),%eax
cmp    -0x8(%rbp),%eax
jge    1805 <main+0x6b5>
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x1c(%rbp)
lea    0x1033(%rip),%rdi
xor    %eax,%eax
mov    %al,-0x2d(%rbp)
call   1030 <printf@plt>
mov    -0x2d(%rbp),%al
mov    -0x24(%rbp),%esi
add    $0x1,%esi
lea    0xee4(%rip),%rdi
call   1030 <printf@plt>
mov    -0x20(%rbp),%eax
mov    %eax,-0x2c(%rbp)
sub    $0x1,%eax
je     125c <main+0x10c>
jmp    124b <main+0xfb>
mov    -0x2c(%rbp),%eax
sub    $0x2,%eax
je     12b6 <main+0x166>
jmp    1310 <main+0x1c0>
jmp    1261 <main+0x111>
lea    0xede(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xea9(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe67(%rip),%rdi
lea    -0x18(%rbp),%rsi
call   1060 <scanf@plt>
mov    $0x1,%al
cmpl   $0x0,-0x18(%rbp)
mov    %al,-0x2e(%rbp)
je     12a6 <main+0x156>
cmpl   $0x4,-0x18(%rbp)
setge  %al
mov    %al,-0x2e(%rbp)
mov    -0x2e(%rbp),%al
test   $0x1,%al
jne    1261 <main+0x111>
jmp    1310 <main+0x1c0>
jmp    12bb <main+0x16b>
lea    0xe71(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe4f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xe0d(%rip),%rdi
lea    -0x18(%rbp),%rsi
call   1060 <scanf@plt>
mov    $0x1,%al
cmpl   $0x0,-0x18(%rbp)
mov    %al,-0x2f(%rbp)
je     1300 <main+0x1b0>
cmpl   $0x6,-0x18(%rbp)
setge  %al
mov    %al,-0x2f(%rbp)
mov    -0x2f(%rbp),%al
test   $0x1,%al
jne    12bb <main+0x16b>
jmp    1310 <main+0x1c0>
lea    0xe4c(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    -0x20(%rbp),%eax
mov    %eax,-0x34(%rbp)
sub    $0x1,%eax
je     1343 <main+0x1f3>
jmp    1332 <main+0x1e2>
mov    -0x34(%rbp),%eax
sub    $0x2,%eax
je     136d <main+0x21d>
jmp    1392 <main+0x242>
xor    %eax,%eax
mov    %eax,%edi
call   1050 <time@plt>
mov    %eax,%edi
call   1040 <srand@plt>
mov    $0x0,%al
call   1070 <rand@plt>
mov    $0x3,%ecx
cltd
idiv   %ecx
add    $0x1,%edx
mov    %edx,-0x1c(%rbp)
jmp    1392 <main+0x242>
xor    %eax,%eax
mov    %eax,%edi
call   1050 <time@plt>
mov    %eax,%edi
call   1040 <srand@plt>
mov    $0x0,%al
call   1070 <rand@plt>
mov    $0x5,%ecx
cltd
idiv   %ecx
add    $0x1,%edx
mov    %edx,-0x1c(%rbp)
mov    -0x1c(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x40(%rbp)
sub    $0x4,%eax
ja     1415 <main+0x2c5>
mov    -0x40(%rbp),%rax
lea    0xc4e(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xdb3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1415 <main+0x2c5>
lea    0xda8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1415 <main+0x2c5>
lea    0xda0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1415 <main+0x2c5>
lea    0xd94(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1415 <main+0x2c5>
lea    0xd8a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xd84(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
cmpl   $0x1,-0x18(%rbp)
jne    14e2 <main+0x392>
mov    -0x1c(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x48(%rbp)
sub    $0x4,%eax
ja     14dd <main+0x38d>
mov    -0x48(%rbp),%rax
lea    0xc17(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xd58(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    14dd <main+0x38d>
lea    0xd52(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    14dd <main+0x38d>
lea    0xd57(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    14dd <main+0x38d>
lea    0xd5a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    14dd <main+0x38d>
lea    0xd5d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    17f2 <main+0x6a2>
cmpl   $0x2,-0x18(%rbp)
jne    15a1 <main+0x451>
mov    -0x1c(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x50(%rbp)
sub    $0x4,%eax
ja     159c <main+0x44c>
mov    -0x50(%rbp),%rax
lea    0xb44(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xd31(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    159c <main+0x44c>
lea    0xc7d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    159c <main+0x44c>
lea    0xd19(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    159c <main+0x44c>
lea    0xd20(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    159c <main+0x44c>
lea    0xd2c(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    17ed <main+0x69d>
cmpl   $0x3,-0x18(%rbp)
jne    1660 <main+0x510>
mov    -0x1c(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x58(%rbp)
sub    $0x4,%eax
ja     165b <main+0x50b>
mov    -0x58(%rbp),%rax
lea    0xa71(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xd01(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    165b <main+0x50b>
lea    0xd04(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    165b <main+0x50b>
lea    0xba2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    165b <main+0x50b>
lea    0xced(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    165b <main+0x50b>
lea    0xcf2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    17e8 <main+0x698>
cmpl   $0x4,-0x18(%rbp)
jne    171f <main+0x5cf>
mov    -0x1c(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x60(%rbp)
sub    $0x4,%eax
ja     171a <main+0x5ca>
mov    -0x60(%rbp),%rax
lea    0x99e(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xcc5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    171a <main+0x5ca>
lea    0xcc8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    171a <main+0x5ca>
lea    0xcd5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    171a <main+0x5ca>
lea    0xac7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    171a <main+0x5ca>
lea    0xcbe(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    17e3 <main+0x693>
cmpl   $0x5,-0x18(%rbp)
jne    17de <main+0x68e>
mov    -0x1c(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x68(%rbp)
sub    $0x4,%eax
ja     17d9 <main+0x689>
mov    -0x68(%rbp),%rax
lea    0x8cb(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xc90(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    17d9 <main+0x689>
lea    0xc97(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    17d9 <main+0x689>
lea    0xc9e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    17d9 <main+0x689>
lea    0xca3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    17d9 <main+0x689>
lea    0x9ec(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    17de <main+0x68e>
jmp    17e3 <main+0x693>
jmp    17e8 <main+0x698>
jmp    17ed <main+0x69d>
jmp    17f2 <main+0x6a2>
jmp    17f7 <main+0x6a7>
mov    -0x24(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x24(%rbp)
jmp    11f7 <main+0xa7>
lea    0xc66(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x10(%rbp),%esi
lea    0xc6f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0xc(%rbp),%esi
lea    0xc76(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
mov    -0x14(%rbp),%esi
lea    0xc7f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xc8a(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
movl   $0x0,0x14(%rsp)
movl   $0x0,0xc(%rsp)
movl   $0x0,0x10(%rsp)
lea    0xf94(%rip),%r14
lea    0xee8(%rip),%rbp
lea    0x10(%rsp),%rbx
nopl   0x0(%rax)
mov    %r14,%rdi
call   1040 <puts@plt>
mov    %rbp,%rdi
mov    %rbx,%rsi
call   1080 <scanf@plt>
mov    0x10(%rsp),%eax
test   %eax,%eax
je     11b0 <main+0x40>
cmp    $0x2,%eax
jg     11b0 <main+0x40>
lea    0xeb8(%rip),%rdi
movl   $0x0,0x4(%rsp)
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xe9f(%rip),%rdi
lea    0x14(%rsp),%rsi
call   1080 <scanf@plt>
cmpl   $0x0,0x14(%rsp)
movl   $0x0,(%rsp)
movl   $0x0,0x8(%rsp)
jle    153b <main+0x3cb>
lea    0xfcb(%rip),%r13
lea    0xea1(%rip),%rbx
lea    0xe66(%rip),%r12
lea    0xc(%rsp),%r15
lea    0xf9e(%rip),%r14
xor    %ebp,%ebp
movl   $0x0,0x8(%rsp)
movl   $0x0,(%rsp)
movl   $0x0,0x4(%rsp)
jmp    1281 <main+0x111>
lea    0x1239(%rip),%rdi
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
call   1040 <puts@plt>
addl   $0x1,(%rsp)
lea    0xf60(%rip),%r14
lea    0xe49(%rip),%rbx
cmp    0x14(%rsp),%ebp
jge    153b <main+0x3cb>
movl   $0x0,0xc(%rsp)
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%ebp
lea    0xe1a(%rip),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x10(%rsp),%eax
cmp    $0x1,%eax
je     12f0 <main+0x180>
cmp    $0x2,%eax
jne    131a <main+0x1aa>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    %r14,%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r12,%rdi
mov    %r15,%rsi
call   1080 <scanf@plt>
mov    0xc(%rsp),%eax
test   %eax,%eax
je     12c0 <main+0x150>
cmp    $0x5,%eax
jg     12c0 <main+0x150>
jmp    131a <main+0x1aa>
nopl   0x0(%rax)
mov    %r13,%rdi
call   1040 <puts@plt>
mov    %rbx,%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    %r12,%rdi
mov    %r15,%rsi
call   1080 <scanf@plt>
mov    0xc(%rsp),%eax
test   %eax,%eax
je     12f0 <main+0x180>
cmp    $0x3,%eax
jg     12f0 <main+0x180>
xor    %r14d,%r14d
lea    0xdb0(%rip),%rdi
xor    %eax,%eax
call   1050 <printf@plt>
mov    0x10(%rsp),%eax
cmp    $0x1,%eax
je     1340 <main+0x1d0>
cmp    $0x2,%eax
jne    1383 <main+0x213>
mov    $0x5,%ebx
jmp    1345 <main+0x1d5>
mov    $0x3,%ebx
xor    %edi,%edi
call   1070 <time@plt>
mov    %eax,%edi
call   1060 <srand@plt>
xor    %eax,%eax
call   1090 <rand@plt>
cltd
idiv   %ebx
lea    0x1(%rdx),%r14d
cmp    $0x4,%edx
ja     137c <main+0x20c>
movslq %edx,%rax
lea    0xd08(%rip),%rcx
movslq (%rcx,%rax,4),%rdi
add    %rcx,%rdi
call   1040 <puts@plt>
lea    0xe60(%rip),%r13
lea    0xe7c(%rip),%rdi
call   1040 <puts@plt>
mov    0xc(%rsp),%eax
add    $0xffffffff,%eax
cmp    $0x4,%eax
ja     1269 <main+0xf9>
lea    0xc5a(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
add    $0xffffffff,%r14d
cmp    $0x4,%r14d
ja     1269 <main+0xf9>
lea    0xca0(%rip),%rcx
movslq (%rcx,%r14,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0x109b(%rip),%rdi
jmp    1520 <main+0x3b0>
add    $0xffffffff,%r14d
cmp    $0x4,%r14d
ja     1269 <main+0xf9>
lea    0xc62(%rip),%rcx
movslq (%rcx,%r14,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0x1012(%rip),%rdi
jmp    1520 <main+0x3b0>
add    $0xffffffff,%r14d
cmp    $0x4,%r14d
ja     1269 <main+0xf9>
lea    0xc24(%rip),%rcx
movslq (%rcx,%r14,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xf5e(%rip),%rdi
jmp    1260 <main+0xf0>
add    $0xffffffff,%r14d
cmp    $0x4,%r14d
ja     1269 <main+0xf9>
lea    0xbe6(%rip),%rcx
movslq (%rcx,%r14,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xeb5(%rip),%rdi
jmp    1520 <main+0x3b0>
add    $0xffffffff,%r14d
cmp    $0x4,%r14d
ja     1269 <main+0xf9>
lea    0xba8(%rip),%rcx
movslq (%rcx,%r14,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xe01(%rip),%rdi
jmp    1260 <main+0xf0>
lea    0x1025(%rip),%rdi
call   1040 <puts@plt>
addl   $0x1,0x8(%rsp)
jmp    1269 <main+0xf9>
lea    0xfb3(%rip),%rdi
jmp    1260 <main+0xf0>
lea    0xf85(%rip),%rdi
jmp    1520 <main+0x3b0>
lea    0xf3b(%rip),%rdi
jmp    1260 <main+0xf0>
lea    0xf08(%rip),%rdi
jmp    1520 <main+0x3b0>
lea    0xedc(%rip),%rdi
jmp    1260 <main+0xf0>
lea    0xe92(%rip),%rdi
jmp    1520 <main+0x3b0>
lea    0xe69(%rip),%rdi
jmp    1260 <main+0xf0>
lea    0xe3c(%rip),%rdi
jmp    1260 <main+0xf0>
lea    0xdea(%rip),%rdi
jmp    1260 <main+0xf0>
lea    0xdbe(%rip),%rdi
jmp    1260 <main+0xf0>
lea    0xd92(%rip),%rdi
jmp    1520 <main+0x3b0>
lea    0xd45(%rip),%rdi
jmp    1520 <main+0x3b0>
lea    0xd1c(%rip),%rdi
nop
call   1040 <puts@plt>
addl   $0x1,0x4(%rsp)
jmp    1269 <main+0xf9>
lea    0xce4(%rip),%rdi
jmp    1260 <main+0xf0>
lea    0xc61(%rip),%rdi
call   1040 <puts@plt>
lea    0xb98(%rip),%rdi
mov    (%rsp),%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xb9f(%rip),%rdi
mov    0x4(%rsp),%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xba7(%rip),%rdi
mov    0x8(%rsp),%esi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xc39(%rip),%rdi
call   1040 <puts@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [115 x i8] c"What type of game would you like to play?\0ARegular rock-paper-scissors = 1 OR rock-paper-scissors-lizard-Spock = 2\0A\00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [40 x i8] c"How many times would you like to play? \00"
@.str.3 = [2 x i8] c"\0A\00"
@.str.4 = [9 x i8] c"Game %d\0A\00"
@.str.5 = [29 x i8] c"3=Rock, 2=Scissors, 1=Paper\0A\00"
@.str.6 = [20 x i8] c"Whats your choice? \00"
@.str.7 = [48 x i8] c"5=Spock, 4=Lizard, 3=Rock, 2=Scissors, 1=Paper\0A\00"
@.str.8 = [18 x i8] c"What I chose was \00"
@.str.9 = [8 x i8] c"Paper.\0A\00"
@.str.10 = [11 x i8] c"Scissors.\0A\00"
@.str.11 = [7 x i8] c"Rock.\0A\00"
@.str.12 = [9 x i8] c"Lizard.\0A\00"
@.str.13 = [8 x i8] c"Spock.\0A\00"
@.str.14 = [21 x i8] c"CALCULATING WINNER.\0A\00"
@.str.15 = [22 x i8] c"Tie game - no winner\0A\00"
@.str.16 = [33 x i8] c"Scissors cuts paper\0AYou Lose...\0A\00"
@.str.17 = [31 x i8] c"Paper covers rock\0AYou Win!!!!\0A\00"
@.str.18 = [31 x i8] c"Lizard eats Paper\0AYou Lose...\0A\00"
@.str.19 = [35 x i8] c"Paper disproves Spock\0AYou Win!!!!\0A\00"
@.str.20 = [32 x i8] c"Scissors cuts paper\0AYou win!!!\0A\00"
@.str.21 = [35 x i8] c"Rock crushes scissors\0AYou Lose...\0A\00"
@.str.22 = [40 x i8] c"Scissors decapitates lizard\0AYou Win!!!\0A\00"
@.str.23 = [36 x i8] c"Spock smashes scissors\0AYou lose...\0A\00"
@.str.24 = [31 x i8] c"Paper covers rock\0AYou lose...\0A\00"
@.str.25 = [33 x i8] c"Rock crushes scissors\0AYou Win!!\0A\00"
@.str.26 = [33 x i8] c"Rock crushes lizard\0AYou Lose...\0A\00"
@.str.27 = [34 x i8] c"Spock vaporizes rock\0AYou lose...\0A\00"
@.str.28 = [31 x i8] c"Lizard eats paper\0AYou Win!!!!\0A\00"
@.str.29 = [41 x i8] c"Scissors decapitates Lizard\0AYou lose...\0A\00"
@.str.30 = [33 x i8] c"Rock crushes lizard\0AYou lose...\0A\00"
@.str.31 = [33 x i8] c"Lizard poisons Spock\0AYou win!!!\0A\00"
@.str.32 = [35 x i8] c"Paper disproves Spock\0AYou lose...\0A\00"
@.str.33 = [35 x i8] c"Spock crushes scissors\0AYou win!!!\0A\00"
@.str.34 = [33 x i8] c"Spock vaporizes rock\0AYou win!!!\0A\00"
@.str.35 = [34 x i8] c"Lizard poisons Spock\0AYou lose!!!\0A\00"
@.str.36 = [26 x i8] c"\0AHere is the final score\0A\00"
@.str.37 = [24 x i8] c"I have won %d game(s).\0A\00"
@.str.38 = [26 x i8] c"You have won %d game(s).\0A\00"
@.str.39 = [25 x i8] c"We have tied %d game(s)\0A\00"
@.str.40 = [21 x i8] c"Thanks for playing!\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
%7 = alloca i32
%8 = alloca i32
%9 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
store i32 0, i32* %3
store i32 0, i32* %4
store i32 0, i32* %5
store i32 0, i32* %6
store i32 0, i32* %7
store i32 0, i32* %8
br label %10
10: ; preds = %19, %0
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([115 x i8], [115 x i8]* @.str, i64 0, i64 0))
%12 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %8)
br label %13
13: ; preds = %10
%14 = load i32, i32* %8
%15 = icmp eq i32 %14, 0
br i1 %15, label %19, label %16
16: ; preds = %13
%17 = load i32, i32* %8
%18 = icmp sge i32 %17, 3
br label %19
19: ; preds = %16, %13
%20 = phi i1 [ true, %13 ], [ %18, %16 ]
br i1 %20, label %10, label %21
21: ; preds = %19
%22 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.2, i64 0, i64 0))
%23 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
store i32 0, i32* %9
br label %24
24: ; preds = %225, %21
%25 = load i32, i32* %9
%26 = load i32, i32* %2
%27 = icmp slt i32 %25, %26
br i1 %27, label %28, label %228
28: ; preds = %24
store i32 0, i32* %6
store i32 0, i32* %7
%29 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%30 = load i32, i32* %9
%31 = add nsw i32 %30, 1
%32 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), i32 %31)
%33 = load i32, i32* %8
switch i32 %33, label %62 [
i32 1, label %34
i32 2, label %48
]
34: ; preds = %28
br label %35
35: ; preds = %45, %34
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.5, i64 0, i64 0))
%37 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.6, i64 0, i64 0))
%38 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %6)
br label %39
39: ; preds = %35
%40 = load i32, i32* %6
%41 = icmp eq i32 %40, 0
br i1 %41, label %45, label %42
42: ; preds = %39
%43 = load i32, i32* %6
%44 = icmp sge i32 %43, 4
br label %45
45: ; preds = %42, %39
%46 = phi i1 [ true, %39 ], [ %44, %42 ]
br i1 %46, label %35, label %47
47: ; preds = %45
br label %62
48: ; preds = %28
br label %49
49: ; preds = %59, %48
%50 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str.7, i64 0, i64 0))
%51 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.6, i64 0, i64 0))
%52 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %6)
br label %53
53: ; preds = %49
%54 = load i32, i32* %6
%55 = icmp eq i32 %54, 0
br i1 %55, label %59, label %56
56: ; preds = %53
%57 = load i32, i32* %6
%58 = icmp sge i32 %57, 6
br label %59
59: ; preds = %56, %53
%60 = phi i1 [ true, %53 ], [ %58, %56 ]
br i1 %60, label %49, label %61
61: ; preds = %59
br label %62
62: ; preds = %28, %61, %47
%63 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.8, i64 0, i64 0))
%64 = load i32, i32* %8
switch i32 %64, label %77 [
i32 1, label %65
i32 2, label %71
]
65: ; preds = %62
%66 = call i32 @time(i32* null)
%67 = call i32 @srand(i32 %66)
%68 = call i32 (...) @rand()
%69 = srem i32 %68, 3
%70 = add nsw i32 %69, 1
store i32 %70, i32* %7
br label %77
71: ; preds = %62
%72 = call i32 @time(i32* null)
%73 = call i32 @srand(i32 %72)
%74 = call i32 (...) @rand()
%75 = srem i32 %74, 5
%76 = add nsw i32 %75, 1
store i32 %76, i32* %7
br label %77
77: ; preds = %62, %71, %65
%78 = load i32, i32* %7
switch i32 %78, label %89 [
i32 1, label %79
i32 2, label %81
i32 3, label %83
i32 4, label %85
i32 5, label %87
]
79: ; preds = %77
%80 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.9, i64 0, i64 0))
br label %89
81: ; preds = %77
%82 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.10, i64 0, i64 0))
br label %89
83: ; preds = %77
%84 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.11, i64 0, i64 0))
br label %89
85: ; preds = %77
%86 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.12, i64 0, i64 0))
br label %89
87: ; preds = %77
%88 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.13, i64 0, i64 0))
br label %89
89: ; preds = %77, %87, %85, %83, %81, %79
%90 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.14, i64 0, i64 0))
%91 = load i32, i32* %6
%92 = icmp eq i32 %91, 1
br i1 %92, label %93, label %116
93: ; preds = %89
%94 = load i32, i32* %7
switch i32 %94, label %115 [
i32 1, label %95
i32 2, label %99
i32 3, label %103
i32 4, label %107
i32 5, label %111
]
95: ; preds = %93
%96 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.15, i64 0, i64 0))
%97 = load i32, i32* %5
%98 = add nsw i32 %97, 1
store i32 %98, i32* %5
br label %115
99: ; preds = %93
%100 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.16, i64 0, i64 0))
%101 = load i32, i32* %4
%102 = add nsw i32 %101, 1
store i32 %102, i32* %4
br label %115
103: ; preds = %93
%104 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.17, i64 0, i64 0))
%105 = load i32, i32* %3
%106 = add nsw i32 %105, 1
store i32 %106, i32* %3
br label %115
107: ; preds = %93
%108 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.18, i64 0, i64 0))
%109 = load i32, i32* %4
%110 = add nsw i32 %109, 1
store i32 %110, i32* %4
br label %115
111: ; preds = %93
%112 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.19, i64 0, i64 0))
%113 = load i32, i32* %3
%114 = add nsw i32 %113, 1
store i32 %114, i32* %3
br label %115
115: ; preds = %93, %111, %107, %103, %99, %95
br label %224
116: ; preds = %89
%117 = load i32, i32* %6
%118 = icmp eq i32 %117, 2
br i1 %118, label %119, label %142
119: ; preds = %116
%120 = load i32, i32* %7
switch i32 %120, label %141 [
i32 1, label %121
i32 2, label %125
i32 3, label %129
i32 4, label %133
i32 5, label %137
]
121: ; preds = %119
%122 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.20, i64 0, i64 0))
%123 = load i32, i32* %3
%124 = add nsw i32 %123, 1
store i32 %124, i32* %3
br label %141
125: ; preds = %119
%126 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.15, i64 0, i64 0))
%127 = load i32, i32* %5
%128 = add nsw i32 %127, 1
store i32 %128, i32* %5
br label %141
129: ; preds = %119
%130 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.21, i64 0, i64 0))
%131 = load i32, i32* %4
%132 = add nsw i32 %131, 1
store i32 %132, i32* %4
br label %141
133: ; preds = %119
%134 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.22, i64 0, i64 0))
%135 = load i32, i32* %3
%136 = add nsw i32 %135, 1
store i32 %136, i32* %3
br label %141
137: ; preds = %119
%138 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.23, i64 0, i64 0))
%139 = load i32, i32* %4
%140 = add nsw i32 %139, 1
store i32 %140, i32* %4
br label %141
141: ; preds = %119, %137, %133, %129, %125, %121
br label %223
142: ; preds = %116
%143 = load i32, i32* %6
%144 = icmp eq i32 %143, 3
br i1 %144, label %145, label %168
145: ; preds = %142
%146 = load i32, i32* %7
switch i32 %146, label %167 [
i32 1, label %147
i32 2, label %151
i32 3, label %155
i32 4, label %159
i32 5, label %163
]
147: ; preds = %145
%148 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.24, i64 0, i64 0))
%149 = load i32, i32* %4
%150 = add nsw i32 %149, 1
store i32 %150, i32* %4
br label %167
151: ; preds = %145
%152 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.25, i64 0, i64 0))
%153 = load i32, i32* %3
%154 = add nsw i32 %153, 1
store i32 %154, i32* %3
br label %167
155: ; preds = %145
%156 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.15, i64 0, i64 0))
%157 = load i32, i32* %5
%158 = add nsw i32 %157, 1
store i32 %158, i32* %5
br label %167
159: ; preds = %145
%160 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.26, i64 0, i64 0))
%161 = load i32, i32* %4
%162 = add nsw i32 %161, 1
store i32 %162, i32* %4
br label %167
163: ; preds = %145
%164 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.27, i64 0, i64 0))
%165 = load i32, i32* %4
%166 = add nsw i32 %165, 1
store i32 %166, i32* %4
br label %167
167: ; preds = %145, %163, %159, %155, %151, %147
br label %222
168: ; preds = %142
%169 = load i32, i32* %6
%170 = icmp eq i32 %169, 4
br i1 %170, label %171, label %194
171: ; preds = %168
%172 = load i32, i32* %7
switch i32 %172, label %193 [
i32 1, label %173
i32 2, label %177
i32 3, label %181
i32 4, label %185
i32 5, label %189
]
173: ; preds = %171
%174 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.28, i64 0, i64 0))
%175 = load i32, i32* %3
%176 = add nsw i32 %175, 1
store i32 %176, i32* %3
br label %193
177: ; preds = %171
%178 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.29, i64 0, i64 0))
%179 = load i32, i32* %4
%180 = add nsw i32 %179, 1
store i32 %180, i32* %4
br label %193
181: ; preds = %171
%182 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.30, i64 0, i64 0))
%183 = load i32, i32* %4
%184 = add nsw i32 %183, 1
store i32 %184, i32* %4
br label %193
185: ; preds = %171
%186 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.15, i64 0, i64 0))
%187 = load i32, i32* %5
%188 = add nsw i32 %187, 1
store i32 %188, i32* %5
br label %193
189: ; preds = %171
%190 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.31, i64 0, i64 0))
%191 = load i32, i32* %3
%192 = add nsw i32 %191, 1
store i32 %192, i32* %3
br label %193
193: ; preds = %171, %189, %185, %181, %177, %173
br label %221
194: ; preds = %168
%195 = load i32, i32* %6
%196 = icmp eq i32 %195, 5
br i1 %196, label %197, label %220
197: ; preds = %194
%198 = load i32, i32* %7
switch i32 %198, label %219 [
i32 1, label %199
i32 2, label %203
i32 3, label %207
i32 4, label %211
i32 5, label %215
]
199: ; preds = %197
%200 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.32, i64 0, i64 0))
%201 = load i32, i32* %4
%202 = add nsw i32 %201, 1
store i32 %202, i32* %4
br label %219
203: ; preds = %197
%204 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.33, i64 0, i64 0))
%205 = load i32, i32* %3
%206 = add nsw i32 %205, 1
store i32 %206, i32* %3
br label %219
207: ; preds = %197
%208 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.34, i64 0, i64 0))
%209 = load i32, i32* %3
%210 = add nsw i32 %209, 1
store i32 %210, i32* %3
br label %219
211: ; preds = %197
%212 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.35, i64 0, i64 0))
%213 = load i32, i32* %4
%214 = add nsw i32 %213, 1
store i32 %214, i32* %4
br label %219
215: ; preds = %197
%216 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.15, i64 0, i64 0))
%217 = load i32, i32* %5
%218 = add nsw i32 %217, 1
store i32 %218, i32* %5
br label %219
219: ; preds = %197, %215, %211, %207, %203, %199
br label %220
220: ; preds = %219, %194
br label %221
221: ; preds = %220, %193
br label %222
222: ; preds = %221, %167
br label %223
223: ; preds = %222, %141
br label %224
224: ; preds = %223, %115
br label %225
225: ; preds = %224
%226 = load i32, i32* %9
%227 = add nsw i32 %226, 1
store i32 %227, i32* %9
br label %24
228: ; preds = %24
%229 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.36, i64 0, i64 0))
%230 = load i32, i32* %4
%231 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.37, i64 0, i64 0), i32 %230)
%232 = load i32, i32* %3
%233 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.38, i64 0, i64 0), i32 %232)
%234 = load i32, i32* %5
%235 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.39, i64 0, i64 0), i32 %234)
%236 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.40, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [40 x i8] c"How many times would you like to play? \00"
@.str.4 = [9 x i8] c"Game %d\0A\00"
@.str.6 = [20 x i8] c"Whats your choice? \00"
@.str.8 = [18 x i8] c"What I chose was \00"
@.str.37 = [24 x i8] c"I have won %d game(s).\0A\00"
@.str.38 = [26 x i8] c"You have won %d game(s).\0A\00"
@.str.39 = [25 x i8] c"We have tied %d game(s)\0A\00"
@str = [114 x i8] c"What type of game would you like to play?\0ARegular rock-paper-scissors = 1 OR rock-paper-scissors-lizard-Spock = 2\00"
@str.41 = [25 x i8] c"\0AHere is the final score\00"
@str.42 = [20 x i8] c"Thanks for playing!\00"
@str.43 = [47 x i8] c"5=Spock, 4=Lizard, 3=Rock, 2=Scissors, 1=Paper\00"
@str.44 = [7 x i8] c"Spock.\00"
@str.45 = [20 x i8] c"CALCULATING WINNER.\00"
@str.47 = [33 x i8] c"Lizard poisons Spock\0AYou lose!!!\00"
@str.48 = [32 x i8] c"Spock vaporizes rock\0AYou win!!!\00"
@str.49 = [34 x i8] c"Spock crushes scissors\0AYou win!!!\00"
@str.50 = [34 x i8] c"Paper disproves Spock\0AYou lose...\00"
@str.51 = [32 x i8] c"Lizard poisons Spock\0AYou win!!!\00"
@str.53 = [32 x i8] c"Rock crushes lizard\0AYou lose...\00"
@str.54 = [40 x i8] c"Scissors decapitates Lizard\0AYou lose...\00"
@str.55 = [30 x i8] c"Lizard eats paper\0AYou Win!!!!\00"
@str.56 = [33 x i8] c"Spock vaporizes rock\0AYou lose...\00"
@str.57 = [32 x i8] c"Rock crushes lizard\0AYou Lose...\00"
@str.59 = [32 x i8] c"Rock crushes scissors\0AYou Win!!\00"
@str.60 = [30 x i8] c"Paper covers rock\0AYou lose...\00"
@str.61 = [35 x i8] c"Spock smashes scissors\0AYou lose...\00"
@str.62 = [39 x i8] c"Scissors decapitates lizard\0AYou Win!!!\00"
@str.63 = [34 x i8] c"Rock crushes scissors\0AYou Lose...\00"
@str.65 = [31 x i8] c"Scissors cuts paper\0AYou win!!!\00"
@str.66 = [34 x i8] c"Paper disproves Spock\0AYou Win!!!!\00"
@str.67 = [30 x i8] c"Lizard eats Paper\0AYou Lose...\00"
@str.68 = [30 x i8] c"Paper covers rock\0AYou Win!!!!\00"
@str.69 = [32 x i8] c"Scissors cuts paper\0AYou Lose...\00"
@str.70 = [21 x i8] c"Tie game - no winner\00"
@str.71 = [8 x i8] c"Lizard.\00"
@str.72 = [6 x i8] c"Rock.\00"
@str.73 = [10 x i8] c"Scissors.\00"
@str.74 = [7 x i8] c"Paper.\00"
@str.75 = [28 x i8] c"3=Rock, 2=Scissors, 1=Paper\00"
@reltable.main = [5 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([7 x i8]* @str.74 to i64), i64 ptrtoint ([5 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([10 x i8]* @str.73 to i64), i64 ptrtoint ([5 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([6 x i8]* @str.72 to i64), i64 ptrtoint ([5 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([8 x i8]* @str.71 to i64), i64 ptrtoint ([5 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([7 x i8]* @str.44 to i64), i64 ptrtoint ([5 x i32]* @reltable.main to i64)) to i32)]
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%5 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%6 = bitcast i32* %3 to i8*
store i32 0, i32* %3
br label %7
7: ; preds = %7, %0
%8 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([114 x i8], [114 x i8]* @str, i64 0, i64 0))
%9 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%10 = load i32, i32* %3
%11 = icmp eq i32 %10, 0
%12 = icmp sgt i32 %10, 2
%13 = or i1 %11, %12
br i1 %13, label %7, label %14
14: ; preds = %7
%15 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @.str.2, i64 0, i64 0))
%16 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%17 = load i32, i32* %1
%18 = icmp sgt i32 %17, 0
br i1 %18, label %28, label %19
19: ; preds = %155, %14
%20 = phi i32 [ 0, %14 ], [ %156, %155 ]
%21 = phi i32 [ 0, %14 ], [ %157, %155 ]
%22 = phi i32 [ 0, %14 ], [ %158, %155 ]
%23 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @str.41, i64 0, i64 0))
%24 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.37, i64 0, i64 0), i32 %21)
%25 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.38, i64 0, i64 0), i32 %20)
%26 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.39, i64 0, i64 0), i32 %22)
%27 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str.42, i64 0, i64 0))
ret i32 0
28: ; preds = %14, %155
%29 = phi i32 [ %34, %155 ], [ 0, %14 ]
%30 = phi i32 [ %158, %155 ], [ 0, %14 ]
%31 = phi i32 [ %157, %155 ], [ 0, %14 ]
%32 = phi i32 [ %156, %155 ], [ 0, %14 ]
store i32 0, i32* %2
%33 = call i32 @putchar(i32 10)
%34 = add nuw nsw i32 %29, 1
%35 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.4, i64 0, i64 0), i32 %34)
%36 = load i32, i32* %3
switch i32 %36, label %53 [
i32 1, label %37
i32 2, label %45
]
37: ; preds = %28, %37
%38 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str.75, i64 0, i64 0))
%39 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.6, i64 0, i64 0))
%40 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%41 = load i32, i32* %2
%42 = icmp eq i32 %41, 0
%43 = icmp sgt i32 %41, 3
%44 = or i1 %42, %43
br i1 %44, label %37, label %53
45: ; preds = %28, %45
%46 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([47 x i8], [47 x i8]* @str.43, i64 0, i64 0))
%47 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.6, i64 0, i64 0))
%48 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%49 = load i32, i32* %2
%50 = icmp eq i32 %49, 0
%51 = icmp sgt i32 %49, 5
%52 = or i1 %50, %51
br i1 %52, label %45, label %53
53: ; preds = %45, %37, %28
%54 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.8, i64 0, i64 0))
%55 = load i32, i32* %3
switch i32 %55, label %71 [
i32 1, label %57
i32 2, label %56
]
56: ; preds = %53
br label %57
57: ; preds = %53, %56
%58 = phi i32 [ 5, %56 ], [ 3, %53 ]
%59 = call i32 @time(i32* null)
%60 = call i32 @srand(i32 %59)
%61 = call i32 (...) @rand()
%62 = srem i32 %61, %58
%63 = add nsw i32 %62, 1
%64 = icmp ult i32 %62, 5
br i1 %64, label %65, label %71
65: ; preds = %57
%66 = sext i32 %62 to i64
%67 = shl i64 %66, 2
%68 = call i8* @llvm.load.relative.i64(i8* bitcast ([5 x i32]* @reltable.main to i8*), i64 %67)
%69 = add i32 %62, 1
%70 = call i32 @puts(i8* dereferenceable(1) %68)
br label %71
71: ; preds = %57, %65, %53
%72 = phi i32 [ %63, %57 ], [ 0, %53 ], [ %69, %65 ]
%73 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @str.45, i64 0, i64 0))
%74 = load i32, i32* %2
switch i32 %74, label %155 [
i32 1, label %75
i32 2, label %91
i32 3, label %107
i32 4, label %123
i32 5, label %139
]
75: ; preds = %71
switch i32 %72, label %155 [
i32 1, label %76
i32 2, label %79
i32 3, label %82
i32 4, label %85
i32 5, label %88
]
76: ; preds = %75
%77 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str.70, i64 0, i64 0))
%78 = add nsw i32 %30, 1
br label %155
79: ; preds = %75
%80 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str.69, i64 0, i64 0))
%81 = add nsw i32 %31, 1
br label %155
82: ; preds = %75
%83 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str.68, i64 0, i64 0))
%84 = add nsw i32 %32, 1
br label %155
85: ; preds = %75
%86 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str.67, i64 0, i64 0))
%87 = add nsw i32 %31, 1
br label %155
88: ; preds = %75
%89 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str.66, i64 0, i64 0))
%90 = add nsw i32 %32, 1
br label %155
91: ; preds = %71
switch i32 %72, label %155 [
i32 1, label %92
i32 2, label %95
i32 3, label %98
i32 4, label %101
i32 5, label %104
]
92: ; preds = %91
%93 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str.65, i64 0, i64 0))
%94 = add nsw i32 %32, 1
br label %155
95: ; preds = %91
%96 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str.70, i64 0, i64 0))
%97 = add nsw i32 %30, 1
br label %155
98: ; preds = %91
%99 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str.63, i64 0, i64 0))
%100 = add nsw i32 %31, 1
br label %155
101: ; preds = %91
%102 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @str.62, i64 0, i64 0))
%103 = add nsw i32 %32, 1
br label %155
104: ; preds = %91
%105 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str.61, i64 0, i64 0))
%106 = add nsw i32 %31, 1
br label %155
107: ; preds = %71
switch i32 %72, label %155 [
i32 1, label %108
i32 2, label %111
i32 3, label %114
i32 4, label %117
i32 5, label %120
]
108: ; preds = %107
%109 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str.60, i64 0, i64 0))
%110 = add nsw i32 %31, 1
br label %155
111: ; preds = %107
%112 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str.59, i64 0, i64 0))
%113 = add nsw i32 %32, 1
br label %155
114: ; preds = %107
%115 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str.70, i64 0, i64 0))
%116 = add nsw i32 %30, 1
br label %155
117: ; preds = %107
%118 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str.57, i64 0, i64 0))
%119 = add nsw i32 %31, 1
br label %155
120: ; preds = %107
%121 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str.56, i64 0, i64 0))
%122 = add nsw i32 %31, 1
br label %155
123: ; preds = %71
switch i32 %72, label %155 [
i32 1, label %124
i32 2, label %127
i32 3, label %130
i32 4, label %133
i32 5, label %136
]
124: ; preds = %123
%125 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str.55, i64 0, i64 0))
%126 = add nsw i32 %32, 1
br label %155
127: ; preds = %123
%128 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @str.54, i64 0, i64 0))
%129 = add nsw i32 %31, 1
br label %155
130: ; preds = %123
%131 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str.53, i64 0, i64 0))
%132 = add nsw i32 %31, 1
br label %155
133: ; preds = %123
%134 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str.70, i64 0, i64 0))
%135 = add nsw i32 %30, 1
br label %155
136: ; preds = %123
%137 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str.51, i64 0, i64 0))
%138 = add nsw i32 %32, 1
br label %155
139: ; preds = %71
switch i32 %72, label %155 [
i32 1, label %140
i32 2, label %143
i32 3, label %146
i32 4, label %149
i32 5, label %152
]
140: ; preds = %139
%141 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str.50, i64 0, i64 0))
%142 = add nsw i32 %31, 1
br label %155
143: ; preds = %139
%144 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str.49, i64 0, i64 0))
%145 = add nsw i32 %32, 1
br label %155
146: ; preds = %139
%147 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @str.48, i64 0, i64 0))
%148 = add nsw i32 %32, 1
br label %155
149: ; preds = %139
%150 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str.47, i64 0, i64 0))
%151 = add nsw i32 %31, 1
br label %155
152: ; preds = %139
%153 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @str.70, i64 0, i64 0))
%154 = add nsw i32 %30, 1
br label %155
155: ; preds = %71, %75, %88, %85, %82, %79, %76, %107, %120, %117, %114, %111, %108, %139, %152, %149, %146, %143, %140, %124, %127, %130, %133, %136, %123, %92, %95, %98, %101, %104, %91
%156 = phi i32 [ %32, %75 ], [ %90, %88 ], [ %32, %85 ], [ %84, %82 ], [ %32, %79 ], [ %32, %76 ], [ %32, %91 ], [ %32, %104 ], [ %103, %101 ], [ %32, %98 ], [ %32, %95 ], [ %94, %92 ], [ %32, %107 ], [ %32, %120 ], [ %32, %117 ], [ %32, %114 ], [ %113, %111 ], [ %32, %108 ], [ %32, %123 ], [ %138, %136 ], [ %32, %133 ], [ %32, %130 ], [ %32, %127 ], [ %126, %124 ], [ %32, %139 ], [ %32, %152 ], [ %32, %149 ], [ %148, %146 ], [ %145, %143 ], [ %32, %140 ], [ %32, %71 ]
%157 = phi i32 [ %31, %75 ], [ %31, %88 ], [ %87, %85 ], [ %31, %82 ], [ %81, %79 ], [ %31, %76 ], [ %31, %91 ], [ %106, %104 ], [ %31, %101 ], [ %100, %98 ], [ %31, %95 ], [ %31, %92 ], [ %31, %107 ], [ %122, %120 ], [ %119, %117 ], [ %31, %114 ], [ %31, %111 ], [ %110, %108 ], [ %31, %123 ], [ %31, %136 ], [ %31, %133 ], [ %132, %130 ], [ %129, %127 ], [ %31, %124 ], [ %31, %139 ], [ %31, %152 ], [ %151, %149 ], [ %31, %146 ], [ %31, %143 ], [ %142, %140 ], [ %31, %71 ]
%158 = phi i32 [ %30, %75 ], [ %30, %88 ], [ %30, %85 ], [ %30, %82 ], [ %30, %79 ], [ %78, %76 ], [ %30, %91 ], [ %30, %104 ], [ %30, %101 ], [ %30, %98 ], [ %97, %95 ], [ %30, %92 ], [ %30, %107 ], [ %30, %120 ], [ %30, %117 ], [ %116, %114 ], [ %30, %111 ], [ %30, %108 ], [ %30, %123 ], [ %30, %136 ], [ %135, %133 ], [ %30, %130 ], [ %30, %127 ], [ %30, %124 ], [ %30, %139 ], [ %154, %152 ], [ %30, %149 ], [ %30, %146 ], [ %30, %143 ], [ %30, %140 ], [ %30, %71 ]
%159 = load i32, i32* %1
%160 = icmp slt i32 %34, %159
br i1 %160, label %28, label %19
}