#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 */
unsigned int atoi(char *);
long long pow(int, int);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ scanf(char *, char *);
scalar_t__ strcmp(char *, char *);
int strlen(char *);
int main() {
  int tam, k = 0, l = 0, pos = 0;
  long long r = 0, resul = 0;
  char ent[11], val;
  unsigned int v = 0, v1 = 0, v2 = 0, v3 = 0, j = 0, conv = 0;
  int q = 0, i = 0;
  while ((ent[0] == '0' && ent[1] == 'x') || conv >= 0) {
    scanf("%s", ent);
    conv = atoi(ent);
    resul = 0;
    if (ent[0] == '-') {
      break;
    } else if (strcmp(ent, "0x80000000") == 0) {
      printf("2147483648\n");
    } else if (ent[0] == '0' && ent[1] == 'x') {
      tam = strlen(ent) - 1;
      for (i = tam; i >= 0; i--) {
        val = ent[i];
        if (val == 'x' && ent[i - 1] == '0') {
        } else if (val == '0' && ent[i + 1] == 'x') {
        } else if (val == 'A' || val == 'a') {
          r = 10;
          pos = tam - i;
          resul = resul + (r * pow(16, pos));
        } else if (val == 'B' || val == 'b') {
          r = 11;
          pos = tam - i;
          resul = resul + (r * pow(16, pos));
        } else if (val == 'C' || val == 'c') {
          r = 12;
          pos = tam - i;
          resul = resul + (r * pow(16, pos));
        } else if (val == 'D' || val == 'd') {
          r = 13;
          pos = tam - i;
          resul = resul + (r * pow(16, pos));
        } else if (val == 'E' || val == 'e') {
          r = 14;
          pos = tam - i;
          resul = resul + (r * pow(16, pos));
        } else if (val == 'F' || val == 'f') {
          r = 15;
          pos = tam - i;
          resul = resul + (r * pow(16, pos));
        } else {
          r = val - 48;
          pos = tam - i;
          resul = resul + (r * pow(16, pos));
        }
      }
      printf("%i\n", resul);
    } else {
      v = atoi(ent);
      printf("0x%X\n", v);
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0xd0,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movq   $0x0,-0x20(%rbp)
movq   $0x0,-0x28(%rbp)
movl   $0x0,-0x38(%rbp)
movl   $0x0,-0x3c(%rbp)
movl   $0x0,-0x40(%rbp)
movl   $0x0,-0x44(%rbp)
movl   $0x0,-0x48(%rbp)
movl   $0x0,-0x4c(%rbp)
movl   $0x0,-0x50(%rbp)
movl   $0x0,-0x54(%rbp)
movsbl -0x33(%rbp),%eax
cmp    $0x30,%eax
jne    11ee <main+0x8e>
movsbl -0x32(%rbp),%ecx
mov    $0x1,%al
cmp    $0x78,%ecx
mov    %al,-0x55(%rbp)
je     11f8 <main+0x98>
cmpl   $0x0,-0x4c(%rbp)
setae  %al
mov    %al,-0x55(%rbp)
mov    -0x55(%rbp),%al
test   $0x1,%al
jne    1208 <main+0xa8>
jmp    1649 <main+0x4e9>
lea    -0x33(%rbp),%rsi
lea    0xded(%rip),%rdi
call   1060 <scanf@plt>
lea    -0x33(%rbp),%rdi
call   1080 <atoi@plt>
mov    %eax,-0x4c(%rbp)
movq   $0x0,-0x28(%rbp)
movsbl -0x33(%rbp),%eax
cmp    $0x2d,%eax
jne    123e <main+0xde>
jmp    1649 <main+0x4e9>
lea    -0x33(%rbp),%rdi
lea    0xdba(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    126b <main+0x10b>
lea    0xdaf(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    163f <main+0x4df>
movsbl -0x33(%rbp),%eax
cmp    $0x30,%eax
jne    161d <main+0x4bd>
movsbl -0x32(%rbp),%eax
cmp    $0x78,%eax
jne    161d <main+0x4bd>
lea    -0x33(%rbp),%rdi
call   1030 <strlen@plt>
sub    $0x1,%eax
mov    %eax,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x54(%rbp)
cmpl   $0x0,-0x54(%rbp)
jl     1606 <main+0x4a6>
movslq -0x54(%rbp),%rax
mov    -0x33(%rbp,%rax,1),%al
mov    %al,-0x34(%rbp)
movsbl -0x34(%rbp),%eax
cmp    $0x78,%eax
jne    12d7 <main+0x177>
mov    -0x54(%rbp),%eax
sub    $0x1,%eax
cltq
movsbl -0x33(%rbp,%rax,1),%eax
cmp    $0x30,%eax
jne    12d7 <main+0x177>
jmp    15f3 <main+0x493>
movsbl -0x34(%rbp),%eax
cmp    $0x30,%eax
jne    12ff <main+0x19f>
mov    -0x54(%rbp),%eax
add    $0x1,%eax
cltq
movsbl -0x33(%rbp,%rax,1),%eax
cmp    $0x78,%eax
jne    12ff <main+0x19f>
jmp    15ee <main+0x48e>
movsbl -0x34(%rbp),%eax
cmp    $0x41,%eax
je     1319 <main+0x1b9>
movsbl -0x34(%rbp),%eax
cmp    $0x61,%eax
jne    1362 <main+0x202>
movq   $0xa,-0x20(%rbp)
mov    -0x8(%rbp),%eax
sub    -0x54(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x60(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x68(%rbp)
mov    -0x14(%rbp),%esi
mov    $0x10,%edi
call   1070 <pow@plt>
mov    -0x68(%rbp),%rcx
mov    %rax,%rdx
mov    -0x60(%rbp),%rax
imul   %rdx,%rcx
add    %rcx,%rax
mov    %rax,-0x28(%rbp)
jmp    15e9 <main+0x489>
movsbl -0x34(%rbp),%eax
cmp    $0x42,%eax
je     137c <main+0x21c>
movsbl -0x34(%rbp),%eax
cmp    $0x62,%eax
jne    13c5 <main+0x265>
movq   $0xb,-0x20(%rbp)
mov    -0x8(%rbp),%eax
sub    -0x54(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x70(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x78(%rbp)
mov    -0x14(%rbp),%esi
mov    $0x10,%edi
call   1070 <pow@plt>
mov    -0x78(%rbp),%rcx
mov    %rax,%rdx
mov    -0x70(%rbp),%rax
imul   %rdx,%rcx
add    %rcx,%rax
mov    %rax,-0x28(%rbp)
jmp    15e4 <main+0x484>
movsbl -0x34(%rbp),%eax
cmp    $0x43,%eax
je     13df <main+0x27f>
movsbl -0x34(%rbp),%eax
cmp    $0x63,%eax
jne    142e <main+0x2ce>
movq   $0xc,-0x20(%rbp)
mov    -0x8(%rbp),%eax
sub    -0x54(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x80(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x88(%rbp)
mov    -0x14(%rbp),%esi
mov    $0x10,%edi
call   1070 <pow@plt>
mov    -0x88(%rbp),%rcx
mov    %rax,%rdx
mov    -0x80(%rbp),%rax
imul   %rdx,%rcx
add    %rcx,%rax
mov    %rax,-0x28(%rbp)
jmp    15df <main+0x47f>
movsbl -0x34(%rbp),%eax
cmp    $0x44,%eax
je     1448 <main+0x2e8>
movsbl -0x34(%rbp),%eax
cmp    $0x64,%eax
jne    149d <main+0x33d>
movq   $0xd,-0x20(%rbp)
mov    -0x8(%rbp),%eax
sub    -0x54(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0x90(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0x98(%rbp)
mov    -0x14(%rbp),%esi
mov    $0x10,%edi
call   1070 <pow@plt>
mov    -0x98(%rbp),%rcx
mov    %rax,%rdx
mov    -0x90(%rbp),%rax
imul   %rdx,%rcx
add    %rcx,%rax
mov    %rax,-0x28(%rbp)
jmp    15da <main+0x47a>
movsbl -0x34(%rbp),%eax
cmp    $0x45,%eax
je     14b7 <main+0x357>
movsbl -0x34(%rbp),%eax
cmp    $0x65,%eax
jne    150c <main+0x3ac>
movq   $0xe,-0x20(%rbp)
mov    -0x8(%rbp),%eax
sub    -0x54(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0xa0(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0xa8(%rbp)
mov    -0x14(%rbp),%esi
mov    $0x10,%edi
call   1070 <pow@plt>
mov    -0xa8(%rbp),%rcx
mov    %rax,%rdx
mov    -0xa0(%rbp),%rax
imul   %rdx,%rcx
add    %rcx,%rax
mov    %rax,-0x28(%rbp)
jmp    15d5 <main+0x475>
movsbl -0x34(%rbp),%eax
cmp    $0x46,%eax
je     1526 <main+0x3c6>
movsbl -0x34(%rbp),%eax
cmp    $0x66,%eax
jne    157b <main+0x41b>
movq   $0xf,-0x20(%rbp)
mov    -0x8(%rbp),%eax
sub    -0x54(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0xb0(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0xb8(%rbp)
mov    -0x14(%rbp),%esi
mov    $0x10,%edi
call   1070 <pow@plt>
mov    -0xb8(%rbp),%rcx
mov    %rax,%rdx
mov    -0xb0(%rbp),%rax
imul   %rdx,%rcx
add    %rcx,%rax
mov    %rax,-0x28(%rbp)
jmp    15d0 <main+0x470>
movsbl -0x34(%rbp),%eax
sub    $0x30,%eax
cltq
mov    %rax,-0x20(%rbp)
mov    -0x8(%rbp),%eax
sub    -0x54(%rbp),%eax
mov    %eax,-0x14(%rbp)
mov    -0x28(%rbp),%rax
mov    %rax,-0xc0(%rbp)
mov    -0x20(%rbp),%rax
mov    %rax,-0xc8(%rbp)
mov    -0x14(%rbp),%esi
mov    $0x10,%edi
call   1070 <pow@plt>
mov    -0xc8(%rbp),%rcx
mov    %rax,%rdx
mov    -0xc0(%rbp),%rax
imul   %rdx,%rcx
add    %rcx,%rax
mov    %rax,-0x28(%rbp)
jmp    15d5 <main+0x475>
jmp    15da <main+0x47a>
jmp    15df <main+0x47f>
jmp    15e4 <main+0x484>
jmp    15e9 <main+0x489>
jmp    15ee <main+0x48e>
jmp    15f3 <main+0x493>
jmp    15f8 <main+0x498>
mov    -0x54(%rbp),%eax
add    $0xffffffff,%eax
mov    %eax,-0x54(%rbp)
jmp    129a <main+0x13a>
mov    -0x28(%rbp),%rsi
lea    0xa09(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    163a <main+0x4da>
lea    -0x33(%rbp),%rdi
call   1080 <atoi@plt>
mov    %eax,-0x38(%rbp)
mov    -0x38(%rbp),%esi
lea    0x9eb(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    163f <main+0x4df>
jmp    1644 <main+0x4e4>
jmp    11cf <main+0x6f>
xor    %eax,%eax
add    $0xd0,%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    0xe7b(%rip),%rdi
lea    0xd(%rsp),%rsi
call   1070 <scanf@plt>
cmpb   $0x2d,0xd(%rsp)
jne    11a7 <main+0x37>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret
lea    0xe55(%rip),%rbp
lea    0xd(%rsp),%rbx
lea    0xe46(%rip),%r12
jmp    11de <main+0x6e>
nopl   0x0(%rax)
lea    0xe51(%rip),%rdi
call   1030 <puts@plt>
mov    %r12,%rdi
mov    %rbx,%rsi
call   1070 <scanf@plt>
cmpb   $0x2d,0xd(%rsp)
je     1196 <main+0x26>
mov    %rbx,%rdi
mov    %rbp,%rsi
call   1060 <strcmp@plt>
test   %rax,%rax
je     11c0 <main+0x50>
cmpb   $0x30,0xd(%rsp)
jne    12c0 <main+0x150>
cmpb   $0x78,0xe(%rsp)
jne    12c0 <main+0x150>
mov    %rbx,%rdi
call   1040 <strlen@plt>
test   %eax,%eax
jle    12dd <main+0x16d>
mov    %eax,%r15d
add    $0x1,%r15
xor    %ebp,%ebp
xor    %r13d,%r13d
jmp    125c <main+0xec>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
movzbl %cl,%r14d
add    $0xb,%r14
mov    $0x10,%edi
mov    %ebp,%esi
call   1080 <pow@plt>
imul   %r14,%rax
add    %rax,%r13
add    $0xffffffffffffffff,%r15
add    $0x1,%ebp
cmp    $0x1,%r15
jbe    12e0 <main+0x170>
movsbq 0xb(%rsp,%r15,1),%rax
cmp    $0x30,%rax
je     1280 <main+0x110>
cmp    $0x78,%al
jne    1290 <main+0x120>
cmpb   $0x30,0xa(%rsp,%r15,1)
je     124b <main+0xdb>
jmp    1288 <main+0x118>
cs nopw 0x0(%rax,%rax,1)
cmpb   $0x78,0xc(%rsp,%r15,1)
je     124b <main+0xdb>
mov    %eax,%ecx
and    $0xdf,%cl
jmp    12a0 <main+0x130>
nop
mov    %eax,%ecx
and    $0xdf,%cl
mov    $0xa,%r14d
cmp    $0x41,%cl
je     1238 <main+0xc8>
add    $0xbe,%cl
cmp    $0x5,%cl
jb     1230 <main+0xc0>
add    $0xffffffffffffffd0,%rax
mov    %rax,%r14
jmp    1238 <main+0xc8>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %rbx,%rdi
call   1090 <atoi@plt>
lea    0xd43(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
jmp    11cc <main+0x5c>
xor    %r13d,%r13d
lea    0xd27(%rip),%rdi
mov    %r13,%rsi
xor    %eax,%eax
call   1050 <printf@plt>
lea    0xd0b(%rip),%rbp
jmp    11cc <main+0x5c>

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

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [11 x i8] c"0x80000000\00"
@.str.3 = [4 x i8] c"%i\0A\00"
@.str.4 = [6 x i8] c"0x%X\0A\00"
@str = [11 x i8] c"2147483648\00"
define i32 @main() {
%1 = alloca [11 x i8]
%2 = getelementptr inbounds [11 x i8], [11 x i8]* %1, i64 0, i64 0
%3 = getelementptr inbounds [11 x i8], [11 x i8]* %1, i64 0, i64 1
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%5 = load i8, i8* %2
%6 = icmp eq i8 %5, 45
br i1 %6, label %74, label %7
7: ; preds = %0, %70
%8 = call i64 @strcmp(i8* %2, i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.1, i64 0, i64 0))
%9 = icmp eq i64 %8, 0
br i1 %9, label %10, label %12
10: ; preds = %7
%11 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([11 x i8], [11 x i8]* @str, i64 0, i64 0))
br label %70
12: ; preds = %7
%13 = load i8, i8* %2
%14 = icmp eq i8 %13, 48
%15 = load i8, i8* %3
%16 = icmp eq i8 %15, 120
%17 = select i1 %14, i1 %16, i1 false
br i1 %17, label %18, label %67
18: ; preds = %12
%19 = call i32 @strlen(i8* %2)
%20 = icmp sgt i32 %19, 0
br i1 %20, label %21, label %64
21: ; preds = %18
%22 = zext i32 %19 to i64
br label %23
23: ; preds = %21, %61
%24 = phi i64 [ %22, %21 ], [ %26, %61 ]
%25 = phi i64 [ 0, %21 ], [ %62, %61 ]
%26 = add nsw i64 %24, -1
%27 = getelementptr inbounds [11 x i8], [11 x i8]* %1, i64 0, i64 %26
%28 = load i8, i8* %27
%29 = sext i8 %28 to i64
switch i8 %28, label %41 [
i8 120, label %30
i8 48, label %35
]
30: ; preds = %23
%31 = add nsw i64 %24, -2
%32 = getelementptr inbounds [11 x i8], [11 x i8]* %1, i64 0, i64 %31
%33 = load i8, i8* %32
%34 = icmp eq i8 %33, 48
br i1 %34, label %61, label %39
35: ; preds = %23
%36 = getelementptr inbounds [11 x i8], [11 x i8]* %1, i64 0, i64 %24
%37 = load i8, i8* %36
%38 = icmp eq i8 %37, 120
br i1 %38, label %61, label %39
39: ; preds = %30, %35
%40 = and i8 %28, -33
br label %44
41: ; preds = %23
%42 = and i8 %28, -33
%43 = icmp eq i8 %42, 65
br i1 %43, label %53, label %44
44: ; preds = %39, %41
%45 = phi i8 [ %40, %39 ], [ %42, %41 ]
%46 = add i8 %45, -66
%47 = icmp ult i8 %46, 5
br i1 %47, label %50, label %48
48: ; preds = %44
%49 = add nsw i64 %29, -48
br label %53
50: ; preds = %44
%51 = zext i8 %46 to i64
%52 = add nuw nsw i64 %51, 11
br label %53
53: ; preds = %50, %41, %48
%54 = phi i64 [ %49, %48 ], [ 10, %41 ], [ %52, %50 ]
%55 = trunc i64 %26 to i32
%56 = xor i32 %55, -1
%57 = add i32 %19, %56
%58 = call i64 @pow(i32 16, i32 %57)
%59 = mul nsw i64 %58, %54
%60 = add nsw i64 %59, %25
br label %61
61: ; preds = %53, %30, %35
%62 = phi i64 [ %25, %30 ], [ %25, %35 ], [ %60, %53 ]
%63 = icmp ugt i64 %24, 1
br i1 %63, label %23, label %64
64: ; preds = %61, %18
%65 = phi i64 [ 0, %18 ], [ %62, %61 ]
%66 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 0), i64 %65)
br label %70
67: ; preds = %12
%68 = call i32 @atoi(i8* %2)
%69 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([6 x i8], [6 x i8]* @.str.4, i64 0, i64 0), i32 %68)
br label %70
70: ; preds = %10, %67, %64
%71 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%72 = load i8, i8* %2
%73 = icmp eq i8 %72, 45
br i1 %73, label %74, label %7
74: ; preds = %70, %0
ret i32 0
}