// File: /workspace/github_c_makefile_star2_O0/baines[P]MiniGBS/ui.c
// Function: ui_init
int ui_init(void){
	if(cfg.hide_ui)
		return -1;

	initscr();
	noecho();
	cbreak();
	timeout(0);
	curs_set(0);
	nodelay(stdscr, TRUE);
	keypad(stdscr, TRUE);
	set_escdelay(0);

	if(!cfg.monochrome){
		start_color();

		if(can_change_color() && COLORS > 100){
			init_color(COLOR_BLACK, 91, 91, 102);
		}

		init_pair(1, COLOR_CYAN   , COLOR_BLACK);
		init_pair(2, COLOR_MAGENTA, COLOR_BLACK);
		init_pair(3, COLOR_RED    , COLOR_BLACK);
		init_pair(4, COLOR_YELLOW , COLOR_BLACK);
		init_pair(5, COLOR_BLACK  , COLOR_BLACK);
		init_pair(6, COLOR_GREEN  , COLOR_BLACK);
		init_pair(7, COLOR_WHITE  , COLOR_BLACK);

		init_pair(8 , COLOR_CYAN    , COLOR_MAGENTA);
		init_pair(9 , COLOR_CYAN    , COLOR_RED);
		init_pair(10, COLOR_MAGENTA , COLOR_RED);

		init_pair(11, COLOR_BLACK, COLOR_CYAN);
		init_pair(12, COLOR_BLACK, COLOR_MAGENTA);
		init_pair(13, COLOR_BLACK, COLOR_RED);
		init_pair(14, COLOR_BLACK, COLOR_YELLOW);

		bkgd(COLOR_PAIR(7));
	}

	getmaxyx(stdscr, cfg.win_h, cfg.win_w);

	return x11_init();
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
leaq 0x9149(%rip), %rax      # 0x16918
testb $0x1, 0x5(%rax)
je 0xd7e1
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xd9fa
callq 0x5320
callq 0x5160
callq 0x54d0
movq 0x77d9(%rip), %rax      # 0x14fd0
movq (%rax), %rdi
xorl %esi, %esi
callq 0x50c0
xorl %edi, %edi
callq 0x51d0
movq 0x77c1(%rip), %rax      # 0x14fd0
movq (%rax), %rdi
movl $0x1, %esi
callq 0x5040
movq 0x77ad(%rip), %rax      # 0x14fd0
movq (%rax), %rdi
movl $0x1, %esi
callq 0x5170
xorl %edi, %edi
callq 0x5390
leaq 0x90da(%rip), %rax      # 0x16918
testb $0x1, 0x4(%rax)
jne 0xd97c
callq 0x5490
callq 0x53c0
testb $0x1, %al
jne 0xd858
jmp 0xd877
movq 0x7781(%rip), %rax      # 0x14fe0
cmpl $0x64, (%rax)
jle 0xd877
xorl %edi, %edi
movl $0x5b, %edx
movl $0x66, %ecx
movl %edx, %esi
callq 0x5100
movl $0x1, %edi
movl $0x6, %esi
xorl %edx, %edx
callq 0x50a0
movl $0x2, %edi
movl $0x5, %esi
xorl %edx, %edx
callq 0x50a0
movl $0x3, %edi
movl $0x1, %esi
xorl %edx, %edx
callq 0x50a0
movl $0x4, %edi
movl $0x3, %esi
xorl %edx, %edx
callq 0x50a0
movl $0x5, %edi
xorl %edx, %edx
movl %edx, %esi
callq 0x50a0
movl $0x6, %edi
movl $0x2, %esi
xorl %edx, %edx
callq 0x50a0
movl $0x7, %esi
xorl %edx, %edx
movl %esi, %edi
callq 0x50a0
movl $0x8, %edi
movl $0x6, %esi
movl $0x5, %edx
callq 0x50a0
movl $0x9, %edi
movl $0x6, %esi
movl $0x1, %edx
callq 0x50a0
movl $0xa, %edi
movl $0x5, %esi
movl $0x1, %edx
callq 0x50a0
movl $0xb, %edi
xorl %esi, %esi
movl $0x6, %edx
callq 0x50a0
movl $0xc, %edi
xorl %esi, %esi
movl $0x5, %edx
callq 0x50a0
movl $0xd, %edi
xorl %esi, %esi
movl $0x1, %edx
callq 0x50a0
movl $0xe, %edi
xorl %esi, %esi
movl $0x3, %edx
callq 0x50a0
movq 0x7661(%rip), %rax      # 0x14fd0
movq (%rax), %rdi
movl $0x700, %esi            # imm = 0x700
callq 0x5130
xorl %eax, %eax
movq 0x764b(%rip), %rcx      # 0x14fd0
cmpq (%rcx), %rax
je 0xd9a0
movq 0x763f(%rip), %rax      # 0x14fd0
movq (%rax), %rax
movswl 0x4(%rax), %eax
addl $0x1, %eax
movl %eax, -0x8(%rbp)
jmp 0xd9aa
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl %eax, -0x8(%rbp)
jmp 0xd9aa
movl -0x8(%rbp), %ecx
leaq 0x8f64(%rip), %rax      # 0x16918
movl %ecx, 0x2c(%rax)
xorl %eax, %eax
movq 0x7610(%rip), %rcx      # 0x14fd0
cmpq (%rcx), %rax
je 0xd9db
movq 0x7604(%rip), %rax      # 0x14fd0
movq (%rax), %rax
movswl 0x6(%rax), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0xd9e5
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movl %eax, -0xc(%rbp)
jmp 0xd9e5
movl -0xc(%rbp), %ecx
leaq 0x8f29(%rip), %rax      # 0x16918
movl %ecx, 0x28(%rax)
callq 0xf2b0
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)