// File: /workspace/github_c_makefile_star2_O0/kasymovga[P]devilwm/screen.c
// Function: next_border
void next_border(Client *c, int dirx, int diry, int step_over, int *borderx, int *bordery) {
	Client * c_iter;
	struct list *iter;
	int tx, ty, c_iter_height, c_iter_width, c_iter_x, c_iter_y;
	int c_width = c->width + c->border * 2;
	int c_height = c->height + c->border * 2;
	int c_x = c->x - c->border;
	int c_y = c->y - c->border;
	int dummyx, dummyy;
	find_monitors(c);
	if (!borderx)
		borderx = &dummyx;

	if (!bordery)
		bordery = &dummyy;

	if (dirx > 0)
		*borderx = DisplayWidth(dpy, c->screen->screen);
	else
		*borderx = 0;

	if (diry > 0)
		*bordery = DisplayHeight(dpy, c->screen->screen);
	else
		*bordery = 0;

	if (dirx) {
		for (iter = clients_tab_order; iter; iter = iter->next) {
			c_iter =iter->data;
			if (c->screen != c_iter->screen || c_iter == c
#ifdef VWM
					|| c_iter->vdesk != c->vdesk
#endif
					)
				continue;

			c_iter_height = c_iter->height + c_iter->border * 2;
			c_iter_width = c_iter->width + c_iter->border * 2;
			c_iter_x = c_iter->x - c_iter->border;
			c_iter_y = c_iter->y - c_iter->border;
			if (
					(c_iter_y <= c_y            && c_iter_y + c_iter_height >= c_y           ) ||
					(c_iter_y <= c_y + c_height && c_iter_y + c_iter_height >= c_y + c_height) ||
					(c_iter_y >= c_y            && c_iter_y + c_iter_height <= c_y + c_height)
					) {
				if (dirx > 0) {
					tx = c_iter_x;
					if (tx - step_over >= c_x + c_width && tx < *borderx)
						*borderx = tx;

				} else {
					tx = c_iter_x + c_iter_width;
					if (tx + step_over <= c_x && tx > *borderx)
						*borderx = tx;

				}
			}
		}
		for (int i = 0; i < monitors_count; i++) {
			if (dirx > 0) {
				if (monitors[i].x + monitors[i].width > c_x + c_width && monitors[i].x + monitors[i].width < *borderx)
					*borderx = monitors[i].x + monitors[i].width;
			} else {
				if (monitors[i].x < c_x && monitors[i].x > *borderx)
					*borderx = monitors[i].x;
			}
		}
		if (dirx > 0)
			c_width = *borderx - c_x;
		else {
			c_width = c_width + c_x - *borderx;
			c_x = *borderx;
		}
	}
	if (diry) {
		for (iter = clients_tab_order; iter; iter = iter->next) {
			c_iter=iter->data;
			if (c->screen != c_iter->screen || c_iter == c
#ifdef VWM
					|| c_iter->vdesk != c->vdesk
#endif
			)
				continue;

			c_iter_height = c_iter->height + c_iter->border * 2;
			c_iter_width = c_iter->width + c_iter->border * 2;
			c_iter_x = c_iter->x - c_iter->border;
			c_iter_y = c_iter->y - c_iter->border;
			if (
					(c_iter_x <= c_x           && c_iter_x + c_iter_width >= c_x          ) ||
					(c_iter_x <= c_x + c_width && c_iter_x + c_iter_width >= c_x + c_width) ||
					(c_iter_x >= c_x           && c_iter_x + c_iter_width <= c_x + c_width)
					) {
				if (diry > 0) {
					ty = c_iter_y;
					if (ty - step_over >= c_y + c_height && ty < *bordery)
						*bordery = ty;
				} else {
					ty = c_iter_y + c_iter_height;
					if (ty + step_over <= c_y && ty > *bordery)
						*bordery = ty;
				}
			}
		}
		for (int i = 0; i < monitors_count; i++) {
			if (diry > 0) {
				if (monitors[i].y + monitors[i].height > c_y + c_height && monitors[i].y + monitors[i].height < *bordery)
					*bordery = monitors[i].y + monitors[i].height;
			} else {
				if (monitors[i].y < c_y && monitors[i].y > *bordery)
					*bordery = monitors[i].y;
			}
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movl %ecx, -0x14(%rbp)
movq %r8, -0x20(%rbp)
movq %r9, -0x28(%rbp)
movq -0x8(%rbp), %rax
movl 0x2c(%rax), %eax
movq -0x8(%rbp), %rcx
movl 0x34(%rcx), %ecx
shll %ecx
addl %ecx, %eax
movl %eax, -0x54(%rbp)
movq -0x8(%rbp), %rax
movl 0x30(%rax), %eax
movq -0x8(%rbp), %rcx
movl 0x34(%rcx), %ecx
shll %ecx
addl %ecx, %eax
movl %eax, -0x58(%rbp)
movq -0x8(%rbp), %rax
movl 0x24(%rax), %eax
movq -0x8(%rbp), %rcx
subl 0x34(%rcx), %eax
movl %eax, -0x5c(%rbp)
movq -0x8(%rbp), %rax
movl 0x28(%rax), %eax
movq -0x8(%rbp), %rcx
subl 0x34(%rcx), %eax
movl %eax, -0x60(%rbp)
movq -0x8(%rbp), %rdi
callq 0x9820
cmpq $0x0, -0x20(%rbp)
jne 0xaf91
leaq -0x64(%rbp), %rax
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x28(%rbp)
jne 0xafa0
leaq -0x68(%rbp), %rax
movq %rax, -0x28(%rbp)
cmpl $0x0, -0xc(%rbp)
jle 0xafd4
leaq 0x5a6b(%rip), %rax      # 0x10a18
movq (%rax), %rax
movq 0xe8(%rax), %rax
movq -0x8(%rbp), %rcx
movq 0x10(%rcx), %rcx
movslq (%rcx), %rcx
shlq $0x7, %rcx
addq %rcx, %rax
movl 0x18(%rax), %ecx
movq -0x20(%rbp), %rax
movl %ecx, (%rax)
jmp 0xafde
movq -0x20(%rbp), %rax
movl $0x0, (%rax)
cmpl $0x0, -0x10(%rbp)
jle 0xb012
leaq 0x5a2d(%rip), %rax      # 0x10a18
movq (%rax), %rax
movq 0xe8(%rax), %rax
movq -0x8(%rbp), %rcx
movq 0x10(%rcx), %rcx
movslq (%rcx), %rcx
shlq $0x7, %rcx
addq %rcx, %rax
movl 0x1c(%rax), %ecx
movq -0x28(%rbp), %rax
movl %ecx, (%rax)
jmp 0xb01c
movq -0x28(%rbp), %rax
movl $0x0, (%rax)
cmpl $0x0, -0xc(%rbp)
je 0xb2c4
leaq 0x59a3(%rip), %rax      # 0x109d0
movq (%rax), %rax
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x38(%rbp)
je 0xb180
movq -0x38(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x30(%rbp), %rcx
cmpq 0x10(%rcx), %rax
jne 0xb077
movq -0x30(%rbp), %rax
cmpq -0x8(%rbp), %rax
je 0xb077
movq -0x30(%rbp), %rax
movl 0x78(%rax), %eax
movq -0x8(%rbp), %rcx
cmpl 0x78(%rcx), %eax
je 0xb07c
jmp 0xb170
movq -0x30(%rbp), %rax
movl 0x30(%rax), %eax
movq -0x30(%rbp), %rcx
movl 0x34(%rcx), %ecx
shll %ecx
addl %ecx, %eax
movl %eax, -0x44(%rbp)
movq -0x30(%rbp), %rax
movl 0x2c(%rax), %eax
movq -0x30(%rbp), %rcx
movl 0x34(%rcx), %ecx
shll %ecx
addl %ecx, %eax
movl %eax, -0x48(%rbp)
movq -0x30(%rbp), %rax
movl 0x24(%rax), %eax
movq -0x30(%rbp), %rcx
subl 0x34(%rcx), %eax
movl %eax, -0x4c(%rbp)
movq -0x30(%rbp), %rax
movl 0x28(%rax), %eax
movq -0x30(%rbp), %rcx
subl 0x34(%rcx), %eax
movl %eax, -0x50(%rbp)
movl -0x50(%rbp), %eax
cmpl -0x60(%rbp), %eax
jg 0xb0db
movl -0x50(%rbp), %eax
addl -0x44(%rbp), %eax
cmpl -0x60(%rbp), %eax
jge 0xb110
movl -0x50(%rbp), %eax
movl -0x60(%rbp), %ecx
addl -0x58(%rbp), %ecx
cmpl %ecx, %eax
jg 0xb0f8
movl -0x50(%rbp), %eax
addl -0x44(%rbp), %eax
movl -0x60(%rbp), %ecx
addl -0x58(%rbp), %ecx
cmpl %ecx, %eax
jge 0xb110
movl -0x50(%rbp), %eax
cmpl -0x60(%rbp), %eax
jl 0xb16e
movl -0x50(%rbp), %eax
addl -0x44(%rbp), %eax
movl -0x60(%rbp), %ecx
addl -0x58(%rbp), %ecx
cmpl %ecx, %eax
jg 0xb16e
cmpl $0x0, -0xc(%rbp)
jle 0xb142
movl -0x4c(%rbp), %eax
movl %eax, -0x3c(%rbp)
movl -0x3c(%rbp), %eax
subl -0x14(%rbp), %eax
movl -0x5c(%rbp), %ecx
addl -0x54(%rbp), %ecx
cmpl %ecx, %eax
jl 0xb140
movl -0x3c(%rbp), %eax
movq -0x20(%rbp), %rcx
cmpl (%rcx), %eax
jge 0xb140
movl -0x3c(%rbp), %ecx
movq -0x20(%rbp), %rax
movl %ecx, (%rax)
jmp 0xb16c
movl -0x4c(%rbp), %eax
addl -0x48(%rbp), %eax
movl %eax, -0x3c(%rbp)
movl -0x3c(%rbp), %eax
addl -0x14(%rbp), %eax
cmpl -0x5c(%rbp), %eax
jg 0xb16a
movl -0x3c(%rbp), %eax
movq -0x20(%rbp), %rcx
cmpl (%rcx), %eax
jle 0xb16a
movl -0x3c(%rbp), %ecx
movq -0x20(%rbp), %rax
movl %ecx, (%rax)
jmp 0xb16c
jmp 0xb16e
jmp 0xb170
movq -0x38(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x38(%rbp)
jmp 0xb034
movl $0x0, -0x6c(%rbp)
movl -0x6c(%rbp), %eax
cmpl 0x58e0(%rip), %eax      # 0x10a70
jge 0xb296
cmpl $0x0, -0xc(%rbp)
jle 0xb235
movq 0x58c1(%rip), %rax      # 0x10a68
movslq -0x6c(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movl (%rax), %eax
movq 0x58ad(%rip), %rcx      # 0x10a68
movslq -0x6c(%rbp), %rdx
shlq $0x4, %rdx
addq %rdx, %rcx
addl 0x8(%rcx), %eax
movl -0x5c(%rbp), %ecx
addl -0x54(%rbp), %ecx
cmpl %ecx, %eax
jle 0xb233
movq 0x588e(%rip), %rax      # 0x10a68
movslq -0x6c(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movl (%rax), %eax
movq 0x587a(%rip), %rcx      # 0x10a68
movslq -0x6c(%rbp), %rdx
shlq $0x4, %rdx
addq %rdx, %rcx
addl 0x8(%rcx), %eax
movq -0x20(%rbp), %rcx
cmpl (%rcx), %eax
jge 0xb233
movq 0x585d(%rip), %rax      # 0x10a68
movslq -0x6c(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movl (%rax), %ecx
movq 0x5849(%rip), %rax      # 0x10a68
movslq -0x6c(%rbp), %rdx
shlq $0x4, %rdx
addq %rdx, %rax
addl 0x8(%rax), %ecx
movq -0x20(%rbp), %rax
movl %ecx, (%rax)
jmp 0xb286
movq 0x582c(%rip), %rax      # 0x10a68
movslq -0x6c(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movl (%rax), %eax
cmpl -0x5c(%rbp), %eax
jge 0xb284
movq 0x5813(%rip), %rax      # 0x10a68
movslq -0x6c(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movl (%rax), %eax
movq -0x20(%rbp), %rcx
cmpl (%rcx), %eax
jle 0xb284
movq 0x57f7(%rip), %rax      # 0x10a68
movslq -0x6c(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movl (%rax), %ecx
movq -0x20(%rbp), %rax
movl %ecx, (%rax)
jmp 0xb286
jmp 0xb288
movl -0x6c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x6c(%rbp)
jmp 0xb187
cmpl $0x0, -0xc(%rbp)
jle 0xb2aa
movq -0x20(%rbp), %rax
movl (%rax), %eax
subl -0x5c(%rbp), %eax
movl %eax, -0x54(%rbp)
jmp 0xb2c2
movl -0x54(%rbp), %eax
addl -0x5c(%rbp), %eax
movq -0x20(%rbp), %rcx
subl (%rcx), %eax
movl %eax, -0x54(%rbp)
movq -0x20(%rbp), %rax
movl (%rax), %eax
movl %eax, -0x5c(%rbp)
jmp 0xb2c4
cmpl $0x0, -0x10(%rbp)
je 0xb546
leaq 0x56fb(%rip), %rax      # 0x109d0
movq (%rax), %rax
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x38(%rbp)
je 0xb428
movq -0x38(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x30(%rbp)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x30(%rbp), %rcx
cmpq 0x10(%rcx), %rax
jne 0xb31f
movq -0x30(%rbp), %rax
cmpq -0x8(%rbp), %rax
je 0xb31f
movq -0x30(%rbp), %rax
movl 0x78(%rax), %eax
movq -0x8(%rbp), %rcx
cmpl 0x78(%rcx), %eax
je 0xb324
jmp 0xb418
movq -0x30(%rbp), %rax
movl 0x30(%rax), %eax
movq -0x30(%rbp), %rcx
movl 0x34(%rcx), %ecx
shll %ecx
addl %ecx, %eax
movl %eax, -0x44(%rbp)
movq -0x30(%rbp), %rax
movl 0x2c(%rax), %eax
movq -0x30(%rbp), %rcx
movl 0x34(%rcx), %ecx
shll %ecx
addl %ecx, %eax
movl %eax, -0x48(%rbp)
movq -0x30(%rbp), %rax
movl 0x24(%rax), %eax
movq -0x30(%rbp), %rcx
subl 0x34(%rcx), %eax
movl %eax, -0x4c(%rbp)
movq -0x30(%rbp), %rax
movl 0x28(%rax), %eax
movq -0x30(%rbp), %rcx
subl 0x34(%rcx), %eax
movl %eax, -0x50(%rbp)
movl -0x4c(%rbp), %eax
cmpl -0x5c(%rbp), %eax
jg 0xb383
movl -0x4c(%rbp), %eax
addl -0x48(%rbp), %eax
cmpl -0x5c(%rbp), %eax
jge 0xb3b8
movl -0x4c(%rbp), %eax
movl -0x5c(%rbp), %ecx
addl -0x54(%rbp), %ecx
cmpl %ecx, %eax
jg 0xb3a0
movl -0x4c(%rbp), %eax
addl -0x48(%rbp), %eax
movl -0x5c(%rbp), %ecx
addl -0x54(%rbp), %ecx
cmpl %ecx, %eax
jge 0xb3b8
movl -0x4c(%rbp), %eax
cmpl -0x5c(%rbp), %eax
jl 0xb416
movl -0x4c(%rbp), %eax
addl -0x48(%rbp), %eax
movl -0x5c(%rbp), %ecx
addl -0x54(%rbp), %ecx
cmpl %ecx, %eax
jg 0xb416
cmpl $0x0, -0x10(%rbp)
jle 0xb3ea
movl -0x50(%rbp), %eax
movl %eax, -0x40(%rbp)
movl -0x40(%rbp), %eax
subl -0x14(%rbp), %eax
movl -0x60(%rbp), %ecx
addl -0x58(%rbp), %ecx
cmpl %ecx, %eax
jl 0xb3e8
movl -0x40(%rbp), %eax
movq -0x28(%rbp), %rcx
cmpl (%rcx), %eax
jge 0xb3e8
movl -0x40(%rbp), %ecx
movq -0x28(%rbp), %rax
movl %ecx, (%rax)
jmp 0xb414
movl -0x50(%rbp), %eax
addl -0x44(%rbp), %eax
movl %eax, -0x40(%rbp)
movl -0x40(%rbp), %eax
addl -0x14(%rbp), %eax
cmpl -0x60(%rbp), %eax
jg 0xb412
movl -0x40(%rbp), %eax
movq -0x28(%rbp), %rcx
cmpl (%rcx), %eax
jle 0xb412
movl -0x40(%rbp), %ecx
movq -0x28(%rbp), %rax
movl %ecx, (%rax)
jmp 0xb414
jmp 0xb416
jmp 0xb418
movq -0x38(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x38(%rbp)
jmp 0xb2dc
movl $0x0, -0x70(%rbp)
movl -0x70(%rbp), %eax
cmpl 0x5638(%rip), %eax      # 0x10a70
jge 0xb544
cmpl $0x0, -0x10(%rbp)
jle 0xb4e0
movq 0x5619(%rip), %rax      # 0x10a68
movslq -0x70(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movl 0x4(%rax), %eax
movq 0x5604(%rip), %rcx      # 0x10a68
movslq -0x70(%rbp), %rdx
shlq $0x4, %rdx
addq %rdx, %rcx
addl 0xc(%rcx), %eax
movl -0x60(%rbp), %ecx
addl -0x58(%rbp), %ecx
cmpl %ecx, %eax
jle 0xb4de
movq 0x55e5(%rip), %rax      # 0x10a68
movslq -0x70(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movl 0x4(%rax), %eax
movq 0x55d0(%rip), %rcx      # 0x10a68
movslq -0x70(%rbp), %rdx
shlq $0x4, %rdx
addq %rdx, %rcx
addl 0xc(%rcx), %eax
movq -0x28(%rbp), %rcx
cmpl (%rcx), %eax
jge 0xb4de
movq 0x55b3(%rip), %rax      # 0x10a68
movslq -0x70(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movl 0x4(%rax), %ecx
movq 0x559e(%rip), %rax      # 0x10a68
movslq -0x70(%rbp), %rdx
shlq $0x4, %rdx
addq %rdx, %rax
addl 0xc(%rax), %ecx
movq -0x28(%rbp), %rax
movl %ecx, (%rax)
jmp 0xb534
movq 0x5581(%rip), %rax      # 0x10a68
movslq -0x70(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movl 0x4(%rax), %eax
cmpl -0x60(%rbp), %eax
jge 0xb532
movq 0x5567(%rip), %rax      # 0x10a68
movslq -0x70(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movl 0x4(%rax), %eax
movq -0x28(%rbp), %rcx
cmpl (%rcx), %eax
jle 0xb532
movq 0x554a(%rip), %rax      # 0x10a68
movslq -0x70(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movl 0x4(%rax), %ecx
movq -0x28(%rbp), %rax
movl %ecx, (%rax)
jmp 0xb534
jmp 0xb536
movl -0x70(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x70(%rbp)
jmp 0xb42f
jmp 0xb546
addq $0x70, %rsp
popq %rbp
retq
nopl (%rax)