#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*/ clrscr();
char *decimal_hex(int, char *);
int decimal_octal(int);
int /*<<< orphan*/ getch();
int hex_decimal(char *);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, ...);
char *toBinary(int);
int toDecimal(char *);
int /*<<< orphan*/ validBinaryString(char *);
int main() {
  int decimal, oct;
  unsigned int choice, ch;
  char bin[100], hex[20];
  do {
    clrscr();
    printf(" Input Type ? \n1. Decimal\n2. Binary\n3. Octal\n4. "
           "Hexadecimal\n5. Exit\n Choice: ");
    scanf("%d", &choice);
    switch (choice) {
    case 1:
      printf("Decimal\t\t= ");
      scanf("%d", &decimal);
      printf("Binary\t\t= %s", toBinary(decimal));
      printf("\nOctal\t\t= %d", decimal_octal(decimal));
      printf("\nHexadecimal\t= %s", decimal_hex(decimal, hex));
      break;
    case 2:
      printf("Binary\t\t= ");
      scanf("%s", bin);
      if (!validBinaryString(bin)) {
        printf("Invalid binary string\n");
      }
      printf("Decimal\t\t= %d", toDecimal(bin));
      printf("\nOctal\t\t= %o", toDecimal(bin));
      printf("\nHexadecimal\t= %s", decimal_hex(toDecimal(bin), hex));
      break;
    case 3:
      printf("Octal\t\t= ");
      scanf("%o", &oct);
      printf("Binary\t\t= %s", toBinary(oct));
      printf("\nDecimal\t\t= %d", oct);
      printf("\nHexadecimal\t= %x", oct);
      break;
    case 4:
      printf("Hexadecimal\t= ");
      scanf("%s", hex);
      printf("Binary\t\t= %s", toBinary(hex_decimal(hex)));
      printf("\nDecimal\t\t= %d", hex_decimal(hex));
      printf("\nOctal\t\t= %o", hex_decimal(hex));
      break;
    case 5:
      printf("Press any key to exit...");
      getch();
      return 0;
    default:
      printf("Wrong Input !");
      ch = 1;
    }
    printf("\nConvert Again ? (yes-1 / no-0)");
    scanf("%d", &ch);
  } while (ch == 1);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xb0,%rsp
movl   $0x0,-0x4(%rbp)
xor    %eax,%eax
mov    %al,-0xa9(%rbp)
call   1030 <clrscr@plt>
mov    -0xa9(%rbp),%al
lea    0xe48(%rip),%rdi
call   1060 <printf@plt>
mov    -0xa9(%rbp),%al
lea    0xf01(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   10a0 <scanf@plt>
mov    -0x10(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,%ecx
mov    %rcx,-0xa8(%rbp)
sub    $0x4,%eax
ja     1430 <main+0x290>
mov    -0xa8(%rbp),%rax
lea    0xdf3(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xe45(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xeb4(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   10a0 <scanf@plt>
mov    -0x8(%rbp),%edi
call   1090 <toBinary@plt>
mov    %rax,%rsi
lea    0xe26(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x8(%rbp),%edi
call   1080 <decimal_octal@plt>
mov    %eax,%esi
lea    0xe1b(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0x8(%rbp),%edi
lea    -0xa0(%rbp),%rsi
call   10c0 <decimal_hex@plt>
mov    %rax,%rsi
lea    0xe08(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
jmp    1445 <main+0x2a5>
lea    0xe07(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    -0x80(%rbp),%rsi
lea    0xdd3(%rip),%rdi
mov    $0x0,%al
call   10a0 <scanf@plt>
lea    -0x80(%rbp),%rdi
call   1040 <validBinaryString@plt>
cmp    $0x0,%eax
jne    12cc <main+0x12c>
lea    0xde0(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    -0x80(%rbp),%rdi
call   1070 <toDecimal@plt>
mov    %eax,%esi
lea    0xdf6(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    -0x80(%rbp),%rdi
call   1070 <toDecimal@plt>
mov    %eax,%esi
lea    0xdc5(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    -0x80(%rbp),%rdi
call   1070 <toDecimal@plt>
mov    %eax,%edi
lea    -0xa0(%rbp),%rsi
call   10c0 <decimal_hex@plt>
mov    %rax,%rsi
lea    0xd69(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
jmp    1445 <main+0x2a5>
lea    0xd97(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xd86(%rip),%rdi
lea    -0xc(%rbp),%rsi
mov    $0x0,%al
call   10a0 <scanf@plt>
mov    -0xc(%rbp),%edi
call   1090 <toBinary@plt>
mov    %rax,%rsi
lea    0xd11(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0xc(%rbp),%esi
lea    0xd65(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    -0xc(%rbp),%esi
lea    0xd63(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
jmp    1445 <main+0x2a5>
lea    0xd62(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    -0xa0(%rbp),%rsi
lea    0xcd1(%rip),%rdi
mov    $0x0,%al
call   10a0 <scanf@plt>
lea    -0xa0(%rbp),%rdi
call   1050 <hex_decimal@plt>
mov    %eax,%edi
call   1090 <toBinary@plt>
mov    %rax,%rsi
lea    0xca3(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    -0xa0(%rbp),%rdi
call   1050 <hex_decimal@plt>
mov    %eax,%esi
lea    0xcec(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    -0xa0(%rbp),%rdi
call   1050 <hex_decimal@plt>
mov    %eax,%esi
lea    0xcb9(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
jmp    1445 <main+0x2a5>
lea    0xced(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
mov    $0x0,%al
call   10b0 <getch@plt>
movl   $0x0,-0x4(%rbp)
jmp    1476 <main+0x2d6>
lea    0xce5(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
movl   $0x1,-0x14(%rbp)
lea    0xcde(%rip),%rdi
mov    $0x0,%al
call   1060 <printf@plt>
lea    0xc85(%rip),%rdi
lea    -0x14(%rbp),%rsi
mov    $0x0,%al
call   10a0 <scanf@plt>
cmpl   $0x1,-0x14(%rbp)
je     11b2 <main+0x12>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0xb0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x98,%rsp
lea    0xf00(%rip),%rbx
lea    0xf44(%rip),%r13
lea    0x8(%rsp),%rbp
lea    0xe25(%rip),%r15
lea    0x10(%rsp),%r12
lea    0x30(%rsp),%r14
jmp    1222 <main+0x72>
lea    0xf17(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
movl   $0x1,0x8(%rsp)
nopl   (%rax)
mov    %r13,%rdi
xor    %eax,%eax
call   1070 <printf@plt>
mov    %rbx,%rdi
mov    %rbp,%rsi
xor    %eax,%eax
call   10b0 <scanf@plt>
cmpl   $0x1,0x8(%rsp)
jne    141e <main+0x26e>
xor    %eax,%eax
call   1030 <clrscr@plt>
lea    0xde4(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
mov    %rbx,%rdi
lea    0xc(%rsp),%rsi
xor    %eax,%eax
call   10b0 <scanf@plt>
mov    0xc(%rsp),%eax
add    $0xffffffff,%eax
cmp    $0x4,%eax
ja     11e7 <main+0x37>
movslq (%r15,%rax,4),%rax
add    %r15,%rax
jmp    *%rax
lea    0xe00(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
mov    %rbx,%rdi
lea    0x4(%rsp),%rsi
xor    %eax,%eax
call   10b0 <scanf@plt>
mov    0x4(%rsp),%edi
call   10a0 <toBinary@plt>
lea    0xde6(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1070 <printf@plt>
mov    0x4(%rsp),%edi
call   1090 <decimal_octal@plt>
lea    0xdd9(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1070 <printf@plt>
mov    0x4(%rsp),%edi
jmp    1322 <main+0x172>
lea    0xde2(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
lea    0xdb2(%rip),%rdi
mov    %r14,%rsi
xor    %eax,%eax
call   10b0 <scanf@plt>
mov    %r14,%rdi
call   1040 <validBinaryString@plt>
test   %eax,%eax
jne    12e8 <main+0x138>
lea    0xe50(%rip),%rdi
call   1050 <puts@plt>
mov    %r14,%rdi
call   1080 <toDecimal@plt>
lea    0xdc6(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1070 <printf@plt>
mov    %r14,%rdi
call   1080 <toDecimal@plt>
lea    0xd96(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1070 <printf@plt>
mov    %r14,%rdi
call   1080 <toDecimal@plt>
mov    %eax,%edi
mov    %r12,%rsi
call   10d0 <decimal_hex@plt>
lea    0xd57(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1070 <printf@plt>
jmp    1200 <main+0x50>
lea    0xd6b(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
lea    0xd5a(%rip),%rdi
mov    %rsp,%rsi
xor    %eax,%eax
call   10b0 <scanf@plt>
mov    (%rsp),%edi
call   10a0 <toBinary@plt>
lea    0xd00(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1070 <printf@plt>
mov    (%rsp),%esi
lea    0xd3a(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
mov    (%rsp),%esi
lea    0xd38(%rip),%rdi
jmp    13fd <main+0x24d>
lea    0xd41(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
lea    0xcce(%rip),%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   10b0 <scanf@plt>
mov    %r12,%rdi
call   1060 <hex_decimal@plt>
mov    %eax,%edi
call   10a0 <toBinary@plt>
lea    0xca4(%rip),%rdi
mov    %rax,%rsi
xor    %eax,%eax
call   1070 <printf@plt>
mov    %r12,%rdi
call   1060 <hex_decimal@plt>
lea    0xcd9(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1070 <printf@plt>
mov    %r12,%rdi
call   1060 <hex_decimal@plt>
lea    0xcaa(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1070 <printf@plt>
jmp    1200 <main+0x50>
lea    0xcdc(%rip),%rdi
xor    %eax,%eax
call   1070 <printf@plt>
xor    %eax,%eax
call   10c0 <getch@plt>
xor    %eax,%eax
add    $0x98,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [78 x i8] c" Input Type ? \0A1. Decimal\0A2. Binary\0A3. Octal\0A4. Hexadecimal\0A5. Exit\0A Choice: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [12 x i8] c"Decimal\09\09= \00"
@.str.3 = [13 x i8] c"Binary\09\09= %s\00"
@.str.4 = [13 x i8] c"\0AOctal\09\09= %d\00"
@.str.5 = [18 x i8] c"\0AHexadecimal\09= %s\00"
@.str.6 = [11 x i8] c"Binary\09\09= \00"
@.str.7 = [3 x i8] c"%s\00"
@.str.8 = [23 x i8] c"Invalid binary string\0A\00"
@.str.9 = [14 x i8] c"Decimal\09\09= %d\00"
@.str.10 = [13 x i8] c"\0AOctal\09\09= %o\00"
@.str.11 = [10 x i8] c"Octal\09\09= \00"
@.str.12 = [3 x i8] c"%o\00"
@.str.13 = [15 x i8] c"\0ADecimal\09\09= %d\00"
@.str.14 = [18 x i8] c"\0AHexadecimal\09= %x\00"
@.str.15 = [15 x i8] c"Hexadecimal\09= \00"
@.str.16 = [25 x i8] c"Press any key to exit...\00"
@.str.17 = [14 x i8] c"Wrong Input !\00"
@.str.18 = [32 x i8] c"\0AConvert Again ? (yes-1 / no-0)\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca i32
%6 = alloca [100 x i8]
%7 = alloca [20 x i8]
store i32 0, i32* %1
br label %8
8: ; preds = %79, %0
%9 = call i32 (...) @clrscr()
%10 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([78 x i8], [78 x i8]* @.str, i64 0, i64 0))
%11 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %4)
%12 = load i32, i32* %4
switch i32 %12, label %74 [
i32 1, label %13
i32 2, label %26
i32 3, label %47
i32 4, label %57
i32 5, label %71
]
13: ; preds = %8
%14 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
%15 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%16 = load i32, i32* %2
%17 = call i8* @toBinary(i32 %16)
%18 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), i8* %17)
%19 = load i32, i32* %2
%20 = call i32 @decimal_octal(i32 %19)
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0), i32 %20)
%22 = load i32, i32* %2
%23 = getelementptr inbounds [20 x i8], [20 x i8]* %7, i64 0, i64 0
%24 = call i8* @decimal_hex(i32 %22, i8* %23)
%25 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.5, i64 0, i64 0), i8* %24)
br label %76
26: ; preds = %8
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.6, i64 0, i64 0))
%28 = getelementptr inbounds [100 x i8], [100 x i8]* %6, i64 0, i64 0
%29 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i8* %28)
%30 = getelementptr inbounds [100 x i8], [100 x i8]* %6, i64 0, i64 0
%31 = call i32 @validBinaryString(i8* %30)
%32 = icmp ne i32 %31, 0
br i1 %32, label %35, label %33
33: ; preds = %26
%34 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([23 x i8], [23 x i8]* @.str.8, i64 0, i64 0))
br label %35
35: ; preds = %33, %26
%36 = getelementptr inbounds [100 x i8], [100 x i8]* %6, i64 0, i64 0
%37 = call i32 @toDecimal(i8* %36)
%38 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.9, i64 0, i64 0), i32 %37)
%39 = getelementptr inbounds [100 x i8], [100 x i8]* %6, i64 0, i64 0
%40 = call i32 @toDecimal(i8* %39)
%41 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.10, i64 0, i64 0), i32 %40)
%42 = getelementptr inbounds [100 x i8], [100 x i8]* %6, i64 0, i64 0
%43 = call i32 @toDecimal(i8* %42)
%44 = getelementptr inbounds [20 x i8], [20 x i8]* %7, i64 0, i64 0
%45 = call i8* @decimal_hex(i32 %43, i8* %44)
%46 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.5, i64 0, i64 0), i8* %45)
br label %76
47: ; preds = %8
%48 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.11, i64 0, i64 0))
%49 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.12, i64 0, i64 0), i32* %3)
%50 = load i32, i32* %3
%51 = call i8* @toBinary(i32 %50)
%52 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), i8* %51)
%53 = load i32, i32* %3
%54 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.13, i64 0, i64 0), i32 %53)
%55 = load i32, i32* %3
%56 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([18 x i8], [18 x i8]* @.str.14, i64 0, i64 0), i32 %55)
br label %76
57: ; preds = %8
%58 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.15, i64 0, i64 0))
%59 = getelementptr inbounds [20 x i8], [20 x i8]* %7, i64 0, i64 0
%60 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i8* %59)
%61 = getelementptr inbounds [20 x i8], [20 x i8]* %7, i64 0, i64 0
%62 = call i32 @hex_decimal(i8* %61)
%63 = call i8* @toBinary(i32 %62)
%64 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), i8* %63)
%65 = getelementptr inbounds [20 x i8], [20 x i8]* %7, i64 0, i64 0
%66 = call i32 @hex_decimal(i8* %65)
%67 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.13, i64 0, i64 0), i32 %66)
%68 = getelementptr inbounds [20 x i8], [20 x i8]* %7, i64 0, i64 0
%69 = call i32 @hex_decimal(i8* %68)
%70 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str.10, i64 0, i64 0), i32 %69)
br label %76
71: ; preds = %8
%72 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str.16, i64 0, i64 0))
%73 = call i32 (...) @getch()
store i32 0, i32* %1
br label %83
74: ; preds = %8
%75 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.17, i64 0, i64 0))
store i32 1, i32* %5
br label %76
76: ; preds = %74, %57, %47, %35, %13
%77 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.18, i64 0, i64 0))
%78 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %5)
br label %79
79: ; preds = %76
%80 = load i32, i32* %5
%81 = icmp eq i32 %80, 1
br i1 %81, label %8, label %82
82: ; preds = %79
store i32 0, i32* %1
br label %83
83: ; preds = %82, %71
%84 = load i32, i32* %1
ret i32 %84
}

