// File: /workspace/github_c_makefile_star2_O0/baskerville[P]bspwm/src/restore.c
// Function: restore_desktop
desktop_t *restore_desktop(jsmntok_t **t, char *json)
{
	int s = (*t)->size;
	(*t)++;
	desktop_t *d = make_desktop(NULL, UINT32_MAX);
	xcb_window_t focusedNodeId = XCB_NONE;

	for (int i = 0; i < s; i++) {
		if (keyeq("name", *t, json)) {
			(*t)++;
			snprintf(d->name, (*t)->end - (*t)->start + 1, "%s", json + (*t)->start);
		RESTORE_UINT(id, &d->id)
		RESTORE_ANY(layout, &d->layout, parse_layout)
		RESTORE_ANY(userLayout, &d->user_layout, parse_layout)
		RESTORE_INT(windowGap, &d->window_gap)
		RESTORE_UINT(borderWidth, &d->border_width)
		} else if (keyeq("focusedNodeId", *t, json)) {
			(*t)++;
			sscanf(json + (*t)->start, "%u", &focusedNodeId);
		} else if (keyeq("padding", *t, json)) {
			(*t)++;
			restore_padding(&d->padding, t, json);
			continue;
		} else if (keyeq("root", *t, json)) {
			(*t)++;
			d->root = restore_node(t, json);
			continue;
		} else {
			warn("Restore desktop: unknown key: '%.*s'.\n", (*t)->end - (*t)->start, json + (*t)->start);
			(*t)++;
		}
		(*t)++;
	}

	if (focusedNodeId != XCB_NONE) {
		d->focus = find_by_id_in(d->root, focusedNodeId);
	}

	return d;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movl 0xc(%rax), %eax
movl %eax, -0x14(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rcx
addq $0x10, %rcx
movq %rcx, (%rax)
xorl %eax, %eax
movl %eax, %edi
movl $0xffffffff, %esi       # imm = 0xFFFFFFFF
callq 0xa460
movq %rax, -0x20(%rbp)
movl $0x0, -0x24(%rbp)
movl $0x0, -0x28(%rbp)
movl -0x28(%rbp), %eax
cmpl -0x14(%rbp), %eax
jge 0x28231
movq -0x8(%rbp), %rax
movq (%rax), %rsi
movq -0x10(%rbp), %rdx
leaq 0x635d(%rip), %rdi      # 0x2e1e6
callq 0x27330
testb $0x1, %al
jne 0x27e94
jmp 0x27ee5
movq -0x8(%rbp), %rax
movq (%rax), %rcx
addq $0x10, %rcx
movq %rcx, (%rax)
movq -0x20(%rbp), %rdi
movq -0x8(%rbp), %rax
movq (%rax), %rax
movl 0x8(%rax), %eax
movq -0x8(%rbp), %rcx
movq (%rcx), %rcx
subl 0x4(%rcx), %eax
addl $0x1, %eax
movslq %eax, %rsi
movq -0x10(%rbp), %rcx
movq -0x8(%rbp), %rax
movq (%rax), %rax
movslq 0x4(%rax), %rax
addq %rax, %rcx
leaq 0x5217(%rip), %rdx      # 0x2d0f0
movb $0x0, %al
callq 0x4120
jmp 0x28215
movq -0x8(%rbp), %rax
movq (%rax), %rsi
movq -0x10(%rbp), %rdx
leaq 0x762e(%rip), %rdi      # 0x2f525
callq 0x27330
testb $0x1, %al
jne 0x27f02
jmp 0x27f3d
movq -0x8(%rbp), %rax
movq (%rax), %rcx
addq $0x10, %rcx
movq %rcx, (%rax)
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rax
movq (%rax), %rax
movslq 0x4(%rax), %rax
addq %rax, %rdi
movq -0x20(%rbp), %rdx
addq $0x20, %rdx
leaq 0x687a(%rip), %rsi      # 0x2e7ab
movb $0x0, %al
callq 0x41c0
jmp 0x28213
movq -0x8(%rbp), %rax
movq (%rax), %rsi
movq -0x10(%rbp), %rdx
leaq 0x628c(%rip), %rdi      # 0x2e1db
callq 0x27330
testb $0x1, %al
jne 0x27f5a
jmp 0x27fb9
movq -0x8(%rbp), %rax
movq (%rax), %rcx
addq $0x10, %rcx
movq %rcx, (%rax)
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rax
movq (%rax), %rax
movslq 0x4(%rax), %rax
addq %rax, %rdi
movq -0x8(%rbp), %rax
movq (%rax), %rax
movl 0x8(%rax), %eax
movq -0x8(%rbp), %rcx
movq (%rcx), %rcx
subl 0x4(%rcx), %eax
movslq %eax, %rsi
callq 0x6750
movq %rax, -0x30(%rbp)
movq -0x30(%rbp), %rdi
movq -0x20(%rbp), %rsi
addq $0x24, %rsi
callq 0x20a20
movq -0x30(%rbp), %rdi
callq 0x4450
jmp 0x28211
movq -0x8(%rbp), %rax
movq (%rax), %rsi
movq -0x10(%rbp), %rdx
leaq 0x75c5(%rip), %rdi      # 0x2f590
callq 0x27330
testb $0x1, %al
jne 0x27fd6
jmp 0x28035
movq -0x8(%rbp), %rax
movq (%rax), %rcx
addq $0x10, %rcx
movq %rcx, (%rax)
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rax
movq (%rax), %rax
movslq 0x4(%rax), %rax
addq %rax, %rdi
movq -0x8(%rbp), %rax
movq (%rax), %rax
movl 0x8(%rax), %eax
movq -0x8(%rbp), %rcx
movq (%rcx), %rcx
subl 0x4(%rcx), %eax
movslq %eax, %rsi
callq 0x6750
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rdi
movq -0x20(%rbp), %rsi
addq $0x28, %rsi
callq 0x20a20
movq -0x38(%rbp), %rdi
callq 0x4450
jmp 0x2820f
movq -0x8(%rbp), %rax
movq (%rax), %rsi
movq -0x10(%rbp), %rdx
leaq 0x74fb(%rip), %rdi      # 0x2f542
callq 0x27330
testb $0x1, %al
jne 0x28052
jmp 0x2808d
movq -0x8(%rbp), %rax
movq (%rax), %rcx
addq $0x10, %rcx
movq %rcx, (%rax)
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rax
movq (%rax), %rax
movslq 0x4(%rax), %rax
addq %rax, %rdi
movq -0x20(%rbp), %rdx
addq $0x60, %rdx
leaq 0x7258(%rip), %rsi      # 0x2f2d9
movb $0x0, %al
callq 0x41c0
jmp 0x2820d
movq -0x8(%rbp), %rax
movq (%rax), %rsi
movq -0x10(%rbp), %rdx
leaq 0x74ad(%rip), %rdi      # 0x2f54c
callq 0x27330
testb $0x1, %al
jne 0x280aa
jmp 0x280e5
movq -0x8(%rbp), %rax
movq (%rax), %rcx
addq $0x10, %rcx
movq %rcx, (%rax)
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rax
movq (%rax), %rax
movslq 0x4(%rax), %rax
addq %rax, %rdi
movq -0x20(%rbp), %rdx
addq $0x64, %rdx
leaq 0x66d2(%rip), %rsi      # 0x2e7ab
movb $0x0, %al
callq 0x41c0
jmp 0x2820b
movq -0x8(%rbp), %rax
movq (%rax), %rsi
movq -0x10(%rbp), %rdx
leaq 0x74a4(%rip), %rdi      # 0x2f59b
callq 0x27330
testb $0x1, %al
jne 0x28102
jmp 0x28139
movq -0x8(%rbp), %rax
movq (%rax), %rcx
addq $0x10, %rcx
movq %rcx, (%rax)
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rax
movq (%rax), %rax
movslq 0x4(%rax), %rax
addq %rax, %rdi
leaq 0x6682(%rip), %rsi      # 0x2e7ab
leaq -0x24(%rbp), %rdx
movb $0x0, %al
callq 0x41c0
jmp 0x28209
movq -0x8(%rbp), %rax
movq (%rax), %rsi
movq -0x10(%rbp), %rdx
leaq 0x6710(%rip), %rdi      # 0x2e85b
callq 0x27330
testb $0x1, %al
jne 0x28156
jmp 0x2817e
movq -0x8(%rbp), %rax
movq (%rax), %rcx
addq $0x10, %rcx
movq %rcx, (%rax)
movq -0x20(%rbp), %rdi
addq $0x50, %rdi
movq -0x8(%rbp), %rsi
movq -0x10(%rbp), %rdx
callq 0x27aa0
jmp 0x28223
movq -0x8(%rbp), %rax
movq (%rax), %rsi
movq -0x10(%rbp), %rdx
leaq 0x7419(%rip), %rdi      # 0x2f5a9
callq 0x27330
testb $0x1, %al
jne 0x2819b
jmp 0x281c3
movq -0x8(%rbp), %rax
movq (%rax), %rcx
addq $0x10, %rcx
movq %rcx, (%rax)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x28260
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x30(%rax)
jmp 0x28223
movq -0x8(%rbp), %rax
movq (%rax), %rax
movl 0x8(%rax), %esi
movq -0x8(%rbp), %rax
movq (%rax), %rax
subl 0x4(%rax), %esi
movq -0x10(%rbp), %rdx
movq -0x8(%rbp), %rax
movq (%rax), %rax
movslq 0x4(%rax), %rax
addq %rax, %rdx
leaq 0x73be(%rip), %rdi      # 0x2f5ae
movb $0x0, %al
callq 0x6410
movq -0x8(%rbp), %rax
movq (%rax), %rcx
addq $0x10, %rcx
movq %rcx, (%rax)
jmp 0x28207
jmp 0x28209
jmp 0x2820b
jmp 0x2820d
jmp 0x2820f
jmp 0x28211
jmp 0x28213
jmp 0x28215
movq -0x8(%rbp), %rax
movq (%rax), %rcx
addq $0x10, %rcx
movq %rcx, (%rax)
movl -0x28(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x28(%rbp)
jmp 0x27e6b
movl -0x24(%rbp), %eax
cmpq $0x0, %rax
je 0x28255
movq -0x20(%rbp), %rax
movq 0x30(%rax), %rdi
movl -0x24(%rbp), %esi
callq 0xebf0
movq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x38(%rax)
movq -0x20(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nop