// File: /workspace/github_cpp_makefile_star2_O2/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 0x5368
movq %rax, %r12
movzbl 0xf(%rbx), %edx
movl %edx, %eax
xorl $0xf, %eax
testb %dl, %dl
cmovsl 0x8(%rbx), %eax
cmpq %rax, %r12
jne 0x5085
leaq 0x2636f(%rip), %r15     # 0x2b3d9
movq %rbx, %rdi
movq %r15, %rsi
callq 0x42ce
movq %r14, %rdi
movq %r15, %rsi
callq 0x42ce
jmp 0x51aa
movq %rbx, %rcx
testb %dl, %dl
jns 0x508f
movq (%rbx), %rcx
movabsq $0x100000000, %rbp      # imm = 0x100000000
cmpq %rax, %r12
movq %rax, %rdx
cmovaq %r12, %rdx
movq %r12, %rsi
shlq $0x20, %rsi
leaq 0x23bdf(%rip), %rdi     # 0x28c90
movq %r12, %r8
cmpq %rax, %r8
jae 0x50e4
movq %rsi, %r9
sarq $0x20, %r9
movzbl (%rcx,%r9), %r9d
leal -0x2d(%r9), %r10d
cmpb $0x2, %r10b
jb 0x50d9
movb (%rdi,%r9), %r9b
andb $0x60, %r9b
je 0x50e1
incq %r8
addq %rbp, %rsi
jmp 0x50b4
movq %r8, %rdx
cmpq %rdx, %r12
jne 0x5139
leaq 0x231e3(%rip), %rsi     # 0x282d3
movq %r14, %rdi
callq 0x42ce
movzbl 0xf(%rbx), %ecx
movl %ecx, %eax
xorl $0xf, %eax
testb %cl, %cl
cmovsl 0x8(%rbx), %eax
movq (%rbx), %rcx
cmovnsq %rbx, %rcx
cmpq %rax, %r12
movq %rax, %rsi
cmovaq %r12, %rsi
movq %r12, %rdx
shlq $0x20, %rdx
cmpq %rax, %r12
jae 0x5198
movq %rdx, %rdi
sarq $0x20, %rdi
cmpb $0xa, (%rcx,%rdi)
je 0x5195
incq %r12
addq %rbp, %rdx
jmp 0x511f
movq %rbx, %rdi
movl %r12d, %esi
xorl %ecx, %ecx
callq 0x53e0
movq %rax, (%r13)
movq %rdx, 0x8(%r13)
movzbl 0xf(%rbx), %ecx
testb %cl, %cl
jns 0x515b
movl 0x8(%rbx), %eax
jmp 0x5160
movl %ecx, %eax
xorl $0xf, %eax
testl %eax, %eax
je 0x518d
movq %rbx, %rdx
testb %cl, %cl
jns 0x516e
movq (%rbx), %rdx
movzbl (%rdx), %ecx
cmpl $0x9, %ecx
je 0x518d
cmpl $0x3d, %ecx
je 0x51bb
cmpl $0x3a, %ecx
je 0x5223
cmpl $0x20, %ecx
jne 0x5273
movb $0x0, (%r15)
movb $0x1, %al
jmp 0x51ac
movq %r12, %rsi
pushq $-0x1
popq %rdx
movq %rbx, %rdi
callq 0x55aa
movq %rax, (%rbx)
movq %rdx, 0x8(%rbx)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpl $0x1, %eax
je 0x527f
cmpb $0x22, 0x1(%rdx)
jne 0x527f
movb $0x1, (%r15)
movzbl 0xf(%rbx), %ecx
movl %ecx, %eax
xorl $0xf, %eax
testb %cl, %cl
cmovsl 0x8(%rbx), %eax
movq (%rbx), %rcx
cmovnsq %rbx, %rcx
cmpq $0x3, %rax
pushq $0x2
popq %rsi
movq %rsi, %rdx
cmovaeq %rax, %rdx
movabsq $0x200000000, %rdi      # imm = 0x200000000
cmpq %rax, %rsi
jae 0x5315
movq %rdi, %r8
sarq $0x20, %r8
cmpb $0x22, (%rcx,%r8)
je 0x5312
incq %rsi
addq %rbp, %rdi
jmp 0x5200
movb $0x1, (%r15)
movzbl 0xf(%rbx), %ecx
movl %ecx, %eax
xorl $0xf, %eax
testb %cl, %cl
cmovsl 0x8(%rbx), %eax
movq (%rbx), %rcx
cmovnsq %rbx, %rcx
cmpq $0x1, %rax
movq %rax, %rdx
adcq $0x0, %rdx
pushq $0x1
popq %rsi
movq %rbp, %rdi
cmpq %rax, %rsi
jae 0x52c0
movq %rdi, %r8
sarq $0x20, %r8
movzbl (%rcx,%r8), %r8d
cmpl $0x20, %r8d
je 0x526b
cmpl $0x9, %r8d
jne 0x52c3
incq %rsi
addq %rbp, %rdi
jmp 0x524e
leaq 0x2306b(%rip), %rsi     # 0x282e5
jmp 0x5360
movb $0x1, (%r15)
movzbl 0xf(%rbx), %ecx
movl %ecx, %eax
xorl $0xf, %eax
testb %cl, %cl
cmovsl 0x8(%rbx), %eax
movq (%rbx), %rcx
cmovnsq %rbx, %rcx
xorl %esi, %esi
xorl %edx, %edx
cmpq %rdx, %rax
je 0x52f6
movq %rsi, %rdi
sarq $0x20, %rdi
movzbl (%rcx,%rdi), %r8d
orl $0x2, %r8d
cmpl $0x22, %r8d
je 0x52e9
incq %rdx
addq %rbp, %rsi
jmp 0x529d
movq %rdx, %rsi
pushq $-0x1
popq %rdx
movq %rbx, %rdi
callq 0x55aa
movq %rax, (%r14)
movq %rdx, 0x8(%r14)
leaq 0x260fd(%rip), %rsi     # 0x2b3d9
movq %rbx, %rdi
callq 0x42ce
jmp 0x5191
cmpq %rax, %rdx
jae 0x52f9
cmpb $0x22, (%rcx,%rdi)
jne 0x52f9
jmp 0x534a
movq %rax, %rdx
pushq $0x1
popq %rsi
movq %rbx, %rdi
xorl %ecx, %ecx
callq 0x53e0
movq %rax, (%r14)
movq %rdx, 0x8(%r14)
jmp 0x5191
movq %rsi, %rdx
cmpq %rax, %rdx
je 0x534a
movslq %edx, %rsi
cmpb $0x22, (%rcx,%rsi)
jne 0x534a
movq %rdx, %rsi
incq %rsi
cmpq %rax, %rsi
jae 0x533f
movslq %esi, %rax
movzbl (%rcx,%rax), %eax
cmpl $0x20, %eax
je 0x533f
cmpl $0x9, %eax
jne 0x534a
pushq $0x2
popq %rsi
pushq $0x1
popq %rcx
movq %rbx, %rdi
jmp 0x5301
leaq 0x26088(%rip), %rsi     # 0x2b3d9
movq %rbx, %rdi
callq 0x42ce
leaq 0x22f99(%rip), %rsi     # 0x282f9
movq %r14, %rdi
jmp 0x507b