// File: /workspace/github_c_makefile_star2_O0/sharpyfox[P]citrusleaf-client/src/cl_scan.c
// Function: do_scan_monte
static int
do_scan_monte(cl_cluster *asc, char *node_name, uint operation_info, uint operation_info2, const char *ns, const char *set, 
	cl_bin *bins, int n_bins, uint8_t scan_pct, 
	citrusleaf_get_many_cb cb, void *udata, cl_scan_parameters *scan_opt)
{
	int rv = -1;

	uint8_t		rd_stack_buf[STACK_BUF_SZ];	
	uint8_t		*rd_buf = 0;
	size_t		rd_buf_sz = 0;
	uint8_t		wr_stack_buf[STACK_BUF_SZ];
	uint8_t		*wr_buf = wr_stack_buf;
	size_t		wr_buf_sz = sizeof(wr_stack_buf);

	cl_scan_param_field	scan_param_field;

	if (scan_opt) {
		scan_param_field.scan_pct = scan_pct>100? 100:scan_pct;
		scan_param_field.byte1 = (scan_opt->priority<<4) | (scan_opt->fail_on_cluster_change<<3);
	}

	// we have a single namespace and/or set to get
	if (cl_compile(operation_info, operation_info2, 0, ns, set, 0, 0, 0, 0, 0, 0, &wr_buf, &wr_buf_sz, 0, NULL, 0,
			scan_opt ? &scan_param_field : NULL)) {
		return(rv);
	}
	
#ifdef DEBUG_VERBOSE
	dump_buf("sending request to cluster:", wr_buf, wr_buf_sz);
#endif

	int fd;
	cl_cluster_node *node = 0;

	// Get an FD from a cluster
	if (node_name) {
		node = cl_cluster_node_get_byname(asc,node_name);
		// grab a reservation
		if (node)
			cf_client_rc_reserve(node);
	} else {
		pthread_mutex_lock(&asc->LOCK);
		node = cl_cluster_node_get_random(asc);
		pthread_mutex_unlock(&asc->LOCK);
	}
	if (!node) {
#ifdef DEBUG
		cf_debug("warning: no healthy nodes in cluster, failing");
#endif			
		return(-1);
	}
	fd = cl_cluster_node_fd_get(node, false, asc->nbconnect);
	if (fd == -1) {
#ifdef DEBUG			
		cf_debug("warning: node %s has no file descriptors, retrying transaction", node->name);
#endif
		return(-1);
	}
	
	// send it to the cluster - non blocking socket, but we're blocking
	if (0 != cf_socket_write_forever(fd, wr_buf, wr_buf_sz)) {
#ifdef DEBUG			
		cf_debug("Citrusleaf: write timeout or error when writing header to server - %d fd %d errno %d", rv, fd, errno);
#endif
		return(-1);
	}

	cl_proto 		proto;
	bool done = false;
	
	do { // multiple CL proto per response
		
		// Now turn around and read a fine cl_pro - that's the first 8 bytes that has types and lengths
		if ((rv = cf_socket_read_forever(fd, (uint8_t *) &proto, sizeof(cl_proto) ) ) ) {
			cf_error("network error: errno %d fd %d",rv, fd);
			return(-1);
		}
#ifdef DEBUG_VERBOSE
		dump_buf("read proto header from cluster", (uint8_t *) &proto, sizeof(cl_proto));
#endif	
		cl_proto_swap(&proto);

		if (proto.version != CL_PROTO_VERSION) {
			cf_error("network error: received protocol message of wrong version %d", proto.version);
			return(-1);
		}
		if (proto.type != CL_PROTO_TYPE_CL_MSG) {
			cf_error("network error: received incorrect message version %d", proto.type);
			return(-1);
		}
		
		// second read for the remainder of the message - expect this to cover lots of data, many lines
		//
		// if there's no error
		rd_buf_sz =  proto.sz;
		if (rd_buf_sz > 0) {
                                                         
//            cf_debug("message read: size %u",(uint)proto.sz);

			if (rd_buf_sz > sizeof(rd_stack_buf))
				rd_buf = malloc(rd_buf_sz);
			else
				rd_buf = rd_stack_buf;
			if (rd_buf == NULL) 		return (-1);

			if ((rv = cf_socket_read_forever(fd, rd_buf, rd_buf_sz))) {
				cf_error("network error: errno %d fd %d", rv, fd);
				if (rd_buf != rd_stack_buf)	{ free(rd_buf); }
				return(-1);
			}
// this one's a little much: printing the entire body before printing the other bits			
#ifdef DEBUG_VERBOSE
			dump_buf("read msg body header (multiple msgs)", rd_buf, rd_buf_sz);
#endif	
		}
		
		// process all the cl_msg in this proto
		uint8_t *buf = rd_buf;
		uint pos = 0;
		cl_bin stack_bins[STACK_BINS];
		cl_bin *bins_local;
		
		while (pos < rd_buf_sz) {

#ifdef DEBUG_VERBOSE
			dump_buf("individual message header", buf, sizeof(cl_msg));
#endif	
			
			uint8_t *buf_start = buf;
			cl_msg *msg = (cl_msg *) buf;
			cl_msg_swap_header(msg);
			buf += sizeof(cl_msg);
			
			if (msg->header_sz != sizeof(cl_msg)) {
				cf_error("received cl msg of unexpected size: expecting %zd found %d, internal error",
					sizeof(cl_msg),msg->header_sz);
				return(-1);
			}

			// parse through the fields
			cf_digest *keyd = 0;
			char ns_ret[33] = {0};
			char *set_ret = NULL;
			cl_msg_field *mf = (cl_msg_field *)buf;
			for (int i=0;i<msg->n_fields;i++) {
				cl_msg_swap_field(mf);
				if (mf->type == CL_MSG_FIELD_TYPE_KEY) {
					cf_error("read: found a key - unexpected");
				}
				else if (mf->type == CL_MSG_FIELD_TYPE_DIGEST_RIPE) {
					keyd = (cf_digest *) mf->data;
				}
				else if (mf->type == CL_MSG_FIELD_TYPE_NAMESPACE) {
					memcpy(ns_ret, mf->data, cl_msg_field_get_value_sz(mf));
					ns_ret[ cl_msg_field_get_value_sz(mf) ] = 0;
				}
				else if (mf->type == CL_MSG_FIELD_TYPE_SET) {
					uint32_t set_name_len = cl_msg_field_get_value_sz(mf);
					set_ret = (char *)malloc(set_name_len + 1);
					memcpy(set_ret, mf->data, set_name_len);
					set_ret[ set_name_len ] = '\0';
				}

				mf = cl_msg_field_get_next(mf);
			}
			buf = (uint8_t *) mf;

#ifdef DEBUG_VERBOSE
			cf_debug("message header fields: nfields %u nops %u", msg->n_fields, msg->n_ops);
#endif


			if (msg->n_ops > STACK_BINS) {
				bins_local = malloc(sizeof(cl_bin) * msg->n_ops);
			}
			else {
				bins_local = stack_bins;
			}
			if (bins_local == NULL) {
				if (set_ret) {
					free(set_ret);
				}
				return (-1);
			}
			
			// parse through the bins/ops
			cl_msg_op *op = (cl_msg_op *)buf;
			for (int i=0;i<msg->n_ops;i++) {

				cl_msg_swap_op(op);

#ifdef DEBUG_VERBOSE
				cf_debug("op receive: %p size %d op %d ptype %d pversion %d namesz %d",
					op,op->op_sz, op->op, op->particle_type, op->version, op->name_sz);				
#endif			

#ifdef DEBUG_VERBOSE
				dump_buf("individual op (host order)", (uint8_t *) op, op->op_sz + sizeof(uint32_t));
#endif	

				cl_set_value_particular(op, &bins_local[i]);
				op = cl_msg_op_get_next(op);
			}
			buf = (uint8_t *) op;
			
			if (msg->result_code != CL_RESULT_OK) {
				// Special case - if we scan a set name that doesn't exist on a
				// node, it will return "not found" - we unify this with the
				// case where OK is returned and no callbacks were made. [AKG]
				if (msg->result_code == CL_RESULT_NOTFOUND) {
					msg->result_code = CL_RESULT_OK;
				}
				rv = (int)msg->result_code;
				done = true;
			}
			else if (msg->info3 & CL_MSG_INFO3_LAST)	{
#ifdef DEBUG
				cf_debug("received final message");
#endif
				done = true;
			}
			else if ((msg->n_ops) || (operation_info & CL_MSG_INFO1_NOBINDATA)) {
				// got one good value? call it a success!
				(*cb) ( ns_ret, keyd, set_ret, msg->generation, msg->record_ttl, bins_local, msg->n_ops, false /*islast*/, udata);
				rv = 0;
			}
//			else
//				cf_debug("received message with no bins, signal of an error");

			if (bins_local != stack_bins) {
				free(bins_local);
				bins_local = 0;
			}

			if (set_ret) {
				free(set_ret);
				set_ret = NULL;
			}

			// don't have to free object internals. They point into the read buffer, where
			// a pointer is required
			pos += buf - buf_start;
			
		}
		
		if (rd_buf && (rd_buf != rd_stack_buf))	{
			free(rd_buf);
			rd_buf = 0;
		}

	} while ( done == false );

	if (wr_buf != wr_stack_buf) {
		free(wr_buf);
		wr_buf = 0;
	}

	cl_cluster_node_fd_put(node, fd, false);
	cl_cluster_node_put(node);
	node = 0;
	
#ifdef DEBUG_VERBOSE	
	cf_debug("exited loop: rv %d", rv );
#endif	
	
	return(rv);
}

