// File: /workspace/github_c_makefile_star2_O2/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 0x8758(%rip), %r15      # 0x12448
cmpb $0x0, 0x5(%r15)
jne 0xa543
movq %rdi, %r14
leaq 0x20(%rsp), %rbx
andq $0x0, (%rbx)
movq %rbx, %rdi
callq 0x9059
movq %rbx, %rdi
callq 0x9960
cmpl $0x2, 0x24(%r15)
pushq $0x2
popq %rbp
jne 0x9ec9
movq 0x8674(%rip), %rax      # 0x123a0
leaq 0x8a9d(%rip), %rsi      # 0x127d0
subq %rsi, %rax
pushq $0x3c
popq %rcx
cqto
idivq %rcx
movq %rax, %rcx
movl 0x28(%r15), %eax
addl $-0x3c, %eax
cltd
idivl %ebp
xorl %edx, %edx
testl %eax, %eax
cmovlel %edx, %eax
movslq %ecx, %rdi
addl $0x3c, %eax
movl %eax, 0x2c(%rsp)
imulq $0x3c, %rdi, %rax
addq $0x3c, %rdi
leaq (%rax,%rsi), %r8
addq $0xe11, %r8             # imm = 0xE11
addq %rax, %rsi
addq $0xe10, %rsi            # imm = 0xE10
xorl %r9d, %r9d
movq %rdi, %rax
xorl %edx, %edx
pushq $0x3c
popq %rcx
divq %rcx
cmpq $0x3c, %r9
je 0xa543
movq %rdi, (%rsp)
imulq $-0xe10, %rax, %rax     # imm = 0xF1F0
movq %r8, 0x18(%rsp)
leaq (%r8,%rax), %rcx
movq %rcx, 0x8(%rsp)
movq %rsi, 0x38(%rsp)
addq %rsi, %rax
movq %rax, 0x10(%rsp)
movl 0x2c(%rsp), %ebp
movq %r9, 0x30(%rsp)
subl %r9d, %ebp
pushq $0x1e
popq %r12
xorl %r15d, %r15d
cmpq $0x3c, %r15
jae 0x9ea3
movq 0x10(%rsp), %rax
movzbl (%rax,%r15), %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 0x8(%rsp), %rdx
movzbl (%rdx,%r15), %edi
bsfl %edi, %r8d
leal 0x1(%r8), %edx
testb %dil, %dil
movzbl %dl, %edx
cmovel %r9d, %edx
andl %r10d, %edx
testb %dil, %dil
je 0x9e37
testb %cl, %cl
je 0x9e37
cmpb %r8b, %sil
movl $0x0, %ecx
adcq $0x1, %rcx
addl %edx, %eax
addl $0x5, %eax
jmp 0x9e4e
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 0x3737(%rip), %rdx      # 0xd58c
movslq (%rdx,%rcx,4), %r13
addq %rdx, %r13
movq 0x816d(%rip), %r14      # 0x11fd0
movq (%r14), %rdi
shll $0x8, %eax
movzwl %ax, %ebx
movl %ebx, %esi
xorl %edx, %edx
callq 0x52b0
movl %r12d, %edi
movl %ebp, %esi
leaq 0x29e6(%rip), %rdx      # 0xc867
movq %r13, %rcx
xorl %eax, %eax
callq 0x50e0
movq (%r14), %rdi
movl %ebx, %esi
xorl %edx, %edx
callq 0x55a0
addq $0x2, %r15
decl %r12d
jmp 0x9dca
movq 0x30(%rsp), %r9
incq %r9
movq 0x18(%rsp), %r8
addq $-0x3c, %r8
movq (%rsp), %rdi
decq %rdi
movq 0x38(%rsp), %rsi
addq $-0x3c, %rsi
jmp 0x9d7c
leaq 0x40(%rsp), %r12
xorl %ebx, %ebx
movl $0x100, %edx            # imm = 0x100
movq %r12, %rdi
xorl %esi, %esi
callq 0x5080
movq %r15, %r13
movq 0x80e7(%rip), %r15      # 0x11fd0
movq (%r15), %rdi
xorl %esi, %esi
xorl %edx, %edx
callq 0x5210
movq (%r15), %rdi
movl $0x200000, %esi         # imm = 0x200000
xorl %edx, %edx
callq 0x52b0
movl 0x14(%r13), %ecx
movzbl 0x4(%r14), %r8d
decl %r8d
leaq 0x3799(%rip), %rdx      # 0xd6b0
movl $0x100, %esi            # imm = 0x100
movq %r12, %rdi
xorl %eax, %eax
callq 0x5090
movq (%r15), %rdi
movl 0x28(%r13), %edx
subl %eax, %edx
xorl %esi, %esi
callq 0x5210
cmpl $-0x1, %eax
je 0x9f4b
movq (%r15), %rdi
leaq 0x40(%rsp), %rsi
pushq $-0x1
popq %rdx
callq 0x5270
movb $0x0, 0x40(%rsp)
cmpb $0x0, 0x10(%r14)
je 0x9f8e
leaq 0x10(%r14), %r12
leaq 0x3756(%rip), %rsi      # 0xd6b8
pushq $0x4
popq %rdx
movq %r12, %rdi
callq 0x51b0
testl %eax, %eax
je 0x9f8e
leaq 0x3748(%rip), %rdx      # 0xd6c0
leaq 0x40(%rsp), %rdi
movl $0x100, %esi            # imm = 0x100
movq %r12, %rcx
xorl %eax, %eax
callq 0x5090
movl %eax, %ebx
cmpb $0x0, 0x50(%r14)
je 0x9fd5
leaq 0x50(%r14), %r12
leaq 0x3718(%rip), %rsi      # 0xd6b8
pushq $0x4
popq %rdx
movq %r12, %rdi
callq 0x51b0
testl %eax, %eax
je 0x9fd5
movslq %ebx, %rbx
leaq (%rsp,%rbx), %rdi
addq $0x40, %rdi
movl $0x100, %esi            # imm = 0x100
subq %rbx, %rsi
leaq 0x36f3(%rip), %rdx      # 0xd6bc
movq %r12, %rcx
xorl %eax, %eax
callq 0x5090
addl %eax, %ebx
movq 0x7ff4(%rip), %r15      # 0x11fd0
movq (%r15), %rdi
leaq 0x8462(%rip), %rax      # 0x12448
movl 0x28(%rax), %eax
subl %ebx, %eax
cltd
idivl %ebp
pushq $0x1
popq %rsi
movl %eax, %edx
callq 0x5210
cmpl $-0x1, %eax
je 0xa00d
movq (%r15), %rdi
leaq 0x40(%rsp), %rsi
pushq $-0x1
popq %rdx
callq 0x5270
movb $0x0, 0x40(%rsp)
cmpb $0x0, 0x30(%r14)
je 0xa059
addq $0x30, %r14
leaq 0x3694(%rip), %rsi      # 0xd6b8
pushq $0x4
popq %rdx
movq %r14, %rdi
callq 0x51b0
testl %eax, %eax
leaq 0x8410(%rip), %r15      # 0x12448
je 0xa060
leaq 0x3685(%rip), %rdx      # 0xd6c6
leaq 0x40(%rsp), %rdi
movl $0x100, %esi            # imm = 0x100
movq %r14, %rcx
xorl %eax, %eax
callq 0x5090
movl %eax, %ebx
jmp 0xa060
leaq 0x83e8(%rip), %r15      # 0x12448
movq 0x7f69(%rip), %rcx      # 0x11fd0
movq (%rcx), %rdi
movl 0x28(%r15), %eax
subl %ebx, %eax
movq %rcx, %rbx
cltd
idivl %ebp
movl %ebp, %esi
movl %eax, %edx
callq 0x5210
cmpl $-0x1, %eax
je 0xa094
movq (%rbx), %rdi
leaq 0x40(%rsp), %rsi
pushq $-0x1
popq %rdx
callq 0x5270
movq (%rbx), %rdi
movl $0x200000, %esi         # imm = 0x200000
xorl %edx, %edx
callq 0x55a0
movl 0x28(%r15), %eax
movl 0x2c(%r15), %ecx
addl $-0x2f, %eax
cltd
idivl %ebp
movl %eax, %r8d
addl $-0x6, %ecx
pushq $0x6
popq %rsi
movl %ecx, %eax
cltd
idivl %esi
movq %rax, (%rsp)
leal 0x4(%rax), %esi
movq (%rbx), %rdi
movl %r8d, 0x18(%rsp)
movl %r8d, %edx
callq 0x5210
movq (%rbx), %rdi
movl $0x200000, %esi         # imm = 0x200000
xorl %edx, %edx
callq 0x52b0
leaq 0x35e4(%rip), %rbx      # 0xd6d0
xorl %r12d, %r12d
cmpl $0x10, %r12d
je 0xa107
movq %rbx, %rdi
movl %r12d, %esi
xorl %eax, %eax
callq 0x54e0
incl %r12d
jmp 0xa0ef
movq 0x7ec2(%rip), %rbx      # 0x11fd0
movq (%rbx), %rdi
movl $0x200000, %esi         # imm = 0x200000
xorl %edx, %edx
callq 0x55a0
movq (%rsp), %rax
addl $0x5, %eax
movq %rax, (%rsp)
addl $-0x4, 0x18(%rsp)
movl $0xff10, %r13d          # imm = 0xFF10
leaq 0x9536(%rip), %r14      # 0x13670
xorl %r15d, %r15d
xorl %r12d, %r12d
cmpq $0x3, %r12
je 0xa251
movq (%rbx), %rdi
movq (%rsp), %rax
leal (%rax,%r12), %esi
movl 0x18(%rsp), %edx
callq 0x5210
movq (%rbx), %rdi
movl $0x200000, %esi         # imm = 0x200000
xorl %edx, %edx
callq 0x52b0
incq %r12
leaq 0x355f(%rip), %rdi      # 0xd6d6
movq %r12, 0x8(%rsp)
movl %r12d, %esi
xorl %eax, %eax
callq 0x54e0
movq (%rbx), %rdi
movl $0x200000, %esi         # imm = 0x200000
xorl %edx, %edx
callq 0x55a0
xorl %ebp, %ebp
movq %r13, 0x10(%rsp)
cmpq $0x40, %rbp
je 0xa23a
leaq (%r15,%rbp), %r12
cmpl $0x0, (%r14,%r12)
je 0xa1c0
movq (%rbx), %rdi
movl $0x200000, %esi         # imm = 0x200000
xorl %edx, %edx
callq 0x52b0
movq (%rbx), %rdi
leaq 0x33d6(%rip), %rax      # 0xd5a0
movl (%rax,%r12), %eax
shll $0x8, %eax
movzwl %ax, %ebx
movl %ebx, %esi
xorl %edx, %edx
callq 0x52b0
leaq 0x825c(%rip), %rax      # 0x12440
movq (%rax), %rax
movzbl (%rax,%r13), %esi
leaq 0x34e9(%rip), %rdi      # 0xd6dc
xorl %eax, %eax
callq 0x54e0
movq 0x7dcf(%rip), %rax      # 0x11fd0
movq (%rax), %rdi
movl %ebx, %esi
movq 0x7dc3(%rip), %rbx      # 0x11fd0
xorl %edx, %edx
callq 0x55a0
cmpl $0x0, (%r14,%r12)
je 0xa22e
movq (%rbx), %rdi
movl $0x200000, %esi         # imm = 0x200000
xorl %edx, %edx
callq 0x55a0
decl (%r14,%r12)
incq %r13
addq $0x4, %rbp
jmp 0xa19c
movq 0x10(%rsp), %r13
addq $0x10, %r13
addq $0x40, %r15
movq 0x8(%rsp), %r12
jmp 0xa140
leaq 0x81f0(%rip), %r15      # 0x12448
cmpl $0x0, 0x24(%r15)
je 0xa441
leaq 0x40(%rsp), %rdi
callq 0x909a
xorl %eax, %eax
leaq 0xf8ea(%rip), %rcx      # 0x19b60
pushq $0x2
popq %r8
cmpq $0x8, %rax
je 0xa2af
movl %eax, %edx
andl $-0x2, %edx
cmpw $-0x1, 0x20(%rsp,%rdx)
jne 0xa292
movb $0x0, 0x40(%rsp,%rax)
movzbl (%rax,%rcx), %edx
testl %edx, %edx
je 0xa2aa
decl %edx
movzbl 0x40(%rsp,%rax), %esi
cmpl %esi, %edx
cmovbel %esi, %edx
movb %dl, 0x40(%rsp,%rax)
incq %rax
jmp 0xa27a
movb $0x5, %r13b
leaq 0x7aa7(%rip), %r12      # 0x11d60
leaq 0x25a7(%rip), %r14      # 0xc867
xorl %ebp, %ebp
cmpq $0x4, %rbp
je 0xa430
movq (%rbx), %rdi
movl 0x28(%r15), %ecx
movl 0x2c(%r15), %eax
addl $-0x6, %eax
cltd
pushq $0x6
popq %rsi
idivl %esi
leal 0x9(%rax), %esi
addl $-0x2f, %ecx
movl %ecx, %eax
cltd
idivl %r8d
imull $0xc, %ebp, %ecx
leal (%rax,%rcx), %edx
addl $0x3, %edx
callq 0x5210
movq (%rbx), %rdi
movq %rbp, %rbx
shll $0x8, %ebp
addl $0xb00, %ebp            # imm = 0xB00
movl %ebp, %esi
xorl %edx, %edx
callq 0x52b0
movq %rbx, 0x10(%rsp)
addq %rbx, %rbx
pushq $0x3
popq %r15
movl %r15d, %ecx
subl $0x1, %ecx
jb 0xa36c
movzbl 0x40(%rsp,%rbx), %eax
divb %r13b
movzbl %ah, %edx
movzbl %al, %eax
cmpl %eax, %ecx
jne 0xa348
movb $0x4, %al
subb %dl, %al
movzbl %al, %eax
movq (%r12,%rax,8), %rsi
movq %r14, %rdi
jmp 0xa360
movq %r14, %rdi
cmpl %eax, %r15d
jbe 0xa359
leaq 0x33d0(%rip), %rsi      # 0xd727
jmp 0xa360
leaq 0x33b9(%rip), %rsi      # 0xd719
xorl %eax, %eax
callq 0x54e0
decl %r15d
jmp 0xa31e
movq 0x7c5d(%rip), %r15      # 0x11fd0
movq (%r15), %rdi
movl %ebp, %esi
xorl %edx, %edx
callq 0x55a0
movq (%r15), %rdi
movq 0x10(%rsp), %r15
leaq 0x1(%r15), %rax
movq %rax, 0x8(%rsp)
movl %eax, %ebp
shll $0x8, %ebp
movl %ebp, %esi
xorl %edx, %edx
callq 0x52b0
orq $0x1, %rbx
cmpb $0x0, 0x40(%rsp,%r15,2)
jne 0xa3b1
cmpb $0x0, 0x40(%rsp,%rbx)
je 0xa3bf
leaq 0x336f(%rip), %rdi      # 0xd727
xorl %eax, %eax
callq 0x54e0
xorl %r15d, %r15d
cmpl $0x3, %r15d
je 0xa408
movzbl 0x40(%rsp,%rbx), %eax
divb %r13b
movzbl %ah, %ecx
movzbl %al, %eax
cmpl %eax, %r15d
jne 0xa3e7
movzbl %cl, %eax
movq (%r12,%rax,8), %rsi
movq %r14, %rdi
jmp 0xa3fc
movq %r14, %rdi
jae 0xa3f5
leaq 0x3334(%rip), %rsi      # 0xd727
jmp 0xa3fc
leaq 0x331d(%rip), %rsi      # 0xd719
xorl %eax, %eax
callq 0x54e0
incl %r15d
jmp 0xa3c2
movq 0x7bc1(%rip), %rbx      # 0x11fd0
movq (%rbx), %rdi
movl %ebp, %esi
xorl %edx, %edx
callq 0x55a0
movq 0x8(%rsp), %rbp
pushq $0x2
popq %r8
leaq 0x801d(%rip), %r15      # 0x12448
jmp 0xa2c2
movq 0x40(%rsp), %rax
movq %rax, 0xf724(%rip)      # 0x19b60
jmp 0xa543
movq (%rbx), %rdi
movl 0x28(%r15), %ecx
movl 0x2c(%r15), %eax
addl $-0x6, %eax
cltd
pushq $0x6
popq %rsi
idivl %esi
leal 0x9(%rax), %esi
addl $-0x2f, %ecx
movl %ecx, %eax
cltd
pushq $0x2
popq %rcx
idivl %ecx
leal 0x9(%rax), %edx
callq 0x5210
movq (%rbx), %rdi
movl $0x200000, %esi         # imm = 0x200000
xorl %edx, %edx
callq 0x52b0
movl $0x100, %ebx            # imm = 0x100
leaq 0x3288(%rip), %r15      # 0xd70e
leaq 0x31d3(%rip), %rbp      # 0xd660
leaq 0x327f(%rip), %r14      # 0xd713
xorl %r13d, %r13d
cmpq $0x3, %r13
je 0xa52d
cmpw $-0x1, 0x20(%rsp,%r13,2)
movq %r15, %rdi
je 0xa518
leaq 0x3252(%rip), %rdi      # 0xd706
xorl %eax, %eax
callq 0x54e0
movq 0x7b0e(%rip), %r12      # 0x11fd0
movq (%r12), %rdi
movl %ebx, %esi
xorl %edx, %edx
callq 0x52b0
movzwl 0x20(%rsp,%r13,2), %ecx
movl %ecx, %eax
xorl %edx, %edx
movw $0xc, %si
divw %si
cmpw $0x78, %cx
pushq $0x9
popq %rcx
cmovael %ecx, %eax
movzwl %ax, %eax
movzwl %dx, %ecx
movslq (%rbp,%rcx,4), %rsi
addq %rbp, %rsi
leaq 0x320a(%rip), %rdi      # 0xd709
movl %eax, %edx
xorl %eax, %eax
callq 0x54e0
movq (%r12), %rdi
movl %ebx, %esi
xorl %edx, %edx
callq 0x55a0
movq %r14, %rdi
xorl %eax, %eax
callq 0x54e0
incq %r13
addl $0x100, %ebx            # imm = 0x100
jmp 0xa497
movq 0x7a9c(%rip), %rax      # 0x11fd0
movq (%rax), %rdi
movl $0x200000, %esi         # imm = 0x200000
xorl %edx, %edx
callq 0x55a0
addq $0x148, %rsp            # imm = 0x148
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq