#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_unlocked();
void fastread(int *a) {
  char c = 0;
  while (c < 33) {
    c = getchar_unlocked();
  }
  *a = 0;
  while (c > 33) {
    *a = *a * 10 + c - '0';
    c = getchar_unlocked();
  }
}


x86 assembly (clang, -O0):
<fastread>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movb   $0x0,-0x9(%rbp)
movsbl -0x9(%rbp),%eax
cmp    $0x21,%eax
jge    113c <fastread+0x2c>
mov    $0x0,%al
call   1030 <getchar_unlocked@plt>
mov    %al,-0x9(%rbp)
jmp    1120 <fastread+0x10>
mov    -0x8(%rbp),%rax
movl   $0x0,(%rax)
movsbl -0x9(%rbp),%eax
cmp    $0x21,%eax
jle    1178 <fastread+0x68>
mov    -0x8(%rbp),%rax
imul   $0xa,(%rax),%ecx
movsbl -0x9(%rbp),%eax
add    %eax,%ecx
sub    $0x30,%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
mov    $0x0,%al
call   1030 <getchar_unlocked@plt>
mov    %al,-0x9(%rbp)
jmp    1146 <fastread+0x36>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fastread>:
push   %rbx
mov    %rdi,%rbx
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
xor    %eax,%eax
call   1030 <getchar_unlocked@plt>
cmp    $0x21,%al
jl     1120 <fastread+0x10>
movl   $0x0,(%rbx)
je     116b <fastread+0x5b>
movzbl %al,%eax
add    $0xffffffd0,%eax
mov    %eax,(%rbx)
xor    %eax,%eax
call   1030 <getchar_unlocked@plt>
cmp    $0x22,%al
jl     116b <fastread+0x5b>
cs nopw 0x0(%rax,%rax,1)
mov    (%rbx),%ecx
movzbl %al,%eax
lea    (%rcx,%rcx,4),%ecx
lea    (%rax,%rcx,2),%eax
add    $0xffffffd0,%eax
mov    %eax,(%rbx)
xor    %eax,%eax
call   1030 <getchar_unlocked@plt>
cmp    $0x21,%al
jg     1150 <fastread+0x40>
pop    %rbx
ret

LLVM IR (-O0):
define void @fastread(i32* %0) {
%2 = alloca i32*
%3 = alloca i8
store i32* %0, i32** %2
store i8 0, i8* %3
br label %4
4: ; preds = %8, %1
%5 = load i8, i8* %3
%6 = sext i8 %5 to i32
%7 = icmp slt i32 %6, 33
br i1 %7, label %8, label %10
8: ; preds = %4
%9 = call signext i8 (...) @getchar_unlocked()
store i8 %9, i8* %3
br label %4
10: ; preds = %4
%11 = load i32*, i32** %2
store i32 0, i32* %11
br label %12
12: ; preds = %16, %10
%13 = load i8, i8* %3
%14 = sext i8 %13 to i32
%15 = icmp sgt i32 %14, 33
br i1 %15, label %16, label %26
16: ; preds = %12
%17 = load i32*, i32** %2
%18 = load i32, i32* %17
%19 = mul nsw i32 %18, 10
%20 = load i8, i8* %3
%21 = sext i8 %20 to i32
%22 = add nsw i32 %19, %21
%23 = sub nsw i32 %22, 48
%24 = load i32*, i32** %2
store i32 %23, i32* %24
%25 = call signext i8 (...) @getchar_unlocked()
store i8 %25, i8* %3
br label %12
26: ; preds = %12
ret void
}

LLVM IR (-O2):
define void @fastread(i32* nocapture %0) {
br label %2
2: ; preds = %1, %2
%3 = tail call signext i8 (...) @getchar_unlocked()
%4 = icmp slt i8 %3, 33
br i1 %4, label %2, label %5
5: ; preds = %2
store i32 0, i32* %0
%6 = icmp eq i8 %3, 33
br i1 %6, label %21, label %7
7: ; preds = %5
%8 = zext i8 %3 to i32
%9 = add nsw i32 %8, -48
store i32 %9, i32* %0
%10 = tail call signext i8 (...) @getchar_unlocked()
%11 = icmp sgt i8 %10, 33
br i1 %11, label %12, label %21
12: ; preds = %7, %12
%13 = phi i8 [ %19, %12 ], [ %10, %7 ]
%14 = load i32, i32* %0
%15 = zext i8 %13 to i32
%16 = mul nsw i32 %14, 10
%17 = add nsw i32 %15, -48
%18 = add i32 %17, %16
store i32 %18, i32* %0
%19 = tail call signext i8 (...) @getchar_unlocked()
%20 = icmp sgt i8 %19, 33
br i1 %20, label %12, label %21
21: ; preds = %12, %7, %5
ret void
}