// File: /workspace/github_c_makefile_star2_O3/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 0xb1a9(%rip), %rax      # 0x11840
movl 0x28(%rax), %ebx
movq 0xb16f(%rip), %rdi      # 0x11810
callq 0x3050
movq 0xb163(%rip), %rdi      # 0x11810
movq 0xafb4(%rip), %rsi      # 0x11668
callq 0x4cbc
movq 0xb150(%rip), %rdi      # 0x11810
callq 0x31b0
xorl %r14d, %r14d
leaq 0x630b(%rip), %r12      # 0xc9da
leaq 0x61d5(%rip), %rbp      # 0xc8ab
movq 0xa8c3(%rip), %r15      # 0x10fa0
leal 0x2(%rbx), %r13d
movq 0xb140(%rip), %rdi      # 0x11828
callq 0x3050
movq 0xb134(%rip), %rdi      # 0x11828
movl $0x2, %esi
movl $0x2, %edx
leaq 0x5ed0(%rip), %rcx      # 0xc5d5
xorl %eax, %eax
callq 0x31c0
movq 0xb115(%rip), %rdi      # 0x11828
movl $0x3, %esi
movl $0x2, %edx
leaq 0x5ec6(%rip), %rcx      # 0xc5ea
xorl %eax, %eax
callq 0x31c0
movq 0xb0f6(%rip), %rdi      # 0x11828
movl $0x4, %esi
movl $0x2, %edx
leaq 0x5ebc(%rip), %rcx      # 0xc5ff
xorl %eax, %eax
callq 0x31c0
movq 0xb0d7(%rip), %rdi      # 0x11828
movl $0x5, %esi
movl $0x2, %edx
movq %r12, %rcx
xorl %eax, %eax
callq 0x31c0
movq 0xb0bc(%rip), %rdi      # 0x11828
movl %r13d, %esi
movl $0x2, %edx
callq 0x33b0
cmpl $-0x1, %eax
je 0x6797
movq 0xb0a3(%rip), %rdi      # 0x11828
movq 0xa80c(%rip), %rax      # 0x10f98
movl 0xac(%rax), %esi
callq 0x33f0
cmpl $0x2, %ebx
je 0x6863
cmpl $0x1, %ebx
je 0x6808
testl %ebx, %ebx
jne 0x691d
movq 0xb074(%rip), %rdi      # 0x11828
movl $0x2, %esi
movl $0x1e, %edx
leaq 0x5e4f(%rip), %rcx      # 0xc614
xorl %eax, %eax
callq 0x31c0
movq 0xb055(%rip), %rdi      # 0x11828
movl $0x6, %esi
movl $0x2, %edx
leaq 0x5e59(%rip), %rcx      # 0xc63d
xorl %eax, %eax
callq 0x31c0
movq 0xb036(%rip), %rdi      # 0x11828
movl $0x7, %esi
movl $0x2, %edx
leaq 0x619f(%rip), %rcx      # 0xc9a2
jmp 0x6916
movq 0xb019(%rip), %rdi      # 0x11828
movl $0x2, %esi
movl $0x1e, %edx
leaq 0x5e6a(%rip), %rcx      # 0xc68a
xorl %eax, %eax
callq 0x31c0
movq 0xaffa(%rip), %rdi      # 0x11828
movl $0x6, %esi
movl $0x2, %edx
leaq 0x5e75(%rip), %rcx      # 0xc6b4
xorl %eax, %eax
callq 0x31c0
movq 0xafdb(%rip), %rdi      # 0x11828
movl $0x7, %esi
movl $0x2, %edx
leaq 0x5ea3(%rip), %rcx      # 0xc701
jmp 0x6916
movq 0xafbe(%rip), %rdi      # 0x11828
movl $0x2, %esi
movl $0x1e, %edx
leaq 0x5ed3(%rip), %rcx      # 0xc74e
xorl %eax, %eax
callq 0x31c0
movq 0xaf9f(%rip), %rdi      # 0x11828
movl $0x6, %esi
movl $0x2, %edx
leaq 0x5edd(%rip), %rcx      # 0xc777
xorl %eax, %eax
callq 0x31c0
movq 0xaf80(%rip), %rdi      # 0x11828
movl $0x7, %esi
movl $0x2, %edx
leaq 0x60e9(%rip), %rcx      # 0xc9a2
xorl %eax, %eax
callq 0x31c0
movq 0xaf61(%rip), %rdi      # 0x11828
movl $0x8, %esi
movl $0x2, %edx
leaq 0x5eec(%rip), %rcx      # 0xc7c4
xorl %eax, %eax
callq 0x31c0
movq 0xaf42(%rip), %rdi      # 0x11828
movl $0x9, %esi
movl $0x2, %edx
leaq 0x5f1a(%rip), %rcx      # 0xc811
xorl %eax, %eax
callq 0x31c0
movq 0xaf23(%rip), %rdi      # 0x11828
movl $0xa, %esi
movl $0x2, %edx
leaq 0x5f48(%rip), %rcx      # 0xc85e
xorl %eax, %eax
callq 0x31c0
movq 0xaf04(%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 0xaede(%rip), %rdi      # 0x11828
movq %rbp, %rsi
callq 0x4cbc
movq 0xaecf(%rip), %rdi      # 0x11828
callq 0x31b0
movq (%r15), %rdi
callq 0x3120
cmpl $0x6a, %eax
jg 0x6985
cmpl $0x49, %eax
jle 0x69a0
cmpl $0x4a, %eax
je 0x69c2
cmpl $0x4b, %eax
je 0x69cc
cmpl $0x6a, %eax
jne 0x66e1
jmp 0x69c2
leal -0x101(%rax), %ecx
cmpl $0x6, %ecx
ja 0x69b0
leaq 0x56d1(%rip), %rdx      # 0xc068
movslq (%rdx,%rcx,4), %rax
addq %rdx, %rax
jmpq *%rax
cmpl $0xa, %eax
je 0x69dc
cmpl $0x20, %eax
jne 0x66e1
jmp 0x69dc
cmpl $0x6b, %eax
je 0x69cc
cmpl $0x157, %eax            # imm = 0x157
jne 0x66e1
jmp 0x69dc
xorl %eax, %eax
cmpl $0x2, %ebx
setl %al
jmp 0x69d5
xorl %eax, %eax
testl %ebx, %ebx
setg %al
negl %eax
addl %eax, %ebx
jmp 0x66dd
cmpl $0x2, %ebx
ja 0x69eb
leaq 0xae58(%rip), %rax      # 0x11840
movl %ebx, 0x28(%rax)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq