#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 */
typedef int /*<<< orphan*/ regs;

/* Variables and functions */
scalar_t__ strcmp(char const *, char *);
int isregister(const char *name) {
  static char *regs[] = {
      "al",  "bl",  "cl",  "dl",  "ah",  "bh",  "ch",  "dh",  "ax",
      "bx",  "cx",  "dx",  "si",  "di",  "bp",  "sp",  "eax", "ebx",
      "ecx", "edx", "esi", "edi", "ebp", "esp", "cs",  "ds",  "es",
      "fs",  "gs",  "ss",  "cr0", "cr1", "cr2", "cr3", "cr4", "dr0",
      "dr1", "dr2", "dr3", "dr6", "dr7", "st",
  };
  int reg;
  for (reg = 0; reg < (sizeof(regs) / sizeof((regs)[0])); reg++) {
    if (strcmp(name, regs[reg]) == 0)
      return reg + 1;
  }
  return 0;
}


x86 assembly (clang, -O0):
<isregister>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movslq -0x14(%rbp),%rax
cmp    $0x2a,%rax
jae    1174 <isregister+0x64>
mov    -0x10(%rbp),%rdi
movslq -0x14(%rbp),%rcx
lea    0x2ef0(%rip),%rax
mov    (%rax,%rcx,8),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
jne    1161 <isregister+0x51>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x4(%rbp)
jmp    117b <isregister+0x6b>
jmp    1166 <isregister+0x56>
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    1123 <isregister+0x13>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<isregister>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdi,%r14
mov    $0x1,%ebp
xor    %ebx,%ebx
lea    0xed8(%rip),%r15
nopl   0x0(%rax,%rax,1)
movslq (%rbx,%r15,1),%rsi
add    %r15,%rsi
mov    %r14,%rdi
call   1030 <strcmp@plt>
test   %rax,%rax
je     1156 <isregister+0x46>
add    $0x4,%rbx
add    $0x1,%ebp
cmp    $0xa8,%rbx
jne    1130 <isregister+0x20>
xor    %ebp,%ebp
mov    %ebp,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@isregister.regs = internal global [42 x i8*] [i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.2, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.3, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.5, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.6, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.7, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.8, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.9, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.10, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.11, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.12, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.13, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.14, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.15, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.16, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.17, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.18, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.19, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.20, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.21, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.22, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.23, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.24, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.25, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.26, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.27, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.28, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.29, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.30, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.31, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.32, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.33, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.34, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.35, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.36, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.37, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.38, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.39, i32 0, i32 0), i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.40, i32 0, i32 0), i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.41, i32 0, i32 0)]
@.str = [3 x i8] c"al\00"
@.str.1 = [3 x i8] c"bl\00"
@.str.2 = [3 x i8] c"cl\00"
@.str.3 = [3 x i8] c"dl\00"
@.str.4 = [3 x i8] c"ah\00"
@.str.5 = [3 x i8] c"bh\00"
@.str.6 = [3 x i8] c"ch\00"
@.str.7 = [3 x i8] c"dh\00"
@.str.8 = [3 x i8] c"ax\00"
@.str.9 = [3 x i8] c"bx\00"
@.str.10 = [3 x i8] c"cx\00"
@.str.11 = [3 x i8] c"dx\00"
@.str.12 = [3 x i8] c"si\00"
@.str.13 = [3 x i8] c"di\00"
@.str.14 = [3 x i8] c"bp\00"
@.str.15 = [3 x i8] c"sp\00"
@.str.16 = [4 x i8] c"eax\00"
@.str.17 = [4 x i8] c"ebx\00"
@.str.18 = [4 x i8] c"ecx\00"
@.str.19 = [4 x i8] c"edx\00"
@.str.20 = [4 x i8] c"esi\00"
@.str.21 = [4 x i8] c"edi\00"
@.str.22 = [4 x i8] c"ebp\00"
@.str.23 = [4 x i8] c"esp\00"
@.str.24 = [3 x i8] c"cs\00"
@.str.25 = [3 x i8] c"ds\00"
@.str.26 = [3 x i8] c"es\00"
@.str.27 = [3 x i8] c"fs\00"
@.str.28 = [3 x i8] c"gs\00"
@.str.29 = [3 x i8] c"ss\00"
@.str.30 = [4 x i8] c"cr0\00"
@.str.31 = [4 x i8] c"cr1\00"
@.str.32 = [4 x i8] c"cr2\00"
@.str.33 = [4 x i8] c"cr3\00"
@.str.34 = [4 x i8] c"cr4\00"
@.str.35 = [4 x i8] c"dr0\00"
@.str.36 = [4 x i8] c"dr1\00"
@.str.37 = [4 x i8] c"dr2\00"
@.str.38 = [4 x i8] c"dr3\00"
@.str.39 = [4 x i8] c"dr6\00"
@.str.40 = [4 x i8] c"dr7\00"
@.str.41 = [3 x i8] c"st\00"
define i32 @isregister(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca i32
store i8* %0, i8** %3
store i32 0, i32* %4
br label %5
5: ; preds = %21, %1
%6 = load i32, i32* %4
%7 = sext i32 %6 to i64
%8 = icmp ult i64 %7, 42
br i1 %8, label %9, label %24
9: ; preds = %5
%10 = load i8*, i8** %3
%11 = load i32, i32* %4
%12 = sext i32 %11 to i64
%13 = getelementptr inbounds [42 x i8*], [42 x i8*]* @isregister.regs, i64 0, i64 %12
%14 = load i8*, i8** %13
%15 = call i64 @strcmp(i8* %10, i8* %14)
%16 = icmp eq i64 %15, 0
br i1 %16, label %17, label %20
17: ; preds = %9
%18 = load i32, i32* %4
%19 = add nsw i32 %18, 1
store i32 %19, i32* %2
br label %25
20: ; preds = %9
br label %21
21: ; preds = %20
%22 = load i32, i32* %4
%23 = add nsw i32 %22, 1
store i32 %23, i32* %4
br label %5
24: ; preds = %5
store i32 0, i32* %2
br label %25
25: ; preds = %24, %17
%26 = load i32, i32* %2
ret i32 %26
}

