#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*/ TSIL_Error(char *, char *, int);
int /*<<< orphan*/ strcmp(char const *, char *);
int TSIL_NumFuncs(const char *which) {
  char funcname[] = "TSIL_NumFuncs";
  if (!strcmp(which, "M"))
    return 1;
  else if (!strcmp(which, "U"))
    return 4;
  else if (!strcmp(which, "V"))
    return 4;
  else if (!strcmp(which, "T"))
    return 6;
  else if (!strcmp(which, "S"))
    return 2;
  else if (!strcmp(which, "B"))
    return 2;
  else
    TSIL_Error(funcname, "Invalid identifier specified.", 99);
  return 0;
}


x86 assembly (clang, -O0):
<TSIL_NumFuncs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x10(%rbp)
mov    0xecd(%rip),%rax
mov    %rax,-0x1e(%rbp)
mov    0xecb(%rip),%eax
mov    %eax,-0x16(%rbp)
mov    0xec5(%rip),%ax
mov    %ax,-0x12(%rbp)
mov    -0x10(%rbp),%rdi
lea    0xeb8(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    1170 <TSIL_NumFuncs+0x50>
movl   $0x1,-0x4(%rbp)
jmp    125e <TSIL_NumFuncs+0x13e>
mov    -0x10(%rbp),%rdi
lea    0xe95(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    1195 <TSIL_NumFuncs+0x75>
movl   $0x4,-0x4(%rbp)
jmp    125e <TSIL_NumFuncs+0x13e>
mov    -0x10(%rbp),%rdi
lea    0xe72(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    11ba <TSIL_NumFuncs+0x9a>
movl   $0x4,-0x4(%rbp)
jmp    125e <TSIL_NumFuncs+0x13e>
mov    -0x10(%rbp),%rdi
lea    0xe4f(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    11df <TSIL_NumFuncs+0xbf>
movl   $0x6,-0x4(%rbp)
jmp    125e <TSIL_NumFuncs+0x13e>
mov    -0x10(%rbp),%rdi
lea    0xe2c(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    1204 <TSIL_NumFuncs+0xe4>
movl   $0x2,-0x4(%rbp)
jmp    125e <TSIL_NumFuncs+0x13e>
mov    -0x10(%rbp),%rdi
lea    0xe09(%rip),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%eax
jne    1229 <TSIL_NumFuncs+0x109>
movl   $0x2,-0x4(%rbp)
jmp    125e <TSIL_NumFuncs+0x13e>
lea    -0x1e(%rbp),%rdi
lea    0xde6(%rip),%rsi
mov    $0x63,%edx
call   1030 <TSIL_Error@plt>
jmp    1243 <TSIL_NumFuncs+0x123>
jmp    1248 <TSIL_NumFuncs+0x128>
jmp    124d <TSIL_NumFuncs+0x12d>
jmp    1252 <TSIL_NumFuncs+0x132>
jmp    1257 <TSIL_NumFuncs+0x137>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<TSIL_NumFuncs>:
push   %rbp
push   %rbx
sub    $0x18,%rsp
mov    %rdi,%rbx
movabs $0x73636e75466d75,%rax
mov    %rax,0xe(%rsp)
movabs $0x6d754e5f4c495354,%rax
4e 75 6d
mov    %rax,0x8(%rsp)
lea    0xec0(%rip),%rsi
call   1040 <strcmp@plt>
test   %eax,%eax
je     11de <TSIL_NumFuncs+0xbe>
lea    0xeae(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
mov    $0x4,%ebp
test   %eax,%eax
je     11e3 <TSIL_NumFuncs+0xc3>
lea    0xe98(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %eax,%eax
je     11e3 <TSIL_NumFuncs+0xc3>
lea    0xe87(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %eax,%eax
je     11ec <TSIL_NumFuncs+0xcc>
lea    0xe76(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
mov    $0x2,%ebp
test   %eax,%eax
je     11e3 <TSIL_NumFuncs+0xc3>
lea    0xe60(%rip),%rsi
mov    %rbx,%rdi
call   1040 <strcmp@plt>
test   %eax,%eax
je     11e3 <TSIL_NumFuncs+0xc3>
lea    0xe4f(%rip),%rsi
lea    0x8(%rsp),%rdi
mov    $0x63,%edx
call   1030 <TSIL_Error@plt>
xor    %ebp,%ebp
jmp    11e3 <TSIL_NumFuncs+0xc3>
mov    $0x1,%ebp
mov    %ebp,%eax
add    $0x18,%rsp
pop    %rbx
pop    %rbp
ret
mov    $0x6,%ebp
jmp    11e3 <TSIL_NumFuncs+0xc3>

LLVM IR (-O0):
@__const.TSIL_NumFuncs.funcname = [14 x i8] c"TSIL_NumFuncs\00"
@.str = [2 x i8] c"M\00"
@.str.1 = [2 x i8] c"U\00"
@.str.2 = [2 x i8] c"V\00"
@.str.3 = [2 x i8] c"T\00"
@.str.4 = [2 x i8] c"S\00"
@.str.5 = [2 x i8] c"B\00"
@.str.6 = [30 x i8] c"Invalid identifier specified.\00"
define i32 @TSIL_NumFuncs(i8* %0) {
%2 = alloca i32
%3 = alloca i8*
%4 = alloca [14 x i8]
store i8* %0, i8** %3
%5 = bitcast [14 x i8]* %4 to i8*
%6 = load i8*, i8** %3
%7 = call i32 @strcmp(i8* %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%8 = icmp ne i32 %7, 0
br i1 %8, label %10, label %9
9: ; preds = %1
store i32 1, i32* %2
br label %44
10: ; preds = %1
%11 = load i8*, i8** %3
%12 = call i32 @strcmp(i8* %11, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%13 = icmp ne i32 %12, 0
br i1 %13, label %15, label %14
14: ; preds = %10
store i32 4, i32* %2
br label %44
15: ; preds = %10
%16 = load i8*, i8** %3
%17 = call i32 @strcmp(i8* %16, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%18 = icmp ne i32 %17, 0
br i1 %18, label %20, label %19
19: ; preds = %15
store i32 4, i32* %2
br label %44
20: ; preds = %15
%21 = load i8*, i8** %3
%22 = call i32 @strcmp(i8* %21, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%23 = icmp ne i32 %22, 0
br i1 %23, label %25, label %24
24: ; preds = %20
store i32 6, i32* %2
br label %44
25: ; preds = %20
%26 = load i8*, i8** %3
%27 = call i32 @strcmp(i8* %26, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%28 = icmp ne i32 %27, 0
br i1 %28, label %30, label %29
29: ; preds = %25
store i32 2, i32* %2
br label %44
30: ; preds = %25
%31 = load i8*, i8** %3
%32 = call i32 @strcmp(i8* %31, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%33 = icmp ne i32 %32, 0
br i1 %33, label %35, label %34
34: ; preds = %30
store i32 2, i32* %2
br label %44
35: ; preds = %30
%36 = getelementptr inbounds [14 x i8], [14 x i8]* %4, i64 0, i64 0
%37 = call i32 @TSIL_Error(i8* %36, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.6, i64 0, i64 0), i32 99)
br label %38
38: ; preds = %35
br label %39
39: ; preds = %38
br label %40
40: ; preds = %39
br label %41
41: ; preds = %40
br label %42
42: ; preds = %41
br label %43
43: ; preds = %42
store i32 0, i32* %2
br label %44
44: ; preds = %43, %34, %29, %24, %19, %14, %9
%45 = load i32, i32* %2
ret i32 %45
}

LLVM IR (-O2):
@__const.TSIL_NumFuncs.funcname = [14 x i8] c"TSIL_NumFuncs\00"
@.str = [2 x i8] c"M\00"
@.str.1 = [2 x i8] c"U\00"
@.str.2 = [2 x i8] c"V\00"
@.str.3 = [2 x i8] c"T\00"
@.str.4 = [2 x i8] c"S\00"
@.str.5 = [2 x i8] c"B\00"
@.str.6 = [30 x i8] c"Invalid identifier specified.\00"
define i32 @TSIL_NumFuncs(i8* nocapture %0) {
%2 = alloca [14 x i8]
%3 = getelementptr inbounds [14 x i8], [14 x i8]* %2, i64 0, i64 0
%4 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(2) getelementptr inbounds ([2 x i8], [2 x i8]* @.str, i64 0, i64 0))
%5 = icmp eq i32 %4, 0
br i1 %5, label %23, label %6
6: ; preds = %1
%7 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(2) getelementptr inbounds ([2 x i8], [2 x i8]* @.str.1, i64 0, i64 0))
%8 = icmp eq i32 %7, 0
br i1 %8, label %23, label %9
9: ; preds = %6
%10 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(2) getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%11 = icmp eq i32 %10, 0
br i1 %11, label %23, label %12
12: ; preds = %9
%13 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(2) getelementptr inbounds ([2 x i8], [2 x i8]* @.str.3, i64 0, i64 0))
%14 = icmp eq i32 %13, 0
br i1 %14, label %23, label %15
15: ; preds = %12
%16 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(2) getelementptr inbounds ([2 x i8], [2 x i8]* @.str.4, i64 0, i64 0))
%17 = icmp eq i32 %16, 0
br i1 %17, label %23, label %18
18: ; preds = %15
%19 = tail call i32 @strcmp(i8* dereferenceable(1) %0, i8* dereferenceable(2) getelementptr inbounds ([2 x i8], [2 x i8]* @.str.5, i64 0, i64 0))
%20 = icmp eq i32 %19, 0
br i1 %20, label %23, label %21
21: ; preds = %18
%22 = call i32 @TSIL_Error(i8* %3, i8* getelementptr inbounds ([30 x i8], [30 x i8]* @.str.6, i64 0, i64 0), i32 99)
br label %23
23: ; preds = %18, %15, %12, %9, %6, %1, %21
%24 = phi i32 [ 0, %21 ], [ 1, %1 ], [ 4, %6 ], [ 4, %9 ], [ 6, %12 ], [ 2, %15 ], [ 2, %18 ]
ret i32 %24
}