int match_char(char a) {
  char match_alpha[] = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
  int i = 0;
  if (a == '\0') {
    return 0;
  }
  while (match_alpha[i] != '\0') {
    if (match_alpha[i] == a)
      return 0;
    i++;
  }
  return -1;
}


x86 assembly (clang, -O0):
<match_char>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    %dil,%al
mov    %al,-0x5(%rbp)
lea    -0x40(%rbp),%rdi
lea    0xed7(%rip),%rsi
mov    $0x35,%edx
call   1030 <memcpy@plt>
movl   $0x0,-0x44(%rbp)
movsbl -0x5(%rbp),%eax
cmp    $0x0,%eax
jne    1153 <match_char+0x43>
movl   $0x0,-0x4(%rbp)
jmp    11a0 <match_char+0x90>
jmp    1158 <match_char+0x48>
movslq -0x44(%rbp),%rax
movsbl -0x40(%rbp,%rax,1),%eax
cmp    $0x0,%eax
je     1199 <match_char+0x89>
movslq -0x44(%rbp),%rax
movsbl -0x40(%rbp,%rax,1),%eax
movsbl -0x5(%rbp),%ecx
cmp    %ecx,%eax
jne    118b <match_char+0x7b>
movl   $0x0,-0x4(%rbp)
jmp    11a0 <match_char+0x90>
mov    -0x44(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x44(%rbp)
jmp    1158 <match_char+0x48>
movl   $0xffffffff,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<match_char>:
xor    %eax,%eax
test   %dil,%dil
je     114a <match_char+0x4a>
mov    $0x3,%ecx
lea    0xeed(%rip),%rdx
cs nopw 0x0(%rax,%rax,1)
nopl   (%rax)
cmp    %dil,-0x3(%rcx,%rdx,1)
je     114a <match_char+0x4a>
cmp    %dil,-0x2(%rcx,%rdx,1)
je     114a <match_char+0x4a>
cmp    %dil,-0x1(%rcx,%rdx,1)
je     114a <match_char+0x4a>
cmp    %dil,(%rcx,%rdx,1)
je     114a <match_char+0x4a>
add    $0x4,%rcx
cmp    $0x37,%rcx
jne    1120 <match_char+0x20>
mov    $0xffffffff,%eax
ret

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

LLVM IR (-O2):
@__const.match_char.match_alpha = [53 x i8] c"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ\00"
define i32 @match_char(i8 signext %0) {
%2 = icmp eq i8 %0, 0
br i1 %2, label %26, label %21
3: ; preds = %21
%4 = or i64 %22, 1
%5 = getelementptr inbounds [53 x i8], [53 x i8]* @__const.match_char.match_alpha, i64 0, i64 %4
%6 = load i8, i8* %5
%7 = icmp eq i8 %6, %0
br i1 %7, label %26, label %8
8: ; preds = %3
%9 = or i64 %22, 2
%10 = getelementptr inbounds [53 x i8], [53 x i8]* @__const.match_char.match_alpha, i64 0, i64 %9
%11 = load i8, i8* %10
%12 = icmp eq i8 %11, %0
br i1 %12, label %26, label %13
13: ; preds = %8
%14 = or i64 %22, 3
%15 = getelementptr inbounds [53 x i8], [53 x i8]* @__const.match_char.match_alpha, i64 0, i64 %14
%16 = load i8, i8* %15
%17 = icmp eq i8 %16, %0
%18 = add nuw nsw i64 %22, 4
br i1 %17, label %26, label %19
19: ; preds = %13
%20 = icmp eq i64 %18, 52
br i1 %20, label %26, label %21
21: ; preds = %1, %19
%22 = phi i64 [ %18, %19 ], [ 0, %1 ]
%23 = getelementptr inbounds [53 x i8], [53 x i8]* @__const.match_char.match_alpha, i64 0, i64 %22
%24 = load i8, i8* %23
%25 = icmp eq i8 %24, %0
br i1 %25, label %26, label %3
26: ; preds = %21, %3, %8, %13, %19, %1
%27 = phi i32 [ 0, %1 ], [ 0, %21 ], [ 0, %3 ], [ 0, %8 ], [ 0, %13 ], [ -1, %19 ]
ret i32 %27
}