// File: /workspace/github_c_makefile_star2_O2/baskerville[P]bspwm/src/geometry.c
// Function: on_dir_side
bool on_dir_side(xcb_rectangle_t r1, xcb_rectangle_t r2, direction_t dir)
{
	xcb_point_t r1_max = {r1.x + r1.width - 1, r1.y + r1.height - 1};
	xcb_point_t r2_max = {r2.x + r2.width - 1, r2.y + r2.height - 1};

	/* Eliminate rectangles on the opposite side */
	switch (directional_focus_tightness) {
		case TIGHTNESS_LOW:
			switch (dir) {
				case DIR_NORTH:
					if (r2.y > r1_max.y) {
						return false;
					}
					break;
				case DIR_WEST:
					if (r2.x > r1_max.x) {
						return false;
					}
					break;
				case DIR_SOUTH:
					if (r2_max.y < r1.y) {
						return false;
					}
					break;
				case DIR_EAST:
					if (r2_max.x < r1.x) {
						return false;
					}
					break;
				default:
					return false;
			}
			break;
		case TIGHTNESS_HIGH:
			switch (dir) {
				case DIR_NORTH:
					if (r2.y >= r1.y) {
						return false;
					}
					break;
				case DIR_WEST:
					if (r2.x >= r1.x) {
						return false;
					}
					break;
				case DIR_SOUTH:
					if (r2_max.y <= r1_max.y) {
						return false;
					}
					break;
				case DIR_EAST:
					if (r2_max.x <= r1_max.x) {
						return false;
					}
					break;
				default:
					return false;
			}
			break;
		default:
			return false;
	}

	/* Is there a shared vertical/horizontal range? */
	switch (dir) {
		case DIR_NORTH:
		case DIR_SOUTH:
			return
				(r2.x >= r1.x && r2.x <= r1_max.x) ||
				(r2_max.x >= r1.x && r2_max.x <= r1_max.x) ||
				(r1.x > r2.x && r1.x < r2_max.x);
			break;
		case DIR_WEST:
		case DIR_EAST:
			return
				(r2.y >= r1.y && r2.y <= r1_max.y) ||
				(r2_max.y >= r1.y && r2_max.y <= r1_max.y) ||
				(r1.y > r2.y && r1_max.y < r2_max.y);
			break;
		default:
			return false;
	}
}

// Assembly:
pushq %rbx
movq %rdi, %rax
shrq $0x20, %rax
movq %rdi, %r9
shrq $0x30, %r9
movq %rsi, %r11
shrq $0x20, %r11
movq %rsi, %rbx
shrq $0x30, %rbx
movswl %di, %ecx
leal (%rax,%rdi), %r8d
decl %r8d
sarl $0x10, %edi
leal (%rdi,%r9), %r10d
decl %r10d
movswl %si, %r9d
addl %esi, %r11d
decl %r11d
sarl $0x10, %esi
addl %esi, %ebx
decl %ebx
leaq 0x22c63(%rip), %rax     # 0x28ddc
movl (%rax), %eax
cmpl $0x1, %eax
je 0x61a9
testl %eax, %eax
jne 0x620c
cmpl $0x3, %edx
ja 0x620c
movl %edx, %eax
leaq 0x18232(%rip), %rdx     # 0x1e3c8
movslq (%rdx,%rax,4), %rax
addq %rdx, %rax
jmpq *%rax
movswl %r10w, %eax
cmpl %eax, %esi
jle 0x61d5
jmp 0x620c
cmpl $0x3, %edx
ja 0x620c
movl %edx, %eax
leaq 0x18201(%rip), %rdx     # 0x1e3b8
movslq (%rdx,%rax,4), %rax
addq %rdx, %rax
jmpq *%rax
cmpl %edi, %esi
jl 0x61d5
jmp 0x620c
movswl %bx, %eax
cmpl %eax, %edi
jle 0x61d5
jmp 0x620c
cmpw %r10w, %bx
jle 0x620c
movb $0x1, %al
cmpl %ecx, %r9d
jl 0x61e5
movswl %r8w, %edx
cmpl %edx, %r9d
jle 0x620e
movswl %r11w, %edx
cmpl %edx, %ecx
jg 0x61f3
cmpw %r8w, %r11w
jle 0x620e
cmpl %ecx, %r9d
setl %sil
cmpl %edx, %ecx
setl %al
andb %sil, %al
jmp 0x620e
movswl %r11w, %eax
cmpl %eax, %ecx
jle 0x6221
xorl %eax, %eax
popq %rbx
retq
movswl %r8w, %eax
cmpl %eax, %r9d
jg 0x620c
jmp 0x6221
cmpw %r8w, %r11w
jle 0x620c
cmpl %edi, %esi
jl 0x622f
movswl %r10w, %ecx
movb $0x1, %al
cmpl %ecx, %esi
jle 0x620e
cmpl %edi, %esi
setl %cl
movswl %bx, %eax
cmpl %eax, %edi
setle %dl
cmpw %r10w, %bx
setle %al
setg %sil
andb %cl, %sil
andb %dl, %al
orb %sil, %al
jmp 0x620e
cmpl %ecx, %r9d
jge 0x620c
jmp 0x6221