#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 getchar();
int /*<<< orphan*/ printf(char *, ...);
int main() {
  int var;
  char c;
  while ((c = getchar()) != '\n') {
    var = 0;
    var = getchar() - '0';
    var = var * 10 + getchar() - '0';
    if (c == '0') {
      if (var == 0)
        printf(" ");
      else
        printf("%c", 'a' - 1 + var);
    } else {
      printf("%c", 'A' - 1 + var);
    }
  }
  printf("\n");
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,-0x9(%rbp)
movsbl %al,%eax
cmp    $0xa,%eax
je     11d0 <main+0xb0>
movl   $0x0,-0x8(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
sub    $0x30,%eax
mov    %eax,-0x8(%rbp)
imul   $0xa,-0x8(%rbp),%eax
mov    %eax,-0x10(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %eax,%ecx
mov    -0x10(%rbp),%eax
add    %ecx,%eax
sub    $0x30,%eax
mov    %eax,-0x8(%rbp)
movsbl -0x9(%rbp),%eax
cmp    $0x30,%eax
jne    11b7 <main+0x97>
cmpl   $0x0,-0x8(%rbp)
jne    119e <main+0x7e>
lea    0xe6e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11b2 <main+0x92>
mov    -0x8(%rbp),%esi
add    $0x60,%esi
lea    0xe57(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    11cb <main+0xab>
mov    -0x8(%rbp),%esi
add    $0x40,%esi
lea    0xe3e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    112f <main+0xf>
lea    0xe2e(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r14
push   %rbx
push   %rax
jmp    1135 <main+0x15>
cs nopw 0x0(%rax,%rax,1)
call   1030 <putchar@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
mov    %eax,%ebx
shl    $0x18,%ebx
cmp    $0xa000000,%ebx
je     118a <main+0x6a>
xor    %eax,%eax
call   1040 <getchar@plt>
lea    (%rax,%rax,4),%r14d
xor    %eax,%eax
call   1040 <getchar@plt>
lea    (%rax,%r14,2),%ecx
mov    $0x20,%edi
cmp    $0x210,%ecx
je     1176 <main+0x56>
lea    (%rax,%r14,2),%edi
add    $0xfffffe50,%edi
cmp    $0x30000000,%ebx
je     1130 <main+0x10>
lea    (%rax,%r14,2),%edi
add    $0xfffffe30,%edi
jmp    1130 <main+0x10>
mov    $0xa,%edi
call   1030 <putchar@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@.str = [2 x i8] c" \00"
@.str.1 = [3 x i8] c"%c\00"
@.str.2 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8
store i32 0, i32* %1
br label %4
4: ; preds = %34, %0
%5 = call i32 (...) @getchar()
%6 = trunc i32 %5 to i8
store i8 %6, i8* %3
%7 = sext i8 %6 to i32
%8 = icmp ne i32 %7, 10
br i1 %8, label %9, label %35
9: ; preds = %4
store i32 0, i32* %2
%10 = call i32 (...) @getchar()
%11 = sub nsw i32 %10, 48
store i32 %11, i32* %2
%12 = load i32, i32* %2
%13 = mul nsw i32 %12, 10
%14 = call i32 (...) @getchar()
%15 = add nsw i32 %13, %14
%16 = sub nsw i32 %15, 48
store i32 %16, i32* %2
%17 = load i8, i8* %3
%18 = sext i8 %17 to i32
%19 = icmp eq i32 %18, 48
br i1 %19, label %20, label %30
20: ; preds = %9
%21 = load i32, i32* %2
%22 = icmp eq i32 %21, 0
br i1 %22, label %23, label %25
23: ; preds = %20
%24 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
br label %29
25: ; preds = %20
%26 = load i32, i32* %2
%27 = add nsw i32 96, %26
%28 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %27)
br label %29
29: ; preds = %25, %23
br label %34
30: ; preds = %9
%31 = load i32, i32* %2
%32 = add nsw i32 64, %31
%33 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %32)
br label %34
34: ; preds = %30, %29
br label %4
35: ; preds = %4
%36 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
ret i32 0
}

LLVM IR (-O2):
define i32 @main() {
%1 = tail call i32 (...) @getchar()
%2 = shl i32 %1, 24
%3 = icmp eq i32 %2, 167772160
br i1 %3, label %21, label %4
4: ; preds = %0, %4
%5 = phi i32 [ %19, %4 ], [ %2, %0 ]
%6 = tail call i32 (...) @getchar()
%7 = mul i32 %6, 10
%8 = add i32 %7, -480
%9 = tail call i32 (...) @getchar()
%10 = add nsw i32 %8, %9
%11 = icmp eq i32 %5, 805306368
%12 = add nsw i32 %10, 16
%13 = icmp eq i32 %10, 48
%14 = add nsw i32 %10, 48
%15 = select i1 %13, i32 32, i32 %14
%16 = select i1 %11, i32 %15, i32 %12
%17 = tail call i32 @putchar(i32 %16)
%18 = tail call i32 (...) @getchar()
%19 = shl i32 %18, 24
%20 = icmp eq i32 %19, 167772160
br i1 %20, label %21, label %4
21: ; preds = %4, %0
%22 = tail call i32 @putchar(i32 10)
ret i32 0
}