LLVM IR (-O2):
@.str = [78 x i8] c" Input Type ? \0A1. Decimal\0A2. Binary\0A3. Octal\0A4. Hexadecimal\0A5. Exit\0A Choice: \00"
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [12 x i8] c"Decimal\09\09= \00"
@.str.3 = [13 x i8] c"Binary\09\09= %s\00"
@.str.4 = [13 x i8] c"\0AOctal\09\09= %d\00"
@.str.5 = [18 x i8] c"\0AHexadecimal\09= %s\00"
@.str.6 = [11 x i8] c"Binary\09\09= \00"
@.str.7 = [3 x i8] c"%s\00"
@.str.9 = [14 x i8] c"Decimal\09\09= %d\00"
@.str.10 = [13 x i8] c"\0AOctal\09\09= %o\00"
@.str.11 = [10 x i8] c"Octal\09\09= \00"
@.str.12 = [3 x i8] c"%o\00"
@.str.13 = [15 x i8] c"\0ADecimal\09\09= %d\00"
@.str.14 = [18 x i8] c"\0AHexadecimal\09= %x\00"
@.str.15 = [15 x i8] c"Hexadecimal\09= \00"
@.str.16 = [25 x i8] c"Press any key to exit...\00"
@.str.17 = [14 x i8] c"Wrong Input !\00"
@.str.18 = [32 x i8] c"\0AConvert Again ? (yes-1 / no-0)\00"
@str = [22 x i8] c"Invalid binary string\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i32
%4 = alloca i32
%5 = alloca [100 x i8]
%6 = alloca [20 x i8]
%7 = bitcast i32* %1 to i8*
%8 = bitcast i32* %2 to i8*
%9 = bitcast i32* %3 to i8*
%10 = bitcast i32* %4 to i8*
%11 = getelementptr inbounds [100 x i8], [100 x i8]* %5, i64 0, i64 0
%12 = getelementptr inbounds [20 x i8], [20 x i8]* %6, i64 0, i64 0
br label %13
13: ; preds = %70, %0
%14 = call i32 (...) @clrscr()
%15 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([78 x i8], [78 x i8]* @.str, i64 0, i64 0))
%16 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%17 = load i32, i32* %3
switch i32 %17, label %68 [
i32 1, label %18
i32 2, label %30
i32 3, label %45
i32 4, label %55
i32 5, label %65
]
18: ; preds = %13
%19 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([12 x i8], [12 x i8]* @.str.2, i64 0, i64 0))
%20 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%21 = load i32, i32* %1
%22 = call i8* @toBinary(i32 %21)
%23 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), i8* %22)
%24 = load i32, i32* %1
%25 = call i32 @decimal_octal(i32 %24)
%26 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.4, i64 0, i64 0), i32 %25)
%27 = load i32, i32* %1
%28 = call i8* @decimal_hex(i32 %27, i8* %12)
%29 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.5, i64 0, i64 0), i8* %28)
br label %70
30: ; preds = %13
%31 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @.str.6, i64 0, i64 0))
%32 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i8* %11)
%33 = call i32 @validBinaryString(i8* %11)
%34 = icmp eq i32 %33, 0
br i1 %34, label %35, label %37
35: ; preds = %30
%36 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([22 x i8], [22 x i8]* @str, i64 0, i64 0))
br label %37
37: ; preds = %35, %30
%38 = call i32 @toDecimal(i8* %11)
%39 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.9, i64 0, i64 0), i32 %38)
%40 = call i32 @toDecimal(i8* %11)
%41 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.10, i64 0, i64 0), i32 %40)
%42 = call i32 @toDecimal(i8* %11)
%43 = call i8* @decimal_hex(i32 %42, i8* %12)
%44 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.5, i64 0, i64 0), i8* %43)
br label %70
45: ; preds = %13
%46 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([10 x i8], [10 x i8]* @.str.11, i64 0, i64 0))
%47 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.12, i64 0, i64 0), i32* %2)
%48 = load i32, i32* %2
%49 = call i8* @toBinary(i32 %48)
%50 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), i8* %49)
%51 = load i32, i32* %2
%52 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.13, i64 0, i64 0), i32 %51)
%53 = load i32, i32* %2
%54 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([18 x i8], [18 x i8]* @.str.14, i64 0, i64 0), i32 %53)
br label %70
55: ; preds = %13
%56 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.15, i64 0, i64 0))
%57 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i64 0, i64 0), i8* %12)
%58 = call i32 @hex_decimal(i8* %12)
%59 = call i8* @toBinary(i32 %58)
%60 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.3, i64 0, i64 0), i8* %59)
%61 = call i32 @hex_decimal(i8* %12)
%62 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([15 x i8], [15 x i8]* @.str.13, i64 0, i64 0), i32 %61)
%63 = call i32 @hex_decimal(i8* %12)
%64 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([13 x i8], [13 x i8]* @.str.10, i64 0, i64 0), i32 %63)
br label %70
65: ; preds = %13
%66 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([25 x i8], [25 x i8]* @.str.16, i64 0, i64 0))
%67 = call i32 (...) @getch()
br label %75
68: ; preds = %13
%69 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.17, i64 0, i64 0))
store i32 1, i32* %4
br label %70
70: ; preds = %68, %55, %45, %37, %18
%71 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.18, i64 0, i64 0))
%72 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32* %4)
%73 = load i32, i32* %4
%74 = icmp eq i32 %73, 1
br i1 %74, label %13, label %75
75: ; preds = %70, %65
ret i32 0
}