// File: /workspace/github_c_makefile_star2_O1/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 0x7eb1
leaq 0x13df(%rip), %rcx      # 0x905c
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movb 0x4(%rdi), %al
movb %al, 0x4b11(%rip)       # 0xc7a0
jmp 0x7e1f
cmpl $0x0, 0x4(%rdi)
setne 0x4b27(%rip)            # 0xc7c6
jmp 0x7eb1
cmpl $0x0, 0x4(%rdi)
setne 0x4b15(%rip)            # 0xc7c4
jmp 0x7eb1
cmpl $0x0, 0x4(%rdi)
setne 0x4b02(%rip)            # 0xc7c1
jmp 0x7eb1
movl 0x4(%rdi), %eax
movl %eax, 0x4ae3(%rip)      # 0xc7b0
jmp 0x7e1f
cmpl $0x0, 0x4(%rdi)
setne 0x4ae5(%rip)            # 0xc7c2
jmp 0x7eb1
movl 0x4(%rdi), %r14d
movq %r14, %rdi
callq 0x31b0
movq %rax, %rbx
movl 0x4ac5(%rip), %eax      # 0xc7bc
cmpl %r14d, %eax
movl %r14d, %edx
cmovbl %eax, %edx
testl %edx, %edx
je 0x7d1f
movq 0x4af5(%rip), %rcx      # 0xc800
movl %edx, %edx
xorl %esi, %esi
movb (%rcx,%rsi), %dil
movb %dil, (%rbx,%rsi)
incq %rsi
cmpq %rsi, %rdx
jne 0x7d0f
cmpl %r14d, %eax
setbe %al
movq 0x469c(%rip), %r15      # 0xc3c8
testq %r15, %r15
sete %cl
orb %al, %cl
jne 0x7d7f
movq (%r15), %r12
movl 0x58(%r12), %edi
cmpl $-0x1, %edi
sete %al
cmpl %r14d, %edi
setb %cl
orb %al, %cl
jne 0x7d76
callq 0x8274
movl $0xffffffff, 0x58(%r12) # imm = 0xFFFFFFFF
testq %r12, %r12
je 0x7d76
movq 0x4658(%rip), %rdi      # 0xc3c0
movl (%r12), %esi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x3450
movq 0x10(%r15), %r15
testq %r15, %r15
jne 0x7d36
movl %r14d, 0x4a36(%rip)     # 0xc7bc
movq 0x4a73(%rip), %rdi      # 0xc800
callq 0x32d0
movq %rbx, 0x4a67(%rip)      # 0xc800
jmp 0x7eb1
movl 0x4(%rdi), %eax
movl %eax, 0x4a05(%rip)      # 0xc7ac
jmp 0x7e1f
cmpl $0x0, 0x4(%rdi)
setne 0x4a11(%rip)            # 0xc7c5
jmp 0x7eb1
movb 0x4(%rdi), %al
movb %al, 0x49df(%rip)       # 0xc7a1
jmp 0x7e1f
movb 0x4(%rdi), %al
movb %al, 0x49d5(%rip)       # 0xc7a2
jmp 0x7eb1
movl 0x4(%rdi), %eax
movl %eax, 0x49cd(%rip)      # 0xc7a8
jmp 0x7e1f
movl 0xc(%rdi), %eax
movl %eax, 0x49ea(%rip)      # 0xc7d0
movq 0x4(%rdi), %rax
movq %rax, 0x49d7(%rip)      # 0xc7c8
callq 0x41a1
movq 0x45cb(%rip), %rbx      # 0xc3c8
testq %rbx, %rbx
je 0x7eb1
movq (%rbx), %rax
movl (%rax), %edi
callq 0x55f0
movq 0x10(%rbx), %rbx
jmp 0x7dfd
movl 0x4(%rdi), %eax
movl %eax, 0x4995(%rip)      # 0xc7b4
cmpb $0x1, 0x499f(%rip)      # 0xc7c5
jne 0x7eb1
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x58d7
cmpl $0x0, 0x4(%rdi)
setne 0x497c(%rip)            # 0xc7c3
jmp 0x7eb1
movl 0x4(%rdi), %eax
addl $-0x5, %eax
cmpl $0x4, %eax
ja 0x7eb1
leaq 0x1251(%rip), %rcx      # 0x90ac
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movb 0x8(%rdi), %al
movb %al, 0x4936(%rip)       # 0xc7a3
jmp 0x7eb1
movzwl 0x4(%rdi), %eax
movw %ax, 0x495a(%rip)       # 0xc7d4
callq 0x41a1
movq 0x4542(%rip), %rbx      # 0xc3c8
testq %rbx, %rbx
je 0x7eb1
movq (%rbx), %rax
movl (%rax), %edi
callq 0x55f0
movq 0x10(%rbx), %rbx
jmp 0x7e86
cmpl $0x0, 0x4(%rdi)
setne 0x491a(%rip)            # 0xc7c0
jmp 0x7eb1
movl 0x4(%rdi), %eax
movl %eax, 0x4907(%rip)      # 0xc7b8
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movb 0x4(%rdi), %al
movb %al, 0x4910(%rip)       # 0xc7d6
callq 0x41a1
movq 0x44f6(%rip), %rbx      # 0xc3c8
testq %rbx, %rbx
je 0x7eb1
movq (%rbx), %rax
movl (%rax), %edi
callq 0x55f0
movq 0x10(%rbx), %rbx
jmp 0x7ed2
movzbl 0x8(%rdi), %eax
imull $0x1010101, %eax, %eax  # imm = 0x1010101
movl %eax, 0x48ac(%rip)      # 0xc7a3
jmp 0x7eb1
movb 0x8(%rdi), %al
movb %al, 0x48a3(%rip)       # 0xc7a5
jmp 0x7eb1
movb 0x8(%rdi), %al
movb %al, 0x4899(%rip)       # 0xc7a6
jmp 0x7eb1
movb 0x8(%rdi), %al
movb %al, 0x488c(%rip)       # 0xc7a4
jmp 0x7eb1