#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 strlen(char *);
bool Is_number(char *value) {
  char *pOver = value + strlen(value);
  while (value < pOver) {
    if (*value < '0' || *value > '9') {
      return false;
    }
    ++value;
  }
  return true;
}


x86 assembly (clang, -O0):
<Is_number>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x20(%rbp),%rax
movslq %ecx,%rcx
add    %rcx,%rax
mov    %rax,-0x18(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jae    1188 <Is_number+0x78>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x30,%eax
jl     116b <Is_number+0x5b>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x39,%eax
jle    1177 <Is_number+0x67>
movl   $0x0,-0x4(%rbp)
jmp    118f <Is_number+0x7f>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    113d <Is_number+0x2d>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Is_number>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    $0x1,%eax
test   %ecx,%ecx
jle    1144 <Is_number+0x34>
movslq %ecx,%rcx
add    %rbx,%rcx
nopw   0x0(%rax,%rax,1)
movzbl (%rbx),%edx
add    $0xc6,%dl
cmp    $0xf5,%dl
jbe    1146 <Is_number+0x36>
add    $0x1,%rbx
cmp    %rcx,%rbx
jb     1130 <Is_number+0x20>
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

LLVM IR (-O0):
define i32 @Is_number(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i8*
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = load i8*, i8** %3
%7 = call i32 @strlen(i8* %6)
%8 = sext i32 %7 to i64
%9 = getelementptr inbounds i8, i8* %5, i64 %8
store i8* %9, i8** %4
br label %10
10: ; preds = %25, %1
%11 = load i8*, i8** %3
%12 = load i8*, i8** %4
%13 = icmp ult i8* %11, %12
br i1 %13, label %14, label %28
14: ; preds = %10
%15 = load i8*, i8** %3
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
%18 = icmp slt i32 %17, 48
br i1 %18, label %24, label %19
19: ; preds = %14
%20 = load i8*, i8** %3
%21 = load i8, i8* %20
%22 = sext i8 %21 to i32
%23 = icmp sgt i32 %22, 57
br i1 %23, label %24, label %25
24: ; preds = %19, %14
store i32 0, i32* %2
br label %29
25: ; preds = %19
%26 = load i8*, i8** %3
%27 = getelementptr inbounds i8, i8* %26, i32 1
store i8* %27, i8** %3
br label %10
28: ; preds = %10
store i32 1, i32* %2
br label %29
29: ; preds = %28, %24
%30 = load i32, i32* %2
ret i32 %30
}

LLVM IR (-O2):
define i32 @Is_number(i8* %0) {
%2 = tail call i32 @strlen(i8* %0)
%3 = sext i32 %2 to i64
%4 = getelementptr inbounds i8, i8* %0, i64 %3
%5 = icmp sgt i32 %2, 0
br i1 %5, label %8, label %14
6: ; preds = %8
%7 = icmp ult i8* %13, %4
br i1 %7, label %8, label %14
8: ; preds = %1, %6
%9 = phi i8* [ %13, %6 ], [ %0, %1 ]
%10 = load i8, i8* %9
%11 = add i8 %10, -58
%12 = icmp ult i8 %11, -10
%13 = getelementptr inbounds i8, i8* %9, i64 1
br i1 %12, label %14, label %6
14: ; preds = %8, %6, %1
%15 = phi i32 [ 1, %1 ], [ 1, %6 ], [ 0, %8 ]
ret i32 %15
}