#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*/ isalpha(char);
int /*<<< orphan*/ isdigit(char);
void SENNA_tokenize_alphanumeric(int *size_, const char *sentence) {
  int size = 0;
  while (1) {
    char c = *sentence++;
    if (c == '\0' || (!isdigit(c) && !isalpha(c)))
      break;
    size++;
  }
  *size_ = size;
}


x86 assembly (clang, -O0):
<SENNA_tokenize_alphanumeric>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0x10(%rbp)
mov    (%rax),%al
mov    %al,-0x15(%rbp)
movsbl -0x15(%rbp),%eax
cmp    $0x0,%eax
je     117c <SENNA_tokenize_alphanumeric+0x5c>
movsbl -0x15(%rbp),%edi
call   1030 <isdigit@plt>
cmp    $0x0,%eax
jne    1181 <SENNA_tokenize_alphanumeric+0x61>
movsbl -0x15(%rbp),%edi
call   1040 <isalpha@plt>
cmp    $0x0,%eax
jne    1181 <SENNA_tokenize_alphanumeric+0x61>
jmp    118f <SENNA_tokenize_alphanumeric+0x6f>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1137 <SENNA_tokenize_alphanumeric+0x17>
mov    -0x14(%rbp),%ecx
mov    -0x8(%rbp),%rax
mov    %ecx,(%rax)
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SENNA_tokenize_alphanumeric>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    (%rsi),%al
test   %al,%al
je     1169 <SENNA_tokenize_alphanumeric+0x49>
mov    %rsi,%r15
xor    %ebx,%ebx
jmp    114e <SENNA_tokenize_alphanumeric+0x2e>
nopw   0x0(%rax,%rax,1)
movzbl 0x1(%r15,%rbx,1),%eax
add    $0x1,%rbx
test   %al,%al
je     116b <SENNA_tokenize_alphanumeric+0x4b>
movsbl %al,%ebp
mov    %ebp,%edi
call   1030 <isdigit@plt>
test   %eax,%eax
jne    1140 <SENNA_tokenize_alphanumeric+0x20>
mov    %ebp,%edi
call   1040 <isalpha@plt>
test   %eax,%eax
jne    1140 <SENNA_tokenize_alphanumeric+0x20>
jmp    116b <SENNA_tokenize_alphanumeric+0x4b>
xor    %ebx,%ebx
mov    %ebx,(%r14)
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define void @SENNA_tokenize_alphanumeric(i32* %0, i8* %1) {
%3 = alloca i32*
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i8
store i32* %0, i32** %3
store i8* %1, i8** %4
store i32 0, i32* %5
br label %7
7: ; preds = %2, %23
%8 = load i8*, i8** %4
%9 = getelementptr inbounds i8, i8* %8, i32 1
store i8* %9, i8** %4
%10 = load i8, i8* %8
store i8 %10, i8* %6
%11 = load i8, i8* %6
%12 = sext i8 %11 to i32
%13 = icmp eq i32 %12, 0
br i1 %13, label %22, label %14
14: ; preds = %7
%15 = load i8, i8* %6
%16 = call i32 @isdigit(i8 signext %15)
%17 = icmp ne i32 %16, 0
br i1 %17, label %23, label %18
18: ; preds = %14
%19 = load i8, i8* %6
%20 = call i32 @isalpha(i8 signext %19)
%21 = icmp ne i32 %20, 0
br i1 %21, label %23, label %22
22: ; preds = %18, %7
br label %26
23: ; preds = %18, %14
%24 = load i32, i32* %5
%25 = add nsw i32 %24, 1
store i32 %25, i32* %5
br label %7
26: ; preds = %22
%27 = load i32, i32* %5
%28 = load i32*, i32** %3
store i32 %27, i32* %28
ret void
}

LLVM IR (-O2):
define void @SENNA_tokenize_alphanumeric(i32* nocapture writeonly %0, i8* nocapture %1) {
%3 = load i8, i8* %1
%4 = icmp eq i8 %3, 0
br i1 %4, label %19, label %5
5: ; preds = %2, %15
%6 = phi i8 [ %17, %15 ], [ %3, %2 ]
%7 = phi i8* [ %9, %15 ], [ %1, %2 ]
%8 = phi i32 [ %16, %15 ], [ 0, %2 ]
%9 = getelementptr inbounds i8, i8* %7, i64 1
%10 = tail call i32 @isdigit(i8 signext %6)
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %15
12: ; preds = %5
%13 = tail call i32 @isalpha(i8 signext %6)
%14 = icmp eq i32 %13, 0
br i1 %14, label %19, label %15
15: ; preds = %5, %12
%16 = add nuw nsw i32 %8, 1
%17 = load i8, i8* %9
%18 = icmp eq i8 %17, 0
br i1 %18, label %19, label %5
19: ; preds = %15, %12, %2
%20 = phi i32 [ 0, %2 ], [ %8, %12 ], [ %16, %15 ]
store i32 %20, i32* %0
ret void
}