#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();
int /*<<< orphan*/ Cmd_Argv(int);
int /*<<< orphan*/ Com_Printf(char *, ...);
int /*<<< orphan*/ Key_SetBinding(int, void *);
int Key_StringToKeynum(int /*<<< orphan*/);
void Key_Unbind_f(void) {
  int b;
  if (Cmd_Argc() != 2) {
    Com_Printf("unbind <key> : remove commands from a key\n");
    return;
  }
  b = Key_StringToKeynum(Cmd_Argv(1));
  if (b == -1) {
    Com_Printf("\"%s\" isn't a valid key\n", Cmd_Argv(1));
    return;
  }
  Key_SetBinding(b, ((void *)0));
}


x86 assembly (clang, -O0):
<Key_Unbind_f>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1030 <Cmd_Argc@plt>
cmp    $0x2,%eax
je     117b <Key_Unbind_f+0x2b>
lea    0xe91(%rip),%rdi
mov    $0x0,%al
call   1060 <Com_Printf@plt>
jmp    11c4 <Key_Unbind_f+0x74>
mov    $0x1,%edi
call   1070 <Cmd_Argv@plt>
mov    %eax,%edi
call   1040 <Key_StringToKeynum@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0xffffffff,-0x4(%rbp)
jne    11b8 <Key_Unbind_f+0x68>
mov    $0x1,%edi
call   1070 <Cmd_Argv@plt>
mov    %eax,%esi
lea    0xe7f(%rip),%rdi
mov    $0x0,%al
call   1060 <Com_Printf@plt>
jmp    11c4 <Key_Unbind_f+0x74>
mov    -0x4(%rbp),%edi
xor    %eax,%eax
mov    %eax,%esi
call   1050 <Key_SetBinding@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Key_Unbind_f>:
push   %rax
xor    %eax,%eax
call   1030 <Cmd_Argc@plt>
cmp    $0x2,%eax
jne    117d <Key_Unbind_f+0x2d>
mov    $0x1,%edi
call   1070 <Cmd_Argv@plt>
mov    %eax,%edi
call   1040 <Key_StringToKeynum@plt>
cmp    $0xffffffff,%eax
je     118c <Key_Unbind_f+0x3c>
mov    %eax,%edi
xor    %esi,%esi
pop    %rax
jmp    1050 <Key_SetBinding@plt>
lea    0xe7c(%rip),%rdi
xor    %eax,%eax
pop    %rcx
jmp    1060 <Com_Printf@plt>
mov    $0x1,%edi
call   1070 <Cmd_Argv@plt>
lea    0xe8e(%rip),%rdi
mov    %eax,%esi
xor    %eax,%eax
pop    %rcx
jmp    1060 <Com_Printf@plt>

LLVM IR (-O0):
@.str = [43 x i8] c"unbind <key> : remove commands from a key\0A\00"
@.str.1 = [24 x i8] c"\22%s\22 isn't a valid key\0A\00"
define void @Key_Unbind_f() {
%1 = alloca i32
%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*, ...) @Com_Printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
br label %17
6: ; preds = %0
%7 = call i32 @Cmd_Argv(i32 1)
%8 = call i32 @Key_StringToKeynum(i32 %7)
store i32 %8, i32* %1
%9 = load i32, i32* %1
%10 = icmp eq i32 %9, -1
br i1 %10, label %11, label %14
11: ; preds = %6
%12 = call i32 @Cmd_Argv(i32 1)
%13 = call i32 (i8*, ...) @Com_Printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i32 %12)
br label %17
14: ; preds = %6
%15 = load i32, i32* %1
%16 = call i32 @Key_SetBinding(i32 %15, i8* null)
br label %17
17: ; preds = %14, %11, %4
ret void
}

LLVM IR (-O2):
@.str = [43 x i8] c"unbind <key> : remove commands from a key\0A\00"
@.str.1 = [24 x i8] c"\22%s\22 isn't a valid key\0A\00"
define void @Key_Unbind_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*, ...) @Com_Printf(i8* getelementptr inbounds ([43 x i8], [43 x i8]* @.str, i64 0, i64 0))
br label %14
5: ; preds = %0
%6 = tail call i32 @Cmd_Argv(i32 1)
%7 = tail call i32 @Key_StringToKeynum(i32 %6)
%8 = icmp eq i32 %7, -1
br i1 %8, label %9, label %12
9: ; preds = %5
%10 = tail call i32 @Cmd_Argv(i32 1)
%11 = tail call i32 (i8*, ...) @Com_Printf(i8* getelementptr inbounds ([24 x i8], [24 x i8]* @.str.1, i64 0, i64 0), i32 %10)
br label %14
12: ; preds = %5
%13 = tail call i32 @Key_SetBinding(i32 %7, i8* null)
br label %14
14: ; preds = %12, %9, %3
ret void
}