// File: nikosgalanis[P]Vectors-Similarity-Search-and-Clustering/programs/common/io_utils.cc
// Function: parse_lsh_args(int, char**, char**, char**, char**, int*, int*, int*, int*)
void parse_lsh_args(int argc, char* argv[], char** input, char** output,
	char** query, int* k, int* L, int* n_neighs, int* radius) {
		// default arguments
		*k = 4; *L = 5; *n_neighs = 1; *radius = 10000;
		// parse through comand line arguments
		for (int i = 1; i < argc; i++) {
			if (!strcmp(argv[i], "-d")) {
				*input = strdup(argv[++i]);
			}
			if (!strcmp(argv[i], "-q")) {
				*query = strdup(argv[++i]);
			}	
			if (!strcmp(argv[i], "-o")) {
				*output = strdup(argv[++i]);
			}
			if (!strcmp(argv[i], "-k")) {
				*k = atoi(argv[++i]);
			}
			if (!strcmp(argv[i], "-L")) {
				*L = atoi(argv[++i]);
			}
			if (!strcmp(argv[i], "-N")) {
				*n_neighs = atoi(argv[++i]);
			}
			if (!strcmp(argv[i], "-R")) {
				*radius = atoi(argv[++i]);
			}
		}
		assert(*input && *query && *output);
	}

// Assembly:
subq $0x38, %rsp
movq 0x50(%rsp), %rax
movq 0x48(%rsp), %rax
movq 0x40(%rsp), %rax
movl %edi, 0x34(%rsp)
movq %rsi, 0x28(%rsp)
movq %rdx, 0x20(%rsp)
movq %rcx, 0x18(%rsp)
movq %r8, 0x10(%rsp)
movq %r9, 0x8(%rsp)
movq 0x8(%rsp), %rax
movl $0x4, (%rax)
movq 0x40(%rsp), %rax
movl $0x5, (%rax)
movq 0x48(%rsp), %rax
movl $0x1, (%rax)
movq 0x50(%rsp), %rax
movl $0x2710, (%rax)         # imm = 0x2710
movl $0x1, 0x4(%rsp)
movl 0x4(%rsp), %eax
cmpl 0x34(%rsp), %eax
jge 0x2ab6
movq 0x28(%rsp), %rax
movslq 0x4(%rsp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0xf72d(%rip), %rsi      # 0x12004
callq 0x22a0
cmpl $0x0, %eax
jne 0x2908
movq 0x28(%rsp), %rax
movl 0x4(%rsp), %ecx
addl $0x1, %ecx
movl %ecx, 0x4(%rsp)
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdi
callq 0x23e0
movq %rax, %rcx
movq 0x20(%rsp), %rax
movq %rcx, (%rax)
movq 0x28(%rsp), %rax
movslq 0x4(%rsp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0xf6ea(%rip), %rsi      # 0x12007
callq 0x22a0
cmpl $0x0, %eax
jne 0x294e
movq 0x28(%rsp), %rax
movl 0x4(%rsp), %ecx
addl $0x1, %ecx
movl %ecx, 0x4(%rsp)
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdi
callq 0x23e0
movq %rax, %rcx
movq 0x10(%rsp), %rax
movq %rcx, (%rax)
movq 0x28(%rsp), %rax
movslq 0x4(%rsp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0xf6a7(%rip), %rsi      # 0x1200a
callq 0x22a0
cmpl $0x0, %eax
jne 0x2994
movq 0x28(%rsp), %rax
movl 0x4(%rsp), %ecx
addl $0x1, %ecx
movl %ecx, 0x4(%rsp)
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdi
callq 0x23e0
movq %rax, %rcx
movq 0x18(%rsp), %rax
movq %rcx, (%rax)
movq 0x28(%rsp), %rax
movslq 0x4(%rsp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0xf664(%rip), %rsi      # 0x1200d
callq 0x22a0
cmpl $0x0, %eax
jne 0x29d8
movq 0x28(%rsp), %rax
movl 0x4(%rsp), %ecx
addl $0x1, %ecx
movl %ecx, 0x4(%rsp)
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdi
callq 0x2310
movl %eax, %ecx
movq 0x8(%rsp), %rax
movl %ecx, (%rax)
movq 0x28(%rsp), %rax
movslq 0x4(%rsp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0xf623(%rip), %rsi      # 0x12010
callq 0x22a0
cmpl $0x0, %eax
jne 0x2a1c
movq 0x28(%rsp), %rax
movl 0x4(%rsp), %ecx
addl $0x1, %ecx
movl %ecx, 0x4(%rsp)
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdi
callq 0x2310
movl %eax, %ecx
movq 0x40(%rsp), %rax
movl %ecx, (%rax)
movq 0x28(%rsp), %rax
movslq 0x4(%rsp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0xf5e2(%rip), %rsi      # 0x12013
callq 0x22a0
cmpl $0x0, %eax
jne 0x2a60
movq 0x28(%rsp), %rax
movl 0x4(%rsp), %ecx
addl $0x1, %ecx
movl %ecx, 0x4(%rsp)
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdi
callq 0x2310
movl %eax, %ecx
movq 0x48(%rsp), %rax
movl %ecx, (%rax)
movq 0x28(%rsp), %rax
movslq 0x4(%rsp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0xf5a1(%rip), %rsi      # 0x12016
callq 0x22a0
cmpl $0x0, %eax
jne 0x2aa4
movq 0x28(%rsp), %rax
movl 0x4(%rsp), %ecx
addl $0x1, %ecx
movl %ecx, 0x4(%rsp)
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdi
callq 0x2310
movl %eax, %ecx
movq 0x50(%rsp), %rax
movl %ecx, (%rax)
jmp 0x2aa6
movl 0x4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x4(%rsp)
jmp 0x28b4
movq 0x20(%rsp), %rcx
xorl %eax, %eax
cmpq $0x0, (%rcx)
movb %al, 0x3(%rsp)
je 0x2ae8
movq 0x10(%rsp), %rcx
xorl %eax, %eax
cmpq $0x0, (%rcx)
movb %al, 0x3(%rsp)
je 0x2ae8
movq 0x18(%rsp), %rax
cmpq $0x0, (%rax)
setne %al
movb %al, 0x3(%rsp)
movb 0x3(%rsp), %al
testb $0x1, %al
jne 0x2af2
jmp 0x2af4
jmp 0x2b13
leaq 0xf51e(%rip), %rdi      # 0x12019
leaq 0xf533(%rip), %rsi      # 0x12035
movl $0x65, %edx
leaq 0xf543(%rip), %rcx      # 0x12051
callq 0x2130
addq $0x38, %rsp
retq
nopl (%rax,%rax)