#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 scanf(char *, long long *);
int main() {
  long long n;
  while (scanf("%lld", &n) == 1) {
    if (n < 0 && n % 2 == 0)
      printf("Underflow!\n");
    else if (n < 0 && n % 2 != 0)
      printf("Overflow!\n");
    else if (n == 0 || n <= 7)
      printf("Underflow!\n");
    else if (n == 8)
      printf("40320\n");
    else if (n == 9)
      printf("362880\n");
    else if (n == 10)
      printf("3628800\n");
    else if (n == 11)
      printf("39916800\n");
    else if (n == 12)
      printf("479001600\n");
    else if (n == 13)
      printf("6227020800\n");
    else if (n > 13)
      printf("Overflow!\n");
  }
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xeca(%rip),%rdi
lea    -0x10(%rbp),%rsi
call   1040 <scanf@plt>
cmp    $0x1,%eax
jne    12c8 <main+0x1a8>
cmpq   $0x0,-0x10(%rbp)
jge    117c <main+0x5c>
mov    -0x10(%rbp),%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
cmp    $0x0,%rdx
jne    117c <main+0x5c>
lea    0xe93(%rip),%rdi
call   1030 <printf@plt>
jmp    12c3 <main+0x1a3>
cmpq   $0x0,-0x10(%rbp)
jge    11b0 <main+0x90>
mov    -0x10(%rbp),%rax
mov    $0x2,%ecx
cqto
idiv   %rcx
cmp    $0x0,%rdx
je     11b0 <main+0x90>
lea    0xe6b(%rip),%rdi
call   1030 <printf@plt>
jmp    12be <main+0x19e>
cmpq   $0x0,-0x10(%rbp)
je     11c6 <main+0xa6>
cmpq   $0x7,-0x10(%rbp)
jg     11d7 <main+0xb7>
lea    0xe38(%rip),%rdi
call   1030 <printf@plt>
jmp    12b9 <main+0x199>
cmpq   $0x8,-0x10(%rbp)
jne    11f3 <main+0xd3>
lea    0xe33(%rip),%rdi
call   1030 <printf@plt>
jmp    12b4 <main+0x194>
cmpq   $0x9,-0x10(%rbp)
jne    120f <main+0xef>
lea    0xe1e(%rip),%rdi
call   1030 <printf@plt>
jmp    12af <main+0x18f>
cmpq   $0xa,-0x10(%rbp)
jne    122b <main+0x10b>
lea    0xe0a(%rip),%rdi
call   1030 <printf@plt>
jmp    12aa <main+0x18a>
cmpq   $0xb,-0x10(%rbp)
jne    1247 <main+0x127>
lea    0xdf7(%rip),%rdi
call   1030 <printf@plt>
jmp    12a5 <main+0x185>
cmpq   $0xc,-0x10(%rbp)
jne    1263 <main+0x143>
lea    0xde5(%rip),%rdi
call   1030 <printf@plt>
jmp    12a0 <main+0x180>
cmpq   $0xd,-0x10(%rbp)
jne    127f <main+0x15f>
lea    0xdd4(%rip),%rdi
call   1030 <printf@plt>
jmp    129b <main+0x17b>
cmpq   $0xd,-0x10(%rbp)
jle    1296 <main+0x176>
lea    0xd80(%rip),%rdi
call   1030 <printf@plt>
jmp    129b <main+0x17b>
jmp    12a0 <main+0x180>
jmp    12a5 <main+0x185>
jmp    12aa <main+0x18a>
jmp    12af <main+0x18f>
jmp    12b4 <main+0x194>
jmp    12b9 <main+0x199>
jmp    12be <main+0x19e>
jmp    12c3 <main+0x1a3>
jmp    112f <main+0xf>
xor    %eax,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
lea    0xece(%rip),%rdi
mov    %rsp,%rsi
call   1040 <scanf@plt>
cmp    $0x1,%eax
jne    11d5 <main+0xb5>
movabs $0x8000000000000001,%rbx
lea    0xeee(%rip),%r12
movabs $0x8000000000000000,%r13
lea    0xe9b(%rip),%r14
mov    %rsp,%r15
lea    0xec9(%rip),%rbp
jmp    1198 <main+0x78>
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
mov    %rbp,%rdi
call   1030 <puts@plt>
mov    %r14,%rdi
mov    %r15,%rsi
call   1040 <scanf@plt>
cmp    $0x1,%eax
jne    11d5 <main+0xb5>
mov    (%rsp),%rax
mov    %rax,%rcx
and    %rbx,%rcx
mov    %r12,%rdi
cmp    %r13,%rcx
je     1183 <main+0x63>
cmp    %rbx,%rcx
je     1180 <main+0x60>
mov    %r12,%rdi
cmp    $0x8,%rax
jl     1183 <main+0x63>
add    $0xfffffffffffffff8,%rax
mov    %rbp,%rdi
cmp    $0x5,%rax
ja     1183 <main+0x63>
lea    0xe84(%rip),%rcx
movslq (%rcx,%rax,4),%rdi
add    %rcx,%rdi
jmp    1183 <main+0x63>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [5 x i8] c"%lld\00"
@.str.1 = [12 x i8] c"Underflow!\0A\00"
@.str.2 = [11 x i8] c"Overflow!\0A\00"
@.str.3 = [7 x i8] c"40320\0A\00"
@.str.4 = [8 x i8] c"362880\0A\00"
@.str.5 = [9 x i8] c"3628800\0A\00"
@.str.6 = [10 x i8] c"39916800\0A\00"
@.str.7 = [11 x i8] c"479001600\0A\00"
@.str.8 = [12 x i8] c"6227020800\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i64
store i32 0, i32* %1
br label %3
3: ; preds = %76, %0
%4 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64* %2)
%5 = icmp eq i32 %4, 1
br i1 %5, label %6, label %77
6: ; preds = %3
%7 = load i64, i64* %2
%8 = icmp slt i64 %7, 0
br i1 %8, label %9, label %15
9: ; preds = %6
%10 = load i64, i64* %2
%11 = srem i64 %10, 2
%12 = icmp eq i64 %11, 0
br i1 %12, label %13, label %15
13: ; preds = %9
%14 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
br label %76
15: ; preds = %9, %6
%16 = load i64, i64* %2
%17 = icmp slt i64 %16, 0
br i1 %17, label %18, label %24
18: ; preds = %15
%19 = load i64, i64* %2
%20 = srem i64 %19, 2
%21 = icmp ne i64 %20, 0
br i1 %21, label %22, label %24
22: ; preds = %18
%23 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
br label %75
24: ; preds = %18, %15
%25 = load i64, i64* %2
%26 = icmp eq i64 %25, 0
br i1 %26, label %30, label %27
27: ; preds = %24
%28 = load i64, i64* %2
%29 = icmp sle i64 %28, 7
br i1 %29, label %30, label %32
30: ; preds = %27, %24
%31 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0))
br label %74
32: ; preds = %27
%33 = load i64, i64* %2
%34 = icmp eq i64 %33, 8
br i1 %34, label %35, label %37
35: ; preds = %32
%36 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
br label %73
37: ; preds = %32
%38 = load i64, i64* %2
%39 = icmp eq i64 %38, 9
br i1 %39, label %40, label %42
40: ; preds = %37
%41 = call i32 @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.4, i64 0, i64 0))
br label %72
42: ; preds = %37
%43 = load i64, i64* %2
%44 = icmp eq i64 %43, 10
br i1 %44, label %45, label %47
45: ; preds = %42
%46 = call i32 @printf(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.5, i64 0, i64 0))
br label %71
47: ; preds = %42
%48 = load i64, i64* %2
%49 = icmp eq i64 %48, 11
br i1 %49, label %50, label %52
50: ; preds = %47
%51 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.6, i64 0, i64 0))
br label %70
52: ; preds = %47
%53 = load i64, i64* %2
%54 = icmp eq i64 %53, 12
br i1 %54, label %55, label %57
55: ; preds = %52
%56 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.7, i64 0, i64 0))
br label %69
57: ; preds = %52
%58 = load i64, i64* %2
%59 = icmp eq i64 %58, 13
br i1 %59, label %60, label %62
60: ; preds = %57
%61 = call i32 @printf(i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.8, i64 0, i64 0))
br label %68
62: ; preds = %57
%63 = load i64, i64* %2
%64 = icmp sgt i64 %63, 13
br i1 %64, label %65, label %67
65: ; preds = %62
%66 = call i32 @printf(i8* getelementptr inbounds ([11 x i8], [11 x i8]* @.str.2, i64 0, i64 0))
br label %67
67: ; preds = %65, %62
br label %68
68: ; preds = %67, %60
br label %69
69: ; preds = %68, %55
br label %70
70: ; preds = %69, %50
br label %71
71: ; preds = %70, %45
br label %72
72: ; preds = %71, %40
br label %73
73: ; preds = %72, %35
br label %74
74: ; preds = %73, %30
br label %75
75: ; preds = %74, %22
br label %76
76: ; preds = %75, %13
br label %3
77: ; preds = %3
ret i32 0
}

