// File: nikosgalanis[P]Vectors-Similarity-Search-and-Clustering/programs/common/io_utils.cc
// Function: parse_clustering_args(int, char**, char**, char**, char**, bool*, char**)
void parse_clustering_args(int argc, char* argv[], char** input,
	char** output, char** config, bool* complete, char** method) {
		// default arguments
		*complete = false;
		// parse through comand line arguments
		for (int i = 1; i < argc; i++) {
			if (!strcmp(argv[i], "-i")) {
				*input = strdup(argv[++i]);
			}
			if (!strcmp(argv[i], "-c")) {
				*config = strdup(argv[++i]);
			}	
			if (!strcmp(argv[i], "-o")) {
				*output = strdup(argv[++i]);
			}
			if (!strcmp(argv[i], "-m")) {
				*method = strdup(argv[++i]);
			}
			if (!strcmp(argv[i], "-complete")) {
				*complete = true;
			}
		}
		assert(*input && *config && *output && *method);
	}

// Assembly:
subq $0x38, %rsp
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
movb $0x0, (%rax)
movl $0x1, 0x4(%rsp)
movl 0x4(%rsp), %eax
cmpl 0x34(%rsp), %eax
jge 0x2fd5
movq 0x28(%rsp), %rax
movslq 0x4(%rsp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0xf27b(%rip), %rsi      # 0x12114
callq 0x22a0
cmpl $0x0, %eax
jne 0x2eca
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 0xf238(%rip), %rsi      # 0x12117
callq 0x22a0
cmpl $0x0, %eax
jne 0x2f10
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 0xf0e5(%rip), %rsi      # 0x1200a
callq 0x22a0
cmpl $0x0, %eax
jne 0x2f56
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 0xf1af(%rip), %rsi      # 0x1211a
callq 0x22a0
cmpl $0x0, %eax
jne 0x2f9c
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 0x40(%rsp), %rax
movq %rcx, (%rax)
movq 0x28(%rsp), %rax
movslq 0x4(%rsp), %rcx
movq (%rax,%rcx,8), %rdi
leaq 0xf16c(%rip), %rsi      # 0x1211d
callq 0x22a0
cmpl $0x0, %eax
jne 0x2fc3
movq 0x8(%rsp), %rax
movb $0x1, (%rax)
jmp 0x2fc5
movl 0x4(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x4(%rsp)
jmp 0x2e76
movq 0x20(%rsp), %rcx
xorl %eax, %eax
cmpq $0x0, (%rcx)
movb %al, 0x3(%rsp)
je 0x3018
movq 0x10(%rsp), %rcx
xorl %eax, %eax
cmpq $0x0, (%rcx)
movb %al, 0x3(%rsp)
je 0x3018
movq 0x18(%rsp), %rcx
xorl %eax, %eax
cmpq $0x0, (%rcx)
movb %al, 0x3(%rsp)
je 0x3018
movq 0x40(%rsp), %rax
cmpq $0x0, (%rax)
setne %al
movb %al, 0x3(%rsp)
movb 0x3(%rsp), %al
testb $0x1, %al
jne 0x3022
jmp 0x3024
jmp 0x3043
leaq 0xf0fc(%rip), %rdi      # 0x12127
leaq 0xf003(%rip), %rsi      # 0x12035
movl $0xa0, %edx
leaq 0xf111(%rip), %rcx      # 0x1214f
callq 0x2130
addq $0x38, %rsp
retq
nopl (%rax,%rax)