// File: /workspace/github_c_makefile_star2_O3/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 0x15084
movl %esi, %r15d
movq %rdi, %r14
movq %rdx, 0x18(%rsp)
leaq 0x147c8(%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 0xb252(%rip), %rbp      # 0x201d4
movq (%r14), %rbx
cmpb $0x2d, (%rbx)
jne 0x150a3
movzbl 0x1(%rbx), %eax
subl $0x6d, %eax
jne 0x14f9b
movzbl 0x2(%rbx), %eax
negl %eax
testl %eax, %eax
je 0x1502a
movq %rbp, %rdi
movq %rbx, %rsi
callq 0x4820
testl %eax, %eax
je 0x1502a
movzbl 0x1(%rbx), %eax
subl $0x64, %eax
jne 0x14fc1
movzbl 0x2(%rbx), %eax
negl %eax
testl %eax, %eax
je 0x1504c
leaq 0xb215(%rip), %rdi      # 0x201e7
movq %rbx, %rsi
callq 0x4820
testl %eax, %eax
je 0x1504c
movzbl 0x1(%rbx), %eax
subl $0x6e, %eax
jne 0x14feb
movzbl 0x2(%rbx), %eax
negl %eax
testl %eax, %eax
je 0x15008
leaq 0xb202(%rip), %rdi      # 0x201fa
movq %rbx, %rsi
callq 0x4820
testl %eax, %eax
jne 0x15168
cmpl $0x1, %r15d
je 0x150d9
movq 0x8(%r14), %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0x1a2ed
testl %eax, %eax
je 0x1506d
jmp 0x15142
cmpl $0x1, %r15d
je 0x150d9
movq 0x8(%r14), %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0x19b1a
testl %eax, %eax
je 0x1506d
jmp 0x15128
cmpl $0x1, %r15d
je 0x150d9
movq 0x8(%r14), %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0x19eaf
testl %eax, %eax
jne 0x15135
leal -0x2(%r15), %edx
addq $0x10, %r14
cmpl $0x2, %r15d
movl %edx, %r15d
jg 0x14f82
jmp 0x150a6
leaq 0xb486(%rip), %rsi      # 0x20511
movq %rdx, %rdi
xorl %eax, %eax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x117fd
movl %r15d, %edx
cmpl $0x1, %edx
je 0x150f1
cmpl $0x2, %edx
jne 0x15113
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 0x15214
jmp 0x15159
leaq 0xb44d(%rip), %rsi      # 0x2052d
movq 0x18(%rsp), %rdi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x117fd
jmp 0x15159
movq (%r14), %rdi
movq 0x30(%rsp), %rax
movq %rax, 0x10(%rsp)
movaps 0x20(%rsp), %xmm0
movups %xmm0, (%rsp)
movq 0x18(%rsp), %rsi
callq 0x16095
jmp 0x15159
leaq 0xb472(%rip), %rsi      # 0x2058c
movq 0x18(%rsp), %rdi
xorl %eax, %eax
callq 0x117fd
jmp 0x15159
movq 0x8(%r14), %rdx
leaq 0xb41c(%rip), %rsi      # 0x2054f
jmp 0x1514d
movq 0x8(%r14), %rdx
leaq 0xb419(%rip), %rsi      # 0x20559
jmp 0x1514d
movq 0x8(%r14), %rdx
leaq 0xb416(%rip), %rsi      # 0x20563
movl %eax, %edi
movq 0x18(%rsp), %rcx
callq 0x151d0
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xb3fe(%rip), %rsi      # 0x2056d
jmp 0x150e0