// File: /workspace/github_c_makefile_star2_O0/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 %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x0, (%rax)
je 0x248c
movq -0x10(%rbp), %rax
movq (%rax), %rdi
callq 0x6910
jmp 0x248e
cmpl $0x3, -0x8(%rbp)
je 0x24bd
movq 0x1bb5d(%rip), %rax     # 0x1dff8
movq (%rax), %rdi
leaq 0x14b7b(%rip), %rsi     # 0x17020
leaq 0x14b8d(%rip), %rdx     # 0x17039
movb $0x0, %al
callq 0x21f0
movl $0x1, %edi
callq 0x22f0
callq 0x20a0
movl $0x0, (%rax)
movq $0x1, -0x20(%rbp)
movq -0x20(%rbp), %rax
shrq %rax
movq %rax, -0x20(%rbp)
cmpq $0x0, %rax
jbe 0x252c
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
movsd 0x14b17(%rip), %xmm0    # 0x17008
movsd 0x14b17(%rip), %xmm1    # 0x17010
xorl %esi, %esi
callq 0x2740
movaps %xmm0, %xmm1
cvttsd2si %xmm1, %rax
movq %rax, %rdx
sarq $0x3f, %rdx
movsd 0x14b01(%rip), %xmm1    # 0x17018
subsd %xmm1, %xmm0
cvttsd2si %xmm0, %rcx
andq %rdx, %rcx
orq %rcx, %rax
movq %rax, -0x20(%rbp)
jmp 0x2594
movq $-0x1, -0x20(%rbp)
movb $0x1, %al
testb $0x1, %al
jne 0x253c
jmp 0x2561
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rdi
movq -0x20(%rbp), %rdx
movq -0x20(%rbp), %rcx
xorl %eax, %eax
movl %eax, %esi
xorl %r9d, %r9d
movl %r9d, %r8d
callq 0x27f0
movq %rax, -0x20(%rbp)
jmp 0x2592
movq 0x1ba90(%rip), %rax     # 0x1dff8
movq (%rax), %rdi
leaq 0x14ad4(%rip), %rsi     # 0x17046
leaq 0x14b3b(%rip), %rdx     # 0x170b4
leaq 0x14b39(%rip), %rcx     # 0x170b9
movl $0xad, %r8d
movb $0x0, %al
callq 0x21f0
callq 0x2090
jmp 0x2594
callq 0x20a0
cmpl $0x0, (%rax)
je 0x25ef
jmp 0x25a0
callq 0x20a0
cmpl $0x0, (%rax)
je 0x25cd
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rsi
leaq 0x14b07(%rip), %rdi     # 0x170c0
movb $0x0, %al
callq 0x69d0
callq 0x20a0
movl $0x0, (%rax)
jmp 0x25e3
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rsi
leaq 0x14ae4(%rip), %rdi     # 0x170c0
movb $0x0, %al
callq 0x6c20
jmp 0x25e5
movl $0x1, %edi
callq 0x22f0
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x4d60
movq %rax, -0x18(%rbp)
cmpq $0x0, %rax
jne 0x2657
jmp 0x2608
callq 0x20a0
cmpl $0x0, (%rax)
je 0x2635
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rsi
leaq 0x14ab7(%rip), %rdi     # 0x170d8
movb $0x0, %al
callq 0x69d0
callq 0x20a0
movl $0x0, (%rax)
jmp 0x264b
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rsi
leaq 0x14a94(%rip), %rdi     # 0x170d8
movb $0x0, %al
callq 0x6c20
jmp 0x264d
movl $0x1, %edi
callq 0x22f0
movq -0x18(%rbp), %rax
cmpq $0x0, (%rax)
jne 0x268e
jmp 0x2663
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rsi
leaq 0x14a89(%rip), %rdi     # 0x170fb
movb $0x0, %al
callq 0x6c20
callq 0x20a0
movl $0x0, (%rax)
movl $0x1, %edi
callq 0x22f0
movq -0x18(%rbp), %rdi
callq 0x5c30
movl %eax, -0x24(%rbp)
cmpl $-0x1, %eax
jne 0x26a9
movl $0x1, %edi
callq 0x22f0
movl -0x24(%rbp), %edi
callq 0x96e0
movq %rax, -0x30(%rbp)
cmpq $0x0, %rax
jne 0x26fc
jmp 0x26bd
callq 0x20a0
cmpl $0x0, (%rax)
je 0x26e2
leaq 0x14a47(%rip), %rdi     # 0x17115
movb $0x0, %al
callq 0x69d0
callq 0x20a0
movl $0x0, (%rax)
jmp 0x26f0
leaq 0x14a2c(%rip), %rdi     # 0x17115
movb $0x0, %al
callq 0x6c20
jmp 0x26f2
movl $0x1, %edi
callq 0x22f0
movq -0x30(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x28b0
cmpl $0x0, %eax
je 0x2718
movl $0x1, %edi
callq 0x22f0
movq -0x30(%rbp), %rdi
callq 0x9cb0
movq -0x30(%rbp), %rdi
callq 0x9cf0
movq -0x18(%rbp), %rdi
callq 0x5990
xorl %edi, %edi
callq 0x22f0
nopw (%rax,%rax)