#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;
int /*<<< orphan*/ exit(int);
char getchar();
int /*<<< orphan*/ printf(char *);
int GetNumber() {
  int number;
  char c;
  number = -1;
  while ((c = getchar()) != EOF) {
    if (c >= '0' && c <= '9') {
      if (number != -1) {
        number = (number * 10) + c - 48;
      } else {
        number = c - 48;
      }
    } else if (c == ' ' || c == '\n' || c == '\t' || c == '\v' || c == '\f' ||
               c == '\r') {
      if (number == -1) {
        continue;
      } else {
        return number;
      }
    } else {
      printf("ERROR: Wrong input! Must be integer numbers only!\n\n");
      exit(-1);
    }
  }
  return number;
}


x86 assembly (clang, -O0):
<GetNumber>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
movl   $0xffffffff,-0x8(%rbp)
mov    $0x0,%al
call   1040 <getchar@plt>
mov    %al,-0x9(%rbp)
movsbl %al,%eax
mov    0x2e95(%rip),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
je     1229 <GetNumber+0xf9>
movsbl -0x9(%rbp),%eax
cmp    $0x30,%eax
jl     11a6 <GetNumber+0x76>
movsbl -0x9(%rbp),%eax
cmp    $0x39,%eax
jg     11a6 <GetNumber+0x76>
cmpl   $0xffffffff,-0x8(%rbp)
je     1197 <GetNumber+0x67>
imul   $0xa,-0x8(%rbp),%eax
movsbl -0x9(%rbp),%ecx
add    %ecx,%eax
sub    $0x30,%eax
mov    %eax,-0x8(%rbp)
jmp    11a1 <GetNumber+0x71>
movsbl -0x9(%rbp),%eax
sub    $0x30,%eax
mov    %eax,-0x8(%rbp)
jmp    1224 <GetNumber+0xf4>
movsbl -0x9(%rbp),%eax
cmp    $0x20,%eax
je     11f4 <GetNumber+0xc4>
movsbl -0x9(%rbp),%eax
cmp    $0xa,%eax
je     11f4 <GetNumber+0xc4>
movsbl -0x9(%rbp),%eax
cmp    $0x9,%eax
je     11f4 <GetNumber+0xc4>
movsbl -0x9(%rbp),%eax
cmp    $0xb,%eax
je     11f4 <GetNumber+0xc4>
movsbl -0x9(%rbp),%eax
cmp    $0xc,%eax
je     11f4 <GetNumber+0xc4>
movsbl -0x9(%rbp),%eax
cmp    $0xd,%eax
jne    120e <GetNumber+0xde>
cmpl   $0xffffffff,-0x8(%rbp)
jne    1203 <GetNumber+0xd3>
jmp    113f <GetNumber+0xf>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    122f <GetNumber+0xff>
lea    0xdeb(%rip),%rdi
call   1030 <printf@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>
jmp    113f <GetNumber+0xf>
mov    -0x8(%rbp),%eax
mov    %eax,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<GetNumber>:
push   %rbp
push   %r14
push   %rbx
xor    %r14d,%r14d
xor    %eax,%eax
call   1040 <getchar@plt>
mov    %eax,%ecx
mov    0x2ea1(%rip),%rbx
mov    $0xffffffff,%eax
cmp    (%rbx),%cl
jne    1155 <GetNumber+0x25>
pop    %rbx
pop    %r14
pop    %rbp
ret
mov    $0xffffffff,%eax
jmp    1185 <GetNumber+0x55>
nopl   0x0(%rax)
movzbl %cl,%ecx
lea    (%rax,%rax,1),%edx
cmp    $0xffffffff,%eax
lea    (%rdx,%rdx,4),%eax
cmove  %r14d,%eax
lea    (%rcx,%rax,1),%ebp
add    $0xffffffd0,%ebp
xor    %eax,%eax
call   1040 <getchar@plt>
mov    %eax,%ecx
mov    %ebp,%eax
cmp    (%rbx),%cl
je     1150 <GetNumber+0x20>
lea    -0x30(%rcx),%edx
cmp    $0x9,%dl
jbe    1160 <GetNumber+0x30>
lea    -0x9(%rcx),%edx
cmp    $0x5,%dl
jae    11a1 <GetNumber+0x71>
mov    $0xffffffff,%ebp
cmp    $0xffffffff,%eax
je     1176 <GetNumber+0x46>
jmp    1150 <GetNumber+0x20>
cmp    $0x20,%cl
je     1195 <GetNumber+0x65>
lea    0xe53(%rip),%rdi
call   1030 <puts@plt>
mov    $0xffffffff,%edi
call   1050 <exit@plt>

