// File: /workspace/github_c_makefile_star2_O2/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 0x13f1b
movl %esi, %ebp
movq %rdi, %r14
movq %rdx, 0x18(%rsp)
leaq 0x1491c(%rip), %rax     # 0x28710
movq (%rax), %rax
leaq 0x40(%rsp), %r15
movq %rax, (%r15)
movq 0x58(%rax), %rax
movq %rax, 0x8(%r15)
movq 0x38(%rax), %rax
movq %rax, 0x10(%r15)
xorps %xmm0, %xmm0
leaq 0x20(%rsp), %r12
movaps %xmm0, (%r12)
andq $0x0, 0x10(%r12)
addq $0x8, %r14
leaq 0xb3a7(%rip), %r13      # 0x1f1d4
testl %ebp, %ebp
jle 0x13f3a
movq -0x8(%r14), %rbx
cmpb $0x2d, (%rbx)
jne 0x13f3a
movzbl 0x1(%rbx), %eax
subl $0x6d, %eax
jne 0x13e4f
movzbl 0x2(%rbx), %eax
negl %eax
testl %eax, %eax
je 0x13ed4
movq %r13, %rdi
movq %rbx, %rsi
callq 0x4820
testl %eax, %eax
je 0x13ed4
movzbl 0x1(%rbx), %eax
subl $0x64, %eax
jne 0x13e71
movzbl 0x2(%rbx), %eax
negl %eax
testl %eax, %eax
je 0x13ef4
leaq 0xb369(%rip), %rdi      # 0x1f1e7
movq %rbx, %rsi
callq 0x4820
testl %eax, %eax
je 0x13ef4
movzbl 0x1(%rbx), %eax
subl $0x6e, %eax
jne 0x13e97
movzbl 0x2(%rbx), %eax
negl %eax
testl %eax, %eax
je 0x13eb4
leaq 0xb356(%rip), %rdi      # 0x1f1fa
movq %rbx, %rsi
callq 0x4820
testl %eax, %eax
jne 0x13ffc
cmpl $0x1, %ebp
je 0x13f6d
movq (%r14), %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x18ebb
testl %eax, %eax
je 0x13f0f
jmp 0x13fd7
cmpl $0x1, %ebp
je 0x13f6d
movq (%r14), %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x1876b
testl %eax, %eax
je 0x13f0f
jmp 0x13fbf
cmpl $0x1, %ebp
je 0x13f6d
movq (%r14), %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x18a95
testl %eax, %eax
jne 0x13fcb
addl $-0x2, %ebp
addq $0x10, %r14
jmp 0x13e2d
leaq 0xb5ef(%rip), %rsi      # 0x1f511
movq %rdx, %rdi
xorl %eax, %eax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x10897
cmpl $0x1, %ebp
je 0x13f85
cmpl $0x2, %ebp
jne 0x13fa8
movq -0x8(%r14), %rdi
movq (%r14), %rsi
movq 0x30(%rsp), %rax
movq %rax, 0x10(%rsp)
movaps 0x20(%rsp), %xmm0
movups %xmm0, (%rsp)
movq 0x18(%rsp), %rdx
callq 0x140a8
jmp 0x13fed
leaq 0xb5b9(%rip), %rsi      # 0x1f52d
movq 0x18(%rsp), %rdi
movq %rbx, %rdx
xorl %eax, %eax
callq 0x10897
jmp 0x13fed
movq -0x8(%r14), %rdi
movq 0x30(%rsp), %rax
movq %rax, 0x10(%rsp)
movaps 0x20(%rsp), %xmm0
movups %xmm0, (%rsp)
movq 0x18(%rsp), %rsi
callq 0x14f3b
jmp 0x13fed
leaq 0xb5dd(%rip), %rsi      # 0x1f58c
movq 0x18(%rsp), %rdi
movl %ebp, %edx
xorl %eax, %eax
callq 0x10897
jmp 0x13fed
movq (%r14), %rdx
leaq 0xb586(%rip), %rsi      # 0x1f54f
jmp 0x13fe1
movq (%r14), %rdx
leaq 0xb584(%rip), %rsi      # 0x1f559
jmp 0x13fe1
movq (%r14), %rdx
leaq 0xb582(%rip), %rsi      # 0x1f563
movl %eax, %edi
movq 0x18(%rsp), %rcx
callq 0x14064
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xb56a(%rip), %rsi      # 0x1f56d
jmp 0x13f74