// File: /workspace/github_c_makefile_star2_O0/sTeeLM[P]dwipe/method.c
// Function: dwipe_runmethod
int dwipe_runmethod( DWIPE_METHOD_SIGNATURE, dwipe_pattern_t* patterns )
{
/**
 * Writes patterns to the device.
 *
 */

	/* The result holder. */
	int r;

	/* An index variable. */
	int i = 0;

	/* The zero-fill pattern for the final pass of most methods. */
	dwipe_pattern_t pattern_zero = { 1, "\x00" };


	/* Create the PRNG state buffer. */
	c->prng_seed.length = DWIPE_KNOB_PRNG_STATE_LENGTH;
	c->prng_seed.s = malloc( c->prng_seed.length );

	/* Check the memory allocation. */
	if( ! c->prng_seed.s )
	{
		dwipe_perror( errno, __FUNCTION__, "malloc" );
		dwipe_log( DWIPE_LOG_FATAL, "Unable to allocate memory for the prng seed buffer." );
		return -1;
	}

	/* Count the number of patterns in the array. */
	while( patterns[i].length ) { i += 1; }
 

	/* Tell the parent the number of device passes that will be run in one round. */
	c->pass_count = i;

	/* Set the number of bytes that will be written across all passes in one round. */
	c->pass_size = c->pass_count * c->device_size;

	if( dwipe_options.verify == DWIPE_VERIFY_ALL )
	{
		/* We must read back all passes, so double the byte count. */
		c->pass_size *= 2;
	}


	/* Tell the parent the number of rounds that will be run. */
	c->round_count = dwipe_options.rounds;

	/* Set the number of bytes that will be written across all rounds. */
	c->round_size = c->round_count * c->pass_size;

	/* The final pass is always a zero fill, except ops2 which is random. */
	c->round_size += c->device_size;

	if( dwipe_options.verify == DWIPE_VERIFY_LAST || dwipe_options.verify == DWIPE_VERIFY_ALL )
	{
		/* We must read back the last pass to verify it. */
		c->round_size += c->device_size;
	}


	/* Initialize the working round counter. */
	c->round_working = 0;

	dwipe_log( DWIPE_LOG_NOTICE, "Invoking method '%s' on device '%s'.", \
	  dwipe_method_label( dwipe_options.method ), c->device_name );

	while( c->round_working < c->round_count )
	{
		/* Increment the round counter. */
		c->round_working += 1;

		dwipe_log( DWIPE_LOG_NOTICE, "Starting round %i of %i on device '%s'.", \
		  c->round_working, c->round_count, c->device_name );

		/* Initialize the working pass counter. */
		c->pass_working = 0;

		for( i = 0 ; i < c->pass_count ; i++ )
		{
			/* Increment the working pass. */
			c->pass_working += 1;

			dwipe_log( DWIPE_LOG_NOTICE, "Starting pass %i of %i, round %i of %i, on device '%s'.", \
			  c->pass_working, c->pass_count, c->round_working, c->round_count, c->device_name );

			if( patterns[i].length == 0 )
			{
				/* Caught insanity. */
				dwipe_log( DWIPE_LOG_SANITY, "dwipe_runmethod: A non-terminating pattern element has zero length." );
				return -1;
			}
	
			if( patterns[i].length > 0 )
			{

				/* Write a static pass. */
				c->pass_type = DWIPE_PASS_WRITE;
				r = dwipe_static_pass( c, &patterns[i] );
				c->pass_type = DWIPE_PASS_NONE;
	
				/* Check for a fatal error. */
				if( r < 0 ) { return r; }
	
				if( dwipe_options.verify == DWIPE_VERIFY_ALL )
				{

					dwipe_log( DWIPE_LOG_NOTICE, "Verifying pass %i of %i, round %i of %i, on device '%s'.", \
			  		  c->pass_working, c->pass_count, c->round_working, c->round_count, c->device_name );

					/* Verify this pass. */
					c->pass_type = DWIPE_PASS_VERIFY;
					r = dwipe_static_verify( c, &patterns[i] );
					c->pass_type = DWIPE_PASS_NONE;
	
					/* Check for a fatal error. */
					if( r < 0 ) { return r; }

					dwipe_log( DWIPE_LOG_NOTICE, "Verified pass %i of %i, round %i of %i, on device '%s'.", \
			  		  c->pass_working, c->pass_count, c->round_working, c->round_count, c->device_name );
				}
		
			} /* static pass */
	
			else
			{
				c->pass_type = DWIPE_PASS_WRITE;

				/* Seed the PRNG. */
				r = read( c->entropy_fd, c->prng_seed.s, c->prng_seed.length );
	
				/* Check the result. */
				if( r < 0 )
				{
					c->pass_type = DWIPE_PASS_NONE;
					dwipe_perror( errno, __FUNCTION__, "read" );
					dwipe_log( DWIPE_LOG_FATAL, "Unable to seed the PRNG." );
					return -1;
				}
	
				/* Check for a partial read. */
				if( r != c->prng_seed.length )
				{
					/* TODO: Handle partial reads. */
					dwipe_log( DWIPE_LOG_FATAL, "Insufficient entropy is available." );
					return -1;
				}
	
				/* Write the random pass. */
				r = dwipe_random_pass( c );
				c->pass_type = DWIPE_PASS_NONE;
	
				/* Check for a fatal error. */
				if( r < 0 ) { return r; }
	
				if( dwipe_options.verify == DWIPE_VERIFY_ALL )
				{
					dwipe_log( DWIPE_LOG_NOTICE, "Verifying pass %i of %i, round %i of %i, on device '%s'.", \
			  		  c->pass_working, c->pass_count, c->round_working, c->round_count, c->device_name );

					/* Verify this pass. */
					c->pass_type = DWIPE_PASS_VERIFY;
					r = dwipe_random_verify( c );
					c->pass_type = DWIPE_PASS_NONE;
	
					/* Check for a fatal error. */
					if( r < 0 ) { return r; }

					dwipe_log( DWIPE_LOG_NOTICE, "Verified pass %i of %i, round %i of %i, on device '%s'.", \
			  		  c->pass_working, c->pass_count, c->round_working, c->round_count, dwipe_method_label( dwipe_options.method ) );
				}
	
			} /* random pass */
	
			dwipe_log( DWIPE_LOG_NOTICE, "Finished pass %i of %i, round %i of %i, on device '%s'.", \
			  c->pass_working, c->pass_count, c->round_working, c->round_count, c->device_name );

		} /* for passes */

		dwipe_log( DWIPE_LOG_NOTICE, "Finished round %i of %i on device '%s'.", \
		  c->round_working, c->round_count, c->device_name );
	
	} /* while rounds */


	if( dwipe_options.method == &dwipe_ops2 )
	{
		/* NOTE: The OPS-II method specifically requires that a random pattern be left on the device. */

		/* Tell the parent that we are running the final pass. */
		c->pass_type = DWIPE_PASS_FINAL_OPS2;

		/* Seed the PRNG. */
		r = read( c->entropy_fd, c->prng_seed.s, c->prng_seed.length );
	
		/* Check the result. */
		if( r < 0 )
		{
			dwipe_perror( errno, __FUNCTION__, "read" );
			dwipe_log( DWIPE_LOG_FATAL, "Unable to seed the PRNG." );
			return -1;
		}
	
		/* Check for a partial read. */
		if( r != c->prng_seed.length )
		{
			/* TODO: Handle partial reads. */
			dwipe_log( DWIPE_LOG_FATAL, "Insufficient entropy is available." );
			return -1;
		}
	
		dwipe_log( DWIPE_LOG_NOTICE, "Writing final random pattern to '%s'.", c->device_name );

		/* The final ops2 pass. */
		r = dwipe_random_pass( c );

		/* Check for a fatal error. */
		if( r < 0 ) { return r; }

		if( dwipe_options.verify == DWIPE_VERIFY_LAST || dwipe_options.verify == DWIPE_VERIFY_ALL )
		{
			dwipe_log( DWIPE_LOG_NOTICE, "Verifying the final random pattern on '%s' is empty.", c->device_name );

			/* Verify the final zero pass. */
			r = dwipe_random_verify( c );

			/* Check for a fatal error. */
			if( r < 0 ) { return r; }

			dwipe_log( DWIPE_LOG_NOTICE, "Verified the final random pattern on '%s' is empty.", c->device_name );
		}

		dwipe_log( DWIPE_LOG_NOTICE, "Wrote final random pattern to '%s'.", c->device_name );

	} /* final ops2 */


	else
	{
		/* Tell the user that we are on the final pass. */
		c->pass_type = DWIPE_PASS_FINAL_BLANK;

		dwipe_log( DWIPE_LOG_NOTICE, "Blanking device '%s'.", c->device_name );

		/* The final zero pass. */
		r = dwipe_static_pass( c, &pattern_zero );
	
		/* Check for a fatal error. */
		if( r < 0 ) { return r; }
	
	
		if( dwipe_options.verify == DWIPE_VERIFY_LAST || dwipe_options.verify == DWIPE_VERIFY_ALL )
		{
			dwipe_log( DWIPE_LOG_NOTICE, "Verifying that '%s' is empty.", c->device_name );
	
			/* Verify the final zero pass. */
			r = dwipe_static_verify( c, &pattern_zero );
	
			/* Check for a fatal error. */
			if( r < 0 ) { return r; }
	
			dwipe_log( DWIPE_LOG_NOTICE, "Verified that '%s' is empty.", c->device_name );
		}

		dwipe_log( DWIPE_LOG_NOTICE, "Blanked device '%s'.", c->device_name );

	} /* final blank */
	
	/* Release the state buffer. */
	c->prng_seed.length = 0;
	free( c->prng_seed.s );
	
	/* Tell the parent that we have fininshed the final pass. */
	c->pass_type = DWIPE_PASS_NONE;

	if( c->verify_errors > 0 )
	{
		/* We finished, but with non-fatal verification errors. */
		dwipe_log( DWIPE_LOG_ERROR, "%llu verification errors on device '%s'.", c->verify_errors, c->device_name );
	}

	if( c->pass_errors > 0 )
	{
		/* We finished, but with non-fatal wipe errors. */
		dwipe_log( DWIPE_LOG_ERROR, "%llu wipe errors on device '%s'.", c->pass_errors, c->device_name );
	}

	/* FIXME: The 'round_errors' context member is not being used. */

	if( c->pass_errors > 0 || c->round_errors > 0 || c->verify_errors > 0 )
	{
		/* We finished, but with non-fatal errors. */
		return 1;
	}
	
	/* We finished successfully. */
	return 0;	
	
}

