// File: /workspace/github_c_makefile_star2_O0/baines[P]MiniGBS/ui.c
// Function: ui_info_draw
static void ui_info_draw(struct GBSHeader* h){
	char buf[256] = {};
	int len = 0;

	move(0, 0);
	attron(A_BOLD);

	len = snprintf(buf, countof(buf), "[%d/%d]", cfg.song_no, h->song_count - 1);
	mvaddstr(0, cfg.win_w-len, buf);
	len = 0;
	*buf = 0;

	if(*h->title && strncmp(h->title, "<?>", 4) != 0){
		len += snprintf(buf + len, countof(buf) - len, "%.32s", h->title);
	}
	if(*h->copyright && strncmp(h->copyright, "<?>", 4) != 0){
		len += snprintf(buf + len, countof(buf) - len, "  ©%.32s", h->copyright);
	}
	mvaddstr(1, (cfg.win_w-len)/2, buf);
	*buf = 0;

	if(*h->author && strncmp(h->author, "<?>", 4) != 0){
		len = snprintf(buf, countof(buf), "by %.32s ", h->author);
	}
	mvaddstr(2, (cfg.win_w-len)/2, buf);

	attroff(A_BOLD);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x120, %rsp            # imm = 0x120
movq %rdi, -0x8(%rbp)
leaq -0x110(%rbp), %rdi
xorl %esi, %esi
movl $0x100, %edx            # imm = 0x100
callq 0x5080
movl $0x0, -0x114(%rbp)
movq 0x71cd(%rip), %rax      # 0x14fd0
movq (%rax), %rdi
xorl %edx, %edx
movl %edx, %esi
callq 0x5200
movq 0x71ba(%rip), %rax      # 0x14fd0
movq (%rax), %rdi
movl $0x200000, %esi         # imm = 0x200000
xorl %eax, %eax
movl %eax, %edx
callq 0x52b0
leaq -0x110(%rbp), %rdi
leaq 0x8ae3(%rip), %rax      # 0x16918
movl 0x14(%rax), %ecx
movq -0x8(%rbp), %rax
movzbl 0x4(%rax), %r8d
subl $0x1, %r8d
movl $0x100, %esi            # imm = 0x100
leaq 0x412f(%rip), %rdx      # 0x11f80
movb $0x0, %al
callq 0x5090
movl %eax, -0x114(%rbp)
movq 0x716b(%rip), %rax      # 0x14fd0
movq (%rax), %rdi
leaq 0x8aa9(%rip), %rax      # 0x16918
movl 0x28(%rax), %edx
subl -0x114(%rbp), %edx
xorl %esi, %esi
callq 0x5200
cmpl $-0x1, %eax
jne 0xde86
jmp 0xdea1
movq 0x7143(%rip), %rax      # 0x14fd0
movq (%rax), %rdi
leaq -0x110(%rbp), %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x5270
movl $0x0, -0x114(%rbp)
movb $0x0, -0x110(%rbp)
movq -0x8(%rbp), %rax
movsbl 0x10(%rax), %eax
cmpl $0x0, %eax
je 0xdf1f
movq -0x8(%rbp), %rdi
addq $0x10, %rdi
leaq 0x40ba(%rip), %rsi      # 0x11f88
movl $0x4, %edx
callq 0x51a0
cmpl $0x0, %eax
je 0xdf1f
leaq -0x110(%rbp), %rdi
movslq -0x114(%rbp), %rax
addq %rax, %rdi
movslq -0x114(%rbp), %rax
movl $0x100, %esi            # imm = 0x100
subq %rax, %rsi
movq -0x8(%rbp), %rcx
addq $0x10, %rcx
leaq 0x4084(%rip), %rdx      # 0x11f90
movb $0x0, %al
callq 0x5090
addl -0x114(%rbp), %eax
movl %eax, -0x114(%rbp)
movq -0x8(%rbp), %rax
movsbl 0x50(%rax), %eax
cmpl $0x0, %eax
je 0xdf8c
movq -0x8(%rbp), %rdi
addq $0x50, %rdi
leaq 0x404d(%rip), %rsi      # 0x11f88
movl $0x4, %edx
callq 0x51a0
cmpl $0x0, %eax
je 0xdf8c
leaq -0x110(%rbp), %rdi
movslq -0x114(%rbp), %rax
addq %rax, %rdi
movslq -0x114(%rbp), %rax
movl $0x100, %esi            # imm = 0x100
subq %rax, %rsi
movq -0x8(%rbp), %rcx
addq $0x50, %rcx
leaq 0x4013(%rip), %rdx      # 0x11f8c
movb $0x0, %al
callq 0x5090
addl -0x114(%rbp), %eax
movl %eax, -0x114(%rbp)
movq 0x703d(%rip), %rax      # 0x14fd0
movq (%rax), %rdi
leaq 0x897b(%rip), %rax      # 0x16918
movl 0x28(%rax), %eax
subl -0x114(%rbp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, %edx
movl $0x1, %esi
callq 0x5200
cmpl $-0x1, %eax
jne 0xdfc1
jmp 0xdfdc
movq 0x7008(%rip), %rax      # 0x14fd0
movq (%rax), %rdi
leaq -0x110(%rbp), %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x5270
movb $0x0, -0x110(%rbp)
movq -0x8(%rbp), %rax
movsbl 0x30(%rax), %eax
cmpl $0x0, %eax
je 0xe036
movq -0x8(%rbp), %rdi
addq $0x30, %rdi
leaq 0x3f89(%rip), %rsi      # 0x11f88
movl $0x4, %edx
callq 0x51a0
cmpl $0x0, %eax
je 0xe036
leaq -0x110(%rbp), %rdi
movq -0x8(%rbp), %rcx
addq $0x30, %rcx
movl $0x100, %esi            # imm = 0x100
leaq 0x3f6d(%rip), %rdx      # 0x11f96
movb $0x0, %al
callq 0x5090
movl %eax, -0x114(%rbp)
movq 0x6f93(%rip), %rax      # 0x14fd0
movq (%rax), %rdi
leaq 0x88d1(%rip), %rax      # 0x16918
movl 0x28(%rax), %eax
subl -0x114(%rbp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
movl %eax, %edx
movl $0x2, %esi
callq 0x5200
cmpl $-0x1, %eax
jne 0xe06b
jmp 0xe086
movq 0x6f5e(%rip), %rax      # 0x14fd0
movq (%rax), %rdi
leaq -0x110(%rbp), %rsi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x5270
movq 0x6f43(%rip), %rax      # 0x14fd0
movq (%rax), %rdi
movl $0x200000, %esi         # imm = 0x200000
xorl %eax, %eax
movl %eax, %edx
callq 0x55a0
addq $0x120, %rsp            # imm = 0x120
popq %rbp
retq
nopw (%rax,%rax)