// File: /workspace/github_c_makefile_star2_O0/bobrippling[P]tim/keys.c
// Function: k_winmove
void k_winmove(const keyarg_u *a, unsigned repeat, const int from_ch)
{
	enum neighbour dir = pos2dir(&a->pos);
	int count = 0;

	window *w;
	ITER_WINDOWS(w){
		count++;
		if(count == 2){
			/* now have >1 */
			break;
		}
	}
	if(count < 2)
		return;

	w = windows_cur();
	window *target = window_next(w);

	window_evict(w);

	switch(dir){
		case neighbour_up:
			for(; target->neighbours.above;
					target = target->neighbours.above);
			break;

		case neighbour_down:
			for(; target->neighbours.below;
					target = target->neighbours.below);
			break;

		case neighbour_right:
			for(; target->neighbours.above;
					target = target->neighbours.above);
			for(; target->neighbours.right;
					target = target->neighbours.right);
			break;

		case neighbour_left:
			for(; target->neighbours.above;
					target = target->neighbours.above);
			for(; target->neighbours.left;
					target = target->neighbours.left);
			break;
	}

	window_add_neighbour(target, dir, w);

	ui_redraw();
	ui_cur_changed();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movq -0x8(%rbp), %rdi
callq 0x8180
movl %eax, -0x14(%rbp)
movl $0x0, -0x18(%rbp)
callq 0x13c60
movq %rax, %rdi
callq 0x13010
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0x74a5
movq -0x28(%rbp), %rax
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0x7495
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
cmpl $0x2, -0x18(%rbp)
jne 0x7485
jmp 0x7495
jmp 0x7487
movq -0x20(%rbp), %rax
movq 0x58(%rax), %rax
movq %rax, -0x20(%rbp)
jmp 0x746d
jmp 0x7497
movq -0x28(%rbp), %rax
movq 0x50(%rax), %rax
movq %rax, -0x28(%rbp)
jmp 0x745e
cmpl $0x2, -0x18(%rbp)
jge 0x74b0
jmp 0x75c7
callq 0x13c60
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
callq 0x12f90
movq %rax, -0x30(%rbp)
movq -0x20(%rbp), %rdi
callq 0x130f0
movl -0x14(%rbp), %eax
movq %rax, -0x38(%rbp)
subq $0x3, %rax
ja 0x75ad
movq -0x38(%rbp), %rax
leaq 0xdcad(%rip), %rcx      # 0x15198
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
jmp 0x74f6
movq -0x30(%rbp), %rax
cmpq $0x0, 0x60(%rax)
je 0x7511
jmp 0x7503
movq -0x30(%rbp), %rax
movq 0x60(%rax), %rax
movq %rax, -0x30(%rbp)
jmp 0x74f6
jmp 0x75ad
jmp 0x7518
movq -0x30(%rbp), %rax
cmpq $0x0, 0x58(%rax)
je 0x7533
jmp 0x7525
movq -0x30(%rbp), %rax
movq 0x58(%rax), %rax
movq %rax, -0x30(%rbp)
jmp 0x7518
jmp 0x75ad
jmp 0x7537
movq -0x30(%rbp), %rax
cmpq $0x0, 0x60(%rax)
je 0x7552
jmp 0x7544
movq -0x30(%rbp), %rax
movq 0x60(%rax), %rax
movq %rax, -0x30(%rbp)
jmp 0x7537
jmp 0x7554
movq -0x30(%rbp), %rax
cmpq $0x0, 0x50(%rax)
je 0x756f
jmp 0x7561
movq -0x30(%rbp), %rax
movq 0x50(%rax), %rax
movq %rax, -0x30(%rbp)
jmp 0x7554
jmp 0x75ad
jmp 0x7573
movq -0x30(%rbp), %rax
cmpq $0x0, 0x60(%rax)
je 0x758e
jmp 0x7580
movq -0x30(%rbp), %rax
movq 0x60(%rax), %rax
movq %rax, -0x30(%rbp)
jmp 0x7573
jmp 0x7590
movq -0x30(%rbp), %rax
cmpq $0x0, 0x48(%rax)
je 0x75ab
jmp 0x759d
movq -0x30(%rbp), %rax
movq 0x48(%rax), %rax
movq %rax, -0x30(%rbp)
jmp 0x7590
jmp 0x75ad
movq -0x30(%rbp), %rdi
movl -0x14(%rbp), %esi
movq -0x20(%rbp), %rdx
callq 0x133a0
callq 0x4fd0
callq 0x5050
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax)