// File: /workspace/github_c_makefile_star2_O1/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:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movl %ecx, 0x40(%rsp)
movl %edx, 0x8(%rsp)
testl %r8d, %r8d
jle 0x5c5f
movl %r9d, %ebx
movl %r8d, %r13d
movl %esi, %r12d
movl %edi, %r14d
movl %r8d, %r15d
leaq (,%r15,8), %rdi
movq %rdi, 0x28(%rsp)
callq 0x22f0
movq %rax, %rbp
xorl %eax, %eax
callq 0x5c6c
movq %rax, 0x16fbb(%rip)     # 0x1c398
xorl %eax, %eax
callq 0x5c6c
movq %rax, 0x16fbd(%rip)     # 0x1c3a8
xorl %eax, %eax
callq 0x5c6c
movq %rax, 0x16fbf(%rip)     # 0x1c3b8
xorl %eax, %eax
callq 0x5c6c
movq %rax, 0x16f89(%rip)     # 0x1c390
xorl %eax, %eax
callq 0x5c6c
movq %rax, 0x16f8b(%rip)     # 0x1c3a0
xorl %eax, %eax
callq 0x5c6c
movq %rax, 0x16f8d(%rip)     # 0x1c3b0
movq 0x16f7d(%rip), %xmm0    # 0x1c3a8
movq 0x16f65(%rip), %xmm1    # 0x1c398
punpcklqdq %xmm0, %xmm1    # xmm1 = xmm1[0],xmm0[0]
movq 0x16f51(%rip), %xmm0    # 0x1c390
movq 0x16f71(%rip), %xmm2    # 0x1c3b8
punpcklqdq %xmm0, %xmm2    # xmm2 = xmm2[0],xmm0[0]
pxor %xmm0, %xmm0
cmpq $0x0, 0x16f49(%rip)     # 0x1c3a0
sete %cl
testq %rax, %rax
sete %al
pcmpeqd %xmm0, %xmm2
pcmpeqd %xmm0, %xmm1
movdqa %xmm1, %xmm0
shufps $0xdd, %xmm2, %xmm0     # xmm0 = xmm0[1,3],xmm2[1,3]
shufps $0x88, %xmm2, %xmm1     # xmm1 = xmm1[0,2],xmm2[0,2]
andps %xmm0, %xmm1
movmskps %xmm1, %edx
testl %edx, %edx
setne %dl
orb %cl, %al
orb %dl, %al
cmpb $0x1, %al
jne 0x5491
callq 0x2e00
jmp 0x5bac
movl %r12d, 0x68(%rsp)
movl %r14d, 0x54(%rsp)
movl %ebx, 0x24(%rsp)
callq 0x841c
movq %rax, %rbx
leaq 0x16e82(%rip), %r14     # 0x1c330
cmpb $0x1, 0x2a(%r14)
jne 0x54bf
movq %rbx, %rdi
xorl %esi, %esi
callq 0x9423
movl 0xc8(%rsp), %r12d
movq (%r14), %rsi
movswl 0x8(%r14), %edx
movq %rbx, %rdi
xorl %ecx, %ecx
callq 0x86fd
movq 0x14b00(%rip), %rax     # 0x19fe0
movq (%rax), %rcx
leaq 0xd89b(%rip), %rdi      # 0x12d85
movl $0x1f, %esi
movl $0x1, %edx
callq 0x2550
cmpb $0x1, 0x28(%r14)
je 0x5bc3
testl %r12d, %r12d
movq %rbp, 0x48(%rsp)
movq %r13, 0x60(%rsp)
movq %rbx, 0x38(%rsp)
je 0x56e9
jle 0x5c64
movl 0xd0(%rsp), %edi
cmpb $0x1, 0x28(%r14)
je 0x5bea
shlq $0x6, %r15
movq %r15, %rdi
callq 0x22f0
movq %rax, %rbp
xorl %ebx, %ebx
movl %r12d, %eax
xorl %edx, %edx
divl %r13d
movl %eax, 0x8(%rsp)
xorl %edi, %edi
callq 0x2ffc
movq %rax, %r15
xorl %edi, %edi
callq 0x2ffc
movq %rax, %r12
xorl %edi, %edi
callq 0x2ffc
movq %rax, %r14
leaq 0xd8d9(%rip), %rdi      # 0x12e4f
movq %r15, 0x18(%rsp)
movq %r15, %rsi
movq %rax, %rdx
callq 0x314f
movq %rax, 0x78(%rsp)
leaq 0xd87b(%rip), %rdi      # 0x12e0d
movq %r12, 0x10(%rsp)
movq %r12, %rsi
movq %r14, 0x40(%rsp)
movq %r14, %rdx
callq 0x314f
movq %rax, 0x70(%rsp)
movl 0xd0(%rsp), %ecx
cmpl $0x64, %ecx
movl $0x64, %eax
cmovll %ecx, %eax
testl %eax, %eax
cmovlel %ebx, %eax
movl %eax, 0x30(%rsp)
leal -0x1(%r13), %eax
movq %rax, 0x28(%rsp)
cmpl $0x1, %r13d
adcl $0x0, %r13d
movq %r13, 0x68(%rsp)
movq 0x48(%rsp), %r13
movq %rbp, 0x58(%rsp)
xorl %r12d, %r12d
movl 0x24(%rsp), %r15d
movl 0x54(%rsp), %r14d
movq 0x18(%rsp), %rax
movq %rax, 0x18(%rbp)
movq 0x10(%rsp), %rax
movq %rax, 0x20(%rbp)
movq 0x40(%rsp), %rax
movq %rax, 0x30(%rbp)
movl %r15d, 0xc(%rbp)
movl 0xc0(%rsp), %ecx
movl %ecx, 0x10(%rbp)
leaq 0x16d0c(%rip), %rax     # 0x1c330
movl 0x40(%rax), %eax
movl %eax, (%rbp)
movl %ecx, 0x10(%rbp)
movq 0x38(%rsp), %rax
movq %rax, 0x38(%rbp)
movl %ebx, 0x14(%rbp)
movl 0x30(%rsp), %eax
movl %eax, 0x28(%rbp)
movl %r14d, 0x8(%rbp)
movl 0xc8(%rsp), %eax
subl %r12d, %eax
cmpq %rbx, 0x28(%rsp)
cmovnel 0x8(%rsp), %eax
movl %eax, 0x4(%rbp)
addl %eax, %r12d
movq %r13, %rdi
xorl %esi, %esi
leaq -0x4fb(%rip), %rdx      # 0x516f
movq %rbp, %rcx
callq 0x24f0
incq %rbx
addq $0x40, %rbp
addq $0x8, %r13
cmpq %rbx, 0x68(%rsp)
jne 0x55f4
movq 0x10(%rsp), %r12
movq 0x60(%rsp), %r14
cmpl $0x1, %r14d
adcl $0x0, %r14d
leaq 0x80(%rsp), %r15
movq 0x48(%rsp), %rbp
movq %rbp, %rbx
movq (%rbx), %rdi
movq %r15, %rsi
callq 0x21f0
addq $0x8, %rbx
decq %r14
jne 0x56aa
movq 0x78(%rsp), %rdi
callq 0x31af
movq 0x70(%rsp), %rdi
callq 0x31af
movq 0x58(%rsp), %rdi
callq 0x22a0
movq %r12, %rdi
callq 0x3027
jmp 0x5b1b
cmpl $0x0, 0x8(%rsp)
movl 0x68(%rsp), %r12d
movq %r15, 0x58(%rsp)
je 0x5864
cmpb $0x1, 0x28(%r14)
je 0x5bf4
shlq $0x4, %r15
leaq (%r15,%r15,2), %rdi
callq 0x22f0
movq %rax, %rbx
xorl %r12d, %r12d
movl 0x8(%rsp), %eax
xorl %edx, %edx
divl %r13d
movl %eax, 0x10(%rsp)
xorl %edi, %edi
callq 0x2ffc
movq %rax, %r14
xorl %edi, %edi
callq 0x2ffc
movq %rax, %r15
leaq 0xd6c9(%rip), %rdi      # 0x12e0d
movq %r14, 0x18(%rsp)
movq %r14, %rsi
movq %rax, %rdx
callq 0x314f
movq %rax, 0x70(%rsp)
leal -0x1(%r13), %eax
movq %rax, 0x30(%rsp)
cmpl $0x1, %r13d
movl %r13d, %r14d
adcl $0x0, %r14d
movq %rbp, %r13
movq %rbx, 0x78(%rsp)
movq %rbx, %rbp
xorl %ebx, %ebx
movq 0x18(%rsp), %rax
movq %rax, 0x18(%rbp)
movq %r15, 0x20(%rbp)
movl 0x24(%rsp), %eax
movl %eax, 0x8(%rbp)
movl 0xc0(%rsp), %eax
movl %eax, 0xc(%rbp)
movq 0x38(%rsp), %rax
movq %rax, 0x28(%rbp)
movl %r12d, 0x10(%rbp)
leaq 0x16b84(%rip), %rax     # 0x1c330
movl 0x40(%rax), %eax
cmpb $0x0, 0xd8(%rsp)
je 0x57c5
movl %eax, (%rbp)
movl 0x10(%rsp), %eax
movl %eax, 0x4(%rbp)
jmp 0x57df
addl %ebx, %eax
movl %eax, (%rbp)
movl 0x8(%rsp), %eax
subl %ebx, %eax
cmpq %r12, 0x30(%rsp)
cmovnel 0x10(%rsp), %eax
movl %eax, 0x4(%rbp)
addl %eax, %ebx
movq %r13, %rdi
xorl %esi, %esi
leaq -0xea3(%rip), %rdx      # 0x4948
movq %rbp, %rcx
callq 0x24f0
incq %r12
addq $0x30, %rbp
addq $0x8, %r13
cmpq %r12, %r14
jne 0x577a
leaq 0x80(%rsp), %rbx
movq 0x48(%rsp), %rbp
movq %rbp, %r15
movl 0x68(%rsp), %r12d
movq (%r15), %rdi
movq %rbx, %rsi
callq 0x21f0
addq $0x8, %r15
decq %r14
jne 0x581c
movq 0x70(%rsp), %rdi
callq 0x31af
movq 0x78(%rsp), %rdi
callq 0x22a0
movq 0x18(%rsp), %rdi
callq 0x3027
movq 0x60(%rsp), %r13
movq 0x38(%rsp), %rbx
leaq 0x16ad1(%rip), %r14     # 0x1c330
movq 0x58(%rsp), %r15
testl %r12d, %r12d
je 0x59be
cmpb $0x1, 0x28(%r14)
je 0x5c18
movq 0x28(%rsp), %rax
leaq (%rax,%rax,4), %rdi
callq 0x22f0
movq %rax, %r15
xorl %r14d, %r14d
movl %r12d, %eax
xorl %edx, %edx
divl %r13d
movl %eax, 0x10(%rsp)
xorl %edi, %edi
callq 0x2ffc
leaq 0xd5a9(%rip), %rdi      # 0x12e4f
movq %rax, 0x18(%rsp)
movq %rax, %rsi
xorl %edx, %edx
callq 0x314f
movq %rax, 0x28(%rsp)
leal -0x1(%r13), %eax
movq %rax, 0x8(%rsp)
cmpl $0x1, %r13d
movl %r13d, %ebx
adcl $0x0, %ebx
movq %rbp, %r13
movq %r15, 0x30(%rsp)
movq %r15, %rbp
xorl %r15d, %r15d
movq 0x18(%rsp), %rax
movq %rax, 0x18(%rbp)
leaq 0x16a45(%rip), %rcx     # 0x1c330
movl 0x40(%rcx), %eax
movl %eax, 0x4(%rbp)
movl 0x54(%rsp), %eax
movl %eax, 0x8(%rbp)
movl 0x24(%rsp), %eax
movl %eax, 0xc(%rbp)
movl 0xc0(%rsp), %eax
movl %eax, 0x10(%rbp)
movq 0x38(%rsp), %rax
movq %rax, 0x20(%rbp)
movl %r14d, 0x14(%rbp)
movl %r12d, %eax
subl %r15d, %eax
cmpq %r14, 0x8(%rsp)
cmovnel 0x10(%rsp), %eax
movl %eax, (%rbp)
addl %eax, %r15d
cmpl $0x0, 0x30(%rcx)
leaq -0x142c(%rip), %rdx     # 0x450b
leaq -0x1faa(%rip), %rax     # 0x3994
cmoveq %rax, %rdx
movq %r13, %rdi
xorl %esi, %esi
movq %rbp, %rcx
callq 0x24f0
incq %r14
addq $0x28, %rbp
addq $0x8, %r13
cmpq %r14, %rbx
jne 0x58db
movq 0x18(%rsp), %r12
leaq 0x80(%rsp), %r15
movq 0x48(%rsp), %rbp
movq %rbp, %r14
movq (%r14), %rdi
movq %r15, %rsi
callq 0x21f0
addq $0x8, %r14
decq %rbx
jne 0x5978
movq 0x28(%rsp), %rdi
callq 0x31af
movq 0x30(%rsp), %rdi
callq 0x22a0
movq %r12, %rdi
callq 0x3027
movq 0x60(%rsp), %r13
movq 0x38(%rsp), %rbx
leaq 0x16977(%rip), %r14     # 0x1c330
movq 0x58(%rsp), %r15
cmpl $0x0, 0x40(%rsp)
je 0x5b2a
cmpb $0x1, 0x28(%r14)
je 0x5c3b
shlq $0x4, %r15
leaq (%r15,%r15,2), %rdi
callq 0x22f0
movq %rax, %r12
movq %r13, %r14
xorl %r13d, %r13d
movl 0x40(%rsp), %eax
xorl %edx, %edx
divl %r14d
movl %eax, 0x10(%rsp)
xorl %edi, %edi
callq 0x2ffc
movq %rax, %rbx
xorl %edi, %edi
callq 0x2ffc
movq %rax, %r15
leaq 0xd445(%rip), %rdi      # 0x12e57
movq %rbx, 0x18(%rsp)
movq %rbx, %rsi
movq %rax, %rdx
callq 0x314f
movq %rax, 0x28(%rsp)
leal -0x1(%r14), %eax
movq %rax, 0x8(%rsp)
cmpl $0x1, %r14d
adcl $0x0, %r14d
movq %rbp, %rbx
movq %r12, 0x30(%rsp)
movq %r12, %rbp
xorl %r12d, %r12d
movq 0x18(%rsp), %rax
movq %rax, 0x18(%rbp)
movq %r15, 0x20(%rbp)
movl 0x24(%rsp), %eax
movl %eax, 0x8(%rbp)
movl 0xc0(%rsp), %eax
movl %eax, 0xc(%rbp)
movq 0x38(%rsp), %rax
movq %rax, 0x28(%rbp)
movl %r13d, 0x10(%rbp)
leaq 0x168b8(%rip), %rax     # 0x1c330
movl 0x40(%rax), %eax
cmpb $0x0, 0xd8(%rsp)
je 0x5a91
movl %eax, (%rbp)
movl 0x10(%rsp), %eax
movl %eax, 0x4(%rbp)
jmp 0x5aae
addl %r12d, %eax
movl %eax, (%rbp)
movl 0x40(%rsp), %eax
subl %r12d, %eax
cmpq %r13, 0x8(%rsp)
cmovnel 0x10(%rsp), %eax
movl %eax, 0x4(%rbp)
addl %eax, %r12d
movq %rbx, %rdi
xorl %esi, %esi
leaq -0xc71(%rip), %rdx      # 0x4e49
movq %rbp, %rcx
callq 0x24f0
incq %r13
addq $0x30, %rbp
addq $0x8, %rbx
cmpq %r13, %r14
jne 0x5a46
movq 0x60(%rsp), %r15
cmpl $0x1, %r15d
adcl $0x0, %r15d
leaq 0x80(%rsp), %rbx
movq 0x48(%rsp), %rbp
movq %rbp, %r14
movq (%r14), %rdi
movq %rbx, %rsi
callq 0x21f0
addq $0x8, %r14
decq %r15
jne 0x5af3
movq 0x28(%rsp), %rdi
callq 0x31af
movq 0x30(%rsp), %rdi
callq 0x22a0
movq 0x18(%rsp), %rdi
callq 0x3027
movq 0x38(%rsp), %rbx
movq 0x16877(%rip), %rdi     # 0x1c3a8
leaq 0xd37d(%rip), %rsi      # 0x12eb5
callq 0x5c9e
movq 0x1685c(%rip), %rdi     # 0x1c3a0
leaq 0xd371(%rip), %rsi      # 0x12ebc
callq 0x5c9e
movq 0x16841(%rip), %rdi     # 0x1c398
leaq 0xd36d(%rip), %rsi      # 0x12ecb
callq 0x5c9e
movq 0x16826(%rip), %rdi     # 0x1c390
leaq 0xd360(%rip), %rsi      # 0x12ed1
callq 0x5c9e
movq 0x1683b(%rip), %rdi     # 0x1c3b8
leaq 0xd35b(%rip), %rsi      # 0x12edf
callq 0x5c9e
movq 0x16820(%rip), %rdi     # 0x1c3b0
leaq 0xd350(%rip), %rsi      # 0x12ee7
callq 0x5c9e
movq %rbp, %rdi
callq 0x22a0
movq %rbx, %rdi
callq 0x89c3
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x14416(%rip), %rax     # 0x19fe0
movq (%rax), %rdi
leaq 0xd1d1(%rip), %rsi      # 0x12da5
movl %r13d, %edx
movl 0xc0(%rsp), %ecx
xorl %eax, %eax
callq 0x2390
jmp 0x5504
callq 0x2dbc
jmp 0x5534
movq 0x143e5(%rip), %rax     # 0x19fe0
movq (%rax), %rdi
leaq 0xd1ce(%rip), %rsi      # 0x12dd3
movl 0x8(%rsp), %edx
movl %r13d, %ecx
xorl %eax, %eax
callq 0x2390
jmp 0x5709
movq 0x143c1(%rip), %rax     # 0x19fe0
movq (%rax), %rdi
leaq 0xd1ed(%rip), %rsi      # 0x12e16
movl %r12d, %edx
movl %r13d, %ecx
xorl %eax, %eax
callq 0x2390
jmp 0x5878
movq 0x1439e(%rip), %rax     # 0x19fe0
movq (%rax), %rdi
leaq 0xd187(%rip), %rsi      # 0x12dd3
movl 0x40(%rsp), %edx
movl %r13d, %ecx
xorl %eax, %eax
callq 0x2390
jmp 0x59d4
callq 0x2e1c
callq 0x2ddb
nopl (%rax)