// File: /workspace/github_c_makefile_star2_O0/jonof[P]jftekwar/jfbuild/src/osd.c
// Function: OSD_Draw
void OSD_Draw(void)
{
	unsigned topoffs;
	int row, lines, x, len;

	if (!osdvisible || !osdinited) return;

	topoffs = osdhead * osdcols;
	row = osdrows-1;
	lines = min( osdlines-osdhead, osdrows );

	clearbackground(osdcols,osdrows+1);

	for (; lines>0; lines--, row--) {
		drawosdstr(0,row,osdtext+topoffs,osdcols,osdtextshade,osdtextpal);
		topoffs+=osdcols;
	}

	drawosdchar(2,osdrows,'>',osdpromptshade,osdpromptpal);
	if (osdeditcaps) drawosdchar(0,osdrows,'C',osdpromptshade,osdpromptpal);

	len = min(osdcols-1-3, osdeditlen-osdeditwinstart);
	for (x=0; x<len; x++)
		drawosdchar(3+x,osdrows,osdeditbuf[osdeditwinstart+x],osdeditshade,osdeditpal);

	drawosdcursor(3+osdeditcursor-osdeditwinstart,osdrows,osdovertype,keytime);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
cmpb $0x0, 0x57d15d(%rip)    # 0x5eb2ac
je 0x6e15a
cmpb $0x0, 0x579140(%rip)    # 0x5e7298
jne 0x6e15f
jmp 0x6e32f
movl 0x57d16f(%rip), %eax    # 0x5eb2d4
imull 0x731a0(%rip), %eax     # 0xe130c
movl %eax, -0x4(%rbp)
movl 0x7319f(%rip), %eax     # 0xe1314
subl $0x1, %eax
movl %eax, -0x8(%rbp)
movl 0x7312f(%rip), %eax     # 0xe12b0
subl 0x57d14d(%rip), %eax    # 0x5eb2d4
cmpl 0x73187(%rip), %eax     # 0xe1314
jge 0x6e1a0
movl 0x7311b(%rip), %eax     # 0xe12b0
subl 0x57d139(%rip), %eax    # 0x5eb2d4
movl %eax, -0x18(%rbp)
jmp 0x6e1a9
movl 0x7316e(%rip), %eax     # 0xe1314
movl %eax, -0x18(%rbp)
movl -0x18(%rbp), %eax
movl %eax, -0xc(%rbp)
movq 0x7312a(%rip), %rax     # 0xe12e0
movl 0x73150(%rip), %edi     # 0xe130c
movl 0x73152(%rip), %esi     # 0xe1314
addl $0x1, %esi
callq *%rax
cmpl $0x0, -0xc(%rbp)
jle 0x6e21c
movq 0x730ec(%rip), %rax     # 0xe12c0
movl -0x8(%rbp), %esi
movl -0x4(%rbp), %ecx
leaq 0x5790bf(%rip), %rdx    # 0x5e72a0
addq %rcx, %rdx
movl 0x73122(%rip), %ecx     # 0xe130c
movl 0x57d0b7(%rip), %r8d    # 0x5eb2a8
movl 0x73108(%rip), %r9d     # 0xe1300
xorl %edi, %edi
callq *%rax
movl 0x7310a(%rip), %eax     # 0xe130c
addl -0x4(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0xc(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0xc(%rbp)
movl -0x8(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x8(%rbp)
jmp 0x6e1c7
movq 0x73095(%rip), %rax     # 0xe12b8
movl 0x730eb(%rip), %esi     # 0xe1314
movl 0x57d071(%rip), %ecx    # 0x5eb2a0
movl 0x730c2(%rip), %r8d     # 0xe12f8
movl $0x2, %edi
movl $0x3e, %edx
callq *%rax
cmpl $0x0, 0x57d083(%rip)    # 0x5eb2cc
je 0x6e26e
movq 0x73066(%rip), %rax     # 0xe12b8
movl 0x730bc(%rip), %esi     # 0xe1314
movl 0x57d042(%rip), %ecx    # 0x5eb2a0
movl 0x73093(%rip), %r8d     # 0xe12f8
xorl %edi, %edi
movl $0x43, %edx
callq *%rax
movl 0x73098(%rip), %eax     # 0xe130c
subl $0x1, %eax
subl $0x3, %eax
movl 0x57d05c(%rip), %ecx    # 0x5eb2dc
subl 0x57d052(%rip), %ecx    # 0x5eb2d8
cmpl %ecx, %eax
jge 0x6e29b
movl 0x7307c(%rip), %eax     # 0xe130c
subl $0x1, %eax
subl $0x3, %eax
movl %eax, -0x1c(%rbp)
jmp 0x6e2aa
movl 0x57d03b(%rip), %eax    # 0x5eb2dc
subl 0x57d031(%rip), %eax    # 0x5eb2d8
movl %eax, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
movl %eax, -0x14(%rbp)
movl $0x0, -0x10(%rbp)
movl -0x10(%rbp), %eax
cmpl -0x14(%rbp), %eax
jge 0x6e305
movq 0x72ff2(%rip), %rax     # 0xe12b8
movl -0x10(%rbp), %edi
addl $0x3, %edi
movl 0x73042(%rip), %esi     # 0xe1314
movl 0x57d000(%rip), %ecx    # 0x5eb2d8
addl -0x10(%rbp), %ecx
movslq %ecx, %rdx
leaq 0x57cffb(%rip), %rcx    # 0x5eb2e0
movb (%rcx,%rdx), %dl
movl 0x57cfb6(%rip), %ecx    # 0x5eb2a4
movl 0x73007(%rip), %r8d     # 0xe12fc
movsbl %dl, %edx
callq *%rax
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0x6e2b7
movq 0x72fbc(%rip), %rax     # 0xe12c8
movl 0x57d1ce(%rip), %edi    # 0x5eb4e0
addl $0x3, %edi
subl 0x57cfbd(%rip), %edi    # 0x5eb2d8
movl 0x72ff3(%rip), %esi     # 0xe1314
movl 0x57cfa1(%rip), %edx    # 0x5eb2c8
movl 0x57cf8f(%rip), %ecx    # 0x5eb2bc
callq *%rax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)