// File: /workspace/github_cpp_makefile_star2_O3/FreeSlave[P]vhlt/common/cmdlinecfg.cpp
// Function: parsecommand(execute_t&, char*, char*, unsigned int)
void parsecommand (execute_t &e, char *cmdline, char *words, unsigned int n)
{
	command_t t;
	if (!pvalid (words))
		return;
	if (pmatch (words, "#ifdef" SEPSTR))
		t = IFDEF;
	else if (pmatch (words, "#ifndef" SEPSTR))
		t = IFNDEF;
	else if (pmatch (words, "#else" SEPSTR))
		t = ELSE;
	else if (pmatch (words, "#endif" SEPSTR))
		t = ENDIF;
	else if (pmatch (words, "#define" SEPSTR))
		t = DEFINE;
	else if (pmatch (words, "#undef" SEPSTR))
		t = UNDEF;
	else
		return;
	if (t == IFDEF || t == IFNDEF)
	{
		e.stack ++;
		if (!e.skip)
		{
			if (t == IFDEF && findparams (cmdline, pnext (words)) ||
				t == IFNDEF && !findparams (cmdline, pnext (words)))
				e.skip = false;
			else
			{
				e.skipstack = e.stack;
				e.skip = true;
			}
		}
	}
	else if (t == ELSE)
	{
		if (e.skip)
		{
			if (e.stack == e.skipstack)
				e.skip = false;
		}
		else
		{
			e.skipstack = e.stack;
			e.skip = true;
		}
	}
	else if (t == ENDIF)
	{
		if (e.skip)
		{
			if (e.stack == e.skipstack)
				e.skip = false;
		}
		e.stack --;
	}
	else
	{
		if (!e.skip)
		{
			if (t == DEFINE)
				addparams (cmdline, pnext(words), n);
			if (t == UNDEF)
				delparams (cmdline, pnext(words));
		}
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %ecx, %ebp
movq %rdx, %r14
movq %rsi, %rbx
movq %rdi, %r15
movq %rdx, %rax
movzbl (%rax), %ecx
testl %ecx, %ecx
je 0x913b
cmpl $0xa, %ecx
je 0x8f99
incq %rax
jmp 0x8f84
leaq 0x13968(%rip), %rsi     # 0x1c908
movq %r14, %rdi
callq 0x8b99
testb %al, %al
je 0x8fee
movl (%r15), %ebp
incl %ebp
movl %ebp, (%r15)
cmpb $0x0, 0x4(%r15)
jne 0x913b
leaq 0x4(%r15), %r12
movabsq $0x100000000, %rcx      # imm = 0x100000000
xorl %eax, %eax
movq %r14, %rdx
movzbl (%rdx), %esi
testl %esi, %esi
je 0x90ac
cmpl $0xa, %esi
je 0x9074
addq %rcx, %rax
incq %rdx
jmp 0x8fd2
leaq 0x1391b(%rip), %rsi     # 0x1c910
movq %r14, %rdi
callq 0x8b99
testb %al, %al
je 0x9043
movl (%r15), %ebp
incl %ebp
movl %ebp, (%r15)
cmpb $0x0, 0x4(%r15)
jne 0x913b
leaq 0x4(%r15), %r12
movabsq $0x100000000, %rcx      # imm = 0x100000000
xorl %eax, %eax
movq %r14, %rdx
movzbl (%rdx), %esi
testl %esi, %esi
je 0x9117
cmpl $0xa, %esi
je 0x90ce
addq %rcx, %rax
incq %rdx
jmp 0x9027
leaq 0x138cf(%rip), %rsi     # 0x1c919
movq %r14, %rdi
callq 0x8b99
testb %al, %al
je 0x907a
movl (%r15), %eax
cmpb $0x1, 0x4(%r15)
jne 0x90d4
cmpl 0x8(%r15), %eax
jne 0x913b
movb $0x0, 0x4(%r15)
jmp 0x913b
sarq $0x20, %rax
jmp 0x90b3
leaq 0x1389f(%rip), %rsi     # 0x1c920
movq %r14, %rdi
callq 0x8b99
testb %al, %al
je 0x90da
movl (%r15), %eax
cmpb $0x1, 0x4(%r15)
jne 0x90a2
cmpl 0x8(%r15), %eax
jne 0x90a2
movb $0x0, 0x4(%r15)
decl %eax
movl %eax, (%r15)
jmp 0x913b
movq $-0x1, %rax
leaq (%r14,%rax), %rsi
incq %rsi
movq %rbx, %rdi
callq 0x8d0d
testq %rax, %rax
je 0x9132
movb $0x0, (%r12)
jmp 0x913b
sarq $0x20, %rax
jmp 0x911e
movl %eax, 0x8(%r15)
jmp 0x9136
leaq 0x13847(%rip), %rsi     # 0x1c928
movq %r14, %rdi
callq 0x8b99
testb %al, %al
je 0x9144
cmpb $0x0, 0x4(%r15)
jne 0x913b
movabsq $0x100000000, %rcx      # imm = 0x100000000
xorl %eax, %eax
movq %r14, %rdx
movzbl (%rdx), %esi
testl %esi, %esi
je 0x9187
cmpl $0xa, %esi
je 0x9181
addq %rcx, %rax
incq %rdx
jmp 0x9103
movq $-0x1, %rax
leaq (%r14,%rax), %rsi
incq %rsi
movq %rbx, %rdi
callq 0x8d0d
testq %rax, %rax
je 0x90c7
movl %ebp, 0x8(%r15)
movb $0x1, 0x4(%r15)
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x137e6(%rip), %rsi     # 0x1c931
movq %r14, %rdi
callq 0x8b99
testb %al, %al
je 0x913b
cmpb $0x0, 0x4(%r15)
jne 0x913b
movabsq $0x100000000, %rcx      # imm = 0x100000000
xorl %eax, %eax
movq %r14, %rdx
movzbl (%rdx), %esi
testl %esi, %esi
je 0x91ad
cmpl $0xa, %esi
je 0x91a7
addq %rcx, %rax
incq %rdx
jmp 0x916d
sarq $0x20, %rax
jmp 0x918e
movq $-0x1, %rax
leaq (%r14,%rax), %rsi
incq %rsi
movq %rbx, %rdi
movl %ebp, %edx
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x8e2c
sarq $0x20, %rax
jmp 0x91b4
movq $-0x1, %rax
leaq (%r14,%rax), %rsi
incq %rsi
movq %rbx, %rdi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x8e7f