// File: /workspace/github_c_makefile_star2_O0/bobrippling[P]tim/ui.c
// Function: ui_draw_win_1
static
void ui_draw_win_1(window *win)
{
	buffer_t *buf = win->buf;
	const region_t hlregion = {
		win->ui_npos,
		win->ui_vpos,
		ui_mode_to_region(win->ui_mode),
	};

	list_t *l;
	int y;
	for(y = 0, l = list_seek(buf->head, win->ui_start.y, 0);
			l && y < win->screen_coord.h;
			l = l->next, y++)
	{
		const int lim = l->len_line < (unsigned)win->screen_coord.w
			? l->len_line
			: (unsigned)win->screen_coord.w;

		nc_set_yx(win->screen_coord.y + y, win->screen_coord.x);
		nc_clrtoeol();

		for(int x = 0; x < lim; x++){
			int offhl = 0;
			const int real_y = win->ui_start.y + y;

			if(win->ui_mode & UI_VISUAL_ANY)
				nc_highlight(region_contains(
							&hlregion, x, real_y));

			if(point_eq(&win->ui_paren, (&(point_t){ .x=x, .y=real_y }))){
				nc_highlight(1);
				offhl = 1;
			}

			nc_addch(l->line[x]);

			if(offhl)
				nc_highlight(0);
		}

		nc_highlight(0);
	}

	nc_style(COL_BLUE | ATTR_BOLD);
	for(; y < win->screen_coord.h; y++){
		nc_set_yx(win->screen_coord.y + y, win->screen_coord.x);
		nc_addch('~');
		nc_clrtoeol();
	}
	nc_style(0);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq 0x20(%rax), %rax
movq %rax, -0x24(%rbp)
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rax
movq %rax, -0x1c(%rbp)
movq -0x8(%rbp), %rax
movl 0x40(%rax), %edi
callq 0x5ec0
movl %eax, -0x14(%rbp)
movl $0x0, -0x34(%rbp)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x8(%rbp), %rax
movl 0xc(%rax), %esi
xorl %edx, %edx
callq 0xcd50
movq %rax, -0x30(%rbp)
xorl %eax, %eax
cmpq $0x0, -0x30(%rbp)
movb %al, -0x4d(%rbp)
je 0x5d2b
movl -0x34(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0x1c(%rcx), %eax
setl %al
movb %al, -0x4d(%rbp)
movb -0x4d(%rbp), %al
testb $0x1, %al
jne 0x5d37
jmp 0x5e61
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x8(%rbp), %rcx
movl 0x18(%rcx), %ecx
cmpq %rcx, %rax
jae 0x5d59
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x58(%rbp)
jmp 0x5d64
movq -0x8(%rbp), %rax
movl 0x18(%rax), %eax
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rax
movl %eax, -0x38(%rbp)
movq -0x8(%rbp), %rax
movl 0x14(%rax), %edi
addl -0x34(%rbp), %edi
movq -0x8(%rbp), %rax
movl 0x10(%rax), %esi
callq 0x4b90
callq 0x4e90
movl $0x0, -0x3c(%rbp)
movl -0x3c(%rbp), %eax
cmpl -0x38(%rbp), %eax
jge 0x5e40
movl $0x0, -0x40(%rbp)
movq -0x8(%rbp), %rax
movl 0xc(%rax), %eax
addl -0x34(%rbp), %eax
movl %eax, -0x44(%rbp)
movq -0x8(%rbp), %rax
movl 0x40(%rax), %eax
andl $0x38, %eax
cmpl $0x0, %eax
je 0x5dd5
movl -0x3c(%rbp), %esi
movl -0x44(%rbp), %edx
leaq -0x24(%rbp), %rdi
callq 0x11e90
andb $0x1, %al
movzbl %al, %edi
callq 0x4a40
movq -0x8(%rbp), %rax
addq $0x38, %rax
movl -0x3c(%rbp), %ecx
movl %ecx, -0x4c(%rbp)
movl -0x44(%rbp), %ecx
movl %ecx, -0x48(%rbp)
movq (%rax), %rax
movq -0x4c(%rbp), %rcx
subq %rcx, %rax
setne %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0x5e0f
movl $0x1, %edi
callq 0x4a40
movl $0x1, -0x40(%rbp)
movq -0x30(%rbp), %rax
movq (%rax), %rax
movslq -0x3c(%rbp), %rcx
movsbl (%rax,%rcx), %edi
callq 0x4cf0
cmpl $0x0, -0x40(%rbp)
je 0x5e30
xorl %edi, %edi
callq 0x4a40
jmp 0x5e32
movl -0x3c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x3c(%rbp)
jmp 0x5d8d
xorl %edi, %edi
callq 0x4a40
movq -0x30(%rbp), %rax
movq 0x18(%rax), %rax
movq %rax, -0x30(%rbp)
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x5d0f
movl $0x3, %edi
callq 0x4d70
movl -0x34(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0x1c(%rcx), %eax
jge 0x5ea7
movq -0x8(%rbp), %rax
movl 0x14(%rax), %edi
addl -0x34(%rbp), %edi
movq -0x8(%rbp), %rax
movl 0x10(%rax), %esi
callq 0x4b90
movl $0x7e, %edi
callq 0x4cf0
callq 0x4e90
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x5e6b
xorl %edi, %edi
callq 0x4d70
addq $0x60, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)