// File: /workspace/github_c_makefile_star2_O2/Tarsnap[P]kivaloo/bench/random_read/main.c
// Function: main
int
main(int argc, char * argv[])
{
	struct sock_addr ** sas;
	uintmax_t N;
	int s;
	struct wire_requestqueue * Q;

	WARNP_INIT;

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

	/* Parse N. */
	if (PARSENUM(&N, argv[2])) {
		warnp("Invalid value for N: %s", argv[2]);
		exit(1);
	}

	/* Resolve the socket address and connect. */
	if ((sas = sock_resolve(argv[1])) == NULL) {
		warnp("Error resolving socket address: %s", argv[1]);
		exit(1);
	}
	if (sas[0] == NULL) {
		warn0("No addresses found for %s", argv[1]);
		exit(1);
	}
	if ((s = sock_connect(sas)) == -1)
		exit(1);

	/* Create a request queue. */
	if ((Q = wire_requestqueue_init(s)) == NULL) {
		warnp("Cannot create packet write queue");
		exit(1);
	}

	/* Start issuing random read requests. */
	if (randomread(Q, N))
		exit(1);

	/* Free the request queue. */
	wire_requestqueue_destroy(Q);
	wire_requestqueue_free(Q);

	/* Free socket addresses. */
	sock_addr_freelist(sas);

	/* Success! */
	exit(0);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x70, %rsp
movq %rsi, %r15
movl %edi, %ebx
movq (%rsi), %rdi
testq %rdi, %rdi
je 0x247b
callq 0x49c4
cmpl $0x3, %ebx
jne 0x24b0
callq 0x2090
andl $0x0, (%rax)
movq 0x10(%r15), %r14
testq %r14, %r14
jne 0x24d1
leaq 0x9c08(%rip), %rdi      # 0xc0a0
leaq 0x9c0b(%rip), %rsi      # 0xc0aa
leaq 0x9c26(%rip), %rcx      # 0xc0cc
movl $0xbb, %edx
callq 0x2160
movq 0x10b41(%rip), %rax     # 0x12ff8
movq (%rax), %rdi
leaq 0x9b43(%rip), %rsi      # 0xc004
leaq 0x9b55(%rip), %rdx      # 0xc01d
xorl %eax, %eax
callq 0x21e0
jmp 0x253e
movq %rax, %rbx
leaq 0x8(%rsp), %r13
movq %r14, %rdi
movq %r13, %rsi
xorl %edx, %edx
callq 0x22b0
movq %rax, %r12
movq (%r13), %rax
cmpq %r14, %rax
je 0x24f7
cmpb $0x0, (%rax)
je 0x24fd
movl $0x16, (%rbx)
cmpl $0x0, (%rbx)
jne 0x2529
movq 0x8(%r15), %rdi
callq 0x3b4c
testq %rax, %rax
jne 0x2546
cmpl $0x0, (%rbx)
movq 0x8(%r15), %rsi
leaq 0x9b24(%rip), %rdi      # 0xc042
jne 0x2534
xorl %eax, %eax
callq 0x4bd0
jmp 0x253e
movq 0x10(%r15), %rsi
leaq 0x9af6(%rip), %rdi      # 0xc02a
xorl %eax, %eax
callq 0x4a41
andl $0x0, (%rbx)
pushq $0x1
popq %rdi
callq 0x22e0
movq %rax, %r14
cmpq $0x0, (%rax)
jne 0x2563
movq 0x8(%r15), %rsi
leaq 0x9b0b(%rip), %rdi      # 0xc065
xorl %eax, %eax
callq 0x4bd0
jmp 0x253b
movq %r14, %rdi
callq 0x4325
cmpl $-0x1, %eax
je 0x253e
movl %eax, %edi
callq 0x6538
testq %rax, %rax
jne 0x2595
cmpl $0x0, (%rbx)
jne 0x2606
leaq 0x9af3(%rip), %rdi      # 0xc07f
xorl %eax, %eax
callq 0x4bd0
jmp 0x253e
movq %rax, %r15
movq %rax, 0x8(%rsp)
andq $0x0, 0x18(%rsp)
movq %r12, 0x20(%rsp)
andq $0x0, 0x28(%rsp)
xorps %xmm0, %xmm0
leaq 0x40(%rsp), %rdi
movaps %xmm0, (%rdi)
movaps %xmm0, 0x10(%rdi)
andq $0x0, 0x20(%rdi)
pushq $0x28
popq %rsi
callq 0x525c
movq %rax, 0x30(%rsp)
testq %rax, %rax
je 0x253e
movq %rax, %r12
pushq $0x32
popq %rdi
pushq $0x64
popq %rsi
callq 0x4d54
movq %rax, 0x38(%rsp)
testq %rax, %rax
jne 0x2619
leaq 0x9b2a(%rip), %rdi      # 0xc121
xorl %eax, %eax
callq 0x4bd0
andl $0x0, (%rbx)
jmp 0x26c2
leaq 0x9a72(%rip), %rdi      # 0xc07f
xorl %eax, %eax
callq 0x4a41
jmp 0x253b
leaq 0x8(%rsp), %rdi
callq 0x26cf
testl %eax, %eax
jne 0x26b3
leaq 0x2c(%rsp), %r12
movq %r12, %rdi
callq 0x2a73
orl -0x4(%r12), %eax
je 0x2654
cmpl $0x0, (%rbx)
jne 0x26a2
leaq 0x9ae1(%rip), %rdi      # 0xc12c
xorl %eax, %eax
callq 0x4bd0
jmp 0x26b3
movq 0x38(%rsp), %rdi
callq 0x4fea
leaq 0x9ada(%rip), %rdi      # 0xc13f
movq %rax, %rsi
xorl %eax, %eax
callq 0x2130
movq 0x38(%rsp), %rdi
callq 0x5051
movq 0x30(%rsp), %rdi
callq 0x2040
movq %r15, %rdi
callq 0x6a1b
movq %r15, %rdi
callq 0x6a2f
movq %r14, %rdi
callq 0x414b
xorl %edi, %edi
callq 0x22e0
leaq 0x9a83(%rip), %rdi      # 0xc12c
xorl %eax, %eax
callq 0x4a41
andl $0x0, (%rbx)
movq 0x38(%rsp), %rdi
callq 0x5051
movq 0x30(%rsp), %r12
movq %r12, %rdi
callq 0x2040
jmp 0x253e