// File: /workspace/github_c_makefile_star2_O0/sTeeLM[P]dwipe/gui.c
// Function: dwipe_gui_verify
void dwipe_gui_verify( void )
{
/**
 * Allows the user to change the verification option.
 *
 * @modifies  dwipe_options.verify
 * @modifies  main_window
 *
 */

	/* The number of definitions in the dwipe_verify_t enumeration. */
	const int count = 3;

	/* The first tabstop. */
	const int tab1 = 2;

	/* The second tabstop. */
	const int tab2 = 30;

	/* Set the initial focus. */
	int focus = dwipe_options.verify;

	/* The current working row. */
	int yy;

	/* Input buffer. */
	int keystroke;

	/* Update the footer window. */
	werase( footer_window );
	dwipe_gui_title( footer_window, dwipe_buttons2 );
	wrefresh( footer_window );

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

		/* Initialize the working row. */
		yy = 2;

		/* Print the options. */
		mvwprintw( main_window, yy++, tab1, "  Verification Off  "  );
		mvwprintw( main_window, yy++, tab1, "  Verify Last Pass  " );
		mvwprintw( main_window, yy++, tab1, "  Verify All Passes " );
		mvwprintw( main_window, yy++, tab1, "                    " );

		/* Print the cursor. */
		mvwaddch( main_window, 2 + focus, tab1, ACS_RARROW );


		switch( focus )
		{
			case 0:

				mvwprintw( main_window, 2, tab2, "syslinux.cfg:  nuke=\"dwipe --verify off\"" );

				/*                                 0         1         2         3         4         5         6         7        8  */
				mvwprintw( main_window, yy++, tab1, "Do not verify passes. The wipe will be a write-only operation.              " );
				mvwprintw( main_window, yy++, tab1, "                                                                            " );
				break;

			case 1:

				mvwprintw( main_window, 2, tab2, "syslinux.cfg:  nuke=\"dwipe --verify last\"" );

				/*                                 0         1         2         3         4         5         6         7        8  */
				mvwprintw( main_window, yy++, tab1, "Check whether the device is actually empty after the last pass fills the    " );
				mvwprintw( main_window, yy++, tab1, "device with zeros.                                                          " );
				break;

			case 2:

				mvwprintw( main_window, 2, tab2, "syslinux.cfg:  nuke=\"dwipe --verify all\"" );

				/*                                 0         1         2         3         4         5         6         7        8  */
				mvwprintw( main_window, yy++, tab1, "After every pass, read back the pattern and check whether it is correct.    " );
				mvwprintw( main_window, yy++, tab1, "                                                                            " );
				mvwprintw( main_window, yy++, tab1, "This program writes the entire length of the device before it reads back    " );
				mvwprintw( main_window, yy++, tab1, "for verification, even for random pattern passes, to better ensure that     " );
				mvwprintw( main_window, yy++, tab1, "hardware caches are actually flushed.                                       " );
				break;

		} /* switch */

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

		/* Add a title. */
		dwipe_gui_title( main_window, " Verification Mode " );

		/* Refresh the window. */
		wrefresh( main_window );

		/* Get a keystroke. */
		keystroke = getch();

		switch( keystroke )
		{
			case KEY_DOWN:
			case 'j':
			case 'J':

				if( focus < count -1 ) { focus += 1; } 
				break;

			case KEY_UP:
			case 'k':
			case 'K':

				if( focus > 0 ) { focus -= 1; } 
				break;

			case KEY_ENTER:
			case ' ':
			case 10:

				if( focus >= 0 && focus < count ){ dwipe_options.verify = focus; }
				return;

			case KEY_BACKSPACE:
			case KEY_BREAK:

				return;

		} /* switch */
		
	} /* while */

}

