// File: /workspace/github_c_makefile_star2_O0/sharpyfox[P]citrusleaf-client/tests/key_c/src/key.c
// Function: do_key_test
int 
do_key_test ( uint n_keys, uint n_reads, uint n_writes, uint n_deletes, uint n_threads, uint key_len, uint value_len, uint n_ops, uint writeratio, bool parallel)
{

	if((int)n_threads < 1)
        {
                fprintf(stderr, "Error: Not enough threads\n");
                exit(1);
     	 }

	pthread_t	*thr_array = malloc(sizeof(pthread_t) * n_threads);
	g_p_read_histogram = histogram_create();
	g_p_write_histogram = histogram_create();
	g_p_delete_histogram = histogram_create();
    g_p_read_timeout_histogram = histogram_create();
    g_p_write_timeout_histogram = histogram_create();
    g_p_delete_timeout_histogram = histogram_create();
    if (g_p_read_histogram == NULL || g_p_write_histogram == NULL || g_p_delete_histogram == NULL ||
    	g_p_read_timeout_histogram == NULL || g_p_write_timeout_histogram == NULL ||  g_p_delete_timeout_histogram == NULL) {
        fprintf(stderr," cannot create histograms \n");
        return -1;
    }
	// Create a cluster object that all requests will happen on
	cl_cluster *asc = citrusleaf_cluster_create();
	if (g_config.host_direct == true)
		citrusleaf_cluster_follow(asc, false);
	citrusleaf_cluster_add_host(asc, g_config.host, g_config.port, 0);
	fprintf(stderr," client settled, starting test\n");
	
	if (g_config.verbose) fprintf(stderr, "enter do key test: threads: %d value len: %d\n",n_threads,value_len);

	//read and write operation in some x:y ratio..
	if(n_ops == 0) {
		if (n_writes) {

			if (g_config.verbose) fprintf(stderr,"starting write loop: writing %d elements with %d threads\n",n_writes, n_threads);
			write_work  *write_array = malloc(sizeof(write_work)*n_threads);
			uint writes_per_thread = n_writes / n_threads;
			uint total_writes = 0;
			atomic_int *completed = atomic_int_create(0);
			atomic_int *gen_errs = atomic_int_create(0);

			void *c_th = start_counter_thread( "writes: ",completed,gen_errs);		

			for (uint i=0;i<n_threads;i++) {			
				write_work *work = &write_array[i];

				work->completed = completed;
				work->gen_errs = gen_errs;
				work->key_len = key_len;
				work->value_len = value_len;			
				
				work->value_len = value_len;
				work->asc = asc;
				work->id = i;

				// set all keys in parallel on all threads
				if (parallel) {
					work->start_key = g_config.zero;
					work->n_writes = writes_per_thread;
				}
				else {
					work->start_key = total_writes + g_config.zero;
					if (i == n_threads-1) {// last time! use all remaining writes
						work->n_writes = n_writes - total_writes;
					}
					else {                // regular loop	
						work->n_writes = writes_per_thread;
					}
					total_writes += work->n_writes;
				}

				pthread_create(&thr_array[i], 0, write_fn, work); 
			}

			// wait for threads to complete
			for (uint i=0;i<n_threads;i++) {
				void *value_ptr;
				pthread_join(thr_array[i], &value_ptr);
			}
			stop_counter_thread(c_th);
			free(write_array);
			atomic_int_destroy(completed);
		}

                if (n_reads) {
                        if (g_config.verbose) fprintf(stderr,"starting read loop: reading %d elements with %d threads\n",n_reads,n_threads);
                        read_work  *read_array = malloc(sizeof(read_work)*n_threads);
                        uint reads_per_thread = n_reads / n_threads;
                        uint total_reads = 0;
                        atomic_int *completed = atomic_int_create(0);

                        void *c_th = start_counter_thread( "reads: ", completed, 0);
                        for (uint i=0;i<n_threads;i++) {
                                read_work *work = &read_array[i];
                                work->completed = completed;
                                work->start_key = g_config.zero;
                                work->n_keys = n_keys;
                                work->key_len = key_len;
                                work->value_len = value_len;
                                work->asc = asc;
                                work->id = i;

                                if (i == n_threads-1) // last time! use all remaining writes
                                        work->n_reads = n_reads - total_reads;
                                else                 // regular loop    
                                        work->n_reads = reads_per_thread;
                                total_reads += work->n_reads;
                                pthread_create(&thr_array[i], 0, g_config.n_batch == 0 ? read_fn : read_batch_fn , work);
                        }
                        // wait for threads to complete
                        for (uint i=0;i<n_threads;i++) {
                                void *value_ptr;
                                pthread_join(thr_array[i], &value_ptr);
                        }
                        stop_counter_thread(c_th);
                        free(read_array);
                        atomic_int_destroy(completed);
                }

		if (n_deletes) {

			if (g_config.verbose) fprintf(stderr,"starting write loop: writing %d elements with %d threads\n",n_deletes, n_threads);
			delete_work  *delete_array = malloc(sizeof(delete_work)*n_threads);
			uint deletes_per_thread = n_deletes / n_threads;
			uint total_deletes = 0;
			atomic_int *completed = atomic_int_create(0);
			atomic_int *gen_errs = atomic_int_create(0);

			void *c_th = start_counter_thread( "deletes: ",completed,gen_errs);

			for (uint i=0;i<n_threads;i++) {
				delete_work *work = &delete_array[i];

				work->completed = completed;
				work->gen_errs = gen_errs;
				work->key_len = key_len;
				work->value_len = value_len;

				work->value_len = value_len;
				work->asc = asc;
				work->id = i;
				// set all keys in parallel on all threads
				if (parallel) {
					work->start_key = g_config.zero;
					work->n_deletes = deletes_per_thread;
				}
				else {
					work->start_key = total_deletes + g_config.zero;
					if (i == n_threads-1) {// last time! use all remaining writes
						work->n_deletes = n_deletes - total_deletes;
					}
					else {                // regular loop   
						work->n_deletes = deletes_per_thread;
					}
					total_deletes += work->n_deletes;
				}

				pthread_create(&thr_array[i], 0, delete_fn, work);
			}

			// wait for threads to complete
			for (uint i=0;i<n_threads;i++) {
				void *value_ptr;
				pthread_join(thr_array[i], &value_ptr);
			}
			stop_counter_thread(c_th);
			free(delete_array);
			atomic_int_destroy(completed);
		}
	}
	else {
		if((int)n_ops < 1) {
			fprintf(stderr, "Error: Invalid number of operation.\n");
			exit(1);
		}
		if (g_config.verbose) fprintf(stderr,"starting writing and reading in ratio %d : %d\n",writeratio, 100-writeratio);
			
		op_work  *op_array = malloc(sizeof(op_work)*n_threads);
		uint ops_per_thread = n_ops / n_threads;
		uint total_ops = 0;
		atomic_int *rcompleted = atomic_int_create(0);
		atomic_int *wcompleted = atomic_int_create(0);
		atomic_int *gen_errs = atomic_int_create(0);

		void *c_rth = start_counter_thread( "reads: ",rcompleted,gen_errs);		
		void *c_wth = start_counter_thread( "writes: ",wcompleted,gen_errs);		

		writeratio = my_min(100, writeratio);
		writeratio = my_max(0, (int)writeratio);
		for (uint i=0;i<n_threads;i++) {			
			op_work *work = &op_array[i];
			work->rcompleted = rcompleted;
			work->wcompleted = wcompleted;
			work->gen_errs = gen_errs;
			work->key_len = key_len;
			work->value_len = value_len;			
			work->start_key = g_config.zero;
			work->value_len = value_len;
			work->asc = asc;
			work->id = i;
			work->writeratio = writeratio;
			work->n_keys = n_keys;

			if (i == n_threads-1) {// last time! use all remaining writes
				work->n_ops = n_ops - total_ops;
			}
			else {                // regular loop	
				work->n_ops = ops_per_thread;
			}

			total_ops += work->n_ops;

			pthread_create(&thr_array[i], 0, ops_fn, work); 
		}
		
		// wait for threads to complete
		for (uint i=0;i<n_threads;i++) {
			void *value_ptr;
			pthread_join(thr_array[i], &value_ptr);
		}
		stop_counter_thread(c_rth);
		stop_counter_thread(c_wth);
		free(op_array);
		atomic_int_destroy(wcompleted);
		atomic_int_destroy(rcompleted);
	}
	
    histogram_dump(g_p_write_histogram,  "writes");
    histogram_dump(g_p_write_timeout_histogram,  "write timeouts");
    histogram_dump(g_p_read_histogram,  "reads");
    histogram_dump(g_p_read_timeout_histogram,  "read timeouts");
    histogram_dump(g_p_delete_histogram,  "deletes");
    histogram_dump(g_p_delete_timeout_histogram,  "delete timeouts");

	free(thr_array);
	citrusleaf_cluster_destroy(asc);

	return(-1);	
}

