// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x30, %rsp
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq $0x9c40, -0x28(%rbp)    # imm = 0x9C40
movq -0x10(%rbp), %rax
cmpq $0x0, (%rax)
je 0x2474
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0x5e10
jmp 0x2476
cmpl $0x2, -0x8(%rbp)
je 0x24b2
cmpl $0x3, -0x8(%rbp)
je 0x24b2
movq 0x13b6f(%rip), %rax     # 0x15ff8
movq (%rax), %rdi
leaq 0xdb8d(%rip), %rsi      # 0x10020
leaq 0xdb9f(%rip), %rdx      # 0x10039
leaq 0xdba5(%rip), %rcx      # 0x10046
movb $0x0, %al
callq 0x21d0
movl $0x1, %edi
callq 0x22d0
cmpl $0x3, -0x8(%rbp)
jne 0x25e0
callq 0x20a0
movl $0x0, (%rax)
movq $0x1, -0x28(%rbp)
movq -0x28(%rbp), %rax
shrq %rax
movq %rax, -0x28(%rbp)
cmpq $0x0, %rax
jbe 0x252b
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
movsd 0xdb18(%rip), %xmm0     # 0x10008
movsd 0xdb18(%rip), %xmm1     # 0x10010
xorl %esi, %esi
callq 0x2690
movaps %xmm0, %xmm1
cvttsd2si %xmm1, %rax
movq %rax, %rdx
sarq $0x3f, %rdx
movsd 0xdb02(%rip), %xmm1     # 0x10018
subsd %xmm1, %xmm0
cvttsd2si %xmm0, %rcx
andq %rdx, %rcx
orq %rcx, %rax
movq %rax, -0x28(%rbp)
jmp 0x2593
movq $-0x1, -0x28(%rbp)
movb $0x1, %al
testb $0x1, %al
jne 0x253b
jmp 0x2560
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x28(%rbp), %rdx
movq -0x28(%rbp), %rcx
xorl %eax, %eax
movl %eax, %esi
xorl %r9d, %r9d
movl %r9d, %r8d
callq 0x2740
movq %rax, -0x28(%rbp)
jmp 0x2591
movq 0x13a91(%rip), %rax     # 0x15ff8
movq (%rax), %rdi
leaq 0xdae1(%rip), %rsi      # 0x10052
leaq 0xdb48(%rip), %rdx      # 0x100c0
leaq 0xdb46(%rip), %rcx      # 0x100c5
movl $0x266, %r8d            # imm = 0x266
movb $0x0, %al
callq 0x21d0
callq 0x2090
jmp 0x2593
callq 0x20a0
cmpl $0x0, (%rax)
je 0x25de
jmp 0x259f
callq 0x20a0
cmpl $0x0, (%rax)
je 0x25c4
leaq 0xdb1c(%rip), %rdi      # 0x100cc
movb $0x0, %al
callq 0x5ed0
callq 0x20a0
movl $0x0, (%rax)
jmp 0x25d2
leaq 0xdb01(%rip), %rdi      # 0x100cc
movb $0x0, %al
callq 0x6120
jmp 0x25d4
movl $0x1, %edi
callq 0x22d0
jmp 0x25e0
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
leaq -0x18(%rbp), %rsi
callq 0x90e0
movq %rax, -0x20(%rbp)
cmpq $0x0, %rax
jne 0x2634
jmp 0x25fd
callq 0x20a0
cmpl $0x0, (%rax)
je 0x2622
leaq 0xdac6(%rip), %rdi      # 0x100d4
movb $0x0, %al
callq 0x5ed0
callq 0x20a0
movl $0x0, (%rax)
jmp 0x2630
leaq 0xdaab(%rip), %rdi      # 0x100d4
movb $0x0, %al
callq 0x6120
jmp 0x2632
jmp 0x2681
movq -0x18(%rbp), %rdi
callq 0x2800
cmpl $0x0, %eax
je 0x2644
jmp 0x2678
movq -0x18(%rbp), %rdi
callq 0x28e0
cmpl $0x0, %eax
je 0x2654
jmp 0x2678
movq -0x18(%rbp), %rdi
movq -0x28(%rbp), %rsi
callq 0x2c90
cmpl $0x0, %eax
je 0x2668
jmp 0x2678
movq -0x20(%rbp), %rdi
callq 0x92a0
xorl %edi, %edi
callq 0x22d0
movq -0x20(%rbp), %rdi
callq 0x92a0
movl $0x1, %edi
callq 0x22d0
nopl (%rax,%rax)