#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 strlen(char *);
bool is_sequence_end(char *c) {
  char terminators[] = "ABCDEFGHJKRSTfminsulhp";
  int i;
  for (i = 0; i < strlen(terminators); i++) {
    if (terminators[i] == *c)
      return true;
  }
  return false;
}


x86 assembly (clang, -O0):
<is_sequence_end>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x10(%rbp)
mov    0xedd(%rip),%rax
mov    %rax,-0x30(%rbp)
mov    0xeda(%rip),%rax
mov    %rax,-0x28(%rbp)
mov    0xed8(%rip),%eax
mov    %eax,-0x20(%rbp)
mov    0xed2(%rip),%ax
mov    %ax,-0x1c(%rbp)
mov    0xeca(%rip),%al
mov    %al,-0x1a(%rbp)
movl   $0x0,-0x34(%rbp)
mov    -0x34(%rbp),%eax
mov    %eax,-0x38(%rbp)
lea    -0x30(%rbp),%rdi
call   1030 <strlen@plt>
mov    %eax,%ecx
mov    -0x38(%rbp),%eax
cmp    %ecx,%eax
jge    11a9 <is_sequence_end+0x99>
movslq -0x34(%rbp),%rax
movsbl -0x30(%rbp,%rax,1),%eax
mov    -0x10(%rbp),%rcx
movsbl (%rcx),%ecx
cmp    %ecx,%eax
jne    1196 <is_sequence_end+0x86>
movl   $0x1,-0x4(%rbp)
jmp    11b0 <is_sequence_end+0xa0>
jmp    119b <is_sequence_end+0x8b>
mov    -0x34(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x34(%rbp)
jmp    1156 <is_sequence_end+0x46>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_sequence_end>:
push   %r15
push   %r14
push   %rbx
sub    $0x20,%rsp
mov    %rdi,%r15
movaps 0xedd(%rip),%xmm0
movaps %xmm0,(%rsp)
movabs $0x70686c75736e69,%rax
mov    %rax,0xf(%rsp)
mov    %rsp,%rdi
call   1030 <strlen@plt>
test   %eax,%eax
jle    116c <is_sequence_end+0x5c>
xor    %ebx,%ebx
mov    %rsp,%r14
nopw   0x0(%rax,%rax,1)
movzbl (%rsp,%rbx,1),%eax
cmp    (%r15),%al
je     1170 <is_sequence_end+0x60>
add    $0x1,%rbx
mov    %r14,%rdi
call   1030 <strlen@plt>
cltq
cmp    %rax,%rbx
jl     1150 <is_sequence_end+0x40>
xor    %eax,%eax
jmp    1175 <is_sequence_end+0x65>
mov    $0x1,%eax
add    $0x20,%rsp
pop    %rbx
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
@__const.is_sequence_end.terminators = [23 x i8] c"ABCDEFGHJKRSTfminsulhp\00"
define i32 @is_sequence_end(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca [23 x i8]
%5 = alloca i32
store i8* %0, i8** %3
%6 = bitcast [23 x i8]* %4 to i8*
store i32 0, i32* %5
br label %7
7: ; preds = %24, %1
%8 = load i32, i32* %5
%9 = getelementptr inbounds [23 x i8], [23 x i8]* %4, i64 0, i64 0
%10 = call i32 @strlen(i8* %9)
%11 = icmp slt i32 %8, %10
br i1 %11, label %12, label %27
12: ; preds = %7
%13 = load i32, i32* %5
%14 = sext i32 %13 to i64
%15 = getelementptr inbounds [23 x i8], [23 x i8]* %4, i64 0, i64 %14
%16 = load i8, i8* %15
%17 = sext i8 %16 to i32
%18 = load i8*, i8** %3
%19 = load i8, i8* %18
%20 = sext i8 %19 to i32
%21 = icmp eq i32 %17, %20
br i1 %21, label %22, label %23
22: ; preds = %12
store i32 1, i32* %2
br label %28
23: ; preds = %12
br label %24
24: ; preds = %23
%25 = load i32, i32* %5
%26 = add nsw i32 %25, 1
store i32 %26, i32* %5
br label %7
27: ; preds = %7
store i32 0, i32* %2
br label %28
28: ; preds = %27, %22
%29 = load i32, i32* %2
ret i32 %29
}

LLVM IR (-O2):
@__const.is_sequence_end.terminators = [23 x i8] c"ABCDEFGHJKRSTfminsulhp\00"
define i32 @is_sequence_end(i8* nocapture %0) {
%2 = alloca [23 x i8]
%3 = getelementptr inbounds [23 x i8], [23 x i8]* %2, i64 0, i64 0
%4 = call i32 @strlen(i8* %3)
%5 = icmp sgt i32 %4, 0
br i1 %5, label %10, label %17
6: ; preds = %10
%7 = call i32 @strlen(i8* %3)
%8 = sext i32 %7 to i64
%9 = icmp slt i64 %16, %8
br i1 %9, label %10, label %17
10: ; preds = %1, %6
%11 = phi i64 [ %16, %6 ], [ 0, %1 ]
%12 = getelementptr inbounds [23 x i8], [23 x i8]* %2, i64 0, i64 %11
%13 = load i8, i8* %12
%14 = load i8, i8* %0
%15 = icmp eq i8 %13, %14
%16 = add nuw nsw i64 %11, 1
br i1 %15, label %17, label %6
17: ; preds = %10, %6, %1
%18 = phi i32 [ 0, %1 ], [ 0, %6 ], [ 1, %10 ]
ret i32 %18
}