// File: /workspace/github_c_makefile_star2_O1/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 0x2570
callq 0x4a40
leal -0x4(%r15), %eax
cmpl $-0x3, %eax
ja 0x25a4
movq 0xea78(%rip), %rax      # 0x10ff8
movq (%rax), %rdi
leaq 0x8a7a(%rip), %rsi      # 0xb004
leaq 0x8a8c(%rip), %rdx      # 0xb01d
leaq 0x8a92(%rip), %rcx      # 0xb02a
xorl %eax, %eax
callq 0x21b0
jmp 0x2a57
movl $0x9c40, %r14d          # imm = 0x9C40
cmpl $0x3, %r15d
jne 0x261a
callq 0x2090
movl $0x0, (%rax)
movq 0x10(%rbx), %r12
testq %r12, %r12
jne 0x25e3
leaq 0x8a96(%rip), %rdi      # 0xb061
leaq 0x8a99(%rip), %rsi      # 0xb06b
leaq 0x8ab4(%rip), %rcx      # 0xb08d
movl $0xbb, %edx
callq 0x2140
movq %rax, %r15
leaq 0x20(%rsp), %r13
movq %r12, %rdi
movq %r13, %rsi
xorl %edx, %edx
callq 0x2270
movq %rax, %r14
movq (%r13), %rax
cmpq %r12, %rax
je 0x2609
cmpb $0x0, (%rax)
je 0x2610
movl $0x16, (%r15)
cmpl $0x0, (%r15)
jne 0x26d6
movq 0x8(%rbx), %rdi
leaq 0x18(%rsp), %rsi
callq 0x6c44
testq %rax, %rax
jne 0x264a
callq 0x2090
cmpl $0x0, (%rax)
jne 0x2699
leaq 0x8a00(%rip), %rdi      # 0xb03e
xorl %eax, %eax
callq 0x4bdf
jmp 0x2a57
movq %rax, %rbx
movq 0x18(%rsp), %rdi
movl $0x0, 0xefbc(%rip)      # 0x11618
leaq 0x6ed(%rip), %rsi       # 0x2d50
xorl %edx, %edx
callq 0x4e44
testl %eax, %eax
jne 0x26b5
leaq 0xefa3(%rip), %rdi      # 0x11618
callq 0x3695
orl 0xef9c(%rip), %eax      # 0x1161c
je 0x26f0
callq 0x2090
cmpl $0x0, (%rax)
jne 0x2a37
leaq 0x8a68(%rip), %rdi      # 0xb0ff
jmp 0x26ca
movq %rax, %rbx
leaq 0x899b(%rip), %rdi      # 0xb03e
xorl %eax, %eax
callq 0x4ac0
movl $0x0, (%rbx)
jmp 0x2a57
callq 0x2090
cmpl $0x0, (%rax)
jne 0x2a11
leaq 0x8a18(%rip), %rdi      # 0xb0e2
xorl %eax, %eax
callq 0x4bdf
jmp 0x2a4f
leaq 0x8959(%rip), %rdi      # 0xb036
xorl %eax, %eax
callq 0x4ac0
movl $0x0, (%r15)
jmp 0x2a57
movq 0x18(%rsp), %r13
leaq 0x94dc(%rip), %rdi      # 0xbbd8
movl $0x3, %esi
callq 0x4d04
movq %rax, %r15
leaq 0x94e9(%rip), %rdi      # 0xbbf9
movl $0x5, %esi
callq 0x4d04
movq %rax, %r12
xorl %eax, %eax
movb %al, 0x20(%rsp,%rax)
incq %rax
cmpq $0x64, %rax
jne 0x271f
leaq 0x20(%rsp), %rdi
movl $0x64, %esi
callq 0x4d04
movq %rax, %rbp
movq %r13, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x2d6b
testl %eax, %eax
jne 0x2a1d
movq %r13, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x2e03
testl %eax, %eax
jne 0x2a1d
movq %r13, %rdi
movq %r15, %rsi
movq %rbp, %rdx
callq 0x2d6b
testl %eax, %eax
jne 0x2a1d
movq %r13, %rdi
movq %r15, %rsi
movq %rbp, %rdx
callq 0x2e03
testl %eax, %eax
jne 0x2a1d
movq %r13, %rdi
movq %r15, %rsi
movq %r12, %rdx
movl $0x1, %ecx
callq 0x2ebd
testl %eax, %eax
jne 0x2a1d
movq %r13, %rdi
movq %r15, %rsi
movq %rbp, %rdx
callq 0x2e03
testl %eax, %eax
jne 0x2a1d
movq %r13, %rdi
movq %r15, %rsi
callq 0x2f94
testl %eax, %eax
jne 0x2a1d
movq %r13, %rdi
movq %r15, %rsi
xorl %edx, %edx
callq 0x2e03
testl %eax, %eax
jne 0x2a1d
movq %r13, %rdi
movq %r15, %rsi
callq 0x2f94
testl %eax, %eax
jne 0x2a1d
movq %r13, %rdi
movq %r15, %rsi
xorl %edx, %edx
callq 0x2e03
testl %eax, %eax
jne 0x2a1d
movq %r13, %rdi
movq %r15, %rsi
movq %r12, %rdx
movl $0x1, %ecx
callq 0x302b
testl %eax, %eax
jne 0x2a1d
movq %r13, %rdi
movq %r15, %rsi
xorl %edx, %edx
callq 0x2e03
testl %eax, %eax
jne 0x2a1d
movq %r13, %rdi
movq %r15, %rsi
movq %r12, %rdx
xorl %ecx, %ecx
callq 0x2ebd
testl %eax, %eax
jne 0x2a1d
movq %r13, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x2e03
testl %eax, %eax
jne 0x2a1d
movq %r13, %rdi
movq %r15, %rsi
movq %r12, %rdx
xorl %ecx, %ecx
callq 0x302b
testl %eax, %eax
jne 0x2a1d
movq %r13, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x2e03
testl %eax, %eax
jne 0x2a1d
movq %r13, %rdi
movq %r15, %rsi
movq %rbp, %rdx
movq %rbp, %rcx
movl $0x1, %r8d
callq 0x3102
testl %eax, %eax
jne 0x2a1d
movq %r13, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x2e03
testl %eax, %eax
jne 0x2a1d
movq %r13, %rdi
movq %r15, %rsi
movq %r12, %rdx
movq %rbp, %rcx
xorl %r8d, %r8d
callq 0x3102
testl %eax, %eax
jne 0x2a1d
movq %r13, %rdi
movq %r15, %rsi
movq %rbp, %rdx
callq 0x2e03
testl %eax, %eax
jne 0x2a1d
movq %r13, %rdi
movq %r15, %rsi
movq %r12, %rdx
movl $0x1, %ecx
callq 0x31da
testl %eax, %eax
jne 0x2a1d
movq %r13, %rdi
movq %r15, %rsi
movq %rbp, %rdx
callq 0x2e03
testl %eax, %eax
jne 0x2a1d
movq %r13, %rdi
movq %r15, %rsi
movq %rbp, %rdx
xorl %ecx, %ecx
callq 0x31da
testl %eax, %eax
jne 0x2a1d
movq %r13, %rdi
movq %r15, %rsi
xorl %edx, %edx
callq 0x2e03
testl %eax, %eax
jne 0x2a1d
movq %r13, %rdi
movq %r15, %rsi
movq %r12, %rdx
movq %rbp, %rcx
movl $0x1, %r8d
callq 0x3102
testl %eax, %eax
jne 0x2a1d
movq %r13, %rdi
movq %r15, %rsi
xorl %edx, %edx
callq 0x2e03
testl %eax, %eax
jne 0x2a1d
movq %r13, %rdi
movq %r15, %rsi
movq %r12, %rdx
movl $0x1, %ecx
callq 0x31da
testl %eax, %eax
jne 0x2a1d
movq %r13, %rdi
movq %r15, %rsi
xorl %edx, %edx
callq 0x2e03
testl %eax, %eax
jne 0x2a1d
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 0x21e0
movq %rax, %r15
testq %r14, %r14
jne 0x2a61
movl $0x0, 0xec13(%rip)      # 0x11618
movq %r14, 0xec14(%rip)      # 0x11620
jmp 0x2b06
movq %rax, %r14
leaq 0x86c7(%rip), %rdi      # 0xb0e2
jmp 0x2a41
movq %rbp, %rdi
callq 0x2040
movq %r12, %rdi
callq 0x2040
movq %r15, %rdi
callq 0x2040
jmp 0x2a4f
movq %rax, %r14
leaq 0x86be(%rip), %rdi      # 0xb0ff
xorl %eax, %eax
callq 0x4ac0
movl $0x0, (%r14)
movq %rbx, %rdi
callq 0x6d8d
movl $0x1, %edi
callq 0x22b0
leaq 0x88f7(%rip), %r13      # 0xb35f
leaq 0x20(%rsp), %rbp
xorl %r12d, %r12d
movq %rbp, %rdi
movq %r13, %rsi
movq %r12, %rdx
xorl %eax, %eax
callq 0x22a0
movq %rbp, %rdi
callq 0x20f0
movq %rbp, %rdi
movq %rax, %rsi
callq 0x4d04
movq %rax, (%r15,%r12,8)
incq %r12
cmpq %r12, %r14
jne 0x2a70
movl $0x0, 0xeb6f(%rip)      # 0x11618
movq %r14, 0xeb70(%rip)      # 0x11620
xorl %r13d, %r13d
leaq 0x7f7(%rip), %rbp       # 0x32b1
movq %r13, %rax
bswapq %rax
movq %rax, 0x8(%rsp)
movl $0x8, %esi
leaq 0x8(%rsp), %rdi
callq 0x4d04
movq %rax, %r12
movq (%r15,%r13,8), %rdx
movq 0x10(%rsp), %rdi
movq %rax, %rsi
movq %rbp, %rcx
xorl %r8d, %r8d
callq 0x4f35
testl %eax, %eax
jne 0x2d10
movq %r12, %rdi
callq 0x2040
incq %r13
cmpq %r13, %r14
jne 0x2aba
leaq 0xeb0b(%rip), %rdi      # 0x11618
callq 0x3695
orl 0xeb04(%rip), %eax      # 0x1161c
je 0x2b34
callq 0x2090
cmpl $0x0, (%rax)
jne 0x2bc4
leaq 0x8600(%rip), %rdi      # 0xb12f
jmp 0x2c0f
xorl %eax, %eax
movl %eax, 0xeadc(%rip)      # 0x11618
movl %eax, 0xeada(%rip)      # 0x1161c
movq %r14, 0xead7(%rip)      # 0x11620
testq %r14, %r14
je 0x2b9d
xorl %r13d, %r13d
leaq 0x784(%rip), %rbp       # 0x32dc
movq %r13, %rax
bswapq %rax
movq %rax, 0x8(%rsp)
movl $0x8, %esi
leaq 0x8(%rsp), %rdi
callq 0x4d04
movq %rax, %r12
movq (%r15,%r13,8), %rcx
movq 0x10(%rsp), %rdi
movq %rax, %rsi
movq %rbp, %rdx
callq 0x585a
testl %eax, %eax
jne 0x2bfa
movq %r12, %rdi
callq 0x2040
incq %r13
cmpq %r13, %r14
jne 0x2b58
leaq 0xea74(%rip), %rdi      # 0x11618
callq 0x3695
orl 0xea6d(%rip), %eax      # 0x1161c
je 0x2bd3
callq 0x2090
cmpl $0x0, (%rax)
jne 0x2c1b
leaq 0x859a(%rip), %rdi      # 0xb15c
jmp 0x2c0f
movq %rax, %r12
leaq 0x8561(%rip), %rdi      # 0xb12f
jmp 0x2d01
cmpb $0x0, 0xea4e(%rip)      # 0x11628
je 0x2c2a
leaq 0x858c(%rip), %rdi      # 0xb16f
xorl %eax, %eax
callq 0x4bdf
callq 0x2090
movl $0x0, (%rax)
jmp 0x2d10
callq 0x2090
cmpl $0x0, (%rax)
jne 0x2cf7
leaq 0x8533(%rip), %rdi      # 0xb142
xorl %eax, %eax
callq 0x4bdf
jmp 0x2d10
movq %rax, %r12
leaq 0x8537(%rip), %rdi      # 0xb15c
jmp 0x2d01
testq %r14, %r14
je 0x2c43
xorl %r12d, %r12d
movq (%r15,%r12,8), %rdi
callq 0x2040
incq %r12
cmpq %r12, %r14
jne 0x2c32
movq %r15, %rdi
callq 0x2040
leaq 0x8(%rsp), %r12
movq $0x0, (%r12)
movl $0x8, %esi
movq %r12, %rdi
callq 0x4d04
movq %rax, %r15
bswapq %r14
movq %r14, (%r12)
movl $0x8, %esi
movq %r12, %rdi
callq 0x4d04
movq %rax, %r14
movl $0x0, 0xe98f(%rip)      # 0x11618
movq $0x1, 0xe98c(%rip) # 0x11620
leaq 0x6e0(%rip), %rcx       # 0x337b
leaq 0x60f(%rip), %r8        # 0x32b1
movq 0x10(%rsp), %rdi
movq %r15, %rsi
movq %rax, %rdx
movq %rdi, %r9
callq 0x5f35
testl %eax, %eax
jne 0x2a4f
movq %r14, %rdi
callq 0x2040
movq %r15, %rdi
callq 0x2040
leaq 0xe944(%rip), %rdi      # 0x11618
callq 0x3695
orl 0xe93d(%rip), %eax      # 0x1161c
je 0x2d32
callq 0x2090
cmpl $0x0, (%rax)
jne 0x2d41
leaq 0x8671(%rip), %rdi      # 0xb363
jmp 0x26ca
movq %rax, %r12
leaq 0x8441(%rip), %rdi      # 0xb142
xorl %eax, %eax
callq 0x4ac0
movl $0x0, (%r12)
testq %r14, %r14
je 0x2a2d
xorl %r12d, %r12d
movq (%r15,%r12,8), %rdi
callq 0x2040
incq %r12
cmpq %r12, %r14
jne 0x2d1c
jmp 0x2a2d
movq %rbx, %rdi
callq 0x6d8d
xorl %edi, %edi
callq 0x22b0
movq %rax, %r14
leaq 0x8618(%rip), %rdi      # 0xb363
jmp 0x2a41