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


x86 assembly (clang, -O0):
<clean_prj>:
push   %rbp
mov    %rsp,%rbp
sub    $0x70,%rsp
mov    %rdi,-0x10(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x18(%rbp)
movsbl 0xea6(%rip),%ecx
mov    $0x61,%eax
sub    %ecx,%eax
movsbl %al,%edi
call   1050 <abs@plt>
mov    %rax,%rcx
mov    -0x18(%rbp),%rax
cmpq   $0x0,(%rax,%rcx,8)
je     11e0 <clean_prj+0xa0>
mov    -0x10(%rbp),%rax
mov    %rax,-0x30(%rbp)
movsbl 0xe7a(%rip),%ecx
mov    $0x61,%eax
sub    %ecx,%eax
movsbl %al,%edi
call   1050 <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 0xe51(%rip),%ecx
mov    $0x61,%eax
sub    %ecx,%eax
movsbl %al,%edi
call   1050 <abs@plt>
mov    -0x28(%rbp),%rdi
mov    %rax,%rcx
mov    -0x20(%rbp),%rax
mov    (%rax,%rcx,8),%rsi
call   1030 <clean_at_prj@plt>
jmp    131e <clean_prj+0x1de>
mov    -0x10(%rbp),%rax
mov    %rax,-0x38(%rbp)
movsbl 0xe1e(%rip),%ecx
mov    $0x61,%eax
sub    %ecx,%eax
movsbl %al,%edi
call   1050 <abs@plt>
mov    %rax,%rcx
mov    -0x38(%rbp),%rax
cmpq   $0x0,(%rax,%rcx,8)
je     1274 <clean_prj+0x134>
mov    -0x10(%rbp),%rax
mov    %rax,-0x50(%rbp)
movsbl 0xde6(%rip),%ecx
mov    $0x61,%eax
sub    %ecx,%eax
movsbl %al,%edi
call   1050 <abs@plt>
mov    %rax,%rcx
mov    -0x50(%rbp),%rax
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x48(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x40(%rbp)
movsbl 0xdbd(%rip),%ecx
mov    $0x61,%eax
sub    %ecx,%eax
movsbl %al,%edi
call   1050 <abs@plt>
mov    -0x48(%rbp),%rdi
mov    %rax,%rcx
mov    -0x40(%rbp),%rax
mov    (%rax,%rcx,8),%rsi
call   1040 <clean_m_prj@plt>
jmp    1319 <clean_prj+0x1d9>
mov    -0x10(%rbp),%rax
mov    %rax,-0x58(%rbp)
movsbl 0xd8e(%rip),%ecx
mov    $0x61,%eax
sub    %ecx,%eax
movsbl %al,%edi
call   1050 <abs@plt>
mov    %rax,%rcx
mov    -0x58(%rbp),%rax
cmpq   $0x0,(%rax,%rcx,8)
je     1308 <clean_prj+0x1c8>
mov    -0x10(%rbp),%rax
mov    %rax,-0x70(%rbp)
movsbl 0xd52(%rip),%ecx
mov    $0x61,%eax
sub    %ecx,%eax
movsbl %al,%edi
call   1050 <abs@plt>
mov    %rax,%rcx
mov    -0x70(%rbp),%rax
mov    (%rax,%rcx,8),%rax
mov    %rax,-0x68(%rbp)
mov    -0x10(%rbp),%rax
mov    %rax,-0x60(%rbp)
movsbl 0xd29(%rip),%ecx
mov    $0x61,%eax
sub    %ecx,%eax
movsbl %al,%edi
call   1050 <abs@plt>
mov    -0x68(%rbp),%rdi
mov    %rax,%rcx
mov    -0x60(%rbp),%rax
mov    (%rax,%rcx,8),%rsi
call   1060 <clean_cm_prj@plt>
jmp    1314 <clean_prj+0x1d4>
movl   $0xffffffff,-0x4(%rbp)
jmp    1325 <clean_prj+0x1e5>
jmp    1319 <clean_prj+0x1d9>
jmp    131e <clean_prj+0x1de>
movl   $0x0,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x70,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<clean_prj>:
push   %rbp
push   %r14
push   %rbx
mov    %rdi,%rbx
mov    $0xffffffed,%edi
call   1050 <abs@plt>
cmpq   $0x0,(%rbx,%rax,8)
je     117e <clean_prj+0x3e>
xor    %r14d,%r14d
xor    %edi,%edi
call   1050 <abs@plt>
mov    (%rbx,%rax,8),%rbp
mov    $0xfffffff1,%edi
call   1050 <abs@plt>
mov    (%rbx,%rax,8),%rsi
mov    %rbp,%rdi
call   1030 <clean_at_prj@plt>
jmp    11f2 <clean_prj+0xb2>
mov    $0xfffffff4,%edi
call   1050 <abs@plt>
cmpq   $0x0,(%rbx,%rax,8)
je     11b5 <clean_prj+0x75>
xor    %r14d,%r14d
xor    %edi,%edi
call   1050 <abs@plt>
mov    (%rbx,%rax,8),%rbp
mov    $0xfffffff1,%edi
call   1050 <abs@plt>
mov    (%rbx,%rax,8),%rsi
mov    %rbp,%rdi
call   1040 <clean_m_prj@plt>
jmp    11f2 <clean_prj+0xb2>
mov    $0xfffffff6,%edi
call   1050 <abs@plt>
cmpq   $0x0,(%rbx,%rax,8)
je     11ec <clean_prj+0xac>
xor    %r14d,%r14d
xor    %edi,%edi
call   1050 <abs@plt>
mov    (%rbx,%rax,8),%rbp
mov    $0xfffffff1,%edi
call   1050 <abs@plt>
mov    (%rbx,%rax,8),%rsi
mov    %rbp,%rdi
call   1060 <clean_cm_prj@plt>
jmp    11f2 <clean_prj+0xb2>
mov    $0xffffffff,%r14d
mov    %r14d,%eax
pop    %rbx
pop    %r14
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 @clean_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 @clean_at_prj(i8* %21, i8* %29)
br label %90
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 %59
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 = call i32 @clean_m_prj(i8* %49, i8* %57)
br label %89
59: ; preds = %31
%60 = load i8**, i8*** %3
%61 = load i8, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.4, i64 0, i64 1)
%62 = sext i8 %61 to i32
%63 = sub nsw i32 97, %62
%64 = trunc i32 %63 to i8
%65 = call i64 @abs(i8 signext %64)
%66 = getelementptr inbounds i8*, i8** %60, i64 %65
%67 = load i8*, i8** %66
%68 = icmp ne i8* %67, null
br i1 %68, label %69, label %87
69: ; preds = %59
%70 = load i8**, i8*** %3
%71 = load i8, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 1)
%72 = sext i8 %71 to i32
%73 = sub nsw i32 97, %72
%74 = trunc i32 %73 to i8
%75 = call i64 @abs(i8 signext %74)
%76 = getelementptr inbounds i8*, i8** %70, i64 %75
%77 = load i8*, i8** %76
%78 = load i8**, i8*** %3
%79 = load i8, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.2, 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 = call i32 @clean_cm_prj(i8* %77, i8* %85)
br label %88
87: ; preds = %59
store i32 -1, i32* %2
br label %91
88: ; preds = %69
br label %89
89: ; preds = %88, %41
br label %90
90: ; preds = %89, %13
store i32 0, i32* %2
br label %91
91: ; preds = %90, %87
%92 = load i32, i32* %2
ret i32 %92
}

LLVM IR (-O2):
define i32 @clean_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 @clean_at_prj(i8* %9, i8* %12)
br label %40
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 %27, 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 i32 @clean_m_prj(i8* %22, i8* %25)
br label %40
27: ; preds = %14
%28 = tail call i64 @abs(i8 signext -10)
%29 = getelementptr inbounds i8*, i8** %0, i64 %28
%30 = load i8*, i8** %29
%31 = icmp eq i8* %30, null
br i1 %31, label %40, label %32
32: ; preds = %27
%33 = tail call i64 @abs(i8 signext 0)
%34 = getelementptr inbounds i8*, i8** %0, i64 %33
%35 = load i8*, i8** %34
%36 = tail call i64 @abs(i8 signext -15)
%37 = getelementptr inbounds i8*, i8** %0, i64 %36
%38 = load i8*, i8** %37
%39 = tail call i32 @clean_cm_prj(i8* %35, i8* %38)
br label %40
40: ; preds = %6, %32, %19, %27
%41 = phi i32 [ -1, %27 ], [ 0, %19 ], [ 0, %32 ], [ 0, %6 ]
ret i32 %41
}