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

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ bill(unsigned int);
double expr(char *);
int /*<<< orphan*/ fibseq(unsigned int);
int /*<<< orphan*/ floyd(unsigned int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *);
int /*<<< orphan*/ free(char *);
char *getstr();
int /*<<< orphan*/ iseven(unsigned int);
int /*<<< orphan*/ isleap(unsigned int);
int /*<<< orphan*/ issquare(unsigned int);
int max(unsigned int, unsigned int, unsigned int);
int /*<<< orphan*/ oct2bin(unsigned int);
int /*<<< orphan*/ primefac(unsigned int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ putchar(char);
int /*<<< orphan*/ puts(char *);
int revnum(unsigned int);
int /*<<< orphan*/ scanf(char *, unsigned int *, ...);
int /*<<< orphan*/ stderr;
char *strrev(char *);
int /*<<< orphan*/ table(unsigned int);
int /*<<< orphan*/ tobin(unsigned int);
int todec(unsigned int);
int /*<<< orphan*/ tooct(unsigned int);
int main() {
  unsigned a, b, c, ch;
  char *s;
  do {
    puts("What would you like to do?");
    puts(" ( 0) Exit");
    puts(" ( 1) Reverse String");
    puts(" ( 2) Reverse Number");
    puts(" ( 3) Evaluate Expression");
    puts(" ( 4) Even/Odd");
    puts(" ( 5) Maximum of 3 numbers");
    puts(" ( 6) Decimal to Binary");
    puts(" ( 7) Binary  to Decimal");
    puts(" ( 8) Octal   to Binary");
    puts(" ( 9) Decimal to Octal");
    puts(" (10) Print even numbers from 1 to 100");
    puts(" (11) Multiplication Table");
    puts(" (12) Reciprocal");
    puts(" (13) Electricity Bill");
    puts(" (14) Perfect Square");
    puts(" (15) Prime Factors");
    puts(" (16) Fibonacci Series");
    puts(" (17) Leap Year");
    puts(" (18) Floyd's Triangle");
    scanf(" %u%*c", &ch);
    switch (ch) {
    case 0:
      puts("Bye!");
      break;
    case 1:
      puts("String?");
      s = getstr();
      if (!s)
        goto alocerr;
      printf("Reversed String: %s\n", strrev(s));
      free(s);
      break;
    case 2:
      puts("Number?");
      scanf(" %u%*c", &a);
      printf("Reversed Number: %u\n", revnum(a));
      break;
    case 3:
      puts("Expression?");
      s = getstr();
      if (!s)
        goto alocerr;
      printf("= %lf\n", expr(s));
      free(s);
      break;
    case 4:
      puts("Number?");
      scanf(" %u%*c", &a);
      printf("%s\n", iseven(a) ? "Even" : "Odd");
      break;
    case 5:
      puts("3 numbers?");
      scanf(" %u %u %u%*c", &a, &b, &c);
      printf("max = %u\n", max(a, b, c));
      break;
    case 6:
      puts("Decimal?");
      scanf(" %u%*c", &a);
      tobin(a);
      break;
    case 7:
      puts("Binary?");
      scanf(" %u%*c", &a);
      printf("%u in decimal.\n", todec(a));
      break;
    case 8:
      puts("Octal?");
      scanf(" %u%*c", &a);
      oct2bin(a);
      break;
    case 9:
      puts("Decimal?");
      scanf(" %u%*c", &a);
      tooct(a);
      break;
    case 10:
      for (c = 2; c <= 100; c += 2)
        printf("%4u", c);
      putchar('\n');
      break;
    case 11:
      puts("Number?");
      scanf(" %u%*c", &a);
      table(a);
      break;
    case 12:
      puts("Number?");
      s = getstr();
      if (!s)
        goto alocerr;
      printf("Reciprocal = %lf\n", 1.0 / expr(s));
      free(s);
      break;
    case 13:
      puts("Units Consumed?");
      scanf(" %u%*c", &a);
      bill(a);
      break;
    case 14:
      puts("Number?");
      scanf(" %u%*c", &a);
      printf("The number is %sperfect square.\n", issquare(a) ? "" : "not ");
      break;
    case 15:
      puts("Number?");
      scanf(" %u%*c", &a);
      primefac(a);
      break;
    case 16:
      puts("Number of Elements?");
      scanf(" %u%*c", &a);
      fibseq(a);
      break;
    case 17:
      puts("Year?");
      scanf(" %u%*c", &a);
      printf("%u is %s.\n", a, isleap(a) ? "leap" : "not leap");
      break;
    case 18:
      puts("Number of Rows?");
      scanf(" %u%*c", &a);
      floyd(a);
      break;
    default:
      puts("Incorrect Choice!");
    }
    putchar('\n');
  } while (ch);
  return 0;
alocerr:
  fprintf(stderr, "Allocation Error!\nCore Dumped!\n");
  return 1;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xdce(%rip),%rdi
call   1060 <puts@plt>
lea    0xddd(%rip),%rdi
call   1060 <puts@plt>
lea    0xddc(%rip),%rdi
call   1060 <puts@plt>
lea    0xde5(%rip),%rdi
call   1060 <puts@plt>
lea    0xdee(%rip),%rdi
call   1060 <puts@plt>
lea    0xdfc(%rip),%rdi
call   1060 <puts@plt>
lea    0xdff(%rip),%rdi
call   1060 <puts@plt>
lea    0xe0e(%rip),%rdi
call   1060 <puts@plt>
lea    0xe1a(%rip),%rdi
call   1060 <puts@plt>
lea    0xe27(%rip),%rdi
call   1060 <puts@plt>
lea    0xe33(%rip),%rdi
call   1060 <puts@plt>
lea    0xe3e(%rip),%rdi
call   1060 <puts@plt>
lea    0xe59(%rip),%rdi
call   1060 <puts@plt>
lea    0xe68(%rip),%rdi
call   1060 <puts@plt>
lea    0xe6d(%rip),%rdi
call   1060 <puts@plt>
lea    0xe78(%rip),%rdi
call   1060 <puts@plt>
lea    0xe81(%rip),%rdi
call   1060 <puts@plt>
lea    0xe89(%rip),%rdi
call   1060 <puts@plt>
lea    0xe94(%rip),%rdi
call   1060 <puts@plt>
lea    0xe98(%rip),%rdi
call   1060 <puts@plt>
lea    0xf04(%rip),%rdi
xor    %eax,%eax
lea    -0x14(%rbp),%rsi
call   1140 <scanf@plt>
mov    -0x14(%rbp),%eax
mov    %rax,-0x28(%rbp)
sub    $0x12,%rax
ja     17fc <main+0x58c>
mov    -0x28(%rbp),%rax
lea    0xc6b(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xe6c(%rip),%rdi
call   1060 <puts@plt>
jmp    1808 <main+0x598>
lea    0xe60(%rip),%rdi
call   1060 <puts@plt>
mov    $0x0,%al
call   10f0 <getstr@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    13de <main+0x16e>
jmp    1828 <main+0x5b8>
mov    -0x20(%rbp),%rdi
call   1150 <strrev@plt>
mov    %rax,%rsi
lea    0xe35(%rip),%rdi
mov    $0x0,%al
call   10a0 <printf@plt>
mov    -0x20(%rbp),%rdi
call   1040 <free@plt>
jmp    1808 <main+0x598>
lea    0xe2e(%rip),%rdi
call   1060 <puts@plt>
lea    0xe61(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1140 <scanf@plt>
mov    -0x8(%rbp),%edi
call   1110 <revnum@plt>
mov    %eax,%esi
lea    0xe0e(%rip),%rdi
mov    $0x0,%al
call   10a0 <printf@plt>
jmp    1808 <main+0x598>
lea    0xe10(%rip),%rdi
call   1060 <puts@plt>
mov    $0x0,%al
call   10f0 <getstr@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1468 <main+0x1f8>
jmp    1828 <main+0x5b8>
mov    -0x20(%rbp),%rdi
call   10d0 <expr@plt>
lea    0xe4a(%rip),%rdi
mov    $0x1,%al
call   10a0 <printf@plt>
mov    -0x20(%rbp),%rdi
call   1040 <free@plt>
jmp    1808 <main+0x598>
lea    0xda7(%rip),%rdi
call   1060 <puts@plt>
lea    0xdda(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1140 <scanf@plt>
mov    -0x8(%rbp),%edi
call   10c0 <iseven@plt>
mov    %eax,%ecx
lea    0xc0d(%rip),%rsi
lea    0xda1(%rip),%rax
cmp    $0x0,%ecx
cmovne %rax,%rsi
lea    0xd66(%rip),%rdi
mov    $0x0,%al
call   10a0 <printf@plt>
jmp    1808 <main+0x598>
lea    0xd85(%rip),%rdi
call   1060 <puts@plt>
lea    0xd84(%rip),%rdi
lea    -0x8(%rbp),%rsi
lea    -0xc(%rbp),%rdx
lea    -0x10(%rbp),%rcx
mov    $0x0,%al
call   1140 <scanf@plt>
mov    -0x8(%rbp),%edi
mov    -0xc(%rbp),%esi
mov    -0x10(%rbp),%edx
call   10b0 <max@plt>
mov    %eax,%esi
lea    0xd67(%rip),%rdi
mov    $0x0,%al
call   10a0 <printf@plt>
jmp    1808 <main+0x598>
lea    0xd5e(%rip),%rdi
call   1060 <puts@plt>
lea    0xd41(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1140 <scanf@plt>
mov    -0x8(%rbp),%edi
call   1160 <tobin@plt>
jmp    1808 <main+0x598>
lea    0xd3c(%rip),%rdi
call   1060 <puts@plt>
lea    0xd16(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1140 <scanf@plt>
mov    -0x8(%rbp),%edi
call   1170 <todec@plt>
mov    %eax,%esi
lea    0xd1c(%rip),%rdi
mov    $0x0,%al
call   10a0 <printf@plt>
jmp    1808 <main+0x598>
lea    0xd19(%rip),%rdi
call   1060 <puts@plt>
lea    0xcdb(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1140 <scanf@plt>
mov    -0x8(%rbp),%edi
call   1030 <oct2bin@plt>
jmp    1808 <main+0x598>
lea    0xccd(%rip),%rdi
call   1060 <puts@plt>
lea    0xcb0(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1140 <scanf@plt>
mov    -0x8(%rbp),%edi
call   1080 <tooct@plt>
jmp    1808 <main+0x598>
movl   $0x2,-0x10(%rbp)
cmpl   $0x64,-0x10(%rbp)
ja     1612 <main+0x3a2>
mov    -0x10(%rbp),%esi
lea    0xcb6(%rip),%rdi
mov    $0x0,%al
call   10a0 <printf@plt>
mov    -0x10(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0x10(%rbp)
jmp    15e9 <main+0x379>
mov    $0xa,%edi
call   1050 <putchar@plt>
jmp    1808 <main+0x598>
lea    0xc13(%rip),%rdi
call   1060 <puts@plt>
lea    0xc46(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1140 <scanf@plt>
mov    -0x8(%rbp),%edi
call   10e0 <table@plt>
jmp    1808 <main+0x598>
lea    0xbe8(%rip),%rdi
call   1060 <puts@plt>
mov    $0x0,%al
call   10f0 <getstr@plt>
mov    %rax,-0x20(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    1673 <main+0x403>
jmp    1828 <main+0x5b8>
mov    -0x20(%rbp),%rdi
call   10d0 <expr@plt>
movaps %xmm0,%xmm1
movsd  0x979(%rip),%xmm0
divsd  %xmm1,%xmm0
lea    0xc25(%rip),%rdi
mov    $0x1,%al
call   10a0 <printf@plt>
mov    -0x20(%rbp),%rdi
call   1040 <free@plt>
jmp    1808 <main+0x598>
lea    0xc1b(%rip),%rdi
call   1060 <puts@plt>
lea    0xbc0(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1140 <scanf@plt>
mov    -0x8(%rbp),%edi
call   1090 <bill@plt>
jmp    1808 <main+0x598>
lea    0xb62(%rip),%rdi
call   1060 <puts@plt>
lea    0xb95(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1140 <scanf@plt>
mov    -0x8(%rbp),%edi
call   1130 <issquare@plt>
mov    %eax,%ecx
lea    0xbf9(%rip),%rsi
lea    0xc66(%rip),%rax
cmp    $0x0,%ecx
cmovne %rax,%rsi
lea    0xbc3(%rip),%rdi
mov    $0x0,%al
call   10a0 <printf@plt>
jmp    1808 <main+0x598>
lea    0xb12(%rip),%rdi
call   1060 <puts@plt>
lea    0xb45(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1140 <scanf@plt>
mov    -0x8(%rbp),%edi
call   1180 <primefac@plt>
jmp    1808 <main+0x598>
lea    0xbab(%rip),%rdi
call   1060 <puts@plt>
lea    0xb1a(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1140 <scanf@plt>
mov    -0x8(%rbp),%edi
call   1190 <fibseq@plt>
jmp    1808 <main+0x598>
lea    0xb94(%rip),%rdi
call   1060 <puts@plt>
lea    0xaef(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1140 <scanf@plt>
mov    -0x8(%rbp),%eax
mov    %eax,-0x2c(%rbp)
mov    -0x8(%rbp),%edi
call   1070 <isleap@plt>
mov    -0x2c(%rbp),%esi
mov    %eax,%ecx
lea    0xb74(%rip),%rdx
lea    0xb71(%rip),%rax
cmp    $0x0,%ecx
cmovne %rax,%rdx
lea    0xb54(%rip),%rdi
mov    $0x0,%al
call   10a0 <printf@plt>
jmp    1808 <main+0x598>
lea    0xb55(%rip),%rdi
call   1060 <puts@plt>
lea    0xa96(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1140 <scanf@plt>
mov    -0x8(%rbp),%edi
call   1120 <floyd@plt>
jmp    1808 <main+0x598>
lea    0xb3a(%rip),%rdi
call   1060 <puts@plt>
mov    $0xa,%edi
call   1050 <putchar@plt>
cmpl   $0x0,-0x14(%rbp)
jne    127f <main+0xf>
movl   $0x0,-0x4(%rbp)
jmp    1844 <main+0x5d4>
mov    0x27b1(%rip),%rax
mov    (%rax),%edi
lea    0xb17(%rip),%rsi
call   1100 <fprintf@plt>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
lea    0xdcf(%rip),%rbp
lea    0xf76(%rip),%r15
lea    0xfe7(%rip),%r12
lea    0x10(%rsp),%r13
lea    0xd69(%rip),%r14
lea    0x100d(%rip),%rbx
jmp    12d5 <main+0x65>
lea    0x108e(%rip),%rdi
call   1060 <puts@plt>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
mov    $0xa,%edi
call   1050 <putchar@plt>
cmpl   $0x0,0x10(%rsp)
je     17c0 <main+0x550>
mov    %rbp,%rdi
call   1060 <puts@plt>
lea    0xd8b(%rip),%rdi
call   1060 <puts@plt>
lea    0xd8a(%rip),%rdi
call   1060 <puts@plt>
lea    0xd93(%rip),%rdi
call   1060 <puts@plt>
lea    0xd9c(%rip),%rdi
call   1060 <puts@plt>
lea    0xdaa(%rip),%rdi
call   1060 <puts@plt>
lea    0xdad(%rip),%rdi
call   1060 <puts@plt>
lea    0xdbc(%rip),%rdi
call   1060 <puts@plt>
lea    0xdc8(%rip),%rdi
call   1060 <puts@plt>
lea    0xdd5(%rip),%rdi
call   1060 <puts@plt>
lea    0xde1(%rip),%rdi
call   1060 <puts@plt>
lea    0xdec(%rip),%rdi
call   1060 <puts@plt>
lea    0xe07(%rip),%rdi
call   1060 <puts@plt>
lea    0xe16(%rip),%rdi
call   1060 <puts@plt>
lea    0xe1b(%rip),%rdi
call   1060 <puts@plt>
lea    0xe26(%rip),%rdi
call   1060 <puts@plt>
lea    0xe2f(%rip),%rdi
call   1060 <puts@plt>
lea    0xe37(%rip),%rdi
call   1060 <puts@plt>
lea    0xe42(%rip),%rdi
call   1060 <puts@plt>
mov    %r15,%rdi
call   1060 <puts@plt>
mov    %r12,%rdi
mov    %r13,%rsi
xor    %eax,%eax
call   1140 <scanf@plt>
mov    0x10(%rsp),%eax
cmp    $0x12,%rax
ja     12a8 <main+0x38>
movslq (%r14,%rax,4),%rax
add    %r14,%rax
jmp    *%rax
lea    0xe31(%rip),%rdi
jmp    12af <main+0x3f>
lea    0xe2a(%rip),%rdi
call   1060 <puts@plt>
xor    %eax,%eax
call   10f0 <getstr@plt>
test   %rax,%rax
je     17d1 <main+0x561>
mov    %rax,%rbp
mov    %rax,%rdi
call   1150 <strrev@plt>
lea    0xe0b(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   10a0 <printf@plt>
jmp    1667 <main+0x3f7>
lea    0xe0a(%rip),%rdi
call   1060 <puts@plt>
mov    %r12,%rdi
lea    0x8(%rsp),%rsi
xor    %eax,%eax
call   1140 <scanf@plt>
mov    0x8(%rsp),%edi
call   1110 <revnum@plt>
lea    0xdee(%rip),%rdi
jmp    1561 <main+0x2f1>
lea    0xdf7(%rip),%rdi
call   1060 <puts@plt>
xor    %eax,%eax
call   10f0 <getstr@plt>
test   %rax,%rax
je     17d1 <main+0x561>
mov    %rax,%rbp
mov    %rax,%rdi
call   10d0 <expr@plt>
lea    0xe3a(%rip),%rdi
jmp    1660 <main+0x3f0>
lea    0xda7(%rip),%rdi
call   1060 <puts@plt>
mov    %r12,%rdi
lea    0x8(%rsp),%rsi
xor    %eax,%eax
call   1140 <scanf@plt>
mov    0x8(%rsp),%edi
call   10c0 <iseven@plt>
test   %eax,%eax
lea    0xdaa(%rip),%rdi
lea    0xc08(%rip),%rax
cmove  %rax,%rdi
jmp    12af <main+0x3f>
lea    0xd98(%rip),%rdi
call   1060 <puts@plt>
lea    0xd97(%rip),%rdi
lea    0x8(%rsp),%rsi
lea    0x14(%rsp),%rdx
lea    0xc(%rsp),%rcx
xor    %eax,%eax
call   1140 <scanf@plt>
mov    0x8(%rsp),%edi
mov    0x14(%rsp),%esi
mov    0xc(%rsp),%edx
call   10b0 <max@plt>
lea    0xd76(%rip),%rdi
jmp    1561 <main+0x2f1>
lea    0xd77(%rip),%rdi
call   1060 <puts@plt>
mov    %r12,%rdi
lea    0x8(%rsp),%rsi
xor    %eax,%eax
call   1140 <scanf@plt>
mov    0x8(%rsp),%edi
call   1160 <tobin@plt>
jmp    12c0 <main+0x50>
lea    0xd57(%rip),%rdi
call   1060 <puts@plt>
mov    %r12,%rdi
lea    0x8(%rsp),%rsi
xor    %eax,%eax
call   1140 <scanf@plt>
mov    0x8(%rsp),%edi
call   1170 <todec@plt>
lea    0xd3b(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   10a0 <printf@plt>
jmp    12c0 <main+0x50>
lea    0xd36(%rip),%rdi
call   1060 <puts@plt>
mov    %r12,%rdi
lea    0x8(%rsp),%rsi
xor    %eax,%eax
call   1140 <scanf@plt>
mov    0x8(%rsp),%edi
call   1030 <oct2bin@plt>
jmp    12c0 <main+0x50>
lea    0xcec(%rip),%rdi
call   1060 <puts@plt>
mov    %r12,%rdi
lea    0x8(%rsp),%rsi
xor    %eax,%eax
call   1140 <scanf@plt>
mov    0x8(%rsp),%edi
call   1080 <tooct@plt>
jmp    12c0 <main+0x50>
movl   $0x2,0xc(%rsp)
mov    $0x2,%esi
xchg   %ax,%ax
mov    %rbx,%rdi
xor    %eax,%eax
call   10a0 <printf@plt>
mov    0xc(%rsp),%esi
add    $0x2,%esi
mov    %esi,0xc(%rsp)
cmp    $0x65,%esi
jb     15d0 <main+0x360>
mov    $0xa,%edi
call   1050 <putchar@plt>
jmp    12c0 <main+0x50>
lea    0xc3b(%rip),%rdi
call   1060 <puts@plt>
mov    %r12,%rdi
lea    0x8(%rsp),%rsi
xor    %eax,%eax
call   1140 <scanf@plt>
mov    0x8(%rsp),%edi
call   10e0 <table@plt>
jmp    12c0 <main+0x50>
lea    0xc12(%rip),%rdi
call   1060 <puts@plt>
xor    %eax,%eax
call   10f0 <getstr@plt>
test   %rax,%rax
je     17d1 <main+0x561>
mov    %rax,%rbp
mov    %rax,%rdi
call   10d0 <expr@plt>
movsd  0x9af(%rip),%xmm1
divsd  %xmm0,%xmm1
lea    0xc5b(%rip),%rdi
movapd %xmm1,%xmm0
mov    $0x1,%al
call   10a0 <printf@plt>
mov    %rbp,%rdi
call   1040 <free@plt>
lea    0x9de(%rip),%rbp
jmp    12c0 <main+0x50>
lea    0xc47(%rip),%rdi
call   1060 <puts@plt>
mov    %r12,%rdi
lea    0x8(%rsp),%rsi
xor    %eax,%eax
call   1140 <scanf@plt>
mov    0x8(%rsp),%edi
call   1090 <bill@plt>
jmp    12c0 <main+0x50>
lea    0xb90(%rip),%rdi
call   1060 <puts@plt>
mov    %r12,%rdi
lea    0x8(%rsp),%rsi
xor    %eax,%eax
call   1140 <scanf@plt>
mov    0x8(%rsp),%edi
call   1130 <issquare@plt>
test   %eax,%eax
lea    0xc9d(%rip),%rsi
lea    0xc22(%rip),%rax
cmove  %rax,%rsi
lea    0xbf6(%rip),%rdi
xor    %eax,%eax
call   10a0 <printf@plt>
jmp    12c0 <main+0x50>
lea    0xb45(%rip),%rdi
call   1060 <puts@plt>
mov    %r12,%rdi
lea    0x8(%rsp),%rsi
xor    %eax,%eax
call   1140 <scanf@plt>
mov    0x8(%rsp),%edi
call   1180 <primefac@plt>
jmp    12c0 <main+0x50>
lea    0xbe0(%rip),%rdi
call   1060 <puts@plt>
mov    %r12,%rdi
lea    0x8(%rsp),%rsi
xor    %eax,%eax
call   1140 <scanf@plt>
mov    0x8(%rsp),%edi
call   1190 <fibseq@plt>
jmp    12c0 <main+0x50>
lea    0xbcb(%rip),%rdi
call   1060 <puts@plt>
mov    %r12,%rdi
lea    0x8(%rsp),%rsi
xor    %eax,%eax
call   1140 <scanf@plt>
mov    0x8(%rsp),%ebp
mov    %ebp,%edi
call   1070 <isleap@plt>
test   %eax,%eax
lea    0xbb8(%rip),%rdx
lea    0xbad(%rip),%rax
cmove  %rax,%rdx
lea    0xb97(%rip),%rdi
mov    %ebp,%esi
lea    0x8c9(%rip),%rbp
xor    %eax,%eax
call   10a0 <printf@plt>
jmp    12c0 <main+0x50>
lea    0xb8f(%rip),%rdi
call   1060 <puts@plt>
mov    %r12,%rdi
lea    0x8(%rsp),%rsi
xor    %eax,%eax
call   1140 <scanf@plt>
mov    0x8(%rsp),%edi
call   1120 <floyd@plt>
jmp    12c0 <main+0x50>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x2808(%rip),%rax
mov    (%rax),%edi
lea    0xb6e(%rip),%rsi
call   1100 <fprintf@plt>
mov    $0x1,%eax
jmp    17c2 <main+0x552>

LLVM IR (-O0):
@.str = [27 x i8] c"What would you like to do?\00"
@.str.1 = [11 x i8] c" ( 0) Exit\00"
@.str.2 = [21 x i8] c" ( 1) Reverse String\00"
@.str.3 = [21 x i8] c" ( 2) Reverse Number\00"
@.str.4 = [26 x i8] c" ( 3) Evaluate Expression\00"
@.str.5 = [15 x i8] c" ( 4) Even/Odd\00"
@.str.6 = [27 x i8] c" ( 5) Maximum of 3 numbers\00"
@.str.7 = [24 x i8] c" ( 6) Decimal to Binary\00"
@.str.8 = [25 x i8] c" ( 7) Binary to Decimal\00"
@.str.9 = [24 x i8] c" ( 8) Octal to Binary\00"
@.str.10 = [23 x i8] c" ( 9) Decimal to Octal\00"
@.str.11 = [39 x i8] c" (10) Print even numbers from 1 to 100\00"
@.str.12 = [27 x i8] c" (11) Multiplication Table\00"
@.str.13 = [17 x i8] c" (12) Reciprocal\00"
@.str.14 = [23 x i8] c" (13) Electricity Bill\00"
@.str.15 = [21 x i8] c" (14) Perfect Square\00"
@.str.16 = [20 x i8] c" (15) Prime Factors\00"
@.str.17 = [23 x i8] c" (16) Fibonacci Series\00"
@.str.18 = [16 x i8] c" (17) Leap Year\00"
@.str.19 = [23 x i8] c" (18) Floyd's Triangle\00"
@.str.20 = [7 x i8] c" %u%*c\00"
@.str.21 = [5 x i8] c"Bye!\00"
@.str.22 = [8 x i8] c"String?\00"
@.str.23 = [21 x i8] c"Reversed String: %s\0A\00"
@.str.24 = [8 x i8] c"Number?\00"
@.str.25 = [21 x i8] c"Reversed Number: %u\0A\00"
@.str.26 = [12 x i8] c"Expression?\00"
@.str.27 = [7 x i8] c"= %lf\0A\00"
@.str.28 = [4 x i8] c"%s\0A\00"
@.str.29 = [5 x i8] c"Even\00"
@.str.30 = [4 x i8] c"Odd\00"
@.str.31 = [11 x i8] c"3 numbers?\00"
@.str.32 = [13 x i8] c" %u %u %u%*c\00"
@.str.33 = [10 x i8] c"max = %u\0A\00"
@.str.34 = [9 x i8] c"Decimal?\00"
@.str.35 = [8 x i8] c"Binary?\00"
@.str.36 = [16 x i8] c"%u in decimal.\0A\00"
@.str.37 = [7 x i8] c"Octal?\00"
@.str.38 = [4 x i8] c"%4u\00"
@.str.39 = [18 x i8] c"Reciprocal = %lf\0A\00"
@.str.40 = [16 x i8] c"Units Consumed?\00"
@.str.41 = [33 x i8] c"The number is %sperfect square.\0A\00"
@.str.42 = [1 x i8] zeroinitializer
@.str.43 = [5 x i8] c"not \00"
@.str.44 = [20 x i8] c"Number of Elements?\00"
@.str.45 = [6 x i8] c"Year?\00"
@.str.46 = [11 x i8] c"%u is %s.\0A\00"
@.str.47 = [5 x i8] c"leap\00"
@.str.48 = [9 x i8] c"not leap\00"
@.str.49 = [16 x i8] c"Number of Rows?\00"
@.str.50 = [18 x i8] c"Incorrect Choice!\00"
@stderr = global i32 0
@.str.51 = [32 x i8] c"Allocation Error!\0ACore Dumped!\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8*
store i32 0, i32* %1
br label %7
7: ; preds = %173, %0
%8 = call i32 @puts(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%9 = call i32 @puts(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%10 = call i32 @puts(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0))
%11 = call i32 @puts(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0))
%12 = call i32 @puts(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.4, i64 0, i64 0))
%13 = call i32 @puts(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0))
%14 = call i32 @puts(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.6, i64 0, i64 0))
%15 = call i32 @puts(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.7, i64 0, i64 0))
%16 = call i32 @puts(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.8, i64 0, i64 0))
%17 = call i32 @puts(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.9, i64 0, i64 0))
%18 = call i32 @puts(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.10, i64 0, i64 0))
%19 = call i32 @puts(i8* getelementptr inbounds ([39 x i8], [39 x i8]* @.str.11, i64 0, i64 0))
%20 = call i32 @puts(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.12, i64 0, i64 0))
%21 = call i32 @puts(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.13, i64 0, i64 0))
%22 = call i32 @puts(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.14, i64 0, i64 0))
%23 = call i32 @puts(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.15, i64 0, i64 0))
%24 = call i32 @puts(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.16, i64 0, i64 0))
%25 = call i32 @puts(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.17, i64 0, i64 0))
%26 = call i32 @puts(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.18, i64 0, i64 0))
%27 = call i32 @puts(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.19, i64 0, i64 0))
%28 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.20, i64 0, i64 0), i32* %5)
%29 = load i32, i32* %5
switch i32 %29, label %169 [
i32 0, label %30
i32 1, label %32
i32 2, label %44
i32 3, label %50
i32 4, label %62
i32 5, label %71
i32 6, label %79
i32 7, label %84
i32 8, label %90
i32 9, label %95
i32 10, label %100
i32 11, label %112
i32 12, label %117
i32 13, label %130
i32 14, label %135
i32 15, label %144
i32 16, label %149
i32 17, label %154
i32 18, label %164
]
30: ; preds = %7
%31 = call i32 @puts(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.21, i64 0, i64 0))
br label %171
32: ; preds = %7
%33 = call i32 @puts(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.22, i64 0, i64 0))
%34 = call i8* (...) @getstr()
store i8* %34, i8** %6
%35 = load i8*, i8** %6
%36 = icmp ne i8* %35, null
br i1 %36, label %38, label %37
37: ; preds = %32
br label %177
38: ; preds = %32
%39 = load i8*, i8** %6
%40 = call i8* @strrev(i8* %39)
%41 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.23, i64 0, i64 0), i8* %40)
%42 = load i8*, i8** %6
%43 = call i32 @free(i8* %42)
br label %171
44: ; preds = %7
%45 = call i32 @puts(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.24, i64 0, i64 0))
%46 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.20, i64 0, i64 0), i32* %2)
%47 = load i32, i32* %2
%48 = call i32 @revnum(i32 %47)
%49 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([21 x i8], [21 x i8]* @.str.25, i64 0, i64 0), i32 %48)
br label %171
50: ; preds = %7
%51 = call i32 @puts(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.26, i64 0, i64 0))
%52 = call i8* (...) @getstr()
store i8* %52, i8** %6
%53 = load i8*, i8** %6
%54 = icmp ne i8* %53, null
br i1 %54, label %56, label %55
55: ; preds = %50
br label %177
56: ; preds = %50
%57 = load i8*, i8** %6
%58 = call double @expr(i8* %57)
%59 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.27, i64 0, i64 0), double %58)
%60 = load i8*, i8** %6
%61 = call i32 @free(i8* %60)
br label %171
62: ; preds = %7
%63 = call i32 @puts(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.24, i64 0, i64 0))
%64 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.20, i64 0, i64 0), i32* %2)
%65 = load i32, i32* %2
%66 = call i32 @iseven(i32 %65)
%67 = icmp ne i32 %66, 0
%68 = zext i1 %67 to i64
%69 = select i1 %67, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.29, i64 0, i64 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.30, i64 0, i64 0)
%70 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.28, i64 0, i64 0), i8* %69)
br label %171
71: ; preds = %7
%72 = call i32 @puts(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.31, i64 0, i64 0))
%73 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.32, i64 0, i64 0), i32* %2, i32* %3, i32* %4)
%74 = load i32, i32* %2
%75 = load i32, i32* %3
%76 = load i32, i32* %4
%77 = call i32 @max(i32 %74, i32 %75, i32 %76)
%78 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.33, i64 0, i64 0), i32 %77)
br label %171
79: ; preds = %7
%80 = call i32 @puts(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.34, i64 0, i64 0))
%81 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.20, i64 0, i64 0), i32* %2)
%82 = load i32, i32* %2
%83 = call i32 @tobin(i32 %82)
br label %171
84: ; preds = %7
%85 = call i32 @puts(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.35, i64 0, i64 0))
%86 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.20, i64 0, i64 0), i32* %2)
%87 = load i32, i32* %2
%88 = call i32 @todec(i32 %87)
%89 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.36, i64 0, i64 0), i32 %88)
br label %171
90: ; preds = %7
%91 = call i32 @puts(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.37, i64 0, i64 0))
%92 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.20, i64 0, i64 0), i32* %2)
%93 = load i32, i32* %2
%94 = call i32 @oct2bin(i32 %93)
br label %171
95: ; preds = %7
%96 = call i32 @puts(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.34, i64 0, i64 0))
%97 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.20, i64 0, i64 0), i32* %2)
%98 = load i32, i32* %2
%99 = call i32 @tooct(i32 %98)
br label %171
100: ; preds = %7
store i32 2, i32* %4
br label %101
101: ; preds = %107, %100
%102 = load i32, i32* %4
%103 = icmp ule i32 %102, 100
br i1 %103, label %104, label %110
104: ; preds = %101
%105 = load i32, i32* %4
%106 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.38, i64 0, i64 0), i32 %105)
br label %107
107: ; preds = %104
%108 = load i32, i32* %4
%109 = add i32 %108, 2
store i32 %109, i32* %4
br label %101
110: ; preds = %101
%111 = call i32 @putchar(i8 signext 10)
br label %171
112: ; preds = %7
%113 = call i32 @puts(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.24, i64 0, i64 0))
%114 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.20, i64 0, i64 0), i32* %2)
%115 = load i32, i32* %2
%116 = call i32 @table(i32 %115)
br label %171
117: ; preds = %7
%118 = call i32 @puts(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.24, i64 0, i64 0))
%119 = call i8* (...) @getstr()
store i8* %119, i8** %6
%120 = load i8*, i8** %6
%121 = icmp ne i8* %120, null
br i1 %121, label %123, label %122
122: ; preds = %117
br label %177
123: ; preds = %117
%124 = load i8*, i8** %6
%125 = call double @expr(i8* %124)
%126 = fdiv double 1.000000e+00, %125
%127 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.39, i64 0, i64 0), double %126)
%128 = load i8*, i8** %6
%129 = call i32 @free(i8* %128)
br label %171
130: ; preds = %7
%131 = call i32 @puts(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.40, i64 0, i64 0))
%132 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.20, i64 0, i64 0), i32* %2)
%133 = load i32, i32* %2
%134 = call i32 @bill(i32 %133)
br label %171
135: ; preds = %7
%136 = call i32 @puts(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.24, i64 0, i64 0))
%137 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.20, i64 0, i64 0), i32* %2)
%138 = load i32, i32* %2
%139 = call i32 @issquare(i32 %138)
%140 = icmp ne i32 %139, 0
%141 = zext i1 %140 to i64
%142 = select i1 %140, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.42, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.43, i64 0, i64 0)
%143 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([33 x i8], [33 x i8]* @.str.41, i64 0, i64 0), i8* %142)
br label %171
144: ; preds = %7
%145 = call i32 @puts(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.24, i64 0, i64 0))
%146 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.20, i64 0, i64 0), i32* %2)
%147 = load i32, i32* %2
%148 = call i32 @primefac(i32 %147)
br label %171
149: ; preds = %7
%150 = call i32 @puts(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.44, i64 0, i64 0))
%151 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.20, i64 0, i64 0), i32* %2)
%152 = load i32, i32* %2
%153 = call i32 @fibseq(i32 %152)
br label %171
154: ; preds = %7
%155 = call i32 @puts(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.45, i64 0, i64 0))
%156 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.20, i64 0, i64 0), i32* %2)
%157 = load i32, i32* %2
%158 = load i32, i32* %2
%159 = call i32 @isleap(i32 %158)
%160 = icmp ne i32 %159, 0
%161 = zext i1 %160 to i64
%162 = select i1 %160, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.47, i64 0, i64 0), i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.48, i64 0, i64 0)
%163 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.46, i64 0, i64 0), i32 %157, i8* %162)
br label %171
164: ; preds = %7
%165 = call i32 @puts(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.49, i64 0, i64 0))
%166 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.20, i64 0, i64 0), i32* %2)
%167 = load i32, i32* %2
%168 = call i32 @floyd(i32 %167)
br label %171
169: ; preds = %7
%170 = call i32 @puts(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.50, i64 0, i64 0))
br label %171
171: ; preds = %169, %164, %154, %149, %144, %135, %130, %123, %112, %110, %95, %90, %84, %79, %71, %62, %56, %44, %38, %30
%172 = call i32 @putchar(i8 signext 10)
br label %173
173: ; preds = %171
%174 = load i32, i32* %5
%175 = icmp ne i32 %174, 0
br i1 %175, label %7, label %176
176: ; preds = %173
store i32 0, i32* %1
br label %180
177: ; preds = %122, %55, %37
%178 = load i32, i32* @stderr
%179 = call i32 @fprintf(i32 %178, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.51, i64 0, i64 0))
store i32 1, i32* %1
br label %180
180: ; preds = %177, %176
%181 = load i32, i32* %1
ret i32 %181
}