// Assembly:
subq $0x48, %rsp
movq %rdi, 0x38(%rsp)
movq %rsi, 0x30(%rsp)
movl $0x0, 0x28(%rsp)
movq 0x80a3(%rip), %rax      # 0x13d90
movq %rax, 0x18(%rsp)
movq 0x809f(%rip), %rax      # 0x13d98
movq %rax, 0x20(%rsp)
movq 0x38(%rsp), %rax
movq $0x200, 0x320(%rax) # imm = 0x200
movq 0x38(%rsp), %rax
movq 0x320(%rax), %rdi
callq 0x32f0
movq %rax, %rcx
movq 0x38(%rsp), %rax
movq %rcx, 0x328(%rax)
movq 0x38(%rsp), %rax
cmpq $0x0, 0x328(%rax)
jne 0xbd77
callq 0x3070
movl (%rax), %edi
leaq 0x5827(%rip), %rsi      # 0x11572
leaq 0x3e77(%rip), %rdx      # 0xfbc9
callq 0xb160
movl $0x6, %edi
leaq 0x581f(%rip), %rsi      # 0x11582
movb $0x0, %al
callq 0xade0
movl $0xffffffff, 0x44(%rsp) # imm = 0xFFFFFFFF
jmp 0xc785
jmp 0xbd79
movq 0x30(%rsp), %rax
movslq 0x28(%rsp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
cmpl $0x0, (%rax)
je 0xbd9c
movl 0x28(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x28(%rsp)
jmp 0xbd79
movl 0x28(%rsp), %ecx
movq 0x38(%rsp), %rax
movl %ecx, 0x2e8(%rax)
movq 0x38(%rsp), %rax
movslq 0x2e8(%rax), %rcx
movq 0x38(%rsp), %rax
imulq 0x230(%rax), %rcx
movq 0x38(%rsp), %rax
movq %rcx, 0x300(%rax)
leaq 0x8a59(%rip), %rax      # 0x14830
cmpl $0x2, 0x28(%rax)
jne 0xbdf3
movq 0x38(%rsp), %rax
movq 0x300(%rax), %rcx
shlq %rcx
movq %rcx, 0x300(%rax)
leaq 0x8a36(%rip), %rax      # 0x14830
movl 0x20(%rax), %ecx
movq 0x38(%rsp), %rax
movl %ecx, 0x33c(%rax)
movq 0x38(%rsp), %rax
movslq 0x33c(%rax), %rcx
movq 0x38(%rsp), %rax
imulq 0x300(%rax), %rcx
movq 0x38(%rsp), %rax
movq %rcx, 0x350(%rax)
movq 0x38(%rsp), %rax
movq 0x230(%rax), %rcx
movq 0x38(%rsp), %rax
addq 0x350(%rax), %rcx
movq %rcx, 0x350(%rax)
leaq 0x89dd(%rip), %rax      # 0x14830
cmpl $0x1, 0x28(%rax)
je 0xbe66
leaq 0x89d0(%rip), %rax      # 0x14830
cmpl $0x2, 0x28(%rax)
jne 0xbe85
movq 0x38(%rsp), %rax
movq 0x230(%rax), %rcx
movq 0x38(%rsp), %rax
addq 0x350(%rax), %rcx
movq %rcx, 0x350(%rax)
movq 0x38(%rsp), %rax
movl $0x0, 0x360(%rax)
leaq 0x8995(%rip), %rax      # 0x14830
movq 0x10(%rax), %rdi
callq 0xb1c0
movq %rax, %rdx
movq 0x38(%rsp), %rax
movq 0x228(%rax), %rcx
movl $0x3, %edi
leaq 0x56f7(%rip), %rsi      # 0x115b6
movb $0x0, %al
callq 0xade0
movq 0x38(%rsp), %rax
movl 0x360(%rax), %eax
movq 0x38(%rsp), %rcx
cmpl 0x33c(%rcx), %eax
jge 0xc409
movq 0x38(%rsp), %rax
movl 0x360(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x360(%rax)
movq 0x38(%rsp), %rax
movl 0x360(%rax), %edx
movq 0x38(%rsp), %rax
movl 0x33c(%rax), %ecx
movq 0x38(%rsp), %rax
movq 0x228(%rax), %r8
movl $0x3, %edi
leaq 0x56b7(%rip), %rsi      # 0x115db
movb $0x0, %al
callq 0xade0
movq 0x38(%rsp), %rax
movl $0x0, 0x30c(%rax)
movl $0x0, 0x28(%rsp)
movl 0x28(%rsp), %eax
movq 0x38(%rsp), %rcx
cmpl 0x2e8(%rcx), %eax
jge 0xc3cf
movq 0x38(%rsp), %rax
movl 0x30c(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x30c(%rax)
movq 0x38(%rsp), %rax
movl 0x30c(%rax), %edx
movq 0x38(%rsp), %rax
movl 0x2e8(%rax), %ecx
movq 0x38(%rsp), %rax
movl 0x360(%rax), %r8d
movq 0x38(%rsp), %rax
movl 0x33c(%rax), %r9d
movq 0x38(%rsp), %rax
movq 0x228(%rax), %rax
movl $0x3, %edi
leaq 0x5652(%rip), %rsi      # 0x11603
movq %rax, (%rsp)
movb $0x0, %al
callq 0xade0
movq 0x30(%rsp), %rax
movslq 0x28(%rsp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
cmpl $0x0, (%rax)
jne 0xbff2
movl $0x7, %edi
leaq 0x565d(%rip), %rsi      # 0x1163b
movb $0x0, %al
callq 0xade0
movl $0xffffffff, 0x44(%rsp) # imm = 0xFFFFFFFF
jmp 0xc785
movq 0x30(%rsp), %rax
movslq 0x28(%rsp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
cmpl $0x0, (%rax)
jle 0xc166
movq 0x38(%rsp), %rax
movl $0x1, 0x308(%rax)
movq 0x38(%rsp), %rdi
movq 0x30(%rsp), %rsi
movslq 0x28(%rsp), %rax
shlq $0x4, %rax
addq %rax, %rsi
callq 0xe450
movl %eax, 0x2c(%rsp)
movq 0x38(%rsp), %rax
movl $0x0, 0x308(%rax)
cmpl $0x0, 0x2c(%rsp)
jge 0xc05d
movl 0x2c(%rsp), %eax
movl %eax, 0x44(%rsp)
jmp 0xc785
leaq 0x87cc(%rip), %rax      # 0x14830
cmpl $0x2, 0x28(%rax)
jne 0xc161
movq 0x38(%rsp), %rax
movl 0x30c(%rax), %edx
movq 0x38(%rsp), %rax
movl 0x2e8(%rax), %ecx
movq 0x38(%rsp), %rax
movl 0x360(%rax), %r8d
movq 0x38(%rsp), %rax
movl 0x33c(%rax), %r9d
movq 0x38(%rsp), %rax
movq 0x228(%rax), %rax
movl $0x3, %edi
leaq 0x55cb(%rip), %rsi      # 0x1167f
movq %rax, (%rsp)
movb $0x0, %al
callq 0xade0
movq 0x38(%rsp), %rax
movl $0x2, 0x308(%rax)
movq 0x38(%rsp), %rdi
movq 0x30(%rsp), %rsi
movslq 0x28(%rsp), %rax
shlq $0x4, %rax
addq %rax, %rsi
callq 0xdf20
movl %eax, 0x2c(%rsp)
movq 0x38(%rsp), %rax
movl $0x0, 0x308(%rax)
cmpl $0x0, 0x2c(%rsp)
jge 0xc110
movl 0x2c(%rsp), %eax
movl %eax, 0x44(%rsp)
jmp 0xc785
movq 0x38(%rsp), %rax
movl 0x30c(%rax), %edx
movq 0x38(%rsp), %rax
movl 0x2e8(%rax), %ecx
movq 0x38(%rsp), %rax
movl 0x360(%rax), %r8d
movq 0x38(%rsp), %rax
movl 0x33c(%rax), %r9d
movq 0x38(%rsp), %rax
movq 0x228(%rax), %rax
movl $0x3, %edi
leaq 0x5562(%rip), %rsi      # 0x116b8
movq %rax, (%rsp)
movb $0x0, %al
callq 0xade0
jmp 0xc36e
movq 0x38(%rsp), %rax
movl $0x1, 0x308(%rax)
movq 0x38(%rsp), %rax
movl 0x2d8(%rax), %edi
movq 0x38(%rsp), %rax
movq 0x328(%rax), %rsi
movq 0x38(%rsp), %rax
movq 0x320(%rax), %rdx
callq 0x3230
movl %eax, 0x2c(%rsp)
cmpl $0x0, 0x2c(%rsp)
jge 0xc1f1
movq 0x38(%rsp), %rax
movl $0x0, 0x308(%rax)
callq 0x3070
movl (%rax), %edi
leaq 0x53ad(%rip), %rsi      # 0x11572
leaq 0x5253(%rip), %rdx      # 0x1141f
callq 0xb160
movl $0x6, %edi
leaq 0x5513(%rip), %rsi      # 0x116f0
movb $0x0, %al
callq 0xade0
movl $0xffffffff, 0x44(%rsp) # imm = 0xFFFFFFFF
jmp 0xc785
movslq 0x2c(%rsp), %rax
movq 0x38(%rsp), %rcx
cmpq 0x320(%rcx), %rax
je 0xc224
movl $0x6, %edi
leaq 0x54f9(%rip), %rsi      # 0x11709
movb $0x0, %al
callq 0xade0
movl $0xffffffff, 0x44(%rsp) # imm = 0xFFFFFFFF
jmp 0xc785
movq 0x38(%rsp), %rdi
callq 0xdad0
movl %eax, 0x2c(%rsp)
movq 0x38(%rsp), %rax
movl $0x0, 0x308(%rax)
cmpl $0x0, 0x2c(%rsp)
jge 0xc255
movl 0x2c(%rsp), %eax
movl %eax, 0x44(%rsp)
jmp 0xc785
leaq 0x85d4(%rip), %rax      # 0x14830
cmpl $0x2, 0x28(%rax)
jne 0xc36c
movq 0x38(%rsp), %rax
movl 0x30c(%rax), %edx
movq 0x38(%rsp), %rax
movl 0x2e8(%rax), %ecx
movq 0x38(%rsp), %rax
movl 0x360(%rax), %r8d
movq 0x38(%rsp), %rax
movl 0x33c(%rax), %r9d
movq 0x38(%rsp), %rax
movq 0x228(%rax), %rax
movl $0x3, %edi
leaq 0x53d3(%rip), %rsi      # 0x1167f
movq %rax, (%rsp)
movb $0x0, %al
callq 0xade0
movq 0x38(%rsp), %rax
movl $0x2, 0x308(%rax)
movq 0x38(%rsp), %rdi
callq 0xd5f0
movl %eax, 0x2c(%rsp)
movq 0x38(%rsp), %rax
movl $0x0, 0x308(%rax)
cmpl $0x0, 0x2c(%rsp)
jge 0xc2f7
movl 0x2c(%rsp), %eax
movl %eax, 0x44(%rsp)
jmp 0xc785
movq 0x38(%rsp), %rax
movl 0x30c(%rax), %eax
movl %eax, 0x8(%rsp)
movq 0x38(%rsp), %rax
movl 0x2e8(%rax), %eax
movl %eax, 0xc(%rsp)
movq 0x38(%rsp), %rax
movl 0x360(%rax), %eax
movl %eax, 0x10(%rsp)
movq 0x38(%rsp), %rax
movl 0x33c(%rax), %eax
movl %eax, 0x14(%rsp)
leaq 0x84f6(%rip), %rax      # 0x14830
movq 0x10(%rax), %rdi
callq 0xb1c0
movl 0x8(%rsp), %edx
movl 0xc(%rsp), %ecx
movl 0x10(%rsp), %r8d
movl 0x14(%rsp), %r9d
movl $0x3, %edi
leaq 0x5357(%rip), %rsi      # 0x116b8
movq %rax, (%rsp)
movb $0x0, %al
callq 0xade0
jmp 0xc36e
movq 0x38(%rsp), %rax
movl 0x30c(%rax), %edx
movq 0x38(%rsp), %rax
movl 0x2e8(%rax), %ecx
movq 0x38(%rsp), %rax
movl 0x360(%rax), %r8d
movq 0x38(%rsp), %rax
movl 0x33c(%rax), %r9d
movq 0x38(%rsp), %rax
movq 0x228(%rax), %rax
movl $0x3, %edi
leaq 0x5378(%rip), %rsi      # 0x1172c
movq %rax, (%rsp)
movb $0x0, %al
callq 0xade0
movl 0x28(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x28(%rsp)
jmp 0xbf42
movq 0x38(%rsp), %rax
movl 0x360(%rax), %edx
movq 0x38(%rsp), %rax
movl 0x33c(%rax), %ecx
movq 0x38(%rsp), %rax
movq 0x228(%rax), %r8
movl $0x3, %edi
leaq 0x5367(%rip), %rsi      # 0x11764
movb $0x0, %al
callq 0xade0
jmp 0xbec6
leaq -0xca0(%rip), %rcx      # 0xb770
leaq 0x8419(%rip), %rax      # 0x14830
cmpq %rcx, 0x10(%rax)
jne 0xc5af
movq 0x38(%rsp), %rax
movl $0x4, 0x308(%rax)
movq 0x38(%rsp), %rax
movl 0x2d8(%rax), %edi
movq 0x38(%rsp), %rax
movq 0x328(%rax), %rsi
movq 0x38(%rsp), %rax
movq 0x320(%rax), %rdx
callq 0x3230
movl %eax, 0x2c(%rsp)
cmpl $0x0, 0x2c(%rsp)
jge 0xc49d
callq 0x3070
movl (%rax), %edi
leaq 0x5101(%rip), %rsi      # 0x11572
leaq 0x4fa7(%rip), %rdx      # 0x1141f
callq 0xb160
movl $0x6, %edi
leaq 0x5267(%rip), %rsi      # 0x116f0
movb $0x0, %al
callq 0xade0
movl $0xffffffff, 0x44(%rsp) # imm = 0xFFFFFFFF
jmp 0xc785
movslq 0x2c(%rsp), %rax
movq 0x38(%rsp), %rcx
cmpq 0x320(%rcx), %rax
je 0xc4d0
movl $0x6, %edi
leaq 0x524d(%rip), %rsi      # 0x11709
movb $0x0, %al
callq 0xade0
movl $0xffffffff, 0x44(%rsp) # imm = 0xFFFFFFFF
jmp 0xc785
movq 0x38(%rsp), %rax
movq 0x228(%rax), %rdx
movl $0x3, %edi
leaq 0x52a4(%rip), %rsi      # 0x1178c
movb $0x0, %al
callq 0xade0
movq 0x38(%rsp), %rdi
callq 0xdad0
movl %eax, 0x2c(%rsp)
cmpl $0x0, 0x2c(%rsp)
jge 0xc511
movl 0x2c(%rsp), %eax
movl %eax, 0x44(%rsp)
jmp 0xc785
leaq 0x8318(%rip), %rax      # 0x14830
cmpl $0x1, 0x28(%rax)
je 0xc52b
leaq 0x830b(%rip), %rax      # 0x14830
cmpl $0x2, 0x28(%rax)
jne 0xc58b
movq 0x38(%rsp), %rax
movq 0x228(%rax), %rdx
movl $0x3, %edi
leaq 0x526f(%rip), %rsi      # 0x117b2
movb $0x0, %al
callq 0xade0
movq 0x38(%rsp), %rdi
callq 0xd5f0
movl %eax, 0x2c(%rsp)
cmpl $0x0, 0x2c(%rsp)
jge 0xc56c
movl 0x2c(%rsp), %eax
movl %eax, 0x44(%rsp)
jmp 0xc785
movq 0x38(%rsp), %rax
movq 0x228(%rax), %rdx
movl $0x3, %edi
leaq 0x5263(%rip), %rsi      # 0x117e7
movb $0x0, %al
callq 0xade0
movq 0x38(%rsp), %rax
movq 0x228(%rax), %rdx
movl $0x3, %edi
leaq 0x5278(%rip), %rsi      # 0x1181b
movb $0x0, %al
callq 0xade0
jmp 0xc6a2
movq 0x38(%rsp), %rax
movl $0x3, 0x308(%rax)
movq 0x38(%rsp), %rax
movq 0x228(%rax), %rdx
movl $0x3, %edi
leaq 0x5269(%rip), %rsi      # 0x1183f
movb $0x0, %al
callq 0xade0
movq 0x38(%rsp), %rdi
leaq 0x18(%rsp), %rsi
callq 0xe450
movl %eax, 0x2c(%rsp)
cmpl $0x0, 0x2c(%rsp)
jge 0xc604
movl 0x2c(%rsp), %eax
movl %eax, 0x44(%rsp)
jmp 0xc785
leaq 0x8225(%rip), %rax      # 0x14830
cmpl $0x1, 0x28(%rax)
je 0xc61e
leaq 0x8218(%rip), %rax      # 0x14830
cmpl $0x2, 0x28(%rax)
jne 0xc683
movq 0x38(%rsp), %rax
movq 0x228(%rax), %rdx
movl $0x3, %edi
leaq 0x521f(%rip), %rsi      # 0x11855
movb $0x0, %al
callq 0xade0
movq 0x38(%rsp), %rdi
leaq 0x18(%rsp), %rsi
callq 0xdf20
movl %eax, 0x2c(%rsp)
cmpl $0x0, 0x2c(%rsp)
jge 0xc664
movl 0x2c(%rsp), %eax
movl %eax, 0x44(%rsp)
jmp 0xc785
movq 0x38(%rsp), %rax
movq 0x228(%rax), %rdx
movl $0x3, %edi
leaq 0x51f7(%rip), %rsi      # 0x11873
movb $0x0, %al
callq 0xade0
movq 0x38(%rsp), %rax
movq 0x228(%rax), %rdx
movl $0x3, %edi
leaq 0x51f5(%rip), %rsi      # 0x11890
movb $0x0, %al
callq 0xade0
movq 0x38(%rsp), %rax
movq $0x0, 0x320(%rax)
movq 0x38(%rsp), %rax
movq 0x328(%rax), %rdi
callq 0x3060
movq 0x38(%rsp), %rax
movl $0x0, 0x308(%rax)
movq 0x38(%rsp), %rax
cmpq $0x0, 0x588(%rax)
jbe 0xc70c
movq 0x38(%rsp), %rax
movq 0x588(%rax), %rdx
movq 0x38(%rsp), %rax
movq 0x228(%rax), %rcx
movl $0x5, %edi
leaq 0x51a0(%rip), %rsi      # 0x118a5
movb $0x0, %al
callq 0xade0
movq 0x38(%rsp), %rax
cmpq $0x0, 0x2f8(%rax)
jbe 0xc746
movq 0x38(%rsp), %rax
movq 0x2f8(%rax), %rdx
movq 0x38(%rsp), %rax
movq 0x228(%rax), %rcx
movl $0x5, %edi
leaq 0x518f(%rip), %rsi      # 0x118ce
movb $0x0, %al
callq 0xade0
movq 0x38(%rsp), %rax
cmpq $0x0, 0x2f8(%rax)
ja 0xc773
movq 0x38(%rsp), %rax
cmpq $0x0, 0x348(%rax)
ja 0xc773
movq 0x38(%rsp), %rax
cmpq $0x0, 0x588(%rax)
jbe 0xc77d
movl $0x1, 0x44(%rsp)
jmp 0xc785
movl $0x0, 0x44(%rsp)
movl 0x44(%rsp), %eax
addq $0x48, %rsp
retq
nop