// File: /workspace/github_c_makefile_star2_O0/baskerville[P]bspwm/src/tree.c
// Function: arrange
void arrange(monitor_t *m, desktop_t *d)
{
	if (d->root == NULL) {
		return;
	}

	xcb_rectangle_t rect = m->rectangle;

	rect.x += m->padding.left + d->padding.left;
	rect.y += m->padding.top + d->padding.top;
	rect.width -= m->padding.left + d->padding.left + d->padding.right + m->padding.right;
	rect.height -= m->padding.top + d->padding.top + d->padding.bottom + m->padding.bottom;

	if (d->layout == LAYOUT_MONOCLE) {
		rect.x += monocle_padding.left;
		rect.y += monocle_padding.top;
		rect.width -= monocle_padding.left + monocle_padding.right;
		rect.height -= monocle_padding.top + monocle_padding.bottom;
	}

	if (!gapless_monocle || d->layout != LAYOUT_MONOCLE) {
		rect.x += d->window_gap;
		rect.y += d->window_gap;
		rect.width -= d->window_gap;
		rect.height -= d->window_gap;
	}

	apply_layout(m, d, d->root, rect, rect);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x30(%rax)
jne 0xaff0
jmp 0xb15b
movq -0x8(%rbp), %rax
movq 0x4c(%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rax
movl 0x3c(%rax), %ecx
movq -0x10(%rbp), %rax
addl 0x5c(%rax), %ecx
movswl -0x18(%rbp), %eax
addl %ecx, %eax
movw %ax, -0x18(%rbp)
movq -0x8(%rbp), %rax
movl 0x30(%rax), %ecx
movq -0x10(%rbp), %rax
addl 0x50(%rax), %ecx
movswl -0x16(%rbp), %eax
addl %ecx, %eax
movw %ax, -0x16(%rbp)
movq -0x8(%rbp), %rax
movl 0x3c(%rax), %ecx
movq -0x10(%rbp), %rax
addl 0x5c(%rax), %ecx
movq -0x10(%rbp), %rax
addl 0x54(%rax), %ecx
movq -0x8(%rbp), %rax
addl 0x34(%rax), %ecx
movzwl -0x14(%rbp), %eax
subl %ecx, %eax
movw %ax, -0x14(%rbp)
movq -0x8(%rbp), %rax
movl 0x30(%rax), %ecx
movq -0x10(%rbp), %rax
addl 0x50(%rax), %ecx
movq -0x10(%rbp), %rax
addl 0x58(%rax), %ecx
movq -0x8(%rbp), %rax
addl 0x38(%rax), %ecx
movzwl -0x12(%rbp), %eax
subl %ecx, %eax
movw %ax, -0x12(%rbp)
movq -0x10(%rbp), %rax
cmpl $0x1, 0x24(%rax)
jne 0xb0e4
leaq 0x2ad17(%rip), %rax     # 0x35da0
movl 0xc(%rax), %ecx
movswl -0x18(%rbp), %eax
addl %ecx, %eax
movw %ax, -0x18(%rbp)
leaq 0x2ad03(%rip), %rax     # 0x35da0
movl (%rax), %ecx
movswl -0x16(%rbp), %eax
addl %ecx, %eax
movw %ax, -0x16(%rbp)
leaq 0x2acf0(%rip), %rax     # 0x35da0
movl 0xc(%rax), %ecx
leaq 0x2ace6(%rip), %rax     # 0x35da0
addl 0x4(%rax), %ecx
movzwl -0x14(%rbp), %eax
subl %ecx, %eax
movw %ax, -0x14(%rbp)
leaq 0x2acd2(%rip), %rax     # 0x35da0
movl (%rax), %ecx
leaq 0x2acc9(%rip), %rax     # 0x35da0
addl 0x8(%rax), %ecx
movzwl -0x12(%rbp), %eax
subl %ecx, %eax
movw %ax, -0x12(%rbp)
leaq 0x2acfc(%rip), %rax     # 0x35de7
testb $0x1, (%rax)
je 0xb0fa
movq -0x10(%rbp), %rax
cmpl $0x1, 0x24(%rax)
je 0xb13e
movq -0x10(%rbp), %rax
movl 0x60(%rax), %ecx
movswl -0x18(%rbp), %eax
addl %ecx, %eax
movw %ax, -0x18(%rbp)
movq -0x10(%rbp), %rax
movl 0x60(%rax), %ecx
movswl -0x16(%rbp), %eax
addl %ecx, %eax
movw %ax, -0x16(%rbp)
movq -0x10(%rbp), %rax
movl 0x60(%rax), %ecx
movzwl -0x14(%rbp), %eax
subl %ecx, %eax
movw %ax, -0x14(%rbp)
movq -0x10(%rbp), %rax
movl 0x60(%rax), %ecx
movzwl -0x12(%rbp), %eax
subl %ecx, %eax
movw %ax, -0x12(%rbp)
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rdx
movq -0x18(%rbp), %rcx
movq -0x18(%rbp), %r8
callq 0xb170
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)