// File: /workspace/github_c_makefile_star2_O1/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 %r14
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 0x23b4b(%rip), %rax     # 0x29ddc
movl (%rax), %eax
cmpl $0x1, %eax
je 0x62c8
testl %eax, %eax
jne 0x6362
cmpl $0x3, %edx
ja 0x6362
movl %edx, %eax
leaq 0x19116(%rip), %r14     # 0x1f3c8
movslq (%r14,%rax,4), %rax
addq %r14, %rax
jmpq *%rax
movswl %r10w, %eax
cmpl %eax, %esi
jle 0x631c
jmp 0x6362
cmpl $0x3, %edx
ja 0x6362
movl %edx, %eax
leaq 0x190de(%rip), %r14     # 0x1f3b8
movslq (%r14,%rax,4), %rax
addq %r14, %rax
jmpq *%rax
cmpl %edi, %esi
jl 0x631c
jmp 0x6362
movswl %bx, %eax
cmpl %eax, %edi
jle 0x631c
jmp 0x6362
cmpw %r10w, %bx
jg 0x631c
jmp 0x6362
movswl %r11w, %eax
cmpl %eax, %ecx
jle 0x631c
jmp 0x6362
movswl %r8w, %eax
cmpl %eax, %r9d
jle 0x631c
jmp 0x6362
cmpw %r8w, %r11w
jg 0x631c
jmp 0x6362
cmpl %ecx, %r9d
jge 0x6362
cmpl $0x3, %edx
ja 0x6362
movl %edx, %eax
leaq 0x190ae(%rip), %rdx     # 0x1f3d8
movslq (%rdx,%rax,4), %rax
addq %rdx, %rax
jmpq *%rax
movb $0x1, %al
cmpl %ecx, %r9d
jl 0x6343
movswl %r8w, %edx
cmpl %edx, %r9d
jle 0x6364
movswl %r11w, %edx
cmpl %edx, %ecx
jg 0x6351
cmpw %r8w, %r11w
jle 0x6364
cmpl %ecx, %r9d
setl %sil
cmpl %edx, %ecx
setl %al
andb %sil, %al
jmp 0x6364
xorl %eax, %eax
popq %rbx
popq %r14
retq
cmpl %edi, %esi
jl 0x6376
movswl %r10w, %ecx
movb $0x1, %al
cmpl %ecx, %esi
jle 0x6364
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 0x6364