#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*/ *strchr(char const *, char const);
int stralphabet(const char *from, const char *to, const char *alphabet) {
  for (; from < to; from++) {
    if (NULL == strchr(alphabet, from[0]))
      return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<stralphabet>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %rdx,-0x20(%rbp)
mov    -0x10(%rbp),%rax
cmp    -0x18(%rbp),%rax
jae    1172 <stralphabet+0x62>
mov    -0x20(%rbp),%rdi
mov    -0x10(%rbp),%rax
movsbl (%rax),%esi
call   1030 <strchr@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
jne    115c <stralphabet+0x4c>
movl   $0x0,-0x4(%rbp)
jmp    1179 <stralphabet+0x69>
jmp    1161 <stralphabet+0x51>
mov    -0x10(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x10(%rbp)
jmp    1124 <stralphabet+0x14>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stralphabet>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
mov    $0x1,%r14d
cmp    %rsi,%rdi
jae    1160 <stralphabet+0x50>
mov    %rdx,%r15
mov    %rsi,%rbp
mov    %rdi,%r12
sub    %rdi,%rbp
xor    %ebx,%ebx
cs nopw 0x0(%rax,%rax,1)
nopl   0x0(%rax,%rax,1)
movsbl (%r12,%rbx,1),%esi
mov    %r15,%rdi
call   1030 <strchr@plt>
test   %rax,%rax
je     115d <stralphabet+0x4d>
add    $0x1,%rbx
cmp    %rbx,%rbp
jne    1140 <stralphabet+0x30>
jmp    1160 <stralphabet+0x50>
xor    %r14d,%r14d
mov    %r14d,%eax
pop    %rbx
pop    %r12
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
define i32 @stralphabet(i8* %0, i8* %1, i8* %2) {
%4 = alloca i32
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
br label %8
8: ; preds = %21, %3
%9 = load i8*, i8** %5
%10 = load i8*, i8** %6
%11 = icmp ult i8* %9, %10
br i1 %11, label %12, label %24
12: ; preds = %8
%13 = load i8*, i8** %7
%14 = load i8*, i8** %5
%15 = getelementptr inbounds i8, i8* %14, i64 0
%16 = load i8, i8* %15
%17 = call i32* @strchr(i8* %13, i8 signext %16)
%18 = icmp eq i32* null, %17
br i1 %18, label %19, label %20
19: ; preds = %12
store i32 0, i32* %4
br label %25
20: ; preds = %12
br label %21
21: ; preds = %20
%22 = load i8*, i8** %5
%23 = getelementptr inbounds i8, i8* %22, i32 1
store i8* %23, i8** %5
br label %8
24: ; preds = %8
store i32 1, i32* %4
br label %25
25: ; preds = %24, %19
%26 = load i32, i32* %4
ret i32 %26
}

LLVM IR (-O2):
define i32 @stralphabet(i8* %0, i8* readnone %1, i8* %2) {
%4 = icmp ult i8* %0, %1
br i1 %4, label %5, label %18
5: ; preds = %3
%6 = ptrtoint i8* %1 to i64
%7 = ptrtoint i8* %0 to i64
%8 = sub i64 %6, %7
%9 = getelementptr i8, i8* %0, i64 %8
br label %12
10: ; preds = %12
%11 = icmp eq i8* %17, %9
br i1 %11, label %18, label %12
12: ; preds = %5, %10
%13 = phi i8* [ %17, %10 ], [ %0, %5 ]
%14 = load i8, i8* %13
%15 = tail call i32* @strchr(i8* %2, i8 signext %14)
%16 = icmp eq i32* %15, null
%17 = getelementptr inbounds i8, i8* %13, i64 1
br i1 %16, label %18, label %10
18: ; preds = %12, %10, %3
%19 = phi i32 [ 1, %3 ], [ 1, %10 ], [ 0, %12 ]
ret i32 %19
}