// File: /workspace/github_c_makefile_star2_O3/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 %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
callq 0x31a0
callq 0x32e0
callq 0x3160
movq 0xc279(%rip), %rbx      # 0x10fa0
movq (%rbx), %rdi
movl $0x1, %esi
callq 0x3210
callq 0x3030
testb %al, %al
je 0x4ded
callq 0x31f0
callq 0x3190
testb %al, %al
je 0x4d68
movl $0x6, %edi
movl $0x80, %esi
movl $0x80, %edx
movl $0x80, %ecx
callq 0x3350
movl $0x1, %edi
movl $0x7, %esi
movl $0x4, %edx
callq 0x32f0
movl $0x2, %edi
movl $0x6, %esi
movl $0x4, %edx
callq 0x32f0
movl $0x3, %edi
movl $0x1, %esi
movl $0x4, %edx
callq 0x32f0
movl $0x4, %edi
movl $0x4, %esi
movl $0x7, %edx
callq 0x32f0
movl $0x5, %edi
movl $0x7, %esi
movl $0x2, %edx
callq 0x32f0
movl $0x6, %edi
movl $0x7, %esi
movl $0x1, %edx
callq 0x32f0
movq (%rbx), %rdi
movl $0x120, %esi            # imm = 0x120
callq 0x30a0
movq (%rbx), %rdi
callq 0x3130
movq 0xc1cc(%rip), %r14      # 0x10fc8
movl (%r14), %esi
movl $0x1, %edi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x30b0
movq %rax, 0xc9f4(%rip)      # 0x11808
callq 0x3030
testb %al, %al
je 0x4e2e
movq 0xc9e4(%rip), %rdi      # 0x11808
movl $0x420, %esi            # imm = 0x420
callq 0x30a0
movq 0xc9d3(%rip), %rdi      # 0x11808
callq 0x3130
movq 0xc9c7(%rip), %rdi      # 0x11808
leaq 0xc9f8(%rip), %rax      # 0x11840
movq 0x8(%rax), %rsi
callq 0x4cbc
movl (%r14), %esi
movq 0xc17d(%rip), %r15      # 0x10fd8
movl (%r15), %edx
decl %edx
movl $0x1, %edi
xorl %ecx, %ecx
callq 0x30b0
movq %rax, 0xc99d(%rip)      # 0x11810
callq 0x3030
testb %al, %al
je 0x4e8d
movq 0xc98d(%rip), %rdi      # 0x11810
movl $0x420, %esi            # imm = 0x420
callq 0x30a0
movq 0xc97c(%rip), %rdi      # 0x11810
callq 0x3130
xorl %r12d, %r12d
movl $0x7, %edi
movl $0x2c, %esi
movl $0x1, %edx
xorl %ecx, %ecx
callq 0x30b0
movq %rax, 0xc95f(%rip)      # 0x11818
callq 0x3030
testb %al, %al
je 0x4ee6
movq 0xc94f(%rip), %rdi      # 0x11818
movl $0x120, %esi            # imm = 0x120
callq 0x30a0
movq 0xc93e(%rip), %rdi      # 0x11818
movl $0x100, %esi            # imm = 0x100
xorl %edx, %edx
callq 0x3230
movq 0xc92b(%rip), %rdi      # 0x11818
callq 0x3130
movq 0xc91f(%rip), %rdi      # 0x11818
subq $0x8, %rsp
xorl %esi, %esi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
pushq %r12
pushq %r12
pushq %r12
callq 0x3100
addq $0x20, %rsp
movl $0x7, %edi
movl $0x24, %esi
movl $0x1, %edx
movl $0x2c, %ecx
callq 0x30b0
movq %rax, 0xc8e8(%rip)      # 0x11820
callq 0x3030
testb %al, %al
je 0x4f65
movq 0xc8d8(%rip), %rdi      # 0x11820
movl $0x120, %esi            # imm = 0x120
callq 0x30a0
movq 0xc8c7(%rip), %rdi      # 0x11820
movl $0x100, %esi            # imm = 0x100
xorl %edx, %edx
callq 0x3230
movq 0xc8b4(%rip), %rdi      # 0x11820
callq 0x3130
movq 0xc8a8(%rip), %rdi      # 0x11820
subq $0x8, %rsp
xorl %r12d, %r12d
xorl %esi, %esi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
pushq %r12
pushq %r12
pushq %r12
callq 0x3100
addq $0x20, %rsp
movq 0xc87f(%rip), %rdi      # 0x11820
movq 0xc6b0(%rip), %rsi      # 0x11658
callq 0x4cbc
movq 0xc86c(%rip), %rdi      # 0x11820
leaq 0x7187(%rip), %rcx      # 0xc142
movl $0x1, %esi
movl $0x1, %edx
xorl %eax, %eax
callq 0x31c0
movq 0xc84d(%rip), %rdi      # 0x11820
leaq 0x7178(%rip), %rcx      # 0xc152
movl $0x2, %esi
movl $0x1, %edx
xorl %eax, %eax
callq 0x31c0
movq 0xc82e(%rip), %rdi      # 0x11820
leaq 0x7169(%rip), %rcx      # 0xc162
movl $0x3, %esi
movl $0x1, %edx
xorl %eax, %eax
callq 0x31c0
movq 0xc80f(%rip), %rdi      # 0x11820
leaq 0x715a(%rip), %rcx      # 0xc172
movl $0x4, %esi
movl $0x1, %edx
xorl %eax, %eax
callq 0x31c0
movq 0xc7f0(%rip), %rdi      # 0x11820
leaq 0x714b(%rip), %rcx      # 0xc182
movl $0x5, %esi
movl $0x1, %edx
xorl %eax, %eax
callq 0x31c0
movl (%r15), %edi
addl $-0x9, %edi
movl (%r14), %esi
movl $0x8, %edx
xorl %ecx, %ecx
callq 0x30b0
movq %rax, 0xc7c4(%rip)      # 0x11828
callq 0x3030
testb %al, %al
je 0x5091
movq 0xc7b4(%rip), %rdi      # 0x11828
movl $0x120, %esi            # imm = 0x120
callq 0x30a0
movq 0xc7a3(%rip), %rdi      # 0x11828
movl $0x100, %esi            # imm = 0x100
xorl %edx, %edx
callq 0x3230
movq 0xc790(%rip), %rdi      # 0x11828
callq 0x3050
movq 0xc784(%rip), %rdi      # 0x11828
subq $0x8, %rsp
xorl %esi, %esi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
pushq %r12
pushq %r12
pushq %r12
callq 0x3100
addq $0x20, %rsp
movq (%rbx), %rdi
callq 0x31b0
movq 0xc736(%rip), %rdi      # 0x11808
callq 0x31b0
movq 0xc732(%rip), %rdi      # 0x11810
callq 0x31b0
movq 0xc72e(%rip), %rdi      # 0x11818
callq 0x31b0
movq 0xc72a(%rip), %rdi      # 0x11820
callq 0x31b0
movq 0xc726(%rip), %rdi      # 0x11828
callq 0x31b0
xorl %edi, %edi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x30f0