// File: /workspace/github_c_makefile_star2_O1/Tarsnap[P]kivaloo/liball/../lib/proto_dynamodb_kv/proto_dynamodb_kv_client.c
// Function: proto_dynamodb_kv_request_icas
int
proto_dynamodb_kv_request_icas(struct wire_requestqueue * Q, const char * key,
    const uint8_t * buf, size_t buflen, const uint8_t * buf2, size_t buflen2,
    int (* callback)(void *, int), void * cookie)
{
	struct status_cookie * C;
	uint8_t *rbuf, *p;
	size_t rlen;

	/* Validate key length. */
	if (strlen(key) > 255) {
		warn0("Key is too long");
		goto err0;
	}

	/* Validate value lengths. */
	if ((buflen > 256 * 1024) || (buflen2 > 256 * 1024)) {
		warn0("Value is too long");
		goto err0;
	}

	/* Bake a cookie. */
	if ((C = malloc(sizeof(struct status_cookie))) == NULL)
		goto err0;
	C->callback = callback;
	C->cookie = cookie;

	/* Compute request packet size. */
	rlen = 4 + 1 + strlen(key) + 4 + buflen + 4 + buflen2;

	/* Start writing a request. */
	if ((p = rbuf = wire_requestqueue_add_getbuf(Q,
	    rlen, callback_status, C)) == NULL)
		goto err1;

	/* Construct request. */
	be32enc(p, PROTO_DDBKV_ICAS);
	p += 4;
	*p++ = (uint8_t)strlen(key);
	memcpy(p, key, strlen(key));
	p += strlen(key);
	be32enc(p, (uint32_t)buflen);
	p += 4;
	memcpy(p, buf, buflen);
	p += buflen;
	be32enc(p, (uint32_t)buflen2);
	p += 4;
	memcpy(p, buf2, buflen2);
	p += buflen2;

	/* Sanity check. */
	assert(p == &rbuf[rlen]);

	/* Finish writing request. */
	if (wire_requestqueue_add_done(Q, rbuf, rlen))
		goto err1;

	/* Success! */
	return (0);

err1:
	free(C);
err0:
	/* Failure! */
	return (-1);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %r9, %r14
movq %r8, 0x20(%rsp)
movq %rcx, %r13
movq %rdx, %rbp
movq %rsi, %r12
movq %rdi, %rbx
movq %rsi, %rdi
callq 0x20f0
cmpq $0x100, %rax            # imm = 0x100
jb 0x5ad3
leaq 0x4e47(%rip), %rdi      # 0xa918
jmp 0x5af2
movq %rax, %r15
movl $0x40001, %eax          # imm = 0x40001
cmpq %rax, %r13
setb %cl
cmpq %rax, %r14
setb %al
testb %al, %cl
jne 0x5b1a
leaq 0x4e36(%rip), %rdi      # 0xa928
xorl %eax, %eax
callq 0x5773
callq 0x2090
movl $0x0, (%rax)
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
movl %ebx, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rbx, 0x8(%rsp)
movl $0x10, %edi
callq 0x21d0
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
testq %rax, %rax
je 0x5b09
movq 0x68(%rsp), %rdx
movq 0x60(%rsp), %rcx
movq %rcx, (%rax)
movq %rdx, 0x8(%rax)
leaq (%r14,%r13), %rcx
leaq 0xd(%r15,%rcx), %rsi
leaq -0x12c(%rip), %rdx      # 0x5a28
movq 0x8(%rsp), %rdi
movq %rsi, 0x10(%rsp)
movq %rax, 0x18(%rsp)
movq %rax, %rcx
callq 0x65ed
testq %rax, %rax
je 0x5c46
movq %rax, %r15
movl $0x1010100, (%rax)      # imm = 0x1010100
movq %r12, %rdi
callq 0x20f0
leaq 0x5(%r15), %rbx
movb %al, 0x4(%r15)
movq %r12, %rdi
callq 0x20f0
movq %rbx, %rdi
movq %r12, %rsi
movq %rax, %rdx
callq 0x21b0
movq %r12, %rdi
callq 0x20f0
movl %r13d, %ecx
rolw $0x8, %cx
leaq (%r15,%rax), %r12
addq $0x5, %r12
movw %cx, 0x7(%r15,%rax)
movl %r13d, %ecx
shrl $0x10, %ecx
movb %cl, 0x6(%r15,%rax)
xorl %ebx, %ebx
movb %bl, 0x5(%r15,%rax)
leaq (%r15,%rax), %rdi
addq $0x9, %rdi
movq %rbp, %rsi
movq %r13, %rdx
callq 0x21b0
leaq (%r12,%r13), %rbp
addq $0x4, %rbp
movl %r14d, %eax
rolw $0x8, %ax
leaq (%r12,%r13), %rdi
addq $0x8, %rdi
movw %ax, -0x2(%rdi)
movl %r14d, %eax
shrl $0x10, %eax
movb %al, -0x3(%rdi)
movb %bl, -0x4(%rdi)
movq 0x20(%rsp), %rsi
movq %r14, %rdx
callq 0x21b0
leaq (%r14,%rbp), %rax
addq $0x4, %rax
movq %r15, %rcx
movq 0x10(%rsp), %rdx
addq %rdx, %rcx
cmpq %rcx, %rax
jne 0x5c55
movq 0x8(%rsp), %rdi
movq %r15, %rsi
callq 0x68c9
testl %eax, %eax
je 0x5b09
movq 0x18(%rsp), %rdi
callq 0x2040
jmp 0x5b04
leaq 0x4cde(%rip), %rdi      # 0xa93a
leaq 0x4ce8(%rip), %rsi      # 0xa94b
leaq 0x4d98(%rip), %rcx      # 0xaa02
movl $0x105, %edx            # imm = 0x105
callq 0x2140