#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 GetConstant(char *, char);
int GetImmediate(char *, char);
int GetSymbol(char *, char);
int GetWord(char *, char);
int SearchDictionary(char *Name, char Action) {
  if ((GetWord(Name, Action) == (-1)) && (GetConstant(Name, Action) == (-1)) &&
      (GetImmediate(Name, Action) == (-1)) && (GetSymbol(Name, Action) == (-1)))
    return ((-1));
  else
    return ((-2));
}


x86 assembly (clang, -O0):
<SearchDictionary>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %sil,%al
mov    %rdi,-0x10(%rbp)
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%rdi
movsbl -0x11(%rbp),%esi
call   1050 <GetWord@plt>
cmp    $0xffffffff,%eax
jne    11b6 <SearchDictionary+0x76>
mov    -0x10(%rbp),%rdi
movsbl -0x11(%rbp),%esi
call   1030 <GetConstant@plt>
cmp    $0xffffffff,%eax
jne    11b6 <SearchDictionary+0x76>
mov    -0x10(%rbp),%rdi
movsbl -0x11(%rbp),%esi
call   1060 <GetImmediate@plt>
cmp    $0xffffffff,%eax
jne    11b6 <SearchDictionary+0x76>
mov    -0x10(%rbp),%rdi
movsbl -0x11(%rbp),%esi
call   1040 <GetSymbol@plt>
cmp    $0xffffffff,%eax
jne    11b6 <SearchDictionary+0x76>
movl   $0xffffffff,-0x4(%rbp)
jmp    11bd <SearchDictionary+0x7d>
movl   $0xfffffffe,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<SearchDictionary>:
push   %rbp
push   %rbx
push   %rax
mov    %esi,%ebp
mov    %rdi,%rbx
call   1050 <GetWord@plt>
cmp    $0xffffffff,%eax
jne    1183 <SearchDictionary+0x43>
movsbl %bpl,%ebp
mov    %rbx,%rdi
mov    %ebp,%esi
call   1030 <GetConstant@plt>
cmp    $0xffffffff,%eax
jne    1183 <SearchDictionary+0x43>
mov    %rbx,%rdi
mov    %ebp,%esi
call   1060 <GetImmediate@plt>
cmp    $0xffffffff,%eax
jne    1183 <SearchDictionary+0x43>
mov    %rbx,%rdi
mov    %ebp,%esi
call   1040 <GetSymbol@plt>
cmp    $0xffffffff,%eax
je     118f <SearchDictionary+0x4f>
mov    $0xfffffffe,%eax
add    $0x8,%rsp
pop    %rbx
pop    %rbp
ret
mov    $0xffffffff,%eax
jmp    1188 <SearchDictionary+0x48>

LLVM IR (-O0):
define i32 @SearchDictionary(i8* %0, i8 signext %1) {
%3 = alloca i32
%4 = alloca i8*
%5 = alloca i8
store i8* %0, i8** %4
store i8 %1, i8* %5
%6 = load i8*, i8** %4
%7 = load i8, i8* %5
%8 = call i32 @GetWord(i8* %6, i8 signext %7)
%9 = icmp eq i32 %8, -1
br i1 %9, label %10, label %26
10: ; preds = %2
%11 = load i8*, i8** %4
%12 = load i8, i8* %5
%13 = call i32 @GetConstant(i8* %11, i8 signext %12)
%14 = icmp eq i32 %13, -1
br i1 %14, label %15, label %26
15: ; preds = %10
%16 = load i8*, i8** %4
%17 = load i8, i8* %5
%18 = call i32 @GetImmediate(i8* %16, i8 signext %17)
%19 = icmp eq i32 %18, -1
br i1 %19, label %20, label %26
20: ; preds = %15
%21 = load i8*, i8** %4
%22 = load i8, i8* %5
%23 = call i32 @GetSymbol(i8* %21, i8 signext %22)
%24 = icmp eq i32 %23, -1
br i1 %24, label %25, label %26
25: ; preds = %20
store i32 -1, i32* %3
br label %27
26: ; preds = %20, %15, %10, %2
store i32 -2, i32* %3
br label %27
27: ; preds = %26, %25
%28 = load i32, i32* %3
ret i32 %28
}

LLVM IR (-O2):
define i32 @SearchDictionary(i8* %0, i8 signext %1) {
%3 = tail call i32 @GetWord(i8* %0, i8 signext %1)
%4 = icmp eq i32 %3, -1
br i1 %4, label %5, label %14
5: ; preds = %2
%6 = tail call i32 @GetConstant(i8* %0, i8 signext %1)
%7 = icmp eq i32 %6, -1
br i1 %7, label %8, label %14
8: ; preds = %5
%9 = tail call i32 @GetImmediate(i8* %0, i8 signext %1)
%10 = icmp eq i32 %9, -1
br i1 %10, label %11, label %14
11: ; preds = %8
%12 = tail call i32 @GetSymbol(i8* %0, i8 signext %1)
%13 = icmp eq i32 %12, -1
br i1 %13, label %15, label %14
14: ; preds = %11, %8, %5, %2
br label %15
15: ; preds = %11, %14
%16 = phi i32 [ -2, %14 ], [ -1, %11 ]
ret i32 %16
}