// File: /workspace/github_c_makefile_star2_O1/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 0x32d0
callq 0x3160
movq 0xc2e9(%rip), %rbx      # 0x10fa0
movq (%rbx), %rdi
movl $0x1, %esi
callq 0x3210
callq 0x3030
testb %al, %al
je 0x4d7d
callq 0x31f0
callq 0x3190
testb %al, %al
je 0x4cf8
movl $0x6, %edi
movl $0x80, %esi
movl $0x80, %edx
movl $0x80, %ecx
callq 0x3340
movl $0x1, %edi
movl $0x7, %esi
movl $0x4, %edx
callq 0x32e0
movl $0x2, %edi
movl $0x6, %esi
movl $0x4, %edx
callq 0x32e0
movl $0x3, %edi
movl $0x1, %esi
movl $0x4, %edx
callq 0x32e0
movl $0x4, %edi
movl $0x4, %esi
movl $0x7, %edx
callq 0x32e0
movl $0x5, %edi
movl $0x7, %esi
movl $0x2, %edx
callq 0x32e0
movl $0x6, %edi
movl $0x7, %esi
movl $0x1, %edx
callq 0x32e0
movq (%rbx), %rdi
movl $0x120, %esi            # imm = 0x120
callq 0x30a0
movq (%rbx), %rdi
callq 0x3130
movq 0xc23c(%rip), %r14      # 0x10fc8
movl (%r14), %esi
movl $0x1, %edi
xorl %edx, %edx
xorl %ecx, %ecx
callq 0x30b0
movq %rax, 0xca64(%rip)      # 0x11808
callq 0x3030
testb %al, %al
je 0x4dbe
movq 0xca54(%rip), %rdi      # 0x11808
movl $0x420, %esi            # imm = 0x420
callq 0x30a0
movq 0xca43(%rip), %rdi      # 0x11808
callq 0x3130
movq 0xca37(%rip), %rdi      # 0x11808
leaq 0xca68(%rip), %rax      # 0x11840
movq 0x8(%rax), %rsi
callq 0x4c4c
movl (%r14), %esi
movq 0xc1ed(%rip), %r15      # 0x10fd8
movl (%r15), %edx
decl %edx
movl $0x1, %edi
xorl %ecx, %ecx
callq 0x30b0
movq %rax, 0xca0d(%rip)      # 0x11810
callq 0x3030
testb %al, %al
je 0x4e1d
movq 0xc9fd(%rip), %rdi      # 0x11810
movl $0x420, %esi            # imm = 0x420
callq 0x30a0
movq 0xc9ec(%rip), %rdi      # 0x11810
callq 0x3130
xorl %r12d, %r12d
movl $0x7, %edi
movl $0x2c, %esi
movl $0x1, %edx
xorl %ecx, %ecx
callq 0x30b0
movq %rax, 0xc9cf(%rip)      # 0x11818
callq 0x3030
testb %al, %al
je 0x4e76
movq 0xc9bf(%rip), %rdi      # 0x11818
movl $0x120, %esi            # imm = 0x120
callq 0x30a0
movq 0xc9ae(%rip), %rdi      # 0x11818
movl $0x100, %esi            # imm = 0x100
xorl %edx, %edx
callq 0x3230
movq 0xc99b(%rip), %rdi      # 0x11818
callq 0x3130
movq 0xc98f(%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, 0xc958(%rip)      # 0x11820
callq 0x3030
testb %al, %al
je 0x4ef5
movq 0xc948(%rip), %rdi      # 0x11820
movl $0x120, %esi            # imm = 0x120
callq 0x30a0
movq 0xc937(%rip), %rdi      # 0x11820
movl $0x100, %esi            # imm = 0x100
xorl %edx, %edx
callq 0x3230
movq 0xc924(%rip), %rdi      # 0x11820
callq 0x3130
movq 0xc918(%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 0xc8ef(%rip), %rdi      # 0x11820
movq 0xc720(%rip), %rsi      # 0x11658
callq 0x4c4c
movq 0xc8dc(%rip), %rdi      # 0x11820
leaq 0x71f7(%rip), %rcx      # 0xc142
movl $0x1, %esi
movl $0x1, %edx
xorl %eax, %eax
callq 0x31c0
movq 0xc8bd(%rip), %rdi      # 0x11820
leaq 0x71e8(%rip), %rcx      # 0xc152
movl $0x2, %esi
movl $0x1, %edx
xorl %eax, %eax
callq 0x31c0
movq 0xc89e(%rip), %rdi      # 0x11820
leaq 0x71d9(%rip), %rcx      # 0xc162
movl $0x3, %esi
movl $0x1, %edx
xorl %eax, %eax
callq 0x31c0
movq 0xc87f(%rip), %rdi      # 0x11820
leaq 0x71ca(%rip), %rcx      # 0xc172
movl $0x4, %esi
movl $0x1, %edx
xorl %eax, %eax
callq 0x31c0
movq 0xc860(%rip), %rdi      # 0x11820
leaq 0x71bb(%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, 0xc834(%rip)      # 0x11828
callq 0x3030
testb %al, %al
je 0x5021
movq 0xc824(%rip), %rdi      # 0x11828
movl $0x120, %esi            # imm = 0x120
callq 0x30a0
movq 0xc813(%rip), %rdi      # 0x11828
movl $0x100, %esi            # imm = 0x100
xorl %edx, %edx
callq 0x3230
movq 0xc800(%rip), %rdi      # 0x11828
callq 0x3050
movq 0xc7f4(%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 0xc7a6(%rip), %rdi      # 0x11808
callq 0x31b0
movq 0xc7a2(%rip), %rdi      # 0x11810
callq 0x31b0
movq 0xc79e(%rip), %rdi      # 0x11818
callq 0x31b0
movq 0xc79a(%rip), %rdi      # 0x11820
callq 0x31b0
movq 0xc796(%rip), %rdi      # 0x11828
callq 0x31b0
xorl %edi, %edi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x30f0