// Assembly:
subq $0x38, %rsp
movl $0x3, 0x34(%rsp)
movl $0x2, 0x30(%rsp)
movl $0x1e, 0x2c(%rsp)
leaq 0xc2ad(%rip), %rax      # 0x14830
movl 0x28(%rax), %eax
movl %eax, 0x28(%rsp)
movq 0xc26f(%rip), %rdi      # 0x14800
callq 0x3050
movq 0xc263(%rip), %rdi      # 0x14800
movq 0xc0b4(%rip), %rsi      # 0x14658
callq 0x5a80
movq 0xc250(%rip), %rdi      # 0x14800
callq 0x31b0
movq 0xc25c(%rip), %rdi      # 0x14818
callq 0x3050
movl $0x2, 0x24(%rsp)
movq 0xc248(%rip), %rdi      # 0x14818
movl 0x24(%rsp), %esi
movl %esi, %eax
addl $0x1, %eax
movl %eax, 0x24(%rsp)
movl $0x2, %edx
leaq 0x7f84(%rip), %rcx      # 0x1056d
movb $0x0, %al
callq 0x31c0
movq 0xc221(%rip), %rdi      # 0x14818
movl 0x24(%rsp), %esi
movl %esi, %eax
addl $0x1, %eax
movl %eax, 0x24(%rsp)
movl $0x2, %edx
leaq 0x7f72(%rip), %rcx      # 0x10582
movb $0x0, %al
callq 0x31c0
movq 0xc1fa(%rip), %rdi      # 0x14818
movl 0x24(%rsp), %esi
movl %esi, %eax
addl $0x1, %eax
movl %eax, 0x24(%rsp)
movl $0x2, %edx
leaq 0x7f60(%rip), %rcx      # 0x10597
movb $0x0, %al
callq 0x31c0
movq 0xc1d3(%rip), %rdi      # 0x14818
movl 0x24(%rsp), %esi
movl %esi, %eax
addl $0x1, %eax
movl %eax, 0x24(%rsp)
movl $0x2, %edx
leaq 0x8314(%rip), %rcx      # 0x10972
movb $0x0, %al
callq 0x31c0
movq 0xc1ac(%rip), %rdi      # 0x14818
movl 0x28(%rsp), %esi
addl $0x2, %esi
movl $0x2, %edx
callq 0x3390
cmpl $-0x1, %eax
jne 0x8684
jmp 0x869d
movq 0xc18d(%rip), %rdi      # 0x14818
movq 0xb926(%rip), %rax      # 0x13fb8
movl 0xac(%rax), %esi
callq 0x33d0
movl 0x28(%rsp), %eax
movl %eax, 0x1c(%rsp)
testl %eax, %eax
je 0x86cc
jmp 0x86ab
movl 0x1c(%rsp), %eax
subl $0x1, %eax
je 0x873e
jmp 0x86ba
movl 0x1c(%rsp), %eax
subl $0x2, %eax
je 0x87b0
jmp 0x8892
movq 0xc145(%rip), %rdi      # 0x14818
movl $0x2, %esi
movl $0x1e, %edx
leaq 0x7ec8(%rip), %rcx      # 0x105ac
movb $0x0, %al
callq 0x31c0
movq 0xc126(%rip), %rdi      # 0x14818
movl 0x24(%rsp), %esi
movl %esi, %eax
addl $0x1, %eax
movl %eax, 0x24(%rsp)
movl $0x2, %edx
leaq 0x7eca(%rip), %rcx      # 0x105d5
movb $0x0, %al
callq 0x31c0
movq 0xc0ff(%rip), %rdi      # 0x14818
movl 0x24(%rsp), %esi
movl %esi, %eax
addl $0x1, %eax
movl %eax, 0x24(%rsp)
movl $0x2, %edx
leaq 0x8208(%rip), %rcx      # 0x1093a
movb $0x0, %al
callq 0x31c0
jmp 0x8892
movq 0xc0d3(%rip), %rdi      # 0x14818
movl $0x2, %esi
movl $0x1e, %edx
leaq 0x7ecc(%rip), %rcx      # 0x10622
movb $0x0, %al
callq 0x31c0
movq 0xc0b4(%rip), %rdi      # 0x14818
movl 0x24(%rsp), %esi
movl %esi, %eax
addl $0x1, %eax
movl %eax, 0x24(%rsp)
movl $0x2, %edx
leaq 0x7ecf(%rip), %rcx      # 0x1064c
movb $0x0, %al
callq 0x31c0
movq 0xc08d(%rip), %rdi      # 0x14818
movl 0x24(%rsp), %esi
movl %esi, %eax
addl $0x1, %eax
movl %eax, 0x24(%rsp)
movl $0x2, %edx
leaq 0x7ef5(%rip), %rcx      # 0x10699
movb $0x0, %al
callq 0x31c0
jmp 0x8892
movq 0xc061(%rip), %rdi      # 0x14818
movl $0x2, %esi
movl $0x1e, %edx
leaq 0x7f1e(%rip), %rcx      # 0x106e6
movb $0x0, %al
callq 0x31c0
movq 0xc042(%rip), %rdi      # 0x14818
movl 0x24(%rsp), %esi
movl %esi, %eax
addl $0x1, %eax
movl %eax, 0x24(%rsp)
movl $0x2, %edx
leaq 0x7f20(%rip), %rcx      # 0x1070f
movb $0x0, %al
callq 0x31c0
movq 0xc01b(%rip), %rdi      # 0x14818
movl 0x24(%rsp), %esi
movl %esi, %eax
addl $0x1, %eax
movl %eax, 0x24(%rsp)
movl $0x2, %edx
leaq 0x8124(%rip), %rcx      # 0x1093a
movb $0x0, %al
callq 0x31c0
movq 0xbff4(%rip), %rdi      # 0x14818
movl 0x24(%rsp), %esi
movl %esi, %eax
addl $0x1, %eax
movl %eax, 0x24(%rsp)
movl $0x2, %edx
leaq 0x7f1f(%rip), %rcx      # 0x1075c
movb $0x0, %al
callq 0x31c0
movq 0xbfcd(%rip), %rdi      # 0x14818
movl 0x24(%rsp), %esi
movl %esi, %eax
addl $0x1, %eax
movl %eax, 0x24(%rsp)
movl $0x2, %edx
leaq 0x7f45(%rip), %rcx      # 0x107a9
movb $0x0, %al
callq 0x31c0
movq 0xbfa6(%rip), %rdi      # 0x14818
movl 0x24(%rsp), %esi
movl %esi, %eax
addl $0x1, %eax
movl %eax, 0x24(%rsp)
movl $0x2, %edx
leaq 0x7f6b(%rip), %rcx      # 0x107f6
movb $0x0, %al
callq 0x31c0
movq 0xbf7f(%rip), %rdi      # 0x14818
movq %rsp, %rax
movl $0x0, 0x10(%rax)
movl $0x0, 0x8(%rax)
movl $0x0, (%rax)
xorl %r9d, %r9d
movl %r9d, %esi
movl %r9d, %edx
movl %r9d, %ecx
movl %r9d, %r8d
callq 0x3100
movq 0xbf4d(%rip), %rdi      # 0x14818
leaq 0x7f71(%rip), %rsi      # 0x10843
callq 0x5a80
movq 0xbf3a(%rip), %rdi      # 0x14818
callq 0x31b0
movq 0xb6d6(%rip), %rax      # 0x13fc0
movq (%rax), %rdi
callq 0x3120
movl %eax, 0x20(%rsp)
movl 0x20(%rsp), %eax
movl %eax, 0x18(%rsp)
subl $0xa, %eax
je 0x89ad
jmp 0x8909
movl 0x18(%rsp), %eax
subl $0x20, %eax
je 0x89ad
jmp 0x8918
movl 0x18(%rsp), %eax
subl $0x4a, %eax
je 0x8985
jmp 0x8923
movl 0x18(%rsp), %eax
subl $0x4b, %eax
je 0x8999
jmp 0x892e
movl 0x18(%rsp), %eax
subl $0x6a, %eax
je 0x8985
jmp 0x8939
movl 0x18(%rsp), %eax
subl $0x6b, %eax
je 0x8999
jmp 0x8944
movl 0x18(%rsp), %eax
subl $0x101, %eax            # imm = 0x101
je 0x89cb
jmp 0x8951
movl 0x18(%rsp), %eax
subl $0x102, %eax            # imm = 0x102
je 0x8985
jmp 0x895e
movl 0x18(%rsp), %eax
subl $0x103, %eax            # imm = 0x103
je 0x8999
jmp 0x896b
movl 0x18(%rsp), %eax
subl $0x107, %eax            # imm = 0x107
je 0x89cb
jmp 0x8978
movl 0x18(%rsp), %eax
subl $0x157, %eax            # imm = 0x157
je 0x89ad
jmp 0x89cd
cmpl $0x2, 0x28(%rsp)
jge 0x8997
movl 0x28(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x28(%rsp)
jmp 0x89cd
cmpl $0x0, 0x28(%rsp)
jle 0x89ab
movl 0x28(%rsp), %eax
subl $0x1, %eax
movl %eax, 0x28(%rsp)
jmp 0x89cd
cmpl $0x0, 0x28(%rsp)
jl 0x89c9
cmpl $0x3, 0x28(%rsp)
jge 0x89c9
movl 0x28(%rsp), %ecx
leaq 0xbe6a(%rip), %rax      # 0x14830
movl %ecx, 0x28(%rax)
jmp 0x89d2
jmp 0x89d2
jmp 0x85b5
addq $0x38, %rsp
retq
nopw (%rax,%rax)