LLVM IR (-O0):
@EOF = global i8 0
@.str = [52 x i8] c"ERROR: Wrong input! Must be integer numbers only!\0A\0A\00"
define i32 @GetNumber() {
%1 = alloca i32
%2 = alloca i32
%3 = alloca i8
store i32 -1, i32* %2
br label %4
4: ; preds = %66, %60, %0
%5 = call signext i8 (...) @getchar()
store i8 %5, i8* %3
%6 = sext i8 %5 to i32
%7 = load i8, i8* @EOF
%8 = sext i8 %7 to i32
%9 = icmp ne i32 %6, %8
br i1 %9, label %10, label %67
10: ; preds = %4
%11 = load i8, i8* %3
%12 = sext i8 %11 to i32
%13 = icmp sge i32 %12, 48
br i1 %13, label %14, label %33
14: ; preds = %10
%15 = load i8, i8* %3
%16 = sext i8 %15 to i32
%17 = icmp sle i32 %16, 57
br i1 %17, label %18, label %33
18: ; preds = %14
%19 = load i32, i32* %2
%20 = icmp ne i32 %19, -1
br i1 %20, label %21, label %28
21: ; preds = %18
%22 = load i32, i32* %2
%23 = mul nsw i32 %22, 10
%24 = load i8, i8* %3
%25 = sext i8 %24 to i32
%26 = add nsw i32 %23, %25
%27 = sub nsw i32 %26, 48
store i32 %27, i32* %2
br label %32
28: ; preds = %18
%29 = load i8, i8* %3
%30 = sext i8 %29 to i32
%31 = sub nsw i32 %30, 48
store i32 %31, i32* %2
br label %32
32: ; preds = %28, %21
br label %66
33: ; preds = %14, %10
%34 = load i8, i8* %3
%35 = sext i8 %34 to i32
%36 = icmp eq i32 %35, 32
br i1 %36, label %57, label %37
37: ; preds = %33
%38 = load i8, i8* %3
%39 = sext i8 %38 to i32
%40 = icmp eq i32 %39, 10
br i1 %40, label %57, label %41
41: ; preds = %37
%42 = load i8, i8* %3
%43 = sext i8 %42 to i32
%44 = icmp eq i32 %43, 9
br i1 %44, label %57, label %45
45: ; preds = %41
%46 = load i8, i8* %3
%47 = sext i8 %46 to i32
%48 = icmp eq i32 %47, 11
br i1 %48, label %57, label %49
49: ; preds = %45
%50 = load i8, i8* %3
%51 = sext i8 %50 to i32
%52 = icmp eq i32 %51, 12
br i1 %52, label %57, label %53
53: ; preds = %49
%54 = load i8, i8* %3
%55 = sext i8 %54 to i32
%56 = icmp eq i32 %55, 13
br i1 %56, label %57, label %63
57: ; preds = %53, %49, %45, %41, %37, %33
%58 = load i32, i32* %2
%59 = icmp eq i32 %58, -1
br i1 %59, label %60, label %61
60: ; preds = %57
br label %4
61: ; preds = %57
%62 = load i32, i32* %2
store i32 %62, i32* %1
br label %69
63: ; preds = %53
%64 = call i32 @printf(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0))
%65 = call i32 @exit(i32 -1)
unreachable
66: ; preds = %32
br label %4
67: ; preds = %4
%68 = load i32, i32* %2
store i32 %68, i32* %1
br label %69
69: ; preds = %67, %61
%70 = load i32, i32* %1
ret i32 %70
}

LLVM IR (-O2):
@EOF = global i8 0
@str = [51 x i8] c"ERROR: Wrong input! Must be integer numbers only!\0A\00"
define i32 @GetNumber() {
%1 = tail call signext i8 (...) @getchar()
%2 = load i8, i8* @EOF
%3 = icmp eq i8 %1, %2
br i1 %3, label %27, label %4
4: ; preds = %0, %16
%5 = phi i8 [ %18, %16 ], [ %1, %0 ]
%6 = phi i32 [ %17, %16 ], [ -1, %0 ]
%7 = add i8 %5, -48
%8 = icmp ult i8 %7, 10
br i1 %8, label %9, label %21
9: ; preds = %4
%10 = zext i8 %5 to i32
%11 = icmp eq i32 %6, -1
%12 = mul nsw i32 %6, 10
%13 = select i1 %11, i32 0, i32 %12
%14 = add nsw i32 %10, -48
%15 = add i32 %14, %13
br label %16
16: ; preds = %9, %22
%17 = phi i32 [ %15, %9 ], [ -1, %22 ]
%18 = tail call signext i8 (...) @getchar()
%19 = load i8, i8* @EOF
%20 = icmp eq i8 %18, %19
br i1 %20, label %27, label %4
21: ; preds = %4
switch i8 %5, label %24 [
i8 32, label %22
i8 13, label %22
i8 12, label %22
i8 11, label %22
i8 10, label %22
i8 9, label %22
]
22: ; preds = %21, %21, %21, %21, %21, %21
%23 = icmp eq i32 %6, -1
br i1 %23, label %16, label %27
24: ; preds = %21
%25 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @str, i64 0, i64 0))
%26 = tail call i32 @exit(i32 -1)
unreachable
27: ; preds = %22, %16, %0
%28 = phi i32 [ -1, %0 ], [ %17, %16 ], [ %6, %22 ]
ret i32 %28
}