#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*/ digitp(int);
scalar_t__ letterp(char const);
const char *identifier(const char *str, const char *end) {
  if (letterp(*str)) {
    for (; str < end; str++) {
      int c;
      c = *str;
      if (!letterp(c) && !digitp(c)) {
        break;
      }
    }
  }
  return str;
}


x86 assembly (clang, -O0):
<identifier>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    -0x8(%rbp),%rax
movsbl (%rax),%edi
call   1030 <letterp@plt>
cmp    $0x0,%rax
je     11a9 <identifier+0x89>
jmp    114b <identifier+0x2b>
mov    -0x8(%rbp),%rax
cmp    -0x10(%rbp),%rax
jae    11a4 <identifier+0x84>
mov    -0x8(%rbp),%rax
movsbl (%rax),%eax
mov    %eax,-0x14(%rbp)
mov    -0x14(%rbp),%eax
movsbl %al,%edi
call   1030 <letterp@plt>
cmp    $0x0,%rax
jne    118e <identifier+0x6e>
mov    -0x14(%rbp),%edi
call   1040 <digitp@plt>
cmp    $0x0,%eax
jne    118e <identifier+0x6e>
jmp    11a4 <identifier+0x84>
jmp    1193 <identifier+0x73>
mov    -0x8(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x8(%rbp)
jmp    114b <identifier+0x2b>
jmp    11a9 <identifier+0x89>
mov    -0x8(%rbp),%rax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<identifier>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rsi,%r14
mov    %rdi,%rbx
movsbl (%rdi),%edi
call   1030 <letterp@plt>
test   %rax,%rax
je     117c <identifier+0x5c>
cmp    %r14,%rbx
jae    117c <identifier+0x5c>
mov    %r14,%rbp
sub    %rbx,%rbp
jmp    115a <identifier+0x3a>
nopw   0x0(%rax,%rax,1)
add    $0x1,%rbx
add    $0xffffffffffffffff,%rbp
je     1179 <identifier+0x59>
movsbl (%rbx),%r15d
mov    %r15d,%edi
call   1030 <letterp@plt>
test   %rax,%rax
jne    1150 <identifier+0x30>
mov    %r15d,%edi
call   1040 <digitp@plt>
test   %eax,%eax
jne    1150 <identifier+0x30>
jmp    117c <identifier+0x5c>
mov    %r14,%rbx
mov    %rbx,%rax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i8* @identifier(i8* %0, i8* %1) {
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i32
store i8* %0, i8** %3
store i8* %1, i8** %4
%6 = load i8*, i8** %3
%7 = load i8, i8* %6
%8 = call i64 @letterp(i8 signext %7)
%9 = icmp ne i64 %8, 0
br i1 %9, label %10, label %33
10: ; preds = %2
br label %11
11: ; preds = %29, %10
%12 = load i8*, i8** %3
%13 = load i8*, i8** %4
%14 = icmp ult i8* %12, %13
br i1 %14, label %15, label %32
15: ; preds = %11
%16 = load i8*, i8** %3
%17 = load i8, i8* %16
%18 = sext i8 %17 to i32
store i32 %18, i32* %5
%19 = load i32, i32* %5
%20 = trunc i32 %19 to i8
%21 = call i64 @letterp(i8 signext %20)
%22 = icmp ne i64 %21, 0
br i1 %22, label %28, label %23
23: ; preds = %15
%24 = load i32, i32* %5
%25 = call i32 @digitp(i32 %24)
%26 = icmp ne i32 %25, 0
br i1 %26, label %28, label %27
27: ; preds = %23
br label %32
28: ; preds = %23, %15
br label %29
29: ; preds = %28
%30 = load i8*, i8** %3
%31 = getelementptr inbounds i8, i8* %30, i32 1
store i8* %31, i8** %3
br label %11
32: ; preds = %27, %11
br label %33
33: ; preds = %32, %2
%34 = load i8*, i8** %3
ret i8* %34
}

LLVM IR (-O2):
define i8* @identifier(i8* %0, i8* readnone %1) {
%3 = load i8, i8* %0
%4 = tail call i64 @letterp(i8 signext %3)
%5 = icmp ne i64 %4, 0
%6 = icmp ult i8* %0, %1
%7 = and i1 %5, %6
br i1 %7, label %8, label %25
8: ; preds = %2
%9 = ptrtoint i8* %1 to i64
%10 = ptrtoint i8* %0 to i64
%11 = sub i64 %9, %10
%12 = getelementptr i8, i8* %0, i64 %11
br label %13
13: ; preds = %8, %22
%14 = phi i8* [ %23, %22 ], [ %0, %8 ]
%15 = load i8, i8* %14
%16 = tail call i64 @letterp(i8 signext %15)
%17 = icmp eq i64 %16, 0
br i1 %17, label %18, label %22
18: ; preds = %13
%19 = sext i8 %15 to i32
%20 = tail call i32 @digitp(i32 %19)
%21 = icmp eq i32 %20, 0
br i1 %21, label %25, label %22
22: ; preds = %13, %18
%23 = getelementptr inbounds i8, i8* %14, i64 1
%24 = icmp eq i8* %23, %12
br i1 %24, label %25, label %13
25: ; preds = %22, %18, %2
%26 = phi i8* [ %0, %2 ], [ %12, %22 ], [ %14, %18 ]
ret i8* %26
}