#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 */
size_t abs(char);
int /*<<< orphan*/ build_at_prj(char *, char *);
int /*<<< orphan*/ build_cm_prj(char *, char *);
int /*<<< orphan*/ build_m_prj(char *, char *, char *);
int build_prj(char *params[]) {
  if (params[abs('a' - "'t'"[1])] != NULL)
    build_at_prj(params[abs('a' - "'a'"[1])], params[abs('a' - "'p'"[1])]);
  else if (params[abs('a' - "'m'"[1])] != NULL)
    build_m_prj(params[abs('a' - "'a'"[1])], params[abs('a' - "'p'"[1])],
                params[abs('a' - "'m'"[1])]);
  else if (params[abs('a' - "'k'"[1])] != NULL)
    build_cm_prj(params[abs('a' - "'a'"[1])], params[abs('a' - "'p'"[1])]);
  else
    return -1;
  return 0;
}


x86 assembly (clang, -O0):
<build_prj>:
push   %rbp
mov    %rsp,%rbp
sub    $0x80,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
movsbl 0xea3(%rip),%ecx
mov    $0x61,%eax
sub    %ecx,%eax
movsbl %al,%edi
call   1030 <abs@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
cmpq   $0x0,(%rax,%rcx,8)
je     11e3 <build_prj+0xa3>
mov    -0x10(%rbp),%rax
mov    %rax,-0x30(%rbp)
movsbl 0xe77(%rip),%ecx
mov    $0x61,%eax
sub    %ecx,%eax
movsbl %al,%edi
call   1030 <abs@plt>
mov    %rax,%rcx
mov    -0x30(%rbp),%rax
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x20(%rbp)
movsbl 0xe4e(%rip),%ecx
mov    $0x61,%eax
sub    %ecx,%eax
movsbl %al,%edi
call   1030 <abs@plt>
mov    -0x28(%rbp),%rdi
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
mov    (%rax,%rcx,8),%rsi
call   1040 <build_at_prj@plt>
jmp    1352 <build_prj+0x212>
mov    -0x10(%rbp),%rax
mov    %rax,-0x38(%rbp)
movsbl 0xe1b(%rip),%ecx
mov    $0x61,%eax
sub    %ecx,%eax
movsbl %al,%edi
call   1030 <abs@plt>
mov    %rax,%rcx
mov    -0x38(%rbp),%rax
cmpq   $0x0,(%rax,%rcx,8)
je     12a8 <build_prj+0x168>
mov    -0x10(%rbp),%rax
mov    %rax,-0x60(%rbp)
movsbl 0xde3(%rip),%ecx
mov    $0x61,%eax
sub    %ecx,%eax
movsbl %al,%edi
call   1030 <abs@plt>
mov    %rax,%rcx
mov    -0x60(%rbp),%rax
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x50(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x58(%rbp)
movsbl 0xdba(%rip),%ecx
mov    $0x61,%eax
sub    %ecx,%eax
movsbl %al,%edi
call   1030 <abs@plt>
mov    %rax,%rcx
mov    -0x58(%rbp),%rax
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x48(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x40(%rbp)
movsbl 0xd91(%rip),%ecx
mov    $0x61,%eax
sub    %ecx,%eax
movsbl %al,%edi
call   1030 <abs@plt>
mov    -0x50(%rbp),%rdi
mov    -0x48(%rbp),%rsi
mov    %rax,%rcx
mov    -0x40(%rbp),%rax
mov    (%rax,%rcx,8),%rdx
call   1060 <build_m_prj@plt>
jmp    134d <build_prj+0x20d>
mov    -0x10(%rbp),%rax
mov    %rax,-0x68(%rbp)
movsbl 0xd5a(%rip),%ecx
mov    $0x61,%eax
sub    %ecx,%eax
movsbl %al,%edi
call   1030 <abs@plt>
mov    %rax,%rcx
mov    -0x68(%rbp),%rax
cmpq   $0x0,(%rax,%rcx,8)
je     133c <build_prj+0x1fc>
mov    -0x10(%rbp),%rax
mov    %rax,-0x80(%rbp)
movsbl 0xd1e(%rip),%ecx
mov    $0x61,%eax
sub    %ecx,%eax
movsbl %al,%edi
call   1030 <abs@plt>
mov    %rax,%rcx
mov    -0x80(%rbp),%rax
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x78(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x70(%rbp)
movsbl 0xcf5(%rip),%ecx
mov    $0x61,%eax
sub    %ecx,%eax
movsbl %al,%edi
call   1030 <abs@plt>
mov    -0x78(%rbp),%rdi
mov    %rax,%rcx
mov    -0x70(%rbp),%rax
mov    (%rax,%rcx,8),%rsi
call   1050 <build_cm_prj@plt>
jmp    1348 <build_prj+0x208>
movl   $0xffffffff,-0x4(%rbp)
jmp    1359 <build_prj+0x219>
jmp    134d <build_prj+0x20d>
jmp    1352 <build_prj+0x212>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x80,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<build_prj>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
mov    $0xffffffed,%edi
call   1030 <abs@plt>
cmpq   $0x0,(%rbx,%rax,8)
je     1184 <build_prj+0x44>
xor    %r14d,%r14d
xor    %edi,%edi
call   1030 <abs@plt>
mov    (%rbx,%rax,8),%rbp
mov    $0xfffffff1,%edi
call   1030 <abs@plt>
mov    (%rbx,%rax,8),%rsi
mov    %rbp,%rdi
call   1040 <build_at_prj@plt>
jmp    1209 <build_prj+0xc9>
mov    $0xfffffff4,%edi
call   1030 <abs@plt>
cmpq   $0x0,(%rbx,%rax,8)
je     11cc <build_prj+0x8c>
xor    %r14d,%r14d
xor    %edi,%edi
call   1030 <abs@plt>
mov    (%rbx,%rax,8),%r15
mov    $0xfffffff1,%edi
call   1030 <abs@plt>
mov    (%rbx,%rax,8),%rbp
mov    $0xfffffff4,%edi
call   1030 <abs@plt>
mov    (%rbx,%rax,8),%rdx
mov    %r15,%rdi
mov    %rbp,%rsi
call   1060 <build_m_prj@plt>
jmp    1209 <build_prj+0xc9>
mov    $0xfffffff6,%edi
call   1030 <abs@plt>
cmpq   $0x0,(%rbx,%rax,8)
je     1203 <build_prj+0xc3>
xor    %r14d,%r14d
xor    %edi,%edi
call   1030 <abs@plt>
mov    (%rbx,%rax,8),%rbp
mov    $0xfffffff1,%edi
call   1030 <abs@plt>
mov    (%rbx,%rax,8),%rsi
mov    %rbp,%rdi
call   1050 <build_cm_prj@plt>
jmp    1209 <build_prj+0xc9>
mov    $0xffffffff,%r14d
mov    %r14d,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [4 x i8] c"'t'\00"
@.str.1 = [4 x i8] c"'a'\00"
@.str.2 = [4 x i8] c"'p'\00"
@.str.3 = [4 x i8] c"'m'\00"
@.str.4 = [4 x i8] c"'k'\00"
define i32 @build_prj(i8** %0) {
%2 = alloca i32
%3 = alloca i8**
store i8** %0, i8*** %3
%4 = load i8**, i8*** %3
%5 = load i8, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 1)
%6 = sext i8 %5 to i32
%7 = sub nsw i32 97, %6
%8 = trunc i32 %7 to i8
%9 = call i64 @abs(i8 signext %8)
%10 = getelementptr inbounds i8*, i8** %4, i64 %9
%11 = load i8*, i8** %10
%12 = icmp ne i8* %11, null
br i1 %12, label %13, label %31
13: ; preds = %1
%14 = load i8**, i8*** %3
%15 = load i8, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 1)
%16 = sext i8 %15 to i32
%17 = sub nsw i32 97, %16
%18 = trunc i32 %17 to i8
%19 = call i64 @abs(i8 signext %18)
%20 = getelementptr inbounds i8*, i8** %14, i64 %19
%21 = load i8*, i8** %20
%22 = load i8**, i8*** %3
%23 = load i8, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 1)
%24 = sext i8 %23 to i32
%25 = sub nsw i32 97, %24
%26 = trunc i32 %25 to i8
%27 = call i64 @abs(i8 signext %26)
%28 = getelementptr inbounds i8*, i8** %22, i64 %27
%29 = load i8*, i8** %28
%30 = call i32 @build_at_prj(i8* %21, i8* %29)
br label %98
31: ; preds = %1
%32 = load i8**, i8*** %3
%33 = load i8, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 1)
%34 = sext i8 %33 to i32
%35 = sub nsw i32 97, %34
%36 = trunc i32 %35 to i8
%37 = call i64 @abs(i8 signext %36)
%38 = getelementptr inbounds i8*, i8** %32, i64 %37
%39 = load i8*, i8** %38
%40 = icmp ne i8* %39, null
br i1 %40, label %41, label %67
41: ; preds = %31
%42 = load i8**, i8*** %3
%43 = load i8, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 1)
%44 = sext i8 %43 to i32
%45 = sub nsw i32 97, %44
%46 = trunc i32 %45 to i8
%47 = call i64 @abs(i8 signext %46)
%48 = getelementptr inbounds i8*, i8** %42, i64 %47
%49 = load i8*, i8** %48
%50 = load i8**, i8*** %3
%51 = load i8, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 1)
%52 = sext i8 %51 to i32
%53 = sub nsw i32 97, %52
%54 = trunc i32 %53 to i8
%55 = call i64 @abs(i8 signext %54)
%56 = getelementptr inbounds i8*, i8** %50, i64 %55
%57 = load i8*, i8** %56
%58 = load i8**, i8*** %3
%59 = load i8, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.3, i64 0, i64 1)
%60 = sext i8 %59 to i32
%61 = sub nsw i32 97, %60
%62 = trunc i32 %61 to i8
%63 = call i64 @abs(i8 signext %62)
%64 = getelementptr inbounds i8*, i8** %58, i64 %63
%65 = load i8*, i8** %64
%66 = call i32 @build_m_prj(i8* %49, i8* %57, i8* %65)
br label %97
67: ; preds = %31
%68 = load i8**, i8*** %3
%69 = load i8, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 1)
%70 = sext i8 %69 to i32
%71 = sub nsw i32 97, %70
%72 = trunc i32 %71 to i8
%73 = call i64 @abs(i8 signext %72)
%74 = getelementptr inbounds i8*, i8** %68, i64 %73
%75 = load i8*, i8** %74
%76 = icmp ne i8* %75, null
br i1 %76, label %77, label %95
77: ; preds = %67
%78 = load i8**, i8*** %3
%79 = load i8, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 1)
%80 = sext i8 %79 to i32
%81 = sub nsw i32 97, %80
%82 = trunc i32 %81 to i8
%83 = call i64 @abs(i8 signext %82)
%84 = getelementptr inbounds i8*, i8** %78, i64 %83
%85 = load i8*, i8** %84
%86 = load i8**, i8*** %3
%87 = load i8, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, i64 0, i64 1)
%88 = sext i8 %87 to i32
%89 = sub nsw i32 97, %88
%90 = trunc i32 %89 to i8
%91 = call i64 @abs(i8 signext %90)
%92 = getelementptr inbounds i8*, i8** %86, i64 %91
%93 = load i8*, i8** %92
%94 = call i32 @build_cm_prj(i8* %85, i8* %93)
br label %96
95: ; preds = %67
store i32 -1, i32* %2
br label %99
96: ; preds = %77
br label %97
97: ; preds = %96, %41
br label %98
98: ; preds = %97, %13
store i32 0, i32* %2
br label %99
99: ; preds = %98, %95
%100 = load i32, i32* %2
ret i32 %100
}

