// File: /workspace/github_c_makefile_star2_O3/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 0x7153(%rip), %r13      # 0x11448
cmpb $0x0, 0x5(%r13)
jne 0xab80
movq %rdi, %rbx
leaq 0x20(%rsp), %r14
movq $0x0, (%r14)
movq %r14, %rdi
callq 0x9442
movq %r14, %rdi
callq 0x9f44
cmpl $0x2, 0x24(%r13)
jne 0xa4df
movq 0x7067(%rip), %rax      # 0x11398
leaq 0x7498(%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), %ecx
bsfl %ecx, %esi
leal 0x1(%rsi), %eax
testb %cl, %cl
movzbl %al, %eax
movl $0x0, %r9d
cmovel %r9d, %eax
movl $0xff, %r10d
andl %r10d, %eax
movq 0x10(%rsp), %rdx
movzbl 0x2(%rdx,%r14), %edi
bsfl %edi, %r8d
leal 0x1(%r8), %edx
testb %dil, %dil
movzbl %dl, %edx
cmovel %r9d, %edx
andl %r10d, %edx
testb %dil, %dil
je 0xa43b
testb %cl, %cl
je 0xa43b
cmpb %r8b, %sil
movl $0x0, %ecx
adcq $0x1, %rcx
addl %edx, %eax
addl $0x5, %eax
jmp 0xa452
xorl %esi, %esi
testb %cl, %cl
setne %sil
xorl %ecx, %ecx
testb %dil, %dil
setne %cl
leaq (%rcx,%rsi,2), %rcx
cmovnel %edx, %eax
leaq 0x31d3(%rip), %rdx      # 0xd62c
movslq (%rdx,%rcx,4), %r12
addq %rdx, %r12
movq 0x6b69(%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 0x23e0(%rip), %rdx      # 0xc867
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 0xa3d6
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 0xa387
jmp 0xab80
leaq 0x40(%rsp), %r15
xorl %r14d, %r14d
movl $0x100, %edx            # imm = 0x100
movq %r15, %rdi
xorl %esi, %esi
callq 0x5080
movq 0x6ad3(%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 0x3223(%rip), %rdx      # 0xd750
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 0xa565
movq (%r12), %rdi
leaq 0x40(%rsp), %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x5270
movb $0x0, 0x40(%rsp)
cmpb $0x0, 0x10(%rbx)
je 0xa5aa
leaq 0x10(%rbx), %r15
leaq 0x31dd(%rip), %rsi      # 0xd758
movl $0x4, %edx
movq %r15, %rdi
callq 0x51b0
testl %eax, %eax
je 0xa5aa
leaq 0x31cd(%rip), %rdx      # 0xd760
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 0xa5f3
leaq 0x50(%rbx), %r15
leaq 0x319d(%rip), %rsi      # 0xd758
movl $0x4, %edx
movq %r15, %rdi
callq 0x51b0
testl %eax, %eax
je 0xa5f3
movslq %r14d, %r14
leaq (%rsp,%r14), %rdi
addq $0x40, %rdi
movl $0x100, %esi            # imm = 0x100
subq %r14, %rsi
leaq 0x3176(%rip), %rdx      # 0xd75c
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 0xa629
movq (%r12), %rdi
leaq 0x40(%rsp), %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x5270
movb $0x0, 0x40(%rsp)
cmpb $0x0, 0x30(%rbx)
je 0xa66e
addq $0x30, %rbx
leaq 0x3119(%rip), %rsi      # 0xd758
movl $0x4, %edx
movq %rbx, %rdi
callq 0x51b0
testl %eax, %eax
je 0xa66e
leaq 0x310f(%rip), %rdx      # 0xd766
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 0xa6a4
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 0x305c(%rip), %r14      # 0xd770
xorl %ebp, %ebp
movq %r14, %rdi
movl %ebp, %esi
xorl %eax, %eax
callq 0x54d0
incl %ebp
cmpl $0x10, %ebp
jne 0xa716
movq 0x68a0(%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 0x7f13(%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 0x2fe4(%rip), %rdi      # 0xd776
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 0xa7d4
movq (%rbp), %rdi
movl $0x200000, %esi         # imm = 0x200000
xorl %edx, %edx
callq 0x52b0
movq (%rbp), %rdi
leaq 0x2e61(%rip), %rax      # 0xd640
movl (%rax,%r15), %eax
shll $0x8, %eax
movzwl %ax, %ebp
movl %ebp, %esi
xorl %edx, %edx
callq 0x52b0
leaq 0x6c47(%rip), %rax      # 0x11440
movq (%rax), %rax
movzbl (%rax,%r12), %esi
leaq 0x2f74(%rip), %rdi      # 0xd77c
xorl %eax, %eax
callq 0x54d0
movq 0x67ba(%rip), %rax      # 0x10fd0
movq (%rax), %rdi
movl %ebp, %esi
movq 0x67ae(%rip), %rbp      # 0x10fd0
xorl %edx, %edx
callq 0x5590
cmpl $0x0, (%rbx,%r15)
je 0xa844
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 0xa7b9
movq 0x18(%rsp), %r12
addq $0x10, %r12
addq $0x40, %r13
movq 0x10(%rsp), %r14
cmpq $0x3, %r14
jne 0xa763
leaq 0x6bd0(%rip), %r15      # 0x11448
cmpl $0x0, 0x24(%r15)
je 0xaa6a
leaq 0x40(%rsp), %rdi
callq 0x948f
xorl %eax, %eax
leaq 0xe2ca(%rip), %rcx      # 0x18b60
movl %eax, %edx
andl $-0x2, %edx
cmpw $-0x1, 0x20(%rsp,%rdx)
jne 0xa8a8
movb $0x0, 0x40(%rsp,%rax)
movzbl (%rax,%rcx), %edx
testl %edx, %edx
je 0xa8c0
decl %edx
movzbl 0x40(%rsp,%rax), %esi
cmpl %esi, %edx
cmovbel %esi, %edx
movb %dl, 0x40(%rsp,%rax)
incq %rax
cmpq $0x8, %rax
jne 0xa896
leaq 0x6490(%rip), %r12      # 0x10d60
leaq 0x1f90(%rip), %rbx      # 0xc867
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 0xa971
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 0xa989
movq %rbx, %rdi
cmpl %ecx, %r13d
jbe 0xa982
leaq 0x2e47(%rip), %rsi      # 0xd7c7
jmp 0xa989
leaq 0x2e30(%rip), %rsi      # 0xd7b9
xorl %eax, %eax
callq 0x54d0
decl %r13d
jne 0xa945
movq 0x6634(%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
orq $0x1, %r15
cmpb $0x0, 0x40(%rsp,%r14,2)
jne 0xa9d4
cmpb $0x0, 0x40(%rsp,%r15)
je 0xa9e2
leaq 0x2dec(%rip), %rdi      # 0xd7c7
xorl %eax, %eax
callq 0x54d0
xorl %r14d, %r14d
movzbl 0x40(%rsp,%r15), %eax
imull $0xcd, %eax, %ecx
shrl $0xa, %ecx
cmpl %ecx, %r14d
jne 0xaa0a
leal (%rcx,%rcx,4), %ecx
subb %cl, %al
movzbl %al, %eax
movq (%r12,%rax,8), %rsi
movq %rbx, %rdi
jmp 0xaa1f
movq %rbx, %rdi
jae 0xaa18
leaq 0x2db1(%rip), %rsi      # 0xd7c7
jmp 0xaa1f
leaq 0x2d9a(%rip), %rsi      # 0xd7b9
xorl %eax, %eax
callq 0x54d0
incl %r14d
cmpl $0x3, %r14d
jne 0xa9e5
movq 0x659a(%rip), %rax      # 0x10fd0
movq (%rax), %rdi
movl %ebp, %esi
movq %rax, %rbp
xorl %edx, %edx
callq 0x5590
movq %r13, %r14
cmpq $0x4, %r13
leaq 0x69f5(%rip), %r15      # 0x11448
jne 0xa8da
movq 0x40(%rsp), %rax
movq %rax, 0xe0fb(%rip)      # 0x18b60
jmp 0xab80
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 0x2ce6(%rip), %r12      # 0xd7ae
leaq 0x2c31(%rip), %r13      # 0xd700
leaq 0x2cdd(%rip), %rbp      # 0xd7b3
xorl %r14d, %r14d
cmpw $-0x1, 0x20(%rsp,%r14,2)
movq %r12, %rdi
je 0xab50
leaq 0x2cba(%rip), %rdi      # 0xd7a6
xorl %eax, %eax
callq 0x54d0
movq 0x64d6(%rip), %r15      # 0x10fd0
movq (%r15), %rdi
movl %ebx, %esi
xorl %edx, %edx
callq 0x52b0
movzwl 0x20(%rsp,%r14,2), %eax
imull $0xaaab, %eax, %ecx     # imm = 0xAAAB
shrl $0x13, %ecx
cmpl $0x78, %eax
movl $0x9, %edx
cmovbl %ecx, %edx
shll $0x2, %ecx
leal (%rcx,%rcx,2), %ecx
subl %ecx, %eax
movzwl %ax, %eax
movslq (%r13,%rax,4), %rsi
addq %r13, %rsi
leaq 0x2c6f(%rip), %rdi      # 0xd7a9
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 0xaad9
movq 0x645f(%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