// File: /workspace/github_c_makefile_star2_O3/sTeeLM[P]dwipe/gui.c
// Function: dwipe_gui_status
void dwipe_gui_status( int count, dwipe_context_t* c )
{
/**
 * Shows runtime statistics and overall progress.
 *
 * @parameter count           The number of contexts in the array.
 * @parameter c               An array of device contexts.
 *
 * @modifies  main_window     Prints information into the main window.
 * @modifies  c[].throughput  Updates the i/o throughput value. 
 *
 */

	/* Throughput print formats. */
	char* dwipe_tera = "%llu TB/s";
	char* dwipe_giga = "%llu GB/s";
	char* dwipe_mega = "%llu MB/s";
	char* dwipe_kilo = "%llu KB/s";
	char* dwipe_unit = "%llu B/s";

	/* The throughput format pointer. */
	char* dwipe_format;

	/* We count time from when this function is first called. */
	static time_t dwipe_time_start = 0;

	/* The current time. */
	time_t dwipe_time_now;

	/* The index of the element that is visible in the first slot. */
	static int offset;

	/* The number of elements that we can show in the window. */
	int slots;

	/* Window dimensions. */
	int wlines;
	int wcols;

	/* Generic loop variable. */
	int i;

	/* The current working line in the main window. */
	int yy;

	/* User input buffer. */
	int keystroke;

	/* The combined througput of all processes. */
	u64 dwipe_throughput = 0;

	/* The estimated runtime of the slowest device. */
	time_t dwipe_maxeta = 0;

	/* The combined number of errors of all processes. */
	u64 dwipe_errors = 0;

	/* Time values. */
	int dwipe_hh;
	int dwipe_mm;
	int dwipe_ss;

	/* The number of active wipe processes. */
	int dwipe_active = 0;


	if( dwipe_time_start == 0 )
	{
		/* This is the first time that we have been called. */
		dwipe_time_start = time( NULL ) -1;
	}

	/* Get the window dimensions. */
	getmaxyx( main_window, wlines, wcols );

	/* Less four lines for the box and padding. */
	slots = wlines - 4;

	/* Each element prints three lines. */
	slots /= 3;

	/* Get the current time. */
	dwipe_time_now = time( NULL );

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

	/* Erase the stats window. */
	werase( stats_window );

	/* Initialize our working offset to the third line. */
	yy = 2;


	/* Try to get a keystroke. */
	keystroke = getch();

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

				/* Scroll down. */
				offset += 1;

				if( count < slots )
				{
					offset = 0;
				}

				else if( offset + slots > count )
				{
					offset = count - slots;
				}

				break;

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

				/* Scroll up. */
				offset -= 1;

				if( offset < 0 )
				{
					offset = 0;
				}

				break;

			default:

				/* Do nothing. */
				break;

	} /* keystroke */


	/* Enumerate all contexts to compute statistics. */
	for( i = 0 ; i < count ; i++ )
	{
		/* Check whether the child process is still running the wipe. */
		if( c[i].pid > 0 )
		{
			/* Increment the child counter. */
			dwipe_active += 1;

			/* Maintain a rolling average of throughput. */
			dwipe_update_speedring( &c[i].speedring, c[i].round_done, dwipe_time_now );

			if( c[i].speedring.timestotal > 0 )
			{
				/* Update the current average throughput in bytes-per-second. */
				c[i].throughput = c[i].speedring.bytestotal / c[i].speedring.timestotal;

				/* Update the estimated remaining runtime. */
				c[i].eta = ( c[i].round_size - c[i].round_done ) / c[i].throughput;

				if( c[i].eta > dwipe_maxeta )
				{
					dwipe_maxeta = c[i].eta;
				}
			}

			/* Update the percentage value. */
			c[i].round_percent = (double) c[i].round_done / (double) c[i].round_size * 100;

			/* Accumulate combined throughput. */
			dwipe_throughput += c[i].throughput;

		} /* child running */

		/* Accumulate the error count. */
		dwipe_errors += c[i].pass_errors;
		dwipe_errors += c[i].verify_errors;

	} /* for statistics */


	/* Print information for the user. */
	for( i = offset ; i < offset + slots && i < count ; i++ )
	{
		/* Print the context label. */
		mvwprintw( main_window, yy++, 2, "%s", c[i].label );

		/* Check whether the child process is still running the wipe. */
		if( c[i].pid > 0 )
		{
			/* Print percentage and pass information. */
			mvwprintw( main_window, yy++, 4, "[%05.2f%%, round %i of %i, pass %i of %i] ", \
			  c[i].round_percent, c[i].round_working, c[i].round_count, c[i].pass_working, c[i].pass_count );

		} /* child running */

		else
		{
			if( c[i].result == 0 ) { mvwprintw( main_window, yy++, 4, "(success) " );                         }
			else if( c[i].signal ) { mvwprintw( main_window, yy++, 4, "(failure, signal %i) ", c[i].signal ); }
			else                   { mvwprintw( main_window, yy++, 4, "(failure, code %i) ", c[i].result );   }

		} /* child returned */

		if( c[i].verify_errors ) { wprintw( main_window, "[verify errors: %llu] ", c[i].verify_errors ); }
 		if( c[i].pass_errors   ) { wprintw( main_window, "[pass errors: %llu] ",   c[i].pass_errors   ); }


		switch( c[i].pass_type )
		{
			case DWIPE_PASS_FINAL_BLANK:
  				wprintw( main_window, "[blanking] " );
				break;

			case DWIPE_PASS_FINAL_OPS2:
  				wprintw( main_window, "[OPS-II final] " );
				break;

			case DWIPE_PASS_WRITE:
				wprintw( main_window, "[writing] " );
				break;

			case DWIPE_PASS_VERIFY:
				wprintw( main_window, "[verifying] " );
				break;

			case DWIPE_PASS_NONE:
				break;
		}

  		if( c[i].sync_status   ) { wprintw( main_window, "[syncing] "   ); }

		     if( c[i].throughput >= INT64_C( 1000000000000000 ) )
			    { wprintw( main_window, "[%llu TB/s] ", c[i].throughput / INT64_C( 1000000000000 ) ); }
		else if( c[i].throughput >= INT64_C( 1000000000000    ) )
		       { wprintw( main_window, "[%llu GB/s] ", c[i].throughput / INT64_C( 1000000000    ) ); }
		else if( c[i].throughput >= INT64_C( 1000000000       ) )
		       { wprintw( main_window, "[%llu MB/s] ", c[i].throughput / INT64_C( 1000000       ) ); }
		else if( c[i].throughput >= INT64_C( 1000000          ) )
		       { wprintw( main_window, "[%llu KB/s] ", c[i].throughput / INT64_C( 1000          ) ); }
		else
		       { wprintw( main_window, "[%llu B/s] ",  c[i].throughput / INT64_C( 1             ) ); }

		/* Insert whitespace. */
		yy += 1;

	} /* for */

	if( offset > 0 )
	{
		mvwprintw( main_window, 1, wcols -8, " More " );
		waddch( main_window, ACS_UARROW );
	}

	if( count - offset > slots )
	{
		mvwprintw( main_window, wlines -2, wcols -8, " More " );
		waddch( main_window, ACS_DARROW );
	}


	/* Box the main window. */
	box( main_window, 0, 0 );

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

	/* Update the load average field. */
	dwipe_gui_load();


	     if( dwipe_throughput >= INT64_C( 1000000000000000 ) )
		    { dwipe_throughput /= INT64_C( 1000000000000    ); dwipe_format = dwipe_tera; }
	else if( dwipe_throughput >= INT64_C( 1000000000000    ) )
	       { dwipe_throughput /= INT64_C( 1000000000       ); dwipe_format = dwipe_giga; }
	else if( dwipe_throughput >= INT64_C( 1000000000       ) )
	       { dwipe_throughput /= INT64_C( 1000000          ); dwipe_format = dwipe_mega; }
	else if( dwipe_throughput >= INT64_C( 1000000          ) )
	       { dwipe_throughput /= INT64_C( 1000             ); dwipe_format = dwipe_kilo; }
	else
	       { dwipe_throughput /= INT64_C( 1                ); dwipe_format = dwipe_unit; }

	/* Print the combined throughput. */
	mvwprintw( stats_window, DWIPE_GUI_STATS_THROUGHPUT_Y, DWIPE_GUI_STATS_THROUGHPUT_X, "Throughput:" );

	if( dwipe_throughput > 0 )
	{
		mvwprintw( stats_window, DWIPE_GUI_STATS_THROUGHPUT_Y, DWIPE_GUI_STATS_TAB, dwipe_format, dwipe_throughput );
	}

	/* Change the current time into a delta. */
	dwipe_time_now -= dwipe_time_start;

	/* Put the delta into HH:mm:ss form. */
	dwipe_hh = dwipe_time_now / 3600;
	dwipe_time_now %= 3600;
	dwipe_mm = dwipe_time_now / 60;
	dwipe_time_now %= 60;
	dwipe_ss = dwipe_time_now;

	/* Print the runtime. */
	mvwprintw( stats_window, DWIPE_GUI_STATS_RUNTIME_Y, 1, "Runtime:" );
	mvwprintw( stats_window, DWIPE_GUI_STATS_RUNTIME_Y, DWIPE_GUI_STATS_TAB, "%02i:%02i:%02i", dwipe_hh, dwipe_mm, dwipe_ss );

	mvwprintw( stats_window, DWIPE_GUI_STATS_ETA_Y, 1, "Remaining:" );

	if( dwipe_maxeta > 0 )
	{
		/* Do it again for the estimated runtime remaining. */
		dwipe_hh = dwipe_maxeta / 3600;
		dwipe_maxeta %= 3600;
		dwipe_mm = dwipe_maxeta / 60;
		dwipe_maxeta %= 60;
		dwipe_ss = dwipe_maxeta;
	
		/* Print the estimated runtime remaining. */
		mvwprintw( stats_window, DWIPE_GUI_STATS_ETA_Y, DWIPE_GUI_STATS_TAB, "%02i:%02i:%02i", dwipe_hh, dwipe_mm, dwipe_ss );
	}

	/* Print the error count. */
	mvwprintw( stats_window, DWIPE_GUI_STATS_ERRORS_Y, DWIPE_GUI_STATS_ERRORS_X, "Errors:" );
	mvwprintw( stats_window, DWIPE_GUI_STATS_ERRORS_Y, DWIPE_GUI_STATS_TAB, "%llu", dwipe_errors );

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

	/* Add a title. */
	mvwprintw( stats_window, 0, ( DWIPE_GUI_STATS_W - strlen( stats_title ) ) /2, "%s", stats_title );

	/* Refresh the stats window. */
	wrefresh( stats_window );

}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movq %rsi, %r12
movl %edi, %ebx
cmpq $0x0, 0xad1b(%rip)      # 0x11830
jne 0x6b28
xorl %edi, %edi
callq 0x32b0
decq %rax
movq %rax, 0xad08(%rip)      # 0x11830
movq 0xacf9(%rip), %rax      # 0x11828
testq %rax, %rax
je 0x6b45
movswl 0x4(%rax), %r14d
incl %r14d
movswl 0x6(%rax), %ebp
addl $-0x7, %ebp
jmp 0x6b50
movl $0xfffffff7, %ebp       # imm = 0xFFFFFFF7
movl $0xffffffff, %r14d      # imm = 0xFFFFFFFF
leal -0x4(%r14), %eax
cltq
imulq $0x55555556, %rax, %rcx # imm = 0x55555556
movq %rcx, %rax
shrq $0x3f, %rax
shrq $0x20, %rcx
addl %eax, %ecx
movq %rcx, 0x18(%rsp)
xorl %edi, %edi
callq 0x32b0
movq %rax, 0x30(%rsp)
movq 0xaca6(%rip), %rdi      # 0x11828
callq 0x3050
movq 0xac92(%rip), %rdi      # 0x11820
callq 0x3050
movq 0xa406(%rip), %rax      # 0x10fa0
movq (%rax), %rdi
callq 0x3120
cmpl $0x6a, %eax
jg 0x6bb8
cmpl $0x4a, %eax
je 0x6bcb
cmpl $0x4b, %eax
je 0x6bef
cmpl $0x6a, %eax
je 0x6bcb
jmp 0x6c08
cmpl $0x6b, %eax
je 0x6bef
cmpl $0x103, %eax            # imm = 0x103
je 0x6bef
cmpl $0x102, %eax            # imm = 0x102
jne 0x6c08
movl 0xac67(%rip), %ecx      # 0x11838
incl %ecx
movl %ecx, 0xac5f(%rip)      # 0x11838
xorl %eax, %eax
movl %ebx, %edx
subl 0x18(%rsp), %edx
jl 0x6c02
addl 0x18(%rsp), %ecx
cmpl %ebx, %ecx
jle 0x6c08
movl %edx, %eax
jmp 0x6c02
movl 0xac43(%rip), %ecx      # 0x11838
cmpl $0x2, %ecx
movl $0x1, %eax
cmovgel %ecx, %eax
decl %eax
movl %eax, 0xac30(%rip)      # 0x11838
movl %ebp, 0x24(%rsp)
movq %r14, 0x28(%rsp)
testl %ebx, %ebx
movl %ebx, 0xc(%rsp)
jle 0x6d4b
movl %ebx, %eax
leaq 0x370(%r12), %r14
imulq $0x590, %rax, %r13      # imm = 0x590
xorl %ebp, %ebp
xorl %ebx, %ebx
movq $0x0, 0x10(%rsp)
xorl %r15d, %r15d
cmpl $0x0, 0x310(%r12,%rbp)
jle 0x6d29
leaq (%r14,%rbp), %rdi
movq 0x340(%r12,%rbp), %rsi
movq 0x30(%rsp), %rdx
callq 0x73b9
movq 0x560(%r12,%rbp), %rcx
movq 0x340(%r12,%rbp), %rdi
testq %rcx, %rcx
jle 0x6cbe
movq 0x350(%r12,%rbp), %rsi
movq 0x460(%r12,%rbp), %rax
xorl %edx, %edx
divq %rcx
movq %rax, %rcx
movq %rax, 0x580(%r12,%rbp)
movq %rsi, %rax
subq %rdi, %rax
xorl %edx, %edx
divq %rcx
movq %rax, 0x2d0(%r12,%rbp)
movq 0x10(%rsp), %rdx
cmpq %rdx, %rax
cmovaq %rax, %rdx
movq %rdx, 0x10(%rsp)
jmp 0x6cce
movq 0x350(%r12,%rbp), %rsi
movq 0x580(%r12,%rbp), %rcx
movq %rdi, %xmm0
movq 0x53c5(%rip), %xmm2     # 0xc0a0
punpckldq %xmm2, %xmm0    # xmm0 = xmm0[0],xmm2[0],xmm0[1],xmm2[1]
movapd 0x53c9(%rip), %xmm3     # 0xc0b0
subpd %xmm3, %xmm0
movapd %xmm0, %xmm1
unpckhpd %xmm0, %xmm1            # xmm1 = xmm1[1],xmm0[1]
addsd %xmm0, %xmm1
movq %rsi, %xmm0
punpckldq %xmm2, %xmm0    # xmm0 = xmm0[0],xmm2[0],xmm0[1],xmm2[1]
subpd %xmm3, %xmm0
movapd %xmm0, %xmm2
unpckhpd %xmm0, %xmm2            # xmm2 = xmm2[1],xmm0[1]
addsd %xmm0, %xmm2
divsd %xmm2, %xmm1
mulsd 0x53a4(%rip), %xmm1     # 0xc0c0
movsd %xmm1, 0x358(%r12,%rbp)
addq %rcx, %r15
addq 0x2f8(%r12,%rbp), %rbx
addq 0x588(%r12,%rbp), %rbx
addq $0x590, %rbp            # imm = 0x590
cmpq %rbp, %r13
jne 0x6c3e
jmp 0x6d59
xorl %r15d, %r15d
movq $0x0, 0x10(%rsp)
xorl %ebx, %ebx
movl 0xaad9(%rip), %eax      # 0x11838
cmpl $0x7, 0x28(%rsp)
setl %cl
movl 0xc(%rsp), %esi
cmpl %esi, %eax
setge %dl
orb %cl, %dl
jne 0x6fef
movslq %eax, %rbp
movslq %esi, %r14
imulq $0x590, %rbp, %rax      # imm = 0x590
addq %rax, %r12
addq $0x2e0, %r12            # imm = 0x2E0
incq %rbp
movl $0x3, %r13d
leal -0x1(%r13), %esi
movq 0xaa85(%rip), %rdi      # 0x11828
movq (%r12), %r8
movl $0x2, %edx
leaq 0x549a(%rip), %rcx      # 0xc24d
xorl %eax, %eax
callq 0x31c0
cmpl $0x0, 0x30(%r12)
jle 0x6e07
movq 0xaa5f(%rip), %rdi      # 0x11828
movsd 0x78(%r12), %xmm0
movl 0x80(%r12), %r8d
movl 0x5c(%r12), %r9d
movl 0x8(%r12), %r10d
movl 0x2c(%r12), %r11d
movl %r13d, %esi
movl $0x4, %edx
leaq 0x6340(%rip), %rcx      # 0xd136
movb $0x1, %al
pushq %r10
pushq %r11
callq 0x31c0
addq $0x10, %rsp
jmp 0x6e65
movl 0x58(%r12), %r8d
testl %r8d, %r8d
je 0x6e38
movl 0x8c(%r12), %eax
movq 0xaa08(%rip), %rdi      # 0x11828
movl %r13d, %esi
movl $0x4, %edx
testl %eax, %eax
je 0x6e57
leaq 0x6339(%rip), %rcx      # 0xd16c
movl %eax, %r8d
jmp 0x6e5e
movq 0xa9e9(%rip), %rdi      # 0x11828
movl %r13d, %esi
movl $0x4, %edx
leaq 0x6313(%rip), %rcx      # 0xd161
xorl %eax, %eax
callq 0x31c0
jmp 0x6e65
leaq 0x6324(%rip), %rcx      # 0xd182
xorl %eax, %eax
callq 0x31c0
movq 0x2a8(%r12), %rdx
testq %rdx, %rdx
je 0x6e87
movq 0xa9af(%rip), %rdi      # 0x11828
leaq 0x6316(%rip), %rsi      # 0xd196
xorl %eax, %eax
callq 0x3440
movq 0x18(%r12), %rdx
testq %rdx, %rdx
je 0x6ea6
movq 0xa990(%rip), %rdi      # 0x11828
leaq 0x630e(%rip), %rsi      # 0xd1ad
xorl %eax, %eax
callq 0x3440
movl 0x28(%r12), %eax
decl %eax
cmpl $0x3, %eax
ja 0x6ed0
movl %eax, %eax
leaq 0x51c9(%rip), %rcx      # 0xc084
movslq (%rcx,%rax,4), %rsi
addq %rcx, %rsi
movq 0xa95f(%rip), %rdi      # 0x11828
xorl %eax, %eax
callq 0x3440
cmpw $0x0, 0x29c(%r12)
je 0x6ef1
movq 0xa945(%rip), %rdi      # 0x11828
leaq 0x630c(%rip), %rsi      # 0xd1f6
xorl %eax, %eax
callq 0x3440
movq 0x2a0(%r12), %rax
movabsq $0x38d7ea4c67fff, %rcx  # imm = 0x38D7EA4C67FFF
cmpq %rcx, %rax
jbe 0x6f2c
movq 0xa919(%rip), %rdi      # 0x11828
movabsq $0x232f33025bd42233, %rcx # imm = 0x232F33025BD42233
mulq %rcx
shrq $0x25, %rdx
leaq 0x62da(%rip), %rsi      # 0xd201
jmp 0x6fb8
movabsq $0xe8d4a50fff, %rcx     # imm = 0xE8D4A50FFF
cmpq %rcx, %rax
jbe 0x6f60
movq 0xa8e6(%rip), %rdi      # 0x11828
shrq $0x9, %rax
movabsq $0x44b82fa09b5a53, %rcx # imm = 0x44B82FA09B5A53
mulq %rcx
shrq $0xb, %rdx
leaq 0x62b0(%rip), %rsi      # 0xd20e
jmp 0x6fb8
cmpq $0x3b9aca00, %rax       # imm = 0x3B9ACA00
jb 0x6f89
movq 0xa8b9(%rip), %rdi      # 0x11828
movabsq $0x431bde82d7b634db, %rcx # imm = 0x431BDE82D7B634DB
mulq %rcx
shrq $0x12, %rdx
leaq 0x6294(%rip), %rsi      # 0xd21b
jmp 0x6fb8
movq 0xa898(%rip), %rdi      # 0x11828
cmpq $0xf4240, %rax          # imm = 0xF4240
jb 0x6fae
movl %eax, %eax
imulq $0x10624dd3, %rax, %rdx # imm = 0x10624DD3
shrq $0x26, %rdx
leaq 0x627c(%rip), %rsi      # 0xd228
jmp 0x6fb8
leaq 0x6280(%rip), %rsi      # 0xd235
movq %rax, %rdx
xorl %eax, %eax
callq 0x3440
movl 0xa873(%rip), %eax      # 0x11838
movq 0x18(%rsp), %rcx
addl %eax, %ecx
movslq %ecx, %rcx
cmpq %rcx, %rbp
jge 0x6fef
addq $0x590, %r12            # imm = 0x590
leaq 0x1(%rbp), %rcx
addl $0x3, %r13d
cmpq %r14, %rbp
movq %rcx, %rbp
jl 0x6d98
testl %eax, %eax
movl 0x24(%rsp), %ebp
jle 0x7032
movq 0xa82a(%rip), %rdi      # 0x11828
leaq 0x5218(%rip), %rcx      # 0xc21d
movl $0x1, %esi
movl %ebp, %edx
xorl %eax, %eax
callq 0x31c0
movq 0xa80e(%rip), %rdi      # 0x11828
movq 0x9f77(%rip), %rax      # 0x10f98
movl 0xb4(%rax), %esi
callq 0x33f0
movl 0xa806(%rip), %eax      # 0x11838
movl 0xc(%rsp), %ecx
subl %eax, %ecx
cmpl 0x18(%rsp), %ecx
jle 0x7076
movq 0xa7e3(%rip), %rdi      # 0x11828
movq 0x28(%rsp), %rsi
addl $-0x2, %esi
leaq 0x51c9(%rip), %rcx      # 0xc21d
movl %ebp, %edx
xorl %eax, %eax
callq 0x31c0
movq 0xa7c4(%rip), %rdi      # 0x11828
movq 0x9f2d(%rip), %rax      # 0x10f98
movl 0xb8(%rax), %esi
callq 0x33f0
movq 0xa7ab(%rip), %rdi      # 0x11828
subq $0x8, %rsp
xorl %eax, %eax
xorl %esi, %esi
xorl %edx, %edx
xorl %ecx, %ecx
xorl %r8d, %r8d
xorl %r9d, %r9d
pushq %rax
pushq %rax
pushq %rax
callq 0x3100
addq $0x20, %rsp
movq 0xa786(%rip), %rdi      # 0x11828
callq 0x31b0
callq 0x69fa
movabsq $0x38d7ea4c67fff, %rax  # imm = 0x38D7EA4C67FFF
cmpq %rax, %r15
jbe 0x70db
movabsq $0x232f33025bd42233, %rcx # imm = 0x232F33025BD42233
movq %r15, %rax
mulq %rcx
movq %rdx, %r15
shrq $0x25, %r15
leaq 0x602c(%rip), %r12      # 0xd105
jmp 0x7159
movq %r15, %rax
shrq $0xc, %rax
cmpq $0xe8d4a51, %rax        # imm = 0xE8D4A51
jb 0x710e
shrq $0x9, %r15
movabsq $0x44b82fa09b5a53, %rcx # imm = 0x44B82FA09B5A53
movq %r15, %rax
mulq %rcx
movq %rdx, %r15
shrq $0xb, %r15
leaq 0x6003(%rip), %r12      # 0xd10f
jmp 0x7159
cmpq $0x3b9aca00, %r15       # imm = 0x3B9ACA00
jb 0x7137
movabsq $0x431bde82d7b634db, %rcx # imm = 0x431BDE82D7B634DB
movq %r15, %rax
mulq %rcx
movq %rdx, %r15
shrq $0x12, %r15
leaq 0x5fe4(%rip), %r12      # 0xd119
jmp 0x7159
cmpq $0xf4240, %r15          # imm = 0xF4240
jb 0x7385
movl %r15d, %eax
imulq $0x10624dd3, %rax, %r15 # imm = 0x10624DD3
shrq $0x26, %r15
leaq 0x5fca(%rip), %r12      # 0xd123
movq 0xa6c0(%rip), %rdi      # 0x11820
leaq 0x60da(%rip), %rcx      # 0xd241
movl $0x4, %esi
movl $0x1, %edx
xorl %eax, %eax
callq 0x31c0
movq 0xa6a1(%rip), %rdi      # 0x11820
movl $0x4, %esi
movl $0x10, %edx
movq %r12, %rcx
movq %r15, %r8
xorl %eax, %eax
callq 0x31c0
movq 0x30(%rsp), %rsi
subq 0xa68e(%rip), %rsi      # 0x11830
movabsq $0x48d159e26af37c05, %rcx # imm = 0x48D159E26AF37C05
movq %rsi, %rax
imulq %rcx
movq %rdx, %r15
shrq $0x3f, %r15
shrq $0xa, %rdx
addl %edx, %r15d
imull $0xe10, %r15d, %eax     # imm = 0xE10
subl %eax, %esi
movswl %si, %eax
imull $0xffff8889, %eax, %eax # imm = 0xFFFF8889
shrl $0x10, %eax
addl %esi, %eax
movzwl %ax, %eax
movswl %ax, %ecx
shrl $0xf, %eax
sarl $0x5, %ecx
addl %eax, %ecx
movswl %cx, %ebp
imull $0x3c, %ecx, %eax
subl %eax, %esi
movswl %si, %r12d
movq 0xa628(%rip), %rdi      # 0x11820
leaq 0x604e(%rip), %rcx      # 0xd24d
xorl %r14d, %r14d
movl $0x1, %esi
movl $0x1, %edx
xorl %eax, %eax
callq 0x31c0
movq 0xa606(%rip), %rdi      # 0x11820
subq $0x8, %rsp
leaq 0x6031(%rip), %rcx      # 0xd256
movl $0x1, %esi
movl $0x10, %edx
movl %r15d, %r8d
movl %ebp, %r9d
xorl %eax, %eax
pushq %r12
callq 0x31c0
addq $0x10, %rsp
movq 0xa5d7(%rip), %rdi      # 0x11820
leaq 0x6015(%rip), %rcx      # 0xd265
movl $0x2, %esi
movl $0x1, %edx
xorl %eax, %eax
callq 0x31c0
movq 0x10(%rsp), %rsi
testq %rsi, %rsi
jle 0x72cd
movq %rsi, %rax
shrq $0x4, %rax
movabsq $0x91a2b3c4d5e6f81, %rcx # imm = 0x91A2B3C4D5E6F81
mulq %rcx
movq %rdx, %r8
shrq $0x3, %r8
imull $0xe10, %r8d, %eax      # imm = 0xE10
subl %eax, %esi
imull $0x889, %esi, %r9d      # imm = 0x889
shrl $0x11, %r9d
imull $0x3c, %r9d, %eax
subl %eax, %esi
movzwl %si, %r10d
movq 0xa575(%rip), %rdi      # 0x11820
subq $0x8, %rsp
leaq 0x5fa0(%rip), %rcx      # 0xd256
movl $0x2, %esi
movl $0x10, %edx
xorl %eax, %eax
pushq %r10
callq 0x31c0
addq $0x10, %rsp
movq 0xa54c(%rip), %rdi      # 0x11820
leaq 0x5f95(%rip), %rcx      # 0xd270
movl $0x5, %esi
movl $0x1, %edx
xorl %eax, %eax
callq 0x31c0
movq 0xa52d(%rip), %rdi      # 0x11820
leaq 0x5f7e(%rip), %rcx      # 0xd278
movl $0x5, %esi
movl $0x10, %edx
movq %rbx, %r8
xorl %eax, %eax
callq 0x31c0
movq 0xa50b(%rip), %rdi      # 0x11820
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 0xa4e5(%rip), %rbx      # 0x11820
movq 0xa316(%rip), %r14      # 0x11658
movq %r14, %rdi
callq 0x3150
movl $0x24, %edx
subq %rax, %rdx
shrq %rdx
leaq 0x4ef1(%rip), %rcx      # 0xc24d
movq %rbx, %rdi
xorl %esi, %esi
movq %r14, %r8
xorl %eax, %eax
callq 0x31c0
movq 0xa4ae(%rip), %rdi      # 0x11820
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x31b0
movq 0xa494(%rip), %rdi      # 0x11820
leaq 0x5eae(%rip), %rcx      # 0xd241
movl $0x4, %esi
movl $0x1, %edx
xorl %eax, %eax
callq 0x31c0
testq %r15, %r15
je 0x7196
leaq 0x5d79(%rip), %r12      # 0xd12d
jmp 0x7178