#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 RAND_MAX;
int /*<<< orphan*/ drawline(int *);
int /*<<< orphan*/ exit(int /*<<< orphan*/);
int /*<<< orphan*/ getchar();
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ puts(char *);
int rand();
int /*<<< orphan*/ scanf(char *, int *);
int /*<<< orphan*/ srand(int /*<<< orphan*/);
int /*<<< orphan*/ time(int /*<<< orphan*/ *);
int main(void) {
  int op, max, q1, q2, ans, input, strikes, s, v, z, line[6], score[4];
  double cscore;
  srand(time(NULL));
  s = 0;
  printf("Choose an option:\n 1) Addition (easy)\n 2) Addition (hard)\n"
         " 3) Subtraction (easy)\n 4) Subtraction (hard)\n"
         " 5) Multiplication\n 6) Division\n 7) Shuffle\n ? ");
  scanf("%d", &input);
  while (input < 1 || input > 7) {
    printf("Please type a number between 1 and 7 ? ");
    scanf("%d", &input);
  }
  switch (input) {
  case 1:
    max = 10;
    op = 1;
    break;
  case 2:
    max = 99;
    op = 1;
    break;
  case 3:
    max = 10;
    op = 2;
    break;
  case 4:
    max = 99;
    op = 2;
    break;
  case 5:
    max = 10;
    op = 3;
    break;
  case 6:
    max = 10;
    op = 4;
    break;
  case 7:
    max = 10;
    s = 1;
  }
  for (z = 0; z < 4; z++)
    score[z] = 0;
  for (z = 0; z < 25; z++) {
    q1 = rand() % max;
    q2 = rand() % (max - 1) + 1;
    ans = rand() % max;
    v = (rand() < RAND_MAX / 2);
    strikes = 0;
    if (s)
      op = rand() % 4 + 1;
    switch (op) {
    case 1:
      ans = q1 + q2;
      break;
    case 2:
      if (q1 < q2) {
        q1 ^= q2;
        q2 ^= q1;
        q1 ^= q2;
      }
      ans = q1 - q2;
      break;
    case 3:
      ans = q1 * q2;
      break;
    case 4:
      q1 = ans * q2;
      ans = q1 / q2;
      break;
    }
    do {
      if (v) {
        line[0] = (q1 / 10) ? (q1 / 10) : 20;
        line[1] = q1 % 10;
        line[2] = 9 + op;
        line[3] = (q2 / 10) ? (q2 / 10) : 20;
        line[4] = q2 % 10;
        line[5] = 14;
        drawline(line);
      } else {
        line[0] = line[1] = line[4] = line[5] = 20;
        line[2] = (q1 / 10) ? (q1 / 10) : 20;
        line[3] = q1 % 10;
        drawline(line);
        line[0] = line[4] = line[5] = 20;
        line[1] = 9 + op;
        line[2] = (q2 / 10) ? (q2 / 10) : 20;
        line[3] = q2 % 10;
        drawline(line);
        line[0] = line[4] = line[5] = 20;
        line[1] = line[2] = line[3] = 15;
        drawline(line);
      }
      scanf("%d", &input);
      if (input != ans) {
        line[0] = line[2] = line[4] = 20;
        line[1] = (++strikes > 1) ? 16 : 20;
        line[3] = 16;
        line[5] = (strikes > 2) ? 16 : 20;
        drawline(line);
      }
    } while (input != ans && strikes < 3);
    line[0] = line[1] = line[4] = line[5] = 20;
    line[2] = (ans / 10) ? (ans / 10) : 20;
    ;
    line[3] = ans % 10;
    drawline(line);
    if (input == ans) {
      line[0] = line[4] = line[5] = 20;
      line[1] = 17;
      line[2] = 18;
      line[3] = 19;
      drawline(line);
    }
    score[strikes]++;
    puts("Press any key...");
    getchar();
    getchar();
  }
  printf("Report Card\n------ ----\n\n"
         "Out of %d:\n %d on first try (%2.1f%%)\n %d on second try "
         "(%2.1f%%)\n %d on"
         " last try (%2.1f%%)\n %d missed (%2.1f%%)\n\n",
         25, score[0], (float)score[0] * 100 / 25, score[1],
         (float)score[1] * 100 / 25, score[2], (float)score[2] * 100 / 25,
         score[3], (float)score[3] * 100 / 25);
  cscore = (float)score[0] * 100.0 / 25 + (float)score[1] * 50.0 / 25 +
           (float)score[2] * 25.0 / 25;
  printf("Grade: %c, (%2.2f%%)\n",
         'A' + (cscore < 90.0) + (cscore < 80.0) + (cscore < 70.0) +
             2 * (cscore < 60.0),
         cscore);
  exit(0);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xa0,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
mov    %eax,%edi
call   1070 <time@plt>
mov    %eax,%edi
call   1050 <srand@plt>
movl   $0x0,-0x24(%rbp)
lea    0xeac(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xf36(%rip),%rdi
lea    -0x1c(%rbp),%rsi
call   1080 <scanf@plt>
mov    $0x1,%al
cmpl   $0x1,-0x1c(%rbp)
mov    %al,-0x69(%rbp)
jl     11f0 <main+0x60>
cmpl   $0x7,-0x1c(%rbp)
setg   %al
mov    %al,-0x69(%rbp)
mov    -0x69(%rbp),%al
test   $0x1,%al
jne    1200 <main+0x70>
jmp    1223 <main+0x93>
lea    0xf00(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xeef(%rip),%rdi
lea    -0x1c(%rbp),%rsi
call   1080 <scanf@plt>
jmp    11d7 <main+0x47>
mov    -0x1c(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x78(%rbp)
sub    $0x6,%eax
ja     12cc <main+0x13c>
mov    -0x78(%rbp),%rax
lea    0xdfd(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movl   $0xa,-0xc(%rbp)
movl   $0x1,-0x8(%rbp)
jmp    12cc <main+0x13c>
movl   $0x63,-0xc(%rbp)
movl   $0x1,-0x8(%rbp)
jmp    12cc <main+0x13c>
movl   $0xa,-0xc(%rbp)
movl   $0x2,-0x8(%rbp)
jmp    12cc <main+0x13c>
movl   $0x63,-0xc(%rbp)
movl   $0x2,-0x8(%rbp)
jmp    12cc <main+0x13c>
movl   $0xa,-0xc(%rbp)
movl   $0x3,-0x8(%rbp)
jmp    12cc <main+0x13c>
movl   $0xa,-0xc(%rbp)
movl   $0x4,-0x8(%rbp)
jmp    12cc <main+0x13c>
movl   $0xa,-0xc(%rbp)
movl   $0x1,-0x24(%rbp)
movl   $0x0,-0x2c(%rbp)
cmpl   $0x4,-0x2c(%rbp)
jge    12f7 <main+0x167>
movslq -0x2c(%rbp),%rax
movl   $0x0,-0x60(%rbp,%rax,4)
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    12d3 <main+0x143>
movl   $0x0,-0x2c(%rbp)
cmpl   $0x19,-0x2c(%rbp)
jge    17a5 <main+0x615>
mov    $0x0,%al
call   10b0 <rand@plt>
cltd
idivl  -0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    $0x0,%al
call   10b0 <rand@plt>
mov    -0xc(%rbp),%ecx
sub    $0x1,%ecx
cltd
idiv   %ecx
add    $0x1,%edx
mov    %edx,-0x14(%rbp)
mov    $0x0,%al
call   10b0 <rand@plt>
cltd
idivl  -0xc(%rbp)
mov    %edx,-0x18(%rbp)
mov    $0x0,%al
call   10b0 <rand@plt>
mov    %eax,-0x7c(%rbp)
mov    0x2c9d(%rip),%rax
mov    (%rax),%eax
mov    $0x2,%ecx
cltd
idiv   %ecx
mov    %eax,%ecx
mov    -0x7c(%rbp),%eax
cmp    %ecx,%eax
setl   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x28(%rbp)
movl   $0x0,-0x20(%rbp)
cmpl   $0x0,-0x24(%rbp)
je     138d <main+0x1fd>
mov    $0x0,%al
call   10b0 <rand@plt>
mov    $0x4,%ecx
cltd
idiv   %ecx
add    $0x1,%edx
mov    %edx,-0x8(%rbp)
mov    -0x8(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0x88(%rbp)
sub    $0x3,%eax
ja     1422 <main+0x292>
mov    -0x88(%rbp),%rax
lea    0xca9(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    -0x10(%rbp),%eax
add    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
jmp    1422 <main+0x292>
mov    -0x10(%rbp),%eax
cmp    -0x14(%rbp),%eax
jge    13f1 <main+0x261>
mov    -0x14(%rbp),%eax
xor    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
xor    -0x14(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
xor    -0x10(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
sub    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
jmp    1422 <main+0x292>
mov    -0x10(%rbp),%eax
imul   -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
jmp    1422 <main+0x292>
mov    -0x18(%rbp),%eax
imul   -0x14(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cltd
idivl  -0x14(%rbp)
mov    %eax,-0x18(%rbp)
jmp    1427 <main+0x297>
cmpl   $0x0,-0x28(%rbp)
je     14f1 <main+0x361>
mov    -0x10(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
cmp    $0x0,%eax
je     145b <main+0x2cb>
mov    -0x10(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x8c(%rbp)
jmp    146b <main+0x2db>
mov    $0x14,%eax
mov    %eax,-0x8c(%rbp)
jmp    146b <main+0x2db>
mov    -0x8c(%rbp),%eax
mov    %eax,-0x50(%rbp)
mov    -0x10(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0x4c(%rbp)
mov    -0x8(%rbp),%eax
add    $0x9,%eax
mov    %eax,-0x48(%rbp)
mov    -0x14(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
cmp    $0x0,%eax
je     14b5 <main+0x325>
mov    -0x14(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x90(%rbp)
jmp    14c5 <main+0x335>
mov    $0x14,%eax
mov    %eax,-0x90(%rbp)
jmp    14c5 <main+0x335>
mov    -0x90(%rbp),%eax
mov    %eax,-0x44(%rbp)
mov    -0x14(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0x40(%rbp)
movl   $0xe,-0x3c(%rbp)
lea    -0x50(%rbp),%rdi
call   10a0 <drawline@plt>
jmp    1612 <main+0x482>
movl   $0x14,-0x3c(%rbp)
movl   $0x14,-0x40(%rbp)
movl   $0x14,-0x4c(%rbp)
movl   $0x14,-0x50(%rbp)
mov    -0x10(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
cmp    $0x0,%eax
je     1537 <main+0x3a7>
mov    -0x10(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x94(%rbp)
jmp    1547 <main+0x3b7>
mov    $0x14,%eax
mov    %eax,-0x94(%rbp)
jmp    1547 <main+0x3b7>
mov    -0x94(%rbp),%eax
mov    %eax,-0x48(%rbp)
mov    -0x10(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0x44(%rbp)
lea    -0x50(%rbp),%rdi
call   10a0 <drawline@plt>
movl   $0x14,-0x3c(%rbp)
movl   $0x14,-0x40(%rbp)
movl   $0x14,-0x50(%rbp)
mov    -0x8(%rbp),%eax
add    $0x9,%eax
mov    %eax,-0x4c(%rbp)
mov    -0x14(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
cmp    $0x0,%eax
je     15af <main+0x41f>
mov    -0x14(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0x98(%rbp)
jmp    15bf <main+0x42f>
mov    $0x14,%eax
mov    %eax,-0x98(%rbp)
jmp    15bf <main+0x42f>
mov    -0x98(%rbp),%eax
mov    %eax,-0x48(%rbp)
mov    -0x14(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0x44(%rbp)
lea    -0x50(%rbp),%rdi
call   10a0 <drawline@plt>
movl   $0x14,-0x3c(%rbp)
movl   $0x14,-0x40(%rbp)
movl   $0x14,-0x50(%rbp)
movl   $0xf,-0x44(%rbp)
movl   $0xf,-0x48(%rbp)
movl   $0xf,-0x4c(%rbp)
lea    -0x50(%rbp),%rdi
call   10a0 <drawline@plt>
lea    0xaeb(%rip),%rdi
lea    -0x1c(%rbp),%rsi
call   1080 <scanf@plt>
mov    -0x1c(%rbp),%eax
cmp    -0x18(%rbp),%eax
je     1685 <main+0x4f5>
movl   $0x14,-0x40(%rbp)
movl   $0x14,-0x48(%rbp)
movl   $0x14,-0x50(%rbp)
mov    -0x20(%rbp),%edx
add    $0x1,%edx
mov    %edx,-0x20(%rbp)
mov    $0x14,%eax
mov    $0x10,%ecx
cmp    $0x1,%edx
cmovg  %ecx,%eax
mov    %eax,-0x4c(%rbp)
movl   $0x10,-0x44(%rbp)
mov    -0x20(%rbp),%edx
mov    $0x14,%eax
mov    $0x10,%ecx
cmp    $0x2,%edx
cmovg  %ecx,%eax
mov    %eax,-0x3c(%rbp)
lea    -0x50(%rbp),%rdi
call   10a0 <drawline@plt>
jmp    168a <main+0x4fa>
mov    -0x1c(%rbp),%ecx
xor    %eax,%eax
cmp    -0x18(%rbp),%ecx
mov    %al,-0x99(%rbp)
je     16ab <main+0x51b>
cmpl   $0x3,-0x20(%rbp)
setl   %al
mov    %al,-0x99(%rbp)
mov    -0x99(%rbp),%al
test   $0x1,%al
jne    1427 <main+0x297>
movl   $0x14,-0x3c(%rbp)
movl   $0x14,-0x40(%rbp)
movl   $0x14,-0x4c(%rbp)
movl   $0x14,-0x50(%rbp)
mov    -0x18(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
cmp    $0x0,%eax
je     16ff <main+0x56f>
mov    -0x18(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %eax,-0xa0(%rbp)
jmp    170f <main+0x57f>
mov    $0x14,%eax
mov    %eax,-0xa0(%rbp)
jmp    170f <main+0x57f>
mov    -0xa0(%rbp),%eax
mov    %eax,-0x48(%rbp)
mov    -0x18(%rbp),%eax
mov    $0xa,%ecx
cltd
idiv   %ecx
mov    %edx,-0x44(%rbp)
lea    -0x50(%rbp),%rdi
call   10a0 <drawline@plt>
mov    -0x1c(%rbp),%eax
cmp    -0x18(%rbp),%eax
jne    176e <main+0x5de>
movl   $0x14,-0x3c(%rbp)
movl   $0x14,-0x40(%rbp)
movl   $0x14,-0x50(%rbp)
movl   $0x11,-0x4c(%rbp)
movl   $0x12,-0x48(%rbp)
movl   $0x13,-0x44(%rbp)
lea    -0x50(%rbp),%rdi
call   10a0 <drawline@plt>
movslq -0x20(%rbp),%rax
mov    -0x60(%rbp,%rax,4),%ecx
add    $0x1,%ecx
mov    %ecx,-0x60(%rbp,%rax,4)
lea    0x9ab(%rip),%rdi
call   1030 <puts@plt>
mov    $0x0,%al
call   1060 <getchar@plt>
mov    $0x0,%al
call   1060 <getchar@plt>
mov    -0x2c(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2c(%rbp)
jmp    12fe <main+0x16e>
mov    -0x60(%rbp),%edx
cvtsi2ssl -0x60(%rbp),%xmm0
movss  0x887(%rip),%xmm1
mulss  %xmm1,%xmm0
movss  0x877(%rip),%xmm1
divss  %xmm1,%xmm0
cvtss2sd %xmm0,%xmm0
mov    -0x5c(%rbp),%ecx
cvtsi2ssl -0x5c(%rbp),%xmm1
movss  0x863(%rip),%xmm2
mulss  %xmm2,%xmm1
movss  0x853(%rip),%xmm2
divss  %xmm2,%xmm1
cvtss2sd %xmm1,%xmm1
mov    -0x58(%rbp),%r8d
cvtsi2ssl -0x58(%rbp),%xmm2
movss  0x83e(%rip),%xmm3
mulss  %xmm3,%xmm2
movss  0x82e(%rip),%xmm3
divss  %xmm3,%xmm2
cvtss2sd %xmm2,%xmm2
mov    -0x54(%rbp),%r9d
cvtsi2ssl -0x54(%rbp),%xmm3
movss  0x819(%rip),%xmm4
mulss  %xmm4,%xmm3
movss  0x809(%rip),%xmm4
divss  %xmm4,%xmm3
cvtss2sd %xmm3,%xmm3
lea    0x902(%rip),%rdi
mov    $0x19,%esi
mov    $0x4,%al
call   1040 <printf@plt>
cvtsi2ssl -0x60(%rbp),%xmm0
cvtss2sd %xmm0,%xmm0
movsd  0x7d5(%rip),%xmm1
mulsd  %xmm1,%xmm0
movsd  0x7b9(%rip),%xmm1
divsd  %xmm1,%xmm0
cvtsi2ssl -0x5c(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
movsd  0x7ac(%rip),%xmm2
mulsd  %xmm2,%xmm1
movsd  0x798(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
cvtsi2ssl -0x58(%rbp),%xmm1
cvtss2sd %xmm1,%xmm1
movsd  0x77f(%rip),%xmm2
mulsd  %xmm2,%xmm1
movsd  0x773(%rip),%xmm2
divsd  %xmm2,%xmm1
addsd  %xmm1,%xmm0
movsd  %xmm0,-0x68(%rbp)
movsd  0x756(%rip),%xmm0
ucomisd -0x68(%rbp),%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%esi
add    $0x41,%esi
movsd  0x736(%rip),%xmm0
ucomisd -0x68(%rbp),%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
add    %eax,%esi
movsd  0x717(%rip),%xmm0
ucomisd -0x68(%rbp),%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
add    %eax,%esi
movsd  0x6f8(%rip),%xmm0
ucomisd -0x68(%rbp),%xmm0
seta   %al
and    $0x1,%al
movzbl %al,%eax
shl    $0x1,%eax
add    %eax,%esi
movsd  -0x68(%rbp),%xmm0
lea    0x8a6(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
xor    %edi,%edi
call   1090 <exit@plt>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x88,%rsp
xor    %edi,%edi
call   1070 <time@plt>
mov    %eax,%edi
call   1050 <srand@plt>
lea    0xeea(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xf74(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1080 <scanf@plt>
mov    0xc(%rsp),%eax
lea    -0x8(%rax),%ecx
cmp    $0xfffffff8,%ecx
ja     1211 <main+0x81>
lea    0xf5a(%rip),%r14
lea    0xf50(%rip),%rbp
lea    0xc(%rsp),%rbx
nopl   (%rax)
mov    %r14,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbp,%rdi
mov    %rbx,%rsi
call   1080 <scanf@plt>
mov    0xc(%rsp),%eax
lea    -0x8(%rax),%ecx
cmp    $0xfffffff9,%ecx
jb     11f0 <main+0x60>
mov    $0x1,%r14d
mov    $0xa,%ecx
mov    %rcx,0x40(%rsp)
mov    $0x1,%cl
mov    %ecx,0x38(%rsp)
add    $0xfffffffe,%eax
cmp    $0x5,%eax
ja     1271 <main+0xe1>
lea    0xe42(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    $0x2,%r14d
jmp    1271 <main+0xe1>
mov    $0x2,%r14d
mov    $0x63,%eax
mov    %rax,0x40(%rsp)
jmp    1271 <main+0xe1>
mov    $0x3,%r14d
jmp    1271 <main+0xe1>
mov    $0x4,%r14d
jmp    1271 <main+0xe1>
movl   $0x0,0x38(%rsp)
xorps  %xmm0,%xmm0
movaps %xmm0,0x70(%rsp)
mov    0x40(%rsp),%rax
add    $0xffffffff,%eax
mov    %eax,0x54(%rsp)
xor    %eax,%eax
jmp    12ca <main+0x13a>
nopl   0x0(%rax)
movslq %r14d,%rax
addl   $0x1,0x70(%rsp,%rax,4)
lea    0xec4(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
call   1060 <getchar@plt>
xor    %eax,%eax
call   1060 <getchar@plt>
mov    0x58(%rsp),%eax
add    $0x1,%eax
cmp    $0x19,%eax
mov    0x80(%rsp),%r14
je     163e <main+0x4ae>
mov    %eax,0x58(%rsp)
xor    %eax,%eax
call   10b0 <rand@plt>
cltd
mov    0x40(%rsp),%rbx
idiv   %ebx
mov    %edx,%ebp
xor    %eax,%eax
call   10b0 <rand@plt>
cltd
idivl  0x54(%rsp)
mov    %edx,%r15d
xor    %eax,%eax
call   10b0 <rand@plt>
cltd
idiv   %ebx
mov    %edx,%ebx
xor    %eax,%eax
call   10b0 <rand@plt>
mov    %eax,0x5c(%rsp)
mov    0x2cdc(%rip),%rax
mov    (%rax),%eax
mov    %eax,0x60(%rsp)
cmpb   $0x0,0x38(%rsp)
jne    1335 <main+0x1a5>
xor    %eax,%eax
call   10b0 <rand@plt>
lea    0x3(%rax),%ecx
test   %eax,%eax
cmovns %eax,%ecx
and    $0xfffffffc,%ecx
neg    %ecx
lea    (%rax,%rcx,1),%r14d
add    $0x1,%r14d
lea    0x1(%r15),%eax
lea    -0x1(%r14),%ecx
cmp    $0x3,%ecx
ja     13a0 <main+0x210>
lea    0xd47(%rip),%rdx
movslq (%rdx,%rcx,4),%rcx
add    %rdx,%rcx
jmp    *%rcx
mov    %ebp,%ebx
add    %eax,%ebx
jmp    13a0 <main+0x210>
nopl   0x0(%rax,%rax,1)
cmp    %r15d,%ebp
mov    %ebp,%ecx
cmovg  %eax,%ecx
cmovg  %ebp,%eax
mov    %eax,%ebp
mov    %eax,%ebx
sub    %ecx,%ebx
mov    %ecx,%eax
jmp    13a0 <main+0x210>
cs nopw 0x0(%rax,%rax,1)
nop
mov    %ebp,%ebx
imul   %eax,%ebx
jmp    13a0 <main+0x210>
nopw   0x0(%rax,%rax,1)
mov    %ebx,%ebp
imul   %eax,%ebp
cs nopw 0x0(%rax,%rax,1)
nop
mov    0x60(%rsp),%ecx
shr    $0x1f,%ecx
lea    0x9(%rbp),%esi
mov    $0x14,%edx
mov    %rdx,0x30(%rsp)
movslq %ebp,%rdx
mov    $0x14,%edi
mov    %rdi,0x48(%rsp)
cmp    $0x13,%esi
jb     13df <main+0x24f>
imul   $0x66666667,%rdx,%rdi
mov    %rdi,%rsi
shr    $0x3f,%rsi
sar    $0x22,%rdi
add    %esi,%edi
mov    %rdi,0x48(%rsp)
add    %ecx,0x60(%rsp)
imul   $0x66666667,%rdx,%rcx
mov    %rcx,%rdx
shr    $0x3f,%rdx
sar    $0x22,%rcx
add    %edx,%ecx
add    %ecx,%ecx
lea    0x9(%rax),%edx
movslq %eax,%r12
cmp    $0x13,%edx
jb     141d <main+0x28d>
imul   $0x66666667,%r12,%rdx
mov    %rdx,%rax
shr    $0x3f,%rax
sar    $0x22,%rdx
add    %eax,%edx
mov    %rdx,0x30(%rsp)
sarl   0x60(%rsp)
lea    (%rcx,%rcx,4),%eax
sub    %eax,%ebp
mov    %r14,0x80(%rsp)
lea    0x9(%r14),%eax
mov    %eax,0x3c(%rsp)
imul   $0x66666667,%r12,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x22,%rax
add    %ecx,%eax
add    %eax,%eax
lea    (%rax,%rax,4),%eax
sub    %eax,%r12d
xor    %r15d,%r15d
mov    %rbp,%r13
nopl   0x0(%rax,%rax,1)
mov    0x60(%rsp),%eax
cmp    %eax,0x5c(%rsp)
jge    14a0 <main+0x310>
mov    0x48(%rsp),%rax
mov    %eax,0x10(%rsp)
mov    %ebp,0x14(%rsp)
mov    0x3c(%rsp),%eax
mov    %eax,0x18(%rsp)
mov    0x30(%rsp),%rax
mov    %eax,0x1c(%rsp)
mov    %r12d,0x20(%rsp)
movl   $0xe,0x24(%rsp)
lea    0x10(%rsp),%rbp
jmp    1513 <main+0x383>
nopl   0x0(%rax)
movabs $0x1400000014,%rax
mov    %rbx,%r14
mov    %rax,%rbx
mov    %rax,0x20(%rsp)
mov    %rax,0x10(%rsp)
mov    0x48(%rsp),%rax
mov    %eax,0x18(%rsp)
mov    %ebp,0x1c(%rsp)
lea    0x10(%rsp),%rbp
mov    %rbp,%rdi
call   10a0 <drawline@plt>
mov    %rbx,0x20(%rsp)
movl   $0x14,0x10(%rsp)
mov    0x3c(%rsp),%eax
mov    %eax,0x14(%rsp)
mov    0x30(%rsp),%rax
mov    %eax,0x18(%rsp)
mov    %r12d,0x1c(%rsp)
mov    %rbp,%rdi
call   10a0 <drawline@plt>
mov    %rbx,0x20(%rsp)
mov    %r14,%rbx
movaps 0xaf2(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
mov    %rbp,%rdi
call   10a0 <drawline@plt>
lea    0xc16(%rip),%rdi
lea    0xc(%rsp),%rsi
call   1080 <scanf@plt>
cmp    %ebx,0xc(%rsp)
je     15a0 <main+0x410>
movl   $0x14,0x18(%rsp)
movl   $0x14,0x10(%rsp)
lea    0x1(%r15),%r14d
xor    %eax,%eax
test   %r15d,%r15d
sete   %al
lea    0x10(,%rax,4),%eax
mov    %eax,0x14(%rsp)
movabs $0x1400000010,%rax
mov    %rax,0x1c(%rsp)
xor    %eax,%eax
cmp    $0x2,%r15d
setb   %al
lea    0x10(,%rax,4),%eax
mov    %eax,0x24(%rsp)
mov    %rbp,%rdi
call   10a0 <drawline@plt>
cmp    %ebx,0xc(%rsp)
je     15a3 <main+0x413>
cmp    $0x2,%r15d
mov    %r14d,%r15d
mov    %r13,%rbp
jb     1460 <main+0x2d0>
jmp    15a3 <main+0x413>
nopl   0x0(%rax)
mov    %r15d,%r14d
movabs $0x1400000014,%rax
mov    %rax,0x20(%rsp)
mov    %rax,0x10(%rsp)
lea    0x9(%rbx),%ecx
mov    $0x14,%eax
movslq %ebx,%rbx
cmp    $0x13,%ecx
jb     15db <main+0x44b>
imul   $0x66666667,%rbx,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x22,%rax
add    %ecx,%eax
mov    %eax,0x18(%rsp)
imul   $0x66666667,%rbx,%rax
mov    %rax,%rcx
shr    $0x3f,%rcx
sar    $0x22,%rax
add    %ecx,%eax
add    %eax,%eax
lea    (%rax,%rax,4),%eax
mov    %ebx,%ecx
sub    %eax,%ecx
mov    %ecx,0x1c(%rsp)
lea    0x10(%rsp),%rdi
call   10a0 <drawline@plt>
cmp    %ebx,0xc(%rsp)
jne    1290 <main+0x100>
movabs $0x1400000014,%rax
mov    %rax,0x20(%rsp)
movaps 0x9e6(%rip),%xmm0
movaps %xmm0,0x10(%rsp)
lea    0x10(%rsp),%rdi
call   10a0 <drawline@plt>
jmp    1290 <main+0x100>
mov    0x78(%rsp),%r8d
movd   %r8d,%xmm0
mov    0x70(%rsp),%edx
mov    0x74(%rsp),%ecx
movd   %edx,%xmm1
punpckldq %xmm0,%xmm1
cvtdq2ps %xmm1,%xmm1
movss  0x9dd(%rip),%xmm3
movaps %xmm1,%xmm0
movaps %xmm1,%xmm5
movaps %xmm1,0x60(%rsp)
mulss  %xmm3,%xmm0
movss  0x9ca(%rip),%xmm4
xorps  %xmm1,%xmm1
cvtsi2ss %ecx,%xmm1
movss  %xmm1,0x30(%rsp)
divss  %xmm4,%xmm0
cvtss2sd %xmm0,%xmm0
mulss  %xmm3,%xmm1
divss  %xmm4,%xmm1
cvtss2sd %xmm1,%xmm1
movaps %xmm5,%xmm2
shufps $0x55,%xmm5,%xmm2
mulss  %xmm3,%xmm2
divss  %xmm4,%xmm2
mov    0x7c(%rsp),%r9d
xorps  %xmm5,%xmm5
cvtsi2ss %r9d,%xmm5
cvtss2sd %xmm2,%xmm2
mulss  %xmm3,%xmm5
divss  %xmm4,%xmm5
xorps  %xmm3,%xmm3
cvtss2sd %xmm5,%xmm3
lea    0xaa3(%rip),%rdi
mov    $0x19,%esi
mov    $0x4,%al
call   1040 <printf@plt>
movss  0x30(%rsp),%xmm0
xorps  %xmm1,%xmm1
cvtss2sd %xmm0,%xmm1
mulsd  0x956(%rip),%xmm1
divsd  0x956(%rip),%xmm1
cvtps2pd 0x60(%rsp),%xmm0
mulpd  0x919(%rip),%xmm0
divpd  0x921(%rip),%xmm0
addsd  %xmm0,%xmm1
unpckhpd %xmm0,%xmm0
addsd  %xmm1,%xmm0
movsd  0x935(%rip),%xmm1
xor    %eax,%eax
ucomisd %xmm0,%xmm1
seta   %al
movsd  0x92c(%rip),%xmm1
xor    %ecx,%ecx
ucomisd %xmm0,%xmm1
seta   %cl
add    %eax,%ecx
movsd  0x921(%rip),%xmm1
xor    %eax,%eax
ucomisd %xmm0,%xmm1
seta   %al
add    %ecx,%eax
movsd  0x916(%rip),%xmm1
xor    %ecx,%ecx
ucomisd %xmm0,%xmm1
seta   %cl
lea    (%rax,%rcx,2),%esi
add    $0x41,%esi
lea    0xa90(%rip),%rdi
mov    $0x1,%al
call   1040 <printf@plt>
xor    %edi,%edi
call   1090 <exit@plt>

LLVM IR (-O0):
@.str = [152 x i8] c"Choose an option:\0A 1) Addition (easy)\0A 2) Addition (hard)\0A 3) Subtraction (easy)\0A 4) Subtraction (hard)\0A 5) Multiplication\0A 6) Division\0A 7) Shuffle\0A ? \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [40 x i8] c"Please type a number between 1 and 7 ? \00"
@RAND_MAX = global i32 0
@.str.3 = [17 x i8] c"Press any key...\00"
@.str.4 = [140 x i8] c"Report Card\0A------ ----\0A\0AOut of %d:\0A %d on first try (%2.1f%%)\0A %d on second try (%2.1f%%)\0A %d on last try (%2.1f%%)\0A %d missed (%2.1f%%)\0A\0A\00"
@.str.5 = [22 x i8] c"Grade: %c, (%2.2f%%)\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
%10 = alloca i32
%11 = alloca i32
%12 = alloca [6 x i32]
%13 = alloca [4 x i32]
%14 = alloca double
store i32 0, i32* %1
%15 = call i32 @time(i32* null)
%16 = call i32 @srand(i32 %15)
store i32 0, i32* %9
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([152 x i8], [152 x i8]* @.str, i64 0, i64 0))
%18 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %7)
br label %19
19: ; preds = %27, %0
%20 = load i32, i32* %7
%21 = icmp slt i32 %20, 1
br i1 %21, label %25, label %22
22: ; preds = %19
%23 = load i32, i32* %7
%24 = icmp sgt i32 %23, 7
br label %25
25: ; preds = %22, %19
%26 = phi i1 [ true, %19 ], [ %24, %22 ]
br i1 %26, label %27, label %30
27: ; preds = %25
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.2, i64 0, i64 0))
%29 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %7)
br label %19
30: ; preds = %25
%31 = load i32, i32* %7
switch i32 %31, label %39 [
i32 1, label %32
i32 2, label %33
i32 3, label %34
i32 4, label %35
i32 5, label %36
i32 6, label %37
i32 7, label %38
]
32: ; preds = %30
store i32 10, i32* %3
store i32 1, i32* %2
br label %39
33: ; preds = %30
store i32 99, i32* %3
store i32 1, i32* %2
br label %39
34: ; preds = %30
store i32 10, i32* %3
store i32 2, i32* %2
br label %39
35: ; preds = %30
store i32 99, i32* %3
store i32 2, i32* %2
br label %39
36: ; preds = %30
store i32 10, i32* %3
store i32 3, i32* %2
br label %39
37: ; preds = %30
store i32 10, i32* %3
store i32 4, i32* %2
br label %39
38: ; preds = %30
store i32 10, i32* %3
store i32 1, i32* %9
br label %39
39: ; preds = %38, %30, %37, %36, %35, %34, %33, %32
store i32 0, i32* %11
br label %40
40: ; preds = %47, %39
%41 = load i32, i32* %11
%42 = icmp slt i32 %41, 4
br i1 %42, label %43, label %50
43: ; preds = %40
%44 = load i32, i32* %11
%45 = sext i32 %44 to i64
%46 = getelementptr inbounds [4 x i32], [4 x i32]* %13, i64 0, i64 %45
store i32 0, i32* %46
br label %47
47: ; preds = %43
%48 = load i32, i32* %11
%49 = add nsw i32 %48, 1
store i32 %49, i32* %11
br label %40
50: ; preds = %40
store i32 0, i32* %11
br label %51
51: ; preds = %272, %50
%52 = load i32, i32* %11
%53 = icmp slt i32 %52, 25
br i1 %53, label %54, label %275
54: ; preds = %51
%55 = call i32 (...) @rand()
%56 = load i32, i32* %3
%57 = srem i32 %55, %56
store i32 %57, i32* %4
%58 = call i32 (...) @rand()
%59 = load i32, i32* %3
%60 = sub nsw i32 %59, 1
%61 = srem i32 %58, %60
%62 = add nsw i32 %61, 1
store i32 %62, i32* %5
%63 = call i32 (...) @rand()
%64 = load i32, i32* %3
%65 = srem i32 %63, %64
store i32 %65, i32* %6
%66 = call i32 (...) @rand()
%67 = load i32, i32* @RAND_MAX
%68 = sdiv i32 %67, 2
%69 = icmp slt i32 %66, %68
%70 = zext i1 %69 to i32
store i32 %70, i32* %10
store i32 0, i32* %8
%71 = load i32, i32* %9
%72 = icmp ne i32 %71, 0
br i1 %72, label %73, label %77
73: ; preds = %54
%74 = call i32 (...) @rand()
%75 = srem i32 %74, 4
%76 = add nsw i32 %75, 1
store i32 %76, i32* %2
br label %77
77: ; preds = %73, %54
%78 = load i32, i32* %2
switch i32 %78, label %112 [
i32 1, label %79
i32 2, label %83
i32 3, label %101
i32 4, label %105
]
79: ; preds = %77
%80 = load i32, i32* %4
%81 = load i32, i32* %5
%82 = add nsw i32 %80, %81
store i32 %82, i32* %6
br label %112
83: ; preds = %77
%84 = load i32, i32* %4
%85 = load i32, i32* %5
%86 = icmp slt i32 %84, %85
br i1 %86, label %87, label %97
87: ; preds = %83
%88 = load i32, i32* %5
%89 = load i32, i32* %4
%90 = xor i32 %89, %88
store i32 %90, i32* %4
%91 = load i32, i32* %4
%92 = load i32, i32* %5
%93 = xor i32 %92, %91
store i32 %93, i32* %5
%94 = load i32, i32* %5
%95 = load i32, i32* %4
%96 = xor i32 %95, %94
store i32 %96, i32* %4
br label %97
97: ; preds = %87, %83
%98 = load i32, i32* %4
%99 = load i32, i32* %5
%100 = sub nsw i32 %98, %99
store i32 %100, i32* %6
br label %112
101: ; preds = %77
%102 = load i32, i32* %4
%103 = load i32, i32* %5
%104 = mul nsw i32 %102, %103
store i32 %104, i32* %6
br label %112
105: ; preds = %77
%106 = load i32, i32* %6
%107 = load i32, i32* %5
%108 = mul nsw i32 %106, %107
store i32 %108, i32* %4
%109 = load i32, i32* %4
%110 = load i32, i32* %5
%111 = sdiv i32 %109, %110
store i32 %111, i32* %6
br label %112
112: ; preds = %77, %105, %101, %97, %79
br label %113
113: ; preds = %229, %112
%114 = load i32, i32* %10
%115 = icmp ne i32 %114, 0
br i1 %115, label %116, label %149
116: ; preds = %113
%117 = load i32, i32* %4
%118 = sdiv i32 %117, 10
%119 = icmp ne i32 %118, 0
br i1 %119, label %120, label %123
120: ; preds = %116
%121 = load i32, i32* %4
%122 = sdiv i32 %121, 10
br label %124
123: ; preds = %116
br label %124
124: ; preds = %123, %120
%125 = phi i32 [ %122, %120 ], [ 20, %123 ]
%126 = getelementptr inbounds [6 x i32], [6 x i32]* %12, i64 0, i64 0
store i32 %125, i32* %126
%127 = load i32, i32* %4
%128 = srem i32 %127, 10
%129 = getelementptr inbounds [6 x i32], [6 x i32]* %12, i64 0, i64 1
store i32 %128, i32* %129
%130 = load i32, i32* %2
%131 = add nsw i32 9, %130
%132 = getelementptr inbounds [6 x i32], [6 x i32]* %12, i64 0, i64 2
store i32 %131, i32* %132
%133 = load i32, i32* %5
%134 = sdiv i32 %133, 10
%135 = icmp ne i32 %134, 0
br i1 %135, label %136, label %139
136: ; preds = %124
%137 = load i32, i32* %5
%138 = sdiv i32 %137, 10
br label %140
139: ; preds = %124
br label %140
140: ; preds = %139, %136
%141 = phi i32 [ %138, %136 ], [ 20, %139 ]
%142 = getelementptr inbounds [6 x i32], [6 x i32]* %12, i64 0, i64 3
store i32 %141, i32* %142
%143 = load i32, i32* %5
%144 = srem i32 %143, 10
%145 = getelementptr inbounds [6 x i32], [6 x i32]* %12, i64 0, i64 4
store i32 %144, i32* %145
%146 = getelementptr inbounds [6 x i32], [6 x i32]* %12, i64 0, i64 5
store i32 14, i32* %146
%147 = getelementptr inbounds [6 x i32], [6 x i32]* %12, i64 0, i64 0
%148 = call i32 @drawline(i32* %147)
br label %198
149: ; preds = %113
%150 = getelementptr inbounds [6 x i32], [6 x i32]* %12, i64 0, i64 5
store i32 20, i32* %150
%151 = getelementptr inbounds [6 x i32], [6 x i32]* %12, i64 0, i64 4
store i32 20, i32* %151
%152 = getelementptr inbounds [6 x i32], [6 x i32]* %12, i64 0, i64 1
store i32 20, i32* %152
%153 = getelementptr inbounds [6 x i32], [6 x i32]* %12, i64 0, i64 0
store i32 20, i32* %153
%154 = load i32, i32* %4
%155 = sdiv i32 %154, 10
%156 = icmp ne i32 %155, 0
br i1 %156, label %157, label %160
157: ; preds = %149
%158 = load i32, i32* %4
%159 = sdiv i32 %158, 10
br label %161
160: ; preds = %149
br label %161
161: ; preds = %160, %157
%162 = phi i32 [ %159, %157 ], [ 20, %160 ]
%163 = getelementptr inbounds [6 x i32], [6 x i32]* %12, i64 0, i64 2
store i32 %162, i32* %163
%164 = load i32, i32* %4
%165 = srem i32 %164, 10
%166 = getelementptr inbounds [6 x i32], [6 x i32]* %12, i64 0, i64 3
store i32 %165, i32* %166
%167 = getelementptr inbounds [6 x i32], [6 x i32]* %12, i64 0, i64 0
%168 = call i32 @drawline(i32* %167)
%169 = getelementptr inbounds [6 x i32], [6 x i32]* %12, i64 0, i64 5
store i32 20, i32* %169
%170 = getelementptr inbounds [6 x i32], [6 x i32]* %12, i64 0, i64 4
store i32 20, i32* %170
%171 = getelementptr inbounds [6 x i32], [6 x i32]* %12, i64 0, i64 0
store i32 20, i32* %171
%172 = load i32, i32* %2
%173 = add nsw i32 9, %172
%174 = getelementptr inbounds [6 x i32], [6 x i32]* %12, i64 0, i64 1
store i32 %173, i32* %174
%175 = load i32, i32* %5
%176 = sdiv i32 %175, 10
%177 = icmp ne i32 %176, 0
br i1 %177, label %178, label %181
178: ; preds = %161
%179 = load i32, i32* %5
%180 = sdiv i32 %179, 10
br label %182
181: ; preds = %161
br label %182
182: ; preds = %181, %178
%183 = phi i32 [ %180, %178 ], [ 20, %181 ]
%184 = getelementptr inbounds [6 x i32], [6 x i32]* %12, i64 0, i64 2
store i32 %183, i32* %184
%185 = load i32, i32* %5
%186 = srem i32 %185, 10
%187 = getelementptr inbounds [6 x i32], [6 x i32]* %12, i64 0, i64 3
store i32 %186, i32* %187
%188 = getelementptr inbounds [6 x i32], [6 x i32]* %12, i64 0, i64 0
%189 = call i32 @drawline(i32* %188)
%190 = getelementptr inbounds [6 x i32], [6 x i32]* %12, i64 0, i64 5
store i32 20, i32* %190
%191 = getelementptr inbounds [6 x i32], [6 x i32]* %12, i64 0, i64 4
store i32 20, i32* %191
%192 = getelementptr inbounds [6 x i32], [6 x i32]* %12, i64 0, i64 0
store i32 20, i32* %192
%193 = getelementptr inbounds [6 x i32], [6 x i32]* %12, i64 0, i64 3
store i32 15, i32* %193
%194 = getelementptr inbounds [6 x i32], [6 x i32]* %12, i64 0, i64 2
store i32 15, i32* %194
%195 = getelementptr inbounds [6 x i32], [6 x i32]* %12, i64 0, i64 1
store i32 15, i32* %195
%196 = getelementptr inbounds [6 x i32], [6 x i32]* %12, i64 0, i64 0
%197 = call i32 @drawline(i32* %196)
br label %198
198: ; preds = %182, %140
%199 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %7)
%200 = load i32, i32* %7
%201 = load i32, i32* %6
%202 = icmp ne i32 %200, %201
br i1 %202, label %203, label %221
203: ; preds = %198
%204 = getelementptr inbounds [6 x i32], [6 x i32]* %12, i64 0, i64 4
store i32 20, i32* %204
%205 = getelementptr inbounds [6 x i32], [6 x i32]* %12, i64 0, i64 2
store i32 20, i32* %205
%206 = getelementptr inbounds [6 x i32], [6 x i32]* %12, i64 0, i64 0
store i32 20, i32* %206
%207 = load i32, i32* %8
%208 = add nsw i32 %207, 1
store i32 %208, i32* %8
%209 = icmp sgt i32 %208, 1
%210 = zext i1 %209 to i64
%211 = select i1 %209, i32 16, i32 20
%212 = getelementptr inbounds [6 x i32], [6 x i32]* %12, i64 0, i64 1
store i32 %211, i32* %212
%213 = getelementptr inbounds [6 x i32], [6 x i32]* %12, i64 0, i64 3
store i32 16, i32* %213
%214 = load i32, i32* %8
%215 = icmp sgt i32 %214, 2
%216 = zext i1 %215 to i64
%217 = select i1 %215, i32 16, i32 20
%218 = getelementptr inbounds [6 x i32], [6 x i32]* %12, i64 0, i64 5
store i32 %217, i32* %218
%219 = getelementptr inbounds [6 x i32], [6 x i32]* %12, i64 0, i64 0
%220 = call i32 @drawline(i32* %219)
br label %221
221: ; preds = %203, %198
br label %222
222: ; preds = %221
%223 = load i32, i32* %7
%224 = load i32, i32* %6
%225 = icmp ne i32 %223, %224
br i1 %225, label %226, label %229
226: ; preds = %222
%227 = load i32, i32* %8
%228 = icmp slt i32 %227, 3
br label %229
229: ; preds = %226, %222
%230 = phi i1 [ false, %222 ], [ %228, %226 ]
br i1 %230, label %113, label %231
231: ; preds = %229
%232 = getelementptr inbounds [6 x i32], [6 x i32]* %12, i64 0, i64 5
store i32 20, i32* %232
%233 = getelementptr inbounds [6 x i32], [6 x i32]* %12, i64 0, i64 4
store i32 20, i32* %233
%234 = getelementptr inbounds [6 x i32], [6 x i32]* %12, i64 0, i64 1
store i32 20, i32* %234
%235 = getelementptr inbounds [6 x i32], [6 x i32]* %12, i64 0, i64 0
store i32 20, i32* %235
%236 = load i32, i32* %6
%237 = sdiv i32 %236, 10
%238 = icmp ne i32 %237, 0
br i1 %238, label %239, label %242
239: ; preds = %231
%240 = load i32, i32* %6
%241 = sdiv i32 %240, 10
br label %243
242: ; preds = %231
br label %243
243: ; preds = %242, %239
%244 = phi i32 [ %241, %239 ], [ 20, %242 ]
%245 = getelementptr inbounds [6 x i32], [6 x i32]* %12, i64 0, i64 2
store i32 %244, i32* %245
%246 = load i32, i32* %6
%247 = srem i32 %246, 10
%248 = getelementptr inbounds [6 x i32], [6 x i32]* %12, i64 0, i64 3
store i32 %247, i32* %248
%249 = getelementptr inbounds [6 x i32], [6 x i32]* %12, i64 0, i64 0
%250 = call i32 @drawline(i32* %249)
%251 = load i32, i32* %7
%252 = load i32, i32* %6
%253 = icmp eq i32 %251, %252
br i1 %253, label %254, label %263
254: ; preds = %243
%255 = getelementptr inbounds [6 x i32], [6 x i32]* %12, i64 0, i64 5
store i32 20, i32* %255
%256 = getelementptr inbounds [6 x i32], [6 x i32]* %12, i64 0, i64 4
store i32 20, i32* %256
%257 = getelementptr inbounds [6 x i32], [6 x i32]* %12, i64 0, i64 0
store i32 20, i32* %257
%258 = getelementptr inbounds [6 x i32], [6 x i32]* %12, i64 0, i64 1
store i32 17, i32* %258
%259 = getelementptr inbounds [6 x i32], [6 x i32]* %12, i64 0, i64 2
store i32 18, i32* %259
%260 = getelementptr inbounds [6 x i32], [6 x i32]* %12, i64 0, i64 3
store i32 19, i32* %260
%261 = getelementptr inbounds [6 x i32], [6 x i32]* %12, i64 0, i64 0
%262 = call i32 @drawline(i32* %261)
br label %263
263: ; preds = %254, %243
%264 = load i32, i32* %8
%265 = sext i32 %264 to i64
%266 = getelementptr inbounds [4 x i32], [4 x i32]* %13, i64 0, i64 %265
%267 = load i32, i32* %266
%268 = add nsw i32 %267, 1
store i32 %268, i32* %266
%269 = call i32 @puts(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0))
%270 = call i32 (...) @getchar()
%271 = call i32 (...) @getchar()
br label %272
272: ; preds = %263
%273 = load i32, i32* %11
%274 = add nsw i32 %273, 1
store i32 %274, i32* %11
br label %51
275: ; preds = %51
%276 = getelementptr inbounds [4 x i32], [4 x i32]* %13, i64 0, i64 0
%277 = load i32, i32* %276
%278 = getelementptr inbounds [4 x i32], [4 x i32]* %13, i64 0, i64 0
%279 = load i32, i32* %278
%280 = sitofp i32 %279 to float
%281 = fmul float %280, 1.000000e+02
%282 = fdiv float %281, 2.500000e+01
%283 = fpext float %282 to double
%284 = getelementptr inbounds [4 x i32], [4 x i32]* %13, i64 0, i64 1
%285 = load i32, i32* %284
%286 = getelementptr inbounds [4 x i32], [4 x i32]* %13, i64 0, i64 1
%287 = load i32, i32* %286
%288 = sitofp i32 %287 to float
%289 = fmul float %288, 1.000000e+02
%290 = fdiv float %289, 2.500000e+01
%291 = fpext float %290 to double
%292 = getelementptr inbounds [4 x i32], [4 x i32]* %13, i64 0, i64 2
%293 = load i32, i32* %292
%294 = getelementptr inbounds [4 x i32], [4 x i32]* %13, i64 0, i64 2
%295 = load i32, i32* %294
%296 = sitofp i32 %295 to float
%297 = fmul float %296, 1.000000e+02
%298 = fdiv float %297, 2.500000e+01
%299 = fpext float %298 to double
%300 = getelementptr inbounds [4 x i32], [4 x i32]* %13, i64 0, i64 3
%301 = load i32, i32* %300
%302 = getelementptr inbounds [4 x i32], [4 x i32]* %13, i64 0, i64 3
%303 = load i32, i32* %302
%304 = sitofp i32 %303 to float
%305 = fmul float %304, 1.000000e+02
%306 = fdiv float %305, 2.500000e+01
%307 = fpext float %306 to double
%308 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([140 x i8], [140 x i8]* @.str.4, i64 0, i64 0), i32 25, i32 %277, double %283, i32 %285, double %291, i32 %293, double %299, i32 %301, double %307)
%309 = getelementptr inbounds [4 x i32], [4 x i32]* %13, i64 0, i64 0
%310 = load i32, i32* %309
%311 = sitofp i32 %310 to float
%312 = fpext float %311 to double
%313 = fmul double %312, 1.000000e+02
%314 = fdiv double %313, 2.500000e+01
%315 = getelementptr inbounds [4 x i32], [4 x i32]* %13, i64 0, i64 1
%316 = load i32, i32* %315
%317 = sitofp i32 %316 to float
%318 = fpext float %317 to double
%319 = fmul double %318, 5.000000e+01
%320 = fdiv double %319, 2.500000e+01
%321 = fadd double %314, %320
%322 = getelementptr inbounds [4 x i32], [4 x i32]* %13, i64 0, i64 2
%323 = load i32, i32* %322
%324 = sitofp i32 %323 to float
%325 = fpext float %324 to double
%326 = fmul double %325, 2.500000e+01
%327 = fdiv double %326, 2.500000e+01
%328 = fadd double %321, %327
store double %328, double* %14
%329 = load double, double* %14
%330 = fcmp olt double %329, 9.000000e+01
%331 = zext i1 %330 to i32
%332 = add nsw i32 65, %331
%333 = load double, double* %14
%334 = fcmp olt double %333, 8.000000e+01
%335 = zext i1 %334 to i32
%336 = add nsw i32 %332, %335
%337 = load double, double* %14
%338 = fcmp olt double %337, 7.000000e+01
%339 = zext i1 %338 to i32
%340 = add nsw i32 %336, %339
%341 = load double, double* %14
%342 = fcmp olt double %341, 6.000000e+01
%343 = zext i1 %342 to i32
%344 = mul nsw i32 2, %343
%345 = add nsw i32 %340, %344
%346 = load double, double* %14
%347 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.5, i64 0, i64 0), i32 %345, double %346)
%348 = call i32 @exit(i32 0)
unreachable
}

LLVM IR (-O2):
@.str = [152 x i8] c"Choose an option:\0A 1) Addition (easy)\0A 2) Addition (hard)\0A 3) Subtraction (easy)\0A 4) Subtraction (hard)\0A 5) Multiplication\0A 6) Division\0A 7) Shuffle\0A ? \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [40 x i8] c"Please type a number between 1 and 7 ? \00"
@RAND_MAX = global i32 0
@.str.3 = [17 x i8] c"Press any key...\00"
@.str.4 = [140 x i8] c"Report Card\0A------ ----\0A\0AOut of %d:\0A %d on first try (%2.1f%%)\0A %d on second try (%2.1f%%)\0A %d on last try (%2.1f%%)\0A %d missed (%2.1f%%)\0A\0A\00"
@.str.5 = [22 x i8] c"Grade: %c, (%2.2f%%)\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [6 x i32]
%3 = alloca [4 x i32]
%4 = bitcast [4 x i32]* %3 to i8*
%5 = bitcast i32* %1 to i8*
%6 = bitcast [6 x i32]* %2 to i8*
%7 = tail call i32 @time(i32* null)
%8 = tail call i32 @srand(i32 %7)
%9 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([152 x i8], [152 x i8]* @.str, i64 0, i64 0))
%10 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%11 = load i32, i32* %1
%12 = add i32 %11, -8
%13 = icmp ult i32 %12, -7
br i1 %13, label %14, label %20
14: ; preds = %0, %14
%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 = add i32 %17, -8
%19 = icmp ult i32 %18, -7
br i1 %19, label %14, label %20
20: ; preds = %14, %0
%21 = phi i32 [ %11, %0 ], [ %17, %14 ]
switch i32 %21, label %28 [
i32 7, label %27
i32 2, label %22
i32 3, label %23
i32 4, label %24
i32 5, label %25
i32 6, label %26
]
22: ; preds = %20
br label %28
23: ; preds = %20
br label %28
24: ; preds = %20
br label %28
25: ; preds = %20
br label %28
26: ; preds = %20
br label %28
27: ; preds = %20
br label %28
28: ; preds = %27, %20, %26, %25, %24, %23, %22
%29 = phi i1 [ false, %27 ], [ true, %26 ], [ true, %25 ], [ true, %24 ], [ true, %23 ], [ true, %22 ], [ true, %20 ]
%30 = phi i32 [ 10, %27 ], [ 10, %26 ], [ 10, %25 ], [ 99, %24 ], [ 10, %23 ], [ 99, %22 ], [ 10, %20 ]
%31 = phi i32 [ undef, %27 ], [ 4, %26 ], [ 3, %25 ], [ 2, %24 ], [ 2, %23 ], [ 1, %22 ], [ 1, %20 ]
%32 = add nsw i32 %30, -1
%33 = getelementptr inbounds [6 x i32], [6 x i32]* %2, i64 0, i64 5
%34 = getelementptr inbounds [6 x i32], [6 x i32]* %2, i64 0, i64 4
%35 = getelementptr inbounds [6 x i32], [6 x i32]* %2, i64 0, i64 1
%36 = getelementptr inbounds [6 x i32], [6 x i32]* %2, i64 0, i64 0
%37 = getelementptr inbounds [6 x i32], [6 x i32]* %2, i64 0, i64 2
%38 = getelementptr inbounds [6 x i32], [6 x i32]* %2, i64 0, i64 3
%39 = bitcast [6 x i32]* %2 to <4 x i32>*
%40 = bitcast [6 x i32]* %2 to <4 x i32>*
br label %41
41: ; preds = %28, %121
%42 = phi i32 [ %31, %28 ], [ %60, %121 ]
%43 = phi i32 [ 0, %28 ], [ %129, %121 ]
%44 = call i32 (...) @rand()
%45 = srem i32 %44, %30
%46 = call i32 (...) @rand()
%47 = srem i32 %46, %32
%48 = add nsw i32 %47, 1
%49 = call i32 (...) @rand()
%50 = srem i32 %49, %30
%51 = call i32 (...) @rand()
%52 = load i32, i32* @RAND_MAX
%53 = sdiv i32 %52, 2
%54 = icmp slt i32 %51, %53
br i1 %29, label %59, label %55
55: ; preds = %41
%56 = call i32 (...) @rand()
%57 = srem i32 %56, 4
%58 = add nsw i32 %57, 1
br label %59
59: ; preds = %55, %41
%60 = phi i32 [ %58, %55 ], [ %42, %41 ]
switch i32 %60, label %72 [
i32 1, label %61
i32 2, label %63
i32 3, label %68
i32 4, label %70
]
61: ; preds = %59
%62 = add nsw i32 %48, %45
br label %72
63: ; preds = %59
%64 = icmp sgt i32 %45, %47
%65 = select i1 %64, i32 %45, i32 %48
%66 = select i1 %64, i32 %48, i32 %45
%67 = sub nsw i32 %65, %66
br label %72
68: ; preds = %59
%69 = mul nsw i32 %48, %45
br label %72
70: ; preds = %59
%71 = mul nsw i32 %50, %48
br label %72
72: ; preds = %59, %70, %68, %63, %61
%73 = phi i32 [ %45, %59 ], [ %71, %70 ], [ %45, %68 ], [ %65, %63 ], [ %45, %61 ]
%74 = phi i32 [ %48, %59 ], [ %48, %70 ], [ %48, %68 ], [ %66, %63 ], [ %48, %61 ]
%75 = phi i32 [ %50, %59 ], [ %50, %70 ], [ %69, %68 ], [ %67, %63 ], [ %62, %61 ]
%76 = add i32 %73, 9
%77 = icmp ult i32 %76, 19
%78 = sdiv i32 %73, 10
%79 = select i1 %77, i32 20, i32 %78
%80 = srem i32 %73, 10
%81 = add nsw i32 %60, 9
%82 = add i32 %74, 9
%83 = icmp ult i32 %82, 19
%84 = sdiv i32 %74, 10
%85 = select i1 %83, i32 20, i32 %84
%86 = srem i32 %74, 10
br label %87
87: ; preds = %98, %72
%88 = phi i32 [ 0, %72 ], [ %99, %98 ]
br i1 %54, label %89, label %90
89: ; preds = %87
store i32 %79, i32* %36
store i32 %80, i32* %35
store i32 %81, i32* %37
store i32 %85, i32* %38
store i32 %86, i32* %34
store i32 14, i32* %33
br label %93
90: ; preds = %87
store i32 20, i32* %33
store i32 20, i32* %34
store i32 20, i32* %35
store i32 20, i32* %36
store i32 %79, i32* %37
store i32 %80, i32* %38
%91 = call i32 @drawline(i32* %36)
store i32 20, i32* %33
store i32 20, i32* %34
store i32 20, i32* %36
store i32 %81, i32* %35
store i32 %85, i32* %37
store i32 %86, i32* %38
%92 = call i32 @drawline(i32* %36)
store i32 20, i32* %33
store i32 20, i32* %34
store <4 x i32> <i32 20, i32 15, i32 15, i32 15>, <4 x i32>* %39
br label %93
93: ; preds = %90, %89
%94 = call i32 @drawline(i32* %36)
%95 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%96 = load i32, i32* %1
%97 = icmp eq i32 %96, %75
br i1 %97, label %109, label %98
98: ; preds = %93
store i32 20, i32* %34
store i32 20, i32* %37
store i32 20, i32* %36
%99 = add nuw nsw i32 %88, 1
%100 = icmp eq i32 %88, 0
%101 = select i1 %100, i32 20, i32 16
store i32 %101, i32* %35
store i32 16, i32* %38
%102 = icmp ugt i32 %88, 1
%103 = select i1 %102, i32 16, i32 20
store i32 %103, i32* %33
%104 = call i32 @drawline(i32* %36)
%105 = load i32, i32* %1
%106 = icmp ne i32 %105, %75
%107 = icmp ult i32 %88, 2
%108 = select i1 %106, i1 %107, i1 false
br i1 %108, label %87, label %109
109: ; preds = %93, %98
%110 = phi i32 [ %99, %98 ], [ %88, %93 ]
store i32 20, i32* %33
store i32 20, i32* %34
store i32 20, i32* %35
store i32 20, i32* %36
%111 = add i32 %75, 9
%112 = icmp ult i32 %111, 19
%113 = sdiv i32 %75, 10
%114 = select i1 %112, i32 20, i32 %113
store i32 %114, i32* %37
%115 = srem i32 %75, 10
store i32 %115, i32* %38
%116 = call i32 @drawline(i32* %36)
%117 = load i32, i32* %1
%118 = icmp eq i32 %117, %75
br i1 %118, label %119, label %121
119: ; preds = %109
store i32 20, i32* %33
store i32 20, i32* %34
store <4 x i32> <i32 20, i32 17, i32 18, i32 19>, <4 x i32>* %40
%120 = call i32 @drawline(i32* %36)
br label %121
121: ; preds = %119, %109
%122 = sext i32 %110 to i64
%123 = getelementptr inbounds [4 x i32], [4 x i32]* %3, i64 0, i64 %122
%124 = load i32, i32* %123
%125 = add nsw i32 %124, 1
store i32 %125, i32* %123
%126 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.3, i64 0, i64 0))
%127 = call i32 (...) @getchar()
%128 = call i32 (...) @getchar()
%129 = add nuw nsw i32 %43, 1
%130 = icmp eq i32 %129, 25
br i1 %130, label %131, label %41
131: ; preds = %121
%132 = getelementptr inbounds [4 x i32], [4 x i32]* %3, i64 0, i64 0
%133 = load i32, i32* %132
%134 = getelementptr inbounds [4 x i32], [4 x i32]* %3, i64 0, i64 2
%135 = load i32, i32* %134
%136 = insertelement <2 x i32> poison, i32 %133, i64 0
%137 = insertelement <2 x i32> %136, i32 %135, i64 1
%138 = sitofp <2 x i32> %137 to <2 x float>
%139 = extractelement <2 x float> %138, i64 0
%140 = fmul float %139, 1.000000e+02
%141 = fdiv float %140, 2.500000e+01
%142 = fpext float %141 to double
%143 = getelementptr inbounds [4 x i32], [4 x i32]* %3, i64 0, i64 1
%144 = load i32, i32* %143
%145 = sitofp i32 %144 to float
%146 = fmul float %145, 1.000000e+02
%147 = fdiv float %146, 2.500000e+01
%148 = fpext float %147 to double
%149 = extractelement <2 x float> %138, i64 1
%150 = fmul float %149, 1.000000e+02
%151 = fdiv float %150, 2.500000e+01
%152 = fpext float %151 to double
%153 = getelementptr inbounds [4 x i32], [4 x i32]* %3, i64 0, i64 3
%154 = load i32, i32* %153
%155 = sitofp i32 %154 to float
%156 = fmul float %155, 1.000000e+02
%157 = fdiv float %156, 2.500000e+01
%158 = fpext float %157 to double
%159 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([140 x i8], [140 x i8]* @.str.4, i64 0, i64 0), i32 25, i32 %133, double %142, i32 %144, double %148, i32 %135, double %152, i32 %154, double %158)
%160 = fpext float %145 to double
%161 = fmul double %160, 5.000000e+01
%162 = fdiv double %161, 2.500000e+01
%163 = fpext <2 x float> %138 to <2 x double>
%164 = fmul <2 x double> %163, <double 1.000000e+02, double 2.500000e+01>
%165 = fdiv <2 x double> %164, <double 2.500000e+01, double 2.500000e+01>
%166 = extractelement <2 x double> %165, i64 0
%167 = fadd double %166, %162
%168 = extractelement <2 x double> %165, i64 1
%169 = fadd double %167, %168
%170 = fcmp olt double %169, 9.000000e+01
%171 = select i1 %170, i32 66, i32 65
%172 = fcmp olt double %169, 8.000000e+01
%173 = zext i1 %172 to i32
%174 = add nuw nsw i32 %171, %173
%175 = fcmp olt double %169, 7.000000e+01
%176 = zext i1 %175 to i32
%177 = add nuw nsw i32 %174, %176
%178 = fcmp olt double %169, 6.000000e+01
%179 = select i1 %178, i32 2, i32 0
%180 = add nuw nsw i32 %177, %179
%181 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.5, i64 0, i64 0), i32 %180, double %169)
%182 = call i32 @exit(i32 0)
unreachable
}