#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*/ assert(int /*<<< orphan*/);
bool qrcodegen_isNumeric(const char *text) {
  assert(text != NULL);
  for (; *text != '\0'; text++) {
    if (*text < '0' || *text > '9')
      return false;
  }
  return true;
}


x86 assembly (clang, -O0):
<qrcodegen_isNumeric>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x10(%rbp)
cmpq   $0x0,-0x10(%rbp)
setne  %al
and    $0x1,%al
movzbl %al,%edi
call   1030 <assert@plt>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x0,%eax
je     1180 <qrcodegen_isNumeric+0x70>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x30,%eax
jl     115e <qrcodegen_isNumeric+0x4e>
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
cmp    $0x39,%eax
jle    116a <qrcodegen_isNumeric+0x5a>
movl   $0x0,-0x4(%rbp)
jmp    1187 <qrcodegen_isNumeric+0x77>
jmp    116f <qrcodegen_isNumeric+0x5f>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    112e <qrcodegen_isNumeric+0x1e>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<qrcodegen_isNumeric>:
push   %rbx
mov    %rdi,%rbx
xor    %edi,%edi
test   %rbx,%rbx
setne  %dil
call   1030 <assert@plt>
mov    (%rbx),%cl
mov    $0x1,%eax
test   %cl,%cl
je     1153 <qrcodegen_isNumeric+0x43>
add    $0x1,%rbx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
add    $0xc6,%cl
cmp    $0xf5,%cl
jbe    1155 <qrcodegen_isNumeric+0x45>
movzbl (%rbx),%ecx
add    $0x1,%rbx
test   %cl,%cl
jne    1140 <qrcodegen_isNumeric+0x30>
pop    %rbx
ret
xor    %eax,%eax
pop    %rbx
ret

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

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