#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*/ AlgMorphGetEnglishNounRoot(char *, char *);
int /*<<< orphan*/ AlgMorphGetEnglishVerbRoot(char *, char *);
int /*<<< orphan*/ AlgMorphGetFrenchAdjNounRoot(char *, char *);
int /*<<< orphan*/ AlgMorphGetFrenchVerbRoot(char *, char *);
int /*<<< orphan*/ Dbg(int, int, char *);
int /*<<< orphan*/ StringCpy(char *, char *, int);
void AlgMorphGetRoot(char *word, int gender, int number, int pos, int lang,
                     char *root) {
  if (lang == 'y') {
    if (pos == 'V')
      AlgMorphGetFrenchVerbRoot(word, root);
    else if (pos == 'A')
      AlgMorphGetFrenchAdjNounRoot(word, root);
    else if (pos == 'N')
      AlgMorphGetFrenchAdjNounRoot(word, root);
    else
      StringCpy(root, word, 128);
  } else if (lang == 'z') {
    if (pos == 'V')
      AlgMorphGetEnglishVerbRoot(word, root);
    else if (pos == 'N')
      AlgMorphGetEnglishNounRoot(word, root);
    else
      StringCpy(root, word, 128);
  } else {
    Dbg(0x80, 1, "AlgMorphGetWordRoot");
    StringCpy(root, word, 128);
  }
}