LLVM IR (-O2):
@.str = [5 x i8] c"%lld\00"
@str.9 = [11 x i8] c"6227020800\00"
@str.10 = [10 x i8] c"479001600\00"
@str.11 = [9 x i8] c"39916800\00"
@str.12 = [8 x i8] c"3628800\00"
@str.13 = [7 x i8] c"362880\00"
@str.14 = [6 x i8] c"40320\00"
@str.16 = [10 x i8] c"Overflow!\00"
@str.17 = [11 x i8] c"Underflow!\00"
@reltable.main = [6 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([6 x i8]* @str.14 to i64), i64 ptrtoint ([6 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([7 x i8]* @str.13 to i64), i64 ptrtoint ([6 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([8 x i8]* @str.12 to i64), i64 ptrtoint ([6 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([9 x i8]* @str.11 to i64), i64 ptrtoint ([6 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([10 x i8]* @str.10 to i64), i64 ptrtoint ([6 x i32]* @reltable.main to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([11 x i8]* @str.9 to i64), i64 ptrtoint ([6 x i32]* @reltable.main to i64)) to i32)]
define i32 @main() {
%1 = alloca i64
%2 = bitcast i64* %1 to i8*
%3 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64* %1)
%4 = icmp eq i32 %3, 1
br i1 %4, label %5, label %22
5: ; preds = %0, %17
%6 = load i64, i64* %1
%7 = and i64 %6, -9223372036854775807
switch i64 %7, label %9 [
i64 -9223372036854775808, label %17
i64 -9223372036854775807, label %8
]
8: ; preds = %5
br label %17
9: ; preds = %5
%10 = icmp slt i64 %6, 8
br i1 %10, label %17, label %11
11: ; preds = %9
%12 = add i64 %6, -8
%13 = icmp ult i64 %12, 6
br i1 %13, label %14, label %17
14: ; preds = %11
%15 = shl i64 %12, 2
%16 = call i8* @llvm.load.relative.i64(i8* bitcast ([6 x i32]* @reltable.main to i8*), i64 %15)
br label %17
17: ; preds = %11, %14, %9, %5, %8
%18 = phi i8* [ getelementptr inbounds ([10 x i8], [10 x i8]* @str.16, i64 0, i64 0), %8 ], [ getelementptr inbounds ([11 x i8], [11 x i8]* @str.17, i64 0, i64 0), %5 ], [ getelementptr inbounds ([11 x i8], [11 x i8]* @str.17, i64 0, i64 0), %9 ], [ %16, %14 ], [ getelementptr inbounds ([10 x i8], [10 x i8]* @str.16, i64 0, i64 0), %11 ]
%19 = call i32 @puts(i8* dereferenceable(1) %18)
%20 = call i32 @scanf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str, i64 0, i64 0), i64* %1)
%21 = icmp eq i32 %20, 1
br i1 %21, label %5, label %22
22: ; preds = %17, %0
ret i32 0
}