#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 Cmd_Argc();
char *Cmd_Argv(int);
int /*<<< orphan*/ Cmd_DeleteAlias(char *);
int /*<<< orphan*/ Sys_Printf(char *, ...);
int strlen(char *);
void Cmd_UnAlias_f(void) {
  char *s;
  if (Cmd_Argc() != 2) {
    Sys_Printf("unalias <alias>: erase an existing alias\n");
    return;
  }
  s = Cmd_Argv(1);
  if (strlen(s) >= 32) {
    Sys_Printf("Alias name is too long\n");
    return;
  }
  if (!Cmd_DeleteAlias(s))
    Sys_Printf("Unknown alias \"%s\"\n", s);
}


x86 assembly (clang, -O0):
<Cmd_UnAlias_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <Cmd_Argc@plt>
cmp    $0x2,%eax
je     117b <Cmd_UnAlias_f+0x2b>
lea    0xe91(%rip),%rdi
mov    $0x0,%al
call   1050 <Sys_Printf@plt>
jmp    11d2 <Cmd_UnAlias_f+0x82>
mov    $0x1,%edi
call   1060 <Cmd_Argv@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <strlen@plt>
cmp    $0x20,%eax
jl     11ae <Cmd_UnAlias_f+0x5e>
lea    0xe88(%rip),%rdi
mov    $0x0,%al
call   1050 <Sys_Printf@plt>
jmp    11d2 <Cmd_UnAlias_f+0x82>
mov    -0x8(%rbp),%rdi
call   1070 <Cmd_DeleteAlias@plt>
cmp    $0x0,%eax
jne    11d2 <Cmd_UnAlias_f+0x82>
mov    -0x8(%rbp),%rsi
lea    0xe77(%rip),%rdi
mov    $0x0,%al
call   1050 <Sys_Printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Cmd_UnAlias_f>:
push   %rbx
xor    %eax,%eax
call   1030 <Cmd_Argc@plt>
cmp    $0x2,%eax
jne    1180 <Cmd_UnAlias_f+0x30>
mov    $0x1,%edi
call   1060 <Cmd_Argv@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <strlen@plt>
cmp    $0x20,%eax
jl     118f <Cmd_UnAlias_f+0x3f>
lea    0xeac(%rip),%rdi
jmp    1187 <Cmd_UnAlias_f+0x37>
lea    0xe79(%rip),%rdi
xor    %eax,%eax
pop    %rbx
jmp    1050 <Sys_Printf@plt>
mov    %rbx,%rdi
call   1070 <Cmd_DeleteAlias@plt>
test   %eax,%eax
je     119d <Cmd_UnAlias_f+0x4d>
pop    %rbx
ret
lea    0xe9e(%rip),%rdi
mov    %rbx,%rsi
xor    %eax,%eax
pop    %rbx
jmp    1050 <Sys_Printf@plt>

LLVM IR (-O0):
@.str = [42 x i8] c"unalias <alias>: erase an existing alias\0A\00"
@.str.1 = [24 x i8] c"Alias name is too long\0A\00"
@.str.2 = [20 x i8] c"Unknown alias \22%s\22\0A\00"
define void @Cmd_UnAlias_f() {
%1 = alloca i8*
%2 = call i32 (...) @Cmd_Argc()
%3 = icmp ne i32 %2, 2
br i1 %3, label %4, label %6
4: ; preds = %0
%5 = call i32 (i8*, ...) @Sys_Printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
br label %20
6: ; preds = %0
%7 = call i8* @Cmd_Argv(i32 1)
store i8* %7, i8** %1
%8 = load i8*, i8** %1
%9 = call i32 @strlen(i8* %8)
%10 = icmp sge i32 %9, 32
br i1 %10, label %11, label %13
11: ; preds = %6
%12 = call i32 (i8*, ...) @Sys_Printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
br label %20
13: ; preds = %6
%14 = load i8*, i8** %1
%15 = call i32 @Cmd_DeleteAlias(i8* %14)
%16 = icmp ne i32 %15, 0
br i1 %16, label %20, label %17
17: ; preds = %13
%18 = load i8*, i8** %1
%19 = call i32 (i8*, ...) @Sys_Printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i8* %18)
br label %20
20: ; preds = %4, %11, %17, %13
ret void
}

LLVM IR (-O2):
@.str = [42 x i8] c"unalias <alias>: erase an existing alias\0A\00"
@.str.1 = [24 x i8] c"Alias name is too long\0A\00"
@.str.2 = [20 x i8] c"Unknown alias \22%s\22\0A\00"
define void @Cmd_UnAlias_f() {
%1 = tail call i32 (...) @Cmd_Argc()
%2 = icmp eq i32 %1, 2
br i1 %2, label %5, label %3
3: ; preds = %0
%4 = tail call i32 (i8*, ...) @Sys_Printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str, i64 0, i64 0))
br label %16
5: ; preds = %0
%6 = tail call i8* @Cmd_Argv(i32 1)
%7 = tail call i32 @strlen(i8* %6)
%8 = icmp sgt i32 %7, 31
br i1 %8, label %9, label %11
9: ; preds = %5
%10 = tail call i32 (i8*, ...) @Sys_Printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0))
br label %16
11: ; preds = %5
%12 = tail call i32 @Cmd_DeleteAlias(i8* %6)
%13 = icmp eq i32 %12, 0
br i1 %13, label %14, label %16
14: ; preds = %11
%15 = tail call i32 (i8*, ...) @Sys_Printf(i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0), i8* %6)
br label %16
16: ; preds = %11, %14, %9, %3
ret void
}