// File: nikosgalanis[P]Vectors-Similarity-Search-and-Clustering/programs/common/io_utils.cc
// Function: parse_hc_args(int, char**, char**, char**, char**, int*, int*, int*, int*, int*)
void parse_hc_args(int argc, char* argv[], char** input, char** output,
	char** query, int* k, int* M, int* probes, int* n_neighs, int* radius) {
		// default arguments
		*k = 14; *M = 10; *probes = 2; *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], "-M")) {
				*M = atoi(argv[++i]);
			}
			if (!strcmp(argv[i], "-probes")) {
				*probes = 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 0x58(%rsp), %rax
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 $0xe, (%rax)
movq 0x40(%rsp), %rax
movl $0xa, (%rax)
movq 0x48(%rsp), %rax
movl $0x2, (%rax)
movq 0x50(%rsp), %rax
movl $0x1, (%rax)
movq 0x58(%rsp), %rax
movl $0x2710, (%rax)         # imm = 0x2710
movl $0x1, 0x4(%rsp)
movl 0x4(%rsp), %eax
cmpl 0x34(%rsp), %eax
jge 0x2dda
movq 0x28(%rsp), %rax
movslq 0x4(%rsp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0xf44d(%rip), %rsi      # 0x12004
callq 0x22a0
cmpl $0x0, %eax
jne 0x2be8
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 0xf40a(%rip), %rsi      # 0x12007
callq 0x22a0
cmpl $0x0, %eax
jne 0x2c2e
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 0xf3c7(%rip), %rsi      # 0x1200a
callq 0x22a0
cmpl $0x0, %eax
jne 0x2c74
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 0xf384(%rip), %rsi      # 0x1200d
callq 0x22a0
cmpl $0x0, %eax
jne 0x2cb8
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 0xf3dd(%rip), %rsi      # 0x120aa
callq 0x22a0
cmpl $0x0, %eax
jne 0x2cfc
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 0xf39c(%rip), %rsi      # 0x120ad
callq 0x22a0
cmpl $0x0, %eax
jne 0x2d40
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 0xf2be(%rip), %rsi      # 0x12013
callq 0x22a0
cmpl $0x0, %eax
jne 0x2d84
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)
movq 0x28(%rsp), %rax
movslq 0x4(%rsp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0xf27d(%rip), %rsi      # 0x12016
callq 0x22a0
cmpl $0x0, %eax
jne 0x2dc8
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 0x58(%rsp), %rax
movl %ecx, (%rax)
jmp 0x2dca
movl 0x4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x4(%rsp)
jmp 0x2b94
movq 0x20(%rsp), %rcx
xorl %eax, %eax
cmpq $0x0, (%rcx)
movb %al, 0x3(%rsp)
je 0x2e0c
movq 0x10(%rsp), %rcx
xorl %eax, %eax
cmpq $0x0, (%rcx)
movb %al, 0x3(%rsp)
je 0x2e0c
movq 0x18(%rsp), %rax
cmpq $0x0, (%rax)
setne %al
movb %al, 0x3(%rsp)
movb 0x3(%rsp), %al
testb $0x1, %al
jne 0x2e16
jmp 0x2e18
jmp 0x2e37
leaq 0xf1fa(%rip), %rdi      # 0x12019
leaq 0xf20f(%rip), %rsi      # 0x12035
movl $0x87, %edx
leaq 0xf283(%rip), %rcx      # 0x120b5
callq 0x2130
addq $0x38, %rsp
retq
nopl (%rax)