#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 EOF;
char getchar();
scalar_t__ isdigit(char);
int /*<<< orphan*/ push(int);
int main() {
  char c;
  int number_sto = 0;
  int sign;
  while ((c = getchar()) != EOF) {
    if (c == ' ') {
      continue;
    }
    sign = c == '-' ? -1 : 1;
    if (isdigit(c)) {
      number_sto = c - '0';
      while (isdigit(c = getchar())) {
        number_sto = number_sto * 10 + c - '0';
      }
      push(number_sto);
    }
  }
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0x0,-0x4(%rbp)
movl   $0x0,-0xc(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,-0x5(%rbp)
movsbl %al,%eax
mov    0x2e8e(%rip),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     11e9 <main+0xb9>
movsbl -0x5(%rbp),%eax
cmp    $0x20,%eax
jne    1177 <main+0x47>
jmp    1146 <main+0x16>
movsbl -0x5(%rbp),%edx
mov    $0x1,%eax
mov    $0xffffffff,%ecx
cmp    $0x2d,%edx
cmove  %ecx,%eax
mov    %eax,-0x10(%rbp)
movsbl -0x5(%rbp),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%rax
je     11e4 <main+0xb4>
movsbl -0x5(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0xc(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,-0x5(%rbp)
movsbl %al,%edi
call   1030 <isdigit@plt>
cmp    $0x0,%rax
je     11dc <main+0xac>
imul   $0xa,-0xc(%rbp),%eax
movsbl -0x5(%rbp),%ecx
add    %ecx,%eax
sub    $0x30,%eax
mov    %eax,-0xc(%rbp)
jmp    11ab <main+0x7b>
mov    -0xc(%rbp),%edi
call   1050 <push@plt>
jmp    1146 <main+0x16>
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %r15
push   %r14
push   %rbx
xor    %eax,%eax
call   1040 <getchar@plt>
mov    0x2ea5(%rip),%r15
jmp    115f <main+0x2f>
cs nopw 0x0(%rax,%rax,1)
nop
mov    %r14d,%edi
call   1050 <push@plt>
xor    %eax,%eax
call   1040 <getchar@plt>
cmp    (%r15),%al
je     11a7 <main+0x77>
cmp    $0x20,%al
je     1158 <main+0x28>
movsbl %al,%r14d
mov    %r14d,%edi
call   1030 <isdigit@plt>
test   %rax,%rax
je     1158 <main+0x28>
add    $0xffffffd0,%r14d
nopl   (%rax)
xor    %eax,%eax
call   1040 <getchar@plt>
mov    %eax,%ebx
movsbl %al,%edi
call   1030 <isdigit@plt>
test   %rax,%rax
je     1150 <main+0x20>
lea    (%r14,%r14,4),%eax
movsbl %bl,%ecx
lea    (%rcx,%rax,2),%r14d
add    $0xffffffd0,%r14d
jmp    1180 <main+0x50>
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

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

LLVM IR (-O2):
@EOF = global i8 0
define i32 @main() {
%1 = tail call signext i8 (...) @getchar()
%2 = load i8, i8* @EOF
%3 = icmp eq i8 %1, %2
br i1 %3, label %33, label %4
4: ; preds = %0, %29
%5 = phi i8 [ %30, %29 ], [ %1, %0 ]
%6 = sext i8 %5 to i32
%7 = icmp eq i8 %5, 32
br i1 %7, label %29, label %8
8: ; preds = %4
%9 = tail call i64 @isdigit(i8 signext %5)
%10 = icmp eq i64 %9, 0
br i1 %10, label %29, label %11
11: ; preds = %8
%12 = add nsw i32 %6, -48
%13 = tail call signext i8 (...) @getchar()
%14 = tail call i64 @isdigit(i8 signext %13)
%15 = icmp eq i64 %14, 0
br i1 %15, label %26, label %16
16: ; preds = %11, %16
%17 = phi i8 [ %23, %16 ], [ %13, %11 ]
%18 = phi i32 [ %22, %16 ], [ %12, %11 ]
%19 = mul nsw i32 %18, 10
%20 = sext i8 %17 to i32
%21 = add nsw i32 %19, %20
%22 = add nsw i32 %21, -48
%23 = tail call signext i8 (...) @getchar()
%24 = tail call i64 @isdigit(i8 signext %23)
%25 = icmp eq i64 %24, 0
br i1 %25, label %26, label %16
26: ; preds = %16, %11
%27 = phi i32 [ %12, %11 ], [ %22, %16 ]
%28 = tail call i32 @push(i32 %27)
br label %29
29: ; preds = %8, %26, %4
%30 = tail call signext i8 (...) @getchar()
%31 = load i8, i8* @EOF
%32 = icmp eq i8 %30, %31
br i1 %32, label %33, label %4
33: ; preds = %29, %0
ret i32 0
}