#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 */
char getchar();
long long in() {
  long long f = 1, p = 0;
  char c = getchar();
  while (c > '9' || c < '0') {
    if (c == '-')
      f = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') {
    p = p * 10 + c - '0';
    c = getchar();
  }
  return f * p;
}


x86 assembly (clang, -O0):
<in>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
movq   $0x1,-0x8(%rbp)
movq   $0x0,-0x10(%rbp)
mov    $0x0,%al
call   1030 <getchar@plt>
mov    %al,-0x11(%rbp)
movsbl -0x11(%rbp),%ecx
mov    $0x1,%al
cmp    $0x39,%ecx
mov    %al,-0x12(%rbp)
jg     1151 <in+0x41>
movsbl -0x11(%rbp),%eax
cmp    $0x30,%eax
setl   %al
mov    %al,-0x12(%rbp)
mov    -0x12(%rbp),%al
test   $0x1,%al
jne    1161 <in+0x51>
jmp    1185 <in+0x75>
movsbl -0x11(%rbp),%eax
cmp    $0x2d,%eax
jne    1176 <in+0x66>
movq   $0xffffffffffffffff,-0x8(%rbp)
ff
mov    $0x0,%al
call   1030 <getchar@plt>
mov    %al,-0x11(%rbp)
jmp    1132 <in+0x22>
jmp    118a <in+0x7a>
movsbl -0x11(%rbp),%ecx
xor    %eax,%eax
cmp    $0x30,%ecx
mov    %al,-0x13(%rbp)
jl     11a9 <in+0x99>
movsbl -0x11(%rbp),%eax
cmp    $0x39,%eax
setle  %al
mov    %al,-0x13(%rbp)
mov    -0x13(%rbp),%al
test   $0x1,%al
jne    11b9 <in+0xa9>
jmp    11dd <in+0xcd>
imul   $0xa,-0x10(%rbp),%rax
movsbq -0x11(%rbp),%rcx
add    %rcx,%rax
sub    $0x30,%rax
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <getchar@plt>
mov    %al,-0x11(%rbp)
jmp    118a <in+0x7a>
mov    -0x8(%rbp),%rax
imul   -0x10(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<in>:
push   %r14
push   %rbx
push   %rax
xor    %eax,%eax
call   1030 <getchar@plt>
mov    %eax,%ecx
add    $0xc6,%cl
mov    $0x1,%r14d
cmp    $0xf5,%cl
ja     1157 <in+0x47>
mov    $0x1,%r14d
mov    $0xffffffffffffffff,%rbx
nopl   0x0(%rax,%rax,1)
cmp    $0x2d,%al
cmove  %rbx,%r14
xor    %eax,%eax
call   1030 <getchar@plt>
mov    %eax,%ecx
add    $0xc6,%cl
cmp    $0xf6,%cl
jb     1140 <in+0x30>
xor    %ebx,%ebx
nopl   0x0(%rax)
lea    (%rbx,%rbx,4),%rcx
movzbl %al,%eax
lea    (%rax,%rcx,2),%rbx
add    $0xffffffffffffffd0,%rbx
xor    %eax,%eax
call   1030 <getchar@plt>
mov    %eax,%ecx
add    $0xd0,%cl
cmp    $0xa,%cl
jb     1160 <in+0x50>
imul   %r14,%rbx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
define i64 @in() {
%1 = alloca i64
%2 = alloca i64
%3 = alloca i8
store i64 1, i64* %1
store i64 0, i64* %2
%4 = call signext i8 (...) @getchar()
store i8 %4, i8* %3
br label %5
5: ; preds = %20, %0
%6 = load i8, i8* %3
%7 = sext i8 %6 to i32
%8 = icmp sgt i32 %7, 57
br i1 %8, label %13, label %9
9: ; preds = %5
%10 = load i8, i8* %3
%11 = sext i8 %10 to i32
%12 = icmp slt i32 %11, 48
br label %13
13: ; preds = %9, %5
%14 = phi i1 [ true, %5 ], [ %12, %9 ]
br i1 %14, label %15, label %22
15: ; preds = %13
%16 = load i8, i8* %3
%17 = sext i8 %16 to i32
%18 = icmp eq i32 %17, 45
br i1 %18, label %19, label %20
19: ; preds = %15
store i64 -1, i64* %1
br label %20
20: ; preds = %19, %15
%21 = call signext i8 (...) @getchar()
store i8 %21, i8* %3
br label %5
22: ; preds = %13
br label %23
23: ; preds = %33, %22
%24 = load i8, i8* %3
%25 = sext i8 %24 to i32
%26 = icmp sge i32 %25, 48
br i1 %26, label %27, label %31
27: ; preds = %23
%28 = load i8, i8* %3
%29 = sext i8 %28 to i32
%30 = icmp sle i32 %29, 57
br label %31
31: ; preds = %27, %23
%32 = phi i1 [ false, %23 ], [ %30, %27 ]
br i1 %32, label %33, label %41
33: ; preds = %31
%34 = load i64, i64* %2
%35 = mul nsw i64 %34, 10
%36 = load i8, i8* %3
%37 = sext i8 %36 to i64
%38 = add nsw i64 %35, %37
%39 = sub nsw i64 %38, 48
store i64 %39, i64* %2
%40 = call signext i8 (...) @getchar()
store i8 %40, i8* %3
br label %23
41: ; preds = %31
%42 = load i64, i64* %1
%43 = load i64, i64* %2
%44 = mul nsw i64 %42, %43
ret i64 %44
}

LLVM IR (-O2):
define i64 @in() {
%1 = tail call signext i8 (...) @getchar()
%2 = add i8 %1, -58
%3 = icmp ult i8 %2, -10
br i1 %3, label %7, label %4
4: ; preds = %7, %0
%5 = phi i64 [ 1, %0 ], [ %11, %7 ]
%6 = phi i8 [ %1, %0 ], [ %12, %7 ]
br label %15
7: ; preds = %0, %7
%8 = phi i8 [ %12, %7 ], [ %1, %0 ]
%9 = phi i64 [ %11, %7 ], [ 1, %0 ]
%10 = icmp eq i8 %8, 45
%11 = select i1 %10, i64 -1, i64 %9
%12 = tail call signext i8 (...) @getchar()
%13 = add i8 %12, -58
%14 = icmp ult i8 %13, -10
br i1 %14, label %7, label %4
15: ; preds = %4, %15
%16 = phi i8 [ %22, %15 ], [ %6, %4 ]
%17 = phi i64 [ %21, %15 ], [ 0, %4 ]
%18 = mul nsw i64 %17, 10
%19 = zext i8 %16 to i64
%20 = add i64 %18, -48
%21 = add i64 %20, %19
%22 = tail call signext i8 (...) @getchar()
%23 = add i8 %22, -48
%24 = icmp ult i8 %23, 10
br i1 %24, label %15, label %25
25: ; preds = %15
%26 = mul nsw i64 %21, %5
ret i64 %26
}