// File: /workspace/github_c_makefile_star2_O1/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:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
leaq 0xb216(%rip), %rax      # 0x11840
movl 0x28(%rax), %ebx
movq 0xb1dc(%rip), %rdi      # 0x11810
callq 0x3050
movq 0xb1d0(%rip), %rdi      # 0x11810
movq 0xb021(%rip), %rsi      # 0x11668
callq 0x4c4c
movq 0xb1bd(%rip), %rdi      # 0x11810
callq 0x31b0
xorl %r14d, %r14d
leaq 0x6378(%rip), %r12      # 0xc9da
leaq 0x6242(%rip), %rbp      # 0xc8ab
movq 0xa930(%rip), %r15      # 0x10fa0
leal 0x2(%rbx), %r13d
movq 0xb1ad(%rip), %rdi      # 0x11828
callq 0x3050
movq 0xb1a1(%rip), %rdi      # 0x11828
movl $0x2, %esi
movl $0x2, %edx
leaq 0x5f3d(%rip), %rcx      # 0xc5d5
xorl %eax, %eax
callq 0x31c0
movq 0xb182(%rip), %rdi      # 0x11828
movl $0x3, %esi
movl $0x2, %edx
leaq 0x5f33(%rip), %rcx      # 0xc5ea
xorl %eax, %eax
callq 0x31c0
movq 0xb163(%rip), %rdi      # 0x11828
movl $0x4, %esi
movl $0x2, %edx
leaq 0x5f29(%rip), %rcx      # 0xc5ff
xorl %eax, %eax
callq 0x31c0
movq 0xb144(%rip), %rdi      # 0x11828
movl $0x5, %esi
movl $0x2, %edx
movq %r12, %rcx
xorl %eax, %eax
callq 0x31c0
movq 0xb129(%rip), %rdi      # 0x11828
movl %r13d, %esi
movl $0x2, %edx
callq 0x33a0
cmpl $-0x1, %eax
je 0x672a
movq 0xb110(%rip), %rdi      # 0x11828
movq 0xa879(%rip), %rax      # 0x10f98
movl 0xac(%rax), %esi
callq 0x33e0
cmpl $0x2, %ebx
je 0x67f6
cmpl $0x1, %ebx
je 0x679b
testl %ebx, %ebx
jne 0x68b0
movq 0xb0e1(%rip), %rdi      # 0x11828
movl $0x2, %esi
movl $0x1e, %edx
leaq 0x5ebc(%rip), %rcx      # 0xc614
xorl %eax, %eax
callq 0x31c0
movq 0xb0c2(%rip), %rdi      # 0x11828
movl $0x6, %esi
movl $0x2, %edx
leaq 0x5ec6(%rip), %rcx      # 0xc63d
xorl %eax, %eax
callq 0x31c0
movq 0xb0a3(%rip), %rdi      # 0x11828
movl $0x7, %esi
movl $0x2, %edx
leaq 0x620c(%rip), %rcx      # 0xc9a2
jmp 0x68a9
movq 0xb086(%rip), %rdi      # 0x11828
movl $0x2, %esi
movl $0x1e, %edx
leaq 0x5ed7(%rip), %rcx      # 0xc68a
xorl %eax, %eax
callq 0x31c0
movq 0xb067(%rip), %rdi      # 0x11828
movl $0x6, %esi
movl $0x2, %edx
leaq 0x5ee2(%rip), %rcx      # 0xc6b4
xorl %eax, %eax
callq 0x31c0
movq 0xb048(%rip), %rdi      # 0x11828
movl $0x7, %esi
movl $0x2, %edx
leaq 0x5f10(%rip), %rcx      # 0xc701
jmp 0x68a9
movq 0xb02b(%rip), %rdi      # 0x11828
movl $0x2, %esi
movl $0x1e, %edx
leaq 0x5f40(%rip), %rcx      # 0xc74e
xorl %eax, %eax
callq 0x31c0
movq 0xb00c(%rip), %rdi      # 0x11828
movl $0x6, %esi
movl $0x2, %edx
leaq 0x5f4a(%rip), %rcx      # 0xc777
xorl %eax, %eax
callq 0x31c0
movq 0xafed(%rip), %rdi      # 0x11828
movl $0x7, %esi
movl $0x2, %edx
leaq 0x6156(%rip), %rcx      # 0xc9a2
xorl %eax, %eax
callq 0x31c0
movq 0xafce(%rip), %rdi      # 0x11828
movl $0x8, %esi
movl $0x2, %edx
leaq 0x5f59(%rip), %rcx      # 0xc7c4
xorl %eax, %eax
callq 0x31c0
movq 0xafaf(%rip), %rdi      # 0x11828
movl $0x9, %esi
movl $0x2, %edx
leaq 0x5f87(%rip), %rcx      # 0xc811
xorl %eax, %eax
callq 0x31c0
movq 0xaf90(%rip), %rdi      # 0x11828
movl $0xa, %esi
movl $0x2, %edx
leaq 0x5fb5(%rip), %rcx      # 0xc85e
xorl %eax, %eax
callq 0x31c0
movq 0xaf71(%rip), %rdi      # 0x11828
subq $0x8, %rsp
xorl %esi, %esi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
pushq %r14
pushq %r14
pushq %r14
callq 0x3100
addq $0x20, %rsp
movq 0xaf4b(%rip), %rdi      # 0x11828
movq %rbp, %rsi
callq 0x4c4c
movq 0xaf3c(%rip), %rdi      # 0x11828
callq 0x31b0
movq (%r15), %rdi
callq 0x3120
cmpl $0x6a, %eax
jg 0x6918
cmpl $0x49, %eax
jle 0x6933
cmpl $0x4a, %eax
je 0x6955
cmpl $0x4b, %eax
je 0x695f
cmpl $0x6a, %eax
jne 0x6674
jmp 0x6955
leal -0x101(%rax), %ecx
cmpl $0x6, %ecx
ja 0x6943
leaq 0x573e(%rip), %rdx      # 0xc068
movslq (%rdx,%rcx,4), %rax
addq %rdx, %rax
jmpq *%rax
cmpl $0xa, %eax
je 0x696f
cmpl $0x20, %eax
jne 0x6674
jmp 0x696f
cmpl $0x6b, %eax
je 0x695f
cmpl $0x157, %eax            # imm = 0x157
jne 0x6674
jmp 0x696f
xorl %eax, %eax
cmpl $0x2, %ebx
setl %al
jmp 0x6968
xorl %eax, %eax
testl %ebx, %ebx
setg %al
negl %eax
addl %eax, %ebx
jmp 0x6670
cmpl $0x2, %ebx
ja 0x697e
leaq 0xaec5(%rip), %rax      # 0x11840
movl %ebx, 0x28(%rax)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq