// File: /workspace/github_c_makefile_star2_O2/Tarsnap[P]kivaloo/tests/kvlds/main.c
// Function: main
int
main(int argc, char * argv[])
{
	struct wire_requestqueue * Q;
	struct kivaloo_cookie * K;
	size_t num_pairs = 40000;

	WARNP_INIT;

	/* Check number of arguments. */
	if ((argc != 2) && (argc != 3)) {
		fprintf(stderr, "usage: test_kvlds %s %s\n", "<socketname>",
		    "[num_pairs]");
		exit(1);
	}

	/* Override the default number of pairs to test. */
	if (argc == 3) {
		if (PARSENUM(&num_pairs, argv[2])) {
			warnp("parsnum");
			exit(1);
		}
	}

	/* Open a connection to KVLDS. */
	if ((K = kivaloo_open(argv[1], &Q)) == NULL) {
		warnp("Could not connect to KVLDS daemon.");
		goto err0;
	}

	/* Get maximum key/value lengths. */
	if (doparams(Q))
		goto err1;

	/* Test B+Tree mutation code paths. */
	if (mutate(Q))
		goto err1;

	/* Test creating key-value pairs and reading them back. */
	if (createmany(Q, num_pairs))
		goto err1;

	/* Free the request queue and network connection. */
	kivaloo_close(K);

	/* Success! */
	exit(0);

err1:
	kivaloo_close(K);
err0:
	/* Failure! */
	exit(1);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movq %rsi, %rbx
movl %edi, %r15d
movq (%rsi), %rdi
testq %rdi, %rdi
je 0x2440
callq 0x4564
leal -0x4(%r15), %eax
cmpl $-0x3, %eax
ja 0x2474
movq 0xdba8(%rip), %rax      # 0xfff8
movq (%rax), %rdi
leaq 0x7baa(%rip), %rsi      # 0xa004
leaq 0x7bbc(%rip), %rdx      # 0xa01d
leaq 0x7bc2(%rip), %rcx      # 0xa02a
xorl %eax, %eax
callq 0x21a0
jmp 0x292f
movl $0x9c40, %r14d          # imm = 0x9C40
cmpl $0x3, %r15d
jne 0x24e7
callq 0x2090
andl $0x0, (%rax)
movq 0x10(%rbx), %r12
testq %r12, %r12
jne 0x24b0
leaq 0x7bc9(%rip), %rdi      # 0xa061
leaq 0x7bcc(%rip), %rsi      # 0xa06b
leaq 0x7be7(%rip), %rcx      # 0xa08d
movl $0xbb, %edx
callq 0x2140
movq %rax, %r15
leaq 0x20(%rsp), %r13
movq %r12, %rdi
movq %r13, %rsi
xorl %edx, %edx
callq 0x2260
movq %rax, %r14
movq (%r13), %rax
cmpq %r12, %rax
je 0x24d6
cmpb $0x0, (%rax)
je 0x24dd
movl $0x16, (%r15)
cmpl $0x0, (%r15)
jne 0x2599
movq 0x8(%rbx), %rdi
leaq 0x18(%rsp), %rsi
callq 0x6318
testq %rax, %rax
jne 0x2517
callq 0x2090
cmpl $0x0, (%rax)
jne 0x2563
leaq 0x7b33(%rip), %rdi      # 0xa03e
xorl %eax, %eax
callq 0x4770
jmp 0x292f
movq %rax, %rbx
movq 0x18(%rsp), %rdi
andl $0x0, 0xe0e2(%rip)      # 0x10608
leaq 0x687(%rip), %rsi       # 0x2bb4
xorl %edx, %edx
callq 0x49f8
testl %eax, %eax
jne 0x257c
leaq 0xe0c9(%rip), %rdi      # 0x10608
callq 0x348b
orl 0xe0c2(%rip), %eax      # 0x1060c
je 0x25b0
callq 0x2090
cmpl $0x0, (%rax)
jne 0x2912
leaq 0x7b9e(%rip), %rdi      # 0xa0ff
jmp 0x258d
movq %rax, %rbx
leaq 0x7ad1(%rip), %rdi      # 0xa03e
xorl %eax, %eax
callq 0x45e1
andl $0x0, (%rbx)
jmp 0x292f
callq 0x2090
cmpl $0x0, (%rax)
jne 0x25ea
leaq 0x7b55(%rip), %rdi      # 0xa0e2
xorl %eax, %eax
callq 0x4770
jmp 0x2927
leaq 0x7a96(%rip), %rdi      # 0xa036
xorl %eax, %eax
callq 0x45e1
andl $0x0, (%r15)
jmp 0x292f
movq 0x18(%rsp), %r13
leaq 0x862c(%rip), %rdi      # 0xabe8
pushq $0x3
popq %rsi
callq 0x48f4
movq %rax, %r15
leaq 0x863b(%rip), %rdi      # 0xac09
pushq $0x5
popq %rsi
callq 0x48f4
movq %rax, %r12
xorl %eax, %eax
cmpq $0x64, %rax
je 0x25f9
movb %al, 0x20(%rsp,%rax)
incq %rax
jmp 0x25db
movq %rax, %r14
leaq 0x7aee(%rip), %rdi      # 0xa0e2
jmp 0x291c
leaq 0x20(%rsp), %rdi
pushq $0x64
popq %rsi
callq 0x48f4
movq %rax, %rbp
movq %r13, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x2bcf
testl %eax, %eax
jne 0x28f8
movq %r13, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x2c5f
testl %eax, %eax
jne 0x28f8
movq %r13, %rdi
movq %r15, %rsi
movq %rbp, %rdx
callq 0x2bcf
testl %eax, %eax
jne 0x28f8
movq %r13, %rdi
movq %r15, %rsi
movq %rbp, %rdx
callq 0x2c5f
testl %eax, %eax
jne 0x28f8
pushq $0x1
popq %rcx
movq %r13, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x2d0e
testl %eax, %eax
jne 0x28f8
movq %r13, %rdi
movq %r15, %rsi
movq %rbp, %rdx
callq 0x2c5f
testl %eax, %eax
jne 0x28f8
movq %r13, %rdi
movq %r15, %rsi
callq 0x2dda
testl %eax, %eax
jne 0x28f8
movq %r13, %rdi
movq %r15, %rsi
xorl %edx, %edx
callq 0x2c5f
testl %eax, %eax
jne 0x28f8
movq %r13, %rdi
movq %r15, %rsi
callq 0x2dda
testl %eax, %eax
jne 0x28f8
movq %r13, %rdi
movq %r15, %rsi
xorl %edx, %edx
callq 0x2c5f
testl %eax, %eax
jne 0x28f8
pushq $0x1
popq %rcx
movq %r13, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x2e69
testl %eax, %eax
jne 0x28f8
movq %r13, %rdi
movq %r15, %rsi
xorl %edx, %edx
callq 0x2c5f
testl %eax, %eax
jne 0x28f8
movq %r13, %rdi
movq %r15, %rsi
movq %r12, %rdx
xorl %ecx, %ecx
callq 0x2d0e
testl %eax, %eax
jne 0x28f8
movq %r13, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x2c5f
testl %eax, %eax
jne 0x28f8
movq %r13, %rdi
movq %r15, %rsi
movq %r12, %rdx
xorl %ecx, %ecx
callq 0x2e69
testl %eax, %eax
jne 0x28f8
movq %r13, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x2c5f
testl %eax, %eax
jne 0x28f8
pushq $0x1
popq %r8
movq %r13, %rdi
movq %r15, %rsi
movq %rbp, %rdx
movq %rbp, %rcx
callq 0x2f35
testl %eax, %eax
jne 0x28f8
movq %r13, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x2c5f
testl %eax, %eax
jne 0x28f8
movq %r13, %rdi
movq %r15, %rsi
movq %r12, %rdx
movq %rbp, %rcx
xorl %r8d, %r8d
callq 0x2f35
testl %eax, %eax
jne 0x28f8
movq %r13, %rdi
movq %r15, %rsi
movq %rbp, %rdx
callq 0x2c5f
testl %eax, %eax
jne 0x28f8
pushq $0x1
popq %rcx
movq %r13, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x3002
testl %eax, %eax
jne 0x28f8
movq %r13, %rdi
movq %r15, %rsi
movq %rbp, %rdx
callq 0x2c5f
testl %eax, %eax
jne 0x28f8
movq %r13, %rdi
movq %r15, %rsi
movq %rbp, %rdx
xorl %ecx, %ecx
callq 0x3002
testl %eax, %eax
jne 0x28f8
movq %r13, %rdi
movq %r15, %rsi
xorl %edx, %edx
callq 0x2c5f
testl %eax, %eax
jne 0x28f8
pushq $0x1
popq %r8
movq %r13, %rdi
movq %r15, %rsi
movq %r12, %rdx
movq %rbp, %rcx
callq 0x2f35
testl %eax, %eax
jne 0x28f8
movq %r13, %rdi
movq %r15, %rsi
xorl %edx, %edx
callq 0x2c5f
testl %eax, %eax
jne 0x28f8
pushq $0x1
popq %rcx
movq %r13, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x3002
testl %eax, %eax
jne 0x28f8
movq %r13, %rdi
movq %r15, %rsi
xorl %edx, %edx
callq 0x2c5f
testl %eax, %eax
jne 0x28f8
movq %rbp, %rdi
callq 0x2040
movq %r12, %rdi
callq 0x2040
movq %r15, %rdi
callq 0x2040
movq 0x18(%rsp), %rax
movq %rax, 0x10(%rsp)
leaq (,%r14,8), %rdi
callq 0x21d0
movq %rax, %r15
leaq 0x7a9f(%rip), %r12      # 0xa35f
leaq 0x20(%rsp), %r13
xorl %ebp, %ebp
cmpq %rbp, %r14
je 0x2937
movq %r13, %rdi
movq %r12, %rsi
movq %rbp, %rdx
xorl %eax, %eax
callq 0x2290
movq %r13, %rdi
callq 0x20f0
movq %r13, %rdi
movq %rax, %rsi
callq 0x48f4
movq %rax, (%r15,%rbp,8)
incq %rbp
jmp 0x28c7
movq %rbp, %rdi
callq 0x2040
movq %r12, %rdi
callq 0x2040
movq %r15, %rdi
callq 0x2040
jmp 0x2927
movq %rax, %r14
leaq 0x77e3(%rip), %rdi      # 0xa0ff
xorl %eax, %eax
callq 0x45e1
andl $0x0, (%r14)
movq %rbx, %rdi
callq 0x6453
pushq $0x1
popq %rdi
callq 0x22a0
andl $0x0, 0xdcca(%rip)      # 0x10608
movq %r14, 0xdccb(%rip)      # 0x10610
xorl %ebp, %ebp
leaq 0x780(%rip), %r12       # 0x30ce
cmpq %rbp, %r14
je 0x299a
movq %rbp, %rax
bswapq %rax
movq %rax, 0x8(%rsp)
leaq 0x8(%rsp), %rdi
pushq $0x8
popq %rsi
callq 0x48f4
movq %rax, %r13
movq (%r15,%rbp,8), %rdx
movq 0x10(%rsp), %rdi
movq %rax, %rsi
movq %r12, %rcx
xorl %r8d, %r8d
callq 0x4af6
testl %eax, %eax
jne 0x2ab8
movq %r13, %rdi
callq 0x2040
incq %rbp
jmp 0x294e
leaq 0xdc67(%rip), %rdi      # 0x10608
callq 0x348b
orl 0xdc60(%rip), %eax      # 0x1060c
je 0x29c4
callq 0x2090
cmpl $0x0, (%rax)
jne 0x2a28
leaq 0x7770(%rip), %rdi      # 0xa12f
jmp 0x2a6c
andl $0x0, 0xdc3d(%rip)      # 0x10608
andl $0x0, 0xdc3a(%rip)      # 0x1060c
movq %r14, 0xdc37(%rip)      # 0x10610
xorl %r13d, %r13d
leaq 0x714(%rip), %rbp       # 0x30f7
cmpq %r13, %r14
je 0x2a34
movq %r13, %rax
bswapq %rax
movq %rax, 0x8(%rsp)
leaq 0x8(%rsp), %rdi
pushq $0x8
popq %rsi
callq 0x48f4
movq %rax, %r12
movq (%r15,%r13,8), %rcx
movq 0x10(%rsp), %rdi
movq %rax, %rsi
movq %rbp, %rdx
callq 0x51fe
testl %eax, %eax
jne 0x2a5b
movq %r12, %rdi
callq 0x2040
incq %r13
jmp 0x29e3
movq %rax, %r12
leaq 0x76fd(%rip), %rdi      # 0xa12f
jmp 0x2aac
leaq 0xdbcd(%rip), %rdi      # 0x10608
callq 0x348b
orl 0xdbc6(%rip), %eax      # 0x1060c
je 0x2a75
callq 0x2090
cmpl $0x0, (%rax)
jne 0x2aa2
leaq 0x7703(%rip), %rdi      # 0xa15c
jmp 0x2a6c
callq 0x2090
cmpl $0x0, (%rax)
jne 0x2a96
leaq 0x76d6(%rip), %rdi      # 0xa142
xorl %eax, %eax
callq 0x4770
jmp 0x2ab8
cmpb $0x0, 0xdb9c(%rip)      # 0x10618
je 0x2ad2
leaq 0x76ea(%rip), %rdi      # 0xa16f
xorl %eax, %eax
callq 0x4770
callq 0x2090
andl $0x0, (%rax)
jmp 0x2ab8
movq %rax, %r12
leaq 0x76a2(%rip), %rdi      # 0xa142
jmp 0x2aac
movq %rax, %r12
leaq 0x76b0(%rip), %rdi      # 0xa15c
xorl %eax, %eax
callq 0x45e1
andl $0x0, (%r12)
xorl %r12d, %r12d
cmpq %r12, %r14
je 0x2908
movq (%r15,%r12,8), %rdi
callq 0x2040
incq %r12
jmp 0x2abb
xorl %r12d, %r12d
cmpq %r12, %r14
je 0x2ae8
movq (%r15,%r12,8), %rdi
callq 0x2040
incq %r12
jmp 0x2ad5
movq %r15, %rdi
callq 0x2040
leaq 0x8(%rsp), %r12
andq $0x0, (%r12)
pushq $0x8
popq %r13
movq %r12, %rdi
movq %r13, %rsi
callq 0x48f4
movq %rax, %r15
bswapq %r14
movq %r14, (%r12)
movq %r12, %rdi
movq %r13, %rsi
callq 0x48f4
movq %rax, %r14
andl $0x0, 0xdae0(%rip)      # 0x10608
movq $0x1, 0xdadd(%rip) # 0x10610
leaq 0x65a(%rip), %rcx       # 0x3194
leaq 0x58d(%rip), %r8        # 0x30ce
movq 0x10(%rsp), %rdi
movq %r15, %rsi
movq %rax, %rdx
movq %rdi, %r9
callq 0x580c
testl %eax, %eax
jne 0x2927
movq %r14, %rdi
callq 0x2040
movq %r15, %rdi
callq 0x2040
leaq 0xda95(%rip), %rdi      # 0x10608
callq 0x348b
orl 0xda8e(%rip), %eax      # 0x1060c
je 0x2b96
callq 0x2090
cmpl $0x0, (%rax)
jne 0x2ba5
leaq 0x77d2(%rip), %rdi      # 0xa363
jmp 0x258d
movq %rbx, %rdi
callq 0x6453
xorl %edi, %edi
callq 0x22a0
movq %rax, %r14
leaq 0x77b4(%rip), %rdi      # 0xa363
jmp 0x291c