// File: acherkaoui[P]HTOP/core/Parser.cpp
// Function: Parser::flagHandler(int, char**)
void Parser::flagHandler(int ac, char **av)
{
	std::vector<std::string> argv;

	for (int i = 1; i < ac; i += 1)
		argv.emplace_back(av[i]);

	for (unsigned int i = 0; i < argv.size(); i += 1) {
		if (argv[i] == "--help")
			exit(printUsage());
		else if (argv[i] == "-terminal") {
			this->_graphicMode = false;
		}
		else if (argv[i] == "-graphic") {
			this->_graphicMode = true;
		}
		else if (argv[i][0] != '-' || this->setModuleActive(
			argv[i].substr(1))) {
			std::cout << "htop: invalid option "
				<< argv[i].substr(1)
				<< "\nTry 'htop --help' for more information"
				<< std::endl;
			exit(1);
		}
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xe0, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x98(%rbp)
leaq -0x30(%rbp), %rdi
callq 0xa860
movl $0x1, -0x34(%rbp)
movl -0x34(%rbp), %eax
cmpl -0xc(%rbp), %eax
jge 0x982e
movq -0x18(%rbp), %rax
movslq -0x34(%rbp), %rcx
leaq (%rax,%rcx,8), %rsi
leaq -0x30(%rbp), %rdi
callq 0xa880
jmp 0x9810
jmp 0x9812
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x97f1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x9af8
movl $0x0, -0x48(%rbp)
movl -0x48(%rbp), %eax
movq %rax, -0xa0(%rbp)
leaq -0x30(%rbp), %rdi
callq 0xa8f0
movq %rax, %rcx
movq -0xa0(%rbp), %rax
cmpq %rcx, %rax
jae 0x9ae6
movl -0x48(%rbp), %eax
movl %eax, %esi
leaq -0x30(%rbp), %rdi
callq 0xa910
movq %rax, %rdi
leaq 0xa8ec(%rip), %rsi      # 0x1415f
callq 0x70b0
movb %al, -0xa1(%rbp)
jmp 0x9880
movb -0xa1(%rbp), %al
testb $0x1, %al
jne 0x988c
jmp 0x98ab
movq -0x98(%rbp), %rdi
callq 0x9b10
movl %eax, -0xa8(%rbp)
jmp 0x98a0
movl -0xa8(%rbp), %edi
callq 0x44f0
movl -0x48(%rbp), %eax
movl %eax, %esi
leaq -0x30(%rbp), %rdi
callq 0xa910
movq %rax, %rdi
leaq 0xa8a3(%rip), %rsi      # 0x14166
callq 0x70b0
movb %al, -0xa9(%rbp)
jmp 0x98d0
movb -0xa9(%rbp), %al
testb $0x1, %al
jne 0x98dc
jmp 0x98ec
movq -0x98(%rbp), %rax
movb $0x0, 0x58(%rax)
jmp 0x9ad4
movl -0x48(%rbp), %eax
movl %eax, %esi
leaq -0x30(%rbp), %rdi
callq 0xa910
movq %rax, %rdi
leaq 0xa852(%rip), %rsi      # 0x14156
callq 0x70b0
movb %al, -0xaa(%rbp)
jmp 0x9911
movb -0xaa(%rbp), %al
testb $0x1, %al
jne 0x991d
jmp 0x992d
movq -0x98(%rbp), %rax
movb $0x1, 0x58(%rax)
jmp 0x9ad2
movl -0x48(%rbp), %eax
movl %eax, %esi
leaq -0x30(%rbp), %rdi
callq 0xa910
movq %rax, %rdi
movb $0x0, -0x69(%rbp)
xorl %eax, %eax
movl %eax, %esi
callq 0x4780
movq %rax, -0xb8(%rbp)
jmp 0x9954
movq -0xb8(%rbp), %rax
movsbl (%rax), %ecx
movb $0x1, %al
cmpl $0x2d, %ecx
movb %al, -0xb9(%rbp)
jne 0x99c1
movl -0x48(%rbp), %eax
movl %eax, %esi
leaq -0x30(%rbp), %rdi
callq 0xa910
movq %rax, %rsi
leaq -0x68(%rbp), %rdi
movl $0x1, %edx
movq $-0x1, %rcx
callq 0x4440
jmp 0x9993
movq -0x98(%rbp), %rdi
movb $0x1, -0x69(%rbp)
leaq -0x68(%rbp), %rsi
callq 0xa2f0
movl %eax, -0xc0(%rbp)
jmp 0x99af
movl -0xc0(%rbp), %eax
cmpl $0x0, %eax
setne %al
movb %al, -0xb9(%rbp)
movb -0xb9(%rbp), %al
movb %al, -0xc1(%rbp)
testb $0x1, -0x69(%rbp)
jne 0x99d5
jmp 0x99de
leaq -0x68(%rbp), %rdi
callq 0x42a0
movb -0xc1(%rbp), %al
testb $0x1, %al
jne 0x99ed
jmp 0x9ad0
movq 0x115dc(%rip), %rdi     # 0x1afd0
leaq 0xa775(%rip), %rsi      # 0x14170
callq 0x4400
movq %rax, -0xd0(%rbp)
jmp 0x9a09
movl -0x48(%rbp), %eax
movl %eax, %esi
leaq -0x30(%rbp), %rdi
callq 0xa910
movq %rax, %rsi
leaq -0x90(%rbp), %rdi
movl $0x1, %edx
movq $-0x1, %rcx
callq 0x4440
jmp 0x9a34
movq -0xd0(%rbp), %rdi
leaq -0x90(%rbp), %rsi
callq 0x43c0
movq %rax, -0xd8(%rbp)
jmp 0x9a50
movq -0xd8(%rbp), %rdi
leaq 0xa728(%rip), %rsi      # 0x14186
callq 0x4400
movq %rax, -0xe0(%rbp)
jmp 0x9a6c
movq -0xe0(%rbp), %rdi
movq 0x11536(%rip), %rsi     # 0x1afb0
callq 0x4480
jmp 0x9a81
leaq -0x90(%rbp), %rdi
callq 0x42a0
movl $0x1, %edi
callq 0x44f0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
testb $0x1, -0x69(%rbp)
jne 0x9aab
jmp 0x9ab4
leaq -0x68(%rbp), %rdi
callq 0x42a0
jmp 0x9af8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x90(%rbp), %rdi
callq 0x42a0
jmp 0x9af8
jmp 0x9ad2
jmp 0x9ad4
jmp 0x9ad6
jmp 0x9ad8
movl -0x48(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x48(%rbp)
jmp 0x9835
leaq -0x30(%rbp), %rdi
callq 0xa930
addq $0xe0, %rsp
popq %rbp
retq
leaq -0x30(%rbp), %rdi
callq 0xa930
movq -0x40(%rbp), %rdi
callq 0x46f0
nopw (%rax,%rax)