#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 /*<<< orphan*/ skip_whitespace(char const **);
int number(const char *s) {
  if (!s)
    return 0;
  skip_whitespace(&s);
  if (*s == '+' || *s == '-')
    s++;
  if (!*s)
    return 0;
  for (; *s; s++)
    if (*s < '0' || *s > '9')
      return 0;
  return 1;
}


x86 assembly (clang, -O0):
<number>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1133 <number+0x23>
movl   $0x0,-0x4(%rbp)
jmp    11dc <number+0xcc>
lea    -0x10(%rbp),%rdi
call   1030 <skip_whitespace@plt>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2b,%eax
je     115c <number+0x4c>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
jne    1168 <number+0x58>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
jne    1181 <number+0x71>
movl   $0x0,-0x4(%rbp)
jmp    11dc <number+0xcc>
jmp    1186 <number+0x76>
mov    -0x10(%rbp),%rax
cmpb   $0x0,(%rax)
je     11d5 <number+0xc5>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x30,%eax
jl     11b3 <number+0xa3>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x39,%eax
jle    11bf <number+0xaf>
movl   $0x0,-0x4(%rbp)
jmp    11dc <number+0xcc>
jmp    11c4 <number+0xb4>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1186 <number+0x76>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<number>:
push   %rbx
sub    $0x10,%rsp
mov    %rdi,0x8(%rsp)
xor    %ebx,%ebx
test   %rdi,%rdi
je     117d <number+0x6d>
lea    0x8(%rsp),%rdi
call   1030 <skip_whitespace@plt>
mov    0x8(%rsp),%rax
mov    (%rax),%cl
cmp    $0x2d,%cl
je     113c <number+0x2c>
cmp    $0x2b,%cl
jne    114b <number+0x3b>
lea    0x1(%rax),%rdx
mov    %rdx,0x8(%rsp)
mov    0x1(%rax),%cl
mov    %rdx,%rax
test   %cl,%cl
je     117d <number+0x6d>
add    $0x1,%rax
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
add    $0xc6,%cl
cmp    $0xf6,%cl
jb     117d <number+0x6d>
mov    %rax,0x8(%rsp)
movzbl (%rax),%ecx
add    $0x1,%rax
test   %cl,%cl
jne    1160 <number+0x50>
mov    $0x1,%ebx
mov    %ebx,%eax
add    $0x10,%rsp
pop    %rbx
ret

LLVM IR (-O0):
define i32 @number(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = icmp ne i8* %4, null
br i1 %5, label %7, label %6
6: ; preds = %1
store i32 0, i32* %2
br label %47
7: ; preds = %1
%8 = call i32 @skip_whitespace(i8** %3)
%9 = load i8*, i8** %3
%10 = load i8, i8* %9
%11 = sext i8 %10 to i32
%12 = icmp eq i32 %11, 43
br i1 %12, label %18, label %13
13: ; preds = %7
%14 = load i8*, i8** %3
%15 = load i8, i8* %14
%16 = sext i8 %15 to i32
%17 = icmp eq i32 %16, 45
br i1 %17, label %18, label %21
18: ; preds = %13, %7
%19 = load i8*, i8** %3
%20 = getelementptr inbounds i8, i8* %19, i32 1
store i8* %20, i8** %3
br label %21
21: ; preds = %18, %13
%22 = load i8*, i8** %3
%23 = load i8, i8* %22
%24 = icmp ne i8 %23, 0
br i1 %24, label %26, label %25
25: ; preds = %21
store i32 0, i32* %2
br label %47
26: ; preds = %21
br label %27
27: ; preds = %43, %26
%28 = load i8*, i8** %3
%29 = load i8, i8* %28
%30 = icmp ne i8 %29, 0
br i1 %30, label %31, label %46
31: ; preds = %27
%32 = load i8*, i8** %3
%33 = load i8, i8* %32
%34 = sext i8 %33 to i32
%35 = icmp slt i32 %34, 48
br i1 %35, label %41, label %36
36: ; preds = %31
%37 = load i8*, i8** %3
%38 = load i8, i8* %37
%39 = sext i8 %38 to i32
%40 = icmp sgt i32 %39, 57
br i1 %40, label %41, label %42
41: ; preds = %36, %31
store i32 0, i32* %2
br label %47
42: ; preds = %36
br label %43
43: ; preds = %42
%44 = load i8*, i8** %3
%45 = getelementptr inbounds i8, i8* %44, i32 1
store i8* %45, i8** %3
br label %27
46: ; preds = %27
store i32 1, i32* %2
br label %47
47: ; preds = %46, %41, %25, %6
%48 = load i32, i32* %2
ret i32 %48
}

LLVM IR (-O2):
define i32 @number(i8* %0) {
%2 = alloca i8*
store i8* %0, i8** %2
%3 = icmp eq i8* %0, null
br i1 %3, label %24, label %4
4: ; preds = %1
%5 = call i32 @skip_whitespace(i8** %2)
%6 = load i8*, i8** %2
%7 = load i8, i8* %6
switch i8 %7, label %11 [
i8 43, label %8
i8 45, label %8
]
8: ; preds = %4, %4
%9 = getelementptr inbounds i8, i8* %6, i64 1
store i8* %9, i8** %2
%10 = load i8, i8* %9
br label %11
11: ; preds = %4, %8
%12 = phi i8 [ %7, %4 ], [ %10, %8 ]
%13 = phi i8* [ %6, %4 ], [ %9, %8 ]
%14 = icmp eq i8 %12, 0
br i1 %14, label %24, label %15
15: ; preds = %11, %20
%16 = phi i8 [ %22, %20 ], [ %12, %11 ]
%17 = phi i8* [ %21, %20 ], [ %13, %11 ]
%18 = add i8 %16, -58
%19 = icmp ult i8 %18, -10
br i1 %19, label %24, label %20
20: ; preds = %15
%21 = getelementptr inbounds i8, i8* %17, i64 1
store i8* %21, i8** %2
%22 = load i8, i8* %21
%23 = icmp eq i8 %22, 0
br i1 %23, label %24, label %15
24: ; preds = %15, %20, %11, %1
%25 = phi i32 [ 0, %1 ], [ 0, %11 ], [ 0, %15 ], [ 1, %20 ]
ret i32 %25
}