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

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, ...);
int main() {
  char a;
  char b;
  char c;
  char d;
  char e;
  char f;
  int k = 0;
  while (k == 0) {
    int i = 0;
    char str[32];
    int bin = 0;
    int j = 0;
    printf("Base of input integer: Enter b 	for binary, d for decimal, h "
           "for hexadecimal and o for octal: \n");
    scanf("%c", &a);
    scanf("%c", &d);
    printf("Enter the number: \n");
    if (a == 'b') {
      scanf("%s", &str);
      scanf("%c", &d);
      while (str[j] != '\0') {
        bin = bin * 2 + str[j] - '0';
        j++;
      }
    } else if (a == 'd') {
      scanf("%d", &i);
      scanf("%c", &d);
    } else if (a == 'h') {
      scanf("%x", &i);
      scanf("%c", &d);
    } else if (a == 'o') {
      scanf("%o", &i);
      scanf("%c", &d);
    } else {
      printf("Error1\n");
    }
    printf("Enter the base of the output(d, h or o): ");
    scanf("%c", &e);
    scanf("%c", &d);
    if (a == 'b') {
      printf("The integer %s in binary is ", str);
    } else if (a == 'd') {
      printf("The integer %d in decimal is ", i);
    } else if (a == 'h') {
      printf("The integer %x in hexadecimal is ", i);
    } else if (a == 'o') {
      printf("The integer %o in octal is ", i);
    } else {
      printf("Error2\n");
    }
    if (e == 'd') {
      if (a == 'b') {
        printf("%d in decimal.\n", bin);
      } else {
        printf("%d in decimal.\n", i);
      }
    } else if (e == 'h') {
      if (a == 'b') {
        printf("%x in hexadecimal.\n", bin);
      } else {
        printf("%x in hexadecimal.\n", i);
      }
    } else if (e == 'o') {
      if (a == 'b') {
        printf("%o in octal.\n", bin);
      } else {
        printf("%o in octal.\n", i);
      }
    } else {
      printf("Error3\n");
    }
    printf("Do you wish to do another? (Y or N): ");
    scanf("%c", &f);
    scanf("%c", &d);
    if (f != 'Y') {
      k = 1;
    }
  }
  printf("Thank you, have a nice day.\n\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x0,-0x10(%rbp)
jne    14d2 <main+0x3b2>
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x44(%rbp)
movl   $0x0,-0x48(%rbp)
lea    0xea4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xef6(%rip),%rdi
lea    -0x5(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xee4(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xed5(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movsbl -0x5(%rbp),%eax
cmp    $0x62,%eax
jne    1202 <main+0xe2>
lea    0xece(%rip),%rdi
lea    -0x40(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xea5(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
movslq -0x48(%rbp),%rax
movsbl -0x40(%rbp,%rax,1),%eax
cmp    $0x0,%eax
je     11fd <main+0xdd>
mov    -0x44(%rbp),%eax
shl    $0x1,%eax
movslq -0x48(%rbp),%rcx
movsbl -0x40(%rbp,%rcx,1),%ecx
add    %ecx,%eax
sub    $0x30,%eax
mov    %eax,-0x44(%rbp)
mov    -0x48(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x48(%rbp)
jmp    11c6 <main+0xa6>
jmp    12c1 <main+0x1a1>
movsbl -0x5(%rbp),%eax
cmp    $0x64,%eax
jne    1238 <main+0x118>
lea    0xe64(%rip),%rdi
lea    -0x14(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xe38(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
jmp    12bc <main+0x19c>
movsbl -0x5(%rbp),%eax
cmp    $0x68,%eax
jne    126e <main+0x14e>
lea    0xe31(%rip),%rdi
lea    -0x14(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xe02(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
jmp    12b7 <main+0x197>
movsbl -0x5(%rbp),%eax
cmp    $0x6f,%eax
jne    12a4 <main+0x184>
lea    0xdfe(%rip),%rdi
lea    -0x14(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xdcc(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
jmp    12b2 <main+0x192>
lea    0xdd8(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    12b7 <main+0x197>
jmp    12bc <main+0x19c>
jmp    12c1 <main+0x1a1>
lea    0xdc3(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xd8a(%rip),%rdi
lea    -0x9(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xd78(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
movsbl -0x5(%rbp),%eax
cmp    $0x62,%eax
jne    1317 <main+0x1f7>
lea    -0x40(%rbp),%rsi
lea    0xdaa(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    139d <main+0x27d>
movsbl -0x5(%rbp),%eax
cmp    $0x64,%eax
jne    133a <main+0x21a>
mov    -0x14(%rbp),%esi
lea    0xda4(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1398 <main+0x278>
movsbl -0x5(%rbp),%eax
cmp    $0x68,%eax
jne    135d <main+0x23d>
mov    -0x14(%rbp),%esi
lea    0xd9f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1393 <main+0x273>
movsbl -0x5(%rbp),%eax
cmp    $0x6f,%eax
jne    1380 <main+0x260>
mov    -0x14(%rbp),%esi
lea    0xd9e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    138e <main+0x26e>
lea    0xda7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1393 <main+0x273>
jmp    1398 <main+0x278>
jmp    139d <main+0x27d>
movsbl -0x9(%rbp),%eax
cmp    $0x64,%eax
jne    13e3 <main+0x2c3>
movsbl -0x5(%rbp),%eax
cmp    $0x62,%eax
jne    13cd <main+0x2ad>
mov    -0x44(%rbp),%esi
lea    0xd75(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    13de <main+0x2be>
mov    -0x14(%rbp),%esi
lea    0xd5f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1487 <main+0x367>
movsbl -0x9(%rbp),%eax
cmp    $0x68,%eax
jne    1429 <main+0x309>
movsbl -0x5(%rbp),%eax
cmp    $0x62,%eax
jne    1413 <main+0x2f3>
mov    -0x44(%rbp),%esi
lea    0xd3f(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1424 <main+0x304>
mov    -0x14(%rbp),%esi
lea    0xd29(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1482 <main+0x362>
movsbl -0x9(%rbp),%eax
cmp    $0x6f,%eax
jne    146f <main+0x34f>
movsbl -0x5(%rbp),%eax
cmp    $0x62,%eax
jne    1459 <main+0x339>
mov    -0x44(%rbp),%esi
lea    0xd0d(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    146a <main+0x34a>
mov    -0x14(%rbp),%esi
lea    0xcf7(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    147d <main+0x35d>
lea    0xcf2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1482 <main+0x362>
jmp    1487 <main+0x367>
lea    0xce2(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xbc4(%rip),%rdi
lea    -0xa(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
lea    0xbb2(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
movsbl -0xa(%rbp),%eax
cmp    $0x59,%eax
je     14cd <main+0x3ad>
movl   $0x1,-0x10(%rbp)
jmp    1136 <main+0x16>
lea    0xcbd(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x38,%rsp
lea    0xf2b(%rip),%rbx
lea    0xf(%rsp),%r12
lea    0xd(%rsp),%r13
lea    0xee2(%rip),%r14
lea    0xea3(%rip),%r15
jmp    11a2 <main+0x72>
lea    0xfcc(%rip),%rdi
mov    %ebp,%esi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xfde(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
mov    %r13,%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
mov    %rbx,%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
cmpb   $0x59,0xd(%rsp)
jne    13e1 <main+0x2b1>
movl   $0x0,0x8(%rsp)
lea    0xfe6(%rip),%rdi
call   1030 <puts@plt>
mov    %rbx,%rdi
lea    0x7(%rsp),%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
mov    %rbx,%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
lea    0x101d(%rip),%rdi
call   1030 <puts@plt>
mov    0x7(%rsp),%al
add    $0x9e,%al
cmp    $0xd,%al
ja     1250 <main+0x120>
movzbl %al,%eax
movslq (%r15,%rax,4),%rax
add    %r15,%rax
jmp    *%rax
xor    %ebp,%ebp
lea    0xe76(%rip),%rdi
lea    0x10(%rsp),%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
mov    %rbx,%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
mov    0x10(%rsp),%al
test   %al,%al
je     12a2 <main+0x172>
xor    %ebp,%ebp
lea    0x11(%rsp),%rcx
nopl   0x0(%rax)
movsbl %al,%eax
lea    (%rax,%rbp,2),%ebp
add    $0xffffffd0,%ebp
movzbl (%rcx),%eax
add    $0x1,%rcx
test   %al,%al
jne    1230 <main+0x100>
jmp    12a2 <main+0x172>
cs nopw 0x0(%rax,%rax,1)
lea    0xfb2(%rip),%rdi
call   1030 <puts@plt>
xor    %ebp,%ebp
jmp    12a2 <main+0x172>
xor    %ebp,%ebp
lea    0xe0d(%rip),%rdi
jmp    1289 <main+0x159>
nopl   0x0(%rax,%rax,1)
xor    %ebp,%ebp
lea    0xe00(%rip),%rdi
jmp    1289 <main+0x159>
nopl   0x0(%rax,%rax,1)
xor    %ebp,%ebp
lea    0xdf3(%rip),%rdi
lea    0x8(%rsp),%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
mov    %rbx,%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
lea    0xdd6(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %rbx,%rdi
lea    0xe(%rsp),%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
mov    %rbx,%rdi
mov    %r12,%rsi
xor    %eax,%eax
call   1050 <scanf@plt>
mov    0x7(%rsp),%al
add    $0x9e,%al
cmp    $0xd,%al
ja     1300 <main+0x1d0>
movzbl %al,%eax
movslq (%r14,%rax,4),%rax
add    %r14,%rax
jmp    *%rax
lea    0xdc0(%rip),%rdi
lea    0x10(%rsp),%rsi
xor    %eax,%eax
call   1040 <printf@plt>
jmp    1342 <main+0x212>
nopw   0x0(%rax,%rax,1)
lea    0xf09(%rip),%rdi
call   1030 <puts@plt>
jmp    1342 <main+0x212>
xchg   %ax,%ax
mov    0x8(%rsp),%esi
lea    0xdab(%rip),%rdi
jmp    133b <main+0x20b>
nopl   (%rax)
mov    0x8(%rsp),%esi
lea    0xdb9(%rip),%rdi
jmp    133b <main+0x20b>
nopl   (%rax)
mov    0x8(%rsp),%esi
lea    0xdcb(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    0xe(%rsp),%al
cmp    $0x6f,%al
je     1390 <main+0x260>
cmp    $0x68,%al
je     1370 <main+0x240>
cmp    $0x64,%al
jne    13b0 <main+0x280>
cmpb   $0x62,0x7(%rsp)
jne    13c1 <main+0x291>
lea    0xdc2(%rip),%rdi
jmp    1166 <main+0x36>
cs nopw 0x0(%rax,%rax,1)
nop
cmpb   $0x62,0x7(%rsp)
je     115f <main+0x2f>
mov    0x8(%rsp),%esi
lea    0xdac(%rip),%rdi
jmp    1168 <main+0x38>
nopl   0x0(%rax,%rax,1)
cmpb   $0x62,0x7(%rsp)
jne    13d1 <main+0x2a1>
lea    0xda8(%rip),%rdi
jmp    1166 <main+0x36>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
lea    0xe60(%rip),%rdi
call   1030 <puts@plt>
jmp    116f <main+0x3f>
mov    0x8(%rsp),%esi
lea    0xd56(%rip),%rdi
jmp    1168 <main+0x38>
mov    0x8(%rsp),%esi
lea    0xd6a(%rip),%rdi
jmp    1168 <main+0x38>
lea    0xd92(%rip),%rdi
call   1030 <puts@plt>
xor    %eax,%eax
add    $0x38,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [96 x i8] c"Base of input integer: Enter b \09for binary, d for decimal, h for hexadecimal and o for octal: \0A\00"
@.str.1 = [3 x i8] c"%c\00"
@.str.2 = [20 x i8] c"Enter the number: \0A\00"
@.str.3 = [3 x i8] c"%s\00"
@.str.4 = [3 x i8] c"%d\00"
@.str.5 = [3 x i8] c"%x\00"
@.str.6 = [3 x i8] c"%o\00"
@.str.7 = [8 x i8] c"Error1\0A\00"
@.str.8 = [42 x i8] c"Enter the base of the output(d, h or o): \00"
@.str.9 = [29 x i8] c"The integer %s in binary is \00"
@.str.10 = [30 x i8] c"The integer %d in decimal is \00"
@.str.11 = [34 x i8] c"The integer %x in hexadecimal is \00"
@.str.12 = [28 x i8] c"The integer %o in octal is \00"
@.str.13 = [8 x i8] c"Error2\0A\00"
@.str.14 = [16 x i8] c"%d in decimal.\0A\00"
@.str.15 = [20 x i8] c"%x in hexadecimal.\0A\00"
@.str.16 = [14 x i8] c"%o in octal.\0A\00"
@.str.17 = [8 x i8] c"Error3\0A\00"
@.str.18 = [38 x i8] c"Do you wish to do another? (Y or N): \00"
@.str.19 = [30 x i8] c"Thank you, have a nice day.\0A\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8
%3 = alloca i8
%4 = alloca i8
%5 = alloca i8
%6 = alloca i8
%7 = alloca i8
%8 = alloca i32
%9 = alloca i32
%10 = alloca [32 x i8]
%11 = alloca i32
%12 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %8
br label %13
13: ; preds = %166, %0
%14 = load i32, i32* %8
%15 = icmp eq i32 %14, 0
br i1 %15, label %16, label %167
16: ; preds = %13
store i32 0, i32* %9
store i32 0, i32* %11
store i32 0, i32* %12
%17 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([96 x i8], [96 x i8]* @.str, i64 0, i64 0))
%18 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%19 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %5)
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0))
%21 = load i8, i8* %2
%22 = sext i8 %21 to i32
%23 = icmp eq i32 %22, 98
br i1 %23, label %24, label %47
24: ; preds = %16
%25 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), [32 x i8]* %10)
%26 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %5)
br label %27
27: ; preds = %34, %24
%28 = load i32, i32* %12
%29 = sext i32 %28 to i64
%30 = getelementptr inbounds [32 x i8], [32 x i8]* %10, i64 0, i64 %29
%31 = load i8, i8* %30
%32 = sext i8 %31 to i32
%33 = icmp ne i32 %32, 0
br i1 %33, label %34, label %46
34: ; preds = %27
%35 = load i32, i32* %11
%36 = mul nsw i32 %35, 2
%37 = load i32, i32* %12
%38 = sext i32 %37 to i64
%39 = getelementptr inbounds [32 x i8], [32 x i8]* %10, i64 0, i64 %38
%40 = load i8, i8* %39
%41 = sext i8 %40 to i32
%42 = add nsw i32 %36, %41
%43 = sub nsw i32 %42, 48
store i32 %43, i32* %11
%44 = load i32, i32* %12
%45 = add nsw i32 %44, 1
store i32 %45, i32* %12
br label %27
46: ; preds = %27
br label %73
47: ; preds = %16
%48 = load i8, i8* %2
%49 = sext i8 %48 to i32
%50 = icmp eq i32 %49, 100
br i1 %50, label %51, label %54
51: ; preds = %47
%52 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32* %9)
%53 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %5)
br label %72
54: ; preds = %47
%55 = load i8, i8* %2
%56 = sext i8 %55 to i32
%57 = icmp eq i32 %56, 104
br i1 %57, label %58, label %61
58: ; preds = %54
%59 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32* %9)
%60 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %5)
br label %71
61: ; preds = %54
%62 = load i8, i8* %2
%63 = sext i8 %62 to i32
%64 = icmp eq i32 %63, 111
br i1 %64, label %65, label %68
65: ; preds = %61
%66 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i32* %9)
%67 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %5)
br label %70
68: ; preds = %61
%69 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.7, i64 0, i64 0))
br label %70
70: ; preds = %68, %65
br label %71
71: ; preds = %70, %58
br label %72
72: ; preds = %71, %51
br label %73
73: ; preds = %72, %46
%74 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.8, i64 0, i64 0))
%75 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %6)
%76 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %5)
%77 = load i8, i8* %2
%78 = sext i8 %77 to i32
%79 = icmp eq i32 %78, 98
br i1 %79, label %80, label %83
80: ; preds = %73
%81 = getelementptr inbounds [32 x i8], [32 x i8]* %10, i64 0, i64 0
%82 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.9, i64 0, i64 0), i8* %81)
br label %109
83: ; preds = %73
%84 = load i8, i8* %2
%85 = sext i8 %84 to i32
%86 = icmp eq i32 %85, 100
br i1 %86, label %87, label %90
87: ; preds = %83
%88 = load i32, i32* %9
%89 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.10, i64 0, i64 0), i32 %88)
br label %108
90: ; preds = %83
%91 = load i8, i8* %2
%92 = sext i8 %91 to i32
%93 = icmp eq i32 %92, 104
br i1 %93, label %94, label %97
94: ; preds = %90
%95 = load i32, i32* %9
%96 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([34 x i8], [34 x i8]* @.str.11, i64 0, i64 0), i32 %95)
br label %107
97: ; preds = %90
%98 = load i8, i8* %2
%99 = sext i8 %98 to i32
%100 = icmp eq i32 %99, 111
br i1 %100, label %101, label %104
101: ; preds = %97
%102 = load i32, i32* %9
%103 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.12, i64 0, i64 0), i32 %102)
br label %106
104: ; preds = %97
%105 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.13, i64 0, i64 0))
br label %106
106: ; preds = %104, %101
br label %107
107: ; preds = %106, %94
br label %108
108: ; preds = %107, %87
br label %109
109: ; preds = %108, %80
%110 = load i8, i8* %6
%111 = sext i8 %110 to i32
%112 = icmp eq i32 %111, 100
br i1 %112, label %113, label %124
113: ; preds = %109
%114 = load i8, i8* %2
%115 = sext i8 %114 to i32
%116 = icmp eq i32 %115, 98
br i1 %116, label %117, label %120
117: ; preds = %113
%118 = load i32, i32* %11
%119 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.14, i64 0, i64 0), i32 %118)
br label %123
120: ; preds = %113
%121 = load i32, i32* %9
%122 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.14, i64 0, i64 0), i32 %121)
br label %123
123: ; preds = %120, %117
br label %158
124: ; preds = %109
%125 = load i8, i8* %6
%126 = sext i8 %125 to i32
%127 = icmp eq i32 %126, 104
br i1 %127, label %128, label %139
128: ; preds = %124
%129 = load i8, i8* %2
%130 = sext i8 %129 to i32
%131 = icmp eq i32 %130, 98
br i1 %131, label %132, label %135
132: ; preds = %128
%133 = load i32, i32* %11
%134 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.15, i64 0, i64 0), i32 %133)
br label %138
135: ; preds = %128
%136 = load i32, i32* %9
%137 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.15, i64 0, i64 0), i32 %136)
br label %138
138: ; preds = %135, %132
br label %157
139: ; preds = %124
%140 = load i8, i8* %6
%141 = sext i8 %140 to i32
%142 = icmp eq i32 %141, 111
br i1 %142, label %143, label %154
143: ; preds = %139
%144 = load i8, i8* %2
%145 = sext i8 %144 to i32
%146 = icmp eq i32 %145, 98
br i1 %146, label %147, label %150
147: ; preds = %143
%148 = load i32, i32* %11
%149 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.16, i64 0, i64 0), i32 %148)
br label %153
150: ; preds = %143
%151 = load i32, i32* %9
%152 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.16, i64 0, i64 0), i32 %151)
br label %153
153: ; preds = %150, %147
br label %156
154: ; preds = %139
%155 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.17, i64 0, i64 0))
br label %156
156: ; preds = %154, %153
br label %157
157: ; preds = %156, %138
br label %158
158: ; preds = %157, %123
%159 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.18, i64 0, i64 0))
%160 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %7)
%161 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %5)
%162 = load i8, i8* %7
%163 = sext i8 %162 to i32
%164 = icmp ne i32 %163, 89
br i1 %164, label %165, label %166
165: ; preds = %158
store i32 1, i32* %8
br label %166
166: ; preds = %165, %158
br label %13
167: ; preds = %13
%168 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.19, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
@.str.1 = [3 x i8] c"%c\00"
@.str.3 = [3 x i8] c"%s\00"
@.str.4 = [3 x i8] c"%d\00"
@.str.5 = [3 x i8] c"%x\00"
@.str.6 = [3 x i8] c"%o\00"
@.str.8 = [42 x i8] c"Enter the base of the output(d, h or o): \00"
@.str.9 = [29 x i8] c"The integer %s in binary is \00"
@.str.10 = [30 x i8] c"The integer %d in decimal is \00"
@.str.11 = [34 x i8] c"The integer %x in hexadecimal is \00"
@.str.12 = [28 x i8] c"The integer %o in octal is \00"
@.str.14 = [16 x i8] c"%d in decimal.\0A\00"
@.str.15 = [20 x i8] c"%x in hexadecimal.\0A\00"
@.str.16 = [14 x i8] c"%o in octal.\0A\00"
@.str.18 = [38 x i8] c"Do you wish to do another? (Y or N): \00"
@str = [29 x i8] c"Thank you, have a nice day.\0A\00"
@str.20 = [95 x i8] c"Base of input integer: Enter b \09for binary, d for decimal, h for hexadecimal and o for octal: \00"
@str.21 = [19 x i8] c"Enter the number: \00"
@str.22 = [7 x i8] c"Error1\00"
@str.23 = [7 x i8] c"Error2\00"
@str.24 = [7 x i8] c"Error3\00"
define i32 @main() {
%1 = alloca i8
%2 = alloca i8
%3 = alloca i8
%4 = alloca i8
%5 = alloca i32
%6 = alloca [32 x i8]
%7 = bitcast i32* %5 to i8*
%8 = getelementptr inbounds [32 x i8], [32 x i8]* %6, i64 0, i64 0
br label %9
9: ; preds = %0, %90
store i32 0, i32* %5
%10 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([95 x i8], [95 x i8]* @str.20, i64 0, i64 0))
%11 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %1)
%12 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%13 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([19 x i8], [19 x i8]* @str.21, i64 0, i64 0))
%14 = load i8, i8* %1
switch i8 %14, label %41 [
i8 98, label %15
i8 100, label %32
i8 104, label %35
i8 111, label %38
]
15: ; preds = %9
%16 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), [32 x i8]* %6)
%17 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%18 = load i8, i8* %8
%19 = icmp eq i8 %18, 0
br i1 %19, label %43, label %20
20: ; preds = %15, %20
%21 = phi i64 [ %28, %20 ], [ 0, %15 ]
%22 = phi i8 [ %30, %20 ], [ %18, %15 ]
%23 = phi i32 [ %27, %20 ], [ 0, %15 ]
%24 = sext i8 %22 to i32
%25 = shl nsw i32 %23, 1
%26 = add i32 %25, -48
%27 = add i32 %26, %24
%28 = add nuw nsw i64 %21, 1
%29 = getelementptr inbounds [32 x i8], [32 x i8]* %6, i64 0, i64 %28
%30 = load i8, i8* %29
%31 = icmp eq i8 %30, 0
br i1 %31, label %43, label %20
32: ; preds = %9
%33 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i32* %5)
%34 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %2)
br label %43
35: ; preds = %9
%36 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i64 0, i64 0), i32* %5)
%37 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %2)
br label %43
38: ; preds = %9
%39 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i64 0, i64 0), i32* %5)
%40 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %2)
br label %43
41: ; preds = %9
%42 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str.22, i64 0, i64 0))
br label %43
43: ; preds = %20, %15, %32, %38, %41, %35
%44 = phi i32 [ 0, %32 ], [ 0, %35 ], [ 0, %38 ], [ 0, %41 ], [ 0, %15 ], [ %27, %20 ]
%45 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([42 x i8], [42 x i8]* @.str.8, i64 0, i64 0))
%46 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %3)
%47 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%48 = load i8, i8* %1
switch i8 %48, label %60 [
i8 98, label %49
i8 100, label %51
i8 104, label %54
i8 111, label %57
]
49: ; preds = %43
%50 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.9, i64 0, i64 0), i8* %8)
br label %62
51: ; preds = %43
%52 = load i32, i32* %5
%53 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([30 x i8], [30 x i8]* @.str.10, i64 0, i64 0), i32 %52)
br label %62
54: ; preds = %43
%55 = load i32, i32* %5
%56 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([34 x i8], [34 x i8]* @.str.11, i64 0, i64 0), i32 %55)
br label %62
57: ; preds = %43
%58 = load i32, i32* %5
%59 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @.str.12, i64 0, i64 0), i32 %58)
br label %62
60: ; preds = %43
%61 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str.23, i64 0, i64 0))
br label %62
62: ; preds = %51, %57, %60, %54, %49
%63 = load i8, i8* %3
switch i8 %63, label %88 [
i8 100, label %64
i8 104, label %72
i8 111, label %80
]
64: ; preds = %62
%65 = load i8, i8* %1
%66 = icmp eq i8 %65, 98
br i1 %66, label %67, label %69
67: ; preds = %64
%68 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.14, i64 0, i64 0), i32 %44)
br label %90
69: ; preds = %64
%70 = load i32, i32* %5
%71 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([16 x i8], [16 x i8]* @.str.14, i64 0, i64 0), i32 %70)
br label %90
72: ; preds = %62
%73 = load i8, i8* %1
%74 = icmp eq i8 %73, 98
br i1 %74, label %75, label %77
75: ; preds = %72
%76 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.15, i64 0, i64 0), i32 %44)
br label %90
77: ; preds = %72
%78 = load i32, i32* %5
%79 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([20 x i8], [20 x i8]* @.str.15, i64 0, i64 0), i32 %78)
br label %90
80: ; preds = %62
%81 = load i8, i8* %1
%82 = icmp eq i8 %81, 98
br i1 %82, label %83, label %85
83: ; preds = %80
%84 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.16, i64 0, i64 0), i32 %44)
br label %90
85: ; preds = %80
%86 = load i32, i32* %5
%87 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.16, i64 0, i64 0), i32 %86)
br label %90
88: ; preds = %62
%89 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([7 x i8], [7 x i8]* @str.24, i64 0, i64 0))
br label %90
90: ; preds = %77, %75, %83, %85, %88, %67, %69
%91 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.18, i64 0, i64 0))
%92 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %4)
%93 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %2)
%94 = load i8, i8* %4
%95 = icmp eq i8 %94, 89
br i1 %95, label %9, label %96
96: ; preds = %90
%97 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @str, i64 0, i64 0))
ret i32 0
}