// File: /workspace/github_c_makefile_star2_O0/baskerville[P]bspwm/src/ewmh.c
// Function: ewmh_handle_struts
bool ewmh_handle_struts(xcb_window_t win)
{
	xcb_ewmh_wm_strut_partial_t struts;
	bool changed = false;
	if (xcb_ewmh_get_wm_strut_partial_reply(ewmh, xcb_ewmh_get_wm_strut_partial(ewmh, win), &struts, NULL) == 1) {
		for (monitor_t *m = mon_head; m != NULL; m = m->next) {
			xcb_rectangle_t rect = m->rectangle;
			if (rect.x < (int16_t) struts.left &&
			    (int16_t) struts.left < (rect.x + rect.width - 1) &&
			    (int16_t) struts.left_end_y >= rect.y &&
			    (int16_t) struts.left_start_y < (rect.y + rect.height)) {
				int dx = struts.left - rect.x;
				if (m->padding.left < 0) {
					m->padding.left += dx;
				} else {
					m->padding.left = MAX(dx, m->padding.left);
				}
				changed = true;
			}
			if ((rect.x + rect.width) > (int16_t) (screen_width - struts.right) &&
			    (int16_t) (screen_width - struts.right) > rect.x &&
			    (int16_t) struts.right_end_y >= rect.y &&
			    (int16_t) struts.right_start_y < (rect.y + rect.height)) {
				int dx = (rect.x + rect.width) - screen_width + struts.right;
				if (m->padding.right < 0) {
					m->padding.right += dx;
				} else {
					m->padding.right = MAX(dx, m->padding.right);
				}
				changed = true;
			}
			if (rect.y < (int16_t) struts.top &&
			    (int16_t) struts.top < (rect.y + rect.height - 1) &&
			    (int16_t) struts.top_end_x >= rect.x &&
			    (int16_t) struts.top_start_x < (rect.x + rect.width)) {
				int dy = struts.top - rect.y;
				if (m->padding.top < 0) {
					m->padding.top += dy;
				} else {
					m->padding.top = MAX(dy, m->padding.top);
				}
				changed = true;
			}
			if ((rect.y + rect.height) > (int16_t) (screen_height - struts.bottom) &&
			    (int16_t) (screen_height - struts.bottom) > rect.y &&
			    (int16_t) struts.bottom_end_x >= rect.x &&
			    (int16_t) struts.bottom_start_x < (rect.x + rect.width)) {
				int dy = (rect.y + rect.height) - screen_height + struts.bottom;
				if (m->padding.bottom < 0) {
					m->padding.bottom += dy;
				} else {
					m->padding.bottom = MAX(dy, m->padding.bottom);
				}
				changed = true;
			}
		}
	}
	return changed;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movl %edi, -0x4(%rbp)
movb $0x0, -0x35(%rbp)
movq 0xab07(%rip), %rax      # 0x35e20
movq %rax, -0x68(%rbp)
movq 0xaafc(%rip), %rdi      # 0x35e20
movl -0x4(%rbp), %esi
callq 0x4480
movq -0x68(%rbp), %rdi
movl %eax, -0x3c(%rbp)
movl -0x3c(%rbp), %esi
leaq -0x34(%rbp), %rdx
xorl %eax, %eax
movl %eax, %ecx
callq 0x4570
movzbl %al, %eax
cmpl $0x1, %eax
jne 0x2b619
leaq 0xa3a2(%rip), %rax      # 0x356f8
movq (%rax), %rax
movq %rax, -0x48(%rbp)
cmpq $0x0, -0x48(%rbp)
je 0x2b617
movq -0x48(%rbp), %rax
movq 0x4c(%rax), %rax
movq %rax, -0x50(%rbp)
movswl -0x50(%rbp), %eax
movl -0x34(%rbp), %ecx
movswl %cx, %ecx
cmpl %ecx, %eax
jge 0x2b40a
movl -0x34(%rbp), %eax
cwtl
movswl -0x50(%rbp), %ecx
movzwl -0x4c(%rbp), %edx
addl %edx, %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jge 0x2b40a
movl -0x20(%rbp), %eax
cwtl
movswl -0x4e(%rbp), %ecx
cmpl %ecx, %eax
jl 0x2b40a
movl -0x24(%rbp), %eax
cwtl
movswl -0x4e(%rbp), %ecx
movzwl -0x4a(%rbp), %edx
addl %edx, %ecx
cmpl %ecx, %eax
jge 0x2b40a
movl -0x34(%rbp), %eax
movswl -0x50(%rbp), %ecx
subl %ecx, %eax
movl %eax, -0x54(%rbp)
movq -0x48(%rbp), %rax
cmpl $0x0, 0x3c(%rax)
jge 0x2b3de
movl -0x54(%rbp), %ecx
movq -0x48(%rbp), %rax
addl 0x3c(%rax), %ecx
movl %ecx, 0x3c(%rax)
jmp 0x2b406
movl -0x54(%rbp), %eax
movq -0x48(%rbp), %rcx
cmpl 0x3c(%rcx), %eax
jle 0x2b3f2
movl -0x54(%rbp), %eax
movl %eax, -0x6c(%rbp)
jmp 0x2b3fc
movq -0x48(%rbp), %rax
movl 0x3c(%rax), %eax
movl %eax, -0x6c(%rbp)
movl -0x6c(%rbp), %ecx
movq -0x48(%rbp), %rax
movl %ecx, 0x3c(%rax)
movb $0x1, -0x35(%rbp)
movswl -0x50(%rbp), %eax
movzwl -0x4c(%rbp), %ecx
addl %ecx, %eax
leaq 0xa351(%rip), %rcx      # 0x3576c
movl (%rcx), %ecx
subl -0x30(%rbp), %ecx
movswl %cx, %ecx
cmpl %ecx, %eax
jle 0x2b4bc
leaq 0xa33a(%rip), %rax      # 0x3576c
movl (%rax), %eax
subl -0x30(%rbp), %eax
cwtl
movswl -0x50(%rbp), %ecx
cmpl %ecx, %eax
jle 0x2b4bc
movl -0x18(%rbp), %eax
cwtl
movswl -0x4e(%rbp), %ecx
cmpl %ecx, %eax
jl 0x2b4bc
movl -0x1c(%rbp), %eax
cwtl
movswl -0x4e(%rbp), %ecx
movzwl -0x4a(%rbp), %edx
addl %edx, %ecx
cmpl %ecx, %eax
jge 0x2b4bc
movswl -0x50(%rbp), %eax
movzwl -0x4c(%rbp), %ecx
addl %ecx, %eax
leaq 0xa2fd(%rip), %rcx      # 0x3576c
subl (%rcx), %eax
addl -0x30(%rbp), %eax
movl %eax, -0x58(%rbp)
movq -0x48(%rbp), %rax
cmpl $0x0, 0x34(%rax)
jge 0x2b490
movl -0x58(%rbp), %ecx
movq -0x48(%rbp), %rax
addl 0x34(%rax), %ecx
movl %ecx, 0x34(%rax)
jmp 0x2b4b8
movl -0x58(%rbp), %eax
movq -0x48(%rbp), %rcx
cmpl 0x34(%rcx), %eax
jle 0x2b4a4
movl -0x58(%rbp), %eax
movl %eax, -0x70(%rbp)
jmp 0x2b4ae
movq -0x48(%rbp), %rax
movl 0x34(%rax), %eax
movl %eax, -0x70(%rbp)
movl -0x70(%rbp), %ecx
movq -0x48(%rbp), %rax
movl %ecx, 0x34(%rax)
movb $0x1, -0x35(%rbp)
movswl -0x4e(%rbp), %eax
movl -0x2c(%rbp), %ecx
movswl %cx, %ecx
cmpl %ecx, %eax
jge 0x2b552
movl -0x2c(%rbp), %eax
cwtl
movswl -0x4e(%rbp), %ecx
movzwl -0x4a(%rbp), %edx
addl %edx, %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jge 0x2b552
movl -0x10(%rbp), %eax
cwtl
movswl -0x50(%rbp), %ecx
cmpl %ecx, %eax
jl 0x2b552
movl -0x14(%rbp), %eax
cwtl
movswl -0x50(%rbp), %ecx
movzwl -0x4c(%rbp), %edx
addl %edx, %ecx
cmpl %ecx, %eax
jge 0x2b552
movl -0x2c(%rbp), %eax
movswl -0x4e(%rbp), %ecx
subl %ecx, %eax
movl %eax, -0x5c(%rbp)
movq -0x48(%rbp), %rax
cmpl $0x0, 0x30(%rax)
jge 0x2b526
movl -0x5c(%rbp), %ecx
movq -0x48(%rbp), %rax
addl 0x30(%rax), %ecx
movl %ecx, 0x30(%rax)
jmp 0x2b54e
movl -0x5c(%rbp), %eax
movq -0x48(%rbp), %rcx
cmpl 0x30(%rcx), %eax
jle 0x2b53a
movl -0x5c(%rbp), %eax
movl %eax, -0x74(%rbp)
jmp 0x2b544
movq -0x48(%rbp), %rax
movl 0x30(%rax), %eax
movl %eax, -0x74(%rbp)
movl -0x74(%rbp), %ecx
movq -0x48(%rbp), %rax
movl %ecx, 0x30(%rax)
movb $0x1, -0x35(%rbp)
movswl -0x4e(%rbp), %eax
movzwl -0x4a(%rbp), %ecx
addl %ecx, %eax
leaq 0xa20d(%rip), %rcx      # 0x35770
movl (%rcx), %ecx
subl -0x28(%rbp), %ecx
movswl %cx, %ecx
cmpl %ecx, %eax
jle 0x2b604
leaq 0xa1f6(%rip), %rax      # 0x35770
movl (%rax), %eax
subl -0x28(%rbp), %eax
cwtl
movswl -0x4e(%rbp), %ecx
cmpl %ecx, %eax
jle 0x2b604
movl -0x8(%rbp), %eax
cwtl
movswl -0x50(%rbp), %ecx
cmpl %ecx, %eax
jl 0x2b604
movl -0xc(%rbp), %eax
cwtl
movswl -0x50(%rbp), %ecx
movzwl -0x4c(%rbp), %edx
addl %edx, %ecx
cmpl %ecx, %eax
jge 0x2b604
movswl -0x4e(%rbp), %eax
movzwl -0x4a(%rbp), %ecx
addl %ecx, %eax
leaq 0xa1b9(%rip), %rcx      # 0x35770
subl (%rcx), %eax
addl -0x28(%rbp), %eax
movl %eax, -0x60(%rbp)
movq -0x48(%rbp), %rax
cmpl $0x0, 0x38(%rax)
jge 0x2b5d8
movl -0x60(%rbp), %ecx
movq -0x48(%rbp), %rax
addl 0x38(%rax), %ecx
movl %ecx, 0x38(%rax)
jmp 0x2b600
movl -0x60(%rbp), %eax
movq -0x48(%rbp), %rcx
cmpl 0x38(%rcx), %eax
jle 0x2b5ec
movl -0x60(%rbp), %eax
movl %eax, -0x78(%rbp)
jmp 0x2b5f6
movq -0x48(%rbp), %rax
movl 0x38(%rax), %eax
movl %eax, -0x78(%rbp)
movl -0x78(%rbp), %ecx
movq -0x48(%rbp), %rax
movl %ecx, 0x38(%rax)
movb $0x1, -0x35(%rbp)
jmp 0x2b606
movq -0x48(%rbp), %rax
movq 0x78(%rax), %rax
movq %rax, -0x48(%rbp)
jmp 0x2b35d
jmp 0x2b619
movb -0x35(%rbp), %al
andb $0x1, %al
addq $0x80, %rsp
popq %rbp
retq
nopw (%rax,%rax)