#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 EOF;
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, int);
int getc(int /*<<< orphan*/);
int /*<<< orphan*/ stderr;
int /*<<< orphan*/ stdin;
int Parser(int *value) {
  int chi;
  *value = 0;
  chi = 0;
  while (chi != EOF) {
    chi = getc(stdin);
    if (chi < 32)
      fprintf(stderr, "%2.2x", chi);
    else
      fprintf(stderr, "%c", chi);
    if ((chi >= '0') && (chi <= '9')) {
      *value *= 10;
      *value += (chi - '0');
      continue;
    } else if ((chi >= 'A') && (chi <= 'Z')) {
      return chi;
    } else
      return EOF;
  }
  return EOF;
}


x86 assembly (clang, -O0):
<Parser>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movl   $0x0,(%rax)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    0x2e99(%rip),%rcx
cmp    (%rcx),%eax
je     11ff <Parser+0xdf>
mov    0x2e92(%rip),%rax
mov    (%rax),%edi
call   1040 <getc@plt>
mov    %eax,-0x14(%rbp)
cmpl   $0x20,-0x14(%rbp)
jge    1187 <Parser+0x67>
mov    0x2e5f(%rip),%rax
mov    (%rax),%edi
mov    -0x14(%rbp),%edx
lea    0xe83(%rip),%rsi
call   1030 <fprintf@plt>
jmp    119f <Parser+0x7f>
mov    0x2e42(%rip),%rax
mov    (%rax),%edi
mov    -0x14(%rbp),%edx
lea    0xe6c(%rip),%rsi
call   1030 <fprintf@plt>
cmpl   $0x30,-0x14(%rbp)
jl     11cf <Parser+0xaf>
cmpl   $0x39,-0x14(%rbp)
jg     11cf <Parser+0xaf>
mov    -0x10(%rbp),%rax
imul   $0xa,(%rax),%ecx
mov    %ecx,(%rax)
mov    -0x14(%rbp),%ecx
sub    $0x30,%ecx
mov    -0x10(%rbp),%rax
add    (%rax),%ecx
mov    %ecx,(%rax)
jmp    113d <Parser+0x1d>
cmpl   $0x41,-0x14(%rbp)
jl     11ee <Parser+0xce>
cmpl   $0x5a,-0x14(%rbp)
jg     11ee <Parser+0xce>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    120b <Parser+0xeb>
mov    0x2deb(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
jmp    120b <Parser+0xeb>
mov    0x2dda(%rip),%rax
mov    (%rax),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Parser>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
movl   $0x0,(%rdi)
mov    0x2ea8(%rip),%r12
cmpl   $0x0,(%r12)
je     1199 <Parser+0x79>
mov    %rdi,%r14
mov    0x2e9f(%rip),%r13
mov    0x2e80(%rip),%rbp
lea    0xeaf(%rip),%r15
nopw   0x0(%rax,%rax,1)
mov    0x0(%r13),%edi
call   1040 <getc@plt>
mov    %eax,%ebx
mov    0x0(%rbp),%edi
cmp    $0x1f,%eax
jle    119d <Parser+0x7d>
mov    %r15,%rsi
mov    %ebx,%edx
call   1030 <fprintf@plt>
lea    -0x30(%rbx),%eax
cmp    $0x9,%eax
ja     11ab <Parser+0x8b>
mov    (%r14),%ecx
lea    (%rcx,%rcx,4),%ecx
lea    (%rax,%rcx,2),%eax
mov    %eax,(%r14)
cmp    (%r12),%ebx
jne    1160 <Parser+0x40>
jmp    11b9 <Parser+0x99>
xor    %ebx,%ebx
jmp    11b9 <Parser+0x99>
lea    0xe5c(%rip),%rsi
mov    %ebx,%edx
call   1030 <fprintf@plt>
mov    %ebx,%eax
add    $0xffffffbf,%eax
cmp    $0x1a,%eax
jb     11b9 <Parser+0x99>
mov    (%r12),%ebx
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@EOF = global i32 0
@stdin = global i32 0
@stderr = global i32 0
@.str = [6 x i8] c"%2.2x\00"
@.str.1 = [3 x i8] c"%c\00"
define i32 @Parser(i32* %0) {
%2 = alloca i32
%3 = alloca i32*
%4 = alloca i32
store i32* %0, i32** %3
%5 = load i32*, i32** %3
store i32 0, i32* %5
store i32 0, i32* %4
br label %6
6: ; preds = %29, %1
%7 = load i32, i32* %4
%8 = load i32, i32* @EOF
%9 = icmp ne i32 %7, %8
br i1 %9, label %10, label %48
10: ; preds = %6
%11 = load i32, i32* @stdin
%12 = call i32 @getc(i32 %11)
store i32 %12, i32* %4
%13 = load i32, i32* %4
%14 = icmp slt i32 %13, 32
br i1 %14, label %15, label %19
15: ; preds = %10
%16 = load i32, i32* @stderr
%17 = load i32, i32* %4
%18 = call i32 @fprintf(i32 %16, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %17)
br label %23
19: ; preds = %10
%20 = load i32, i32* @stderr
%21 = load i32, i32* %4
%22 = call i32 @fprintf(i32 %20, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %21)
br label %23
23: ; preds = %19, %15
%24 = load i32, i32* %4
%25 = icmp sge i32 %24, 48
br i1 %25, label %26, label %38
26: ; preds = %23
%27 = load i32, i32* %4
%28 = icmp sle i32 %27, 57
br i1 %28, label %29, label %38
29: ; preds = %26
%30 = load i32*, i32** %3
%31 = load i32, i32* %30
%32 = mul nsw i32 %31, 10
store i32 %32, i32* %30
%33 = load i32, i32* %4
%34 = sub nsw i32 %33, 48
%35 = load i32*, i32** %3
%36 = load i32, i32* %35
%37 = add nsw i32 %36, %34
store i32 %37, i32* %35
br label %6
38: ; preds = %26, %23
%39 = load i32, i32* %4
%40 = icmp sge i32 %39, 65
br i1 %40, label %41, label %46
41: ; preds = %38
%42 = load i32, i32* %4
%43 = icmp sle i32 %42, 90
br i1 %43, label %44, label %46
44: ; preds = %41
%45 = load i32, i32* %4
store i32 %45, i32* %2
br label %50
46: ; preds = %41, %38
%47 = load i32, i32* @EOF
store i32 %47, i32* %2
br label %50
48: ; preds = %6
%49 = load i32, i32* @EOF
store i32 %49, i32* %2
br label %50
50: ; preds = %48, %46, %44
%51 = load i32, i32* %2
ret i32 %51
}

LLVM IR (-O2):
@EOF = global i32 0
@stdin = global i32 0
@stderr = global i32 0
@.str = [6 x i8] c"%2.2x\00"
@.str.1 = [3 x i8] c"%c\00"
define i32 @Parser(i32* nocapture %0) {
store i32 0, i32* %0
%2 = load i32, i32* @EOF
%3 = icmp eq i32 %2, 0
br i1 %3, label %26, label %4
4: ; preds = %1, %15
%5 = load i32, i32* @stdin
%6 = tail call i32 @getc(i32 %5)
%7 = icmp slt i32 %6, 32
%8 = load i32, i32* @stderr
br i1 %7, label %9, label %11
9: ; preds = %4
%10 = tail call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 %6)
br label %21
11: ; preds = %4
%12 = tail call i32 @fprintf(i32 %8, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %6)
%13 = add nsw i32 %6, -48
%14 = icmp ult i32 %13, 10
br i1 %14, label %15, label %21
15: ; preds = %11
%16 = load i32, i32* %0
%17 = mul nsw i32 %16, 10
%18 = add nsw i32 %17, %13
store i32 %18, i32* %0
%19 = load i32, i32* @EOF
%20 = icmp eq i32 %6, %19
br i1 %20, label %26, label %4
21: ; preds = %11, %9
%22 = add i32 %6, -65
%23 = icmp ult i32 %22, 26
%24 = load i32, i32* @EOF
%25 = select i1 %23, i32 %6, i32 %24
br label %26
26: ; preds = %15, %1, %21
%27 = phi i32 [ %25, %21 ], [ 0, %1 ], [ %6, %15 ]
ret i32 %27
}