// File: /workspace/github_c_makefile_star2_O1/baskerville[P]bspwm/src/messages.c
// Function: cmd_config
void cmd_config(char **args, int num, FILE *rsp)
{
	if (num < 1) {
		fail(rsp, "config: Missing arguments.\n");
		return;
	}

	coordinates_t ref = {mon, mon->desk, mon->desk->focus};
	coordinates_t trg = {NULL, NULL, NULL};

	while (num > 0 && (*args)[0] == OPT_CHR) {
		if (streq("-m", *args) || streq("--monitor", *args)) {
			num--, args++;
			if (num < 1) {
				fail(rsp, "config %s: Not enough arguments.\n", *(args - 1));
				return;
			}
			int ret;
			if ((ret = monitor_from_desc(*args, &ref, &trg)) != SELECTOR_OK) {
				handle_failure(ret, "config -m", *args, rsp);
				return;
			}
		} else if (streq("-d", *args) || streq("--desktop", *args)) {
			num--, args++;
			if (num < 1) {
				fail(rsp, "config %s: Not enough arguments.\n", *(args - 1));
				return;
			}
			int ret;
			if ((ret = desktop_from_desc(*args, &ref, &trg)) != SELECTOR_OK) {
				handle_failure(ret, "config -d", *args, rsp);
				return;
			}
		} else if (streq("-n", *args) || streq("--node", *args)) {
			num--, args++;
			if (num < 1) {
				fail(rsp, "config %s: Not enough arguments.\n", *(args - 1));
				return;
			}
			int ret;
			if ((ret = node_from_desc(*args, &ref, &trg)) != SELECTOR_OK) {
				handle_failure(ret, "config -n", *args, rsp);
				return;
			}
		} else {
			fail(rsp, "config: Unknown option: '%s'.\n", *args);
			return;
		}
		num--, args++;
	}
	if (num == 2) {
		set_setting(trg, *args, *(args + 1), rsp);
	} else if (num == 1) {
		get_setting(trg, *args, rsp);
	} else {
		fail(rsp, "config: Was expecting 1 or 2 arguments, received %i.\n", num);
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
testl %esi, %esi
jle 0x15142
movl %esi, %r15d
movq %rdi, %r14
movq %rdx, 0x18(%rsp)
leaq 0x1470a(%rip), %rax     # 0x29710
movq (%rax), %rax
leaq 0x40(%rsp), %r12
movq %rax, (%r12)
movq 0x58(%rax), %rax
movq %rax, 0x8(%r12)
movq 0x38(%rax), %rax
movq %rax, 0x10(%r12)
xorps %xmm0, %xmm0
leaq 0x20(%rsp), %r13
movaps %xmm0, (%r13)
movq $0x0, 0x10(%r13)
leaq 0xad06(%rip), %rbp      # 0x1fd46
movq (%r14), %rbx
cmpb $0x2d, (%rbx)
jne 0x15161
movq %rbp, %rdi
movq %rbx, %rsi
callq 0x4820
testl %eax, %eax
je 0x150e8
leaq 0xb1b4(%rip), %rdi      # 0x2021a
movq %rbx, %rsi
callq 0x4820
testl %eax, %eax
je 0x150e8
leaq 0xacb8(%rip), %rdi      # 0x1fd31
movq %rbx, %rsi
callq 0x4820
testl %eax, %eax
je 0x1510a
leaq 0xb19d(%rip), %rdi      # 0x2022d
movq %rbx, %rsi
callq 0x4820
testl %eax, %eax
je 0x1510a
leaq 0xacb5(%rip), %rdi      # 0x1fd58
movq %rbx, %rsi
callq 0x4820
testl %eax, %eax
je 0x150c6
leaq 0xb18a(%rip), %rdi      # 0x20240
movq %rbx, %rsi
callq 0x4820
testl %eax, %eax
jne 0x15226
cmpl $0x1, %r15d
je 0x15197
movq 0x8(%r14), %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0x1a436
testl %eax, %eax
je 0x1512b
jmp 0x15200
cmpl $0x1, %r15d
je 0x15197
movq 0x8(%r14), %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0x19c02
testl %eax, %eax
je 0x1512b
jmp 0x151e6
cmpl $0x1, %r15d
je 0x15197
movq 0x8(%r14), %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0x19fc7
testl %eax, %eax
jne 0x151f3
leal -0x2(%r15), %edx
addq $0x10, %r14
cmpl $0x2, %r15d
movl %edx, %r15d
jg 0x15040
jmp 0x15164
leaq 0xb414(%rip), %rsi      # 0x2055d
movq %rdx, %rdi
xorl %eax, %eax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x11852
movl %r15d, %edx
cmpl $0x1, %edx
je 0x151af
cmpl $0x2, %edx
jne 0x151d1
movq (%r14), %rdi
movq 0x8(%r14), %rsi
movq 0x30(%rsp), %rax
movq %rax, 0x10(%rsp)
movaps 0x20(%rsp), %xmm0
movups %xmm0, (%rsp)
movq 0x18(%rsp), %rdx
callq 0x152d2
jmp 0x15217
leaq 0xb3db(%rip), %rsi      # 0x20579
movq 0x18(%rsp), %rdi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x11852
jmp 0x15217
movq (%r14), %rdi
movq 0x30(%rsp), %rax
movq %rax, 0x10(%rsp)
movaps 0x20(%rsp), %xmm0
movups %xmm0, (%rsp)
movq 0x18(%rsp), %rsi
callq 0x161ca
jmp 0x15217
leaq 0xb400(%rip), %rsi      # 0x205d8
movq 0x18(%rsp), %rdi
xorl %eax, %eax
callq 0x11852
jmp 0x15217
movq 0x8(%r14), %rdx
leaq 0xb3aa(%rip), %rsi      # 0x2059b
jmp 0x1520b
movq 0x8(%r14), %rdx
leaq 0xb3a7(%rip), %rsi      # 0x205a5
jmp 0x1520b
movq 0x8(%r14), %rdx
leaq 0xb3a4(%rip), %rsi      # 0x205af
movl %eax, %edi
movq 0x18(%rsp), %rcx
callq 0x1528e
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xb38c(%rip), %rsi      # 0x205b9
jmp 0x1519e