// File: /workspace/github_c_makefile_star2_O1/baskerville[P]bspwm/src/restore.c
// Function: restore_node
node_t *restore_node(jsmntok_t **t, char *json)
{
	if ((*t)->type == JSMN_PRIMITIVE) {
		(*t)++;
		return NULL;
	} else {
		int s = (*t)->size;
		(*t)++;
		/* hack to prevent a new ID from being generated */
		node_t *n = make_node(UINT32_MAX);

		for (int i = 0; i < s; i++) {
			if (keyeq("id", *t, json)) {
				(*t)++;
				sscanf(json + (*t)->start, "%u", &n->id);
			RESTORE_ANY(splitType, &n->split_type, parse_split_type)
			RESTORE_DOUBLE(splitRatio, &n->split_ratio)
			RESTORE_BOOL(vacant, &n->vacant)
			RESTORE_BOOL(hidden, &n->hidden)
			RESTORE_BOOL(sticky, &n->sticky)
			RESTORE_BOOL(private, &n->private)
			RESTORE_BOOL(locked, &n->locked)
			RESTORE_BOOL(marked, &n->marked)
			} else if (keyeq("presel", *t, json)) {
				(*t)++;
				n->presel = restore_presel(t, json);
				continue;
			} else if (keyeq("rectangle", *t, json)) {
				(*t)++;
				restore_rectangle(&n->rectangle, t, json);
				continue;
			} else if (keyeq("constraints", *t, json)) {
				(*t)++;
				restore_constraints(&n->constraints, t, json);
				continue;
			} else if (keyeq("firstChild", *t, json)) {
				(*t)++;
				node_t *fc = restore_node(t, json);
				n->first_child = fc;
				if (fc != NULL) {
					fc->parent = n;
				}
				continue;
			} else if (keyeq("secondChild", *t, json)) {
				(*t)++;
				node_t *sc = restore_node(t, json);
				n->second_child = sc;
				if (sc != NULL) {
					sc->parent = n;
				}
				continue;
			} else if (keyeq("client", *t, json)) {
				(*t)++;
				n->client = restore_client(t, json);
				continue;
			} else {
				warn("Restore node: unknown key: '%.*s'.\n", (*t)->end - (*t)->start, json + (*t)->start);
				(*t)++;
			}
			(*t)++;
		}

		return n;
	}
}

