// File: /workspace/github_c_makefile_star2_O2/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 0x5521
leaq 0x439b(%rip), %rdi      # 0x98ba
jmp 0x5540
movq %rax, %r15
movl $0x40001, %eax          # imm = 0x40001
cmpq %rax, %r13
setb %cl
cmpq %rax, %r14
setb %al
testb %al, %cl
jne 0x5565
leaq 0x438a(%rip), %rdi      # 0x98ca
xorl %eax, %eax
callq 0x5170
callq 0x2090
andl $0x0, (%rax)
pushq $-0x1
popq %r12
movl %r12d, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
pushq $0x10
popq %rdi
callq 0x21d0
pushq $-0x1
popq %rcx
testq %rax, %rax
je 0x56aa
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 -0x11f(%rip), %rdx      # 0x547b
movq %rbx, %rdi
movq %rsi, 0x10(%rsp)
movq %rax, 0x18(%rsp)
movq %rax, %rcx
callq 0x5f07
testq %rax, %rax
je 0x569b
movq %rax, %r15
movl $0x1010100, (%rax)      # imm = 0x1010100
movq %r12, %rdi
callq 0x20f0
leaq 0x5(%r15), %rcx
movq %rcx, 0x8(%rsp)
movb %al, 0x4(%r15)
movq %r12, %rdi
callq 0x20f0
movq 0x8(%rsp), %rdi
movq %r12, %rsi
movq %rax, %rdx
callq 0x21b0
movq %r12, %rdi
callq 0x20f0
movl %r13d, %ecx
rolw $0x8, %cx
leaq (%r15,%rax), %rdx
addq $0x5, %rdx
movq %rdx, 0x8(%rsp)
movw %cx, 0x7(%r15,%rax)
movl %r13d, %ecx
shrl $0x10, %ecx
movb %cl, 0x6(%r15,%rax)
xorl %r12d, %r12d
movb %r12b, 0x5(%r15,%rax)
leaq (%r15,%rax), %rdi
addq $0x9, %rdi
movq %rbp, %rsi
movq %r13, %rdx
callq 0x21b0
movq 0x8(%rsp), %rcx
leaq (%rcx,%r13), %rbp
addq $0x4, %rbp
movl %r14d, %eax
rolw $0x8, %ax
leaq (%rcx,%r13), %rdi
addq $0x8, %rdi
movw %ax, -0x2(%rdi)
movl %r14d, %eax
shrl $0x10, %eax
movb %al, -0x3(%rdi)
movb %r12b, -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 0x56b2
movq %rbx, %rdi
movq %r15, %rsi
callq 0x6129
testl %eax, %eax
je 0x5553
movq 0x18(%rsp), %rdi
callq 0x2040
jmp 0x554f
movl %ecx, %r12d
jmp 0x5553
leaq 0x4223(%rip), %rdi      # 0x98dc
leaq 0x422d(%rip), %rsi      # 0x98ed
leaq 0x42dd(%rip), %rcx      # 0x99a4
movl $0x105, %edx            # imm = 0x105
callq 0x2140