// File: /workspace/github_c_makefile_star2_O3/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 0x1c486
addq $0x10, %rax
movq %rax, (%rbx)
xorl %r15d, %r15d
jmp 0x1c810
movq %rsi, %r14
movl 0xc(%rax), %ebp
addq $0x10, %rax
movq %rax, (%rbx)
callq 0xa863
movq %rax, %r15
testl %ebp, %ebp
jle 0x1c810
leaq 0x318(%r15), %rax
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)
leaq 0x4f6a(%rip), %r13      # 0x2148e
movq (%rbx), %r12
movq %r13, %rdi
movq %r12, %rsi
movq %r14, %rdx
callq 0x1b3b2
testb %al, %al
je 0x1c55a
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 0x1c591
leaq 0x4f37(%rip), %rdi      # 0x21498
movq %r12, %rsi
movq %r14, %rdx
callq 0x1b3b2
testb %al, %al
je 0x1c5a4
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 0x2aaf(%rip), %rdx      # 0x1f047
xorl %eax, %eax
callq 0x4110
jmp 0x1c631
leaq 0x37db(%rip), %rdi      # 0x1fd86
movq %r12, %rsi
movq %r14, %rdx
callq 0x1b3b2
testb %al, %al
je 0x1c5e5
leaq 0x10(%r12), %rax
movq %rax, (%rbx)
movslq 0x14(%r12), %rax
leaq (%r14,%rax), %rdi
movslq 0x18(%r12), %rsi
subq %rax, %rsi
callq 0x5e2f
movq %rax, %r12
movq %rax, %rdi
movq 0x48(%rsp), %rsi
jmp 0x1c624
leaq 0x4eb9(%rip), %rdi      # 0x214a5
movq %r12, %rsi
movq %r14, %rdx
callq 0x1b3b2
testb %al, %al
je 0x1c642
leaq 0x10(%r12), %rax
movq %rax, (%rbx)
movslq 0x14(%r12), %rax
leaq (%r14,%rax), %rdi
movslq 0x18(%r12), %rsi
subq %rax, %rsi
callq 0x5e2f
movq %rax, %r12
movq %rax, %rdi
movq 0x40(%rsp), %rsi
callq 0x169d6
movq %r12, %rdi
callq 0x4460
addq $0x10, (%rbx)
decl %ebp
jne 0x1c524
jmp 0x1c810
leaq 0x3713(%rip), %rdi      # 0x1fd5c
movq %r12, %rsi
movq %r14, %rdx
callq 0x1b3b2
testb %al, %al
je 0x1c683
leaq 0x10(%r12), %rax
movq %rax, (%rbx)
movslq 0x14(%r12), %rax
leaq (%r14,%rax), %rdi
movslq 0x18(%r12), %rsi
subq %rax, %rsi
callq 0x5e2f
movq %rax, %r12
movq %rax, %rdi
movq 0x38(%rsp), %rsi
jmp 0x1c6c2
leaq 0x4e25(%rip), %rdi      # 0x214af
movq %r12, %rsi
movq %r14, %rdx
callq 0x1b3b2
testb %al, %al
je 0x1c6cc
leaq 0x10(%r12), %rax
movq %rax, (%rbx)
movslq 0x14(%r12), %rax
leaq (%r14,%rax), %rdi
movslq 0x18(%r12), %rsi
subq %rax, %rsi
callq 0x5e2f
movq %rax, %r12
movq %rax, %rdi
movq 0x30(%rsp), %rsi
callq 0x16a53
jmp 0x1c629
leaq 0x4cbf(%rip), %rdi      # 0x21392
movq %r12, %rsi
movq %r14, %rdx
callq 0x1b3b2
testb %al, %al
je 0x1c70a
leaq 0x10(%r12), %rax
movq %rax, (%rbx)
movslq 0x14(%r12), %rdi
addq %r14, %rdi
leaq 0x3ed6(%rip), %rsi      # 0x205cf
movq 0x28(%rsp), %rdx
xorl %eax, %eax
callq 0x41c0
jmp 0x1c631
leaq 0x4535(%rip), %rdi      # 0x20c46
movq %r12, %rsi
movq %r14, %rdx
callq 0x1b3b2
testb %al, %al
je 0x1c74b
leaq 0x10(%r12), %rax
movq %rax, (%rbx)
movslq 0x14(%r12), %rax
leaq (%r14,%rax), %rdi
movslq 0x18(%r12), %rsi
subq %rax, %rsi
callq 0x5e2f
movq %rax, %r12
movq %rax, %rdi
movq 0x20(%rsp), %rsi
jmp 0x1c78a
leaq 0x4d67(%rip), %rdi      # 0x214b9
movq %r12, %rsi
movq %r14, %rdx
callq 0x1b3b2
testb %al, %al
je 0x1c794
leaq 0x10(%r12), %rax
movq %rax, (%rbx)
movslq 0x14(%r12), %rax
leaq (%r14,%rax), %rdi
movslq 0x18(%r12), %rsi
subq %rax, %rsi
callq 0x5e2f
movq %rax, %r12
movq %rax, %rdi
movq 0x18(%rsp), %rsi
callq 0x16884
jmp 0x1c629
leaq 0x4d24(%rip), %rdi      # 0x214bf
movq %r12, %rsi
movq %r14, %rdx
callq 0x1b3b2
testb %al, %al
je 0x1c7b8
addq $0x10, %r12
movq %r12, (%rbx)
movq 0x10(%rsp), %rdi
jmp 0x1c7da
leaq 0x4d0f(%rip), %rdi      # 0x214ce
movq %r12, %rsi
movq %r14, %rdx
callq 0x1b3b2
testb %al, %al
je 0x1c7ea
addq $0x10, %r12
movq %r12, (%rbx)
movq 0x8(%rsp), %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x1ba2a
jmp 0x1c635
movl 0x8(%r12), %esi
movslq 0x4(%r12), %rdx
subl %edx, %esi
addq %r14, %rdx
leaq 0x4ce0(%rip), %rdi      # 0x214e0
xorl %eax, %eax
callq 0x4b50
addq $0x10, (%rbx)
jmp 0x1c631
movq %r15, %rax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq