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

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

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

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

	/* Input buffer. */
	int keystroke;

	/* Erase the footer window. */
	werase( footer_window );
	wrefresh( footer_window );


	do
	{
		/* Erase the main window. */
		werase( main_window );

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

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

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

		/*                               0         1         2         3         4         5         6         7   */
		mvwprintw( main_window, yy++, tab1, "This is the number of times to run the wipe method on each device."  );
		mvwprintw( main_window, yy++, tab1, ""  );

		if( focus > 0 )
		{	
			/* Print the syslinux configuration hint. */
			mvwprintw( main_window, yy++, tab1, "syslinux.cfg:  nuke=\"dwipe --rounds %i\"", focus );

			/* Print this line last so that the cursor is in the right place. */
			mvwprintw( main_window, 2, tab1, "> %i", focus );
		}

		else
		{
			mvwprintw( main_window, yy++, tab1, "The number of rounds must be a non-negative integer." );

			/* Print this line last so that the cursor is in the right place. */
			mvwprintw( main_window, 2, tab1, "> " );
		}

		/* Reveal the cursor. */
		curs_set( 1 );

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

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

		switch( keystroke )
		{
			case '0':
			case '1':
			case '2':
			case '3':
			case '4':
			case '5':
			case '6':
			case '7':
			case '8':
			case '9':

				if( focus < 100000000 )
				{
					/* Left shift, base ten. */
					focus *= 10;

					/* This assumes ASCII input, where the zero character is 0x30. */
					focus += keystroke - 48;
				}

				break;

			case KEY_BACKSPACE:
			case KEY_LEFT:
			case 127:

				/* Right shift, base ten. */
				focus /= 10;

				break;

		} /* switch keystroke */

		/* Hide the cursor. */
		curs_set( 0 );

	} while( keystroke != 10 );

	if( focus > 0 )
	{
		/* Set the number of rounds. */
		dwipe_options.rounds = focus;
	}

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
leaq 0xa8b7(%rip), %rax      # 0x10840
movl 0x20(%rax), %ebx
movq 0xa87d(%rip), %rdi      # 0x10810
callq 0x3050
movq 0xa871(%rip), %rdi      # 0x10810
callq 0x31b0
pushq $0x2
popq %r12
pushq $0x6
popq %r15
pushq $0x1
popq %rbp
movq 0x9fea(%rip), %r14      # 0xffa0
movq 0xa86b(%rip), %rdi      # 0x10828
callq 0x3050
movq 0xa85f(%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 0xa839(%rip), %rdi      # 0x10828
leaq 0x529e(%rip), %rsi      # 0xb294
callq 0x4974
movq 0xa826(%rip), %rdi      # 0x10828
pushq $0x4
popq %rsi
movl %r12d, %edx
leaq 0x528e(%rip), %rcx      # 0xb29d
xorl %eax, %eax
callq 0x31c0
movq 0xa80b(%rip), %rdi      # 0x10828
pushq $0x5
popq %rsi
movl %r12d, %edx
leaq 0x6971(%rip), %rcx      # 0xc99b
xorl %eax, %eax
callq 0x31c0
movq 0xa7f0(%rip), %rdi      # 0x10828
movl %r15d, %esi
movl %r12d, %edx
testl %ebx, %ebx
jle 0x6073
leaq 0x5297(%rip), %rcx      # 0xb2e0
movl %ebx, %r8d
xorl %eax, %eax
callq 0x31c0
movq 0xa7ce(%rip), %rdi      # 0x10828
movl %r12d, %esi
movl %r12d, %edx
leaq 0x52a1(%rip), %rcx      # 0xb308
movl %ebx, %r8d
xorl %eax, %eax
callq 0x31c0
jmp 0x609c
leaq 0x5293(%rip), %rcx      # 0xb30d
xorl %eax, %eax
callq 0x31c0
movq 0xa7a0(%rip), %rdi      # 0x10828
movl %r12d, %esi
movl %r12d, %edx
leaq 0x52ad(%rip), %rcx      # 0xb342
xorl %eax, %eax
callq 0x31c0
movl %ebp, %edi
callq 0x30f0
movq 0xa77e(%rip), %rdi      # 0x10828
callq 0x31b0
movq (%r14), %rdi
callq 0x3120
movl %eax, %r13d
leal -0x30(%r13), %eax
cmpl $0xa, %eax
jae 0x60d7
cmpl $0x5f5e0ff, %ebx        # imm = 0x5F5E0FF
jg 0x60f9
imull $0xa, %ebx, %eax
leal (%rax,%r13), %ebx
addl $-0x30, %ebx
jmp 0x60f9
cmpl $0x7f, %r13d
je 0x60ef
cmpl $0x104, %r13d           # imm = 0x104
je 0x60ef
cmpl $0x107, %r13d           # imm = 0x107
jne 0x60f9
movl %ebx, %eax
cltd
pushq $0xa
popq %rcx
idivl %ecx
movl %eax, %ebx
xorl %edi, %edi
callq 0x30f0
cmpl $0xa, %r13d
jne 0x5fb6
testl %ebx, %ebx
jle 0x6118
leaq 0xa72b(%rip), %rax      # 0x10840
movl %ebx, 0x20(%rax)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq