// File: /workspace/github_c_makefile_star2_O0/baskerville[P]bspwm/src/monitor.c
// Function: update_root
void update_root(monitor_t *m, xcb_rectangle_t *rect)
{
	xcb_rectangle_t last_rect = m->rectangle;
	m->rectangle = *rect;
	if (m->root == XCB_NONE) {
		uint32_t values[] = {XCB_EVENT_MASK_ENTER_WINDOW};
		m->root = xcb_generate_id(dpy);
		xcb_create_window(dpy, XCB_COPY_FROM_PARENT, m->root, root,
		                  rect->x, rect->y, rect->width, rect->height, 0,
		                  XCB_WINDOW_CLASS_INPUT_ONLY, XCB_COPY_FROM_PARENT, XCB_CW_EVENT_MASK, values);
		xcb_icccm_set_wm_class(dpy, m->root, sizeof(ROOT_WINDOW_IC), ROOT_WINDOW_IC);
		xcb_icccm_set_wm_name(dpy, m->root, XCB_ATOM_STRING, 8, strlen(m->name), m->name);
		window_lower(m->root);
		if (focus_follows_pointer) {
			window_show(m->root);
		}
	} else {
		window_move_resize(m->root, rect->x, rect->y, rect->width, rect->height);
		put_status(SBSC_MASK_MONITOR_GEOMETRY, "monitor_geometry 0x%08X %ux%u+%i+%i\n",
		           m->id, rect->width, rect->height, rect->x, rect->y);
	}
	for (desktop_t *d = m->desk_head; d != NULL; d = d->next) {
		for (node_t *n = first_extrema(d->root); n != NULL; n = next_leaf(n, d->root)) {
			if (n->client == NULL) {
				continue;
			}
			adapt_geometry(&last_rect, rect, n);
		}
		arrange(m, d);
	}
	reorder_monitor(m);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq 0x4c(%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq -0x10(%rbp), %rcx
movq (%rcx), %rcx
movq %rcx, 0x4c(%rax)
movq -0x8(%rbp), %rax
movl 0x28(%rax), %eax
cmpq $0x0, %rax
jne 0x81b5
movl 0x255ff(%rip), %eax     # 0x2d684
movl %eax, -0x1c(%rbp)
leaq 0x2d629(%rip), %rax     # 0x356b8
movq (%rax), %rdi
callq 0x4900
movl %eax, %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x28(%rax)
leaq 0x2d611(%rip), %rax     # 0x356b8
movq (%rax), %rdi
movq -0x8(%rbp), %rax
movl 0x28(%rax), %edx
leaq 0x2d6b0(%rip), %rax     # 0x35768
movl (%rax), %ecx
movq -0x10(%rbp), %rax
movw (%rax), %r8w
movq -0x10(%rbp), %rax
movw 0x2(%rax), %r9w
movq -0x10(%rbp), %rax
movw 0x4(%rax), %r11w
movq -0x10(%rbp), %rax
movw 0x6(%rax), %r10w
leaq -0x1c(%rbp), %rax
xorl %esi, %esi
movswl %r8w, %r8d
movswl %r9w, %r9d
movzwl %r11w, %r11d
movl %r11d, (%rsp)
movzwl %r10w, %r10d
movl %r10d, 0x8(%rsp)
movl $0x0, 0x10(%rsp)
movl $0x2, 0x18(%rsp)
movl $0x0, 0x20(%rsp)
movl $0x800, 0x28(%rsp)      # imm = 0x800
movq %rax, 0x30(%rsp)
callq 0x4030
movl %eax, -0x20(%rbp)
leaq 0x2d588(%rip), %rax     # 0x356b8
movq (%rax), %rdi
movq -0x8(%rbp), %rax
movl 0x28(%rax), %esi
movl $0xb, %edx
leaq 0x25542(%rip), %rcx     # 0x2d688
callq 0x46f0
movl %eax, -0x24(%rbp)
leaq 0x2d563(%rip), %rax     # 0x356b8
movq (%rax), %rax
movq %rax, -0x48(%rbp)
movq -0x8(%rbp), %rax
movl 0x28(%rax), %eax
movl %eax, -0x3c(%rbp)
movq -0x8(%rbp), %rdi
callq 0x4460
movq -0x48(%rbp), %rdi
movl -0x3c(%rbp), %esi
movl %eax, %r8d
movq -0x8(%rbp), %r9
movl $0x1f, %edx
movl $0x8, %ecx
callq 0x4190
movl %eax, -0x28(%rbp)
movq -0x8(%rbp), %rax
movl 0x28(%rax), %edi
callq 0x18790
leaq 0x2dc48(%rip), %rax     # 0x35dea
testb $0x1, (%rax)
je 0x81b3
movq -0x8(%rbp), %rax
movl 0x28(%rax), %edi
callq 0x16590
jmp 0x8228
movq -0x8(%rbp), %rax
movl 0x28(%rax), %edi
movq -0x10(%rbp), %rax
movw (%rax), %si
movq -0x10(%rbp), %rax
movw 0x2(%rax), %dx
movq -0x10(%rbp), %rax
movw 0x4(%rax), %cx
movq -0x10(%rbp), %rax
movswl %si, %esi
movswl %dx, %edx
movzwl %cx, %ecx
movzwl 0x6(%rax), %r8d
callq 0x16da0
movq -0x8(%rbp), %rax
movl 0x20(%rax), %edx
movq -0x10(%rbp), %rax
movzwl 0x4(%rax), %ecx
movq -0x10(%rbp), %rax
movzwl 0x6(%rax), %r8d
movq -0x10(%rbp), %rax
movswl (%rax), %r9d
movq -0x10(%rbp), %rax
movswl 0x2(%rax), %eax
movl $0x40, %edi
leaq 0x253cc(%rip), %rsi     # 0x2d5ea
movl %eax, (%rsp)
movb $0x0, %al
callq 0x2c0b0
movq -0x8(%rbp), %rax
movq 0x60(%rax), %rax
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
je 0x82a3
movq -0x30(%rbp), %rax
movq 0x30(%rax), %rdi
callq 0xbe70
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x38(%rbp)
je 0x8288
movq -0x38(%rbp), %rax
cmpq $0x0, 0x48(%rax)
jne 0x8260
jmp 0x8271
movq -0x10(%rbp), %rsi
movq -0x38(%rbp), %rdx
leaq -0x18(%rbp), %rdi
callq 0x82c0
movq -0x38(%rbp), %rdi
movq -0x30(%rbp), %rax
movq 0x30(%rax), %rsi
callq 0xbf80
movq %rax, -0x38(%rbp)
jmp 0x824c
movq -0x8(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0xafd0
movq -0x30(%rbp), %rax
movq 0x48(%rax), %rax
movq %rax, -0x30(%rbp)
jmp 0x8234
movq -0x8(%rbp), %rdi
callq 0x8630
addq $0x80, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)