// File: /workspace/github_c_makefile_star2_O2/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 0x1aa13
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), %r12d
addq $0x10, %rax
movq %rax, (%rbx)
pushq $-0x1
popq %rdi
callq 0x92e9
movq %rax, %r15
addq $0x20, %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)
xorl %eax, %eax
testl %r12d, %r12d
cmovlel %eax, %r12d
leaq 0x58d2(%rip), %r13      # 0x2036b
subl $0x1, %r12d
jb 0x1aa01
movq (%rbx), %rbp
movq %r13, %rdi
movq %rbp, %rsi
movq %r14, %rdx
callq 0x19f32
testb %al, %al
je 0x1aadc
leaq 0x10(%rbp), %rax
movq %rax, (%rbx)
movslq 0x14(%rbp), %rdi
addq %r14, %rdi
leaq 0x4b02(%rip), %rsi      # 0x1f5cf
movq %r15, %rdx
xorl %eax, %eax
callq 0x41c0
jmp 0x1acdf
leaq 0x5938(%rip), %rdi      # 0x2041b
movq %rbp, %rsi
movq %r14, %rdx
callq 0x19f32
testb %al, %al
je 0x1ab22
leaq 0x10(%rbp), %rax
movq %rax, (%rbx)
movslq 0x14(%rbp), %rax
leaq (%r14,%rax), %rdi
movslq 0x18(%rbp), %rsi
subq %rax, %rsi
callq 0x5d82
movq %rax, %rbp
movq %rax, %rdi
movq 0x50(%rsp), %rsi
callq 0x157a1
jmp 0x1acd7
leaq 0x58fc(%rip), %rdi      # 0x20425
movq %rbp, %rsi
movq %r14, %rdx
callq 0x19f32
testb %al, %al
je 0x1ab57
leaq 0x10(%rbp), %rax
movq %rax, (%rbx)
movslq 0x14(%rbp), %rdi
addq %r14, %rdi
leaq 0x42d4(%rip), %rsi      # 0x1ee21
movq 0x48(%rsp), %rdx
jmp 0x1aad0
leaq 0x58d2(%rip), %rdi      # 0x20430
movq %rbp, %rsi
movq %r14, %rdx
callq 0x19f32
testb %al, %al
je 0x1ab98
leaq 0x10(%rbp), %rax
movq %rax, (%rbx)
movslq 0x14(%rbp), %rax
leaq (%r14,%rax), %rdi
movslq 0x18(%rbp), %rsi
subq %rax, %rsi
callq 0x5d82
movq %rax, %rbp
movq %rax, %rdi
movq 0x40(%rsp), %rsi
jmp 0x1acd2
leaq 0x511d(%rip), %rdi      # 0x1fcbc
movq %rbp, %rsi
movq %r14, %rdx
callq 0x19f32
testb %al, %al
je 0x1abd9
leaq 0x10(%rbp), %rax
movq %rax, (%rbx)
movslq 0x14(%rbp), %rax
leaq (%r14,%rax), %rdi
movslq 0x18(%rbp), %rsi
subq %rax, %rsi
callq 0x5d82
movq %rax, %rbp
movq %rax, %rdi
movq 0x38(%rsp), %rsi
jmp 0x1acd2
leaq 0x50e4(%rip), %rdi      # 0x1fcc4
movq %rbp, %rsi
movq %r14, %rdx
callq 0x19f32
testb %al, %al
je 0x1ac1a
leaq 0x10(%rbp), %rax
movq %rax, (%rbx)
movslq 0x14(%rbp), %rax
leaq (%r14,%rax), %rdi
movslq 0x18(%rbp), %rsi
subq %rax, %rsi
callq 0x5d82
movq %rax, %rbp
movq %rax, %rdi
movq 0x30(%rsp), %rsi
jmp 0x1acd2
leaq 0x50ab(%rip), %rdi      # 0x1fccc
movq %rbp, %rsi
movq %r14, %rdx
callq 0x19f32
testb %al, %al
je 0x1ac58
leaq 0x10(%rbp), %rax
movq %rax, (%rbx)
movslq 0x14(%rbp), %rax
leaq (%r14,%rax), %rdi
movslq 0x18(%rbp), %rsi
subq %rax, %rsi
callq 0x5d82
movq %rax, %rbp
movq %rax, %rdi
movq 0x28(%rsp), %rsi
jmp 0x1acd2
leaq 0x5076(%rip), %rdi      # 0x1fcd5
movq %rbp, %rsi
movq %r14, %rdx
callq 0x19f32
testb %al, %al
je 0x1ac96
leaq 0x10(%rbp), %rax
movq %rax, (%rbx)
movslq 0x14(%rbp), %rax
leaq (%r14,%rax), %rdi
movslq 0x18(%rbp), %rsi
subq %rax, %rsi
callq 0x5d82
movq %rax, %rbp
movq %rax, %rdi
movq 0x20(%rsp), %rsi
jmp 0x1acd2
leaq 0x5040(%rip), %rdi      # 0x1fcdd
movq %rbp, %rsi
movq %r14, %rdx
callq 0x19f32
testb %al, %al
je 0x1ace8
leaq 0x10(%rbp), %rax
movq %rax, (%rbx)
movslq 0x14(%rbp), %rax
leaq (%r14,%rax), %rdi
movslq 0x18(%rbp), %rsi
subq %rax, %rsi
callq 0x5d82
movq %rax, %rbp
movq %rax, %rdi
movq 0x18(%rsp), %rsi
callq 0x15728
movq %rbp, %rdi
callq 0x4460
addq $0x10, (%rbx)
jmp 0x1aa99
leaq 0x4e1a(%rip), %rdi      # 0x1fb09
movq %rbp, %rsi
movq %r14, %rdx
callq 0x19f32
testb %al, %al
je 0x1ad19
addq $0x10, %rbp
movq %rbp, (%rbx)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1ae3d
movq %rax, 0x10(%r15)
jmp 0x1aa99
leaq 0x4409(%rip), %rdi      # 0x1f129
movq %rbp, %rsi
movq %r14, %rdx
callq 0x19f32
testb %al, %al
je 0x1ad4b
addq $0x10, %rbp
movq %rbp, (%rbx)
movq 0x10(%rsp), %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x1a5b8
jmp 0x1aa99
leaq 0x56e5(%rip), %rdi      # 0x20437
movq %rbp, %rsi
movq %r14, %rdx
callq 0x19f32
testb %al, %al
je 0x1ad7d
addq $0x10, %rbp
movq %rbp, (%rbx)
movq 0x8(%rsp), %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x1af2a
jmp 0x1aa99
leaq 0x56bf(%rip), %rdi      # 0x20443
movq %rbp, %rsi
movq %r14, %rdx
callq 0x19f32
testb %al, %al
je 0x1adab
addq $0x10, %rbp
movq %rbp, (%rbx)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1a9de
movq %rax, 0x30(%r15)
jmp 0x1add7
leaq 0x569c(%rip), %rdi      # 0x2044e
movq %rbp, %rsi
movq %r14, %rdx
callq 0x19f32
testb %al, %al
je 0x1ade9
addq $0x10, %rbp
movq %rbp, (%rbx)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1a9de
movq %rax, 0x38(%r15)
testq %rax, %rax
je 0x1aa99
movq %r15, 0x40(%rax)
jmp 0x1aa99
leaq 0x566a(%rip), %rdi      # 0x2045a
movq %rbp, %rsi
movq %r14, %rdx
callq 0x19f32
testb %al, %al
je 0x1ae1a
addq $0x10, %rbp
movq %rbp, (%rbx)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1afe9
movq %rax, 0x48(%r15)
jmp 0x1aa99
movl 0x8(%rbp), %esi
movslq 0x4(%rbp), %rdx
subl %edx, %esi
addq %r14, %rdx
leaq 0x5634(%rip), %rdi      # 0x20461
xorl %eax, %eax
callq 0x5b50
addq $0x10, (%rbx)
jmp 0x1acdf