#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 getchar();
void fastint(int *x) {
  register int c = getchar();
  int t = 0;
  for (; ((c < 48 || c > 57) && c != '-'); c = getchar())
    ;
  for (; c > 47 && c < 58; c = getchar()) {
    t = (t << 1) + (t << 3) + c - 48;
  }
  *x = t;
}


x86 assembly (clang, -O0):
<fastint>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    $0x0,%al
call   1030 <getchar@plt>
mov    %eax,-0xc(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x30,-0xc(%rbp)
jl     1146 <fastint+0x36>
xor    %eax,%eax
cmpl   $0x39,-0xc(%rbp)
mov    %al,-0x11(%rbp)
jle    1150 <fastint+0x40>
cmpl   $0x2d,-0xc(%rbp)
setne  %al
mov    %al,-0x11(%rbp)
mov    -0x11(%rbp),%al
test   $0x1,%al
jne    1160 <fastint+0x50>
jmp    1174 <fastint+0x64>
jmp    1165 <fastint+0x55>
mov    $0x0,%al
call   1030 <getchar@plt>
mov    %eax,-0xc(%rbp)
jmp    112d <fastint+0x1d>
jmp    1179 <fastint+0x69>
xor    %eax,%eax
cmpl   $0x2f,-0xc(%rbp)
mov    %al,-0x12(%rbp)
jle    1192 <fastint+0x82>
cmpl   $0x3a,-0xc(%rbp)
setl   %al
mov    %al,-0x12(%rbp)
mov    -0x12(%rbp),%al
test   $0x1,%al
jne    11a2 <fastint+0x92>
jmp    11c8 <fastint+0xb8>
mov    -0x10(%rbp),%eax
shl    $0x1,%eax
mov    -0x10(%rbp),%ecx
shl    $0x3,%ecx
add    %ecx,%eax
add    -0xc(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <getchar@plt>
mov    %eax,-0xc(%rbp)
jmp    1179 <fastint+0x69>
mov    -0x10(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fastint>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
xor    %ebx,%ebx
xor    %eax,%eax
call   1030 <getchar@plt>
cmp    $0x2d,%eax
je     1146 <fastint+0x36>
mov    %eax,%ecx
add    $0xffffffc6,%ecx
cmp    $0xfffffff5,%ecx
ja     1146 <fastint+0x36>
nop
xor    %eax,%eax
call   1030 <getchar@plt>
cmp    $0x2d,%eax
je     1146 <fastint+0x36>
mov    %eax,%ecx
add    $0xffffffc6,%ecx
cmp    $0xfffffff6,%ecx
jb     1130 <fastint+0x20>
lea    -0x30(%rax),%ecx
cmp    $0x9,%ecx
ja     116a <fastint+0x5a>
xor    %ebx,%ebx
lea    (%rbx,%rbx,4),%ecx
lea    (%rax,%rcx,2),%ebx
add    $0xffffffd0,%ebx
xor    %eax,%eax
call   1030 <getchar@plt>
mov    %eax,%ecx
add    $0xffffffd0,%ecx
cmp    $0xa,%ecx
jb     1150 <fastint+0x40>
mov    %ebx,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

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

LLVM IR (-O2):
define void @fastint(i32* nocapture writeonly %0) {
%2 = tail call i32 (...) @getchar()
%3 = add i32 %2, -58
%4 = icmp ult i32 %3, -10
%5 = icmp ne i32 %2, 45
%6 = and i1 %5, %4
br i1 %6, label %11, label %7
7: ; preds = %11, %1
%8 = phi i32 [ %2, %1 ], [ %12, %11 ]
%9 = add nsw i32 %8, -48
%10 = icmp ult i32 %9, 10
br i1 %10, label %17, label %26
11: ; preds = %1, %11
%12 = tail call i32 (...) @getchar()
%13 = add i32 %12, -58
%14 = icmp ult i32 %13, -10
%15 = icmp ne i32 %12, 45
%16 = and i1 %15, %14
br i1 %16, label %11, label %7
17: ; preds = %7, %17
%18 = phi i32 [ %22, %17 ], [ 0, %7 ]
%19 = phi i32 [ %23, %17 ], [ %8, %7 ]
%20 = mul i32 %18, 10
%21 = add nsw i32 %19, -48
%22 = add i32 %21, %20
%23 = tail call i32 (...) @getchar()
%24 = add i32 %23, -48
%25 = icmp ult i32 %24, 10
br i1 %25, label %17, label %26
26: ; preds = %17, %7
%27 = phi i32 [ 0, %7 ], [ %22, %17 ]
store i32 %27, i32* %0
ret void
}