#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;
unsigned long long Fatorial(unsigned short);
int /*<<< orphan*/ printf(char *, unsigned long long);
scalar_t__ scanf(char *, unsigned short *, unsigned short *);
int main() {
  unsigned short int Num1, Num2;
  unsigned long long int Result, TotFat1, TotFat2;
  while (scanf("%hu%hu", &Num1, &Num2) != EOF) {
    TotFat1 = Fatorial(Num1);
    TotFat2 = Fatorial(Num2);
    Result = TotFat1 + TotFat2;
    printf("%llu\n", Result);
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeba(%rip),%rdi
lea    -0x6(%rbp),%rsi
lea    -0x8(%rbp),%rdx
call   1050 <scanf@plt>
mov    0x2e8e(%rip),%rcx
cmp    (%rcx),%rax
je     119e <main+0x6e>
movzwl -0x6(%rbp),%edi
call   1040 <Fatorial@plt>
mov    %rax,-0x18(%rbp)
movzwl -0x8(%rbp),%edi
call   1040 <Fatorial@plt>
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%rax
add    -0x20(%rbp),%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rsi
lea    0xe73(%rip),%rdi
call   1030 <printf@plt>
jmp    113f <main+0xf>
xor    %eax,%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
lea    0xebe(%rip),%rdi
lea    0x6(%rsp),%rsi
lea    0x4(%rsp),%rdx
call   1050 <scanf@plt>
mov    0x2e90(%rip),%rbp
cmp    0x0(%rbp),%rax
je     11b9 <main+0x89>
lea    0xea2(%rip),%r14
lea    0xe94(%rip),%r15
lea    0x6(%rsp),%r12
lea    0x4(%rsp),%r13
cs nopw 0x0(%rax,%rax,1)
movzwl 0x6(%rsp),%edi
call   1040 <Fatorial@plt>
mov    %rax,%rbx
movzwl 0x4(%rsp),%edi
call   1040 <Fatorial@plt>
add    %rax,%rbx
mov    %r14,%rdi
mov    %rbx,%rsi
call   1030 <printf@plt>
mov    %r15,%rdi
mov    %r12,%rsi
mov    %r13,%rdx
call   1050 <scanf@plt>
cmp    0x0(%rbp),%rax
jne    1180 <main+0x50>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

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