// File: /workspace/github_cpp_makefile_star2_O1/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 %r13
pushq %r12
pushq %rbx
pushq %rax
movl %ecx, %ebp
movq %rdx, %r14
movq %rsi, (%rsp)
movq %rdi, %r15
movq %rdx, %rax
movzbl (%rax), %ecx
testl %ecx, %ecx
je 0x92c3
cmpl $0xa, %ecx
je 0x90d7
incq %rax
jmp 0x90c2
leaq 0x1383a(%rip), %rsi     # 0x1c918
movq %r14, %rdi
callq 0x8cd1
movl %eax, %r12d
testb %al, %al
je 0x90f2
xorl %r13d, %r13d
jmp 0x9108
leaq 0x13827(%rip), %rsi     # 0x1c920
movq %r14, %rdi
callq 0x8cd1
testb %al, %al
je 0x9182
movb $0x1, %r13b
xorl %ecx, %ecx
xorl %edx, %edx
xorl %eax, %eax
xorl %ebx, %ebx
movl %r12d, %esi
orb %r13b, %sil
cmpb $0x1, %sil
jne 0x9163
movl (%r15), %ebp
incl %ebp
movl %ebp, (%r15)
cmpb $0x0, 0x4(%r15)
jne 0x92c3
testb %r12b, %r12b
je 0x9269
movabsq $0x100000000, %rcx      # imm = 0x100000000
xorl %eax, %eax
movq %r14, %rdx
movzbl (%rdx), %esi
testl %esi, %esi
je 0x924d
cmpl $0xa, %esi
je 0x9247
addq %rcx, %rax
incq %rdx
jmp 0x9147
movb 0x4(%r15), %sil
testb %cl, %cl
je 0x919f
movl (%r15), %eax
testb %sil, %sil
je 0x91dd
cmpl 0x8(%r15), %eax
jne 0x92c3
jmp 0x92be
leaq 0x137a0(%rip), %rsi     # 0x1c929
movq %r14, %rdi
callq 0x8cd1
testb %al, %al
je 0x91be
movb $0x1, %cl
xorl %r13d, %r13d
jmp 0x910a
testb %dl, %dl
je 0x91e6
testb %sil, %sil
je 0x91b6
movl (%r15), %eax
cmpl 0x8(%r15), %eax
jne 0x91b6
movb $0x0, 0x4(%r15)
decl (%r15)
jmp 0x92c3
leaq 0x1376b(%rip), %rsi     # 0x1c930
movq %r14, %rdi
callq 0x8cd1
testb %al, %al
je 0x9222
movb $0x1, %dl
xorl %r13d, %r13d
xorl %ecx, %ecx
jmp 0x910c
movl %eax, 0x8(%r15)
jmp 0x92b7
testb %sil, %sil
jne 0x92c3
movabsq $0x100000000, %r15      # imm = 0x100000000
testb %al, %al
je 0x9314
xorl %eax, %eax
movq %r14, %rcx
movzbl (%rcx), %edx
testl %edx, %edx
je 0x92fb
cmpl $0xa, %edx
je 0x92f5
addq %r15, %rax
incq %rcx
jmp 0x9206
leaq 0x1370f(%rip), %rsi     # 0x1c938
movq %r14, %rdi
callq 0x8cd1
testb %al, %al
je 0x92d2
movb $0x1, %al
xorl %r13d, %r13d
xorl %ecx, %ecx
xorl %edx, %edx
jmp 0x910e
sarq $0x20, %rax
jmp 0x9254
movq $-0x1, %rax
leaq (%r14,%rax), %rsi
incq %rsi
movq (%rsp), %rdi
callq 0x8e47
testq %rax, %rax
jne 0x92be
testb %r13b, %r13b
je 0x92b3
movabsq $0x100000000, %rcx      # imm = 0x100000000
xorl %eax, %eax
movq %r14, %rdx
movzbl (%rdx), %esi
testl %esi, %esi
je 0x9297
cmpl $0xa, %esi
je 0x9291
addq %rcx, %rax
incq %rdx
jmp 0x927d
sarq $0x20, %rax
jmp 0x929e
movq $-0x1, %rax
leaq (%r14,%rax), %rsi
incq %rsi
movq (%rsp), %rdi
callq 0x8e47
testq %rax, %rax
je 0x92be
movl %ebp, 0x8(%r15)
movb $0x1, 0x4(%r15)
jmp 0x92c3
movb $0x0, 0x4(%r15)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x13668(%rip), %rsi     # 0x1c941
movq %r14, %rdi
callq 0x8cd1
testb %al, %al
je 0x92c3
movb $0x1, %bl
xorl %r13d, %r13d
xorl %ecx, %ecx
xorl %edx, %edx
xorl %eax, %eax
jmp 0x9110
sarq $0x20, %rax
jmp 0x9302
movq $-0x1, %rax
leaq (%r14,%rax), %rsi
incq %rsi
movq (%rsp), %rdi
movl %ebp, %edx
callq 0x8f66
testb %bl, %bl
je 0x92c3
xorl %eax, %eax
movq %r14, %rcx
movzbl (%rcx), %edx
testl %edx, %edx
je 0x9337
cmpl $0xa, %edx
je 0x9331
addq %r15, %rax
incq %rcx
jmp 0x931d
sarq $0x20, %rax
jmp 0x933e
movq $-0x1, %rax
leaq (%r14,%rax), %rsi
incq %rsi
movq (%rsp), %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x8fb9