#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);
scalar_t__ strcmp(char *, char *);
int strlen(char *);
int number_check(char *symbol) {
  int j = 0;
  if (strcmp(symbol, "") == 0)
    return 0;
  j = 0;
  if (symbol[j] == '-') {
    if (strlen(symbol) > 1)
      j++;
    else
      return 0;
  }
  for (; j < strlen(symbol); j++)
    if (!isdigit(symbol[j]))
      return 0;
  return 1;
}


x86 assembly (clang, -O0):
<number_check>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xeb2(%rip),%rsi
call   1050 <strcmp@plt>
cmp    $0x0,%rax
jne    1169 <number_check+0x39>
movl   $0x0,-0x4(%rbp)
jmp    1217 <number_check+0xe7>
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x2d,%eax
jne    11b6 <number_check+0x86>
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
cmp    $0x1,%eax
jle    11a5 <number_check+0x75>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11b1 <number_check+0x81>
movl   $0x0,-0x4(%rbp)
jmp    1217 <number_check+0xe7>
jmp    11b6 <number_check+0x86>
jmp    11bb <number_check+0x8b>
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1040 <strlen@plt>
mov    %eax,%ecx
mov    -0x18(%rbp),%eax
cmp    %ecx,%eax
jge    1210 <number_check+0xe0>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%eax
jne    11fd <number_check+0xcd>
movl   $0x0,-0x4(%rbp)
jmp    1217 <number_check+0xe7>
jmp    1202 <number_check+0xd2>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    11bb <number_check+0x8b>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<number_check>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%rbx
lea    0xec2(%rip),%rsi
call   1050 <strcmp@plt>
test   %rax,%rax
je     119f <number_check+0x6f>
xor    %ebp,%ebp
cmpb   $0x2d,(%rbx)
jne    1164 <number_check+0x34>
mov    %rbx,%rdi
call   1040 <strlen@plt>
xor    %r14d,%r14d
mov    $0x1,%ebp
cmp    $0x2,%eax
jl     11a2 <number_check+0x72>
mov    %rbx,%rdi
call   1040 <strlen@plt>
mov    $0x1,%r14d
cmp    %eax,%ebp
jge    11a2 <number_check+0x72>
mov    %ebp,%ebp
nopl   0x0(%rax,%rax,1)
movsbl (%rbx,%rbp,1),%edi
call   1030 <isdigit@plt>
test   %eax,%eax
je     119f <number_check+0x6f>
add    $0x1,%rbp
mov    %rbx,%rdi
call   1040 <strlen@plt>
cmp    %ebp,%eax
jg     1180 <number_check+0x50>
jmp    11a2 <number_check+0x72>
xor    %r14d,%r14d
mov    %r14d,%eax
pop    %rbx
pop    %r14
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define i32 @number_check(i8* %0) {
%2 = tail call i64 @strcmp(i8* %0, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i64 %2, 0
br i1 %3, label %27, label %4
4: ; preds = %1
%5 = load i8, i8* %0
%6 = icmp eq i8 %5, 45
br i1 %6, label %7, label %10
7: ; preds = %4
%8 = tail call i32 @strlen(i8* %0)
%9 = icmp sgt i32 %8, 1
br i1 %9, label %10, label %27
10: ; preds = %7, %4
%11 = phi i32 [ 0, %4 ], [ 1, %7 ]
%12 = tail call i32 @strlen(i8* %0)
%13 = icmp slt i32 %11, %12
br i1 %13, label %14, label %27
14: ; preds = %10
%15 = zext i32 %11 to i64
br label %20
16: ; preds = %20
%17 = tail call i32 @strlen(i8* %0)
%18 = trunc i64 %26 to i32
%19 = icmp sgt i32 %17, %18
br i1 %19, label %20, label %27
20: ; preds = %14, %16
%21 = phi i64 [ %15, %14 ], [ %26, %16 ]
%22 = getelementptr inbounds i8, i8* %0, i64 %21
%23 = load i8, i8* %22
%24 = tail call i32 @isdigit(i8 signext %23)
%25 = icmp eq i32 %24, 0
%26 = add nuw nsw i64 %21, 1
br i1 %25, label %27, label %16
27: ; preds = %20, %16, %10, %7, %1
%28 = phi i32 [ 0, %1 ], [ 0, %7 ], [ 1, %10 ], [ 0, %20 ], [ 1, %16 ]
ret i32 %28
}