// Assembly:
pushq %rbx
subq $0x9a90, %rsp           # imm = 0x9A90
movq 0x9ac8(%rsp), %rax
movq 0x9ac0(%rsp), %rax
movq 0x9ab8(%rsp), %rax
movb 0x9ab0(%rsp), %al
movl 0x9aa8(%rsp), %eax
movq 0x9aa0(%rsp), %rax
movq %rdi, 0x9a80(%rsp)
movq %rsi, 0x9a78(%rsp)
movl %edx, 0x9a74(%rsp)
movl %ecx, 0x9a70(%rsp)
movq %r8, 0x9a68(%rsp)
movq %r9, 0x9a60(%rsp)
movl $0xffffffff, 0x9a5c(%rsp) # imm = 0xFFFFFFFF
movq $0x0, 0x5a48(%rsp)
movq $0x0, 0x5a40(%rsp)
leaq 0x1a40(%rsp), %rax
movq %rax, 0x1a38(%rsp)
movq $0x4000, 0x1a30(%rsp) # imm = 0x4000
cmpq $0x0, 0x9ac8(%rsp)
je 0x11f80
movzbl 0x9ab0(%rsp), %eax
cmpl $0x64, %eax
jle 0x11f39
movl $0x64, %eax
movl %eax, 0x88(%rsp)
jmp 0x11f48
movzbl 0x9ab0(%rsp), %eax
movl %eax, 0x88(%rsp)
movl 0x88(%rsp), %eax
movb %al, 0x1a2f(%rsp)
movq 0x9ac8(%rsp), %rax
movl 0x4(%rax), %eax
shll $0x4, %eax
movq 0x9ac8(%rsp), %rcx
movb (%rcx), %cl
andb $0x1, %cl
movzbl %cl, %ecx
shll $0x3, %ecx
orl %ecx, %eax
movb %al, 0x1a2e(%rsp)
movl 0x9a74(%rsp), %eax
movl %eax, 0x70(%rsp)
movl 0x9a70(%rsp), %eax
movl %eax, 0x74(%rsp)
movq 0x9a68(%rsp), %rax
movq %rax, 0x78(%rsp)
movq 0x9a60(%rsp), %rax
movq %rax, 0x80(%rsp)
cmpq $0x0, 0x9ac8(%rsp)
je 0x11fcd
leaq 0x1a2e(%rsp), %rax
movq %rax, 0x68(%rsp)
jmp 0x11fd6
xorl %eax, %eax
movq %rax, 0x68(%rsp)
jmp 0x11fd6
movq 0x80(%rsp), %r8
movq 0x78(%rsp), %rcx
movl 0x74(%rsp), %esi
movl 0x70(%rsp), %edi
movq 0x68(%rsp), %rax
xorl %edx, %edx
xorl %r9d, %r9d
leaq 0x1a38(%rsp), %r11
leaq 0x1a30(%rsp), %r10
movq $0x0, (%rsp)
movq $0x0, 0x8(%rsp)
movl $0x0, 0x10(%rsp)
movq $0x0, 0x18(%rsp)
movl $0x0, 0x20(%rsp)
movq %r11, 0x28(%rsp)
movq %r10, 0x30(%rsp)
movq $0x0, 0x38(%rsp)
movq $0x0, 0x40(%rsp)
movq $0x0, 0x48(%rsp)
movq %rax, 0x50(%rsp)
callq 0x63b0
cmpl $0x0, %eax
je 0x12076
movl 0x9a5c(%rsp), %eax
movl %eax, 0x9a8c(%rsp)
jmp 0x129bc
movq $0x0, 0x1a20(%rsp)
cmpq $0x0, 0x9a78(%rsp)
je 0x120c4
movq 0x9a80(%rsp), %rdi
movq 0x9a78(%rsp), %rsi
callq 0x6610
movq %rax, 0x1a20(%rsp)
cmpq $0x0, 0x1a20(%rsp)
je 0x120c2
movq 0x1a20(%rsp), %rdi
callq 0x65b0
jmp 0x12101
movq 0x9a80(%rsp), %rdi
addq $0x158, %rdi            # imm = 0x158
callq 0x6c80
movq 0x9a80(%rsp), %rdi
callq 0x6430
movq %rax, 0x1a20(%rsp)
movq 0x9a80(%rsp), %rdi
addq $0x158, %rdi            # imm = 0x158
callq 0x66e0
cmpq $0x0, 0x1a20(%rsp)
jne 0x1211c
movl $0xffffffff, 0x9a8c(%rsp) # imm = 0xFFFFFFFF
jmp 0x129bc
movq 0x1a20(%rsp), %rdi
movq 0x9a80(%rsp), %rax
movb 0x15(%rax), %al
xorl %esi, %esi
andb $0x1, %al
movzbl %al, %edx
callq 0x6550
movl %eax, 0x1a28(%rsp)
cmpl $-0x1, 0x1a28(%rsp)
jne 0x1215c
movl $0xffffffff, 0x9a8c(%rsp) # imm = 0xFFFFFFFF
jmp 0x129bc
movl 0x1a28(%rsp), %edi
movq 0x1a38(%rsp), %rsi
movq 0x1a30(%rsp), %rdx
callq 0x6030
movl %eax, %ecx
xorl %eax, %eax
cmpl %ecx, %eax
je 0x12190
movl $0xffffffff, 0x9a8c(%rsp) # imm = 0xFFFFFFFF
jmp 0x129bc
movb $0x0, 0x1a17(%rsp)
movl 0x1a28(%rsp), %edi
leaq 0x1a18(%rsp), %rsi
movl $0x8, %edx
callq 0x6b90
movl %eax, 0x9a5c(%rsp)
cmpl $0x0, %eax
je 0x12202
movq 0x10e04(%rip), %rax     # 0x22fc8
movl (%rax), %ecx
xorl %eax, %eax
cmpl %ecx, %eax
jg 0x121f2
movq 0x10dcd(%rip), %rax     # 0x22fa0
movq (%rax), %r8
movl 0x9a5c(%rsp), %edx
movl 0x1a28(%rsp), %ecx
xorl %edi, %edi
leaq 0xb6c5(%rip), %rsi      # 0x1d8b2
movb $0x0, %al
callq *%r8
movl $0xffffffff, 0x9a8c(%rsp) # imm = 0xFFFFFFFF
jmp 0x129bc
leaq 0x1a18(%rsp), %rdi
callq 0x6530
movzbl 0x1a18(%rsp), %eax
cmpl $0x2, %eax
je 0x1225a
movq 0x10da5(%rip), %rax     # 0x22fc8
movl (%rax), %ecx
xorl %eax, %eax
cmpl %ecx, %eax
jg 0x1224a
movq 0x10d6e(%rip), %rax     # 0x22fa0
movq (%rax), %rcx
movzbl 0x1a18(%rsp), %edx
xorl %edi, %edi
leaq 0xb68a(%rip), %rsi      # 0x1d8d0
movb $0x0, %al
callq *%rcx
movl $0xffffffff, 0x9a8c(%rsp) # imm = 0xFFFFFFFF
jmp 0x129bc
movzbl 0x1a19(%rsp), %eax
cmpl $0x3, %eax
je 0x122a5
movq 0x10d5a(%rip), %rax     # 0x22fc8
movl (%rax), %ecx
xorl %eax, %eax
cmpl %ecx, %eax
jg 0x12295
movq 0x10d23(%rip), %rax     # 0x22fa0
movq (%rax), %rcx
movzbl 0x1a19(%rsp), %edx
xorl %edi, %edi
leaq 0xb67c(%rip), %rsi      # 0x1d90d
movb $0x0, %al
callq *%rcx
movl $0xffffffff, 0x9a8c(%rsp) # imm = 0xFFFFFFFF
jmp 0x129bc
movl 0x1a1a(%rsp), %eax
movzwl 0x1a1e(%rsp), %ecx
shlq $0x20, %rcx
orq %rcx, %rax
movq %rax, 0x5a40(%rsp)
cmpq $0x0, 0x5a40(%rsp)
jbe 0x123b3
cmpq $0x4000, 0x5a40(%rsp) # imm = 0x4000
jbe 0x122f7
movq 0x5a40(%rsp), %rdi
callq 0x6720
movq %rax, 0x5a48(%rsp)
jmp 0x12307
leaq 0x5a50(%rsp), %rax
movq %rax, 0x5a48(%rsp)
cmpq $0x0, 0x5a48(%rsp)
jne 0x12322
movl $0xffffffff, 0x9a8c(%rsp) # imm = 0xFFFFFFFF
jmp 0x129bc
movl 0x1a28(%rsp), %edi
movq 0x5a48(%rsp), %rsi
movq 0x5a40(%rsp), %rdx
callq 0x6b90
movl %eax, 0x9a5c(%rsp)
cmpl $0x0, %eax
je 0x123b1
movq 0x10c77(%rip), %rax     # 0x22fc8
movl (%rax), %ecx
xorl %eax, %eax
cmpl %ecx, %eax
jg 0x1237f
movq 0x10c40(%rip), %rax     # 0x22fa0
movq (%rax), %r8
movl 0x9a5c(%rsp), %edx
movl 0x1a28(%rsp), %ecx
xorl %edi, %edi
leaq 0xb538(%rip), %rsi      # 0x1d8b2
movb $0x0, %al
callq *%r8
movq 0x5a48(%rsp), %rax
leaq 0x5a50(%rsp), %rcx
cmpq %rcx, %rax
je 0x123a1
movq 0x5a48(%rsp), %rdi
callq 0x6070
movl $0xffffffff, 0x9a8c(%rsp) # imm = 0xFFFFFFFF
jmp 0x129bc
jmp 0x123b3
movq 0x5a48(%rsp), %rax
movq %rax, 0x1a08(%rsp)
movl $0x0, 0x1a04(%rsp)
movl 0x1a04(%rsp), %eax
cmpq 0x5a40(%rsp), %rax
jae 0x12901
movq 0x1a08(%rsp), %rax
movq %rax, 0xf0(%rsp)
movq 0x1a08(%rsp), %rax
movq %rax, 0xe8(%rsp)
movq 0xe8(%rsp), %rdi
callq 0x6b00
movq 0x1a08(%rsp), %rax
addq $0x16, %rax
movq %rax, 0x1a08(%rsp)
movq 0xe8(%rsp), %rax
movzbl (%rax), %eax
cmpq $0x16, %rax
je 0x1247c
movq 0x10b8c(%rip), %rax     # 0x22fc8
movl (%rax), %ecx
xorl %eax, %eax
cmpl %ecx, %eax
jg 0x1246c
movq 0x10b55(%rip), %rax     # 0x22fa0
movq (%rax), %r8
movq 0xe8(%rsp), %rax
movzbl (%rax), %ecx
xorl %edi, %edi
leaq 0xb512(%rip), %rsi      # 0x1d974
movl $0x16, %edx
movb $0x0, %al
callq *%r8
movl $0xffffffff, 0x9a8c(%rsp) # imm = 0xFFFFFFFF
jmp 0x129bc
movq $0x0, 0xe0(%rsp)
leaq 0xb0(%rsp), %rdi
xorl %esi, %esi
movl $0x21, %edx
callq 0x63f0
movq $0x0, 0xa8(%rsp)
movq 0x1a08(%rsp), %rax
movq %rax, 0xa0(%rsp)
movl $0x0, 0x9c(%rsp)
movl 0x9c(%rsp), %eax
movq 0xe8(%rsp), %rcx
movzwl 0x12(%rcx), %ecx
cmpl %ecx, %eax
jge 0x1265f
movq 0xa0(%rsp), %rdi
callq 0x6c40
movq 0xa0(%rsp), %rax
movzbl 0x4(%rax), %eax
cmpl $0x2, %eax
jne 0x12527
movq 0x10ac5(%rip), %rax     # 0x22fc8
movl (%rax), %ecx
xorl %eax, %eax
cmpl %ecx, %eax
jg 0x12522
movq 0x10a8e(%rip), %rax     # 0x22fa0
movq (%rax), %rcx
xorl %edi, %edi
leaq 0xb4a1(%rip), %rsi      # 0x1d9bf
movb $0x0, %al
callq *%rcx
jmp 0x12634
movq 0xa0(%rsp), %rax
movzbl 0x4(%rax), %eax
cmpl $0x4, %eax
jne 0x12551
movq 0xa0(%rsp), %rax
addq $0x5, %rax
movq %rax, 0xe0(%rsp)
jmp 0x12632
movq 0xa0(%rsp), %rax
movzbl 0x4(%rax), %eax
cmpl $0x0, %eax
jne 0x125b9
leaq 0xb0(%rsp), %rax
movq %rax, 0x58(%rsp)
movq 0xa0(%rsp), %rax
addq $0x5, %rax
movq %rax, 0x60(%rsp)
movq 0xa0(%rsp), %rdi
callq 0x12db0
movq 0x58(%rsp), %rdi
movq 0x60(%rsp), %rsi
movl %eax, %eax
movl %eax, %edx
callq 0x65d0
movq 0xa0(%rsp), %rdi
callq 0x12db0
movl %eax, %eax
movb $0x0, 0xb0(%rsp,%rax)
jmp 0x12630
movq 0xa0(%rsp), %rax
movzbl 0x4(%rax), %eax
cmpl $0x1, %eax
jne 0x1262e
movq 0xa0(%rsp), %rdi
callq 0x12db0
movl %eax, 0x98(%rsp)
movl 0x98(%rsp), %eax
addl $0x1, %eax
movl %eax, %eax
movl %eax, %edi
callq 0x6720
movq %rax, 0xa8(%rsp)
movq 0xa8(%rsp), %rdi
movq 0xa0(%rsp), %rsi
addq $0x5, %rsi
movl 0x98(%rsp), %eax
movl %eax, %edx
callq 0x65d0
movq 0xa8(%rsp), %rax
movl 0x98(%rsp), %ecx
movb $0x0, (%rax,%rcx)
jmp 0x12630
jmp 0x12632
jmp 0x12634
movq 0xa0(%rsp), %rdi
callq 0x12dc0
movq %rax, 0xa0(%rsp)
movl 0x9c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x9c(%rsp)
jmp 0x124c3
movq 0xa0(%rsp), %rax
movq %rax, 0x1a08(%rsp)
movq 0xe8(%rsp), %rax
movzwl 0x14(%rax), %eax
cmpl $0x64, %eax
jle 0x126a1
movq 0xe8(%rsp), %rax
movzwl 0x14(%rax), %eax
movl %eax, %edi
shlq $0x6, %rdi
callq 0x6720
movq %rax, 0xf8(%rsp)
jmp 0x126b1
leaq 0x100(%rsp), %rax
movq %rax, 0xf8(%rsp)
cmpq $0x0, 0xf8(%rsp)
jne 0x126e4
cmpq $0x0, 0xa8(%rsp)
je 0x126d4
movq 0xa8(%rsp), %rdi
callq 0x6070
movl $0xffffffff, 0x9a8c(%rsp) # imm = 0xFFFFFFFF
jmp 0x129bc
movq 0x1a08(%rsp), %rax
movq %rax, 0x90(%rsp)
movl $0x0, 0x8c(%rsp)
movl 0x8c(%rsp), %eax
movq 0xe8(%rsp), %rcx
movzwl 0x14(%rcx), %ecx
cmpl %ecx, %eax
jge 0x1276f
movq 0x90(%rsp), %rdi
callq 0x63d0
movq 0x90(%rsp), %rdi
movq 0xf8(%rsp), %rsi
movslq 0x8c(%rsp), %rax
shlq $0x6, %rax
addq %rax, %rsi
callq 0x6120
movq 0x90(%rsp), %rdi
callq 0x12de0
movq %rax, 0x90(%rsp)
movl 0x8c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x8c(%rsp)
jmp 0x126ff
movq 0x90(%rsp), %rax
movq %rax, 0x1a08(%rsp)
movq 0xe8(%rsp), %rax
movzbl 0x5(%rax), %eax
cmpl $0x0, %eax
je 0x127cd
movq 0xe8(%rsp), %rax
movzbl 0x5(%rax), %eax
cmpl $0x2, %eax
jne 0x127ad
movq 0xe8(%rsp), %rax
movb $0x0, 0x5(%rax)
movq 0xe8(%rsp), %rax
movzbl 0x5(%rax), %eax
movl %eax, 0x9a5c(%rsp)
movb $0x1, 0x1a17(%rsp)
jmp 0x12886
movq 0xe8(%rsp), %rax
movzbl 0x3(%rax), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x127ee
movb $0x1, 0x1a17(%rsp)
jmp 0x12884
movq 0xe8(%rsp), %rax
movzwl 0x14(%rax), %eax
cmpl $0x0, %eax
jne 0x1280e
movl 0x9a74(%rsp), %eax
andl $0x20, %eax
cmpl $0x0, %eax
je 0x12882
movq 0x9ab8(%rsp), %rax
leaq 0xb0(%rsp), %rdi
movq 0xe0(%rsp), %rsi
movq 0xa8(%rsp), %rdx
movq 0xe8(%rsp), %rcx
movl 0x6(%rcx), %ecx
movq 0xe8(%rsp), %r8
movl 0xa(%r8), %r8d
movq 0xf8(%rsp), %r9
movq 0xe8(%rsp), %r10
movzwl 0x14(%r10), %r11d
movq 0x9ac0(%rsp), %r10
xorl %ebx, %ebx
movl %r11d, (%rsp)
movl $0x0, 0x8(%rsp)
movq %r10, 0x10(%rsp)
callq *%rax
movl $0x0, 0x9a5c(%rsp)
jmp 0x12884
jmp 0x12886
movq 0xf8(%rsp), %rax
leaq 0x100(%rsp), %rcx
cmpq %rcx, %rax
je 0x128b4
movq 0xf8(%rsp), %rdi
callq 0x6070
movq $0x0, 0xf8(%rsp)
cmpq $0x0, 0xa8(%rsp)
je 0x128d8
movq 0xa8(%rsp), %rdi
callq 0x6070
movq $0x0, 0xa8(%rsp)
movq 0x1a08(%rsp), %rcx
movq 0xf0(%rsp), %rax
subq %rax, %rcx
movl 0x1a04(%rsp), %eax
addq %rcx, %rax
movl %eax, 0x1a04(%rsp)
jmp 0x123ce
cmpq $0x0, 0x5a48(%rsp)
je 0x1293a
movq 0x5a48(%rsp), %rax
leaq 0x5a50(%rsp), %rcx
cmpq %rcx, %rax
je 0x1293a
movq 0x5a48(%rsp), %rdi
callq 0x6070
movq $0x0, 0x5a48(%rsp)
jmp 0x1293c
movb 0x1a17(%rsp), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
je 0x12198
movq 0x1a38(%rsp), %rax
leaq 0x1a40(%rsp), %rcx
cmpq %rcx, %rax
je 0x1297f
movq 0x1a38(%rsp), %rdi
callq 0x6070
movq $0x0, 0x1a38(%rsp)
movq 0x1a20(%rsp), %rdi
movl 0x1a28(%rsp), %esi
xorl %edx, %edx
callq 0x6110
movq 0x1a20(%rsp), %rdi
callq 0x6660
movq $0x0, 0x1a20(%rsp)
movl 0x9a5c(%rsp), %eax
movl %eax, 0x9a8c(%rsp)
movl 0x9a8c(%rsp), %eax
addq $0x9a90, %rsp           # imm = 0x9A90
popq %rbx
retq
nopl (%rax)