x86 assembly (clang, -O0):
<AlgMorphGetRoot>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    %r8d,-0x18(%rbp)
mov    %r9,-0x20(%rbp)
cmpl   $0x79,-0x18(%rbp)
jne    11fc <AlgMorphGetRoot+0x9c>
cmpl   $0x56,-0x14(%rbp)
jne    11a3 <AlgMorphGetRoot+0x43>
mov    -0x8(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1050 <AlgMorphGetFrenchVerbRoot@plt>
jmp    11f7 <AlgMorphGetRoot+0x97>
cmpl   $0x41,-0x14(%rbp)
jne    11bf <AlgMorphGetRoot+0x5f>
mov    -0x8(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1060 <AlgMorphGetFrenchAdjNounRoot@plt>
jmp    11f2 <AlgMorphGetRoot+0x92>
cmpl   $0x4e,-0x14(%rbp)
jne    11db <AlgMorphGetRoot+0x7b>
mov    -0x8(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1060 <AlgMorphGetFrenchAdjNounRoot@plt>
jmp    11ed <AlgMorphGetRoot+0x8d>
mov    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    $0x80,%edx
call   1080 <StringCpy@plt>
jmp    11f2 <AlgMorphGetRoot+0x92>
jmp    11f7 <AlgMorphGetRoot+0x97>
jmp    1287 <AlgMorphGetRoot+0x127>
cmpl   $0x7a,-0x18(%rbp)
jne    125a <AlgMorphGetRoot+0xfa>
cmpl   $0x56,-0x14(%rbp)
jne    1222 <AlgMorphGetRoot+0xc2>
mov    -0x8(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1070 <AlgMorphGetEnglishVerbRoot@plt>
jmp    1255 <AlgMorphGetRoot+0xf5>
cmpl   $0x4e,-0x14(%rbp)
jne    123e <AlgMorphGetRoot+0xde>
mov    -0x8(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1030 <AlgMorphGetEnglishNounRoot@plt>
jmp    1250 <AlgMorphGetRoot+0xf0>
mov    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    $0x80,%edx
call   1080 <StringCpy@plt>
jmp    1255 <AlgMorphGetRoot+0xf5>
jmp    1282 <AlgMorphGetRoot+0x122>
mov    $0x80,%edi
mov    $0x1,%esi
lea    0xd95(%rip),%rdx
call   1040 <Dbg@plt>
mov    -0x20(%rbp),%rdi
mov    -0x8(%rbp),%rsi
mov    $0x80,%edx
call   1080 <StringCpy@plt>
jmp    1287 <AlgMorphGetRoot+0x127>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<AlgMorphGetRoot>:
push   %r14
push   %rbx
push   %rax
mov    %r9,%r14
mov    %rdi,%rbx
cmp    $0x7a,%r8d
je     1197 <AlgMorphGetRoot+0x37>
cmp    $0x79,%r8d
jne    11b3 <AlgMorphGetRoot+0x53>
cmp    $0x41,%ecx
je     11e0 <AlgMorphGetRoot+0x80>
cmp    $0x4e,%ecx
je     11e0 <AlgMorphGetRoot+0x80>
cmp    $0x56,%ecx
jne    11c9 <AlgMorphGetRoot+0x69>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1050 <AlgMorphGetFrenchVerbRoot@plt>
cmp    $0x4e,%ecx
je     11f2 <AlgMorphGetRoot+0x92>
cmp    $0x56,%ecx
jne    11c9 <AlgMorphGetRoot+0x69>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1070 <AlgMorphGetEnglishVerbRoot@plt>
lea    0xe46(%rip),%rdx
mov    $0x80,%edi
mov    $0x1,%esi
call   1040 <Dbg@plt>
mov    %r14,%rdi
mov    %rbx,%rsi
mov    $0x80,%edx
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1080 <StringCpy@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1060 <AlgMorphGetFrenchAdjNounRoot@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1030 <AlgMorphGetEnglishNounRoot@plt>

LLVM IR (-O0):
@.str = [20 x i8] c"AlgMorphGetWordRoot\00"
define void @AlgMorphGetRoot(i8* %0, i32 %1, i32 %2, i32 %3, i32 %4, i8* %5) {
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i32
%10 = alloca i32
%11 = alloca i32
%12 = alloca i8*
store i8* %0, i8** %7
store i32 %1, i32* %8
store i32 %2, i32* %9
store i32 %3, i32* %10
store i32 %4, i32* %11
store i8* %5, i8** %12
%13 = load i32, i32* %11
%14 = icmp eq i32 %13, 121
br i1 %14, label %15, label %43
15: ; preds = %6
%16 = load i32, i32* %10
%17 = icmp eq i32 %16, 86
br i1 %17, label %18, label %22
18: ; preds = %15
%19 = load i8*, i8** %7
%20 = load i8*, i8** %12
%21 = call i32 @AlgMorphGetFrenchVerbRoot(i8* %19, i8* %20)
br label %42
22: ; preds = %15
%23 = load i32, i32* %10
%24 = icmp eq i32 %23, 65
br i1 %24, label %25, label %29
25: ; preds = %22
%26 = load i8*, i8** %7
%27 = load i8*, i8** %12
%28 = call i32 @AlgMorphGetFrenchAdjNounRoot(i8* %26, i8* %27)
br label %41
29: ; preds = %22
%30 = load i32, i32* %10
%31 = icmp eq i32 %30, 78
br i1 %31, label %32, label %36
32: ; preds = %29
%33 = load i8*, i8** %7
%34 = load i8*, i8** %12
%35 = call i32 @AlgMorphGetFrenchAdjNounRoot(i8* %33, i8* %34)
br label %40
36: ; preds = %29
%37 = load i8*, i8** %12
%38 = load i8*, i8** %7
%39 = call i32 @StringCpy(i8* %37, i8* %38, i32 128)
br label %40
40: ; preds = %36, %32
br label %41
41: ; preds = %40, %25
br label %42
42: ; preds = %41, %18
br label %72
43: ; preds = %6
%44 = load i32, i32* %11
%45 = icmp eq i32 %44, 122
br i1 %45, label %46, label %66
46: ; preds = %43
%47 = load i32, i32* %10
%48 = icmp eq i32 %47, 86
br i1 %48, label %49, label %53
49: ; preds = %46
%50 = load i8*, i8** %7
%51 = load i8*, i8** %12
%52 = call i32 @AlgMorphGetEnglishVerbRoot(i8* %50, i8* %51)
br label %65
53: ; preds = %46
%54 = load i32, i32* %10
%55 = icmp eq i32 %54, 78
br i1 %55, label %56, label %60
56: ; preds = %53
%57 = load i8*, i8** %7
%58 = load i8*, i8** %12
%59 = call i32 @AlgMorphGetEnglishNounRoot(i8* %57, i8* %58)
br label %64
60: ; preds = %53
%61 = load i8*, i8** %12
%62 = load i8*, i8** %7
%63 = call i32 @StringCpy(i8* %61, i8* %62, i32 128)
br label %64
64: ; preds = %60, %56
br label %65
65: ; preds = %64, %49
br label %71
66: ; preds = %43
%67 = call i32 @Dbg(i32 128, i32 1, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%68 = load i8*, i8** %12
%69 = load i8*, i8** %7
%70 = call i32 @StringCpy(i8* %68, i8* %69, i32 128)
br label %71
71: ; preds = %66, %65
br label %72
72: ; preds = %71, %42
ret void
}

LLVM IR (-O2):
@.str = [20 x i8] c"AlgMorphGetWordRoot\00"
define void @AlgMorphGetRoot(i8* %0, i32 %1, i32 %2, i32 %3, i32 %4, i8* %5) {
switch i32 %4, label %23 [
i32 121, label %7
i32 122, label %16
]
7: ; preds = %6
switch i32 %3, label %14 [
i32 86, label %8
i32 65, label %10
i32 78, label %12
]
8: ; preds = %7
%9 = tail call i32 @AlgMorphGetFrenchVerbRoot(i8* %0, i8* %5)
br label %26
10: ; preds = %7
%11 = tail call i32 @AlgMorphGetFrenchAdjNounRoot(i8* %0, i8* %5)
br label %26
12: ; preds = %7
%13 = tail call i32 @AlgMorphGetFrenchAdjNounRoot(i8* %0, i8* %5)
br label %26
14: ; preds = %7
%15 = tail call i32 @StringCpy(i8* %5, i8* %0, i32 128)
br label %26
16: ; preds = %6
switch i32 %3, label %21 [
i32 86, label %17
i32 78, label %19
]
17: ; preds = %16
%18 = tail call i32 @AlgMorphGetEnglishVerbRoot(i8* %0, i8* %5)
br label %26
19: ; preds = %16
%20 = tail call i32 @AlgMorphGetEnglishNounRoot(i8* %0, i8* %5)
br label %26
21: ; preds = %16
%22 = tail call i32 @StringCpy(i8* %5, i8* %0, i32 128)
br label %26
23: ; preds = %6
%24 = tail call i32 @Dbg(i32 128, i32 1, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str, i64 0, i64 0))
%25 = tail call i32 @StringCpy(i8* %5, i8* %0, i32 128)
br label %26
26: ; preds = %23, %19, %21, %17, %8, %12, %14, %10
ret void
}