LLVM IR (-O2):
@.str = [27 x i8] c"What would you like to do?\00"
@.str.1 = [11 x i8] c" ( 0) Exit\00"
@.str.2 = [21 x i8] c" ( 1) Reverse String\00"
@.str.3 = [21 x i8] c" ( 2) Reverse Number\00"
@.str.4 = [26 x i8] c" ( 3) Evaluate Expression\00"
@.str.5 = [15 x i8] c" ( 4) Even/Odd\00"
@.str.6 = [27 x i8] c" ( 5) Maximum of 3 numbers\00"
@.str.7 = [24 x i8] c" ( 6) Decimal to Binary\00"
@.str.8 = [25 x i8] c" ( 7) Binary to Decimal\00"
@.str.9 = [24 x i8] c" ( 8) Octal to Binary\00"
@.str.10 = [23 x i8] c" ( 9) Decimal to Octal\00"
@.str.11 = [39 x i8] c" (10) Print even numbers from 1 to 100\00"
@.str.12 = [27 x i8] c" (11) Multiplication Table\00"
@.str.13 = [17 x i8] c" (12) Reciprocal\00"
@.str.14 = [23 x i8] c" (13) Electricity Bill\00"
@.str.15 = [21 x i8] c" (14) Perfect Square\00"
@.str.16 = [20 x i8] c" (15) Prime Factors\00"
@.str.17 = [23 x i8] c" (16) Fibonacci Series\00"
@.str.18 = [16 x i8] c" (17) Leap Year\00"
@.str.19 = [23 x i8] c" (18) Floyd's Triangle\00"
@.str.20 = [7 x i8] c" %u%*c\00"
@.str.21 = [5 x i8] c"Bye!\00"
@.str.22 = [8 x i8] c"String?\00"
@.str.23 = [21 x i8] c"Reversed String: %s\0A\00"
@.str.24 = [8 x i8] c"Number?\00"
@.str.25 = [21 x i8] c"Reversed Number: %u\0A\00"
@.str.26 = [12 x i8] c"Expression?\00"
@.str.27 = [7 x i8] c"= %lf\0A\00"
@.str.29 = [5 x i8] c"Even\00"
@.str.30 = [4 x i8] c"Odd\00"
@.str.31 = [11 x i8] c"3 numbers?\00"
@.str.32 = [13 x i8] c" %u %u %u%*c\00"
@.str.33 = [10 x i8] c"max = %u\0A\00"
@.str.34 = [9 x i8] c"Decimal?\00"
@.str.35 = [8 x i8] c"Binary?\00"
@.str.36 = [16 x i8] c"%u in decimal.\0A\00"
@.str.37 = [7 x i8] c"Octal?\00"
@.str.38 = [4 x i8] c"%4u\00"
@.str.39 = [18 x i8] c"Reciprocal = %lf\0A\00"
@.str.40 = [16 x i8] c"Units Consumed?\00"
@.str.41 = [33 x i8] c"The number is %sperfect square.\0A\00"
@.str.42 = [1 x i8] zeroinitializer
@.str.43 = [5 x i8] c"not \00"
@.str.44 = [20 x i8] c"Number of Elements?\00"
@.str.45 = [6 x i8] c"Year?\00"
@.str.46 = [11 x i8] c"%u is %s.\0A\00"
@.str.47 = [5 x i8] c"leap\00"
@.str.48 = [9 x i8] c"not leap\00"
@.str.49 = [16 x i8] c"Number of Rows?\00"
@.str.50 = [18 x i8] c"Incorrect Choice!\00"
@stderr = global i32 0
@.str.51 = [32 x i8] c"Allocation Error!\0ACore Dumped!\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = bitcast i32* %1 to i8*
%6 = bitcast i32* %2 to i8*
%7 = bitcast i32* %3 to i8*
%8 = bitcast i32* %4 to i8*
br label %9
9: ; preds = %154, %0
%10 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0))
%11 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%12 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.2, i64 0, i64 0))
%13 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.3, i64 0, i64 0))
%14 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.4, i64 0, i64 0))
%15 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.5, i64 0, i64 0))
%16 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.6, i64 0, i64 0))
%17 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.7, i64 0, i64 0))
%18 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.8, i64 0, i64 0))
%19 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str.9, i64 0, i64 0))
%20 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.10, i64 0, i64 0))
%21 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([39 x i8], [39 x i8]* @.str.11, i64 0, i64 0))
%22 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.12, i64 0, i64 0))
%23 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.13, i64 0, i64 0))
%24 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.14, i64 0, i64 0))
%25 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.15, i64 0, i64 0))
%26 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.16, i64 0, i64 0))
%27 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.17, i64 0, i64 0))
%28 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.18, i64 0, i64 0))
%29 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([23 x i8], [23 x i8]* @.str.19, i64 0, i64 0))
%30 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.20, i64 0, i64 0), i32* %4)
%31 = load i32, i32* %4
switch i32 %31, label %152 [
i32 0, label %33
i32 1, label %35
i32 2, label %43
i32 3, label %49
i32 4, label %57
i32 5, label %65
i32 6, label %73
i32 7, label %78
i32 8, label %84
i32 9, label %89
i32 10, label %32
i32 11, label %102
i32 12, label %107
i32 13, label %116
i32 14, label %121
i32 15, label %129
i32 16, label %134
i32 17, label %139
i32 18, label %147
]
32: ; preds = %9
store i32 2, i32* %3
br label %94
33: ; preds = %9
%34 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.21, i64 0, i64 0))
br label %154
35: ; preds = %9
%36 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.22, i64 0, i64 0))
%37 = call i8* (...) @getstr()
%38 = icmp eq i8* %37, null
br i1 %38, label %158, label %39
39: ; preds = %35
%40 = call i8* @strrev(i8* %37)
%41 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.23, i64 0, i64 0), i8* %40)
%42 = call i32 @free(i8* %37)
br label %154
43: ; preds = %9
%44 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.24, i64 0, i64 0))
%45 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.20, i64 0, i64 0), i32* %1)
%46 = load i32, i32* %1
%47 = call i32 @revnum(i32 %46)
%48 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([21 x i8], [21 x i8]* @.str.25, i64 0, i64 0), i32 %47)
br label %154
49: ; preds = %9
%50 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.26, i64 0, i64 0))
%51 = call i8* (...) @getstr()
%52 = icmp eq i8* %51, null
br i1 %52, label %158, label %53
53: ; preds = %49
%54 = call double @expr(i8* %51)
%55 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.27, i64 0, i64 0), double %54)
%56 = call i32 @free(i8* %51)
br label %154
57: ; preds = %9
%58 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.24, i64 0, i64 0))
%59 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.20, i64 0, i64 0), i32* %1)
%60 = load i32, i32* %1
%61 = call i32 @iseven(i32 %60)
%62 = icmp eq i32 %61, 0
%63 = select i1 %62, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.30, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.29, i64 0, i64 0)
%64 = call i32 @puts(i8* dereferenceable(1) %63)
br label %154
65: ; preds = %9
%66 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.31, i64 0, i64 0))
%67 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.32, i64 0, i64 0), i32* %1, i32* %2, i32* %3)
%68 = load i32, i32* %1
%69 = load i32, i32* %2
%70 = load i32, i32* %3
%71 = call i32 @max(i32 %68, i32 %69, i32 %70)
%72 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.33, i64 0, i64 0), i32 %71)
br label %154
73: ; preds = %9
%74 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.34, i64 0, i64 0))
%75 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.20, i64 0, i64 0), i32* %1)
%76 = load i32, i32* %1
%77 = call i32 @tobin(i32 %76)
br label %154
78: ; preds = %9
%79 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.35, i64 0, i64 0))
%80 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.20, i64 0, i64 0), i32* %1)
%81 = load i32, i32* %1
%82 = call i32 @todec(i32 %81)
%83 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.36, i64 0, i64 0), i32 %82)
br label %154
84: ; preds = %9
%85 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @.str.37, i64 0, i64 0))
%86 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.20, i64 0, i64 0), i32* %1)
%87 = load i32, i32* %1
%88 = call i32 @oct2bin(i32 %87)
br label %154
89: ; preds = %9
%90 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([9 x i8], [9 x i8]* @.str.34, i64 0, i64 0))
%91 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.20, i64 0, i64 0), i32* %1)
%92 = load i32, i32* %1
%93 = call i32 @tooct(i32 %92)
br label %154
94: ; preds = %32, %94
%95 = phi i32 [ 2, %32 ], [ %98, %94 ]
%96 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.38, i64 0, i64 0), i32 %95)
%97 = load i32, i32* %3
%98 = add i32 %97, 2
store i32 %98, i32* %3
%99 = icmp ult i32 %98, 101
br i1 %99, label %94, label %100
100: ; preds = %94
%101 = call i32 @putchar(i8 signext 10)
br label %154
102: ; preds = %9
%103 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.24, i64 0, i64 0))
%104 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.20, i64 0, i64 0), i32* %1)
%105 = load i32, i32* %1
%106 = call i32 @table(i32 %105)
br label %154
107: ; preds = %9
%108 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.24, i64 0, i64 0))
%109 = call i8* (...) @getstr()
%110 = icmp eq i8* %109, null
br i1 %110, label %158, label %111
111: ; preds = %107
%112 = call double @expr(i8* %109)
%113 = fdiv double 1.000000e+00, %112
%114 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.39, i64 0, i64 0), double %113)
%115 = call i32 @free(i8* %109)
br label %154
116: ; preds = %9
%117 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.40, i64 0, i64 0))
%118 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.20, i64 0, i64 0), i32* %1)
%119 = load i32, i32* %1
%120 = call i32 @bill(i32 %119)
br label %154
121: ; preds = %9
%122 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.24, i64 0, i64 0))
%123 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.20, i64 0, i64 0), i32* %1)
%124 = load i32, i32* %1
%125 = call i32 @issquare(i32 %124)
%126 = icmp eq i32 %125, 0
%127 = select i1 %126, i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.43, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.42, i64 0, i64 0)
%128 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([33 x i8], [33 x i8]* @.str.41, i64 0, i64 0), i8* %127)
br label %154
129: ; preds = %9
%130 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.24, i64 0, i64 0))
%131 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.20, i64 0, i64 0), i32* %1)
%132 = load i32, i32* %1
%133 = call i32 @primefac(i32 %132)
br label %154
134: ; preds = %9
%135 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.44, i64 0, i64 0))
%136 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.20, i64 0, i64 0), i32* %1)
%137 = load i32, i32* %1
%138 = call i32 @fibseq(i32 %137)
br label %154
139: ; preds = %9
%140 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.45, i64 0, i64 0))
%141 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.20, i64 0, i64 0), i32* %1)
%142 = load i32, i32* %1
%143 = call i32 @isleap(i32 %142)
%144 = icmp eq i32 %143, 0
%145 = select i1 %144, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.48, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.47, i64 0, i64 0)
%146 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.46, i64 0, i64 0), i32 %142, i8* %145)
br label %154
147: ; preds = %9
%148 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.49, i64 0, i64 0))
%149 = call i32 (i8*, i32*, ...) @scanf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.20, i64 0, i64 0), i32* %1)
%150 = load i32, i32* %1
%151 = call i32 @floyd(i32 %150)
br label %154
152: ; preds = %9
%153 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.50, i64 0, i64 0))
br label %154
154: ; preds = %152, %147, %139, %134, %129, %121, %116, %111, %102, %100, %89, %84, %78, %73, %65, %57, %53, %43, %39, %33
%155 = call i32 @putchar(i8 signext 10)
%156 = load i32, i32* %4
%157 = icmp eq i32 %156, 0
br i1 %157, label %161, label %9
158: ; preds = %107, %49, %35
%159 = load i32, i32* @stderr
%160 = call i32 @fprintf(i32 %159, i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.51, i64 0, i64 0))
br label %161
161: ; preds = %154, %158
%162 = phi i32 [ 1, %158 ], [ 0, %154 ]
ret i32 %162
}