// File: /workspace/github_c_makefile_star2_O1/baines[P]MiniGBS/ui.c
// Function: ui_redraw
void ui_redraw(struct GBSHeader* h){
	if(cfg.hide_ui) return;

	uint16_t notes[4] = {};
	audio_get_notes(notes);
	ui_chart_set(notes);

	if(cfg.ui_mode == UI_MODE_CHART){
		ui_chart_draw();
	} else {
		ui_info_draw(h);
		ui_regs_draw();

		if(cfg.ui_mode == UI_MODE_REGISTERS){
			ui_notes_draw(notes);
		} else {
			ui_volume_draw(notes);
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x148, %rsp            # imm = 0x148
leaq 0x7089(%rip), %r13      # 0x11448
cmpb $0x0, 0x5(%r13)
jne 0xac42
movq %rdi, %rbx
leaq 0x20(%rsp), %r14
movq $0x0, (%r14)
movq %r14, %rdi
callq 0x95df
movq %r14, %rdi
callq 0xa00c
cmpl $0x2, 0x24(%r13)
jne 0xa5a1
movq 0x6f9d(%rip), %rax      # 0x11398
leaq 0x73ce(%rip), %rcx      # 0x117d0
subq %rcx, %rax
shrq $0x2, %rax
imull $0xeeeeeeef, %eax, %eax # imm = 0xEEEEEEEF
movl 0x28(%r13), %edx
movl %edx, %esi
addl $-0x3c, %esi
shrl $0x1f, %esi
addl %esi, %edx
addl $-0x3c, %edx
sarl %edx
xorl %esi, %esi
testl %edx, %edx
cmovlel %esi, %edx
cltq
addl $0x3c, %edx
movl %edx, 0x2c(%rsp)
imulq $0x3c, %rax, %rdx
addq $0x3c, %rax
leaq (%rdx,%rcx), %rsi
addq $0xe11, %rsi            # imm = 0xE11
addq %rdx, %rcx
addq $0xe10, %rcx            # imm = 0xE10
xorl %edi, %edi
movq %rax, (%rsp)
movabsq $-0x7777777777777777, %rdx # imm = 0x8888888888888889
mulq %rdx
shrq $0x5, %rdx
imulq $-0xe10, %rdx, %rax     # imm = 0xF1F0
movq %rsi, 0x8(%rsp)
leaq (%rsi,%rax), %rdx
movq %rdx, 0x10(%rsp)
movq %rcx, 0x38(%rsp)
addq %rcx, %rax
movq %rax, 0x18(%rsp)
movl 0x2c(%rsp), %ebp
movq %rdi, 0x30(%rsp)
subl %edi, %ebp
movq $-0x2, %r14
movl $0x1e, %r15d
movq 0x18(%rsp), %rax
movzbl 0x2(%rax,%r14), %edx
bsfl %edx, %eax
incb %al
testb %dl, %dl
movzbl %al, %eax
movl $0x0, %edi
cmovel %edi, %eax
movl $0xff, %r8d
andl %r8d, %eax
movq 0x10(%rsp), %rcx
movzbl 0x2(%rcx,%r14), %esi
bsfl %esi, %ecx
incb %cl
testb %sil, %sil
movzbl %cl, %ecx
cmovel %edi, %ecx
andl %r8d, %ecx
testb %sil, %sil
je 0xa4fd
testb %dl, %dl
je 0xa4fd
cmpb %cl, %al
movl $0x0, %edx
adcq $0x1, %rdx
addl %ecx, %eax
addl $0x5, %eax
jmp 0xa514
xorl %edi, %edi
testb %dl, %dl
setne %dil
xorl %edx, %edx
testb %sil, %sil
setne %dl
leaq (%rdx,%rdi,2), %rdx
cmovnel %ecx, %eax
leaq 0x3051(%rip), %rcx      # 0xd56c
movslq (%rcx,%rdx,4), %r12
addq %rcx, %r12
movq 0x6aa7(%rip), %rbx      # 0x10fd0
movq (%rbx), %rdi
shll $0x8, %eax
movzwl %ax, %r13d
movl %r13d, %esi
xorl %edx, %edx
callq 0x52b0
movl %r15d, %edi
movl %ebp, %esi
leaq 0x22e6(%rip), %rdx      # 0xc82f
movq %r12, %rcx
xorl %eax, %eax
callq 0x50e0
movq (%rbx), %rdi
movl %r13d, %esi
xorl %edx, %edx
callq 0x5590
addq $0x2, %r14
decl %r15d
cmpq $0x3a, %r14
jb 0xa4a0
movq 0x30(%rsp), %rdi
incq %rdi
movq 0x8(%rsp), %rsi
addq $-0x3c, %rsi
movq (%rsp), %rax
decq %rax
movq 0x38(%rsp), %rcx
addq $-0x3c, %rcx
cmpq $0x3c, %rdi
jne 0xa451
jmp 0xac42
leaq 0x40(%rsp), %r15
xorl %r14d, %r14d
movl $0x100, %edx            # imm = 0x100
movq %r15, %rdi
xorl %esi, %esi
callq 0x5080
movq 0x6a11(%rip), %r12      # 0x10fd0
movq (%r12), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x5210
movq (%r12), %rdi
movl $0x200000, %esi         # imm = 0x200000
xorl %edx, %edx
callq 0x52b0
movl 0x14(%r13), %ecx
movzbl 0x4(%rbx), %r8d
decl %r8d
leaq 0x30a1(%rip), %rdx      # 0xd690
movl $0x100, %esi            # imm = 0x100
movq %r15, %rdi
xorl %eax, %eax
callq 0x5090
movq (%r12), %rdi
movl 0x28(%r13), %edx
subl %eax, %edx
xorl %esi, %esi
callq 0x5210
cmpl $-0x1, %eax
je 0xa627
movq (%r12), %rdi
leaq 0x40(%rsp), %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x5270
movb $0x0, 0x40(%rsp)
cmpb $0x0, 0x10(%rbx)
je 0xa66c
leaq 0x10(%rbx), %r15
leaq 0x305b(%rip), %rsi      # 0xd698
movl $0x4, %edx
movq %r15, %rdi
callq 0x51b0
testl %eax, %eax
je 0xa66c
leaq 0x304b(%rip), %rdx      # 0xd6a0
leaq 0x40(%rsp), %rdi
movl $0x100, %esi            # imm = 0x100
movq %r15, %rcx
xorl %eax, %eax
callq 0x5090
movl %eax, %r14d
cmpb $0x0, 0x50(%rbx)
je 0xa6b5
leaq 0x50(%rbx), %r15
leaq 0x301b(%rip), %rsi      # 0xd698
movl $0x4, %edx
movq %r15, %rdi
callq 0x51b0
testl %eax, %eax
je 0xa6b5
movslq %r14d, %r14
leaq (%rsp,%r14), %rdi
addq $0x40, %rdi
movl $0x100, %esi            # imm = 0x100
subq %r14, %rsi
leaq 0x2ff4(%rip), %rdx      # 0xd69c
movq %r15, %rcx
xorl %eax, %eax
callq 0x5090
addl %eax, %r14d
movq (%r12), %rdi
movl 0x28(%r13), %eax
subl %r14d, %eax
movl %eax, %edx
shrl $0x1f, %edx
addl %eax, %edx
sarl %edx
movl $0x1, %esi
callq 0x5210
cmpl $-0x1, %eax
je 0xa6eb
movq (%r12), %rdi
leaq 0x40(%rsp), %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x5270
movb $0x0, 0x40(%rsp)
cmpb $0x0, 0x30(%rbx)
je 0xa730
addq $0x30, %rbx
leaq 0x2f97(%rip), %rsi      # 0xd698
movl $0x4, %edx
movq %rbx, %rdi
callq 0x51b0
testl %eax, %eax
je 0xa730
leaq 0x2f8d(%rip), %rdx      # 0xd6a6
leaq 0x40(%rsp), %rdi
movl $0x100, %esi            # imm = 0x100
movq %rbx, %rcx
xorl %eax, %eax
callq 0x5090
movl %eax, %r14d
movq (%r12), %rdi
movl 0x28(%r13), %eax
subl %r14d, %eax
movl %eax, %edx
shrl $0x1f, %edx
addl %eax, %edx
sarl %edx
movl $0x2, %esi
callq 0x5210
cmpl $-0x1, %eax
je 0xa766
movq (%r12), %rdi
leaq 0x40(%rsp), %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x5270
movq (%r12), %rdi
movl $0x200000, %esi         # imm = 0x200000
xorl %edx, %edx
callq 0x5590
movl 0x28(%r13), %eax
movl 0x2c(%r13), %ecx
movl %eax, %edx
addl $-0x2f, %edx
shrl $0x1f, %edx
addl %eax, %edx
addl $-0x2f, %edx
sarl %edx
addl $-0x6, %ecx
movslq %ecx, %rax
imulq $0x2aaaaaab, %rax, %rax # imm = 0x2AAAAAAB
movq %rax, %rcx
shrq $0x3f, %rcx
shrq $0x20, %rax
leal (%rax,%rcx), %esi
movq %rsi, (%rsp)
leal (%rax,%rcx), %esi
addl $0x4, %esi
movq (%r12), %rdi
movl %edx, 0x8(%rsp)
callq 0x5210
movq (%r12), %rdi
movl $0x200000, %esi         # imm = 0x200000
xorl %edx, %edx
callq 0x52b0
leaq 0x2eda(%rip), %r14      # 0xd6b0
xorl %ebp, %ebp
movq %r14, %rdi
movl %ebp, %esi
xorl %eax, %eax
callq 0x54d0
incl %ebp
cmpl $0x10, %ebp
jne 0xa7d8
movq 0x67de(%rip), %rbp      # 0x10fd0
movq (%rbp), %rdi
movl $0x200000, %esi         # imm = 0x200000
xorl %edx, %edx
callq 0x5590
movq (%rsp), %rax
addl $0x5, %eax
movq %rax, (%rsp)
addl $-0x4, 0x8(%rsp)
movl $0xff10, %r12d          # imm = 0xFF10
leaq 0x7e51(%rip), %rbx      # 0x12670
xorl %r13d, %r13d
xorl %r14d, %r14d
movq (%rbp), %rdi
movq (%rsp), %rax
leal (%rax,%r14), %esi
movl 0x8(%rsp), %edx
callq 0x5210
movq (%rbp), %rdi
movl $0x200000, %esi         # imm = 0x200000
xorl %edx, %edx
callq 0x52b0
incq %r14
leaq 0x2e62(%rip), %rdi      # 0xd6b6
movq %r14, 0x10(%rsp)
movl %r14d, %esi
xorl %eax, %eax
callq 0x54d0
movq (%rbp), %rdi
movl $0x200000, %esi         # imm = 0x200000
xorl %edx, %edx
callq 0x5590
movq %r12, 0x18(%rsp)
xorl %r14d, %r14d
leaq (%r14,%r13), %r15
cmpl $0x0, (%rbx,%r15)
je 0xa896
movq (%rbp), %rdi
movl $0x200000, %esi         # imm = 0x200000
xorl %edx, %edx
callq 0x52b0
movq (%rbp), %rdi
leaq 0x2cdf(%rip), %rax      # 0xd580
movl (%rax,%r15), %eax
shll $0x8, %eax
movzwl %ax, %ebp
movl %ebp, %esi
xorl %edx, %edx
callq 0x52b0
leaq 0x6b85(%rip), %rax      # 0x11440
movq (%rax), %rax
movzbl (%rax,%r12), %esi
leaq 0x2df2(%rip), %rdi      # 0xd6bc
xorl %eax, %eax
callq 0x54d0
movq 0x66f8(%rip), %rax      # 0x10fd0
movq (%rax), %rdi
movl %ebp, %esi
movq 0x66ec(%rip), %rbp      # 0x10fd0
xorl %edx, %edx
callq 0x5590
cmpl $0x0, (%rbx,%r15)
je 0xa906
movq (%rbp), %rdi
movl $0x200000, %esi         # imm = 0x200000
xorl %edx, %edx
callq 0x5590
decl (%rbx,%r15)
addq $0x4, %r14
incq %r12
cmpq $0x40, %r14
jne 0xa87b
movq 0x18(%rsp), %r12
addq $0x10, %r12
addq $0x40, %r13
movq 0x10(%rsp), %r14
cmpq $0x3, %r14
jne 0xa825
leaq 0x6b0e(%rip), %r15      # 0x11448
cmpl $0x0, 0x24(%r15)
je 0xab2c
leaq 0x40(%rsp), %rdi
callq 0x962c
xorl %eax, %eax
leaq 0xe208(%rip), %rcx      # 0x18b60
movl %eax, %edx
andl $-0x2, %edx
cmpw $-0x1, 0x20(%rsp,%rdx)
jne 0xa96a
movb $0x0, 0x40(%rsp,%rax)
movzbl (%rax,%rcx), %edx
testl %edx, %edx
je 0xa982
decl %edx
movzbl 0x40(%rsp,%rax), %esi
cmpl %esi, %edx
cmovlel %esi, %edx
movb %dl, 0x40(%rsp,%rax)
incq %rax
cmpq $0x8, %rax
jne 0xa958
leaq 0x63ce(%rip), %r12      # 0x10d60
leaq 0x1e96(%rip), %rbx      # 0xc82f
xorl %r14d, %r14d
movq (%rbp), %rdi
movl 0x28(%r15), %eax
movl 0x2c(%r15), %ecx
addl $-0x6, %ecx
movslq %ecx, %rcx
imulq $0x2aaaaaab, %rcx, %rcx # imm = 0x2AAAAAAB
movq %rcx, %rdx
shrq $0x20, %rdx
shrq $0x3f, %rcx
leal (%rdx,%rcx), %esi
addl $0x9, %esi
movl %eax, %ecx
addl $-0x2f, %ecx
shrl $0x1f, %ecx
addl %ecx, %eax
addl $-0x2f, %eax
sarl %eax
leal (%r14,%r14,2), %ecx
leal (%rax,%rcx,4), %edx
addl $0x3, %edx
callq 0x5210
movq (%rbp), %rdi
movl %r14d, %ebp
shll $0x8, %ebp
addl $0xb00, %ebp            # imm = 0xB00
movl %ebp, %esi
xorl %edx, %edx
callq 0x52b0
leaq (%r14,%r14), %r15
movl $0x3, %r13d
leal -0x1(%r13), %edx
movzbl 0x40(%rsp,%r15), %eax
imull $0xcd, %eax, %ecx
shrl $0xa, %ecx
cmpl %ecx, %edx
jne 0xaa33
leal (%rcx,%rcx,4), %ecx
subb %cl, %al
movb $0x4, %cl
subb %al, %cl
movzbl %cl, %eax
movq (%r12,%rax,8), %rsi
movq %rbx, %rdi
jmp 0xaa4b
movq %rbx, %rdi
cmpl %ecx, %r13d
jbe 0xaa44
leaq 0x2cc5(%rip), %rsi      # 0xd707
jmp 0xaa4b
leaq 0x2cae(%rip), %rsi      # 0xd6f9
xorl %eax, %eax
callq 0x54d0
decl %r13d
jne 0xaa07
movq 0x6572(%rip), %r13      # 0x10fd0
movq (%r13), %rdi
movl %ebp, %esi
xorl %edx, %edx
callq 0x5590
movq (%r13), %rdi
leaq 0x1(%r14), %r13
movl %r13d, %ebp
shll $0x8, %ebp
movl %ebp, %esi
xorl %edx, %edx
callq 0x52b0
cmpb $0x0, 0x40(%rsp,%r14,2)
jne 0xaa92
cmpb $0x0, 0x41(%rsp,%r15)
je 0xaaa0
leaq 0x2c6e(%rip), %rdi      # 0xd707
xorl %eax, %eax
callq 0x54d0
orq $0x1, %r15
xorl %r14d, %r14d
movzbl 0x40(%rsp,%r15), %eax
imull $0xcd, %eax, %ecx
shrl $0xa, %ecx
cmpl %ecx, %r14d
jne 0xaacc
leal (%rcx,%rcx,4), %ecx
subb %cl, %al
movzbl %al, %eax
movq (%r12,%rax,8), %rsi
movq %rbx, %rdi
jmp 0xaae1
movq %rbx, %rdi
jae 0xaada
leaq 0x2c2f(%rip), %rsi      # 0xd707
jmp 0xaae1
leaq 0x2c18(%rip), %rsi      # 0xd6f9
xorl %eax, %eax
callq 0x54d0
incl %r14d
cmpl $0x3, %r14d
jne 0xaaa7
movq 0x64d8(%rip), %rax      # 0x10fd0
movq (%rax), %rdi
movl %ebp, %esi
movq %rax, %rbp
xorl %edx, %edx
callq 0x5590
movq %r13, %r14
cmpq $0x4, %r13
leaq 0x6933(%rip), %r15      # 0x11448
jne 0xa99c
movq 0x40(%rsp), %rax
movq %rax, 0xe039(%rip)      # 0x18b60
jmp 0xac42
movq (%rbp), %rdi
movl 0x28(%r15), %eax
movl 0x2c(%r15), %ecx
addl $-0x6, %ecx
movslq %ecx, %rcx
imulq $0x2aaaaaab, %rcx, %rcx # imm = 0x2AAAAAAB
movq %rcx, %rdx
shrq $0x20, %rdx
shrq $0x3f, %rcx
leal (%rdx,%rcx), %esi
addl $0x9, %esi
movl %eax, %ecx
addl $-0x2f, %ecx
shrl $0x1f, %ecx
leal (%rax,%rcx), %edx
addl $-0x2f, %edx
sarl %edx
addl $0x9, %edx
callq 0x5210
movq (%rbp), %rdi
movl $0x200000, %esi         # imm = 0x200000
xorl %edx, %edx
callq 0x52b0
movl $0x100, %ebx            # imm = 0x100
leaq 0x2b64(%rip), %r12      # 0xd6ee
leaq 0x2aaf(%rip), %r13      # 0xd640
leaq 0x2b5b(%rip), %rbp      # 0xd6f3
xorl %r14d, %r14d
cmpw $-0x1, 0x20(%rsp,%r14,2)
movq %r12, %rdi
je 0xac12
leaq 0x2b38(%rip), %rdi      # 0xd6e6
xorl %eax, %eax
callq 0x54d0
movq 0x6414(%rip), %r15      # 0x10fd0
movq (%r15), %rdi
movl %ebx, %esi
xorl %edx, %edx
callq 0x52b0
movzwl 0x20(%rsp,%r14,2), %eax
imulq $0x15555556, %rax, %rcx # imm = 0x15555556
shrq $0x20, %rcx
cmpq $0x78, %rax
movl $0x9, %edx
cmovbl %ecx, %edx
shll $0x2, %ecx
leal (%rcx,%rcx,2), %ecx
subl %ecx, %eax
movslq (%r13,%rax,4), %rsi
addq %r13, %rsi
leaq 0x2aed(%rip), %rdi      # 0xd6e9
xorl %eax, %eax
callq 0x54d0
movq (%r15), %rdi
movl %ebx, %esi
xorl %edx, %edx
callq 0x5590
movq %rbp, %rdi
xorl %eax, %eax
callq 0x54d0
incq %r14
addl $0x100, %ebx            # imm = 0x100
cmpq $0x3, %r14
jne 0xab9b
movq 0x639d(%rip), %rax      # 0x10fd0
movq (%rax), %rdi
movl $0x200000, %esi         # imm = 0x200000
xorl %edx, %edx
callq 0x5590
addq $0x148, %rsp            # imm = 0x148
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq