#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 */
unsigned int next_utf8(char const *, int *);
int fn_cl_48_57_65_91_97_122(const char *text) {
  int pos = 0;
  unsigned int c = next_utf8(text, &pos);
  if (c >= 48 && c <= 57)
    return pos;
  if (c >= 65 && c <= 91)
    return pos;
  if (c >= 97 && c <= 122)
    return pos;
  return -1;
}


x86 assembly (clang, -O0):
<fn_cl_48_57_65_91_97_122>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rdi
lea    -0x14(%rbp),%rsi
call   1030 <next_utf8@plt>
mov    %eax,-0x18(%rbp)
cmpl   $0x30,-0x18(%rbp)
jb     1152 <fn_cl_48_57_65_91_97_122+0x42>
cmpl   $0x39,-0x18(%rbp)
ja     1152 <fn_cl_48_57_65_91_97_122+0x42>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1197 <fn_cl_48_57_65_91_97_122+0x87>
cmpl   $0x41,-0x18(%rbp)
jb     1171 <fn_cl_48_57_65_91_97_122+0x61>
cmpl   $0x5b,-0x18(%rbp)
ja     1171 <fn_cl_48_57_65_91_97_122+0x61>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1197 <fn_cl_48_57_65_91_97_122+0x87>
cmpl   $0x61,-0x18(%rbp)
jb     1190 <fn_cl_48_57_65_91_97_122+0x80>
cmpl   $0x7a,-0x18(%rbp)
ja     1190 <fn_cl_48_57_65_91_97_122+0x80>
mov    -0x14(%rbp),%eax
mov    %eax,-0x4(%rbp)
jmp    1197 <fn_cl_48_57_65_91_97_122+0x87>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<fn_cl_48_57_65_91_97_122>:
push   %rax
movl   $0x0,0x4(%rsp)
lea    0x4(%rsp),%rsi
call   1030 <next_utf8@plt>
lea    -0x30(%rax),%ecx
cmp    $0x9,%ecx
jbe    1140 <fn_cl_48_57_65_91_97_122+0x30>
lea    -0x41(%rax),%ecx
cmp    $0x1a,%ecx
jbe    1140 <fn_cl_48_57_65_91_97_122+0x30>
add    $0xffffff9f,%eax
mov    $0xffffffff,%ecx
cmp    $0x1a,%eax
jae    1144 <fn_cl_48_57_65_91_97_122+0x34>
mov    0x4(%rsp),%ecx
mov    %ecx,%eax
pop    %rcx
ret

LLVM IR (-O0):
define i32 @fn_cl_48_57_65_91_97_122(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
store i8* %0, i8** %3
store i32 0, i32* %4
%6 = load i8*, i8** %3
%7 = call i32 @next_utf8(i8* %6, i32* %4)
store i32 %7, i32* %5
%8 = load i32, i32* %5
%9 = icmp uge i32 %8, 48
br i1 %9, label %10, label %15
10: ; preds = %1
%11 = load i32, i32* %5
%12 = icmp ule i32 %11, 57
br i1 %12, label %13, label %15
13: ; preds = %10
%14 = load i32, i32* %4
store i32 %14, i32* %2
br label %32
15: ; preds = %10, %1
%16 = load i32, i32* %5
%17 = icmp uge i32 %16, 65
br i1 %17, label %18, label %23
18: ; preds = %15
%19 = load i32, i32* %5
%20 = icmp ule i32 %19, 91
br i1 %20, label %21, label %23
21: ; preds = %18
%22 = load i32, i32* %4
store i32 %22, i32* %2
br label %32
23: ; preds = %18, %15
%24 = load i32, i32* %5
%25 = icmp uge i32 %24, 97
br i1 %25, label %26, label %31
26: ; preds = %23
%27 = load i32, i32* %5
%28 = icmp ule i32 %27, 122
br i1 %28, label %29, label %31
29: ; preds = %26
%30 = load i32, i32* %4
store i32 %30, i32* %2
br label %32
31: ; preds = %26, %23
store i32 -1, i32* %2
br label %32
32: ; preds = %31, %29, %21, %13
%33 = load i32, i32* %2
ret i32 %33
}

LLVM IR (-O2):
define i32 @fn_cl_48_57_65_91_97_122(i8* %0) {
%2 = alloca i32
%3 = bitcast i32* %2 to i8*
store i32 0, i32* %2
%4 = call i32 @next_utf8(i8* %0, i32* %2)
%5 = add i32 %4, -48
%6 = icmp ult i32 %5, 10
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = load i32, i32* %2
br label %19
9: ; preds = %1
%10 = add i32 %4, -65
%11 = icmp ult i32 %10, 27
br i1 %11, label %12, label %14
12: ; preds = %9
%13 = load i32, i32* %2
br label %19
14: ; preds = %9
%15 = add i32 %4, -97
%16 = icmp ult i32 %15, 26
%17 = load i32, i32* %2
%18 = select i1 %16, i32 %17, i32 -1
br label %19
19: ; preds = %14, %12, %7
%20 = phi i32 [ %8, %7 ], [ %13, %12 ], [ %18, %14 ]
ret i32 %20
}