// File: /workspace/github_c_makefile_star2_O3/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 0x1be71
addq $0x10, %rax
movq %rax, (%rbx)
xorl %r15d, %r15d
jmp 0x1c296
movq %rsi, %r14
movl 0xc(%rax), %r12d
addq $0x10, %rax
movq %rax, (%rbx)
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x96c2
movq %rax, %r15
testl %r12d, %r12d
jle 0x1c296
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 0x5472(%rip), %r13      # 0x2136b
movq (%rbx), %rbp
movq %r13, %rdi
movq %rbp, %rsi
movq %r14, %rdx
callq 0x1b3b2
testb %al, %al
je 0x1bf32
leaq 0x10(%rbp), %rax
movq %rax, (%rbx)
movslq 0x14(%rbp), %rdi
addq %r14, %rdi
leaq 0x46ac(%rip), %rsi      # 0x205cf
movq %r15, %rdx
xorl %eax, %eax
callq 0x41c0
jmp 0x1c135
leaq 0x54e2(%rip), %rdi      # 0x2141b
movq %rbp, %rsi
movq %r14, %rdx
callq 0x1b3b2
testb %al, %al
je 0x1bf78
leaq 0x10(%rbp), %rax
movq %rax, (%rbx)
movslq 0x14(%rbp), %rax
leaq (%r14,%rax), %rdi
movslq 0x18(%rbp), %rsi
subq %rax, %rsi
callq 0x5e2f
movq %rax, %rbp
movq %rax, %rdi
movq 0x50(%rsp), %rsi
callq 0x168fd
jmp 0x1c12d
leaq 0x54a6(%rip), %rdi      # 0x21425
movq %rbp, %rsi
movq %r14, %rdx
callq 0x1b3b2
testb %al, %al
je 0x1bfad
leaq 0x10(%rbp), %rax
movq %rax, (%rbx)
movslq 0x14(%rbp), %rdi
addq %r14, %rdi
leaq 0x3e7e(%rip), %rsi      # 0x1fe21
movq 0x48(%rsp), %rdx
jmp 0x1bf26
leaq 0x547c(%rip), %rdi      # 0x21430
movq %rbp, %rsi
movq %r14, %rdx
callq 0x1b3b2
testb %al, %al
je 0x1bfee
leaq 0x10(%rbp), %rax
movq %rax, (%rbx)
movslq 0x14(%rbp), %rax
leaq (%r14,%rax), %rdi
movslq 0x18(%rbp), %rsi
subq %rax, %rsi
callq 0x5e2f
movq %rax, %rbp
movq %rax, %rdi
movq 0x40(%rsp), %rsi
jmp 0x1c128
leaq 0x4cc7(%rip), %rdi      # 0x20cbc
movq %rbp, %rsi
movq %r14, %rdx
callq 0x1b3b2
testb %al, %al
je 0x1c02f
leaq 0x10(%rbp), %rax
movq %rax, (%rbx)
movslq 0x14(%rbp), %rax
leaq (%r14,%rax), %rdi
movslq 0x18(%rbp), %rsi
subq %rax, %rsi
callq 0x5e2f
movq %rax, %rbp
movq %rax, %rdi
movq 0x38(%rsp), %rsi
jmp 0x1c128
leaq 0x4c8e(%rip), %rdi      # 0x20cc4
movq %rbp, %rsi
movq %r14, %rdx
callq 0x1b3b2
testb %al, %al
je 0x1c070
leaq 0x10(%rbp), %rax
movq %rax, (%rbx)
movslq 0x14(%rbp), %rax
leaq (%r14,%rax), %rdi
movslq 0x18(%rbp), %rsi
subq %rax, %rsi
callq 0x5e2f
movq %rax, %rbp
movq %rax, %rdi
movq 0x30(%rsp), %rsi
jmp 0x1c128
leaq 0x4c55(%rip), %rdi      # 0x20ccc
movq %rbp, %rsi
movq %r14, %rdx
callq 0x1b3b2
testb %al, %al
je 0x1c0ae
leaq 0x10(%rbp), %rax
movq %rax, (%rbx)
movslq 0x14(%rbp), %rax
leaq (%r14,%rax), %rdi
movslq 0x18(%rbp), %rsi
subq %rax, %rsi
callq 0x5e2f
movq %rax, %rbp
movq %rax, %rdi
movq 0x28(%rsp), %rsi
jmp 0x1c128
leaq 0x4c20(%rip), %rdi      # 0x20cd5
movq %rbp, %rsi
movq %r14, %rdx
callq 0x1b3b2
testb %al, %al
je 0x1c0ec
leaq 0x10(%rbp), %rax
movq %rax, (%rbx)
movslq 0x14(%rbp), %rax
leaq (%r14,%rax), %rdi
movslq 0x18(%rbp), %rsi
subq %rax, %rsi
callq 0x5e2f
movq %rax, %rbp
movq %rax, %rdi
movq 0x20(%rsp), %rsi
jmp 0x1c128
leaq 0x4bea(%rip), %rdi      # 0x20cdd
movq %rbp, %rsi
movq %r14, %rdx
callq 0x1b3b2
testb %al, %al
je 0x1c147
leaq 0x10(%rbp), %rax
movq %rax, (%rbx)
movslq 0x14(%rbp), %rax
leaq (%r14,%rax), %rdi
movslq 0x18(%rbp), %rsi
subq %rax, %rsi
callq 0x5e2f
movq %rax, %rbp
movq %rax, %rdi
movq 0x18(%rsp), %rsi
callq 0x16884
movq %rbp, %rdi
callq 0x4460
addq $0x10, (%rbx)
decl %r12d
jne 0x1bef9
jmp 0x1c296
leaq 0x49bb(%rip), %rdi      # 0x20b09
movq %rbp, %rsi
movq %r14, %rdx
callq 0x1b3b2
testb %al, %al
je 0x1c175
addq $0x10, %rbp
movq %rbp, (%rbx)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1c2a8
movq %rax, 0x10(%r15)
jmp 0x1c139
leaq 0x3fad(%rip), %rdi      # 0x20129
movq %rbp, %rsi
movq %r14, %rdx
callq 0x1b3b2
testb %al, %al
je 0x1c1a4
addq $0x10, %rbp
movq %rbp, (%rbx)
movq 0x10(%rsp), %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x1ba2a
jmp 0x1c139
leaq 0x528c(%rip), %rdi      # 0x21437
movq %rbp, %rsi
movq %r14, %rdx
callq 0x1b3b2
testb %al, %al
je 0x1c1d6
addq $0x10, %rbp
movq %rbp, (%rbx)
movq 0x8(%rsp), %rdi
movq %rbx, %rsi
movq %r14, %rdx
callq 0x1c3a1
jmp 0x1c139
leaq 0x5266(%rip), %rdi      # 0x21443
movq %rbp, %rsi
movq %r14, %rdx
callq 0x1b3b2
testb %al, %al
je 0x1c204
addq $0x10, %rbp
movq %rbp, (%rbx)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1be49
movq %rax, 0x30(%r15)
jmp 0x1c230
leaq 0x5243(%rip), %rdi      # 0x2144e
movq %rbp, %rsi
movq %r14, %rdx
callq 0x1b3b2
testb %al, %al
je 0x1c242
addq $0x10, %rbp
movq %rbp, (%rbx)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1be49
movq %rax, 0x38(%r15)
testq %rax, %rax
je 0x1c139
movq %r15, 0x40(%rax)
jmp 0x1c139
leaq 0x5211(%rip), %rdi      # 0x2145a
movq %rbp, %rsi
movq %r14, %rdx
callq 0x1b3b2
testb %al, %al
je 0x1c273
addq $0x10, %rbp
movq %rbp, (%rbx)
movq %rbx, %rdi
movq %r14, %rsi
callq 0x1c45e
movq %rax, 0x48(%r15)
jmp 0x1c139
movl 0x8(%rbp), %esi
movslq 0x4(%rbp), %rdx
subl %edx, %esi
addq %r14, %rdx
leaq 0x51db(%rip), %rdi      # 0x21461
xorl %eax, %eax
callq 0x4b50
addq $0x10, (%rbx)
jmp 0x1c135
movq %r15, %rax
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq