#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*/ Q_stricmp(char *, char *);
int /*<<< orphan*/ trap_Key_GetBindingBuf(int, char *, int);
int /*<<< orphan*/ trap_Key_SetBinding(int, char *);
void Controls_ClearKeyAssignment(char *command) {
  int i;
  char b[256];
  for (i = 0; i < 256; i++) {
    trap_Key_GetBindingBuf(i, b, 256);
    if (*b == 0) {
      continue;
    }
    if (!Q_stricmp(b, command)) {
      trap_Key_SetBinding(i, "");
    }
  }
}


x86 assembly (clang, -O0):
<Controls_ClearKeyAssignment>:
push   %rbp
mov    %rsp,%rbp
sub    $0x110,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
cmpl   $0x100,-0xc(%rbp)
jge    11b7 <Controls_ClearKeyAssignment+0x87>
mov    -0xc(%rbp),%edi
lea    -0x110(%rbp),%rsi
mov    $0x100,%edx
call   1040 <trap_Key_GetBindingBuf@plt>
movsbl -0x110(%rbp),%eax
cmp    $0x0,%eax
jne    117c <Controls_ClearKeyAssignment+0x4c>
jmp    11a9 <Controls_ClearKeyAssignment+0x79>
lea    -0x110(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <Q_stricmp@plt>
cmp    $0x0,%eax
jne    11a4 <Controls_ClearKeyAssignment+0x74>
mov    -0xc(%rbp),%edi
lea    0xe61(%rip),%rsi
call   1050 <trap_Key_SetBinding@plt>
jmp    11a9 <Controls_ClearKeyAssignment+0x79>
mov    -0xc(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0xc(%rbp)
jmp    1146 <Controls_ClearKeyAssignment+0x16>
add    $0x110,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<Controls_ClearKeyAssignment>:
push   %rbp
push   %r15
push   %r14
push   %rbx
sub    $0x108,%rsp
mov    %rdi,%r14
xor    %ebp,%ebp
mov    %rsp,%rbx
lea    0xeb4(%rip),%r15
jmp    115b <Controls_ClearKeyAssignment+0x2b>
xchg   %ax,%ax
add    $0x1,%ebp
cmp    $0x100,%ebp
je     118b <Controls_ClearKeyAssignment+0x5b>
mov    %ebp,%edi
mov    %rbx,%rsi
mov    $0x100,%edx
call   1040 <trap_Key_GetBindingBuf@plt>
cmpb   $0x0,(%rsp)
je     1150 <Controls_ClearKeyAssignment+0x20>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <Q_stricmp@plt>
test   %eax,%eax
jne    1150 <Controls_ClearKeyAssignment+0x20>
mov    %ebp,%edi
mov    %r15,%rsi
call   1050 <trap_Key_SetBinding@plt>
jmp    1150 <Controls_ClearKeyAssignment+0x20>
add    $0x108,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [1 x i8] zeroinitializer
define void @Controls_ClearKeyAssignment(i8* %0) {
%2 = alloca i8*
%3 = alloca i32
%4 = alloca [256 x i8]
store i8* %0, i8** %2
store i32 0, i32* %3
br label %5
5: ; preds = %26, %1
%6 = load i32, i32* %3
%7 = icmp slt i32 %6, 256
br i1 %7, label %8, label %29
8: ; preds = %5
%9 = load i32, i32* %3
%10 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%11 = call i32 @trap_Key_GetBindingBuf(i32 %9, i8* %10, i32 256)
%12 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%13 = load i8, i8* %12
%14 = sext i8 %13 to i32
%15 = icmp eq i32 %14, 0
br i1 %15, label %16, label %17
16: ; preds = %8
br label %26
17: ; preds = %8
%18 = getelementptr inbounds [256 x i8], [256 x i8]* %4, i64 0, i64 0
%19 = load i8*, i8** %2
%20 = call i32 @Q_stricmp(i8* %18, i8* %19)
%21 = icmp ne i32 %20, 0
br i1 %21, label %25, label %22
22: ; preds = %17
%23 = load i32, i32* %3
%24 = call i32 @trap_Key_SetBinding(i32 %23, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
br label %25
25: ; preds = %22, %17
br label %26
26: ; preds = %25, %16
%27 = load i32, i32* %3
%28 = add nsw i32 %27, 1
store i32 %28, i32* %3
br label %5
29: ; preds = %5
ret void
}

LLVM IR (-O2):
@.str = [1 x i8] zeroinitializer
define void @Controls_ClearKeyAssignment(i8* %0) {
%2 = alloca [256 x i8]
%3 = getelementptr inbounds [256 x i8], [256 x i8]* %2, i64 0, i64 0
br label %4
4: ; preds = %1, %14
%5 = phi i32 [ 0, %1 ], [ %15, %14 ]
%6 = call i32 @trap_Key_GetBindingBuf(i32 %5, i8* %3, i32 256)
%7 = load i8, i8* %3
%8 = icmp eq i8 %7, 0
br i1 %8, label %14, label %9
9: ; preds = %4
%10 = call i32 @Q_stricmp(i8* %3, i8* %0)
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %14
12: ; preds = %9
%13 = call i32 @trap_Key_SetBinding(i32 %5, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str, i64 0, i64 0))
br label %14
14: ; preds = %9, %12, %4
%15 = add nuw nsw i32 %5, 1
%16 = icmp eq i32 %15, 256
br i1 %16, label %17, label %4
17: ; preds = %14
ret void
}