// File: /workspace/github_cpp_makefile_star2_O1/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 %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rcx, %r14
movq %rdx, %r15
movq %rsi, %r13
movq %rdi, %rbx
callq 0x6278
movzbl 0xf(%rbx), %esi
movl %esi, %ecx
xorl $0xf, %ecx
testb %sil, %sil
movl 0x8(%rbx), %edx
cmovnsl %ecx, %edx
cmpq %rdx, %rax
jne 0x5eea
leaq 0x2c50e(%rip), %r12     # 0x323cc
xorl %r15d, %r15d
movq %rbx, %rdi
movq %r12, %rsi
xorl %edx, %edx
movl $0x1, %ecx
callq 0x5040
movq %r14, %rdi
movq %r12, %rsi
xorl %edx, %edx
movl $0x1, %ecx
callq 0x5040
jmp 0x6026
testb %sil, %sil
cmovsl 0x8(%rbx), %ecx
movq %rax, %r12
cmpq %rcx, %rax
jae 0x5f4d
movq %rbx, %rdx
testb %sil, %sil
jns 0x5f04
movq (%rbx), %rdx
movabsq $0x100000000, %rsi      # imm = 0x100000000
movq %rax, %rdi
shlq $0x20, %rdi
leaq 0x29df4(%rip), %r8      # 0x2fd10
movq %rax, %r12
movq %rdi, %r9
sarq $0x20, %r9
movzbl (%rdx,%r9), %r9d
leal -0x2d(%r9), %r10d
cmpb $0x2, %r10b
jb 0x5f3f
movb (%r8,%r9), %r9b
andb $0x60, %r9b
je 0x5f4d
incq %r12
addq %rsi, %rdi
cmpq %r12, %rcx
jne 0x5f1f
movq %rcx, %r12
cmpq %r12, %rax
jne 0x5fd1
leaq 0x2937a(%rip), %rsi     # 0x2f2d3
movl $0x11, %edx
movq %r14, %rdi
movl $0x1, %ecx
callq 0x5040
movzbl 0xf(%rbx), %edx
movl %edx, %eax
xorl $0xf, %eax
testb %dl, %dl
cmovsl 0x8(%rbx), %eax
cmpq %rax, %r12
jae 0x5fb5
movq %rbx, %rcx
testb %dl, %dl
jns 0x5f89
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 0x5fb5
incq %r12
addq %rdx, %rsi
cmpq %r12, %rax
jne 0x5f9a
movq %rax, %r12
movq %rbx, %rdi
movl %r12d, %esi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x658a
movq %rax, (%rbx)
movq %rdx, 0x8(%rbx)
xorl %r15d, %r15d
jmp 0x6026
movq %rbx, %rdi
movl %eax, %esi
movl %r12d, %edx
xorl %ecx, %ecx
callq 0x632c
movq %rax, (%r13)
movq %rdx, 0x8(%r13)
movzbl 0xf(%rbx), %ecx
movl %ecx, %eax
xorl $0xf, %eax
movl 0x8(%rbx), %edx
testb %cl, %cl
movl %eax, %esi
cmovsl %edx, %esi
testl %esi, %esi
je 0x601f
movq %rbx, %rsi
testb %cl, %cl
jns 0x6009
movq (%rbx), %rsi
movzbl (%rsi), %edi
cmpl $0x39, %edi
jg 0x6033
cmpl $0x9, %edi
je 0x601f
cmpl $0x20, %edi
jne 0x6116
movb $0x0, (%r15)
movb $0x1, %r15b
movl %r15d, %eax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
cmpl $0x3a, %edi
je 0x6134
cmpl $0x3d, %edi
jne 0x6116
testb %cl, %cl
cmovsl %edx, %eax
cmpl $0x2, %eax
jb 0x61c2
cmpb $0x22, 0x1(%rsi)
jne 0x61c2
movb $0x1, (%r15)
movzbl 0xf(%rbx), %ecx
movl %ecx, %eax
xorl $0xf, %eax
testb %cl, %cl
movl 0x8(%rbx), %esi
cmovnsl %eax, %esi
movl $0x2, %edx
cmpl $0x3, %esi
jb 0x60b6
movq %rbx, %rdi
testb %cl, %cl
jns 0x6086
movq (%rbx), %rdi
movabsq $0x100000000, %r8       # imm = 0x100000000
movabsq $0x200000000, %r9       # imm = 0x200000000
movq %r9, %r10
sarq $0x20, %r10
cmpb $0x22, (%rdi,%r10)
je 0x60b6
incq %rdx
addq %r8, %r9
cmpq %rdx, %rsi
jne 0x609a
movq %rsi, %rdx
testb %cl, %cl
movl 0x8(%rbx), %esi
cmovnsl %eax, %esi
cmpq %rsi, %rdx
je 0x623a
movq %rbx, %rsi
testb %cl, %cl
jns 0x60d1
movq (%rbx), %rsi
movslq %edx, %rdi
cmpb $0x22, (%rsi,%rdi)
jne 0x623a
movq %rdx, %rdi
incq %rdi
testb %cl, %cl
cmovsl 0x8(%rbx), %eax
cmpq %rax, %rdi
jae 0x6104
movslq %edi, %rax
movzbl (%rsi,%rax), %eax
cmpl $0x20, %eax
je 0x6104
cmpl $0x9, %eax
jne 0x623a
movq %rbx, %rdi
movl $0x2, %esi
movl $0x1, %ecx
jmp 0x6267
leaq 0x291c8(%rip), %rsi     # 0x2f2e5
movl $0x13, %edx
movq %r14, %rdi
movl $0x1, %ecx
callq 0x5040
jmp 0x5fcc
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 0x6193
movq %rbx, %rcx
testb %dl, %dl
jns 0x615b
movq (%rbx), %rcx
movabsq $0x100000000, %rdx      # imm = 0x100000000
movl $0x1, %esi
movq %rdx, %rdi
movq %rdi, %r8
sarq $0x20, %r8
movzbl (%rcx,%r8), %r8d
cmpl $0x20, %r8d
je 0x6185
cmpl $0x9, %r8d
jne 0x6193
incq %rsi
addq %rdx, %rdi
cmpq %rsi, %rax
jne 0x616d
movq %rax, %rsi
movq %rbx, %rdi
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
callq 0x658a
movq %rax, (%r14)
movq %rdx, 0x8(%r14)
leaq 0x2c21e(%rip), %rsi     # 0x323cc
movq %rbx, %rdi
xorl %edx, %edx
movl $0x1, %ecx
callq 0x5040
jmp 0x6023
movb $0x1, (%r15)
movzbl 0xf(%rbx), %eax
movl %eax, %ecx
xorl $0xf, %ecx
testb %al, %al
movl 0x8(%rbx), %esi
cmovnsl %ecx, %esi
testl %esi, %esi
je 0x621a
movq %rbx, %rdi
testb %al, %al
jns 0x61e5
movq (%rbx), %rdi
movabsq $0x100000000, %r8       # imm = 0x100000000
xorl %r9d, %r9d
xorl %edx, %edx
movq %r9, %r10
sarq $0x20, %r10
movzbl (%rdi,%r10), %r10d
orl $0x2, %r10d
cmpl $0x22, %r10d
je 0x621c
incq %rdx
addq %r8, %r9
cmpq %rdx, %rsi
jne 0x61f4
movq %rsi, %rdx
jmp 0x621c
xorl %edx, %edx
testb %al, %al
cmovsl 0x8(%rbx), %ecx
cmpq %rcx, %rdx
jae 0x625d
movq %rbx, %rcx
testb %al, %al
jns 0x6231
movq (%rbx), %rcx
movslq %edx, %rax
cmpb $0x22, (%rcx,%rax)
jne 0x625d
leaq 0x2c18b(%rip), %rsi     # 0x323cc
movq %rbx, %rdi
callq 0x661a
leaq 0x290a9(%rip), %rsi     # 0x2f2f9
movq %r14, %rdi
callq 0x661a
jmp 0x5fcc
movq %rbx, %rdi
movl $0x1, %esi
xorl %ecx, %ecx
callq 0x632c
movq %rax, (%r14)
movq %rdx, 0x8(%r14)
jmp 0x6023