#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 *, char **);
int main() {
  char hexa[100];
  scanf("%s", &hexa);
  int i = 0;
  while (hexa[i]) {
    switch (hexa[i]) {
    case '0':
      printf("0000");
      break;
    case '1':
      printf("0001");
      break;
    case '2':
      printf("0010");
      break;
    case '3':
      printf("0011");
      break;
    case '4':
      printf("0100");
      break;
    case '5':
      printf("0101");
      break;
    case '6':
      printf("0110");
      break;
    case '7':
      printf("0111");
      break;
    case '8':
      printf("1000");
      break;
    case '9':
      printf("1001");
      break;
    case 'A':
    case 'a':
      printf("1010");
      break;
    case 'B':
    case 'b':
      printf("1011");
      break;
    case 'C':
    case 'c':
      printf("1100");
      break;
    case 'D':
    case 'd':
      printf("1101");
      break;
    case 'E':
    case 'e':
      printf("1110");
      break;
    case 'F':
    case 'f':
      printf("1111");
      break;
    }
    i++;
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x70(%rbp),%rsi
lea    0xf9f(%rip),%rdi
call   1040 <scanf@plt>
movl   $0x0,-0x74(%rbp)
movslq -0x74(%rbp),%rax
cmpb   $0x0,-0x70(%rbp,%rax,1)
je     12a0 <main+0x180>
movslq -0x74(%rbp),%rax
movsbl -0x70(%rbp,%rax,1),%eax
add    $0xffffffd0,%eax
mov    %eax,%ecx
mov    %rcx,-0x80(%rbp)
sub    $0x36,%eax
ja     1292 <main+0x172>
mov    -0x80(%rbp),%rax
lea    0xe82(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
lea    0xf51(%rip),%rdi
call   1030 <printf@plt>
jmp    1292 <main+0x172>
lea    0xf45(%rip),%rdi
call   1030 <printf@plt>
jmp    1292 <main+0x172>
lea    0xf39(%rip),%rdi
call   1030 <printf@plt>
jmp    1292 <main+0x172>
lea    0xf2d(%rip),%rdi
call   1030 <printf@plt>
jmp    1292 <main+0x172>
lea    0xf21(%rip),%rdi
call   1030 <printf@plt>
jmp    1292 <main+0x172>
lea    0xf15(%rip),%rdi
call   1030 <printf@plt>
jmp    1292 <main+0x172>
lea    0xf09(%rip),%rdi
call   1030 <printf@plt>
jmp    1292 <main+0x172>
lea    0xefd(%rip),%rdi
call   1030 <printf@plt>
jmp    1292 <main+0x172>
lea    0xef1(%rip),%rdi
call   1030 <printf@plt>
jmp    1292 <main+0x172>
lea    0xee5(%rip),%rdi
call   1030 <printf@plt>
jmp    1292 <main+0x172>
lea    0xed9(%rip),%rdi
call   1030 <printf@plt>
jmp    1292 <main+0x172>
lea    0xecd(%rip),%rdi
call   1030 <printf@plt>
jmp    1292 <main+0x172>
lea    0xec1(%rip),%rdi
call   1030 <printf@plt>
jmp    1292 <main+0x172>
lea    0xeb5(%rip),%rdi
call   1030 <printf@plt>
jmp    1292 <main+0x172>
lea    0xea9(%rip),%rdi
call   1030 <printf@plt>
jmp    1292 <main+0x172>
lea    0xe9d(%rip),%rdi
call   1030 <printf@plt>
mov    -0x74(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x74(%rbp)
jmp    1149 <main+0x29>
xor    %eax,%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
sub    $0x70,%rsp
lea    0xed0(%rip),%rdi
mov    %rsp,%rsi
call   1040 <scanf@plt>
mov    (%rsp),%al
test   %al,%al
je     118c <main+0x6c>
lea    0x1(%rsp),%rbx
movabs $0x7e0000007e03ff,%r14
lea    0xeff(%rip),%r15
jmp    116b <main+0x4b>
nopw   0x0(%rax,%rax,1)
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
je     118c <main+0x6c>
movsbl %al,%eax
add    $0xffffffd0,%eax
cmp    $0x36,%eax
ja     1160 <main+0x40>
bt     %rax,%r14
jae    1160 <main+0x40>
cltq
movslq (%r15,%rax,4),%rdi
add    %r15,%rdi
call   1030 <printf@plt>
jmp    1160 <main+0x40>
xor    %eax,%eax
add    $0x70,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@.str.1 = [5 x i8] c"0000\00"
@.str.2 = [5 x i8] c"0001\00"
@.str.3 = [5 x i8] c"0010\00"
@.str.4 = [5 x i8] c"0011\00"
@.str.5 = [5 x i8] c"0100\00"
@.str.6 = [5 x i8] c"0101\00"
@.str.7 = [5 x i8] c"0110\00"
@.str.8 = [5 x i8] c"0111\00"
@.str.9 = [5 x i8] c"1000\00"
@.str.10 = [5 x i8] c"1001\00"
@.str.11 = [5 x i8] c"1010\00"
@.str.12 = [5 x i8] c"1011\00"
@.str.13 = [5 x i8] c"1100\00"
@.str.14 = [5 x i8] c"1101\00"
@.str.15 = [5 x i8] c"1110\00"
@.str.16 = [5 x i8] c"1111\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [100 x i8]
%3 = alloca i32
store i32 0, i32* %1
%4 = bitcast [100 x i8]* %2 to i8**
%5 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8** %4)
store i32 0, i32* %3
br label %6
6: ; preds = %50, %0
%7 = load i32, i32* %3
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 %8
%10 = load i8, i8* %9
%11 = icmp ne i8 %10, 0
br i1 %11, label %12, label %53
12: ; preds = %6
%13 = load i32, i32* %3
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds [100 x i8], [100 x i8]* %2, i64 0, i64 %14
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
switch i32 %17, label %50 [
i32 48, label %18
i32 49, label %20
i32 50, label %22
i32 51, label %24
i32 52, label %26
i32 53, label %28
i32 54, label %30
i32 55, label %32
i32 56, label %34
i32 57, label %36
i32 65, label %38
i32 97, label %38
i32 66, label %40
i32 98, label %40
i32 67, label %42
i32 99, label %42
i32 68, label %44
i32 100, label %44
i32 69, label %46
i32 101, label %46
i32 70, label %48
i32 102, label %48
]
18: ; preds = %12
%19 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0))
br label %50
20: ; preds = %12
%21 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
br label %50
22: ; preds = %12
%23 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0))
br label %50
24: ; preds = %12
%25 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.4, i64 0, i64 0))
br label %50
26: ; preds = %12
%27 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0))
br label %50
28: ; preds = %12
%29 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.6, i64 0, i64 0))
br label %50
30: ; preds = %12
%31 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.7, i64 0, i64 0))
br label %50
32: ; preds = %12
%33 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.8, i64 0, i64 0))
br label %50
34: ; preds = %12
%35 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.9, i64 0, i64 0))
br label %50
36: ; preds = %12
%37 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.10, i64 0, i64 0))
br label %50
38: ; preds = %12, %12
%39 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.11, i64 0, i64 0))
br label %50
40: ; preds = %12, %12
%41 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.12, i64 0, i64 0))
br label %50
42: ; preds = %12, %12
%43 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.13, i64 0, i64 0))
br label %50
44: ; preds = %12, %12
%45 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.14, i64 0, i64 0))
br label %50
46: ; preds = %12, %12
%47 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.15, i64 0, i64 0))
br label %50
48: ; preds = %12, %12
%49 = call i32 @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.16, i64 0, i64 0))
br label %50
50: ; preds = %12, %48, %46, %44, %42, %40, %38, %36, %34, %32, %30, %28, %26, %24, %22, %20, %18
%51 = load i32, i32* %3
%52 = add nsw i32 %51, 1
store i32 %52, i32* %3
br label %6
53: ; preds = %6
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@.str.1 = [5 x i8] c"0000\00"
@.str.2 = [5 x i8] c"0001\00"
@.str.3 = [5 x i8] c"0010\00"
@.str.4 = [5 x i8] c"0011\00"
@.str.5 = [5 x i8] c"0100\00"
@.str.6 = [5 x i8] c"0101\00"
@.str.7 = [5 x i8] c"0110\00"
@.str.8 = [5 x i8] c"0111\00"
@.str.9 = [5 x i8] c"1000\00"
@.str.10 = [5 x i8] c"1001\00"
@.str.11 = [5 x i8] c"1010\00"
@.str.12 = [5 x i8] c"1011\00"
@.str.13 = [5 x i8] c"1100\00"
@.str.14 = [5 x i8] c"1101\00"
@.str.15 = [5 x i8] c"1110\00"
@.str.16 = [5 x i8] c"1111\00"
@reltable.main = [55 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str.1 to i64), i64 ptrtoint ([55 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str.2 to i64), i64 ptrtoint ([55 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str.3 to i64), i64 ptrtoint ([55 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str.4 to i64), i64 ptrtoint ([55 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str.5 to i64), i64 ptrtoint ([55 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str.6 to i64), i64 ptrtoint ([55 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str.7 to i64), i64 ptrtoint ([55 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str.8 to i64), i64 ptrtoint ([55 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str.9 to i64), i64 ptrtoint ([55 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str.10 to i64), i64 ptrtoint ([55 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str.1 to i64), i64 ptrtoint ([55 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str.1 to i64), i64 ptrtoint ([55 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str.1 to i64), i64 ptrtoint ([55 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str.1 to i64), i64 ptrtoint ([55 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str.1 to i64), i64 ptrtoint ([55 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str.1 to i64), i64 ptrtoint ([55 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str.1 to i64), i64 ptrtoint ([55 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str.11 to i64), i64 ptrtoint ([55 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str.12 to i64), i64 ptrtoint ([55 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str.13 to i64), i64 ptrtoint ([55 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str.14 to i64), i64 ptrtoint ([55 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str.15 to i64), i64 ptrtoint ([55 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str.16 to i64), i64 ptrtoint ([55 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str.1 to i64), i64 ptrtoint ([55 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str.1 to i64), i64 ptrtoint ([55 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str.1 to i64), i64 ptrtoint ([55 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str.1 to i64), i64 ptrtoint ([55 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str.1 to i64), i64 ptrtoint ([55 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str.1 to i64), i64 ptrtoint ([55 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str.1 to i64), i64 ptrtoint ([55 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str.1 to i64), i64 ptrtoint ([55 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str.1 to i64), i64 ptrtoint ([55 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str.1 to i64), i64 ptrtoint ([55 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str.1 to i64), i64 ptrtoint ([55 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str.1 to i64), i64 ptrtoint ([55 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str.1 to i64), i64 ptrtoint ([55 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str.1 to i64), i64 ptrtoint ([55 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str.1 to i64), i64 ptrtoint ([55 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str.1 to i64), i64 ptrtoint ([55 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str.1 to i64), i64 ptrtoint ([55 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str.1 to i64), i64 ptrtoint ([55 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str.1 to i64), i64 ptrtoint ([55 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str.1 to i64), i64 ptrtoint ([55 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str.1 to i64), i64 ptrtoint ([55 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str.1 to i64), i64 ptrtoint ([55 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str.1 to i64), i64 ptrtoint ([55 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str.1 to i64), i64 ptrtoint ([55 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str.1 to i64), i64 ptrtoint ([55 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str.1 to i64), i64 ptrtoint ([55 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str.11 to i64), i64 ptrtoint ([55 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str.12 to i64), i64 ptrtoint ([55 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str.13 to i64), i64 ptrtoint ([55 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str.14 to i64), i64 ptrtoint ([55 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str.15 to i64), i64 ptrtoint ([55 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([5 x i8]* @.str.16 to i64), i64 ptrtoint ([55 x i32]* @reltable.main to i64)) to i32)]
define i32 @main() {
%1 = alloca [100 x i8]
%2 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 0
%3 = bitcast [100 x i8]* %1 to i8**
%4 = call i32 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8** %3)
%5 = load i8, i8* %2
%6 = icmp eq i8 %5, 0
br i1 %6, label %28, label %7
7: ; preds = %0, %23
%8 = phi i64 [ %24, %23 ], [ 0, %0 ]
%9 = phi i8 [ %26, %23 ], [ %5, %0 ]
%10 = sext i8 %9 to i32
%11 = add nsw i32 %10, -48
%12 = icmp ult i32 %11, 55
br i1 %12, label %13, label %23
13: ; preds = %7
%14 = zext i32 %11 to i64
%15 = lshr i64 35465847073801215, %14
%16 = and i64 %15, 1
%17 = icmp eq i64 %16, 0
br i1 %17, label %23, label %18
18: ; preds = %13
%19 = sext i32 %11 to i64
%20 = shl i64 %19, 2
%21 = call i8* @llvm.load.relative.i64(i8* bitcast ([55 x i32]* @reltable.main to i8*), i64 %20)
%22 = call i32 @printf(i8* dereferenceable(1) %21)
br label %23
23: ; preds = %13, %7, %18
%24 = add nuw i64 %8, 1
%25 = getelementptr inbounds [100 x i8], [100 x i8]* %1, i64 0, i64 %24
%26 = load i8, i8* %25
%27 = icmp eq i8 %26, 0
br i1 %27, label %28, label %7
28: ; preds = %23, %0
ret i32 0
}