// File: hugosantos[P]dbeacon/dbeacon.cpp
// Function: parse_arguments(int, char**)
void parse_arguments(int argc, char **argv) {
	vector<string_pair> args;
	vector<const char *> stray;

	for (int i = 1; i < argc; i++) {
		if (argv[i][0] == '-') {
			const char *mast = argv[i];
			const char *arg = 0;
			if ((i + 1) < argc && argv[i+1][0] != '-') {
				arg = argv[i+1];
				i++;
			}
			args.push_back(make_pair(mast + 1, arg));
		} else {
			stray.push_back(argv[i]);
		}
	}

	for (vector<string_pair>::const_iterator i = args.begin();
						 i != args.end(); ++i) {
		const param_tok *tok = resolve_tok(i->first, false);
		check_option_value(tok, i->first, i->second);
		process_param(tok, i->second);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xe0, %rsp
movl %edi, -0x4(%rbp)
movq %rsi, -0x10(%rbp)
leaq -0x28(%rbp), %rdi
callq 0xc910
leaq -0x40(%rbp), %rdi
callq 0xc930
movl $0x1, -0x44(%rbp)
movl -0x44(%rbp), %eax
cmpl -0x4(%rbp), %eax
jge 0x5e94
movq -0x10(%rbp), %rax
movslq -0x44(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movsbl (%rax), %eax
cmpl $0x2d, %eax
jne 0x5e6b
movq -0x10(%rbp), %rax
movslq -0x44(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x50(%rbp)
movq $0x0, -0x58(%rbp)
movl -0x44(%rbp), %eax
addl $0x1, %eax
cmpl -0x4(%rbp), %eax
jge 0x5df9
movq -0x10(%rbp), %rax
movl -0x44(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movsbl (%rax), %eax
cmpl $0x2d, %eax
je 0x5df9
movq -0x10(%rbp), %rax
movl -0x44(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x58(%rbp)
movl -0x44(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x44(%rbp)
movq -0x50(%rbp), %rax
incq %rax
movq %rax, -0x70(%rbp)
leaq -0x70(%rbp), %rdi
leaq -0x58(%rbp), %rsi
callq 0xc980
movq %rdx, -0xb0(%rbp)
movq %rax, -0xa8(%rbp)
jmp 0x5e21
movq -0xb0(%rbp), %rax
movq -0xa8(%rbp), %rcx
movq %rcx, -0x68(%rbp)
movq %rax, -0x60(%rbp)
leaq -0x28(%rbp), %rdi
leaq -0x68(%rbp), %rsi
callq 0xc950
jmp 0x5e46
jmp 0x5e84
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x78(%rbp)
movl %eax, -0x7c(%rbp)
leaq -0x40(%rbp), %rdi
callq 0xcb40
leaq -0x28(%rbp), %rdi
callq 0xcba0
jmp 0x5fba
movq -0x10(%rbp), %rax
movslq -0x44(%rbp), %rcx
leaq (%rax,%rcx,8), %rsi
leaq -0x40(%rbp), %rdi
callq 0xc9b0
jmp 0x5e82
jmp 0x5e84
jmp 0x5e86
movl -0x44(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x44(%rbp)
jmp 0x5d7b
leaq -0x28(%rbp), %rdi
callq 0xca20
movq %rax, -0x90(%rbp)
leaq -0x88(%rbp), %rdi
leaq -0x90(%rbp), %rsi
callq 0xca50
leaq -0x28(%rbp), %rdi
callq 0xcad0
movq %rax, -0x98(%rbp)
leaq -0x88(%rbp), %rdi
leaq -0x98(%rbp), %rsi
callq 0xca90
testb $0x1, %al
jne 0x5ee3
jmp 0x5f9f
leaq -0x88(%rbp), %rdi
callq 0xcb00
movq (%rax), %rdi
xorl %esi, %esi
callq 0x81f0
movq %rax, -0xb8(%rbp)
jmp 0x5f02
movq -0xb8(%rbp), %rax
movq %rax, -0xa0(%rbp)
movq -0xa0(%rbp), %rax
movq %rax, -0xc8(%rbp)
leaq -0x88(%rbp), %rdi
movq %rdi, -0xd0(%rbp)
callq 0xcb00
movq -0xd0(%rbp), %rdi
movq (%rax), %rax
movq %rax, -0xc0(%rbp)
callq 0xcb00
movq -0xc8(%rbp), %rdi
movq -0xc0(%rbp), %rsi
movq 0x8(%rax), %rdx
callq 0x82f0
jmp 0x5f60
movq -0xa0(%rbp), %rax
movq %rax, -0xd8(%rbp)
leaq -0x88(%rbp), %rdi
callq 0xcb00
movq -0xd8(%rbp), %rdi
movq 0x8(%rax), %rsi
callq 0x8380
jmp 0x5f8c
jmp 0x5f8e
leaq -0x88(%rbp), %rdi
callq 0xcb20
jmp 0x5eb7
leaq -0x40(%rbp), %rdi
callq 0xcb40
leaq -0x28(%rbp), %rdi
callq 0xcba0
addq $0xe0, %rsp
popq %rbp
retq
movq -0x78(%rbp), %rdi
callq 0x46f0
nopw %cs:(%rax,%rax)