LLVM IR (-O2):
@reltable.isregister = internal unnamed_addr constant [42 x i32] [i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str to i64), i64 ptrtoint ([42 x i32]* @reltable.isregister to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str.1 to i64), i64 ptrtoint ([42 x i32]* @reltable.isregister to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str.2 to i64), i64 ptrtoint ([42 x i32]* @reltable.isregister to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str.3 to i64), i64 ptrtoint ([42 x i32]* @reltable.isregister to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str.4 to i64), i64 ptrtoint ([42 x i32]* @reltable.isregister to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str.5 to i64), i64 ptrtoint ([42 x i32]* @reltable.isregister to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str.6 to i64), i64 ptrtoint ([42 x i32]* @reltable.isregister to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str.7 to i64), i64 ptrtoint ([42 x i32]* @reltable.isregister to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str.8 to i64), i64 ptrtoint ([42 x i32]* @reltable.isregister to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str.9 to i64), i64 ptrtoint ([42 x i32]* @reltable.isregister to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str.10 to i64), i64 ptrtoint ([42 x i32]* @reltable.isregister to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str.11 to i64), i64 ptrtoint ([42 x i32]* @reltable.isregister to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str.12 to i64), i64 ptrtoint ([42 x i32]* @reltable.isregister to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str.13 to i64), i64 ptrtoint ([42 x i32]* @reltable.isregister to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str.14 to i64), i64 ptrtoint ([42 x i32]* @reltable.isregister to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str.15 to i64), i64 ptrtoint ([42 x i32]* @reltable.isregister to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.16 to i64), i64 ptrtoint ([42 x i32]* @reltable.isregister to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.17 to i64), i64 ptrtoint ([42 x i32]* @reltable.isregister to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.18 to i64), i64 ptrtoint ([42 x i32]* @reltable.isregister to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.19 to i64), i64 ptrtoint ([42 x i32]* @reltable.isregister to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.20 to i64), i64 ptrtoint ([42 x i32]* @reltable.isregister to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.21 to i64), i64 ptrtoint ([42 x i32]* @reltable.isregister to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.22 to i64), i64 ptrtoint ([42 x i32]* @reltable.isregister to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.23 to i64), i64 ptrtoint ([42 x i32]* @reltable.isregister to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str.24 to i64), i64 ptrtoint ([42 x i32]* @reltable.isregister to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str.25 to i64), i64 ptrtoint ([42 x i32]* @reltable.isregister to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str.26 to i64), i64 ptrtoint ([42 x i32]* @reltable.isregister to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str.27 to i64), i64 ptrtoint ([42 x i32]* @reltable.isregister to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str.28 to i64), i64 ptrtoint ([42 x i32]* @reltable.isregister to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str.29 to i64), i64 ptrtoint ([42 x i32]* @reltable.isregister to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.30 to i64), i64 ptrtoint ([42 x i32]* @reltable.isregister to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.31 to i64), i64 ptrtoint ([42 x i32]* @reltable.isregister to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.32 to i64), i64 ptrtoint ([42 x i32]* @reltable.isregister to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.33 to i64), i64 ptrtoint ([42 x i32]* @reltable.isregister to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.34 to i64), i64 ptrtoint ([42 x i32]* @reltable.isregister to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.35 to i64), i64 ptrtoint ([42 x i32]* @reltable.isregister to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.36 to i64), i64 ptrtoint ([42 x i32]* @reltable.isregister to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.37 to i64), i64 ptrtoint ([42 x i32]* @reltable.isregister to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.38 to i64), i64 ptrtoint ([42 x i32]* @reltable.isregister to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.39 to i64), i64 ptrtoint ([42 x i32]* @reltable.isregister to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([4 x i8]* @.str.40 to i64), i64 ptrtoint ([42 x i32]* @reltable.isregister to i64)) to i32), i32 trunc (i64 sub (i64 ptrtoint ([3 x i8]* @.str.41 to i64), i64 ptrtoint ([42 x i32]* @reltable.isregister to i64)) to i32)]
@.str = [3 x i8] c"al\00"
@.str.1 = [3 x i8] c"bl\00"
@.str.2 = [3 x i8] c"cl\00"
@.str.3 = [3 x i8] c"dl\00"
@.str.4 = [3 x i8] c"ah\00"
@.str.5 = [3 x i8] c"bh\00"
@.str.6 = [3 x i8] c"ch\00"
@.str.7 = [3 x i8] c"dh\00"
@.str.8 = [3 x i8] c"ax\00"
@.str.9 = [3 x i8] c"bx\00"
@.str.10 = [3 x i8] c"cx\00"
@.str.11 = [3 x i8] c"dx\00"
@.str.12 = [3 x i8] c"si\00"
@.str.13 = [3 x i8] c"di\00"
@.str.14 = [3 x i8] c"bp\00"
@.str.15 = [3 x i8] c"sp\00"
@.str.16 = [4 x i8] c"eax\00"
@.str.17 = [4 x i8] c"ebx\00"
@.str.18 = [4 x i8] c"ecx\00"
@.str.19 = [4 x i8] c"edx\00"
@.str.20 = [4 x i8] c"esi\00"
@.str.21 = [4 x i8] c"edi\00"
@.str.22 = [4 x i8] c"ebp\00"
@.str.23 = [4 x i8] c"esp\00"
@.str.24 = [3 x i8] c"cs\00"
@.str.25 = [3 x i8] c"ds\00"
@.str.26 = [3 x i8] c"es\00"
@.str.27 = [3 x i8] c"fs\00"
@.str.28 = [3 x i8] c"gs\00"
@.str.29 = [3 x i8] c"ss\00"
@.str.30 = [4 x i8] c"cr0\00"
@.str.31 = [4 x i8] c"cr1\00"
@.str.32 = [4 x i8] c"cr2\00"
@.str.33 = [4 x i8] c"cr3\00"
@.str.34 = [4 x i8] c"cr4\00"
@.str.35 = [4 x i8] c"dr0\00"
@.str.36 = [4 x i8] c"dr1\00"
@.str.37 = [4 x i8] c"dr2\00"
@.str.38 = [4 x i8] c"dr3\00"
@.str.39 = [4 x i8] c"dr6\00"
@.str.40 = [4 x i8] c"dr7\00"
@.str.41 = [3 x i8] c"st\00"
define i32 @isregister(i8* %0) {
br label %2
2: ; preds = %1, %11
%3 = phi i64 [ 0, %1 ], [ %12, %11 ]
%4 = shl i64 %3, 2
%5 = call i8* @llvm.load.relative.i64(i8* bitcast ([42 x i32]* @reltable.isregister to i8*), i64 %4)
%6 = tail call i64 @strcmp(i8* %0, i8* %5)
%7 = icmp eq i64 %6, 0
br i1 %7, label %8, label %11
8: ; preds = %2
%9 = trunc i64 %3 to i32
%10 = add nuw nsw i32 %9, 1
br label %14
11: ; preds = %2
%12 = add nuw nsw i64 %3, 1
%13 = icmp eq i64 %12, 42
br i1 %13, label %14, label %2
14: ; preds = %11, %8
%15 = phi i32 [ %10, %8 ], [ 0, %11 ]
ret i32 %15
}