#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*/ *strchr(char *, char);
scalar_t__ strlen(char *);
int _submask_isnum(char add[16]) {
  int i = 0;
  for (i = 0; i < (int)strlen(add); i++) {
    if (strchr(" 1234567890.", add[i]) == NULL) {
      return 1;
    }
  }
  return 0;
}


x86 assembly (clang, -O0):
<_submask_isnum>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%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    1198 <_submask_isnum+0x78>
mov    -0x10(%rbp),%rax
movslq -0x14(%rbp),%rcx
lea    0xe9a(%rip),%rdi
movsbl (%rax,%rcx,1),%esi
call   1040 <strchr@plt>
cmp    $0x0,%rax
jne    1185 <_submask_isnum+0x65>
movl   $0x1,-0x4(%rbp)
jmp    119f <_submask_isnum+0x7f>
jmp    118a <_submask_isnum+0x6a>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    113a <_submask_isnum+0x1a>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_submask_isnum>:
push   %r15
push   %r14
push   %rbx
mov    %rdi,%r15
call   1030 <strlen@plt>
test   %eax,%eax
jle    1165 <_submask_isnum+0x45>
xor    %ebx,%ebx
lea    0xec6(%rip),%r14
nopw   0x0(%rax,%rax,1)
movsbl (%r15,%rbx,1),%esi
mov    %r14,%rdi
call   1040 <strchr@plt>
test   %rax,%rax
je     1169 <_submask_isnum+0x49>
add    $0x1,%rbx
mov    %r15,%rdi
call   1030 <strlen@plt>
cltq
cmp    %rax,%rbx
jl     1140 <_submask_isnum+0x20>
xor    %eax,%eax
jmp    116e <_submask_isnum+0x4e>
mov    $0x1,%eax
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@.str = [13 x i8] c" 1234567890.\00"
define i32 @_submask_isnum(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 0, i32* %4
store i32 0, i32* %4
br label %5
5: ; preds = %21, %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 %24
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 = call i32* @strchr(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8 signext %16)
%18 = icmp eq i32* %17, null
br i1 %18, label %19, label %20
19: ; preds = %11
store i32 1, i32* %2
br label %25
20: ; preds = %11
br label %21
21: ; preds = %20
%22 = load i32, i32* %4
%23 = add nsw i32 %22, 1
store i32 %23, i32* %4
br label %5
24: ; preds = %5
store i32 0, i32* %2
br label %25
25: ; preds = %24, %19
%26 = load i32, i32* %2
ret i32 %26
}

LLVM IR (-O2):
@.str = [13 x i8] c" 1234567890.\00"
define i32 @_submask_isnum(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 %10, label %17
5: ; preds = %10
%6 = tail call i64 @strlen(i8* dereferenceable(1) %0)
%7 = shl i64 %6, 32
%8 = ashr exact i64 %7, 32
%9 = icmp slt i64 %16, %8
br i1 %9, label %10, label %17
10: ; preds = %1, %5
%11 = phi i64 [ %16, %5 ], [ 0, %1 ]
%12 = getelementptr inbounds i8, i8* %0, i64 %11
%13 = load i8, i8* %12
%14 = tail call i32* @strchr(i8* getelementptr inbounds ([13 x i8], [13 x i8]* @.str, i64 0, i64 0), i8 signext %13)
%15 = icmp eq i32* %14, null
%16 = add nuw nsw i64 %11, 1
br i1 %15, label %17, label %5
17: ; preds = %10, %5, %1
%18 = phi i32 [ 0, %1 ], [ 0, %5 ], [ 1, %10 ]
ret i32 %18
}