// File: /workspace/github_c_makefile_star2_O2/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 0xa707(%rip), %rax      # 0x10840
movl 0x28(%rax), %r13d
movq 0xa6cc(%rip), %rdi      # 0x10810
callq 0x3050
movq 0xa6c0(%rip), %rdi      # 0x10810
movq 0xa511(%rip), %rsi      # 0x10668
callq 0x4974
movq 0xa6ad(%rip), %rdi      # 0x10810
callq 0x31b0
pushq $0x2
popq %rbp
pushq $0x5
popq %r14
leaq 0x5735(%rip), %r15      # 0xb8ab
movq 0x9e23(%rip), %rbx      # 0xffa0
leal 0x2(%r13), %r12d
movq 0xa6a0(%rip), %rdi      # 0x10828
callq 0x3050
movq 0xa694(%rip), %rdi      # 0x10828
movl %ebp, %esi
movl %ebp, %edx
leaq 0x5436(%rip), %rcx      # 0xb5d5
xorl %eax, %eax
callq 0x31c0
movq 0xa67b(%rip), %rdi      # 0x10828
pushq $0x3
popq %rsi
movl %ebp, %edx
leaq 0x5431(%rip), %rcx      # 0xb5ea
xorl %eax, %eax
callq 0x31c0
movq 0xa661(%rip), %rdi      # 0x10828
pushq $0x4
popq %rsi
movl %ebp, %edx
leaq 0x542c(%rip), %rcx      # 0xb5ff
xorl %eax, %eax
callq 0x31c0
movq 0xa647(%rip), %rdi      # 0x10828
movl %r14d, %esi
movl %ebp, %edx
leaq 0x57ed(%rip), %rcx      # 0xb9da
xorl %eax, %eax
callq 0x31c0
movq 0xa62d(%rip), %rdi      # 0x10828
movl %r12d, %esi
movl %ebp, %edx
callq 0x33b0
cmpl $-0x1, %eax
je 0x6223
movq 0xa617(%rip), %rdi      # 0x10828
movq 0x9d80(%rip), %rax      # 0xff98
movl 0xac(%rax), %esi
callq 0x33f0
cmpl $0x2, %r13d
je 0x62d4
cmpl $0x1, %r13d
je 0x6288
testl %r13d, %r13d
jne 0x6370
movq 0xa5e5(%rip), %rdi      # 0x10828
movl %ebp, %esi
pushq $0x1e
popq %rdx
leaq 0x53c5(%rip), %rcx      # 0xb614
xorl %eax, %eax
callq 0x31c0
movq 0xa5cb(%rip), %rdi      # 0x10828
pushq $0x6
popq %rsi
movl %ebp, %edx
leaq 0x53d4(%rip), %rcx      # 0xb63d
xorl %eax, %eax
callq 0x31c0
movq 0xa5b1(%rip), %rdi      # 0x10828
pushq $0x7
popq %rsi
movl %ebp, %edx
leaq 0x571f(%rip), %rcx      # 0xb9a2
jmp 0x6369
movq 0xa599(%rip), %rdi      # 0x10828
movl %ebp, %esi
pushq $0x1e
popq %rdx
leaq 0x53ef(%rip), %rcx      # 0xb68a
xorl %eax, %eax
callq 0x31c0
movq 0xa57f(%rip), %rdi      # 0x10828
pushq $0x6
popq %rsi
movl %ebp, %edx
leaq 0x53ff(%rip), %rcx      # 0xb6b4
xorl %eax, %eax
callq 0x31c0
movq 0xa565(%rip), %rdi      # 0x10828
pushq $0x7
popq %rsi
movl %ebp, %edx
leaq 0x5432(%rip), %rcx      # 0xb701
jmp 0x6369
movq 0xa54d(%rip), %rdi      # 0x10828
movl %ebp, %esi
pushq $0x1e
popq %rdx
leaq 0x5467(%rip), %rcx      # 0xb74e
xorl %eax, %eax
callq 0x31c0
movq 0xa533(%rip), %rdi      # 0x10828
pushq $0x6
popq %rsi
movl %ebp, %edx
leaq 0x5476(%rip), %rcx      # 0xb777
xorl %eax, %eax
callq 0x31c0
movq 0xa519(%rip), %rdi      # 0x10828
pushq $0x7
popq %rsi
movl %ebp, %edx
leaq 0x5687(%rip), %rcx      # 0xb9a2
xorl %eax, %eax
callq 0x31c0
movq 0xa4ff(%rip), %rdi      # 0x10828
pushq $0x8
popq %rsi
movl %ebp, %edx
leaq 0x548f(%rip), %rcx      # 0xb7c4
xorl %eax, %eax
callq 0x31c0
movq 0xa4e5(%rip), %rdi      # 0x10828
pushq $0x9
popq %rsi
movl %ebp, %edx
leaq 0x54c2(%rip), %rcx      # 0xb811
xorl %eax, %eax
callq 0x31c0
movq 0xa4cb(%rip), %rdi      # 0x10828
pushq $0xa
popq %rsi
movl %ebp, %edx
leaq 0x54f5(%rip), %rcx      # 0xb85e
xorl %eax, %eax
callq 0x31c0
movq 0xa4b1(%rip), %rdi      # 0x10828
subq $0x8, %rsp
xorl %esi, %esi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
pushq $0x0
pushq $0x0
pushq $0x0
callq 0x3100
addq $0x20, %rsp
movq 0xa48b(%rip), %rdi      # 0x10828
movq %r15, %rsi
callq 0x4974
movq 0xa47c(%rip), %rdi      # 0x10828
callq 0x31b0
movq (%rbx), %rdi
callq 0x3120
leal -0x101(%rax), %ecx
cmpl $0x6, %ecx
jbe 0x63ef
cmpl $0xa, %eax
je 0x641c
cmpl $0x20, %eax
je 0x641c
cmpl $0x4a, %eax
je 0x63ff
cmpl $0x4b, %eax
je 0x640a
cmpl $0x157, %eax            # imm = 0x157
je 0x641c
cmpl $0x6b, %eax
je 0x640a
cmpl $0x6a, %eax
jne 0x6181
jmp 0x63ff
leaq 0x4c72(%rip), %rdx      # 0xb068
movslq (%rdx,%rcx,4), %rax
addq %rdx, %rax
jmpq *%rax
xorl %eax, %eax
cmpl $0x2, %r13d
setl %al
jmp 0x6414
xorl %eax, %eax
testl %r13d, %r13d
setg %al
negl %eax
addl %eax, %r13d
jmp 0x617d
cmpl $0x2, %r13d
ja 0x642d
leaq 0xa417(%rip), %rax      # 0x10840
movl %r13d, 0x28(%rax)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq