char *scan(char *p) {
  {
    unsigned char yych;
    yych = (unsigned char)*p;
    if (yych <= '/')
      goto yy4;
    if (yych >= ':')
      goto yy4;
    ++p;
    yych = (unsigned char)*p;
    goto yy7;
  yy3 : { return p; }
  yy4:
    ++p;
    { return (char *)0; }
  yy6:
    ++p;
    yych = (unsigned char)*p;
  yy7:
    if (yych <= '/')
      goto yy3;
    if (yych <= '9')
      goto yy6;
    goto yy3;
  }
}


x86 assembly (clang, -O0):
<scan>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x11(%rbp)
movzbl -0x11(%rbp),%eax
cmp    $0x2f,%eax
jg     1123 <scan+0x23>
jmp    115c <scan+0x5c>
movzbl -0x11(%rbp),%eax
cmp    $0x3a,%eax
jl     1135 <scan+0x35>
jmp    115c <scan+0x5c>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x11(%rbp)
jmp    118a <scan+0x8a>
mov    -0x10(%rbp),%rax
mov    %rax,-0x8(%rbp)
jmp    11b3 <scan+0xb3>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
movq   $0x0,-0x8(%rbp)
jmp    11b3 <scan+0xb3>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    (%rax),%al
mov    %al,-0x11(%rbp)
movzbl -0x11(%rbp),%eax
cmp    $0x2f,%eax
jg     119c <scan+0x9c>
jmp    114f <scan+0x4f>
movzbl -0x11(%rbp),%eax
cmp    $0x39,%eax
jg     11ae <scan+0xae>
jmp    1175 <scan+0x75>
jmp    114f <scan+0x4f>
mov    -0x8(%rbp),%rax
pop    %rbp
ret

x86 assembly (clang, -O2):
<scan>:
mov    (%rdi),%cl
add    $0xc6,%cl
cmp    $0xf6,%cl
jae    110d <scan+0xd>
xor    %eax,%eax
ret
mov    %rdi,%rax
movzbl 0x1(%rax),%ecx
add    $0x1,%rax
add    $0xd0,%cl
cmp    $0xa,%cl
jb     1110 <scan+0x10>
ret

LLVM IR (-O0):
define i8* @scan(i8* %0) {
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8
store i8* %0, i8** %3
%5 = load i8*, i8** %3
%6 = load i8, i8* %5
store i8 %6, i8* %4
%7 = load i8, i8* %4
%8 = zext i8 %7 to i32
%9 = icmp sle i32 %8, 47
br i1 %9, label %10, label %11
10: ; preds = %1
br label %23
11: ; preds = %1
%12 = load i8, i8* %4
%13 = zext i8 %12 to i32
%14 = icmp sge i32 %13, 58
br i1 %14, label %15, label %16
15: ; preds = %11
br label %23
16: ; preds = %11
%17 = load i8*, i8** %3
%18 = getelementptr inbounds i8, i8* %17, i32 1
store i8* %18, i8** %3
%19 = load i8*, i8** %3
%20 = load i8, i8* %19
store i8 %20, i8* %4
br label %31
21: ; preds = %41, %35
%22 = load i8*, i8** %3
store i8* %22, i8** %2
br label %42
23: ; preds = %15, %10
%24 = load i8*, i8** %3
%25 = getelementptr inbounds i8, i8* %24, i32 1
store i8* %25, i8** %3
store i8* null, i8** %2
br label %42
26: ; preds = %40
%27 = load i8*, i8** %3
%28 = getelementptr inbounds i8, i8* %27, i32 1
store i8* %28, i8** %3
%29 = load i8*, i8** %3
%30 = load i8, i8* %29
store i8 %30, i8* %4
br label %31
31: ; preds = %26, %16
%32 = load i8, i8* %4
%33 = zext i8 %32 to i32
%34 = icmp sle i32 %33, 47
br i1 %34, label %35, label %36
35: ; preds = %31
br label %21
36: ; preds = %31
%37 = load i8, i8* %4
%38 = zext i8 %37 to i32
%39 = icmp sle i32 %38, 57
br i1 %39, label %40, label %41
40: ; preds = %36
br label %26
41: ; preds = %36
br label %21
42: ; preds = %23, %21
%43 = load i8*, i8** %2
ret i8* %43
}

LLVM IR (-O2):
define i8* @scan(i8* %0) {
%2 = load i8, i8* %0
%3 = add i8 %2, -58
%4 = icmp ult i8 %3, -10
br i1 %4, label %11, label %5
5: ; preds = %1, %5
%6 = phi i8* [ %7, %5 ], [ %0, %1 ]
%7 = getelementptr inbounds i8, i8* %6, i64 1
%8 = load i8, i8* %7
%9 = add i8 %8, -48
%10 = icmp ult i8 %9, 10
br i1 %10, label %5, label %11
11: ; preds = %5, %1
%12 = phi i8* [ null, %1 ], [ %7, %5 ]
ret i8* %12
}