#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 pow(int, int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, ...);
void main() {
  int b1 = 0, b2 = 0;
  int pre[1000];
  int pen[1000];
  int rem;
  int total = 0;
  char num[1000], end[1000];
  int i = 0, j;
  printf("Please enter a number: ");
  scanf("%s", &num);
  while ((b1 < 2) || ((b1 > 10) && (b1 != 16))) {
    printf("Please enter the initial base (2-10, 16): ");
    scanf("%d", &b1);
  }
  while ((b2 < 2) || ((b2 > 10) && (b2 != 16))) {
    printf("Please enter the final base (2-10, 16): ");
    scanf("%d", &b2);
  }
  printf("%s in base %d = ", num, b1);
  while (num[i] != 0) {
    switch (num[i]) {
    case 48:
      pre[i] = 79;
      break;
    case 49:
      pre[i] = 1;
      break;
    case 50:
      pre[i] = 2;
      break;
    case 51:
      pre[i] = 3;
      break;
    case 52:
      pre[i] = 4;
      break;
    case 53:
      pre[i] = 5;
      break;
    case 54:
      pre[i] = 6;
      break;
    case 55:
      pre[i] = 7;
      break;
    case 56:
      pre[i] = 8;
      break;
    case 57:
      pre[i] = 9;
      break;
    case 65:
      pre[i] = 10;
      break;
    case 66:
      pre[i] = 11;
      break;
    case 67:
      pre[i] = 12;
      break;
    case 68:
      pre[i] = 13;
      break;
    case 69:
      pre[i] = 14;
      break;
    case 70:
      pre[i] = 15;
      break;
    default:
      break;
    }
    i += 1;
  }
  for (j = 0; pre[j] != 0; j += 1) {
    if (pre[j] == 79) {
      pre[j] = 0;
    }
    total = total + pre[j] * pow(b1, (i - 1 - j));
  }
  i = 0;
  j = 0;
  while (total > 0) {
    pen[i] = total % b2;
    total = total / b2;
    i += 1;
  }
  while (i > 0) {
    i -= 1;
    switch (pen[i]) {
    case 15:
      end[j] = 70;
      break;
    case 14:
      end[j] = 69;
      break;
    case 13:
      end[j] = 68;
      break;
    case 12:
      end[j] = 67;
      break;
    case 11:
      end[j] = 66;
      break;
    case 10:
      end[j] = 65;
      break;
    case 9:
      end[j] = 57;
      break;
    case 8:
      end[j] = 56;
      break;
    case 7:
      end[j] = 55;
      break;
    case 6:
      end[j] = 54;
      break;
    case 5:
      end[j] = 53;
      break;
    case 4:
      end[j] = 52;
      break;
    case 3:
      end[j] = 51;
      break;
    case 2:
      end[j] = 50;
      break;
    case 1:
      end[j] = 49;
      break;
    case 0:
      end[j] = 48;
      break;
    default:
      break;
    }
    j += 1;
  }
  printf("%s in base %d", end, b2);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x2760,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0x8(%rbp)
movl   $0x0,-0x1f58(%rbp)
movl   $0x0,-0x2734(%rbp)
lea    0xf38(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf42(%rip),%rdi
lea    -0x2340(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
mov    $0x1,%al
cmpl   $0x2,-0x4(%rbp)
mov    %al,-0x2739(%rbp)
jl     11bd <main+0x8d>
xor    %eax,%eax
cmpl   $0xa,-0x4(%rbp)
mov    %al,-0x273a(%rbp)
jle    11b1 <main+0x81>
cmpl   $0x10,-0x4(%rbp)
setne  %al
mov    %al,-0x273a(%rbp)
mov    -0x273a(%rbp),%al
mov    %al,-0x2739(%rbp)
mov    -0x2739(%rbp),%al
test   $0x1,%al
jne    11d0 <main+0xa0>
jmp    11f5 <main+0xc5>
lea    0xee0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xf42(%rip),%rdi
lea    -0x4(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
jmp    1180 <main+0x50>
jmp    11fa <main+0xca>
mov    $0x1,%al
cmpl   $0x2,-0x8(%rbp)
mov    %al,-0x273b(%rbp)
jl     1237 <main+0x107>
xor    %eax,%eax
cmpl   $0xa,-0x8(%rbp)
mov    %al,-0x273c(%rbp)
jle    122b <main+0xfb>
cmpl   $0x10,-0x8(%rbp)
setne  %al
mov    %al,-0x273c(%rbp)
mov    -0x273c(%rbp),%al
mov    %al,-0x273b(%rbp)
mov    -0x273b(%rbp),%al
test   $0x1,%al
jne    124a <main+0x11a>
jmp    126f <main+0x13f>
lea    0xe91(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
lea    0xec8(%rip),%rdi
lea    -0x8(%rbp),%rsi
mov    $0x0,%al
call   1040 <scanf@plt>
jmp    11fa <main+0xca>
lea    -0x2340(%rbp),%rsi
mov    -0x4(%rbp),%edx
lea    0xe8b(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
movslq -0x2734(%rbp),%rax
movsbl -0x2340(%rbp,%rax,1),%eax
ff
cmp    $0x0,%eax
je     1463 <main+0x333>
movslq -0x2734(%rbp),%rax
movsbl -0x2340(%rbp,%rax,1),%eax
ff
add    $0xffffffd0,%eax
mov    %eax,%ecx
mov    %rcx,-0x2748(%rbp)
sub    $0x16,%eax
ja     144a <main+0x31a>
mov    -0x2748(%rbp),%rax
lea    0xd6f(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movslq -0x2734(%rbp),%rax
movl   $0x4f,-0xfb0(%rbp,%rax,4)
jmp    144f <main+0x31f>
movslq -0x2734(%rbp),%rax
movl   $0x1,-0xfb0(%rbp,%rax,4)
jmp    144f <main+0x31f>
movslq -0x2734(%rbp),%rax
movl   $0x2,-0xfb0(%rbp,%rax,4)
jmp    144f <main+0x31f>
movslq -0x2734(%rbp),%rax
movl   $0x3,-0xfb0(%rbp,%rax,4)
jmp    144f <main+0x31f>
movslq -0x2734(%rbp),%rax
movl   $0x4,-0xfb0(%rbp,%rax,4)
jmp    144f <main+0x31f>
movslq -0x2734(%rbp),%rax
movl   $0x5,-0xfb0(%rbp,%rax,4)
jmp    144f <main+0x31f>
movslq -0x2734(%rbp),%rax
movl   $0x6,-0xfb0(%rbp,%rax,4)
jmp    144f <main+0x31f>
movslq -0x2734(%rbp),%rax
movl   $0x7,-0xfb0(%rbp,%rax,4)
jmp    144f <main+0x31f>
movslq -0x2734(%rbp),%rax
movl   $0x8,-0xfb0(%rbp,%rax,4)
jmp    144f <main+0x31f>
movslq -0x2734(%rbp),%rax
movl   $0x9,-0xfb0(%rbp,%rax,4)
jmp    144f <main+0x31f>
movslq -0x2734(%rbp),%rax
movl   $0xa,-0xfb0(%rbp,%rax,4)
jmp    144f <main+0x31f>
movslq -0x2734(%rbp),%rax
movl   $0xb,-0xfb0(%rbp,%rax,4)
jmp    144f <main+0x31f>
movslq -0x2734(%rbp),%rax
movl   $0xc,-0xfb0(%rbp,%rax,4)
jmp    144f <main+0x31f>
movslq -0x2734(%rbp),%rax
movl   $0xd,-0xfb0(%rbp,%rax,4)
jmp    144f <main+0x31f>
movslq -0x2734(%rbp),%rax
movl   $0xe,-0xfb0(%rbp,%rax,4)
jmp    144f <main+0x31f>
movslq -0x2734(%rbp),%rax
movl   $0xf,-0xfb0(%rbp,%rax,4)
jmp    144f <main+0x31f>
jmp    144f <main+0x31f>
mov    -0x2734(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2734(%rbp)
jmp    1287 <main+0x157>
movl   $0x0,-0x2738(%rbp)
movslq -0x2738(%rbp),%rax
cmpl   $0x0,-0xfb0(%rbp,%rax,4)
je     150d <main+0x3dd>
movslq -0x2738(%rbp),%rax
cmpl   $0x4f,-0xfb0(%rbp,%rax,4)
4f
jne    14a9 <main+0x379>
movslq -0x2738(%rbp),%rax
movl   $0x0,-0xfb0(%rbp,%rax,4)
mov    -0x1f58(%rbp),%eax
mov    %eax,-0x274c(%rbp)
movslq -0x2738(%rbp),%rax
mov    -0xfb0(%rbp,%rax,4),%eax
mov    %eax,-0x2750(%rbp)
mov    -0x4(%rbp),%edi
mov    -0x2734(%rbp),%esi
sub    $0x1,%esi
sub    -0x2738(%rbp),%esi
call   1050 <pow@plt>
mov    -0x2750(%rbp),%ecx
mov    %eax,%edx
mov    -0x274c(%rbp),%eax
imul   %edx,%ecx
add    %ecx,%eax
mov    %eax,-0x1f58(%rbp)
mov    -0x2738(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2738(%rbp)
jmp    146d <main+0x33d>
movl   $0x0,-0x2734(%rbp)
movl   $0x0,-0x2738(%rbp)
cmpl   $0x0,-0x1f58(%rbp)
jle    156a <main+0x43a>
mov    -0x1f58(%rbp),%eax
cltd
idivl  -0x8(%rbp)
movslq -0x2734(%rbp),%rax
mov    %edx,-0x1f50(%rbp,%rax,4)
mov    -0x1f58(%rbp),%eax
cltd
idivl  -0x8(%rbp)
mov    %eax,-0x1f58(%rbp)
mov    -0x2734(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2734(%rbp)
jmp    1521 <main+0x3f1>
jmp    156f <main+0x43f>
cmpl   $0x0,-0x2734(%rbp)
jle    171a <main+0x5ea>
mov    -0x2734(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x2734(%rbp)
movslq -0x2734(%rbp),%rax
mov    -0x1f50(%rbp,%rax,4),%eax
mov    %rax,-0x2758(%rbp)
sub    $0xf,%rax
ja     1701 <main+0x5d1>
mov    -0x2758(%rbp),%rax
lea    0xa48(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
movslq -0x2738(%rbp),%rax
movb   $0x46,-0x2730(%rbp,%rax,1)
46
jmp    1706 <main+0x5d6>
movslq -0x2738(%rbp),%rax
movb   $0x45,-0x2730(%rbp,%rax,1)
45
jmp    1706 <main+0x5d6>
movslq -0x2738(%rbp),%rax
movb   $0x44,-0x2730(%rbp,%rax,1)
44
jmp    1706 <main+0x5d6>
movslq -0x2738(%rbp),%rax
movb   $0x43,-0x2730(%rbp,%rax,1)
43
jmp    1706 <main+0x5d6>
movslq -0x2738(%rbp),%rax
movb   $0x42,-0x2730(%rbp,%rax,1)
42
jmp    1706 <main+0x5d6>
movslq -0x2738(%rbp),%rax
movb   $0x41,-0x2730(%rbp,%rax,1)
41
jmp    1706 <main+0x5d6>
movslq -0x2738(%rbp),%rax
movb   $0x39,-0x2730(%rbp,%rax,1)
39
jmp    1706 <main+0x5d6>
movslq -0x2738(%rbp),%rax
movb   $0x38,-0x2730(%rbp,%rax,1)
38
jmp    1706 <main+0x5d6>
movslq -0x2738(%rbp),%rax
movb   $0x37,-0x2730(%rbp,%rax,1)
37
jmp    1706 <main+0x5d6>
movslq -0x2738(%rbp),%rax
movb   $0x36,-0x2730(%rbp,%rax,1)
36
jmp    1706 <main+0x5d6>
movslq -0x2738(%rbp),%rax
movb   $0x35,-0x2730(%rbp,%rax,1)
35
jmp    1706 <main+0x5d6>
movslq -0x2738(%rbp),%rax
movb   $0x34,-0x2730(%rbp,%rax,1)
34
jmp    1706 <main+0x5d6>
movslq -0x2738(%rbp),%rax
movb   $0x33,-0x2730(%rbp,%rax,1)
33
jmp    1706 <main+0x5d6>
movslq -0x2738(%rbp),%rax
movb   $0x32,-0x2730(%rbp,%rax,1)
32
jmp    1706 <main+0x5d6>
movslq -0x2738(%rbp),%rax
movb   $0x31,-0x2730(%rbp,%rax,1)
31
jmp    1706 <main+0x5d6>
movslq -0x2738(%rbp),%rax
movb   $0x30,-0x2730(%rbp,%rax,1)
30
jmp    1706 <main+0x5d6>
jmp    1706 <main+0x5d6>
mov    -0x2738(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x2738(%rbp)
jmp    156f <main+0x43f>
lea    -0x2730(%rbp),%rsi
mov    -0x8(%rbp),%edx
lea    0x9f1(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x2760,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x2738,%rsp
movl   $0x0,0xc(%rsp)
movl   $0x0,0x8(%rsp)
lea    0xeac(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeb6(%rip),%rdi
lea    0x400(%rsp),%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
lea    0xea3(%rip),%r14
lea    0xf0c(%rip),%rbp
lea    0xc(%rsp),%rbx
xor    %eax,%eax
jmp    11ab <main+0x7b>
nopl   0x0(%rax,%rax,1)
mov    %r14,%rdi
xor    %eax,%eax
call   1030 <printf@plt>
mov    %rbp,%rdi
mov    %rbx,%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
mov    0xc(%rsp),%eax
cmp    $0x2,%eax
jl     1190 <main+0x60>
cmp    $0xb,%eax
jb     11e1 <main+0xb1>
cmp    $0x10,%eax
jne    1190 <main+0x60>
jmp    11e1 <main+0xb1>
nopl   0x0(%rax)
lea    0xe7f(%rip),%rdi
xor    %eax,%eax
call   1030 <printf@plt>
lea    0xeb6(%rip),%rdi
lea    0x8(%rsp),%rsi
xor    %eax,%eax
call   1040 <scanf@plt>
mov    0x8(%rsp),%eax
cmp    $0x2,%eax
jl     11c0 <main+0x90>
cmp    $0xb,%eax
jb     11f4 <main+0xc4>
cmp    $0x10,%eax
jne    11c0 <main+0x90>
mov    0xc(%rsp),%edx
lea    0xe70(%rip),%rdi
xor    %r14d,%r14d
lea    0x400(%rsp),%rsi
xor    %eax,%eax
call   1030 <printf@plt>
mov    0x400(%rsp),%dl
mov    $0x0,%r15d
test   %dl,%dl
je     1271 <main+0x141>
xor    %r15d,%r15d
mov    $0x7e03ff,%eax
lea    0xe5f(%rip),%rcx
jmp    1251 <main+0x121>
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
movzbl 0x401(%rsp,%r15,1),%edx
add    $0x1,%r15
test   %dl,%dl
je     1271 <main+0x141>
movsbl %dl,%edx
add    $0xffffffd0,%edx
cmp    $0x16,%edx
ja     1240 <main+0x110>
bt     %edx,%eax
jae    1240 <main+0x110>
movslq %edx,%rdx
mov    (%rcx,%rdx,4),%edx
mov    %edx,0x1790(%rsp,%r15,4)
jmp    1240 <main+0x110>
add    $0xffffffff,%r15d
lea    0x1790(%rsp),%rbp
jmp    12a3 <main+0x173>
nop
movl   $0x0,0x0(%rbp)
xor    %ebx,%ebx
mov    0xc(%rsp),%edi
mov    %r15d,%esi
call   1050 <pow@plt>
imul   %ebx,%eax
add    %eax,%r14d
add    $0xffffffff,%r15d
add    $0x4,%rbp
mov    0x0(%rbp),%ebx
cmp    $0x4f,%ebx
je     1280 <main+0x150>
test   %ebx,%ebx
jne    1289 <main+0x159>
test   %r14d,%r14d
jle    130e <main+0x1de>
mov    0x8(%rsp),%esi
xor    %ecx,%ecx
nopw   0x0(%rax,%rax,1)
mov    %r14d,%eax
cltd
idiv   %esi
mov    %edx,0x7f0(%rsp,%rcx,4)
add    $0x1,%rcx
mov    %eax,%r14d
test   %eax,%eax
jg     12c0 <main+0x190>
test   %ecx,%ecx
jle    130e <main+0x1de>
mov    $0xffffffff,%edx
mov    %ecx,%eax
cmp    $0x1,%rax
jne    1333 <main+0x203>
xor    %esi,%esi
test   $0x1,%cl
je     130e <main+0x1de>
add    %edx,%eax
movslq 0x7f0(%rsp,%rax,4),%rax
cmp    $0xf,%rax
ja     130e <main+0x1de>
lea    0xde5(%rip),%rcx
mov    (%rax,%rcx,1),%al
mov    %al,0x10(%rsp,%rsi,1)
mov    0x8(%rsp),%edx
lea    0xd67(%rip),%rdi
lea    0x10(%rsp),%rsi
xor    %eax,%eax
call   1030 <printf@plt>
add    $0x2738,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret
mov    %ecx,%edi
mov    %ecx,%esi
and    $0x1,%esi
sub    %rsi,%rdi
xor    %esi,%esi
lea    0xda6(%rip),%rbp
jmp    1359 <main+0x229>
nopl   0x0(%rax,%rax,1)
add    $0x2,%rsi
cmp    %rsi,%rdi
je     12eb <main+0x1bb>
lea    (%rax,%rdx,1),%ebx
movslq 0x7f0(%rsp,%rbx,4),%rbx
cmp    $0xf,%rbx
ja     1372 <main+0x242>
movzbl (%rbx,%rbp,1),%ebx
mov    %bl,0x10(%rsp,%rsi,1)
add    $0xfffffffffffffffe,%rax
mov    %eax,%ebx
movslq 0x7f0(%rsp,%rbx,4),%rbx
cmp    $0xf,%rbx
ja     1350 <main+0x220>
movzbl (%rbx,%rbp,1),%ebx
mov    %bl,0x11(%rsp,%rsi,1)
jmp    1350 <main+0x220>

LLVM IR (-O0):
@.str = [24 x i8] c"Please enter a number: \00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [43 x i8] c"Please enter the initial base (2-10, 16): \00"
@.str.3 = [3 x i8] c"%d\00"
@.str.4 = [41 x i8] c"Please enter the final base (2-10, 16): \00"
@.str.5 = [17 x i8] c"%s in base %d = \00"
@.str.6 = [14 x i8] c"%s in base %d\00"
define void @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [1000 x i32]
%4 = alloca [1000 x i32]
%5 = alloca i32
%6 = alloca i32
%7 = alloca [1000 x i8]
%8 = alloca [1000 x i8]
%9 = alloca i32
%10 = alloca i32
store i32 0, i32* %1
store i32 0, i32* %2
store i32 0, i32* %6
store i32 0, i32* %9
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%12 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), [1000 x i8]* %7)
br label %13
13: ; preds = %26, %0
%14 = load i32, i32* %1
%15 = icmp slt i32 %14, 2
br i1 %15, label %24, label %16
16: ; preds = %13
%17 = load i32, i32* %1
%18 = icmp sgt i32 %17, 10
br i1 %18, label %19, label %22
19: ; preds = %16
%20 = load i32, i32* %1
%21 = icmp ne i32 %20, 16
br label %22
22: ; preds = %19, %16
%23 = phi i1 [ false, %16 ], [ %21, %19 ]
br label %24
24: ; preds = %22, %13
%25 = phi i1 [ true, %13 ], [ %23, %22 ]
br i1 %25, label %26, label %29
26: ; preds = %24
%27 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str.2, i64 0, i64 0))
%28 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %1)
br label %13
29: ; preds = %24
br label %30
30: ; preds = %43, %29
%31 = load i32, i32* %2
%32 = icmp slt i32 %31, 2
br i1 %32, label %41, label %33
33: ; preds = %30
%34 = load i32, i32* %2
%35 = icmp sgt i32 %34, 10
br i1 %35, label %36, label %39
36: ; preds = %33
%37 = load i32, i32* %2
%38 = icmp ne i32 %37, 16
br label %39
39: ; preds = %36, %33
%40 = phi i1 [ false, %33 ], [ %38, %36 ]
br label %41
41: ; preds = %39, %30
%42 = phi i1 [ true, %30 ], [ %40, %39 ]
br i1 %42, label %43, label %46
43: ; preds = %41
%44 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([41 x i8], [41 x i8]* @.str.4, i64 0, i64 0))
%45 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %2)
br label %30
46: ; preds = %41
%47 = getelementptr inbounds [1000 x i8], [1000 x i8]* %7, i64 0, i64 0
%48 = load i32, i32* %1
%49 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.5, i64 0, i64 0), i8* %47, i32 %48)
br label %50
50: ; preds = %128, %46
%51 = load i32, i32* %9
%52 = sext i32 %51 to i64
%53 = getelementptr inbounds [1000 x i8], [1000 x i8]* %7, i64 0, i64 %52
%54 = load i8, i8* %53
%55 = sext i8 %54 to i32
%56 = icmp ne i32 %55, 0
br i1 %56, label %57, label %131
57: ; preds = %50
%58 = load i32, i32* %9
%59 = sext i32 %58 to i64
%60 = getelementptr inbounds [1000 x i8], [1000 x i8]* %7, i64 0, i64 %59
%61 = load i8, i8* %60
%62 = sext i8 %61 to i32
switch i32 %62, label %127 [
i32 48, label %63
i32 49, label %67
i32 50, label %71
i32 51, label %75
i32 52, label %79
i32 53, label %83
i32 54, label %87
i32 55, label %91
i32 56, label %95
i32 57, label %99
i32 65, label %103
i32 66, label %107
i32 67, label %111
i32 68, label %115
i32 69, label %119
i32 70, label %123
]
63: ; preds = %57
%64 = load i32, i32* %9
%65 = sext i32 %64 to i64
%66 = getelementptr inbounds [1000 x i32], [1000 x i32]* %3, i64 0, i64 %65
store i32 79, i32* %66
br label %128
67: ; preds = %57
%68 = load i32, i32* %9
%69 = sext i32 %68 to i64
%70 = getelementptr inbounds [1000 x i32], [1000 x i32]* %3, i64 0, i64 %69
store i32 1, i32* %70
br label %128
71: ; preds = %57
%72 = load i32, i32* %9
%73 = sext i32 %72 to i64
%74 = getelementptr inbounds [1000 x i32], [1000 x i32]* %3, i64 0, i64 %73
store i32 2, i32* %74
br label %128
75: ; preds = %57
%76 = load i32, i32* %9
%77 = sext i32 %76 to i64
%78 = getelementptr inbounds [1000 x i32], [1000 x i32]* %3, i64 0, i64 %77
store i32 3, i32* %78
br label %128
79: ; preds = %57
%80 = load i32, i32* %9
%81 = sext i32 %80 to i64
%82 = getelementptr inbounds [1000 x i32], [1000 x i32]* %3, i64 0, i64 %81
store i32 4, i32* %82
br label %128
83: ; preds = %57
%84 = load i32, i32* %9
%85 = sext i32 %84 to i64
%86 = getelementptr inbounds [1000 x i32], [1000 x i32]* %3, i64 0, i64 %85
store i32 5, i32* %86
br label %128
87: ; preds = %57
%88 = load i32, i32* %9
%89 = sext i32 %88 to i64
%90 = getelementptr inbounds [1000 x i32], [1000 x i32]* %3, i64 0, i64 %89
store i32 6, i32* %90
br label %128
91: ; preds = %57
%92 = load i32, i32* %9
%93 = sext i32 %92 to i64
%94 = getelementptr inbounds [1000 x i32], [1000 x i32]* %3, i64 0, i64 %93
store i32 7, i32* %94
br label %128
95: ; preds = %57
%96 = load i32, i32* %9
%97 = sext i32 %96 to i64
%98 = getelementptr inbounds [1000 x i32], [1000 x i32]* %3, i64 0, i64 %97
store i32 8, i32* %98
br label %128
99: ; preds = %57
%100 = load i32, i32* %9
%101 = sext i32 %100 to i64
%102 = getelementptr inbounds [1000 x i32], [1000 x i32]* %3, i64 0, i64 %101
store i32 9, i32* %102
br label %128
103: ; preds = %57
%104 = load i32, i32* %9
%105 = sext i32 %104 to i64
%106 = getelementptr inbounds [1000 x i32], [1000 x i32]* %3, i64 0, i64 %105
store i32 10, i32* %106
br label %128
107: ; preds = %57
%108 = load i32, i32* %9
%109 = sext i32 %108 to i64
%110 = getelementptr inbounds [1000 x i32], [1000 x i32]* %3, i64 0, i64 %109
store i32 11, i32* %110
br label %128
111: ; preds = %57
%112 = load i32, i32* %9
%113 = sext i32 %112 to i64
%114 = getelementptr inbounds [1000 x i32], [1000 x i32]* %3, i64 0, i64 %113
store i32 12, i32* %114
br label %128
115: ; preds = %57
%116 = load i32, i32* %9
%117 = sext i32 %116 to i64
%118 = getelementptr inbounds [1000 x i32], [1000 x i32]* %3, i64 0, i64 %117
store i32 13, i32* %118
br label %128
119: ; preds = %57
%120 = load i32, i32* %9
%121 = sext i32 %120 to i64
%122 = getelementptr inbounds [1000 x i32], [1000 x i32]* %3, i64 0, i64 %121
store i32 14, i32* %122
br label %128
123: ; preds = %57
%124 = load i32, i32* %9
%125 = sext i32 %124 to i64
%126 = getelementptr inbounds [1000 x i32], [1000 x i32]* %3, i64 0, i64 %125
store i32 15, i32* %126
br label %128
127: ; preds = %57
br label %128
128: ; preds = %127, %123, %119, %115, %111, %107, %103, %99, %95, %91, %87, %83, %79, %75, %71, %67, %63
%129 = load i32, i32* %9
%130 = add nsw i32 %129, 1
store i32 %130, i32* %9
br label %50
131: ; preds = %50
store i32 0, i32* %10
br label %132
132: ; preds = %162, %131
%133 = load i32, i32* %10
%134 = sext i32 %133 to i64
%135 = getelementptr inbounds [1000 x i32], [1000 x i32]* %3, i64 0, i64 %134
%136 = load i32, i32* %135
%137 = icmp ne i32 %136, 0
br i1 %137, label %138, label %165
138: ; preds = %132
%139 = load i32, i32* %10
%140 = sext i32 %139 to i64
%141 = getelementptr inbounds [1000 x i32], [1000 x i32]* %3, i64 0, i64 %140
%142 = load i32, i32* %141
%143 = icmp eq i32 %142, 79
br i1 %143, label %144, label %148
144: ; preds = %138
%145 = load i32, i32* %10
%146 = sext i32 %145 to i64
%147 = getelementptr inbounds [1000 x i32], [1000 x i32]* %3, i64 0, i64 %146
store i32 0, i32* %147
br label %148
148: ; preds = %144, %138
%149 = load i32, i32* %6
%150 = load i32, i32* %10
%151 = sext i32 %150 to i64
%152 = getelementptr inbounds [1000 x i32], [1000 x i32]* %3, i64 0, i64 %151
%153 = load i32, i32* %152
%154 = load i32, i32* %1
%155 = load i32, i32* %9
%156 = sub nsw i32 %155, 1
%157 = load i32, i32* %10
%158 = sub nsw i32 %156, %157
%159 = call i32 @pow(i32 %154, i32 %158)
%160 = mul nsw i32 %153, %159
%161 = add nsw i32 %149, %160
store i32 %161, i32* %6
br label %162
162: ; preds = %148
%163 = load i32, i32* %10
%164 = add nsw i32 %163, 1
store i32 %164, i32* %10
br label %132
165: ; preds = %132
store i32 0, i32* %9
store i32 0, i32* %10
br label %166
166: ; preds = %169, %165
%167 = load i32, i32* %6
%168 = icmp sgt i32 %167, 0
br i1 %168, label %169, label %181
169: ; preds = %166
%170 = load i32, i32* %6
%171 = load i32, i32* %2
%172 = srem i32 %170, %171
%173 = load i32, i32* %9
%174 = sext i32 %173 to i64
%175 = getelementptr inbounds [1000 x i32], [1000 x i32]* %4, i64 0, i64 %174
store i32 %172, i32* %175
%176 = load i32, i32* %6
%177 = load i32, i32* %2
%178 = sdiv i32 %176, %177
store i32 %178, i32* %6
%179 = load i32, i32* %9
%180 = add nsw i32 %179, 1
store i32 %180, i32* %9
br label %166
181: ; preds = %166
br label %182
182: ; preds = %257, %181
%183 = load i32, i32* %9
%184 = icmp sgt i32 %183, 0
br i1 %184, label %185, label %260
185: ; preds = %182
%186 = load i32, i32* %9
%187 = sub nsw i32 %186, 1
store i32 %187, i32* %9
%188 = load i32, i32* %9
%189 = sext i32 %188 to i64
%190 = getelementptr inbounds [1000 x i32], [1000 x i32]* %4, i64 0, i64 %189
%191 = load i32, i32* %190
switch i32 %191, label %256 [
i32 15, label %192
i32 14, label %196
i32 13, label %200
i32 12, label %204
i32 11, label %208
i32 10, label %212
i32 9, label %216
i32 8, label %220
i32 7, label %224
i32 6, label %228
i32 5, label %232
i32 4, label %236
i32 3, label %240
i32 2, label %244
i32 1, label %248
i32 0, label %252
]
192: ; preds = %185
%193 = load i32, i32* %10
%194 = sext i32 %193 to i64
%195 = getelementptr inbounds [1000 x i8], [1000 x i8]* %8, i64 0, i64 %194
store i8 70, i8* %195
br label %257
196: ; preds = %185
%197 = load i32, i32* %10
%198 = sext i32 %197 to i64
%199 = getelementptr inbounds [1000 x i8], [1000 x i8]* %8, i64 0, i64 %198
store i8 69, i8* %199
br label %257
200: ; preds = %185
%201 = load i32, i32* %10
%202 = sext i32 %201 to i64
%203 = getelementptr inbounds [1000 x i8], [1000 x i8]* %8, i64 0, i64 %202
store i8 68, i8* %203
br label %257
204: ; preds = %185
%205 = load i32, i32* %10
%206 = sext i32 %205 to i64
%207 = getelementptr inbounds [1000 x i8], [1000 x i8]* %8, i64 0, i64 %206
store i8 67, i8* %207
br label %257
208: ; preds = %185
%209 = load i32, i32* %10
%210 = sext i32 %209 to i64
%211 = getelementptr inbounds [1000 x i8], [1000 x i8]* %8, i64 0, i64 %210
store i8 66, i8* %211
br label %257
212: ; preds = %185
%213 = load i32, i32* %10
%214 = sext i32 %213 to i64
%215 = getelementptr inbounds [1000 x i8], [1000 x i8]* %8, i64 0, i64 %214
store i8 65, i8* %215
br label %257
216: ; preds = %185
%217 = load i32, i32* %10
%218 = sext i32 %217 to i64
%219 = getelementptr inbounds [1000 x i8], [1000 x i8]* %8, i64 0, i64 %218
store i8 57, i8* %219
br label %257
220: ; preds = %185
%221 = load i32, i32* %10
%222 = sext i32 %221 to i64
%223 = getelementptr inbounds [1000 x i8], [1000 x i8]* %8, i64 0, i64 %222
store i8 56, i8* %223
br label %257
224: ; preds = %185
%225 = load i32, i32* %10
%226 = sext i32 %225 to i64
%227 = getelementptr inbounds [1000 x i8], [1000 x i8]* %8, i64 0, i64 %226
store i8 55, i8* %227
br label %257
228: ; preds = %185
%229 = load i32, i32* %10
%230 = sext i32 %229 to i64
%231 = getelementptr inbounds [1000 x i8], [1000 x i8]* %8, i64 0, i64 %230
store i8 54, i8* %231
br label %257
232: ; preds = %185
%233 = load i32, i32* %10
%234 = sext i32 %233 to i64
%235 = getelementptr inbounds [1000 x i8], [1000 x i8]* %8, i64 0, i64 %234
store i8 53, i8* %235
br label %257
236: ; preds = %185
%237 = load i32, i32* %10
%238 = sext i32 %237 to i64
%239 = getelementptr inbounds [1000 x i8], [1000 x i8]* %8, i64 0, i64 %238
store i8 52, i8* %239
br label %257
240: ; preds = %185
%241 = load i32, i32* %10
%242 = sext i32 %241 to i64
%243 = getelementptr inbounds [1000 x i8], [1000 x i8]* %8, i64 0, i64 %242
store i8 51, i8* %243
br label %257
244: ; preds = %185
%245 = load i32, i32* %10
%246 = sext i32 %245 to i64
%247 = getelementptr inbounds [1000 x i8], [1000 x i8]* %8, i64 0, i64 %246
store i8 50, i8* %247
br label %257
248: ; preds = %185
%249 = load i32, i32* %10
%250 = sext i32 %249 to i64
%251 = getelementptr inbounds [1000 x i8], [1000 x i8]* %8, i64 0, i64 %250
store i8 49, i8* %251
br label %257
252: ; preds = %185
%253 = load i32, i32* %10
%254 = sext i32 %253 to i64
%255 = getelementptr inbounds [1000 x i8], [1000 x i8]* %8, i64 0, i64 %254
store i8 48, i8* %255
br label %257
256: ; preds = %185
br label %257
257: ; preds = %256, %252, %248, %244, %240, %236, %232, %228, %224, %220, %216, %212, %208, %204, %200, %196, %192
%258 = load i32, i32* %10
%259 = add nsw i32 %258, 1
store i32 %259, i32* %10
br label %182
260: ; preds = %182
%261 = getelementptr inbounds [1000 x i8], [1000 x i8]* %8, i64 0, i64 0
%262 = load i32, i32* %2
%263 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.6, i64 0, i64 0), i8* %261, i32 %262)
ret void
}

LLVM IR (-O2):
@.str = [24 x i8] c"Please enter a number: \00"
@.str.1 = [3 x i8] c"%s\00"
@.str.2 = [43 x i8] c"Please enter the initial base (2-10, 16): \00"
@.str.3 = [3 x i8] c"%d\00"
@.str.4 = [41 x i8] c"Please enter the final base (2-10, 16): \00"
@.str.5 = [17 x i8] c"%s in base %d = \00"
@.str.6 = [14 x i8] c"%s in base %d\00"
@switch.table.main = [23 x i32] [i32 79, i32 1, i32 2, i32 3, i32 4, i32 5, i32 6, i32 7, i32 8, i32 9, i32 79, i32 79, i32 79, i32 79, i32 79, i32 79, i32 79, i32 10, i32 11, i32 12, i32 13, i32 14, i32 15]
@switch.table.main.7 = [16 x i8] c"0123456789ABCDEF"
define void @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [1000 x i32]
%4 = alloca [1000 x i32]
%5 = alloca [1000 x i8]
%6 = alloca [1000 x i8]
%7 = bitcast i32* %1 to i8*
store i32 0, i32* %1
%8 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%9 = bitcast [1000 x i32]* %3 to i8*
%10 = bitcast [1000 x i32]* %4 to i8*
%11 = getelementptr inbounds [1000 x i8], [1000 x i8]* %5, i64 0, i64 0
%12 = getelementptr inbounds [1000 x i8], [1000 x i8]* %6, i64 0, i64 0
%13 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([24 x i8], [24 x i8]* @.str, i64 0, i64 0))
%14 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), [1000 x i8]* %5)
br label %15
15: ; preds = %22, %0
%16 = phi i32 [ %25, %22 ], [ 0, %0 ]
%17 = icmp slt i32 %16, 2
br i1 %17, label %22, label %18
18: ; preds = %15
%19 = icmp ugt i32 %16, 10
%20 = icmp ne i32 %16, 16
%21 = and i1 %19, %20
br i1 %21, label %22, label %26
22: ; preds = %15, %18
%23 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([43 x i8], [43 x i8]* @.str.2, i64 0, i64 0))
%24 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %1)
%25 = load i32, i32* %1
br label %15
26: ; preds = %18, %33
%27 = load i32, i32* %2
%28 = icmp slt i32 %27, 2
br i1 %28, label %33, label %29
29: ; preds = %26
%30 = icmp ugt i32 %27, 10
%31 = icmp ne i32 %27, 16
%32 = and i1 %30, %31
br i1 %32, label %33, label %36
33: ; preds = %26, %29
%34 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([41 x i8], [41 x i8]* @.str.4, i64 0, i64 0))
%35 = call i32 (i8*, ...) @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i64 0, i64 0), i32* %2)
br label %26
36: ; preds = %29
%37 = load i32, i32* %1
%38 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([17 x i8], [17 x i8]* @.str.5, i64 0, i64 0), i8* %11, i32 %37)
%39 = load i8, i8* %11
%40 = icmp eq i8 %39, 0
br i1 %40, label %43, label %45
41: ; preds = %60
%42 = trunc i64 %61 to i32
br label %43
43: ; preds = %41, %36
%44 = phi i32 [ 0, %36 ], [ %42, %41 ]
br label %65
45: ; preds = %36, %60
%46 = phi i64 [ %61, %60 ], [ 0, %36 ]
%47 = phi i8 [ %63, %60 ], [ %39, %36 ]
%48 = sext i8 %47 to i32
%49 = add nsw i32 %48, -48
%50 = icmp ult i32 %49, 23
br i1 %50, label %51, label %60
51: ; preds = %45
%52 = lshr i32 8258559, %49
%53 = and i32 %52, 1
%54 = icmp eq i32 %53, 0
br i1 %54, label %60, label %55
55: ; preds = %51
%56 = sext i32 %49 to i64
%57 = getelementptr inbounds [23 x i32], [23 x i32]* @switch.table.main, i64 0, i64 %56
%58 = load i32, i32* %57
%59 = getelementptr inbounds [1000 x i32], [1000 x i32]* %3, i64 0, i64 %46
store i32 %58, i32* %59
br label %60
60: ; preds = %51, %45, %55
%61 = add nuw i64 %46, 1
%62 = getelementptr inbounds [1000 x i8], [1000 x i8]* %5, i64 0, i64 %61
%63 = load i8, i8* %62
%64 = icmp eq i8 %63, 0
br i1 %64, label %41, label %45
65: ; preds = %43, %75
%66 = phi i64 [ 0, %43 ], [ %84, %75 ]
%67 = phi i32 [ 0, %43 ], [ %83, %75 ]
%68 = getelementptr inbounds [1000 x i32], [1000 x i32]* %3, i64 0, i64 %66
%69 = load i32, i32* %68
switch i32 %69, label %75 [
i32 0, label %70
i32 79, label %74
]
70: ; preds = %65
%71 = icmp sgt i32 %67, 0
br i1 %71, label %72, label %147
72: ; preds = %70
%73 = load i32, i32* %2
br label %94
74: ; preds = %65
store i32 0, i32* %68
br label %75
75: ; preds = %65, %74
%76 = phi i32 [ %69, %65 ], [ 0, %74 ]
%77 = load i32, i32* %1
%78 = trunc i64 %66 to i32
%79 = xor i32 %78, -1
%80 = add nsw i32 %44, %79
%81 = call i32 @pow(i32 %77, i32 %80)
%82 = mul nsw i32 %81, %76
%83 = add nsw i32 %82, %67
%84 = add nuw i64 %66, 1
br label %65
85: ; preds = %94
%86 = trunc i64 %100 to i32
%87 = icmp sgt i32 %86, 0
br i1 %87, label %88, label %147
88: ; preds = %85
%89 = and i64 %100, 4294967295
%90 = and i64 %100, 1
%91 = icmp eq i64 %89, 1
br i1 %91, label %132, label %92
92: ; preds = %88
%93 = sub nsw i64 %89, %90
br label %102
94: ; preds = %72, %94
%95 = phi i64 [ 0, %72 ], [ %100, %94 ]
%96 = phi i32 [ %67, %72 ], [ %99, %94 ]
%97 = srem i32 %96, %73
%98 = getelementptr inbounds [1000 x i32], [1000 x i32]* %4, i64 0, i64 %95
store i32 %97, i32* %98
%99 = sdiv i32 %96, %73
%100 = add nuw i64 %95, 1
%101 = icmp sgt i32 %99, 0
br i1 %101, label %94, label %85
102: ; preds = %128, %92
%103 = phi i64 [ %89, %92 ], [ %117, %128 ]
%104 = phi i64 [ 0, %92 ], [ %129, %128 ]
%105 = phi i64 [ 0, %92 ], [ %130, %128 ]
%106 = add i64 %103, 4294967295
%107 = and i64 %106, 4294967295
%108 = getelementptr inbounds [1000 x i32], [1000 x i32]* %4, i64 0, i64 %107
%109 = load i32, i32* %108
%110 = icmp ult i32 %109, 16
br i1 %110, label %111, label %116
111: ; preds = %102
%112 = sext i32 %109 to i64
%113 = getelementptr inbounds [16 x i8], [16 x i8]* @switch.table.main.7, i64 0, i64 %112
%114 = load i8, i8* %113
%115 = getelementptr inbounds [1000 x i8], [1000 x i8]* %6, i64 0, i64 %104
store i8 %114, i8* %115
br label %116
116: ; preds = %102, %111
%117 = add nsw i64 %103, -2
%118 = and i64 %117, 4294967295
%119 = getelementptr inbounds [1000 x i32], [1000 x i32]* %4, i64 0, i64 %118
%120 = load i32, i32* %119
%121 = icmp ult i32 %120, 16
br i1 %121, label %122, label %128
122: ; preds = %116
%123 = or i64 %104, 1
%124 = sext i32 %120 to i64
%125 = getelementptr inbounds [16 x i8], [16 x i8]* @switch.table.main.7, i64 0, i64 %124
%126 = load i8, i8* %125
%127 = getelementptr inbounds [1000 x i8], [1000 x i8]* %6, i64 0, i64 %123
store i8 %126, i8* %127
br label %128
128: ; preds = %122, %116
%129 = add nuw nsw i64 %104, 2
%130 = add i64 %105, 2
%131 = icmp eq i64 %130, %93
br i1 %131, label %132, label %102
132: ; preds = %128, %88
%133 = phi i64 [ %89, %88 ], [ %117, %128 ]
%134 = phi i64 [ 0, %88 ], [ %129, %128 ]
%135 = icmp eq i64 %90, 0
br i1 %135, label %147, label %136
136: ; preds = %132
%137 = add i64 %133, 4294967295
%138 = and i64 %137, 4294967295
%139 = getelementptr inbounds [1000 x i32], [1000 x i32]* %4, i64 0, i64 %138
%140 = load i32, i32* %139
%141 = icmp ult i32 %140, 16
br i1 %141, label %142, label %147
142: ; preds = %136
%143 = sext i32 %140 to i64
%144 = getelementptr inbounds [16 x i8], [16 x i8]* @switch.table.main.7, i64 0, i64 %143
%145 = load i8, i8* %144
%146 = getelementptr inbounds [1000 x i8], [1000 x i8]* %6, i64 0, i64 %134
store i8 %145, i8* %146
br label %147
147: ; preds = %132, %142, %136, %70, %85
%148 = load i32, i32* %2
%149 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([14 x i8], [14 x i8]* @.str.6, i64 0, i64 0), i8* %12, i32 %148)
ret void
}