#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*/ isdigit(char);
char isNumber(char number[]) {
  int i = 0;
  if (number[0] == '-')
    i = 1;
  for (; number[i] != 0; i++) {
    if (!isdigit(number[i]))
      return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<isNumber>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x2d,%eax
jne    113a <isNumber+0x2a>
movl   $0x1,-0x14(%rbp)
jmp    113f <isNumber+0x2f>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x0,%eax
je     118a <isNumber+0x7a>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%eax
jne    1177 <isNumber+0x67>
movb   $0x0,-0x1(%rbp)
jmp    118e <isNumber+0x7e>
jmp    117c <isNumber+0x6c>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    113f <isNumber+0x2f>
movb   $0x1,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isNumber>:
push   %rbp
push   %rbx
push   %rax
xor    %ecx,%ecx
cmpb   $0x2d,(%rdi)
sete   %cl
mov    (%rdi,%rcx,1),%al
mov    $0x1,%bpl
test   %al,%al
je     114b <isNumber+0x3b>
lea    (%rcx,%rdi,1),%rbx
add    $0x1,%rbx
nopl   (%rax)
movsbl %al,%edi
call   1030 <isdigit@plt>
test   %eax,%eax
je     1149 <isNumber+0x39>
movzbl (%rbx),%eax
add    $0x1,%rbx
test   %al,%al
jne    1130 <isNumber+0x20>
jmp    114b <isNumber+0x3b>
xor    %ebp,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret

LLVM IR (-O0):
define signext i8 @isNumber(i8* %0) {
%2 = alloca i8
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 0, i32* %4
%5 = load i8*, i8** %3
%6 = getelementptr inbounds i8, i8* %5, i64 0
%7 = load i8, i8* %6
%8 = sext i8 %7 to i32
%9 = icmp eq i32 %8, 45
br i1 %9, label %10, label %11
10: ; preds = %1
store i32 1, i32* %4
br label %11
11: ; preds = %10, %1
br label %12
12: ; preds = %30, %11
%13 = load i8*, i8** %3
%14 = load i32, i32* %4
%15 = sext i32 %14 to i64
%16 = getelementptr inbounds i8, i8* %13, i64 %15
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
%19 = icmp ne i32 %18, 0
br i1 %19, label %20, label %33
20: ; preds = %12
%21 = load i8*, i8** %3
%22 = load i32, i32* %4
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds i8, i8* %21, i64 %23
%25 = load i8, i8* %24
%26 = call i32 @isdigit(i8 signext %25)
%27 = icmp ne i32 %26, 0
br i1 %27, label %29, label %28
28: ; preds = %20
store i8 0, i8* %2
br label %34
29: ; preds = %20
br label %30
30: ; preds = %29
%31 = load i32, i32* %4
%32 = add nsw i32 %31, 1
store i32 %32, i32* %4
br label %12
33: ; preds = %12
store i8 1, i8* %2
br label %34
34: ; preds = %33, %28
%35 = load i8, i8* %2
ret i8 %35
}

LLVM IR (-O2):
define signext i8 @isNumber(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = icmp eq i8 %2, 45
%4 = zext i1 %3 to i64
%5 = getelementptr inbounds i8, i8* %0, i64 %4
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, 0
br i1 %7, label %18, label %12
8: ; preds = %12
%9 = getelementptr inbounds i8, i8* %0, i64 %17
%10 = load i8, i8* %9
%11 = icmp eq i8 %10, 0
br i1 %11, label %18, label %12
12: ; preds = %1, %8
%13 = phi i64 [ %17, %8 ], [ %4, %1 ]
%14 = phi i8 [ %10, %8 ], [ %6, %1 ]
%15 = tail call i32 @isdigit(i8 signext %14)
%16 = icmp eq i32 %15, 0
%17 = add nuw i64 %13, 1
br i1 %16, label %18, label %8
18: ; preds = %12, %8, %1
%19 = phi i8 [ 1, %1 ], [ 1, %8 ], [ 0, %12 ]
ret i8 %19
}