// File: /workspace/github_c_makefile_star2_O0/baines[P]MiniGBS/ui.c
// Function: ui_regs_draw
static void ui_regs_draw(void){
	static const int color_map[3][16] = {
		{ 1, 1, 1, 1, 1, 5, 2, 2, 2, 2, 3, 3, 3, 3, 3, 5 },
		{ 4, 4, 4, 4, 6, 6, 6, 5, 5, 5, 5, 5, 5, 5, 5, 5 },
		{ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3 },
	};

	int x = (cfg.win_w-47)/2;
	int y = (cfg.win_h-6)/6+4;

	move(y, x);
	attron(A_BOLD);
	for(int i = 0; i < 0x10; ++i) printw("  %1X", i);
	attroff(A_BOLD);

	for(int i = 0; i < 3; ++i){
		move(y+i+1, x-4);

		attron(A_BOLD);
		printw("FF%d ", i+1);
		attroff(A_BOLD);

		for(int j = 0; j < 16; ++j){
			if(boldness[i*16+j]){
				attron(A_BOLD);
			}

			attron(COLOR_PAIR(color_map[i][j]));
			printw(" %02x", mem[0xFF10 + (i*0x10) + j]);
			attroff(COLOR_PAIR(color_map[i][j]));

			if(boldness[i*16+j]){
				attroff(A_BOLD);
				--boldness[i*16+j];
			}
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
leaq 0x8859(%rip), %rax      # 0x16918
movl 0x28(%rax), %eax
subl $0x2f, %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, -0x4(%rbp)
leaq 0x8841(%rip), %rax      # 0x16918
movl 0x2c(%rax), %eax
subl $0x6, %eax
movl $0x6, %ecx
cltd
idivl %ecx
addl $0x4, %eax
movl %eax, -0x8(%rbp)
movq 0x6ede(%rip), %rax      # 0x14fd0
movq (%rax), %rdi
movl -0x8(%rbp), %esi
movl -0x4(%rbp), %edx
callq 0x5200
movq 0x6ec9(%rip), %rax      # 0x14fd0
movq (%rax), %rdi
movl $0x200000, %esi         # imm = 0x200000
xorl %eax, %eax
movl %eax, %edx
callq 0x52b0
movl $0x0, -0xc(%rbp)
cmpl $0x10, -0xc(%rbp)
jge 0xe141
movl -0xc(%rbp), %esi
leaq 0x3e71(%rip), %rdi      # 0x11fa0
movb $0x0, %al
callq 0x54e0
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0xe11f
movq 0x6e88(%rip), %rax      # 0x14fd0
movq (%rax), %rdi
movl $0x200000, %esi         # imm = 0x200000
xorl %eax, %eax
movl %eax, %edx
callq 0x55a0
movl $0x0, -0x10(%rbp)
cmpl $0x3, -0x10(%rbp)
jge 0xe31a
movq 0x6e5f(%rip), %rax      # 0x14fd0
movq (%rax), %rdi
movl -0x8(%rbp), %esi
addl -0x10(%rbp), %esi
addl $0x1, %esi
movl -0x4(%rbp), %edx
subl $0x4, %edx
callq 0x5200
movq 0x6e41(%rip), %rax      # 0x14fd0
movq (%rax), %rdi
movl $0x200000, %esi         # imm = 0x200000
xorl %eax, %eax
movl %eax, %edx
callq 0x52b0
movl -0x10(%rbp), %esi
addl $0x1, %esi
leaq 0x3df9(%rip), %rdi      # 0x11fa6
movb $0x0, %al
callq 0x54e0
movq 0x6e15(%rip), %rax      # 0x14fd0
movq (%rax), %rdi
movl $0x200000, %esi         # imm = 0x200000
xorl %eax, %eax
movl %eax, %edx
callq 0x55a0
movl $0x0, -0x14(%rbp)
cmpl $0x10, -0x14(%rbp)
jge 0xe30a
movl -0x10(%rbp), %eax
shll $0x4, %eax
addl -0x14(%rbp), %eax
movslq %eax, %rcx
leaq 0x9950(%rip), %rax      # 0x17b40
cmpl $0x0, (%rax,%rcx,4)
je 0xe20e
movq 0x6dd3(%rip), %rax      # 0x14fd0
movq (%rax), %rdi
movl $0x200000, %esi         # imm = 0x200000
xorl %eax, %eax
movl %eax, %edx
callq 0x52b0
movq 0x6dbb(%rip), %rax      # 0x14fd0
movq (%rax), %rdi
movslq -0x10(%rbp), %rcx
leaq 0x3c7d(%rip), %rax      # 0x11ea0
shlq $0x6, %rcx
addq %rcx, %rax
movslq -0x14(%rbp), %rcx
movl (%rax,%rcx,4), %esi
shll $0x8, %esi
andl $0xff00, %esi           # imm = 0xFF00
xorl %eax, %eax
movl %eax, %edx
callq 0x52b0
leaq 0x86c6(%rip), %rax      # 0x16910
movq (%rax), %rax
movl -0x10(%rbp), %ecx
shll $0x4, %ecx
addl $0xff10, %ecx           # imm = 0xFF10
addl -0x14(%rbp), %ecx
movslq %ecx, %rcx
movzbl (%rax,%rcx), %esi
leaq 0x3d42(%rip), %rdi      # 0x11fac
movb $0x0, %al
callq 0x54e0
movq 0x6d58(%rip), %rax      # 0x14fd0
movq (%rax), %rdi
movslq -0x10(%rbp), %rcx
leaq 0x3c1a(%rip), %rax      # 0x11ea0
shlq $0x6, %rcx
addq %rcx, %rax
movslq -0x14(%rbp), %rcx
movl (%rax,%rcx,4), %esi
shll $0x8, %esi
andl $0xff00, %esi           # imm = 0xFF00
xorl %eax, %eax
movl %eax, %edx
callq 0x55a0
movl -0x10(%rbp), %eax
shll $0x4, %eax
addl -0x14(%rbp), %eax
movslq %eax, %rcx
leaq 0x9887(%rip), %rax      # 0x17b40
cmpl $0x0, (%rax,%rcx,4)
je 0xe2fa
movq 0x6d0a(%rip), %rax      # 0x14fd0
movq (%rax), %rdi
movl $0x200000, %esi         # imm = 0x200000
xorl %eax, %eax
movl %eax, %edx
callq 0x55a0
movl -0x10(%rbp), %eax
shll $0x4, %eax
addl -0x14(%rbp), %eax
movslq %eax, %rcx
leaq 0x9856(%rip), %rax      # 0x17b40
movl (%rax,%rcx,4), %edx
addl $-0x1, %edx
leaq 0x9849(%rip), %rax      # 0x17b40
movl %edx, (%rax,%rcx,4)
jmp 0xe2fc
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0xe1d3
jmp 0xe30c
movl -0x10(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x10(%rbp)
jmp 0xe160
addq $0x20, %rsp
popq %rbp
retq