// File: /workspace/github_cpp_makefile_star2_O3/Alcaro[P]bridges/arlib/bmlparse.cpp
// Function: bml_parse_inline_node(cstring&, cstring&, bool&, cstring&)
static bool bml_parse_inline_node(cstring& data, cstring& node, bool& hasvalue, cstring& value)
{
	size_t nodestart = bml_size_white(data);
	if (nodestart == data.length())
	{
		data = "";
		value = "";
		return false;
	}
	
	size_t nodelen = nodestart;
	while (nodelen < data.length() && (isalnum(data[nodelen]) || data[nodelen]=='-' || data[nodelen]=='.')) nodelen++;
	if (nodestart == nodelen)
	{
		value = "Invalid node name";
		while (nodelen < data.length() && data[nodelen]!='\n') nodelen++;
		data = data.substr(nodelen, ~0);
		return false;
	}
	node = cut(data, nodestart, nodelen, 0);
	if (!data)
	{
		hasvalue = false;
		return true;
	}
	switch (data[0])
	{
		case '\t':
		case ' ':
		{
			hasvalue = false;
			return true;
		}
		case ':':
		{
			hasvalue = true;
			size_t valstart = 1;
			while (valstart < data.length() && (data[valstart]==' ' || data[valstart]=='\t')) valstart++;
			value = data.substr(valstart, ~0);
			data = "";
			return true;
		}
		case '=':
		{
			if (data.length() >= 2 && data[1]=='"')
			{
				hasvalue = true;
				size_t valend = 2;
				while (valend < data.length() && data[valend]!='"') valend++;
				if (valend == data.length() || data[valend]!='"')
					goto bad_quote;
				if (valend+1 < data.length() && data[valend+1]!=' ' && data[valend+1]!='\t')
					goto bad_quote;
				value = cut(data, 2, valend, 1);
				return true;
			}
			else
			{
				hasvalue = true;
				size_t valend = 0;
				while (valend < data.length() && data[valend]!=' ' && data[valend]!='"') valend++;
				if (valend < data.length() && data[valend]=='"')
					goto bad_quote;
				value = cut(data, 1, valend, 0);
				return true;
			}
		}
		default:
			value = "Invalid node suffix";
			return false;
	}
	if (false)
	{
	bad_quote:
		data = "";
		value = "Broken quoted value";
		return false;
	}
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %r14
movq %rdx, %r15
movq %rsi, %r13
movq %rdi, %rbx
callq 0x686e
movq %rax, %r12
movzbl 0xf(%rbx), %edx
movl %edx, %eax
xorl $0xf, %eax
testb %dl, %dl
cmovsl 0x8(%rbx), %eax
cmpq %rax, %r12
jne 0x6534
leaq 0x2bf64(%rip), %r12     # 0x3246c
xorl %r15d, %r15d
movq %rbx, %rdi
movq %r12, %rsi
xorl %edx, %edx
movl $0x1, %ecx
callq 0x5990
movq %r14, %rdi
movq %r12, %rsi
xorl %edx, %edx
movl $0x1, %ecx
callq 0x5990
jmp 0x665f
jae 0x658e
movq %rbx, %rcx
testb %dl, %dl
jns 0x6540
movq (%rbx), %rcx
movabsq $0x100000000, %rbp      # imm = 0x100000000
movq %r12, %rsi
shlq $0x20, %rsi
leaq 0x297f8(%rip), %rdi     # 0x2fd50
movq %r12, %rdx
movq %rsi, %r8
sarq $0x20, %r8
movzbl (%rcx,%r8), %r8d
leal -0x2d(%r8), %r9d
cmpb $0x2, %r9b
jb 0x657b
movb (%rdi,%r8), %r8b
andb $0x60, %r8b
je 0x6589
incq %rdx
addq %rbp, %rsi
cmpq %rdx, %rax
jne 0x655b
movq %rax, %rdx
cmpq %rdx, %r12
jne 0x660d
leaq 0x28d3e(%rip), %rsi     # 0x2f2d3
movl $0x11, %edx
movq %r14, %rdi
movl $0x1, %ecx
callq 0x5990
movzbl 0xf(%rbx), %edx
movl %edx, %eax
xorl $0xf, %eax
testb %dl, %dl
cmovsl 0x8(%rbx), %eax
cmpq %rax, %r12
jae 0x65f1
movq %rbx, %rcx
testb %dl, %dl
jns 0x65c5
movq (%rbx), %rcx
movabsq $0x100000000, %rdx      # imm = 0x100000000
movq %r12, %rsi
shlq $0x20, %rsi
movq %rsi, %rdi
sarq $0x20, %rdi
cmpb $0xa, (%rcx,%rdi)
je 0x65f1
incq %r12
addq %rdx, %rsi
cmpq %r12, %rax
jne 0x65d6
movq %rax, %r12
movq %rbx, %rdi
movl %r12d, %esi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x6b28
movq %rax, (%rbx)
movq %rdx, 0x8(%rbx)
xorl %r15d, %r15d
jmp 0x665f
movq %rbx, %rdi
movl %r12d, %esi
xorl %ecx, %ecx
callq 0x6906
movq %rax, (%r13)
movq %rdx, 0x8(%r13)
movzbl 0xf(%rbx), %edx
testb %dl, %dl
jns 0x662f
movl 0x8(%rbx), %eax
jmp 0x6634
movl %edx, %eax
xorl $0xf, %eax
testl %eax, %eax
je 0x6658
movq %rbx, %rcx
testb %dl, %dl
jns 0x6642
movq (%rbx), %rcx
movzbl (%rcx), %edx
cmpl $0x39, %edx
jg 0x6671
cmpl $0x9, %edx
je 0x6658
cmpl $0x20, %edx
jne 0x66e9
movb $0x0, (%r15)
movb $0x1, %r15b
movl %r15d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpl $0x3a, %edx
je 0x6707
cmpl $0x3d, %edx
jne 0x66e9
cmpl $0x1, %eax
je 0x6788
cmpb $0x22, 0x1(%rcx)
jne 0x6788
movb $0x1, (%r15)
movzbl 0xf(%rbx), %ecx
movl %ecx, %eax
xorl $0xf, %eax
testb %cl, %cl
cmovsl 0x8(%rbx), %eax
movl $0x2, %edx
cmpl $0x3, %eax
jb 0x6808
movq %rbx, %rsi
testb %cl, %cl
jns 0x66bd
movq (%rbx), %rsi
movabsq $0x200000000, %rdi      # imm = 0x200000000
movq %rdi, %r8
sarq $0x20, %r8
cmpb $0x22, (%rsi,%r8)
je 0x6808
incq %rdx
addq %rbp, %rdi
cmpq %rdx, %rax
jne 0x66c7
jmp 0x684b
leaq 0x28bf5(%rip), %rsi     # 0x2f2e5
movl $0x13, %edx
movq %r14, %rdi
movl $0x1, %ecx
callq 0x5990
jmp 0x6608
movb $0x1, (%r15)
movzbl 0xf(%rbx), %edx
movl %edx, %eax
xorl $0xf, %eax
testb %dl, %dl
cmovsl 0x8(%rbx), %eax
movl $0x1, %esi
cmpl $0x2, %eax
jb 0x6759
movq %rbx, %rcx
testb %dl, %dl
jns 0x672e
movq (%rbx), %rcx
movl $0x1, %esi
movq %rbp, %rdx
movq %rdx, %rdi
sarq $0x20, %rdi
movzbl (%rcx,%rdi), %edi
cmpl $0x20, %edi
je 0x674b
cmpl $0x9, %edi
jne 0x6759
incq %rsi
addq %rbp, %rdx
cmpq %rsi, %rax
jne 0x6736
movq %rax, %rsi
movq %rbx, %rdi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x6b28
movq %rax, (%r14)
movq %rdx, 0x8(%r14)
leaq 0x2bcf8(%rip), %rsi     # 0x3246c
movq %rbx, %rdi
xorl %edx, %edx
movl $0x1, %ecx
callq 0x5990
jmp 0x665c
movb $0x1, (%r15)
movzbl 0xf(%rbx), %eax
movl %eax, %ecx
xorl $0xf, %ecx
testb %al, %al
cmovsl 0x8(%rbx), %ecx
testl %ecx, %ecx
je 0x67d3
movq %rbx, %rsi
testb %al, %al
jns 0x67a9
movq (%rbx), %rsi
xorl %edi, %edi
xorl %edx, %edx
movq %rdi, %r8
sarq $0x20, %r8
movzbl (%rsi,%r8), %r8d
orl $0x2, %r8d
cmpl $0x22, %r8d
je 0x67d5
incq %rdx
addq %rbp, %rdi
cmpq %rdx, %rcx
jne 0x67ad
movq %rcx, %rdx
jmp 0x67ed
xorl %edx, %edx
cmpq %rcx, %rdx
jae 0x67ed
movq %rbx, %rcx
testb %al, %al
jns 0x67e4
movq (%rbx), %rcx
movslq %edx, %rax
cmpb $0x22, (%rcx,%rax)
je 0x684b
movq %rbx, %rdi
movl $0x1, %esi
xorl %ecx, %ecx
callq 0x6906
movq %rax, (%r14)
movq %rdx, 0x8(%r14)
jmp 0x665c
cmpq %rax, %rdx
je 0x684b
movq %rbx, %rsi
testb %cl, %cl
jns 0x6817
movq (%rbx), %rsi
movslq %edx, %rcx
cmpb $0x22, (%rsi,%rcx)
jne 0x684b
movq %rdx, %rcx
incq %rcx
cmpq %rax, %rcx
jae 0x683c
movslq %ecx, %rax
movzbl (%rsi,%rax), %eax
cmpl $0x20, %eax
je 0x683c
cmpl $0x9, %eax
jne 0x684b
movq %rbx, %rdi
movl $0x2, %esi
movl $0x1, %ecx
jmp 0x67f7
leaq 0x2bc1a(%rip), %rsi     # 0x3246c
movq %rbx, %rdi
callq 0x6bba
leaq 0x28a98(%rip), %rsi     # 0x2f2f9
movq %r14, %rdi
callq 0x6bba
jmp 0x6608