LLVM IR (-O2):
define i32 @build_prj(i8** nocapture %0) {
%2 = tail call i64 @abs(i8 signext -19)
%3 = getelementptr inbounds i8*, i8** %0, i64 %2
%4 = load i8*, i8** %3
%5 = icmp eq i8* %4, null
br i1 %5, label %14, label %6
6: ; preds = %1
%7 = tail call i64 @abs(i8 signext 0)
%8 = getelementptr inbounds i8*, i8** %0, i64 %7
%9 = load i8*, i8** %8
%10 = tail call i64 @abs(i8 signext -15)
%11 = getelementptr inbounds i8*, i8** %0, i64 %10
%12 = load i8*, i8** %11
%13 = tail call i32 @build_at_prj(i8* %9, i8* %12)
br label %43
14: ; preds = %1
%15 = tail call i64 @abs(i8 signext -12)
%16 = getelementptr inbounds i8*, i8** %0, i64 %15
%17 = load i8*, i8** %16
%18 = icmp eq i8* %17, null
br i1 %18, label %30, label %19
19: ; preds = %14
%20 = tail call i64 @abs(i8 signext 0)
%21 = getelementptr inbounds i8*, i8** %0, i64 %20
%22 = load i8*, i8** %21
%23 = tail call i64 @abs(i8 signext -15)
%24 = getelementptr inbounds i8*, i8** %0, i64 %23
%25 = load i8*, i8** %24
%26 = tail call i64 @abs(i8 signext -12)
%27 = getelementptr inbounds i8*, i8** %0, i64 %26
%28 = load i8*, i8** %27
%29 = tail call i32 @build_m_prj(i8* %22, i8* %25, i8* %28)
br label %43
30: ; preds = %14
%31 = tail call i64 @abs(i8 signext -10)
%32 = getelementptr inbounds i8*, i8** %0, i64 %31
%33 = load i8*, i8** %32
%34 = icmp eq i8* %33, null
br i1 %34, label %43, label %35
35: ; preds = %30
%36 = tail call i64 @abs(i8 signext 0)
%37 = getelementptr inbounds i8*, i8** %0, i64 %36
%38 = load i8*, i8** %37
%39 = tail call i64 @abs(i8 signext -15)
%40 = getelementptr inbounds i8*, i8** %0, i64 %39
%41 = load i8*, i8** %40
%42 = tail call i32 @build_cm_prj(i8* %38, i8* %41)
br label %43
43: ; preds = %6, %35, %19, %30
%44 = phi i32 [ -1, %30 ], [ 0, %19 ], [ 0, %35 ], [ 0, %6 ]
ret i32 %44
}