// File: /workspace/github_c_makefile_star2_O3/tudurom[P]windowchef/wm.c
// Function: ipc_wm_config
static void
ipc_wm_config(uint32_t *d)
{
	enum IPCConfig key;

	key = d[0];

	switch (key) {
	case IPCConfigBorderWidth:
		conf.border_width = d[1];
		if (conf.apply_settings)
			refresh_borders();
		break;
	case IPCConfigColorFocused:
		conf.focus_color = d[1];
		if (conf.apply_settings)
			refresh_borders();
		break;
	case IPCConfigColorUnfocused:
		conf.unfocus_color = d[1];
		if (conf.apply_settings)
			refresh_borders();
		break;
	case IPCConfigInternalBorderWidth:
		conf.internal_border_width = d[1];
		if (conf.apply_settings)
			refresh_borders();
		break;
	case IPCConfigInternalColorFocused:
		conf.internal_focus_color = d[1];
		if (conf.apply_settings)
			refresh_borders();
		break;
	case IPCConfigInternalColorUnfocused:
		conf.internal_unfocus_color = d[1];
		if (conf.apply_settings)
			refresh_borders();
		break;
	case IPCConfigGapWidth:
		switch (d[1]) {
		case LEFT: conf.gap_left   = d[2]; break;
		case BOTTOM: conf.gap_down = d[2]; break;
		case TOP: conf.gap_up      = d[2]; break;
		case RIGHT: conf.gap_right = d[2]; break;
		case ALL: conf.gap_left = conf.gap_down
				= conf.gap_up = conf.gap_right = d[2];
		default: break;
		}
		break;
	case IPCConfigGridGapWidth:
		conf.grid_gap = d[1];
		break;
	case IPCConfigCursorPosition:
		conf.cursor_position = d[1];
		break;
	case IPCConfigGroupsNr:
		change_nr_of_groups(d[1]);
		break;
	case IPCConfigEnableSloppyFocus:
		conf.sloppy_focus = d[1];
		break;
	case IPCConfigEnableResizeHints:
		conf.resize_hints = d[1];
		break;
	case IPCConfigStickyWindows:
		conf.sticky_windows = d[1];
		break;
	case IPCConfigEnableBorders:
		conf.borders = d[1];
		break;
	case IPCConfigEnableLastWindowFocusing:
		conf.last_window_focusing = d[1];
		break;
	case IPCConfigApplySettings:
		conf.apply_settings = d[1];
		break;
	case IPCConfigReplayClickOnFocus:
		conf.replay_click_on_focus = d[1];
		break;
	case IPCConfigPointerActions:
		for (int i = 0; i < NR_BUTTONS; i++) {
			conf.pointer_actions[i] = d[i + 1];
		}
		ungrab_buttons();
		grab_buttons();
		break;
	case IPCConfigPointerModifier:
		conf.pointer_modifier = d[1];
		ungrab_buttons();
		grab_buttons();
		break;
	case IPCConfigClickToFocus:
		if (d[1] == UINT32_MAX)
			conf.click_to_focus = -1;
		else
			conf.click_to_focus = d[1];
		ungrab_buttons();
		grab_buttons();
		break;
	default:
		DMSG("!!! unhandled config key %d\n", key);
		break;
	}
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movl (%rdi), %eax
cmpq $0x13, %rax
ja 0x7eba
leaq 0x141d(%rip), %rcx      # 0x90a8
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movb 0x4(%rdi), %al
movb %al, 0x4b03(%rip)       # 0xc7a0
jmp 0x7e28
cmpl $0x0, 0x4(%rdi)
setne 0x4b19(%rip)            # 0xc7c6
jmp 0x7eba
cmpl $0x0, 0x4(%rdi)
setne 0x4b07(%rip)            # 0xc7c4
jmp 0x7eba
cmpl $0x0, 0x4(%rdi)
setne 0x4af4(%rip)            # 0xc7c1
jmp 0x7eba
movl 0x4(%rdi), %eax
movl %eax, 0x4ad5(%rip)      # 0xc7b0
jmp 0x7e28
cmpl $0x0, 0x4(%rdi)
setne 0x4ad7(%rip)            # 0xc7c2
jmp 0x7eba
movl 0x4(%rdi), %r14d
movq %r14, %rdi
callq 0x31b0
movq %rax, %rbx
movl 0x4ab7(%rip), %eax      # 0xc7bc
cmpl %r14d, %eax
movl %r14d, %edx
cmovbl %eax, %edx
testl %edx, %edx
je 0x7d2d
movq 0x4ae7(%rip), %rcx      # 0xc800
movl %edx, %edx
xorl %esi, %esi
movb (%rcx,%rsi), %dil
movb %dil, (%rbx,%rsi)
incq %rsi
cmpq %rsi, %rdx
jne 0x7d1d
cmpl %r14d, %eax
setbe %al
movq 0x468e(%rip), %r15      # 0xc3c8
testq %r15, %r15
sete %cl
orb %al, %cl
jne 0x7d88
movq (%r15), %r12
movl 0x58(%r12), %edi
cmpl $-0x1, %edi
sete %al
cmpl %r14d, %edi
setb %cl
orb %al, %cl
jne 0x7d7f
callq 0x8278
movl $0xffffffff, 0x58(%r12) # imm = 0xFFFFFFFF
movq 0x464f(%rip), %rdi      # 0xc3c0
movl (%r12), %esi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x3450
movq 0x10(%r15), %r15
testq %r15, %r15
jne 0x7d44
movl %r14d, 0x4a2d(%rip)     # 0xc7bc
movq 0x4a6a(%rip), %rdi      # 0xc800
callq 0x32d0
movq %rbx, 0x4a5e(%rip)      # 0xc800
jmp 0x7eba
movl 0x4(%rdi), %eax
movl %eax, 0x49fc(%rip)      # 0xc7ac
jmp 0x7e28
cmpl $0x0, 0x4(%rdi)
setne 0x4a08(%rip)            # 0xc7c5
jmp 0x7eba
movb 0x4(%rdi), %al
movb %al, 0x49d6(%rip)       # 0xc7a1
jmp 0x7e28
movb 0x4(%rdi), %al
movb %al, 0x49cc(%rip)       # 0xc7a2
jmp 0x7eba
movl 0x4(%rdi), %eax
movl %eax, 0x49c4(%rip)      # 0xc7a8
jmp 0x7e28
movl 0xc(%rdi), %eax
movl %eax, 0x49e1(%rip)      # 0xc7d0
movq 0x4(%rdi), %rax
movq %rax, 0x49ce(%rip)      # 0xc7c8
callq 0x4170
movq 0x45c2(%rip), %rbx      # 0xc3c8
testq %rbx, %rbx
je 0x7eba
movq (%rbx), %rax
movl (%rax), %edi
callq 0x5536
movq 0x10(%rbx), %rbx
jmp 0x7e06
movl 0x4(%rdi), %eax
movl %eax, 0x498c(%rip)      # 0xc7b4
cmpb $0x1, 0x4996(%rip)      # 0xc7c5
jne 0x7eba
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x581f
cmpl $0x0, 0x4(%rdi)
setne 0x4973(%rip)            # 0xc7c3
jmp 0x7eba
movl 0x4(%rdi), %eax
addl $-0x5, %eax
cmpl $0x4, %eax
ja 0x7eba
leaq 0x1294(%rip), %rcx      # 0x90f8
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movb 0x8(%rdi), %al
movb %al, 0x492d(%rip)       # 0xc7a3
jmp 0x7eba
movzwl 0x4(%rdi), %eax
movw %ax, 0x4951(%rip)       # 0xc7d4
callq 0x4170
movq 0x4539(%rip), %rbx      # 0xc3c8
testq %rbx, %rbx
je 0x7eba
movq (%rbx), %rax
movl (%rax), %edi
callq 0x5536
movq 0x10(%rbx), %rbx
jmp 0x7e8f
cmpl $0x0, 0x4(%rdi)
setne 0x4911(%rip)            # 0xc7c0
jmp 0x7eba
movl 0x4(%rdi), %eax
movl %eax, 0x48fe(%rip)      # 0xc7b8
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movb 0x4(%rdi), %al
movb %al, 0x4907(%rip)       # 0xc7d6
callq 0x4170
movq 0x44ed(%rip), %rbx      # 0xc3c8
testq %rbx, %rbx
je 0x7eba
movq (%rbx), %rax
movl (%rax), %edi
callq 0x5536
movq 0x10(%rbx), %rbx
jmp 0x7edb
movzbl 0x8(%rdi), %eax
imull $0x1010101, %eax, %eax  # imm = 0x1010101
movl %eax, 0x48a3(%rip)      # 0xc7a3
jmp 0x7eba
movb 0x8(%rdi), %al
movb %al, 0x489a(%rip)       # 0xc7a5
jmp 0x7eba
movb 0x8(%rdi), %al
movb %al, 0x4890(%rip)       # 0xc7a6
jmp 0x7eba
movb 0x8(%rdi), %al
movb %al, 0x4883(%rip)       # 0xc7a4
jmp 0x7eba