#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 */
scalar_t__ EOF;
int char2int(char);
int /*<<< orphan*/ printf(char *, ...);
scalar_t__ scanf(char *, char *);
int strlen(char *);
int main() {
  int i;
  char line[10010];
  while (scanf("%s", line) != EOF) {
    for (i = 0; i < strlen(line); i++)
      printf("%d", char2int(line[i]));
    printf("\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x2740,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x2730(%rbp),%rsi
lea    0xea0(%rip),%rdi
call   1060 <scanf@plt>
mov    0x2e7c(%rip),%rcx
cmp    (%rcx),%rax
je     11e3 <main+0xa3>
movl   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%eax
mov    %eax,-0x2734(%rbp)
lea    -0x2730(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x2734(%rbp),%eax
cmp    %ecx,%eax
jge    11d0 <main+0x90>
movslq -0x8(%rbp),%rax
movsbl -0x2730(%rbp,%rax,1),%edi
ff
call   1050 <char2int@plt>
mov    %eax,%esi
lea    0xe48(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x8(%rbp)
jmp    117c <main+0x3c>
lea    0xe2f(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1152 <main+0x12>
xor    %eax,%eax
add    $0x2740,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x2720,%rsp
lea    0xe99(%rip),%rdi
mov    %rsp,%rsi
call   1070 <scanf@plt>
mov    0x2e72(%rip),%r12
cmp    (%r12),%rax
jne    118f <main+0x3f>
xor    %eax,%eax
add    $0x2720,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret
mov    %rsp,%r13
lea    0xe6a(%rip),%r14
lea    0xe60(%rip),%r15
jmp    11cb <main+0x7b>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax)
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %r15,%rdi
mov    %r13,%rsi
call   1070 <scanf@plt>
cmp    (%r12),%rax
je     117c <main+0x2c>
mov    %r13,%rdi
call   1040 <strlen@plt>
test   %eax,%eax
jle    11b0 <main+0x60>
xor    %ebx,%ebx
nopl   0x0(%rax)
movsbl (%rsp,%rbx,1),%edi
call   1060 <char2int@plt>
mov    %r14,%rdi
mov    %eax,%esi
xor    %eax,%eax
call   1050 <printf@plt>
add    $0x1,%rbx
mov    %r13,%rdi
call   1040 <strlen@plt>
cltq
cmp    %rax,%rbx
jl     11e0 <main+0x90>
jmp    11b0 <main+0x60>

LLVM IR (-O0):
@.str = [3 x i8] c"%s\00"
@EOF = global i64 0
@.str.1 = [3 x i8] c"%d\00"
@.str.2 = [2 x i8] c"\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca [10010 x i8]
store i32 0, i32* %1
br label %4
4: ; preds = %25, %0
%5 = getelementptr inbounds [10010 x i8], [10010 x i8]* %3, i64 0, i64 0
%6 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %5)
%7 = load i64, i64* @EOF
%8 = icmp ne i64 %6, %7
br i1 %8, label %9, label %27
9: ; preds = %4
store i32 0, i32* %2
br label %10
10: ; preds = %22, %9
%11 = load i32, i32* %2
%12 = getelementptr inbounds [10010 x i8], [10010 x i8]* %3, i64 0, i64 0
%13 = call i32 @strlen(i8* %12)
%14 = icmp slt i32 %11, %13
br i1 %14, label %15, label %25
15: ; preds = %10
%16 = load i32, i32* %2
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds [10010 x i8], [10010 x i8]* %3, i64 0, i64 %17
%19 = load i8, i8* %18
%20 = call i32 @char2int(i8 signext %19)
%21 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %20)
br label %22
22: ; preds = %15
%23 = load i32, i32* %2
%24 = add nsw i32 %23, 1
store i32 %24, i32* %2
br label %10
25: ; preds = %10
%26 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
br label %4
27: ; preds = %4
ret i32 0
}

LLVM IR (-O2):
@.str = [3 x i8] c"%s\00"
@EOF = global i64 0
@.str.1 = [3 x i8] c"%d\00"
define i32 @main() {
%1 = alloca [10010 x i8]
%2 = getelementptr inbounds [10010 x i8], [10010 x i8]* %1, i64 0, i64 0
%3 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%4 = load i64, i64* @EOF
%5 = icmp eq i64 %3, %4
br i1 %5, label %24, label %6
6: ; preds = %0, %19
%7 = call i32 @strlen(i8* %2)
%8 = icmp sgt i32 %7, 0
br i1 %8, label %9, label %19
9: ; preds = %6, %9
%10 = phi i64 [ %15, %9 ], [ 0, %6 ]
%11 = getelementptr inbounds [10010 x i8], [10010 x i8]* %1, i64 0, i64 %10
%12 = load i8, i8* %11
%13 = call i32 @char2int(i8 signext %12)
%14 = call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i32 %13)
%15 = add nuw nsw i64 %10, 1
%16 = call i32 @strlen(i8* %2)
%17 = sext i32 %16 to i64
%18 = icmp slt i64 %15, %17
br i1 %18, label %9, label %19
19: ; preds = %9, %6
%20 = call i32 @putchar(i32 10)
%21 = call i64 @scanf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8* %2)
%22 = load i64, i64* @EOF
%23 = icmp eq i64 %21, %22
br i1 %23, label %24, label %6
24: ; preds = %19, %0
ret i32 0
}