// 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 0x1c136
addq $0x10, %rax
movq %rax, (%rbx)
xorl %r15d, %r15d
jmp 0x1c55b
movq %rsi, %r14
movl 0xc(%rax), %r12d
addq $0x10, %rax
movq %rax, (%rbx)
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x97c2
movq %rax, %r15
testl %r12d, %r12d
jle 0x1c55b
leaq 0x20(%r15), %rax
movq %rax, 0x8(%rsp)
leaq 0x18(%r15), %rax
movq %rax, 0x10(%rsp)
leaq 0x29(%r15), %rax
movq %rax, 0x18(%rsp)
leaq 0x28(%r15), %rax
movq %rax, 0x20(%rsp)
leaq 0x27(%r15), %rax
movq %rax, 0x28(%rsp)
leaq 0x26(%r15), %rax
movq %rax, 0x30(%rsp)
leaq 0x25(%r15), %rax
movq %rax, 0x38(%rsp)
leaq 0x24(%r15), %rax
movq %rax, 0x40(%rsp)
leaq 0x8(%r15), %rax
movq %rax, 0x48(%rsp)
movq %r15, %rax
addq $0x4, %rax
movq %rax, 0x50(%rsp)
leaq 0x51f9(%rip), %r13      # 0x213b7
movq (%rbx), %rbp
movq %r13, %rdi
movq %rbp, %rsi
movq %r14, %rdx
callq 0x1b678
testb %al, %al
je 0x1c1f7
leaq 0x10(%rbp), %rax
movq %rax, (%rbx)
movslq 0x14(%rbp), %rdi
addq %r14, %rdi
leaq 0x4433(%rip), %rsi      # 0x2061b
movq %r15, %rdx
xorl %eax, %eax
callq 0x41c0
jmp 0x1c3fa
leaq 0x5269(%rip), %rdi      # 0x21467
movq %rbp, %rsi
movq %r14, %rdx
callq 0x1b678
testb %al, %al
je 0x1c23d
leaq 0x10(%rbp), %rax
movq %rax, (%rbx)
movslq 0x14(%rbp), %rax
leaq (%r14,%rax), %rdi
movslq 0x18(%rbp), %rsi
subq %rax, %rsi
callq 0x5e6e
movq %rax, %rbp
movq %rax, %rdi
movq 0x50(%rsp), %rsi
callq 0x16a2a
jmp 0x1c3f2
leaq 0x522d(%rip), %rdi      # 0x21471
movq %rbp, %rsi
movq %r14, %rdx
callq 0x1b678
testb %al, %al
je 0x1c272
leaq 0x10(%rbp), %rax
movq %rax, (%rbx)
movslq 0x14(%rbp), %rdi
addq %r14, %rdi
leaq 0x3bd5(%rip), %rsi      # 0x1fe3d
movq 0x48(%rsp), %rdx
jmp 0x1c1eb
leaq 0x5203(%rip), %rdi      # 0x2147c
movq %rbp, %rsi
movq %r14, %rdx
callq 0x1b678
testb %al, %al
je 0x1c2b3
leaq 0x10(%rbp), %rax
movq %rax, (%rbx)
movslq 0x14(%rbp), %rax
leaq (%r14,%rax), %rdi
movslq 0x18(%rbp), %rsi
subq %rax, %rsi
callq 0x5e6e
movq %rax, %rbp
movq %rax, %rdi
movq 0x40(%rsp), %rsi
jmp 0x1c3ed
leaq 0x4a4e(%rip), %rdi      # 0x20d08
movq %rbp, %rsi
movq %r14, %rdx
callq 0x1b678
testb %al, %al
je 0x1c2f4
leaq 0x10(%rbp), %rax
movq %rax, (%rbx)
movslq 0x14(%rbp), %rax
leaq (%r14,%rax), %rdi
movslq 0x18(%rbp), %rsi
subq %rax, %rsi
callq 0x5e6e
movq %rax, %rbp
movq %rax, %rdi
movq 0x38(%rsp), %rsi
jmp 0x1c3ed
leaq 0x4a15(%rip), %rdi      # 0x20d10
movq %rbp, %rsi
movq %r14, %rdx
callq 0x1b678
testb %al, %al
je 0x1c335
leaq 0x10(%rbp), %rax
movq %rax, (%rbx)
movslq 0x14(%rbp), %rax
leaq (%r14,%rax), %rdi
movslq 0x18(%rbp), %rsi
subq %rax, %rsi
callq 0x5e6e
movq %rax, %rbp
movq %rax, %rdi
movq 0x30(%rsp), %rsi
jmp 0x1c3ed
leaq 0x49dc(%rip), %rdi      # 0x20d18
movq %rbp, %rsi
movq %r14, %rdx
callq 0x1b678
testb %al, %al
je 0x1c373
leaq 0x10(%rbp), %rax
movq %rax, (%rbx)
movslq 0x14(%rbp), %rax
leaq (%r14,%rax), %rdi
movslq 0x18(%rbp), %rsi
subq %rax, %rsi
callq 0x5e6e
movq %rax, %rbp
movq %rax, %rdi
movq 0x28(%rsp), %rsi
jmp 0x1c3ed
leaq 0x49a7(%rip), %rdi      # 0x20d21
movq %rbp, %rsi
movq %r14, %rdx
callq 0x1b678
testb %al, %al
je 0x1c3b1
leaq 0x10(%rbp), %rax
movq %rax, (%rbx)
movslq 0x14(%rbp), %rax
leaq (%r14,%rax), %rdi
movslq 0x18(%rbp), %rsi
subq %rax, %rsi
callq 0x5e6e
movq %rax, %rbp
movq %rax, %rdi
movq 0x20(%rsp), %rsi
jmp 0x1c3ed
leaq 0x4971(%rip), %rdi      # 0x20d29
movq %rbp, %rsi
movq %r14, %rdx
callq 0x1b678
testb %al, %al
je 0x1c40c
leaq 0x10(%rbp), %rax
movq %rax, (%rbx)
movslq 0x14(%rbp), %rax
leaq (%r14,%rax), %rdi
movslq 0x18(%rbp), %rsi
subq %rax, %rsi
callq 0x5e6e
movq %rax, %rbp
movq %rax, %rdi
movq 0x18(%rsp), %rsi
callq 0x169bc
movq %rbp, %rdi
callq 0x4460
addq $0x10, (%rbx)
decl %r12d
jne 0x1c1be
jmp 0x1c55b
leaq 0x4742(%rip), %rdi      # 0x20b55
movq %rbp, %rsi
movq %r14, %rdx
callq 0x1b678
testb %al, %al
je 0x1c43a
addq $0x10, %rbp
movq %rbp, (%rbx)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1c56d
movq %rax, 0x10(%r15)
jmp 0x1c3fe
leaq 0x3d2b(%rip), %rdi      # 0x2016c
movq %rbp, %rsi
movq %r14, %rdx
callq 0x1b678
testb %al, %al
je 0x1c469
addq $0x10, %rbp
movq %rbp, (%rbx)
movq 0x10(%rsp), %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x1bcf2
jmp 0x1c3fe
leaq 0x5013(%rip), %rdi      # 0x21483
movq %rbp, %rsi
movq %r14, %rdx
callq 0x1b678
testb %al, %al
je 0x1c49b
addq $0x10, %rbp
movq %rbp, (%rbx)
movq 0x8(%rsp), %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x1c660
jmp 0x1c3fe
leaq 0x4fed(%rip), %rdi      # 0x2148f
movq %rbp, %rsi
movq %r14, %rdx
callq 0x1b678
testb %al, %al
je 0x1c4c9
addq $0x10, %rbp
movq %rbp, (%rbx)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1c10e
movq %rax, 0x30(%r15)
jmp 0x1c4f5
leaq 0x4fca(%rip), %rdi      # 0x2149a
movq %rbp, %rsi
movq %r14, %rdx
callq 0x1b678
testb %al, %al
je 0x1c507
addq $0x10, %rbp
movq %rbp, (%rbx)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1c10e
movq %rax, 0x38(%r15)
testq %rax, %rax
je 0x1c3fe
movq %r15, 0x40(%rax)
jmp 0x1c3fe
leaq 0x4f98(%rip), %rdi      # 0x214a6
movq %rbp, %rsi
movq %r14, %rdx
callq 0x1b678
testb %al, %al
je 0x1c538
addq $0x10, %rbp
movq %rbp, (%rbx)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1c718
movq %rax, 0x48(%r15)
jmp 0x1c3fe
movl 0x8(%rbp), %esi
movslq 0x4(%rbp), %rdx
subl %edx, %esi
addq %r14, %rdx
leaq 0x4f62(%rip), %rdi      # 0x214ad
xorl %eax, %eax
callq 0x4b50
addq $0x10, (%rbx)
jmp 0x1c3fa
movq %r15, %rax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq