// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x70, %rsp
movq 0x18(%rbp), %rax
movq 0x10(%rbp), %rax
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq %r8, -0x30(%rbp)
movq %r9, -0x38(%rbp)
movq -0x18(%rbp), %rdi
callq 0x2100
cmpq $0xff, %rax
jbe 0x7d89
jmp 0x7d6b
leaq 0x6ca6(%rip), %rdi      # 0xea18
movb $0x0, %al
callq 0x7770
callq 0x20a0
movl $0x0, (%rax)
jmp 0x7f75
cmpq $0x40000, -0x28(%rbp)   # imm = 0x40000
ja 0x7d9d
cmpq $0x40000, -0x38(%rbp)   # imm = 0x40000
jbe 0x7dbd
jmp 0x7d9f
leaq 0x6c82(%rip), %rdi      # 0xea28
movb $0x0, %al
callq 0x7770
callq 0x20a0
movl $0x0, (%rax)
jmp 0x7f75
movl $0x10, %edi
callq 0x21f0
movq %rax, -0x40(%rbp)
cmpq $0x0, %rax
jne 0x7dd6
jmp 0x7f75
movq 0x10(%rbp), %rcx
movq -0x40(%rbp), %rax
movq %rcx, (%rax)
movq 0x18(%rbp), %rcx
movq -0x40(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x18(%rbp), %rdi
callq 0x2100
addq $0x5, %rax
addq $0x4, %rax
addq -0x28(%rbp), %rax
addq $0x4, %rax
addq -0x38(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x10(%rbp), %rdi
movq -0x58(%rbp), %rsi
movq -0x40(%rbp), %rcx
leaq -0x261(%rip), %rdx      # 0x7bc0
callq 0x8c00
movq %rax, -0x48(%rbp)
movq %rax, -0x50(%rbp)
cmpq $0x0, %rax
jne 0x7e39
jmp 0x7f6c
movq -0x50(%rbp), %rdi
movl $0x10101, %esi          # imm = 0x10101
callq 0x7cc0
movq -0x50(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x50(%rbp)
movq -0x18(%rbp), %rdi
callq 0x2100
movb %al, %cl
movq -0x50(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x50(%rbp)
movb %cl, (%rax)
movq -0x50(%rbp), %rax
movq %rax, -0x68(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x18(%rbp), %rdi
callq 0x2100
movq -0x68(%rbp), %rdi
movq -0x60(%rbp), %rsi
movq %rax, %rdx
callq 0x21d0
movq -0x18(%rbp), %rdi
callq 0x2100
addq -0x50(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rdi
movq -0x28(%rbp), %rax
movl %eax, %esi
callq 0x7cc0
movq -0x50(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x28(%rbp), %rdx
callq 0x21d0
movq -0x28(%rbp), %rax
addq -0x50(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rdi
movq -0x38(%rbp), %rax
movl %eax, %esi
callq 0x7cc0
movq -0x50(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rdi
movq -0x30(%rbp), %rsi
movq -0x38(%rbp), %rdx
callq 0x21d0
movq -0x38(%rbp), %rax
addq -0x50(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rax
movq -0x48(%rbp), %rcx
addq -0x58(%rbp), %rcx
cmpq %rcx, %rax
jne 0x7f2c
jmp 0x7f4b
leaq 0x6b07(%rip), %rdi      # 0xea3a
leaq 0x6b11(%rip), %rsi      # 0xea4b
movl $0x105, %edx            # imm = 0x105
leaq 0x6bbc(%rip), %rcx      # 0xeb02
callq 0x2160
movq -0x10(%rbp), %rdi
movq -0x48(%rbp), %rsi
movq -0x58(%rbp), %rdx
callq 0x8d90
cmpl $0x0, %eax
je 0x7f63
jmp 0x7f6c
movl $0x0, -0x4(%rbp)
jmp 0x7f7c
movq -0x40(%rbp), %rdi
callq 0x2040
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
movl -0x4(%rbp), %eax
addq $0x70, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)