// File: /workspace/github_c_makefile_star2_O2/baskerville[P]bspwm/src/restore.c
// Function: restore_client
client_t *restore_client(jsmntok_t **t, char *json)
{
	if ((*t)->type == JSMN_PRIMITIVE) {
		(*t)++;
		return NULL;
	} else {
		int s = (*t)->size;
		(*t)++;
		client_t *c = make_client();

		for (int i = 0; i < s; i++) {
			if (keyeq("className", *t, json)) {
				(*t)++;
				snprintf(c->class_name, (*t)->end - (*t)->start + 1, "%s", json + (*t)->start);
			} else if (keyeq("instanceName", *t, json)) {
				(*t)++;
				snprintf(c->instance_name, (*t)->end - (*t)->start + 1, "%s", json + (*t)->start);
			RESTORE_ANY(state, &c->state, parse_client_state)
			RESTORE_ANY(lastState, &c->last_state, parse_client_state)
			RESTORE_ANY(layer, &c->layer, parse_stack_layer)
			RESTORE_ANY(lastLayer, &c->last_layer, parse_stack_layer)
			RESTORE_UINT(borderWidth, &c->border_width)
			RESTORE_BOOL(urgent, &c->urgent)
			RESTORE_BOOL(shown, &c->shown)
			} else if (keyeq("tiledRectangle", *t, json)) {
				(*t)++;
				restore_rectangle(&c->tiled_rectangle, t, json);
				continue;
			} else if (keyeq("floatingRectangle", *t, json)) {
				(*t)++;
				restore_rectangle(&c->floating_rectangle, t, json);
				continue;
			} else {
				warn("Restore client: unknown key: '%.*s'.\n", (*t)->end - (*t)->start, json + (*t)->start);
				(*t)++;
			}

			(*t)++;
		}

		return c;
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rdi, %rbx
movq (%rdi), %rax
cmpl $0x4, (%rax)
jne 0x1b01e
addq $0x10, %rax
movq %rax, (%rbx)
xorl %r15d, %r15d
movq %r15, %rax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rsi, %r14
movl 0xc(%rax), %ebp
addq $0x10, %rax
movq %rax, (%rbx)
callq 0xa1f3
movq %rax, %r15
addq $0x318, %rax            # imm = 0x318
movq %rax, 0x8(%rsp)
leaq 0x320(%r15), %rax
movq %rax, 0x10(%rsp)
leaq 0x305(%r15), %rax
movq %rax, 0x18(%rsp)
leaq 0x304(%r15), %rax
movq %rax, 0x20(%rsp)
leaq 0x300(%r15), %rax
movq %rax, 0x28(%rsp)
leaq 0x314(%r15), %rax
movq %rax, 0x30(%rsp)
leaq 0x310(%r15), %rax
movq %rax, 0x38(%rsp)
leaq 0x30c(%r15), %rax
movq %rax, 0x40(%rsp)
leaq 0x308(%r15), %rax
movq %rax, 0x48(%rsp)
movq %r15, %rax
addq $0x100, %rax            # imm = 0x100
movq %rax, 0x50(%rsp)
xorl %eax, %eax
testl %ebp, %ebp
cmovlel %eax, %ebp
leaq 0x53d4(%rip), %r13      # 0x2048e
subl $0x1, %ebp
jb 0x1b00c
movq (%rbx), %r12
movq %r13, %rdi
movq %r12, %rsi
movq %r14, %rdx
callq 0x19f32
testb %al, %al
je 0x1b0f9
leaq 0x10(%r12), %rax
movq %rax, (%rbx)
movl 0x18(%r12), %eax
movslq 0x14(%r12), %rcx
subl %ecx, %eax
incl %eax
movslq %eax, %rsi
addq %r14, %rcx
movq %r15, %rdi
jmp 0x1b130
leaq 0x5398(%rip), %rdi      # 0x20498
movq %r12, %rsi
movq %r14, %rdx
callq 0x19f32
testb %al, %al
je 0x1b143
leaq 0x10(%r12), %rax
movq %rax, (%rbx)
movl 0x18(%r12), %eax
movslq 0x14(%r12), %rcx
subl %ecx, %eax
incl %eax
movslq %eax, %rsi
addq %r14, %rcx
movq 0x50(%rsp), %rdi
leaq 0x2f10(%rip), %rdx      # 0x1e047
xorl %eax, %eax
callq 0x4110
jmp 0x1b1d0
leaq 0x3c3c(%rip), %rdi      # 0x1ed86
movq %r12, %rsi
movq %r14, %rdx
callq 0x19f32
testb %al, %al
je 0x1b184
leaq 0x10(%r12), %rax
movq %rax, (%rbx)
movslq 0x14(%r12), %rax
leaq (%r14,%rax), %rdi
movslq 0x18(%r12), %rsi
subq %rax, %rsi
callq 0x5d82
movq %rax, %r12
movq %rax, %rdi
movq 0x48(%rsp), %rsi
jmp 0x1b1c3
leaq 0x531a(%rip), %rdi      # 0x204a5
movq %r12, %rsi
movq %r14, %rdx
callq 0x19f32
testb %al, %al
je 0x1b1d9
leaq 0x10(%r12), %rax
movq %rax, (%rbx)
movslq 0x14(%r12), %rax
leaq (%r14,%rax), %rdi
movslq 0x18(%r12), %rsi
subq %rax, %rsi
callq 0x5d82
movq %rax, %r12
movq %rax, %rdi
movq 0x40(%rsp), %rsi
callq 0x15874
movq %r12, %rdi
callq 0x4460
addq $0x10, (%rbx)
jmp 0x1b0ba
leaq 0x3b7c(%rip), %rdi      # 0x1ed5c
movq %r12, %rsi
movq %r14, %rdx
callq 0x19f32
testb %al, %al
je 0x1b21a
leaq 0x10(%r12), %rax
movq %rax, (%rbx)
movslq 0x14(%r12), %rax
leaq (%r14,%rax), %rdi
movslq 0x18(%r12), %rsi
subq %rax, %rsi
callq 0x5d82
movq %rax, %r12
movq %rax, %rdi
movq 0x38(%rsp), %rsi
jmp 0x1b259
leaq 0x528e(%rip), %rdi      # 0x204af
movq %r12, %rsi
movq %r14, %rdx
callq 0x19f32
testb %al, %al
je 0x1b263
leaq 0x10(%r12), %rax
movq %rax, (%rbx)
movslq 0x14(%r12), %rax
leaq (%r14,%rax), %rdi
movslq 0x18(%r12), %rsi
subq %rax, %rsi
callq 0x5d82
movq %rax, %r12
movq %rax, %rdi
movq 0x30(%rsp), %rsi
callq 0x158e9
jmp 0x1b1c8
leaq 0x5128(%rip), %rdi      # 0x20392
movq %r12, %rsi
movq %r14, %rdx
callq 0x19f32
testb %al, %al
je 0x1b2a1
leaq 0x10(%r12), %rax
movq %rax, (%rbx)
movslq 0x14(%r12), %rdi
addq %r14, %rdi
leaq 0x433f(%rip), %rsi      # 0x1f5cf
movq 0x28(%rsp), %rdx
xorl %eax, %eax
callq 0x41c0
jmp 0x1b1d0
leaq 0x499e(%rip), %rdi      # 0x1fc46
movq %r12, %rsi
movq %r14, %rdx
callq 0x19f32
testb %al, %al
je 0x1b2e2
leaq 0x10(%r12), %rax
movq %rax, (%rbx)
movslq 0x14(%r12), %rax
leaq (%r14,%rax), %rdi
movslq 0x18(%r12), %rsi
subq %rax, %rsi
callq 0x5d82
movq %rax, %r12
movq %rax, %rdi
movq 0x20(%rsp), %rsi
jmp 0x1b321
leaq 0x51d0(%rip), %rdi      # 0x204b9
movq %r12, %rsi
movq %r14, %rdx
callq 0x19f32
testb %al, %al
je 0x1b32b
leaq 0x10(%r12), %rax
movq %rax, (%rbx)
movslq 0x14(%r12), %rax
leaq (%r14,%rax), %rdi
movslq 0x18(%r12), %rsi
subq %rax, %rsi
callq 0x5d82
movq %rax, %r12
movq %rax, %rdi
movq 0x18(%rsp), %rsi
callq 0x15728
jmp 0x1b1c8
leaq 0x518d(%rip), %rdi      # 0x204bf
movq %r12, %rsi
movq %r14, %rdx
callq 0x19f32
testb %al, %al
je 0x1b34f
addq $0x10, %r12
movq %r12, (%rbx)
movq 0x10(%rsp), %rdi
jmp 0x1b371
leaq 0x5178(%rip), %rdi      # 0x204ce
movq %r12, %rsi
movq %r14, %rdx
callq 0x19f32
testb %al, %al
je 0x1b381
addq $0x10, %r12
movq %r12, (%rbx)
movq 0x8(%rsp), %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x1a5b8
jmp 0x1b0ba
movl 0x8(%r12), %esi
movslq 0x4(%r12), %rdx
subl %edx, %esi
addq %r14, %rdx
leaq 0x5149(%rip), %rdi      # 0x204e0
xorl %eax, %eax
callq 0x5b50
addq $0x10, (%rbx)
jmp 0x1b1d0