#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 *, char);
int is_initialpairok(char *s) {
  switch (s[0]) {
  case 'b':
  case 'f':
  case 'g':
  case 'k':
  case 'm':
  case 'p':
  case 'v':
  case 'x':
    return !!strchr("lr", s[1]);
  case 'c':
  case 's':
    return !!strchr("fklmnprt", s[1]);
  case 'd':
    return !!strchr("jrz", s[1]);
  case 'j':
  case 'z':
    return !!strchr("bdgmv", s[1]);
  case 't':
    return !!strchr("crs", s[1]);
  default:
    return 0;
  }
}


x86 assembly (clang, -O0):
<is_initialpairok>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
movsbl (%rax),%eax
add    $0xffffff9e,%eax
mov    %eax,%ecx
mov    %rcx,-0x18(%rbp)
sub    $0x18,%eax
ja     1220 <is_initialpairok+0x110>
mov    -0x18(%rbp),%rax
lea    0xec0(%rip),%rcx
movslq (%rcx,%rax,4),%rax
add    %rcx,%rax
jmp    *%rax
mov    -0x10(%rbp),%rax
lea    0xf10(%rip),%rdi
movsbl 0x1(%rax),%esi
call   1030 <strchr@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
jmp    1227 <is_initialpairok+0x117>
mov    -0x10(%rbp),%rax
lea    0xee8(%rip),%rdi
movsbl 0x1(%rax),%esi
call   1030 <strchr@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
jmp    1227 <is_initialpairok+0x117>
mov    -0x10(%rbp),%rax
lea    0xec6(%rip),%rdi
movsbl 0x1(%rax),%esi
call   1030 <strchr@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
jmp    1227 <is_initialpairok+0x117>
mov    -0x10(%rbp),%rax
lea    0xe9f(%rip),%rdi
movsbl 0x1(%rax),%esi
call   1030 <strchr@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
jmp    1227 <is_initialpairok+0x117>
mov    -0x10(%rbp),%rax
lea    0xe7a(%rip),%rdi
movsbl 0x1(%rax),%esi
call   1030 <strchr@plt>
cmp    $0x0,%eax
setne  %al
xor    $0xff,%al
xor    $0xff,%al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x4(%rbp)
jmp    1227 <is_initialpairok+0x117>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<is_initialpairok>:
push   %rax
movsbq (%rdi),%rcx
add    $0xffffffffffffff9e,%rcx
xor    %eax,%eax
cmp    $0x18,%ecx
ja     114d <is_initialpairok+0x3d>
mov    $0x1564b37,%edx
bt     %ecx,%edx
jae    114d <is_initialpairok+0x3d>
lea    0xeeb(%rip),%rdx
movslq (%rdx,%rcx,4),%rax
add    %rdx,%rax
movsbl 0x1(%rdi),%esi
mov    %rax,%rdi
call   1030 <strchr@plt>
mov    %eax,%ecx
xor    %eax,%eax
test   %ecx,%ecx
setne  %al
pop    %rcx
ret

LLVM IR (-O0):
@.str = [3 x i8] c"lr\00"
@.str.1 = [9 x i8] c"fklmnprt\00"
@.str.2 = [4 x i8] c"jrz\00"
@.str.3 = [6 x i8] c"bdgmv\00"
@.str.4 = [4 x i8] c"crs\00"
define i32 @is_initialpairok(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
store i8* %0, i8** %3
%4 = load i8*, i8** %3
%5 = getelementptr inbounds i8, i8* %4, i64 0
%6 = load i8, i8* %5
%7 = sext i8 %6 to i32
switch i32 %7, label %53 [
i32 98, label %8
i32 102, label %8
i32 103, label %8
i32 107, label %8
i32 109, label %8
i32 112, label %8
i32 118, label %8
i32 120, label %8
i32 99, label %17
i32 115, label %17
i32 100, label %26
i32 106, label %35
i32 122, label %35
i32 116, label %44
]
8: ; preds = %1, %1, %1, %1, %1, %1, %1, %1
%9 = load i8*, i8** %3
%10 = getelementptr inbounds i8, i8* %9, i64 1
%11 = load i8, i8* %10
%12 = call i32 @strchr(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i64 0, i64 0), i8 signext %11)
%13 = icmp ne i32 %12, 0
%14 = xor i1 %13, true
%15 = xor i1 %14, true
%16 = zext i1 %15 to i32
store i32 %16, i32* %2
br label %54
17: ; preds = %1, %1
%18 = load i8*, i8** %3
%19 = getelementptr inbounds i8, i8* %18, i64 1
%20 = load i8, i8* %19
%21 = call i32 @strchr(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str.1, i64 0, i64 0), i8 signext %20)
%22 = icmp ne i32 %21, 0
%23 = xor i1 %22, true
%24 = xor i1 %23, true
%25 = zext i1 %24 to i32
store i32 %25, i32* %2
br label %54
26: ; preds = %1
%27 = load i8*, i8** %3
%28 = getelementptr inbounds i8, i8* %27, i64 1
%29 = load i8, i8* %28
%30 = call i32 @strchr(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 0), i8 signext %29)
%31 = icmp ne i32 %30, 0
%32 = xor i1 %31, true
%33 = xor i1 %32, true
%34 = zext i1 %33 to i32
store i32 %34, i32* %2
br label %54
35: ; preds = %1, %1
%36 = load i8*, i8** %3
%37 = getelementptr inbounds i8, i8* %36, i64 1
%38 = load i8, i8* %37
%39 = call i32 @strchr(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.3, i64 0, i64 0), i8 signext %38)
%40 = icmp ne i32 %39, 0
%41 = xor i1 %40, true
%42 = xor i1 %41, true
%43 = zext i1 %42 to i32
store i32 %43, i32* %2
br label %54
44: ; preds = %1
%45 = load i8*, i8** %3
%46 = getelementptr inbounds i8, i8* %45, i64 1
%47 = load i8, i8* %46
%48 = call i32 @strchr(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 0), i8 signext %47)
%49 = icmp ne i32 %48, 0
%50 = xor i1 %49, true
%51 = xor i1 %50, true
%52 = zext i1 %51 to i32
store i32 %52, i32* %2
br label %54
53: ; preds = %1
store i32 0, i32* %2
br label %54
54: ; preds = %53, %44, %35, %26, %17, %8
%55 = load i32, i32* %2
ret i32 %55
}

