// File: /workspace/github_c_makefile_star2_O2/sTeeLM[P]dwipe/gui.c
// Function: dwipe_gui_init
void dwipe_gui_init( void )
{
/**
 * Initializes the ncurses gui.
 *
 */

	/* Initialize the screen. */
	initscr();

	/* Disable TTY line buffering. */
	cbreak();

	/* Disable TTY echo. */
	noecho();

	/* Enable most special keys. */
	keypad( stdscr, TRUE );

	if( has_colors() )
	{
		/* Initialize color capabilities. */
		start_color();

		if( can_change_color() )
		{
			/* Redefine cyan to gray. */
			init_color( COLOR_CYAN, 128, 128, 128 );
		}

		/* Set white on blue as the emphasis color. */
		init_pair( 1, COLOR_WHITE, COLOR_BLUE );

		/* Set gray (or cyan) on blue as the normal color. */
		init_pair( 2, COLOR_CYAN, COLOR_BLUE );

		/* Set red on blue as the hilite color. */
		init_pair( 3, COLOR_RED, COLOR_BLUE );

		/* Set blue on white as the color for the header and footer windows. */
		init_pair( 4, COLOR_BLUE, COLOR_WHITE );

		/* Set white on green for success messages. */
		init_pair( 5, COLOR_WHITE, COLOR_GREEN );

		/* Set white on green for failure messages. */
		init_pair( 6, COLOR_WHITE, COLOR_RED );

		/* Set the background style. */
		wbkgdset( stdscr, COLOR_PAIR(1) | ' ' );

	}

	/* Clear the screen. */
	wclear( stdscr );


	/* Create the header window. */
	header_window = newwin( DWIPE_GUI_HEADER_H, DWIPE_GUI_HEADER_W, DWIPE_GUI_HEADER_Y, DWIPE_GUI_HEADER_X );

	if( has_colors() )
	{
		/* Set the background style of the header window. */
		wbkgdset( header_window, COLOR_PAIR(4) | ' ' );
	}

	/* Clear the header window. */
	wclear( header_window );

	/* Print the product banner. */
	dwipe_gui_title( header_window, dwipe_options.banner );

	/* Create the footer window. */
	footer_window = newwin( DWIPE_GUI_FOOTER_H, DWIPE_GUI_FOOTER_W, DWIPE_GUI_FOOTER_Y, DWIPE_GUI_FOOTER_X );

	if( has_colors() )
	{
		/* Set the background style of the footer window. */
		wbkgdset( footer_window, COLOR_PAIR(4) | ' ' );
	}

	/* Clear the footer window. */
	wclear( footer_window );

	/* Create the options window. */
	options_window = newwin( DWIPE_GUI_OPTIONS_H, DWIPE_GUI_OPTIONS_W, DWIPE_GUI_OPTIONS_Y, DWIPE_GUI_OPTIONS_X );

	if( has_colors() )
	{
		/* Set the background style of the options window. */
		wbkgdset( options_window, COLOR_PAIR(1) | ' ' );

		/* Apply the color change to the options window. */
		wattron( options_window, COLOR_PAIR(1) );
	}

	/* Clear the options window. */
	wclear( options_window );

	/* Add a border. */
	box( options_window, 0, 0 );

	/* Create the stats window. */
	stats_window = newwin( DWIPE_GUI_STATS_H, DWIPE_GUI_STATS_W, DWIPE_GUI_STATS_Y, DWIPE_GUI_STATS_X );

	if( has_colors() )
	{
		/* Set the background style of the stats window. */
		wbkgdset( stats_window, COLOR_PAIR(1) | ' ' );

		/* Apply the color change to the stats window. */
		wattron( stats_window, COLOR_PAIR(1) );
	}

	/* Clear the new window. */
	wclear( stats_window );

	/* Add a border. */
	box( stats_window, 0, 0 );

	/* Add a title. */
	dwipe_gui_title( stats_window, stats_title );

	/* Print field labels. */
	mvwprintw( stats_window, DWIPE_GUI_STATS_RUNTIME_Y,    DWIPE_GUI_STATS_RUNTIME_X,    "Runtime:       " );
	mvwprintw( stats_window, DWIPE_GUI_STATS_ETA_Y,        DWIPE_GUI_STATS_ETA_X,        "Remaining:     " );
	mvwprintw( stats_window, DWIPE_GUI_STATS_LOAD_Y,       DWIPE_GUI_STATS_LOAD_X,       "Load Averages: " );
	mvwprintw( stats_window, DWIPE_GUI_STATS_THROUGHPUT_Y, DWIPE_GUI_STATS_THROUGHPUT_X, "Throughput:    " );
	mvwprintw( stats_window, DWIPE_GUI_STATS_ERRORS_Y,     DWIPE_GUI_STATS_ERRORS_X,     "Errors:        " );


	/* Create the main window. */
	main_window = newwin( DWIPE_GUI_MAIN_H, DWIPE_GUI_MAIN_W, DWIPE_GUI_MAIN_Y, DWIPE_GUI_MAIN_X );

	if( has_colors() )
	{
		/* Set the background style. */
		wbkgdset( main_window, COLOR_PAIR(1) | ' ' );

      /* Apply the color change. */
      wattron( main_window, COLOR_PAIR(1) );
	}

	/* Clear the main window. */
	werase( main_window );

	/* Add a border. */
	box( main_window, 0, 0 );

	/* Refresh the screen. */
	wrefresh( stdscr );
	wrefresh( header_window );
	wrefresh( footer_window );
	wrefresh( options_window );
	wrefresh( stats_window );
	wrefresh( main_window );

	/* Hide the cursor. */
	curs_set( 0 );

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
callq 0x31a0
callq 0x32e0
callq 0x3160
movq 0xb5be(%rip), %r13      # 0xffa0
movq (%r13), %rdi
pushq $0x1
popq %rsi
callq 0x3210
callq 0x3030
testb %al, %al
je 0x4a8d
callq 0x31f0
callq 0x3190
testb %al, %al
je 0x4a20
pushq $0x6
popq %rdi
movl $0x80, %esi
movl $0x80, %edx
movl $0x80, %ecx
callq 0x3350
pushq $0x1
popq %rbx
pushq $0x7
popq %rbp
pushq $0x4
popq %r14
movl %ebx, %edi
movl %ebp, %esi
movl %r14d, %edx
callq 0x32f0
pushq $0x2
popq %r15
pushq $0x6
popq %r12
movl %r15d, %edi
movl %r12d, %esi
movl %r14d, %edx
callq 0x32f0
pushq $0x3
popq %rdi
movl %ebx, %esi
movl %r14d, %edx
callq 0x32f0
movl %r14d, %edi
movl %r14d, %esi
movl %ebp, %edx
callq 0x32f0
pushq $0x5
popq %rdi
movl %ebp, %esi
movl %r15d, %edx
callq 0x32f0
movl %r12d, %edi
movl %ebp, %esi
movl %ebx, %edx
callq 0x32f0
movq (%r13), %rdi
movl $0x120, %esi            # imm = 0x120
callq 0x30a0
movq (%r13), %rdi
callq 0x3130
movq 0xb52b(%rip), %r14      # 0xffc8
movl (%r14), %esi
pushq $0x1
popq %rdi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x30b0
movq %rax, 0xbd55(%rip)      # 0x10808
callq 0x3030
testb %al, %al
je 0x4acd
movq 0xbd45(%rip), %rdi      # 0x10808
movl $0x420, %esi            # imm = 0x420
callq 0x30a0
movq 0xbd34(%rip), %rdi      # 0x10808
callq 0x3130
movq 0xbd28(%rip), %rdi      # 0x10808
leaq 0xbd59(%rip), %rax      # 0x10840
movq 0x8(%rax), %rsi
callq 0x4974
movl (%r14), %esi
movq 0xb4de(%rip), %r15      # 0xffd8
movl (%r15), %edx
decl %edx
pushq $0x1
popq %rdi
xorl %ecx, %ecx
callq 0x30b0
movq %rax, 0xbd00(%rip)      # 0x10810
callq 0x3030
testb %al, %al
je 0x4b2a
movq 0xbcf0(%rip), %rdi      # 0x10810
movl $0x420, %esi            # imm = 0x420
callq 0x30a0
movq 0xbcdf(%rip), %rdi      # 0x10810
callq 0x3130
pushq $0x7
popq %rdi
pushq $0x2c
popq %rsi
pushq $0x1
popq %rdx
xorl %ecx, %ecx
callq 0x30b0
movq %rax, 0xbccb(%rip)      # 0x10818
callq 0x3030
testb %al, %al
je 0x4b7a
movq 0xbcbb(%rip), %rdi      # 0x10818
movl $0x120, %esi            # imm = 0x120
callq 0x30a0
movq 0xbcaa(%rip), %rdi      # 0x10818
movl $0x100, %esi            # imm = 0x100
xorl %edx, %edx
callq 0x3230
movq 0xbc97(%rip), %rdi      # 0x10818
callq 0x3130
movq 0xbc8b(%rip), %rdi      # 0x10818
andl $0x0, 0x10(%rsp)
andl $0x0, 0x8(%rsp)
andl $0x0, (%rsp)
xorl %esi, %esi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x3100
pushq $0x7
popq %rdi
pushq $0x24
popq %rsi
pushq $0x1
popq %rdx
pushq $0x2c
popq %rcx
callq 0x30b0
movq %rax, 0xbc5c(%rip)      # 0x10820
callq 0x3030
testb %al, %al
je 0x4bf1
movq 0xbc4c(%rip), %rdi      # 0x10820
movl $0x120, %esi            # imm = 0x120
callq 0x30a0
movq 0xbc3b(%rip), %rdi      # 0x10820
movl $0x100, %esi            # imm = 0x100
xorl %edx, %edx
callq 0x3230
movq 0xbc28(%rip), %rdi      # 0x10820
callq 0x3130
movq 0xbc1c(%rip), %rdi      # 0x10820
andl $0x0, 0x10(%rsp)
andl $0x0, 0x8(%rsp)
andl $0x0, (%rsp)
xorl %esi, %esi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x3100
movq 0xbbf6(%rip), %rdi      # 0x10820
movq 0xba27(%rip), %rsi      # 0x10658
callq 0x4974
movq 0xbbe3(%rip), %rdi      # 0x10820
leaq 0x64fe(%rip), %rcx      # 0xb142
pushq $0x1
popq %rbx
movl %ebx, %esi
movl %ebx, %edx
xorl %eax, %eax
callq 0x31c0
movq 0xbbc7(%rip), %rdi      # 0x10820
leaq 0x64f2(%rip), %rcx      # 0xb152
pushq $0x2
popq %rsi
movl %ebx, %edx
xorl %eax, %eax
callq 0x31c0
movq 0xbbad(%rip), %rdi      # 0x10820
leaq 0x64e8(%rip), %rcx      # 0xb162
pushq $0x3
popq %rsi
movl %ebx, %edx
xorl %eax, %eax
callq 0x31c0
movq 0xbb93(%rip), %rdi      # 0x10820
leaq 0x64de(%rip), %rcx      # 0xb172
pushq $0x4
popq %rsi
movl %ebx, %edx
xorl %eax, %eax
callq 0x31c0
movq 0xbb79(%rip), %rdi      # 0x10820
leaq 0x64d4(%rip), %rcx      # 0xb182
pushq $0x5
popq %rsi
movl %ebx, %edx
xorl %eax, %eax
callq 0x31c0
movl (%r15), %edi
addl $-0x9, %edi
movl (%r14), %esi
pushq $0x8
popq %rdx
xorl %ecx, %ecx
callq 0x30b0
movq %rax, 0xbb54(%rip)      # 0x10828
callq 0x3030
testb %al, %al
je 0x4d01
movq 0xbb44(%rip), %rdi      # 0x10828
movl $0x120, %esi            # imm = 0x120
callq 0x30a0
movq 0xbb33(%rip), %rdi      # 0x10828
movl $0x100, %esi            # imm = 0x100
xorl %edx, %edx
callq 0x3230
movq 0xbb20(%rip), %rdi      # 0x10828
callq 0x3050
movq 0xbb14(%rip), %rdi      # 0x10828
andl $0x0, 0x10(%rsp)
andl $0x0, 0x8(%rsp)
andl $0x0, (%rsp)
xorl %esi, %esi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
callq 0x3100
movq (%r13), %rdi
callq 0x31b0
movq 0xbac5(%rip), %rdi      # 0x10808
callq 0x31b0
movq 0xbac1(%rip), %rdi      # 0x10810
callq 0x31b0
movq 0xbabd(%rip), %rdi      # 0x10818
callq 0x31b0
movq 0xbab9(%rip), %rdi      # 0x10820
callq 0x31b0
movq 0xbab5(%rip), %rdi      # 0x10828
callq 0x31b0
xorl %edi, %edi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x30f0