#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 /*<<< orphan*/ printf(char *, int);
scalar_t__ scanf(char *, char *, char *);
int solve(char *);
int main() {
  char str1[15], str2[15];
  while (scanf("%s%s", str1, str2) != EOF) {
    printf("%d\n", solve(str1) + solve(str2));
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    -0x13(%rbp),%rsi
lea    -0x22(%rbp),%rdx
lea    0xeb2(%rip),%rdi
call   1050 <scanf@plt>
mov    0x2e8e(%rip),%rcx
cmp    (%rcx),%rax
je     118e <main+0x5e>
lea    -0x13(%rbp),%rdi
call   1030 <solve@plt>
mov    %eax,-0x28(%rbp)
lea    -0x22(%rbp),%rdi
call   1030 <solve@plt>
mov    -0x28(%rbp),%esi
add    %eax,%esi
lea    0xe81(%rip),%rdi
call   1040 <printf@plt>
jmp    113f <main+0xf>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x28,%rsp
lea    0xebb(%rip),%rdi
lea    0x19(%rsp),%rsi
lea    0xa(%rsp),%rdx
call   1050 <scanf@plt>
mov    0x2e8d(%rip),%r13
cmp    0x0(%r13),%rax
je     11b2 <main+0x82>
lea    0x19(%rsp),%r14
lea    0xa(%rsp),%rbx
lea    0xe93(%rip),%r15
lea    0xe87(%rip),%r12
nopl   0x0(%rax)
mov    %r14,%rdi
call   1030 <solve@plt>
mov    %eax,%ebp
mov    %rbx,%rdi
call   1030 <solve@plt>
add    %eax,%ebp
mov    %r15,%rdi
mov    %ebp,%esi
call   1040 <printf@plt>
mov    %r12,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
call   1050 <scanf@plt>
cmp    0x0(%r13),%rax
jne    1180 <main+0x50>
xor    %eax,%eax
add    $0x28,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%s%s\00"
@EOF = global i64 0
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca [15 x i8]
%3 = alloca [15 x i8]
store i32 0, i32* %1
br label %4
4: ; preds = %10, %0
%5 = getelementptr inbounds [15 x i8], [15 x i8]* %2, i64 0, i64 0
%6 = getelementptr inbounds [15 x i8], [15 x i8]* %3, i64 0, i64 0
%7 = call i64 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %5, i8* %6)
%8 = load i64, i64* @EOF
%9 = icmp ne i64 %7, %8
br i1 %9, label %10, label %17
10: ; preds = %4
%11 = getelementptr inbounds [15 x i8], [15 x i8]* %2, i64 0, i64 0
%12 = call i32 @solve(i8* %11)
%13 = getelementptr inbounds [15 x i8], [15 x i8]* %3, i64 0, i64 0
%14 = call i32 @solve(i8* %13)
%15 = add nsw i32 %12, %14
%16 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %15)
br label %4
17: ; preds = %4
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"%s%s\00"
@EOF = global i64 0
@.str.1 = [4 x i8] c"%d\0A\00"
define i32 @main() {
%1 = alloca [15 x i8]
%2 = alloca [15 x i8]
%3 = getelementptr inbounds [15 x i8], [15 x i8]* %1, i64 0, i64 0
%4 = getelementptr inbounds [15 x i8], [15 x i8]* %2, i64 0, i64 0
%5 = call i64 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %3, i8* %4)
%6 = load i64, i64* @EOF
%7 = icmp eq i64 %5, %6
br i1 %7, label %16, label %8
8: ; preds = %0, %8
%9 = call i32 @solve(i8* %3)
%10 = call i32 @solve(i8* %4)
%11 = add nsw i32 %10, %9
%12 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i32 %11)
%13 = call i64 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i8* %3, i8* %4)
%14 = load i64, i64* @EOF
%15 = icmp eq i64 %13, %14
br i1 %15, label %16, label %8
16: ; preds = %8, %0
ret i32 0
}