LLVM IR (-O2):
@.str = [3 x i8] c"lr\00"
@.str.1 = [9 x i8] c"fklmnprt\00"
@.str.2 = [4 x i8] c"jrz\00"
@.str.3 = [6 x i8] c"bdgmv\00"
@.str.4 = [4 x i8] c"crs\00"
@reltable.is_initialpairok = [25 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str to i64), i64 ptrtoint ([25 x i32]* @reltable.is_initialpairok to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([9 x i8]* @.str.1 to i64), i64 ptrtoint ([25 x i32]* @reltable.is_initialpairok to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.2 to i64), i64 ptrtoint ([25 x i32]* @reltable.is_initialpairok to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str to i64), i64 ptrtoint ([25 x i32]* @reltable.is_initialpairok to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str to i64), i64 ptrtoint ([25 x i32]* @reltable.is_initialpairok to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str to i64), i64 ptrtoint ([25 x i32]* @reltable.is_initialpairok to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str to i64), i64 ptrtoint ([25 x i32]* @reltable.is_initialpairok to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str to i64), i64 ptrtoint ([25 x i32]* @reltable.is_initialpairok to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([6 x i8]* @.str.3 to i64), i64 ptrtoint ([25 x i32]* @reltable.is_initialpairok to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str to i64), i64 ptrtoint ([25 x i32]* @reltable.is_initialpairok to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str to i64), i64 ptrtoint ([25 x i32]* @reltable.is_initialpairok to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str to i64), i64 ptrtoint ([25 x i32]* @reltable.is_initialpairok to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str to i64), i64 ptrtoint ([25 x i32]* @reltable.is_initialpairok to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str to i64), i64 ptrtoint ([25 x i32]* @reltable.is_initialpairok to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str to i64), i64 ptrtoint ([25 x i32]* @reltable.is_initialpairok to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str to i64), i64 ptrtoint ([25 x i32]* @reltable.is_initialpairok to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str to i64), i64 ptrtoint ([25 x i32]* @reltable.is_initialpairok to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([9 x i8]* @.str.1 to i64), i64 ptrtoint ([25 x i32]* @reltable.is_initialpairok to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.4 to i64), i64 ptrtoint ([25 x i32]* @reltable.is_initialpairok to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str to i64), i64 ptrtoint ([25 x i32]* @reltable.is_initialpairok to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str to i64), i64 ptrtoint ([25 x i32]* @reltable.is_initialpairok to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str to i64), i64 ptrtoint ([25 x i32]* @reltable.is_initialpairok to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str to i64), i64 ptrtoint ([25 x i32]* @reltable.is_initialpairok to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str to i64), i64 ptrtoint ([25 x i32]* @reltable.is_initialpairok to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([6 x i8]* @.str.3 to i64), i64 ptrtoint ([25 x i32]* @reltable.is_initialpairok to i64)) to i32)]
define i32 @is_initialpairok(i8* nocapture %0) {
%2 = load i8, i8* %0
%3 = sext i8 %2 to i32
%4 = add nsw i32 %3, -98
%5 = icmp ult i32 %4, 25
br i1 %5, label %6, label %19
6: ; preds = %1
%7 = lshr i32 22432567, %4
%8 = and i32 %7, 1
%9 = icmp eq i32 %8, 0
br i1 %9, label %19, label %10
10: ; preds = %6
%11 = sext i32 %4 to i64
%12 = shl i64 %11, 2
%13 = call i8* @llvm.load.relative.i64(i8* bitcast ([25 x i32]* @reltable.is_initialpairok to i8*), i64 %12)
%14 = getelementptr inbounds i8, i8* %0, i64 1
%15 = load i8, i8* %14
%16 = tail call i32 @strchr(i8* %13, i8 signext %15)
%17 = icmp ne i32 %16, 0
%18 = zext i1 %17 to i32
br label %19
19: ; preds = %6, %1, %10
%20 = phi i32 [ 0, %1 ], [ %18, %10 ], [ 0, %6 ]
ret i32 %20
}