#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 atoi(char *);
int /*<<< orphan*/ fgets(char *, int, int /*<<< orphan*/);
int /*<<< orphan*/ print_binary(int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ stdin;
int strlen(char *);
int main() {
  while (1) {
    char input[10];
    int is_letters = 0;
    int k;
    while (is_letters == 0) {
      printf("Enter \"help\" for a list of commands\n");
      printf("Please enter a command: ");
      fgets(input, 10, stdin);
      for (k = 0; k < strlen(input) - 1; k++) {
        if (input[k] >= 'a' && input[k] <= 'z') {
          input[k] = input[k] - 'a' + 'A';
          is_letters = 1;
        } else if (input[k] >= 'A' && input[k] <= 'Z')
          is_letters = 1;
        else {
          is_letters = 0;
          printf("\nYou entered an invalid entry!\n");
          printf("You entered an invalid character.\n\n");
          break;
        }
      }
    }
    if (input[0] == 'Q' && input[1] == 'U' && input[2] == 'I' &&
        input[3] == 'T') {
      return 0;
    } else if (input[0] == 'H' && input[1] == 'E' && input[2] == 'L' &&
               input[3] == 'P') {
      printf("\n***************************************************************"
             "****************\n");
      printf("[range]\n");
      printf("This command proceeds to accept a valid range of the following "
             "format:\n");
      printf("<n1>,<n2>\n");
      printf("Typing this command gives the utility a start and stop point for "
             "printing \n");
      printf("numbers. The utility will also accept the command ,<n2> in which "
             "case it\n");
      printf("will start at zero and print a table up to <n2> and the command "
             "<n1>, in\n");
      printf("which case it will start at <n1> and report up to the precision "
             "limit of\n");
      printf("the machine you are running on.\n\n");
      printf("[quit]\n");
      printf("Terminates execution.\n\n");
      printf("[help]\n");
      printf("Prints a short help doc to the terminal.\n");
      printf("*****************************************************************"
             "**************\n\n");
    } else if (input[0] == 'R' && input[1] == 'A' && input[2] == 'N' &&
               input[3] == 'G' && input[4] == 'E') {
      int start, end;
      int valid_format = 0;
      int comma_flag = 0;
      int range_flag = 0;
      while (valid_format == 0 || comma_flag == 0 || range_flag == 0) {
        start = 0;
        end = 0;
        printf("Enter a valid range: ");
        fgets(input, 10, stdin);
        for (k = 0; k < strlen(input) - 1; k++) {
          if (input[k] == '0' || input[k] == '1' || input[k] == '2' ||
              input[k] == '3' || input[k] == '4' || input[k] == '5' ||
              input[k] == '6' || input[k] == '7' || input[k] == '8' ||
              input[k] == '9' || input[k] == ',')
            valid_format = 1;
          else {
            valid_format = 0;
            printf("\nYou entered an invalid entry!\n");
            printf("The range of positive values must follow the form:\n");
            printf("	start,end\n");
            printf("Spaces are not allowed.\n");
            break;
          }
        }
        int i, j;
        int comma = -1;
        for (i = 0; i < 10; i++) {
          if (input[i] == ',') {
            comma = i;
            comma_flag = 1;
          }
        }
        if (comma == -1) {
          comma_flag = 0;
          printf("The comma was not correctly placed!\n");
        }
        char temp[10];
        for (i = 0; i < comma; i++) {
          temp[i] = input[i];
        }
        start = atoi(temp);
        if (comma + 2 == strlen(input))
          end = 1000;
        else {
          i = 0;
          for (j = comma + 1; j < strlen(input); j++) {
            temp[i] = input[j];
            i++;
          }
          end = atoi(temp);
        }
        if (start > end) {
          range_flag = 0;
          printf("You entered an invalid entry!\n");
          printf("The start value is larger than the end value.\n");
        } else
          range_flag = 1;
        printf("\n");
      }
      printf("dec		oct		hex		bin\n");
      int l;
      for (l = start; l <= end; l++) {
        printf("%d		%o		%x		", l, l, l);
        print_binary(l);
        printf("\n");
      }
      printf("\n");
    } else
      printf("\nAn invalid command was entered!\n\n");
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x60,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x14(%rbp)
cmpl   $0x0,-0x14(%rbp)
jne    1287 <main+0x137>
lea    0xe89(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xea0(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0xe(%rbp),%rdi
mov    0x2e51(%rip),%rax
mov    (%rax),%edx
mov    $0xa,%esi
call   1050 <fgets@plt>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x4c(%rbp)
lea    -0xe(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x4c(%rbp),%eax
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    1282 <main+0x132>
movslq -0x18(%rbp),%rax
movsbl -0xe(%rbp,%rax,1),%eax
cmp    $0x61,%eax
jl     1212 <main+0xc2>
movslq -0x18(%rbp),%rax
movsbl -0xe(%rbp,%rax,1),%eax
cmp    $0x7a,%eax
jg     1212 <main+0xc2>
movslq -0x18(%rbp),%rax
movsbl -0xe(%rbp,%rax,1),%eax
sub    $0x61,%eax
add    $0x41,%eax
mov    %al,%cl
movslq -0x18(%rbp),%rax
mov    %cl,-0xe(%rbp,%rax,1)
movl   $0x1,-0x14(%rbp)
jmp    126f <main+0x11f>
movslq -0x18(%rbp),%rax
movsbl -0xe(%rbp,%rax,1),%eax
cmp    $0x41,%eax
jl     1242 <main+0xf2>
movslq -0x18(%rbp),%rax
movsbl -0xe(%rbp,%rax,1),%eax
cmp    $0x5a,%eax
jg     1242 <main+0xf2>
movl   $0x1,-0x14(%rbp)
jmp    126a <main+0x11a>
movl   $0x0,-0x14(%rbp)
lea    0xdee(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe00(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1282 <main+0x132>
jmp    126f <main+0x11f>
jmp    1274 <main+0x124>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    11aa <main+0x5a>
jmp    1166 <main+0x16>
movsbl -0xe(%rbp),%eax
cmp    $0x51,%eax
jne    12c3 <main+0x173>
movsbl -0xd(%rbp),%eax
cmp    $0x55,%eax
jne    12c3 <main+0x173>
movsbl -0xc(%rbp),%eax
cmp    $0x49,%eax
jne    12c3 <main+0x173>
movsbl -0xb(%rbp),%eax
cmp    $0x54,%eax
jne    12c3 <main+0x173>
xor    %eax,%eax
add    $0x60,%rsp
pop    %rbp
ret
movsbl -0xe(%rbp),%eax
cmp    $0x48,%eax
jne    13c0 <main+0x270>
movsbl -0xd(%rbp),%eax
cmp    $0x45,%eax
jne    13c0 <main+0x270>
movsbl -0xc(%rbp),%eax
cmp    $0x4c,%eax
jne    13c0 <main+0x270>
movsbl -0xb(%rbp),%eax
cmp    $0x50,%eax
jne    13c0 <main+0x270>
lea    0xd84(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xdc8(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xdc3(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xdfd(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xdfa(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe38(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe74(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xeb0(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xeec(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xf00(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xefa(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xf04(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xefe(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xf1a(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    17cf <main+0x67f>
movsbl -0xe(%rbp),%eax
cmp    $0x52,%eax
jne    17bc <main+0x66c>
movsbl -0xd(%rbp),%eax
cmp    $0x41,%eax
jne    17bc <main+0x66c>
movsbl -0xc(%rbp),%eax
cmp    $0x4e,%eax
jne    17bc <main+0x66c>
movsbl -0xb(%rbp),%eax
cmp    $0x47,%eax
jne    17bc <main+0x66c>
movsbl -0xa(%rbp),%eax
cmp    $0x45,%eax
jne    17bc <main+0x66c>
movl   $0x0,-0x24(%rbp)
movl   $0x0,-0x28(%rbp)
movl   $0x0,-0x2c(%rbp)
mov    $0x1,%al
cmpl   $0x0,-0x24(%rbp)
mov    %al,-0x4d(%rbp)
je     143e <main+0x2ee>
mov    $0x1,%al
cmpl   $0x0,-0x28(%rbp)
mov    %al,-0x4d(%rbp)
je     143e <main+0x2ee>
cmpl   $0x0,-0x2c(%rbp)
sete   %al
mov    %al,-0x4d(%rbp)
mov    -0x4d(%rbp),%al
test   $0x1,%al
jne    144e <main+0x2fe>
jmp    174e <main+0x5fe>
movl   $0x0,-0x1c(%rbp)
movl   $0x0,-0x20(%rbp)
lea    0xebd(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    -0xe(%rbp),%rdi
mov    0x2b73(%rip),%rax
mov    (%rax),%edx
mov    $0xa,%esi
call   1050 <fgets@plt>
movl   $0x0,-0x18(%rbp)
mov    -0x18(%rbp),%eax
mov    %eax,-0x54(%rbp)
lea    -0xe(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x54(%rbp),%eax
sub    $0x1,%ecx
cmp    %ecx,%eax
jge    15d0 <main+0x480>
movslq -0x18(%rbp),%rax
movsbl -0xe(%rbp,%rax,1),%eax
cmp    $0x30,%eax
je     156d <main+0x41d>
movslq -0x18(%rbp),%rax
movsbl -0xe(%rbp,%rax,1),%eax
cmp    $0x31,%eax
je     156d <main+0x41d>
movslq -0x18(%rbp),%rax
movsbl -0xe(%rbp,%rax,1),%eax
cmp    $0x32,%eax
je     156d <main+0x41d>
movslq -0x18(%rbp),%rax
movsbl -0xe(%rbp,%rax,1),%eax
cmp    $0x33,%eax
je     156d <main+0x41d>
movslq -0x18(%rbp),%rax
movsbl -0xe(%rbp,%rax,1),%eax
cmp    $0x34,%eax
je     156d <main+0x41d>
movslq -0x18(%rbp),%rax
movsbl -0xe(%rbp,%rax,1),%eax
cmp    $0x35,%eax
je     156d <main+0x41d>
movslq -0x18(%rbp),%rax
movsbl -0xe(%rbp,%rax,1),%eax
cmp    $0x36,%eax
je     156d <main+0x41d>
movslq -0x18(%rbp),%rax
movsbl -0xe(%rbp,%rax,1),%eax
cmp    $0x37,%eax
je     156d <main+0x41d>
movslq -0x18(%rbp),%rax
movsbl -0xe(%rbp,%rax,1),%eax
cmp    $0x38,%eax
je     156d <main+0x41d>
movslq -0x18(%rbp),%rax
movsbl -0xe(%rbp,%rax,1),%eax
cmp    $0x39,%eax
je     156d <main+0x41d>
movslq -0x18(%rbp),%rax
movsbl -0xe(%rbp,%rax,1),%eax
cmp    $0x2c,%eax
jne    1579 <main+0x429>
movl   $0x1,-0x24(%rbp)
jmp    15bd <main+0x46d>
movl   $0x0,-0x24(%rbp)
lea    0xab7(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xda1(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xdc7(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xdc5(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    15d0 <main+0x480>
jmp    15c2 <main+0x472>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    1488 <main+0x338>
movl   $0xffffffff,-0x38(%rbp)
movl   $0x0,-0x30(%rbp)
cmpl   $0xa,-0x30(%rbp)
jge    161a <main+0x4ca>
movslq -0x30(%rbp),%rax
movsbl -0xe(%rbp,%rax,1),%eax
cmp    $0x2c,%eax
jne    1607 <main+0x4b7>
mov    -0x30(%rbp),%eax
mov    %eax,-0x38(%rbp)
movl   $0x1,-0x28(%rbp)
jmp    160c <main+0x4bc>
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    15de <main+0x48e>
cmpl   $0xffffffff,-0x38(%rbp)
jne    1639 <main+0x4e9>
movl   $0x0,-0x28(%rbp)
lea    0xd5d(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
movl   $0x0,-0x30(%rbp)
mov    -0x30(%rbp),%eax
cmp    -0x38(%rbp),%eax
jge    166a <main+0x51a>
movslq -0x30(%rbp),%rax
mov    -0xe(%rbp,%rax,1),%cl
movslq -0x30(%rbp),%rax
mov    %cl,-0x42(%rbp,%rax,1)
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
jmp    1640 <main+0x4f0>
lea    -0x42(%rbp),%rdi
call   1070 <atoi@plt>
mov    %eax,-0x1c(%rbp)
mov    -0x38(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x58(%rbp)
lea    -0xe(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x58(%rbp),%eax
cmp    %ecx,%eax
jne    16a1 <main+0x551>
movl   $0x3e8,-0x20(%rbp)
jmp    1700 <main+0x5b0>
movl   $0x0,-0x30(%rbp)
mov    -0x38(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
mov    -0x34(%rbp),%eax
mov    %eax,-0x5c(%rbp)
lea    -0xe(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x5c(%rbp),%eax
cmp    %ecx,%eax
jge    16f4 <main+0x5a4>
movslq -0x34(%rbp),%rax
mov    -0xe(%rbp,%rax,1),%cl
movslq -0x30(%rbp),%rax
mov    %cl,-0x42(%rbp,%rax,1)
mov    -0x30(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x30(%rbp)
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    16b1 <main+0x561>
lea    -0x42(%rbp),%rdi
call   1070 <atoi@plt>
mov    %eax,-0x20(%rbp)
mov    -0x1c(%rbp),%eax
cmp    -0x20(%rbp),%eax
jle    1734 <main+0x5e4>
movl   $0x0,-0x2c(%rbp)
lea    0x925(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xc8c(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    173b <main+0x5eb>
movl   $0x1,-0x2c(%rbp)
lea    0xce3(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1416 <main+0x2c6>
lea    0xc8e(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x1c(%rbp),%eax
mov    %eax,-0x48(%rbp)
mov    -0x48(%rbp),%eax
cmp    -0x20(%rbp),%eax
jg     17a9 <main+0x659>
mov    -0x48(%rbp),%esi
mov    -0x48(%rbp),%edx
mov    -0x48(%rbp),%ecx
lea    0xc79(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x48(%rbp),%edi
call   1060 <print_binary@plt>
lea    0xc91(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x48(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x48(%rbp)
jmp    1762 <main+0x612>
lea    0xc75(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    17ca <main+0x67a>
lea    0xc41(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    17cf <main+0x67f>
jmp    17d4 <main+0x684>
jmp    115f <main+0xf>

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
lea    0x1224(%rip),%r14
lea    0xe74(%rip),%r15
mov    0x2e45(%rip),%rbp
lea    0x8(%rsp),%rbx
lea    0xf7a(%rip),%r12
jmp    125f <main+0xdf>
mov    %r12,%rdi
call   1040 <puts@plt>
lea    0xfb7(%rip),%rdi
call   1040 <puts@plt>
lea    0xfb3(%rip),%rdi
call   1040 <puts@plt>
lea    0xfee(%rip),%rdi
call   1040 <puts@plt>
lea    0xfec(%rip),%rdi
call   1040 <puts@plt>
lea    0x102b(%rip),%rdi
call   1040 <puts@plt>
lea    0x1068(%rip),%rdi
call   1040 <puts@plt>
lea    0x10a5(%rip),%rdi
call   1040 <puts@plt>
lea    0x10e2(%rip),%rdi
call   1040 <puts@plt>
lea    0x10f7(%rip),%rdi
call   1040 <puts@plt>
lea    0x10f2(%rip),%rdi
call   1040 <puts@plt>
lea    0x10fd(%rip),%rdi
call   1040 <puts@plt>
lea    0x10f8(%rip),%rdi
call   1040 <puts@plt>
lea    0x1115(%rip),%rdi
call   1040 <puts@plt>
mov    0x2d89(%rip),%rbp
mov    %r14,%rdi
call   1040 <puts@plt>
mov    %r15,%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    0x0(%rbp),%edx
mov    %rbx,%rdi
mov    $0xa,%esi
call   1070 <fgets@plt>
mov    %rbx,%rdi
call   1050 <strlen@plt>
cmp    $0x2,%eax
jl     125f <main+0xdf>
xor    %ebp,%ebp
jmp    12bc <main+0x13c>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
add    $0xe0,%al
mov    %al,0x8(%rsp,%rbp,1)
add    $0x1,%rbp
mov    %rbx,%rdi
call   1050 <strlen@plt>
add    $0xffffffff,%eax
cltq
cmp    %rax,%rbp
jge    12f0 <main+0x170>
movzbl 0x8(%rsp,%rbp,1),%eax
lea    -0x61(%rax),%ecx
cmp    $0x19,%cl
jbe    12a0 <main+0x120>
add    $0xbf,%al
cmp    $0x1a,%al
jb     12a6 <main+0x126>
lea    0x1107(%rip),%rdi
call   1040 <puts@plt>
lea    0x111a(%rip),%rdi
jmp    1253 <main+0xd3>
nopw   0x0(%rax,%rax,1)
mov    0x8(%rsp),%al
mov    0x9(%rsp),%dl
mov    0xa(%rsp),%cl
mov    0xb(%rsp),%sil
cmp    $0x51,%al
jne    1319 <main+0x199>
cmp    $0x55,%dl
jne    1319 <main+0x199>
cmp    $0x49,%cl
jne    1319 <main+0x199>
cmp    $0x54,%sil
je     1691 <main+0x511>
cmp    $0x48,%al
jne    1331 <main+0x1b1>
cmp    $0x45,%dl
jne    1331 <main+0x1b1>
cmp    $0x4c,%cl
jne    1331 <main+0x1b1>
cmp    $0x50,%sil
je     11b4 <main+0x34>
cmp    $0x52,%al
mov    0x2cae(%rip),%rbp
jne    1680 <main+0x500>
cmp    $0x41,%dl
jne    1680 <main+0x500>
cmp    $0x4e,%cl
jne    1680 <main+0x500>
cmp    $0x47,%sil
jne    1680 <main+0x500>
cmpb   $0x45,0xc(%rsp)
jne    1680 <main+0x500>
xor    %r12d,%r12d
movl   $0x0,0x18(%rsp)
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
lea    0xca2(%rip),%rdi
xor    %eax,%eax
call   1060 <printf@plt>
mov    0x0(%rbp),%edx
lea    0x8(%rsp),%rbp
mov    %rbp,%rdi
mov    $0xa,%esi
call   1070 <fgets@plt>
mov    %rbp,%rdi
call   1050 <strlen@plt>
cmp    $0x2,%eax
jl     1438 <main+0x2b8>
xor    %ebx,%ebx
jmp    13d6 <main+0x256>
nopl   0x0(%rax,%rax,1)
add    $0x1,%rbx
mov    %rbp,%rdi
call   1050 <strlen@plt>
add    $0xffffffff,%eax
cltq
cmp    %rax,%rbx
jge    1430 <main+0x2b0>
movzbl 0x8(%rsp,%rbx,1),%eax
lea    -0x30(%rax),%ecx
cmp    $0xa,%cl
jb     13c0 <main+0x240>
cmp    $0x2c,%al
je     13c0 <main+0x240>
lea    0xfef(%rip),%rdi
call   1040 <puts@plt>
lea    0xcd9(%rip),%rdi
call   1040 <puts@plt>
lea    0xd00(%rip),%rdi
call   1040 <puts@plt>
lea    0xcff(%rip),%rdi
call   1040 <puts@plt>
movl   $0x0,0x18(%rsp)
jmp    1438 <main+0x2b8>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movl   $0x1,0x18(%rsp)
movq   0x8(%rsp),%xmm0
pcmpeqb 0xbba(%rip),%xmm0
pmovmskb %xmm0,%eax
mov    %eax,%esi
and    $0x2,%sil
mov    %eax,%edi
and    $0x4,%dil
lea    (%rdi,%rsi,1),%ecx
mov    %eax,%r8d
and    $0x8,%r8b
or     %r8b,%cl
mov    %eax,%r9d
and    $0x10,%r9b
or     %r9b,%cl
mov    %eax,%r10d
and    $0x20,%r10b
or     %r10b,%cl
mov    %eax,%edx
and    $0x40,%dl
or     %dl,%cl
mov    %eax,%ebx
and    $0x80,%bl
mov    %eax,%r13d
and    $0x1,%r13d
add    $0xffffffff,%r13d
test   %sil,%sil
mov    $0x1,%esi
cmovne %esi,%r13d
test   %dil,%dil
mov    $0x2,%edi
cmovne %edi,%r13d
test   %r8b,%r8b
mov    $0x3,%edi
cmovne %edi,%r13d
test   %r9b,%r9b
mov    $0x4,%edi
cmovne %edi,%r13d
test   %r10b,%r10b
mov    $0x5,%edi
cmovne %edi,%r13d
test   %dl,%dl
mov    $0x6,%edx
cmovne %edx,%r13d
test   %bl,%bl
mov    $0x7,%edx
cmovne %edx,%r13d
test   $0x1,%al
cmovne %esi,%r12d
or     %cl,%bl
cmovne %esi,%r12d
cmpb   $0x2c,0x10(%rsp)
mov    $0x8,%eax
cmove  %eax,%r13d
cmove  %esi,%r12d
cmpb   $0x2c,0x11(%rsp)
cmove  %esi,%r12d
mov    $0x9,%eax
cmove  %eax,%r13d
cmp    $0xffffffff,%r13d
je     1530 <main+0x3b0>
test   %r13d,%r13d
lea    0x1e(%rsp),%rbx
je     1544 <main+0x3c4>
mov    %r13d,%edx
mov    %rbx,%rdi
mov    %rbp,%rsi
call   1080 <memcpy@plt>
jmp    1544 <main+0x3c4>
lea    0xb78(%rip),%rdi
call   1040 <puts@plt>
xor    %r12d,%r12d
lea    0x1e(%rsp),%rbx
mov    %rbx,%rdi
call   10a0 <atoi@plt>
mov    %eax,%r14d
lea    0x2(%r13),%ebx
mov    %rbp,%rdi
call   1050 <strlen@plt>
mov    $0x3e8,%r15d
cmp    %eax,%ebx
mov    0x2a7e(%rip),%rbp
je     15c3 <main+0x443>
add    $0x1,%r13d
lea    0x8(%rsp),%r15
mov    %r15,%rdi
call   1050 <strlen@plt>
cmp    %eax,%r13d
jge    15af <main+0x42f>
mov    %r13d,%ebx
lea    0x1e(%rsp),%rbp
nopw   0x0(%rax,%rax,1)
movzbl 0x8(%rsp,%rbx,1),%eax
mov    %al,0x0(%rbp)
add    $0x1,%rbx
mov    %r15,%rdi
call   1050 <strlen@plt>
cltq
add    $0x1,%rbp
cmp    %rax,%rbx
jl     1590 <main+0x410>
lea    0x1e(%rsp),%rdi
call   10a0 <atoi@plt>
mov    %eax,%r15d
mov    0x2a25(%rip),%rbp
cmp    %r15d,%r14d
jle    15e0 <main+0x460>
lea    0xe0f(%rip),%rdi
call   1040 <puts@plt>
lea    0xaa6(%rip),%rdi
call   1040 <puts@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
cmpl   $0x0,0x18(%rsp)
je     1380 <main+0x200>
test   %r12d,%r12d
je     1380 <main+0x200>
cmp    %r15d,%r14d
jg     1380 <main+0x200>
lea    0xa60(%rip),%rdi
call   1040 <puts@plt>
add    $0x1,%r15d
lea    0xb0b(%rip),%r12
lea    0xa1a(%rip),%rbx
cs nopw 0x0(%rax,%rax,1)
nop
mov    %rbx,%rdi
mov    %r14d,%esi
mov    %r14d,%edx
mov    %r14d,%ecx
xor    %eax,%eax
call   1060 <printf@plt>
mov    %r14d,%edi
call   1090 <print_binary@plt>
mov    $0xa,%edi
call   1030 <putchar@plt>
add    $0x1,%r14d
cmp    %r14d,%r15d
jne    1630 <main+0x4b0>
mov    $0xa,%edi
call   1030 <putchar@plt>
lea    0xd4a(%rip),%r14
lea    0x99a(%rip),%r15
lea    0x8(%rsp),%rbx
jmp    125f <main+0xdf>
lea    0x9c5(%rip),%rdi
call   1040 <puts@plt>
jmp    125f <main+0xdf>
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [37 x i8] c"Enter \22help\22 for a list of commands\0A\00"
@.str.1 = [25 x i8] c"Please enter a command: \00"
@stdin = global i32 0
@.str.2 = [32 x i8] c"\0AYou entered an invalid entry!\0A\00"
@.str.3 = [36 x i8] c"You entered an invalid character.\0A\0A\00"
@.str.4 = [82 x i8] c"\0A*******************************************************************************\0A\00"
@.str.5 = [9 x i8] c"[range]\0A\00"
@.str.6 = [72 x i8] c"This command proceeds to accept a valid range of the following format:\0A\00"
@.str.7 = [11 x i8] c"<n1>,<n2>\0A\00"
@.str.8 = [76 x i8] c"Typing this command gives the utility a start and stop point for printing \0A\00"
@.str.9 = [74 x i8] c"numbers. The utility will also accept the command ,<n2> in which case it\0A\00"
@.str.10 = [74 x i8] c"will start at zero and print a table up to <n2> and the command <n1>, in\0A\00"
@.str.11 = [74 x i8] c"which case it will start at <n1> and report up to the precision limit of\0A\00"
@.str.12 = [34 x i8] c"the machine you are running on.\0A\0A\00"
@.str.13 = [8 x i8] c"[quit]\0A\00"
@.str.14 = [24 x i8] c"Terminates execution.\0A\0A\00"
@.str.15 = [8 x i8] c"[help]\0A\00"
@.str.16 = [42 x i8] c"Prints a short help doc to the terminal.\0A\00"
@.str.17 = [82 x i8] c"*******************************************************************************\0A\0A\00"
@.str.18 = [22 x i8] c"Enter a valid range: \00"
@.str.19 = [52 x i8] c"The range of positive values must follow the form:\0A\00"
@.str.20 = [12 x i8] c"\09start,end\0A\00"
@.str.21 = [25 x i8] c"Spaces are not allowed.\0A\00"
@.str.22 = [37 x i8] c"The comma was not correctly placed!\0A\00"
@.str.23 = [31 x i8] c"You entered an invalid entry!\0A\00"
@.str.24 = [47 x i8] c"The start value is larger than the end value.\0A\00"
@.str.25 = [2 x i8] c"\0A\00"
@.str.26 = [20 x i8] c"dec\09\09oct\09\09hex\09\09bin\0A\00"
@.str.27 = [13 x i8] c"%d\09\09%o\09\09%x\09\09\00"
@.str.28 = [35 x i8] c"\0AAn invalid command was entered!\0A\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [10 x i8]
%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 i32
%13 = alloca [10 x i8]
%14 = alloca i32
store i32 0, i32* %1
br label %15
15: ; preds = %0, %377
store i32 0, i32* %3
br label %16
16: ; preds = %80, %15
%17 = load i32, i32* %3
%18 = icmp eq i32 %17, 0
br i1 %18, label %19, label %81
19: ; preds = %16
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
%22 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%23 = load i32, i32* @stdin
%24 = call i32 @fgets(i8* %22, i32 10, i32 %23)
store i32 0, i32* %4
br label %25
25: ; preds = %77, %19
%26 = load i32, i32* %4
%27 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%28 = call i32 @strlen(i8* %27)
%29 = sub nsw i32 %28, 1
%30 = icmp slt i32 %26, %29
br i1 %30, label %31, label %80
31: ; preds = %25
%32 = load i32, i32* %4
%33 = sext i32 %32 to i64
%34 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 %33
%35 = load i8, i8* %34
%36 = sext i8 %35 to i32
%37 = icmp sge i32 %36, 97
br i1 %37, label %38, label %57
38: ; preds = %31
%39 = load i32, i32* %4
%40 = sext i32 %39 to i64
%41 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 %40
%42 = load i8, i8* %41
%43 = sext i8 %42 to i32
%44 = icmp sle i32 %43, 122
br i1 %44, label %45, label %57
45: ; preds = %38
%46 = load i32, i32* %4
%47 = sext i32 %46 to i64
%48 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 %47
%49 = load i8, i8* %48
%50 = sext i8 %49 to i32
%51 = sub nsw i32 %50, 97
%52 = add nsw i32 %51, 65
%53 = trunc i32 %52 to i8
%54 = load i32, i32* %4
%55 = sext i32 %54 to i64
%56 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 %55
store i8 %53, i8* %56
store i32 1, i32* %3
br label %76
57: ; preds = %38, %31
%58 = load i32, i32* %4
%59 = sext i32 %58 to i64
%60 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 %59
%61 = load i8, i8* %60
%62 = sext i8 %61 to i32
%63 = icmp sge i32 %62, 65
br i1 %63, label %64, label %72
64: ; preds = %57
%65 = load i32, i32* %4
%66 = sext i32 %65 to i64
%67 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 %66
%68 = load i8, i8* %67
%69 = sext i8 %68 to i32
%70 = icmp sle i32 %69, 90
br i1 %70, label %71, label %72
71: ; preds = %64
store i32 1, i32* %3
br label %75
72: ; preds = %64, %57
store i32 0, i32* %3
%73 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0))
%74 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([36 x i8], [36 x i8]* @.str.3, i64 0, i64 0))
br label %80
75: ; preds = %71
br label %76
76: ; preds = %75, %45
br label %77
77: ; preds = %76
%78 = load i32, i32* %4
%79 = add nsw i32 %78, 1
store i32 %79, i32* %4
br label %25
80: ; preds = %72, %25
br label %16
81: ; preds = %16
%82 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%83 = load i8, i8* %82
%84 = sext i8 %83 to i32
%85 = icmp eq i32 %84, 81
br i1 %85, label %86, label %102
86: ; preds = %81
%87 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 1
%88 = load i8, i8* %87
%89 = sext i8 %88 to i32
%90 = icmp eq i32 %89, 85
br i1 %90, label %91, label %102
91: ; preds = %86
%92 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 2
%93 = load i8, i8* %92
%94 = sext i8 %93 to i32
%95 = icmp eq i32 %94, 73
br i1 %95, label %96, label %102
96: ; preds = %91
%97 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 3
%98 = load i8, i8* %97
%99 = sext i8 %98 to i32
%100 = icmp eq i32 %99, 84
br i1 %100, label %101, label %102
101: ; preds = %96
ret i32 0
102: ; preds = %96, %91, %86, %81
%103 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%104 = load i8, i8* %103
%105 = sext i8 %104 to i32
%106 = icmp eq i32 %105, 72
br i1 %106, label %107, label %137
107: ; preds = %102
%108 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 1
%109 = load i8, i8* %108
%110 = sext i8 %109 to i32
%111 = icmp eq i32 %110, 69
br i1 %111, label %112, label %137
112: ; preds = %107
%113 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 2
%114 = load i8, i8* %113
%115 = sext i8 %114 to i32
%116 = icmp eq i32 %115, 76
br i1 %116, label %117, label %137
117: ; preds = %112
%118 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 3
%119 = load i8, i8* %118
%120 = sext i8 %119 to i32
%121 = icmp eq i32 %120, 80
br i1 %121, label %122, label %137
122: ; preds = %117
%123 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([82 x i8], [82 x i8]* @.str.4, i64 0, i64 0))
%124 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0))
%125 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([72 x i8], [72 x i8]* @.str.6, i64 0, i64 0))
%126 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.7, i64 0, i64 0))
%127 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([76 x i8], [76 x i8]* @.str.8, i64 0, i64 0))
%128 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str.9, i64 0, i64 0))
%129 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str.10, i64 0, i64 0))
%130 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([74 x i8], [74 x i8]* @.str.11, i64 0, i64 0))
%131 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.12, i64 0, i64 0))
%132 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.13, i64 0, i64 0))
%133 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.14, i64 0, i64 0))
%134 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.15, i64 0, i64 0))
%135 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.16, i64 0, i64 0))
%136 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([82 x i8], [82 x i8]* @.str.17, i64 0, i64 0))
br label %376
137: ; preds = %117, %112, %107, %102
%138 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%139 = load i8, i8* %138
%140 = sext i8 %139 to i32
%141 = icmp eq i32 %140, 82
br i1 %141, label %142, label %373
142: ; preds = %137
%143 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 1
%144 = load i8, i8* %143
%145 = sext i8 %144 to i32
%146 = icmp eq i32 %145, 65
br i1 %146, label %147, label %373
147: ; preds = %142
%148 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 2
%149 = load i8, i8* %148
%150 = sext i8 %149 to i32
%151 = icmp eq i32 %150, 78
br i1 %151, label %152, label %373
152: ; preds = %147
%153 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 3
%154 = load i8, i8* %153
%155 = sext i8 %154 to i32
%156 = icmp eq i32 %155, 71
br i1 %156, label %157, label %373
157: ; preds = %152
%158 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 4
%159 = load i8, i8* %158
%160 = sext i8 %159 to i32
%161 = icmp eq i32 %160, 69
br i1 %161, label %162, label %373
162: ; preds = %157
store i32 0, i32* %7
store i32 0, i32* %8
store i32 0, i32* %9
br label %163
163: ; preds = %351, %162
%164 = load i32, i32* %7
%165 = icmp eq i32 %164, 0
br i1 %165, label %172, label %166
166: ; preds = %163
%167 = load i32, i32* %8
%168 = icmp eq i32 %167, 0
br i1 %168, label %172, label %169
169: ; preds = %166
%170 = load i32, i32* %9
%171 = icmp eq i32 %170, 0
br label %172
172: ; preds = %169, %166, %163
%173 = phi i1 [ true, %166 ], [ true, %163 ], [ %171, %169 ]
br i1 %173, label %174, label %353
174: ; preds = %172
store i32 0, i32* %5
store i32 0, i32* %6
%175 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([22 x i8], [22 x i8]* @.str.18, i64 0, i64 0))
%176 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%177 = load i32, i32* @stdin
%178 = call i32 @fgets(i8* %176, i32 10, i32 %177)
store i32 0, i32* %4
br label %179
179: ; preds = %269, %174
%180 = load i32, i32* %4
%181 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%182 = call i32 @strlen(i8* %181)
%183 = sub nsw i32 %182, 1
%184 = icmp slt i32 %180, %183
br i1 %184, label %185, label %272
185: ; preds = %179
%186 = load i32, i32* %4
%187 = sext i32 %186 to i64
%188 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 %187
%189 = load i8, i8* %188
%190 = sext i8 %189 to i32
%191 = icmp eq i32 %190, 48
br i1 %191, label %262, label %192
192: ; preds = %185
%193 = load i32, i32* %4
%194 = sext i32 %193 to i64
%195 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 %194
%196 = load i8, i8* %195
%197 = sext i8 %196 to i32
%198 = icmp eq i32 %197, 49
br i1 %198, label %262, label %199
199: ; preds = %192
%200 = load i32, i32* %4
%201 = sext i32 %200 to i64
%202 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 %201
%203 = load i8, i8* %202
%204 = sext i8 %203 to i32
%205 = icmp eq i32 %204, 50
br i1 %205, label %262, label %206
206: ; preds = %199
%207 = load i32, i32* %4
%208 = sext i32 %207 to i64
%209 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 %208
%210 = load i8, i8* %209
%211 = sext i8 %210 to i32
%212 = icmp eq i32 %211, 51
br i1 %212, label %262, label %213
213: ; preds = %206
%214 = load i32, i32* %4
%215 = sext i32 %214 to i64
%216 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 %215
%217 = load i8, i8* %216
%218 = sext i8 %217 to i32
%219 = icmp eq i32 %218, 52
br i1 %219, label %262, label %220
220: ; preds = %213
%221 = load i32, i32* %4
%222 = sext i32 %221 to i64
%223 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 %222
%224 = load i8, i8* %223
%225 = sext i8 %224 to i32
%226 = icmp eq i32 %225, 53
br i1 %226, label %262, label %227
227: ; preds = %220
%228 = load i32, i32* %4
%229 = sext i32 %228 to i64
%230 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 %229
%231 = load i8, i8* %230
%232 = sext i8 %231 to i32
%233 = icmp eq i32 %232, 54
br i1 %233, label %262, label %234
234: ; preds = %227
%235 = load i32, i32* %4
%236 = sext i32 %235 to i64
%237 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 %236
%238 = load i8, i8* %237
%239 = sext i8 %238 to i32
%240 = icmp eq i32 %239, 55
br i1 %240, label %262, label %241
241: ; preds = %234
%242 = load i32, i32* %4
%243 = sext i32 %242 to i64
%244 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 %243
%245 = load i8, i8* %244
%246 = sext i8 %245 to i32
%247 = icmp eq i32 %246, 56
br i1 %247, label %262, label %248
248: ; preds = %241
%249 = load i32, i32* %4
%250 = sext i32 %249 to i64
%251 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 %250
%252 = load i8, i8* %251
%253 = sext i8 %252 to i32
%254 = icmp eq i32 %253, 57
br i1 %254, label %262, label %255
255: ; preds = %248
%256 = load i32, i32* %4
%257 = sext i32 %256 to i64
%258 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 %257
%259 = load i8, i8* %258
%260 = sext i8 %259 to i32
%261 = icmp eq i32 %260, 44
br i1 %261, label %262, label %263
262: ; preds = %255, %248, %241, %234, %227, %220, %213, %206, %199, %192, %185
store i32 1, i32* %7
br label %268
263: ; preds = %255
store i32 0, i32* %7
%264 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0))
%265 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.19, i64 0, i64 0))
%266 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.20, i64 0, i64 0))
%267 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.21, i64 0, i64 0))
br label %272
268: ; preds = %262
br label %269
269: ; preds = %268
%270 = load i32, i32* %4
%271 = add nsw i32 %270, 1
store i32 %271, i32* %4
br label %179
272: ; preds = %263, %179
store i32 -1, i32* %12
store i32 0, i32* %10
br label %273
273: ; preds = %286, %272
%274 = load i32, i32* %10
%275 = icmp slt i32 %274, 10
br i1 %275, label %276, label %289
276: ; preds = %273
%277 = load i32, i32* %10
%278 = sext i32 %277 to i64
%279 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 %278
%280 = load i8, i8* %279
%281 = sext i8 %280 to i32
%282 = icmp eq i32 %281, 44
br i1 %282, label %283, label %285
283: ; preds = %276
%284 = load i32, i32* %10
store i32 %284, i32* %12
store i32 1, i32* %8
br label %285
285: ; preds = %283, %276
br label %286
286: ; preds = %285
%287 = load i32, i32* %10
%288 = add nsw i32 %287, 1
store i32 %288, i32* %10
br label %273
289: ; preds = %273
%290 = load i32, i32* %12
%291 = icmp eq i32 %290, -1
br i1 %291, label %292, label %294
292: ; preds = %289
store i32 0, i32* %8
%293 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str.22, i64 0, i64 0))
br label %294
294: ; preds = %292, %289
store i32 0, i32* %10
br label %295
295: ; preds = %307, %294
%296 = load i32, i32* %10
%297 = load i32, i32* %12
%298 = icmp slt i32 %296, %297
br i1 %298, label %299, label %310
299: ; preds = %295
%300 = load i32, i32* %10
%301 = sext i32 %300 to i64
%302 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 %301
%303 = load i8, i8* %302
%304 = load i32, i32* %10
%305 = sext i32 %304 to i64
%306 = getelementptr inbounds [10 x i8], [10 x i8]* %13, i64 0, i64 %305
store i8 %303, i8* %306
br label %307
307: ; preds = %299
%308 = load i32, i32* %10
%309 = add nsw i32 %308, 1
store i32 %309, i32* %10
br label %295
310: ; preds = %295
%311 = getelementptr inbounds [10 x i8], [10 x i8]* %13, i64 0, i64 0
%312 = call i32 @atoi(i8* %311)
store i32 %312, i32* %5
%313 = load i32, i32* %12
%314 = add nsw i32 %313, 2
%315 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%316 = call i32 @strlen(i8* %315)
%317 = icmp eq i32 %314, %316
br i1 %317, label %318, label %319
318: ; preds = %310
store i32 1000, i32* %6
br label %343
319: ; preds = %310
store i32 0, i32* %10
%320 = load i32, i32* %12
%321 = add nsw i32 %320, 1
store i32 %321, i32* %11
br label %322
322: ; preds = %337, %319
%323 = load i32, i32* %11
%324 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 0
%325 = call i32 @strlen(i8* %324)
%326 = icmp slt i32 %323, %325
br i1 %326, label %327, label %340
327: ; preds = %322
%328 = load i32, i32* %11
%329 = sext i32 %328 to i64
%330 = getelementptr inbounds [10 x i8], [10 x i8]* %2, i64 0, i64 %329
%331 = load i8, i8* %330
%332 = load i32, i32* %10
%333 = sext i32 %332 to i64
%334 = getelementptr inbounds [10 x i8], [10 x i8]* %13, i64 0, i64 %333
store i8 %331, i8* %334
%335 = load i32, i32* %10
%336 = add nsw i32 %335, 1
store i32 %336, i32* %10
br label %337
337: ; preds = %327
%338 = load i32, i32* %11
%339 = add nsw i32 %338, 1
store i32 %339, i32* %11
br label %322
340: ; preds = %322
%341 = getelementptr inbounds [10 x i8], [10 x i8]* %13, i64 0, i64 0
%342 = call i32 @atoi(i8* %341)
store i32 %342, i32* %6
br label %343
343: ; preds = %340, %318
%344 = load i32, i32* %5
%345 = load i32, i32* %6
%346 = icmp sgt i32 %344, %345
br i1 %346, label %347, label %350
347: ; preds = %343
store i32 0, i32* %9
%348 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str.23, i64 0, i64 0))
%349 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([47 x i8], [47 x i8]* @.str.24, i64 0, i64 0))
br label %351
350: ; preds = %343
store i32 1, i32* %9
br label %351
351: ; preds = %350, %347
%352 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.25, i64 0, i64 0))
br label %163
353: ; preds = %172
%354 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.26, i64 0, i64 0))
%355 = load i32, i32* %5
store i32 %355, i32* %14
br label %356
356: ; preds = %368, %353
%357 = load i32, i32* %14
%358 = load i32, i32* %6
%359 = icmp sle i32 %357, %358
br i1 %359, label %360, label %371
360: ; preds = %356
%361 = load i32, i32* %14
%362 = load i32, i32* %14
%363 = load i32, i32* %14
%364 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.27, i64 0, i64 0), i32 %361, i32 %362, i32 %363)
%365 = load i32, i32* %14
%366 = call i32 @print_binary(i32 %365)
%367 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.25, i64 0, i64 0))
br label %368
368: ; preds = %360
%369 = load i32, i32* %14
%370 = add nsw i32 %369, 1
store i32 %370, i32* %14
br label %356
371: ; preds = %356
%372 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.25, i64 0, i64 0))
br label %375
373: ; preds = %157, %152, %147, %142, %137
%374 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([35 x i8], [35 x i8]* @.str.28, i64 0, i64 0))
br label %375
375: ; preds = %373, %371
br label %376
376: ; preds = %375, %122
br label %377
377: ; preds = %376
br label %15
}

