#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 */
scalar_t__ strlen(char const *);
char testNumber(const char *string) {
  for (int i = 0; i < (int)strlen(string); i++) {
    if (string[i] < 48 || string[i] > 57)
      return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<testNumber>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x14(%rbp),%eax
mov    %eax,-0x18(%rbp)
mov    -0x10(%rbp),%rdi
call   1030 <strlen@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%eax
cmp    %ecx,%eax
jge    1186 <testNumber+0x76>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x30,%eax
jl     116a <testNumber+0x5a>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
movsbl (%rax,%rcx,1),%eax
cmp    $0x39,%eax
jle    1173 <testNumber+0x63>
movb   $0x0,-0x1(%rbp)
jmp    118a <testNumber+0x7a>
jmp    1178 <testNumber+0x68>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1123 <testNumber+0x13>
movb   $0x1,-0x1(%rbp)
movsbl -0x1(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<testNumber>:
push   %rbx
mov    %rdi,%rbx
call   1030 <strlen@plt>
test   %eax,%eax
jle    112b <testNumber+0x1b>
mov    (%rbx),%cl
add    $0xc6,%cl
cmp    $0xf6,%cl
jae    112f <testNumber+0x1f>
xor    %eax,%eax
pop    %rbx
ret
mov    $0x1,%al
pop    %rbx
ret
movslq %eax,%rdi
mov    %edi,%ecx
mov    $0x1,%esi
nopl   0x0(%rax)
mov    %rsi,%rdx
cmp    %rsi,%rcx
je     1156 <testNumber+0x46>
movzbl (%rbx,%rdx,1),%eax
add    $0xc6,%al
lea    0x1(%rdx),%rsi
cmp    $0xf5,%al
ja     1140 <testNumber+0x30>
cmp    %rdi,%rdx
setge  %al
pop    %rbx
ret

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

LLVM IR (-O2):
define signext i8 @testNumber(i8* nocapture %0) {
%2 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%3 = trunc i64 %2 to i32
%4 = icmp sgt i32 %3, 0
br i1 %4, label %5, label %24
5: ; preds = %1
%6 = shl i64 %2, 32
%7 = ashr exact i64 %6, 32
%8 = and i64 %2, 4294967295
%9 = load i8, i8* %0
%10 = add i8 %9, -58
%11 = icmp ult i8 %10, -10
br i1 %11, label %24, label %12
12: ; preds = %5, %15
%13 = phi i64 [ %20, %15 ], [ 1, %5 ]
%14 = icmp eq i64 %13, %8
br i1 %14, label %21, label %15
15: ; preds = %12
%16 = getelementptr inbounds i8, i8* %0, i64 %13
%17 = load i8, i8* %16
%18 = add i8 %17, -58
%19 = icmp ult i8 %18, -10
%20 = add nuw nsw i64 %13, 1
br i1 %19, label %21, label %12
21: ; preds = %12, %15
%22 = icmp sge i64 %13, %7
%23 = zext i1 %22 to i8
br label %24
24: ; preds = %21, %5, %1
%25 = phi i8 [ 1, %1 ], [ 0, %5 ], [ %23, %21 ]
ret i8 %25
}