// File: /workspace/github_c_makefile_star2_O2/zenlinux[P]cwm/conf.c
// Function: conf_bindname
void
conf_bindname(struct conf *c, char *name, char *binding)
{
	struct keybinding	*current_binding;
	char			*substring, *tmp;
	int			 iter;

	current_binding = xcalloc(1, sizeof(*current_binding));

	if ((substring = strchr(name, '-')) != NULL) {
		for (iter = 0; iter < nitems(bind_mods); iter++) {
			if ((tmp = strchr(name, bind_mods[iter].chr)) !=
			    NULL && tmp < substring) {
				current_binding->modmask |=
				    bind_mods[iter].mask;
			}
		}

		/* skip past the modifiers */
		substring++;
	} else {
		substring = name;
	}

	if (substring[0] == '[' &&
	    substring[strlen(substring)-1] == ']') {
		sscanf(substring, "[%d]", &current_binding->keycode);
		current_binding->keysym = NoSymbol;
	} else {
		current_binding->keycode = 0;
		current_binding->keysym = XStringToKeysym(substring);
	}

	if (current_binding->keysym == NoSymbol &&
	    current_binding->keycode == 0) {
		xfree(current_binding);
		return;
	}

	/* We now have the correct binding, remove duplicates. */
	conf_unbind(c, current_binding);

	if (strcmp("unmap", binding) == 0)
		return;

	for (iter = 0; iter < nitems(name_to_kbfunc); iter++) {
		if (strcmp(name_to_kbfunc[iter].tag, binding) != 0)
			continue;

		current_binding->callback = name_to_kbfunc[iter].handler;
		current_binding->flags = name_to_kbfunc[iter].flags;
		current_binding->argument = name_to_kbfunc[iter].argument;
		conf_grab(c, current_binding);
		TAILQ_INSERT_TAIL(&c->keybindingq, current_binding, entry);
		return;
	}

	current_binding->callback = kbfunc_cmdexec;
	current_binding->argument.c = xstrdup(binding);
	current_binding->flags = 0;
	conf_grab(c, current_binding);
	TAILQ_INSERT_TAIL(&c->keybindingq, current_binding, entry);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r15
movq %rsi, %r12
movq %rdi, %rbx
pushq $0x1
popq %rdi
pushq $0x30
popq %rsi
callq 0x6032
movq %rax, %r14
pushq $0x2d
popq %rsi
movq %r12, %rdi
callq 0x5520
testq %rax, %rax
je 0x91bc
movq %rax, %r13
movq %rbx, (%rsp)
xorl %ebp, %ebp
leaq 0x563d(%rip), %rbx      # 0xe7c0
cmpq $0x4, %rbp
je 0x91b2
movsbl (%rbx,%rbp,8), %esi
movq %r12, %rdi
callq 0x5520
testq %rax, %rax
sete %cl
cmpq %r13, %rax
setae %al
orb %cl, %al
jne 0x91ad
movl 0x4(%rbx,%rbp,8), %eax
orl %eax, 0x20(%r14)
incq %rbp
jmp 0x9183
incq %r13
movq %r13, %r12
movq (%rsp), %rbx
cmpb $0x5b, (%r12)
jne 0x91f6
movq %r12, %rdi
callq 0x5320
cmpb $0x5d, -0x1(%rax,%r12)
jne 0x91f6
leaq 0x28(%r14), %rdx
leaq 0x51c7(%rip), %rsi      # 0xe3a5
movq %r12, %rdi
xorl %eax, %eax
callq 0x5160
movq %r14, %r13
addq $0x24, %r13
andl $0x0, 0x24(%r14)
jmp 0x9212
andl $0x0, 0x28(%r14)
movq %r12, %rdi
callq 0x50d0
movq %r14, %r13
addq $0x24, %r13
movl %eax, 0x24(%r14)
testl %eax, %eax
jne 0x921d
cmpl $0x0, 0x28(%r14)
je 0x9335
movq (%rbx), %rbp
testq %rbp, %rbp
je 0x928f
movq %rbp, %r12
movq (%rbp), %rbp
movl 0x20(%r12), %eax
cmpl 0x20(%r14), %eax
jne 0x9220
movl 0x24(%r12), %eax
movl 0x28(%r12), %ecx
testl %ecx, %ecx
setne %dl
testl %eax, %eax
sete %sil
andb %dl, %sil
cmpb $0x1, %sil
jne 0x925d
xorl %eax, %eax
cmpl 0x28(%r14), %ecx
je 0x9263
cmpl (%r13), %eax
jne 0x9220
movq %r12, %rsi
callq 0x9783
movq (%r12), %rax
movq 0x8(%r12), %rcx
testq %rax, %rax
movq %rax, %rdx
cmoveq %rbx, %rdx
movq %rcx, 0x8(%rdx)
movq %rax, (%rcx)
movq %r12, %rdi
callq 0x6050
jmp 0x9220
leaq 0x5114(%rip), %rdi      # 0xe3aa
movq %r15, %rsi
callq 0x5610
testl %eax, %eax
je 0x9326
movq %rbx, %r13
xorl %ecx, %ecx
leaq 0x9f7e(%rip), %rbx      # 0x13230
leaq 0x20(%rcx), %r12
cmpq $0x9c0, %r12            # imm = 0x9C0
je 0x92ef
movq (%rcx,%rbx), %rdi
movq %r15, %rsi
callq 0x5610
movq %r12, %rcx
testl %eax, %eax
jne 0x92b2
movq -0x18(%r12,%rbx), %rax
movq %rax, 0x10(%r14)
movl -0x10(%r12,%rbx), %eax
movl %eax, 0x2c(%r14)
movq -0x8(%r12,%rbx), %rax
movq %rax, 0x18(%r14)
jmp 0x930b
leaq 0x19d9(%rip), %rax      # 0xaccf
movq %rax, 0x10(%r14)
movq %r15, %rdi
callq 0x6055
movq %rax, 0x18(%r14)
andl $0x0, 0x2c(%r14)
movq %r14, %rsi
callq 0x9754
andq $0x0, (%r14)
movq 0x8(%r13), %rax
movq %rax, 0x8(%r14)
movq %r14, (%rax)
movq %r14, 0x8(%r13)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %r14, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x6050