#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*/ ConvertBabelName(char *);
int /*<<< orphan*/ ConvertString(char *);
int /*<<< orphan*/ free(char *);
char *getBraceParam();
void CmdPs(int code) {
  char *s = getBraceParam();
  if (code == 3)
    ConvertBabelName("ENCLNAME");
  else if (code == 2)
    ConvertBabelName("CCNAME");
  ConvertString(s);
  free(s);
}


x86 assembly (clang, -O0):
<CmdPs>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %edi,-0x4(%rbp)
mov    $0x0,%al
call   1040 <getBraceParam@plt>
mov    %rax,-0x10(%rbp)
cmpl   $0x3,-0x4(%rbp)
jne    1171 <CmdPs+0x31>
lea    0xe99(%rip),%rdi
call   1060 <ConvertBabelName@plt>
jmp    118c <CmdPs+0x4c>
cmpl   $0x2,-0x4(%rbp)
jne    1187 <CmdPs+0x47>
lea    0xe87(%rip),%rdi
call   1060 <ConvertBabelName@plt>
jmp    118c <CmdPs+0x4c>
mov    -0x10(%rbp),%rdi
call   1050 <ConvertString@plt>
mov    -0x10(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CmdPs>:
push   %rbp
push   %rbx
push   %rax
mov    %edi,%ebp
xor    %eax,%eax
call   1040 <getBraceParam@plt>
mov    %rax,%rbx
cmp    $0x3,%ebp
je     1162 <CmdPs+0x22>
cmp    $0x2,%ebp
jne    116e <CmdPs+0x2e>
lea    0xea9(%rip),%rdi
jmp    1169 <CmdPs+0x29>
lea    0xe97(%rip),%rdi
call   1060 <ConvertBabelName@plt>
mov    %rbx,%rdi
call   1050 <ConvertString@plt>
mov    %rbx,%rdi
add    $0x8,%rsp
pop    %rbx
pop    %rbp
jmp    1030 <free@plt>

LLVM IR (-O0):
@.str = [9 x i8] c"ENCLNAME\00"
@.str.1 = [7 x i8] c"CCNAME\00"
define void @CmdPs(i32 %0) {
%2 = alloca i32
%3 = alloca i8*
store i32 %0, i32* %2
%4 = call i8* (...) @getBraceParam()
store i8* %4, i8** %3
%5 = load i32, i32* %2
%6 = icmp eq i32 %5, 3
br i1 %6, label %7, label %9
7: ; preds = %1
%8 = call i32 @ConvertBabelName(i8* getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0))
br label %15
9: ; preds = %1
%10 = load i32, i32* %2
%11 = icmp eq i32 %10, 2
br i1 %11, label %12, label %14
12: ; preds = %9
%13 = call i32 @ConvertBabelName(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0))
br label %14
14: ; preds = %12, %9
br label %15
15: ; preds = %14, %7
%16 = load i8*, i8** %3
%17 = call i32 @ConvertString(i8* %16)
%18 = load i8*, i8** %3
%19 = call i32 @free(i8* %18)
ret void
}

LLVM IR (-O2):
@.str = [9 x i8] c"ENCLNAME\00"
@.str.1 = [7 x i8] c"CCNAME\00"
define void @CmdPs(i32 %0) {
%2 = tail call i8* (...) @getBraceParam()
switch i32 %0, label %7 [
i32 3, label %4
i32 2, label %3
]
3: ; preds = %1
br label %4
4: ; preds = %1, %3
%5 = phi i8* [ getelementptr inbounds ([7 x i8], [7 x i8]* @.str.1, i64 0, i64 0), %3 ], [ getelementptr inbounds ([9 x i8], [9 x i8]* @.str, i64 0, i64 0), %1 ]
%6 = tail call i32 @ConvertBabelName(i8* %5)
br label %7
7: ; preds = %4, %1
%8 = tail call i32 @ConvertString(i8* %2)
%9 = tail call i32 @free(i8* %2)
ret void
}