// Assembly:
subq $0x158, %rsp            # imm = 0x158
movb 0x178(%rsp), %al
movl 0x170(%rsp), %r10d
movl 0x168(%rsp), %r10d
movl 0x160(%rsp), %r10d
movl %edi, 0x150(%rsp)
movl %esi, 0x14c(%rsp)
movl %edx, 0x148(%rsp)
movl %ecx, 0x144(%rsp)
movl %r8d, 0x140(%rsp)
movl %r9d, 0x13c(%rsp)
andb $0x1, %al
movb %al, 0x13b(%rsp)
cmpl $0x1, 0x140(%rsp)
jge 0x6137
movq 0x1cec4(%rip), %rax     # 0x22fe0
movq (%rax), %rdi
leaq 0x16c09(%rip), %rsi     # 0x1cd2f
movb $0x0, %al
callq 0x23b0
movl $0x1, %edi
callq 0x22e0
movl 0x140(%rsp), %eax
movl %eax, %edi
shlq $0x3, %rdi
callq 0x2310
movq %rax, 0x130(%rsp)
movb $0x0, %al
callq 0x6eb0
movq %rax, 0x1f239(%rip)     # 0x25398
movb $0x0, %al
callq 0x6eb0
movq %rax, 0x1f23b(%rip)     # 0x253a8
movb $0x0, %al
callq 0x6eb0
movq %rax, 0x1f23d(%rip)     # 0x253b8
movb $0x0, %al
callq 0x6eb0
movq %rax, 0x1f207(%rip)     # 0x25390
movb $0x0, %al
callq 0x6eb0
movq %rax, 0x1f209(%rip)     # 0x253a0
movb $0x0, %al
callq 0x6eb0
movq %rax, 0x1f20b(%rip)     # 0x253b0
cmpq $0x0, 0x1f1eb(%rip)     # 0x25398
je 0x61e1
cmpq $0x0, 0x1f1f1(%rip)     # 0x253a8
je 0x61e1
cmpq $0x0, 0x1f1f7(%rip)     # 0x253b8
je 0x61e1
cmpq $0x0, 0x1f1c5(%rip)     # 0x25390
je 0x61e1
cmpq $0x0, 0x1f1cb(%rip)     # 0x253a0
je 0x61e1
cmpq $0x0, 0x1f1d1(%rip)     # 0x253b0
jne 0x6209
movq 0x1cdf8(%rip), %rax     # 0x22fe0
movq (%rax), %rdi
leaq 0x16b58(%rip), %rsi     # 0x1cd4a
movb $0x0, %al
callq 0x23b0
movl $0xffffffff, 0x154(%rsp) # imm = 0xFFFFFFFF
jmp 0x6e20
callq 0xbbf0
movq %rax, 0x128(%rsp)
leaq 0x1f113(%rip), %rax     # 0x25330
movb 0x2a(%rax), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x1, %eax
jne 0x6239
movq 0x128(%rsp), %rdi
xorl %esi, %esi
callq 0xcff0
movq 0x128(%rsp), %rdi
leaq 0x1f0e8(%rip), %rax     # 0x25330
movq (%rax), %rsi
leaq 0x1f0de(%rip), %rax     # 0x25330
movl 0x8(%rax), %eax
xorl %ecx, %ecx
movswl %ax, %edx
callq 0xc070
movq 0x1cd7a(%rip), %rax     # 0x22fe0
movq (%rax), %rdi
leaq 0x16af6(%rip), %rsi     # 0x1cd66
movb $0x0, %al
callq 0x23b0
leaq 0x1f0b2(%rip), %rax     # 0x25330
testb $0x1, 0x28(%rax)
je 0x62aa
movq 0x1cd55(%rip), %rax     # 0x22fe0
movq (%rax), %rdi
movl 0x140(%rsp), %edx
movl 0x160(%rsp), %ecx
leaq 0x16ae3(%rip), %rsi     # 0x1cd86
movb $0x0, %al
callq 0x23b0
cmpl $0x0, 0x168(%rsp)
jne 0x6ab3
cmpl $0x0, 0x148(%rsp)
je 0x6597
leaq 0x1f063(%rip), %rax     # 0x25330
testb $0x1, 0x28(%rax)
je 0x62f9
movq 0x1cd06(%rip), %rax     # 0x22fe0
movq (%rax), %rdi
movl 0x148(%rsp), %edx
movl 0x140(%rsp), %ecx
leaq 0x16ac2(%rip), %rsi     # 0x1cdb4
movb $0x0, %al
callq 0x23b0
movl 0x140(%rsp), %eax
imulq $0x30, %rax, %rdi
callq 0x2310
movq %rax, 0x120(%rsp)
movl 0x148(%rsp), %eax
xorl %edx, %edx
divl 0x140(%rsp)
movl %eax, 0x11c(%rsp)
movl $0x0, 0x118(%rsp)
xorl %edi, %edi
callq 0x2680
movq %rax, 0x110(%rsp)
xorl %edi, %edi
callq 0x2680
movq %rax, 0x108(%rsp)
movq 0x110(%rsp), %rsi
movq 0x108(%rsp), %rdx
leaq 0x16a86(%rip), %rdi     # 0x1cdee
callq 0x2890
movq %rax, 0x100(%rsp)
movl $0x0, 0xfc(%rsp)
movl 0xfc(%rsp), %eax
cmpl 0x140(%rsp), %eax
jae 0x6522
movq 0x120(%rsp), %rax
movl 0xfc(%rsp), %ecx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movq %rax, 0xf0(%rsp)
movq 0x110(%rsp), %rcx
movq 0xf0(%rsp), %rax
movq %rcx, 0x18(%rax)
movq 0x108(%rsp), %rcx
movq 0xf0(%rsp), %rax
movq %rcx, 0x20(%rax)
movl 0x13c(%rsp), %ecx
movq 0xf0(%rsp), %rax
movl %ecx, 0x8(%rax)
movl 0x160(%rsp), %ecx
movq 0xf0(%rsp), %rax
movl %ecx, 0xc(%rax)
movl 0x160(%rsp), %ecx
movq 0xf0(%rsp), %rax
movl %ecx, 0xc(%rax)
movq 0x128(%rsp), %rcx
movq 0xf0(%rsp), %rax
movq %rcx, 0x28(%rax)
movl 0xfc(%rsp), %ecx
movq 0xf0(%rsp), %rax
movl %ecx, 0x10(%rax)
testb $0x1, 0x13b(%rsp)
je 0x6468
leaq 0x1eee9(%rip), %rax     # 0x25330
movl 0x40(%rax), %ecx
movq 0xf0(%rsp), %rax
movl %ecx, (%rax)
movl 0x11c(%rsp), %ecx
movq 0xf0(%rsp), %rax
movl %ecx, 0x4(%rax)
jmp 0x64de
movl 0x118(%rsp), %ecx
leaq 0x1eeba(%rip), %rax     # 0x25330
addl 0x40(%rax), %ecx
movq 0xf0(%rsp), %rax
movl %ecx, (%rax)
movl 0xfc(%rsp), %eax
movl 0x140(%rsp), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jne 0x64b3
movl 0x148(%rsp), %ecx
subl 0x118(%rsp), %ecx
movq 0xf0(%rsp), %rax
movl %ecx, 0x4(%rax)
jmp 0x64c5
movl 0x11c(%rsp), %ecx
movq 0xf0(%rsp), %rax
movl %ecx, 0x4(%rax)
movq 0xf0(%rsp), %rax
movl 0x4(%rax), %eax
addl 0x118(%rsp), %eax
movl %eax, 0x118(%rsp)
movq 0x130(%rsp), %rdi
movl 0xfc(%rsp), %eax
shlq $0x3, %rax
addq %rax, %rdi
movq 0xf0(%rsp), %rcx
xorl %eax, %eax
movl %eax, %esi
leaq -0x1387(%rip), %rdx     # 0x5180
callq 0x2500
movl 0xfc(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xfc(%rsp)
jmp 0x6380
movl $0x0, 0xec(%rsp)
movl 0xec(%rsp), %eax
cmpl 0x140(%rsp), %eax
jae 0x6570
movq 0x130(%rsp), %rax
movl 0xec(%rsp), %ecx
movq (%rax,%rcx,8), %rdi
leaq 0xe0(%rsp), %rsi
callq 0x2220
movl 0xec(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xec(%rsp)
jmp 0x652d
movq 0x100(%rsp), %rdi
callq 0x2920
movq 0x120(%rsp), %rdi
callq 0x22c0
movq 0x110(%rsp), %rdi
callq 0x26c0
cmpl $0x0, 0x14c(%rsp)
je 0x682c
leaq 0x1ed84(%rip), %rax     # 0x25330
testb $0x1, 0x28(%rax)
je 0x65d8
movq 0x1ca27(%rip), %rax     # 0x22fe0
movq (%rax), %rdi
movl 0x14c(%rsp), %edx
movl 0x140(%rsp), %ecx
leaq 0x16826(%rip), %rsi     # 0x1cdf7
movb $0x0, %al
callq 0x23b0
movl 0x140(%rsp), %eax
imulq $0x28, %rax, %rdi
callq 0x2310
movq %rax, 0xd8(%rsp)
movl 0x14c(%rsp), %eax
xorl %edx, %edx
divl 0x140(%rsp)
movl %eax, 0xd4(%rsp)
movl $0x0, 0xd0(%rsp)
xorl %edi, %edi
callq 0x2680
movq %rax, 0xc8(%rsp)
movq 0xc8(%rsp), %rsi
leaq 0x16800(%rip), %rdi     # 0x1ce30
xorl %eax, %eax
movl %eax, %edx
callq 0x2890
movq %rax, 0xc0(%rsp)
movl $0x0, 0xbc(%rsp)
movl 0xbc(%rsp), %eax
cmpl 0x140(%rsp), %eax
jae 0x67b7
movq 0xd8(%rsp), %rax
movl 0xbc(%rsp), %ecx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq %rax, 0xb0(%rsp)
movq 0xc8(%rsp), %rcx
movq 0xb0(%rsp), %rax
movq %rcx, 0x18(%rax)
leaq 0x1ec97(%rip), %rax     # 0x25330
movl 0x40(%rax), %ecx
movq 0xb0(%rsp), %rax
movl %ecx, 0x4(%rax)
movl 0x150(%rsp), %ecx
movq 0xb0(%rsp), %rax
movl %ecx, 0x8(%rax)
movl 0x13c(%rsp), %ecx
movq 0xb0(%rsp), %rax
movl %ecx, 0xc(%rax)
movl 0x160(%rsp), %ecx
movq 0xb0(%rsp), %rax
movl %ecx, 0x10(%rax)
movq 0x128(%rsp), %rcx
movq 0xb0(%rsp), %rax
movq %rcx, 0x20(%rax)
movl 0xbc(%rsp), %ecx
movq 0xb0(%rsp), %rax
movl %ecx, 0x14(%rax)
movl 0xbc(%rsp), %eax
movl 0x140(%rsp), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jne 0x6732
movl 0x14c(%rsp), %ecx
subl 0xd0(%rsp), %ecx
movq 0xb0(%rsp), %rax
movl %ecx, (%rax)
jmp 0x6743
movl 0xd4(%rsp), %ecx
movq 0xb0(%rsp), %rax
movl %ecx, (%rax)
movq 0xb0(%rsp), %rax
movl (%rax), %eax
addl 0xd0(%rsp), %eax
movl %eax, 0xd0(%rsp)
movq 0x130(%rsp), %rdi
movl 0xbc(%rsp), %eax
shlq $0x3, %rax
addq %rax, %rdi
leaq 0x1ebb8(%rip), %rax     # 0x25330
movl 0x30(%rax), %ecx
leaq -0x1bc2(%rip), %rdx     # 0x4bc0
leaq -0x3229(%rip), %rax     # 0x3560
cmpl $0x0, %ecx
cmoveq %rax, %rdx
movq 0xb0(%rsp), %rcx
xorl %eax, %eax
movl %eax, %esi
callq 0x2500
movl 0xbc(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xbc(%rsp)
jmp 0x664c
movl $0x0, 0xac(%rsp)
movl 0xac(%rsp), %eax
cmpl 0x140(%rsp), %eax
jae 0x6805
movq 0x130(%rsp), %rax
movl 0xac(%rsp), %ecx
movq (%rax,%rcx,8), %rdi
leaq 0xa0(%rsp), %rsi
callq 0x2220
movl 0xac(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xac(%rsp)
jmp 0x67c2
movq 0xc0(%rsp), %rdi
callq 0x2920
movq 0xd8(%rsp), %rdi
callq 0x22c0
movq 0xc8(%rsp), %rdi
callq 0x26c0
cmpl $0x0, 0x144(%rsp)
je 0x6aae
leaq 0x1eaef(%rip), %rax     # 0x25330
testb $0x1, 0x28(%rax)
je 0x686d
movq 0x1c792(%rip), %rax     # 0x22fe0
movq (%rax), %rdi
movl 0x144(%rsp), %edx
movl 0x140(%rsp), %ecx
leaq 0x1654e(%rip), %rsi     # 0x1cdb4
movb $0x0, %al
callq 0x23b0
movl 0x140(%rsp), %eax
imulq $0x30, %rax, %rdi
callq 0x2310
movq %rax, 0x98(%rsp)
movl 0x144(%rsp), %eax
xorl %edx, %edx
divl 0x140(%rsp)
movl %eax, 0x94(%rsp)
movl $0x0, 0x90(%rsp)
xorl %edi, %edi
callq 0x2680
movq %rax, 0x88(%rsp)
xorl %edi, %edi
callq 0x2680
movq %rax, 0x80(%rsp)
movq 0x88(%rsp), %rsi
movq 0x80(%rsp), %rdx
leaq 0x1655c(%rip), %rdi     # 0x1ce38
callq 0x2890
movq %rax, 0x78(%rsp)
movl $0x0, 0x74(%rsp)
movl 0x74(%rsp), %eax
cmpl 0x140(%rsp), %eax
jae 0x6a4e
movq 0x98(%rsp), %rax
movl 0x74(%rsp), %ecx
imulq $0x30, %rcx, %rcx
addq %rcx, %rax
movq %rax, 0x68(%rsp)
movq 0x88(%rsp), %rcx
movq 0x68(%rsp), %rax
movq %rcx, 0x18(%rax)
movq 0x80(%rsp), %rcx
movq 0x68(%rsp), %rax
movq %rcx, 0x20(%rax)
movl 0x13c(%rsp), %ecx
movq 0x68(%rsp), %rax
movl %ecx, 0x8(%rax)
movl 0x160(%rsp), %ecx
movq 0x68(%rsp), %rax
movl %ecx, 0xc(%rax)
movl 0x160(%rsp), %ecx
movq 0x68(%rsp), %rax
movl %ecx, 0xc(%rax)
movq 0x128(%rsp), %rcx
movq 0x68(%rsp), %rax
movq %rcx, 0x28(%rax)
movl 0x74(%rsp), %ecx
movq 0x68(%rsp), %rax
movl %ecx, 0x10(%rax)
testb $0x1, 0x13b(%rsp)
je 0x69af
leaq 0x1e99c(%rip), %rax     # 0x25330
movl 0x40(%rax), %ecx
movq 0x68(%rsp), %rax
movl %ecx, (%rax)
movl 0x94(%rsp), %ecx
movq 0x68(%rsp), %rax
movl %ecx, 0x4(%rax)
jmp 0x6a16
movl 0x90(%rsp), %ecx
leaq 0x1e973(%rip), %rax     # 0x25330
addl 0x40(%rax), %ecx
movq 0x68(%rsp), %rax
movl %ecx, (%rax)
movl 0x74(%rsp), %eax
movl 0x140(%rsp), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jne 0x69f1
movl 0x144(%rsp), %ecx
subl 0x90(%rsp), %ecx
movq 0x68(%rsp), %rax
movl %ecx, 0x4(%rax)
jmp 0x6a00
movl 0x94(%rsp), %ecx
movq 0x68(%rsp), %rax
movl %ecx, 0x4(%rax)
movq 0x68(%rsp), %rax
movl 0x4(%rax), %eax
addl 0x90(%rsp), %eax
movl %eax, 0x90(%rsp)
movq 0x130(%rsp), %rdi
movl 0x74(%rsp), %eax
shlq $0x3, %rax
addq %rax, %rdi
movq 0x68(%rsp), %rcx
xorl %eax, %eax
movl %eax, %esi
leaq -0x11a9(%rip), %rdx     # 0x5890
callq 0x2500
movl 0x74(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x74(%rsp)
jmp 0x68ee
movl $0x0, 0x64(%rsp)
movl 0x64(%rsp), %eax
cmpl 0x140(%rsp), %eax
jae 0x6a8a
movq 0x130(%rsp), %rax
movl 0x64(%rsp), %ecx
movq (%rax,%rcx,8), %rdi
leaq 0x58(%rsp), %rsi
callq 0x2220
movl 0x64(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x64(%rsp)
jmp 0x6a56
movq 0x78(%rsp), %rdi
callq 0x2920
movq 0x98(%rsp), %rdi
callq 0x22c0
movq 0x88(%rsp), %rdi
callq 0x26c0
jmp 0x6d89
cmpl $0x1, 0x168(%rsp)
jge 0x6adf
movq 0x1c51c(%rip), %rax     # 0x22fe0
movq (%rax), %rdi
leaq 0x16374(%rip), %rsi     # 0x1ce42
movb $0x0, %al
callq 0x23b0
movl $0x1, %edi
callq 0x22e0
leaq 0x1e84a(%rip), %rax     # 0x25330
testb $0x1, 0x28(%rax)
je 0x6b17
movq 0x1c4ed(%rip), %rax     # 0x22fe0
movq (%rax), %rdi
movl 0x170(%rsp), %edx
movl $0x64, %ecx
subl 0x170(%rsp), %ecx
leaq 0x16357(%rip), %rsi     # 0x1ce67
movb $0x0, %al
callq 0x23b0
movl 0x140(%rsp), %eax
movl %eax, %edi
shlq $0x6, %rdi
callq 0x2310
movq %rax, 0x50(%rsp)
movl 0x168(%rsp), %eax
xorl %edx, %edx
divl 0x140(%rsp)
movl %eax, 0x4c(%rsp)
movl $0x0, 0x48(%rsp)
xorl %edi, %edi
callq 0x2680
movq %rax, 0x40(%rsp)
xorl %edi, %edi
callq 0x2680
movq %rax, 0x38(%rsp)
xorl %edi, %edi
callq 0x2680
movq %rax, 0x30(%rsp)
movq 0x40(%rsp), %rsi
movq 0x30(%rsp), %rdx
leaq 0x162b1(%rip), %rdi     # 0x1ce30
callq 0x2890
movq %rax, 0x28(%rsp)
movq 0x38(%rsp), %rsi
movq 0x30(%rsp), %rdx
leaq 0x16254(%rip), %rdi     # 0x1cdee
callq 0x2890
movq %rax, 0x20(%rsp)
movl 0x170(%rsp), %esi
movl $0x64, %edi
callq 0x4510
movl %eax, 0x170(%rsp)
movl 0x170(%rsp), %esi
xorl %edi, %edi
callq 0x44e0
movl %eax, 0x170(%rsp)
movl $0x0, 0x1c(%rsp)
movl 0x1c(%rsp), %eax
cmpl 0x140(%rsp), %eax
jae 0x6d1d
movq 0x50(%rsp), %rax
movl 0x1c(%rsp), %ecx
shlq $0x6, %rcx
addq %rcx, %rax
movq %rax, 0x10(%rsp)
movq 0x40(%rsp), %rcx
movq 0x10(%rsp), %rax
movq %rcx, 0x18(%rax)
movq 0x38(%rsp), %rcx
movq 0x10(%rsp), %rax
movq %rcx, 0x20(%rax)
movq 0x30(%rsp), %rcx
movq 0x10(%rsp), %rax
movq %rcx, 0x30(%rax)
movl 0x13c(%rsp), %ecx
movq 0x10(%rsp), %rax
movl %ecx, 0xc(%rax)
movl 0x160(%rsp), %ecx
movq 0x10(%rsp), %rax
movl %ecx, 0x10(%rax)
leaq 0x1e6e2(%rip), %rax     # 0x25330
movl 0x40(%rax), %ecx
movq 0x10(%rsp), %rax
movl %ecx, (%rax)
movl 0x160(%rsp), %ecx
movq 0x10(%rsp), %rax
movl %ecx, 0x10(%rax)
movq 0x128(%rsp), %rcx
movq 0x10(%rsp), %rax
movq %rcx, 0x38(%rax)
movl 0x1c(%rsp), %ecx
movq 0x10(%rsp), %rax
movl %ecx, 0x14(%rax)
movl 0x170(%rsp), %ecx
movq 0x10(%rsp), %rax
movl %ecx, 0x28(%rax)
movl 0x150(%rsp), %ecx
movq 0x10(%rsp), %rax
movl %ecx, 0x8(%rax)
movl 0x1c(%rsp), %eax
movl 0x140(%rsp), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jne 0x6cc9
movl 0x168(%rsp), %ecx
subl 0x48(%rsp), %ecx
movq 0x10(%rsp), %rax
movl %ecx, 0x4(%rax)
jmp 0x6cd5
movl 0x4c(%rsp), %ecx
movq 0x10(%rsp), %rax
movl %ecx, 0x4(%rax)
movq 0x10(%rsp), %rax
movl 0x4(%rax), %eax
addl 0x48(%rsp), %eax
movl %eax, 0x48(%rsp)
movq 0x130(%rsp), %rdi
movl 0x1c(%rsp), %eax
shlq $0x3, %rax
addq %rax, %rdi
movq 0x10(%rsp), %rcx
xorl %eax, %eax
movl %eax, %esi
leaq -0x1088(%rip), %rdx     # 0x5c80
callq 0x2500
movl 0x1c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x1c(%rsp)
jmp 0x6bd9
movl $0x0, 0xc(%rsp)
movl 0xc(%rsp), %eax
cmpl 0x140(%rsp), %eax
jae 0x6d57
movq 0x130(%rsp), %rax
movl 0xc(%rsp), %ecx
movq (%rax,%rcx,8), %rdi
movq %rsp, %rsi
callq 0x2220
movl 0xc(%rsp), %eax
addl $0x1, %eax
movl %eax, 0xc(%rsp)
jmp 0x6d25
movq 0x28(%rsp), %rdi
callq 0x2920
movq 0x20(%rsp), %rdi
callq 0x2920
movq 0x50(%rsp), %rdi
callq 0x22c0
movq 0x38(%rsp), %rdi
callq 0x26c0
movq 0x40(%rsp), %rdi
callq 0x26c0
movq 0x1e618(%rip), %rdi     # 0x253a8
leaq 0x160ff(%rip), %rsi     # 0x1ce96
callq 0x6ef0
movq 0x1e5fd(%rip), %rdi     # 0x253a0
leaq 0x160f3(%rip), %rsi     # 0x1ce9d
callq 0x6ef0
movq 0x1e5e2(%rip), %rdi     # 0x25398
leaq 0x160ef(%rip), %rsi     # 0x1ceac
callq 0x6ef0
movq 0x1e5c7(%rip), %rdi     # 0x25390
leaq 0x160e2(%rip), %rsi     # 0x1ceb2
callq 0x6ef0
movq 0x1e5dc(%rip), %rdi     # 0x253b8
leaq 0x160dd(%rip), %rsi     # 0x1cec0
callq 0x6ef0
movq 0x1e5c1(%rip), %rdi     # 0x253b0
leaq 0x160d2(%rip), %rsi     # 0x1cec8
callq 0x6ef0
movq 0x130(%rsp), %rdi
callq 0x22c0
movq 0x128(%rsp), %rdi
callq 0xc4e0
movl $0xffffffff, 0x154(%rsp) # imm = 0xFFFFFFFF
movl 0x154(%rsp), %eax
addq $0x158, %rsp            # imm = 0x158
retq
nop