LLVM IR (-O2):
@.str.1 = [25 x i8] c"Please enter a command: \00"
@stdin = global i32 0
@.str.18 = [22 x i8] c"Enter a valid range: \00"
@.str.27 = [13 x i8] c"%d\09\09%o\09\09%x\09\09\00"
@str = [34 x i8] c"\0AAn invalid command was entered!\0A\00"
@str.29 = [19 x i8] c"dec\09\09oct\09\09hex\09\09bin\00"
@str.30 = [30 x i8] c"You entered an invalid entry!\00"
@str.31 = [46 x i8] c"The start value is larger than the end value.\00"
@str.32 = [36 x i8] c"The comma was not correctly placed!\00"
@str.34 = [51 x i8] c"The range of positive values must follow the form:\00"
@str.35 = [11 x i8] c"\09start,end\00"
@str.36 = [24 x i8] c"Spaces are not allowed.\00"
@str.37 = [81 x i8] c"\0A*******************************************************************************\00"
@str.38 = [8 x i8] c"[range]\00"
@str.39 = [71 x i8] c"This command proceeds to accept a valid range of the following format:\00"
@str.40 = [10 x i8] c"<n1>,<n2>\00"
@str.41 = [75 x i8] c"Typing this command gives the utility a start and stop point for printing \00"
@str.42 = [73 x i8] c"numbers. The utility will also accept the command ,<n2> in which case it\00"
@str.43 = [73 x i8] c"will start at zero and print a table up to <n2> and the command <n1>, in\00"
@str.44 = [73 x i8] c"which case it will start at <n1> and report up to the precision limit of\00"
@str.45 = [33 x i8] c"the machine you are running on.\0A\00"
@str.46 = [7 x i8] c"[quit]\00"
@str.47 = [23 x i8] c"Terminates execution.\0A\00"
@str.48 = [7 x i8] c"[help]\00"
@str.49 = [41 x i8] c"Prints a short help doc to the terminal.\00"
@str.50 = [81 x i8] c"*******************************************************************************\0A\00"
@str.51 = [36 x i8] c"Enter \22help\22 for a list of commands\00"
@str.52 = [31 x i8] c"\0AYou entered an invalid entry!\00"
@str.53 = [35 x i8] c"You entered an invalid character.\0A\00"
define i32 @main() {
%1 = alloca [10 x i8]
%2 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%3 = alloca [10 x i8]
%4 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%5 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 0
%6 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 1
%7 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 2
%8 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 3
%9 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 4
%10 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 0
%11 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 8
%12 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 9
%13 = bitcast [10 x i8]* %1 to <8 x i8>*
br label %14
14: ; preds = %206, %0
br label %15
15: ; preds = %22, %14
%16 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str.51, i64 0, i64 0))
%17 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.1, i64 0, i64 0))
%18 = load i32, i32* @stdin
%19 = call i32 @fgets(i8* %5, i32 10, i32 %18)
%20 = call i32 @strlen(i8* %5)
%21 = icmp sgt i32 %20, 1
br i1 %21, label %23, label %22
22: ; preds = %15, %34
br label %15
23: ; preds = %15, %37
%24 = phi i64 [ %38, %37 ], [ 0, %15 ]
%25 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 %24
%26 = load i8, i8* %25
%27 = add i8 %26, -97
%28 = icmp ult i8 %27, 26
br i1 %28, label %29, label %31
29: ; preds = %23
%30 = add nsw i8 %26, -32
store i8 %30, i8* %25
br label %37
31: ; preds = %23
%32 = add i8 %26, -65
%33 = icmp ult i8 %32, 26
br i1 %33, label %37, label %34
34: ; preds = %31
%35 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str.52, i64 0, i64 0))
%36 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([35 x i8], [35 x i8]* @str.53, i64 0, i64 0))
br label %22
37: ; preds = %31, %29
%38 = add nuw nsw i64 %24, 1
%39 = call i32 @strlen(i8* %5)
%40 = add nsw i32 %39, -1
%41 = sext i32 %40 to i64
%42 = icmp slt i64 %38, %41
br i1 %42, label %23, label %43
43: ; preds = %37
%44 = load i8, i8* %5
%45 = icmp eq i8 %44, 81
%46 = load i8, i8* %6
%47 = icmp eq i8 %46, 85
%48 = select i1 %45, i1 %47, i1 false
%49 = load i8, i8* %7
%50 = icmp eq i8 %49, 73
%51 = select i1 %48, i1 %50, i1 false
%52 = load i8, i8* %8
%53 = icmp eq i8 %52, 84
%54 = select i1 %51, i1 %53, i1 false
br i1 %54, label %207, label %55
55: ; preds = %43
%56 = icmp eq i8 %44, 72
%57 = icmp eq i8 %46, 69
%58 = select i1 %56, i1 %57, i1 false
%59 = icmp eq i8 %49, 76
%60 = select i1 %58, i1 %59, i1 false
%61 = icmp eq i8 %52, 80
%62 = select i1 %60, i1 %61, i1 false
br i1 %62, label %63, label %78
63: ; preds = %55
%64 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([81 x i8], [81 x i8]* @str.37, i64 0, i64 0))
%65 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @str.38, i64 0, i64 0))
%66 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([71 x i8], [71 x i8]* @str.39, i64 0, i64 0))
%67 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @str.40, i64 0, i64 0))
%68 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([75 x i8], [75 x i8]* @str.41, i64 0, i64 0))
%69 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([73 x i8], [73 x i8]* @str.42, i64 0, i64 0))
%70 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([73 x i8], [73 x i8]* @str.43, i64 0, i64 0))
%71 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([73 x i8], [73 x i8]* @str.44, i64 0, i64 0))
%72 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @str.45, i64 0, i64 0))
%73 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str.46, i64 0, i64 0))
%74 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @str.47, i64 0, i64 0))
%75 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str.48, i64 0, i64 0))
%76 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @str.49, i64 0, i64 0))
%77 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([81 x i8], [81 x i8]* @str.50, i64 0, i64 0))
br label %206
78: ; preds = %55
%79 = icmp eq i8 %44, 82
%80 = icmp eq i8 %46, 65
%81 = select i1 %79, i1 %80, i1 false
%82 = icmp eq i8 %49, 78
%83 = select i1 %81, i1 %82, i1 false
%84 = icmp eq i8 %52, 71
%85 = select i1 %83, i1 %84, i1 false
%86 = load i8, i8* %9
%87 = icmp eq i8 %86, 69
%88 = select i1 %85, i1 %87, i1 false
br i1 %88, label %89, label %204
89: ; preds = %78, %187
%90 = phi i32 [ %157, %187 ], [ 0, %78 ]
%91 = phi i32 [ %113, %187 ], [ 0, %78 ]
%92 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @.str.18, i64 0, i64 0))
%93 = load i32, i32* @stdin
%94 = call i32 @fgets(i8* %5, i32 10, i32 %93)
%95 = call i32 @strlen(i8* %5)
%96 = icmp sgt i32 %95, 1
br i1 %96, label %97, label %112
97: ; preds = %89, %101
%98 = phi i64 [ %102, %101 ], [ 0, %89 ]
%99 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 %98
%100 = load i8, i8* %99
switch i8 %100, label %107 [
i8 48, label %101
i8 49, label %101
i8 50, label %101
i8 51, label %101
i8 52, label %101
i8 53, label %101
i8 54, label %101
i8 55, label %101
i8 56, label %101
i8 57, label %101
i8 44, label %101
]
101: ; preds = %97, %97, %97, %97, %97, %97, %97, %97, %97, %97, %97
%102 = add nuw nsw i64 %98, 1
%103 = call i32 @strlen(i8* %5)
%104 = add nsw i32 %103, -1
%105 = sext i32 %104 to i64
%106 = icmp slt i64 %102, %105
br i1 %106, label %97, label %112
107: ; preds = %97
%108 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([31 x i8], [31 x i8]* @str.52, i64 0, i64 0))
%109 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @str.34, i64 0, i64 0))
%110 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str.35, i64 0, i64 0))
%111 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @str.36, i64 0, i64 0))
br label %112
112: ; preds = %101, %89, %107
%113 = phi i32 [ 0, %107 ], [ %91, %89 ], [ 1, %101 ]
%114 = load <8 x i8>, <8 x i8>* %13
%115 = icmp eq <8 x i8> %114, <i8 44, i8 44, i8 44, i8 44, i8 44, i8 44, i8 44, i8 44>
%116 = extractelement <8 x i1> %115, i64 0
%117 = xor i1 %116, true
%118 = sext i1 %117 to i32
%119 = extractelement <8 x i1> %115, i64 1
%120 = select i1 %119, i32 1, i32 %118
%121 = extractelement <8 x i1> %115, i64 2
%122 = select i1 %121, i32 2, i32 %120
%123 = extractelement <8 x i1> %115, i64 3
%124 = select i1 %123, i32 3, i32 %122
%125 = extractelement <8 x i1> %115, i64 4
%126 = select i1 %125, i32 4, i32 %124
%127 = extractelement <8 x i1> %115, i64 5
%128 = select i1 %127, i32 5, i32 %126
%129 = extractelement <8 x i1> %115, i64 6
%130 = select i1 %129, i32 6, i32 %128
%131 = extractelement <8 x i1> %115, i64 7
%132 = select i1 %131, i32 7, i32 %130
%133 = load i8, i8* %11
%134 = icmp eq i8 %133, 44
%135 = select i1 %134, i32 8, i32 %132
%136 = load i8, i8* %12
%137 = icmp eq i8 %136, 44
%138 = select i1 %137, i1 true, i1 %134
%139 = select i1 %138, i1 true, i1 %131
%140 = select i1 %139, i1 true, i1 %129
%141 = select i1 %140, i1 true, i1 %127
%142 = select i1 %141, i1 true, i1 %125
%143 = select i1 %142, i1 true, i1 %123
%144 = select i1 %143, i1 true, i1 %121
%145 = select i1 %144, i1 true, i1 %119
%146 = select i1 %145, i1 true, i1 %116
%147 = select i1 %146, i32 1, i32 %90
%148 = select i1 %137, i32 9, i32 %135
%149 = icmp eq i32 %148, -1
br i1 %149, label %150, label %152
150: ; preds = %112
%151 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([36 x i8], [36 x i8]* @str.32, i64 0, i64 0))
br label %156
152: ; preds = %112
%153 = icmp eq i32 %148, 0
br i1 %153, label %156, label %154
154: ; preds = %152
%155 = zext i32 %148 to i64
br label %156
156: ; preds = %150, %154, %152
%157 = phi i32 [ 0, %150 ], [ %147, %154 ], [ %147, %152 ]
%158 = call i32 @atoi(i8* %10)
%159 = add nsw i32 %148, 2
%160 = call i32 @strlen(i8* %5)
%161 = icmp eq i32 %159, %160
br i1 %161, label %181, label %162
162: ; preds = %156
%163 = add nsw i32 %148, 1
%164 = call i32 @strlen(i8* %5)
%165 = icmp slt i32 %163, %164
br i1 %165, label %166, label %179
166: ; preds = %162
%167 = zext i32 %163 to i64
br label %168
168: ; preds = %166, %168
%169 = phi i64 [ 0, %166 ], [ %174, %168 ]
%170 = phi i64 [ %167, %166 ], [ %175, %168 ]
%171 = getelementptr inbounds [10 x i8], [10 x i8]* %1, i64 0, i64 %170
%172 = load i8, i8* %171
%173 = getelementptr inbounds [10 x i8], [10 x i8]* %3, i64 0, i64 %169
store i8 %172, i8* %173
%174 = add nuw nsw i64 %169, 1
%175 = add nuw nsw i64 %170, 1
%176 = call i32 @strlen(i8* %5)
%177 = sext i32 %176 to i64
%178 = icmp slt i64 %175, %177
br i1 %178, label %168, label %179
179: ; preds = %168, %162
%180 = call i32 @atoi(i8* %10)
br label %181
181: ; preds = %156, %179
%182 = phi i32 [ %180, %179 ], [ 1000, %156 ]
%183 = icmp sgt i32 %158, %182
br i1 %183, label %184, label %187
184: ; preds = %181
%185 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @str.30, i64 0, i64 0))
%186 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([46 x i8], [46 x i8]* @str.31, i64 0, i64 0))
br label %187
187: ; preds = %181, %184
%188 = call i32 @putchar(i32 10)
%189 = icmp eq i32 %113, 0
%190 = icmp eq i32 %157, 0
%191 = select i1 %189, i1 true, i1 %190
%192 = or i1 %191, %183
br i1 %192, label %89, label %193
193: ; preds = %187
%194 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str.29, i64 0, i64 0))
br label %195
195: ; preds = %193, %195
%196 = phi i32 [ %200, %195 ], [ %158, %193 ]
%197 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.27, i64 0, i64 0), i32 %196, i32 %196, i32 %196)
%198 = call i32 @print_binary(i32 %196)
%199 = call i32 @putchar(i32 10)
%200 = add i32 %196, 1
%201 = icmp eq i32 %196, %182
br i1 %201, label %202, label %195
202: ; preds = %195
%203 = call i32 @putchar(i32 10)
br label %206
204: ; preds = %78
%205 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @str, i64 0, i64 0))
br label %206
206: ; preds = %202, %204, %63
br label %14
207: ; preds = %43
ret i32 0
}