// File: /workspace/github_cpp_makefile_star2_O1/vsklad[P]cgen/./bal/variables/variablesio.cpp
// Function: bal::VariableTextReader::read_variable_element_(bal::Container<unsigned int>&, unsigned int)
inline container_size_t VariableTextReader::read_variable_element_(Container<literalid_t>& value, const unsigned level) {
        const container_size_t baseline_size = value.size_;
        container_size_t element_size = 1;
        
        const bool b_brackets = is_token(TextReader::ttSymbol) && is_symbol('{');
        if (b_brackets) {
            skip_symbol();
            skip_space();
        
            element_size = read_variable_element_(value, level + 1);
        
            // read more elements
            skip_space();
            while (is_symbol(',')) {
                skip_symbol();
                skip_space();
                
                const container_size_t other_size = read_variable_element_(value, level + 1);
                if (other_size != element_size) {
                    // there is no structure, assume a single element
                    element_size = 0;
                };
                
                skip_space();
            };
            
            read_symbol('}');
        } else {
            read_variable_element_item_(value);
            element_size = value.size_ - baseline_size;
        };
        
        if (!b_brackets || element_size == 0 || level >= 1 || is_variable_element_sequence_()) {
            element_size = value.size_ - baseline_size;
        };
        
        read_variable_elements_sequence_(value, element_size);
        
        return level <= 1 ? element_size : value.size_ - baseline_size;
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %edx, %r13d
movq %rdi, %r15
movq %rsi, -0x38(%rbp)
movl 0x8(%rsi), %eax
movl %eax, -0x2c(%rbp)
movq (%rdi), %rax
movq -0x18(%rax), %rbx
addq %rbx, %rdi
callq 0x1eae0
xorl %r9d, %r9d
cmpq $0x0, 0x10(%r15,%rbx)
je 0x3fcaf
cmpl $0x6, 0x40(%r15,%rbx)
jne 0x3fcaf
movq (%r15), %rax
movq -0x18(%rax), %r12
leaq (%r15,%r12), %rbx
movq %rbx, %rdi
callq 0x1eae0
cmpq $0x0, 0x10(%r15,%r12)
je 0x3fcac
movq 0x8(%rbx), %rax
movq 0x18(%rbx), %rcx
cmpb $0x7b, (%rcx,%rax)
sete %r9b
jmp 0x3fcaf
xorl %r9d, %r9d
testb %r9b, %r9b
movl %r9d, -0x3c(%rbp)
je 0x3fefa
movq (%r15), %rax
movq -0x18(%rax), %rcx
cmpq $0x0, 0x10(%r15,%rcx)
je 0x3fce2
incq 0x8(%r15,%rcx)
movq $0x0, 0x10(%r15,%rcx)
movl $0x0, 0x40(%r15,%rcx)
movq -0x18(%rax), %rax
movq 0x8(%r15,%rax), %rcx
movq 0x20(%r15,%rax), %rdx
cmpq %rdx, %rcx
jae 0x3fd3a
movq 0x10(%r15,%rax), %rdi
movq 0x18(%r15,%rax), %rsi
negq %rdx
incq %rcx
cmpb $0x20, -0x1(%rsi,%rcx)
jne 0x3fd3a
movq %rcx, 0x8(%r15,%rax)
testq %rdi, %rdi
je 0x3fd2a
movq $0x0, 0x10(%r15,%rax)
movl $0x0, 0x40(%r15,%rax)
xorl %edi, %edi
leaq (%rdx,%rcx), %r8
incq %r8
incq %rcx
cmpq $0x1, %r8
jne 0x3fd05
movq %r13, -0x48(%rbp)
incl %r13d
movq %r15, %rdi
movq -0x38(%rbp), %rsi
movl %r13d, %edx
callq 0x3fc3c
movl %eax, %r12d
movq (%r15), %rax
movq -0x18(%rax), %rax
movq 0x8(%r15,%rax), %rcx
movq 0x20(%r15,%rax), %rdx
cmpq %rdx, %rcx
jae 0x3fec1
movq 0x10(%r15,%rax), %rdi
movq 0x18(%r15,%rax), %rsi
negq %rdx
incq %rcx
cmpb $0x20, -0x1(%rsi,%rcx)
jne 0x3fec1
movq %rcx, 0x8(%r15,%rax)
testq %rdi, %rdi
je 0x3fda6
movq $0x0, 0x10(%r15,%rax)
movl $0x0, 0x40(%r15,%rax)
xorl %edi, %edi
leaq (%rdx,%rcx), %r8
incq %r8
incq %rcx
cmpq $0x1, %r8
jne 0x3fd7d
jmp 0x3fec1
movq 0x8(%rbx), %rax
movq 0x18(%rbx), %rcx
cmpb $0x2c, (%rcx,%rax)
jne 0x3fee0
movq (%r15), %rax
movq -0x18(%rax), %rcx
cmpq $0x0, 0x10(%r15,%rcx)
je 0x3fdf3
incq 0x8(%r15,%rcx)
movq $0x0, 0x10(%r15,%rcx)
movl $0x0, 0x40(%r15,%rcx)
movq -0x18(%rax), %rax
movq 0x8(%r15,%rax), %rcx
movq 0x20(%r15,%rax), %rdx
cmpq %rdx, %rcx
jae 0x3fe4b
movq 0x10(%r15,%rax), %rdi
movq 0x18(%r15,%rax), %rsi
negq %rdx
incq %rcx
cmpb $0x20, -0x1(%rsi,%rcx)
jne 0x3fe4b
movq %rcx, 0x8(%r15,%rax)
testq %rdi, %rdi
je 0x3fe3b
movq $0x0, 0x10(%r15,%rax)
movl $0x0, 0x40(%r15,%rax)
xorl %edi, %edi
leaq (%rdx,%rcx), %r8
incq %r8
incq %rcx
cmpq $0x1, %r8
jne 0x3fe16
movq %r15, %rdi
movq -0x38(%rbp), %rsi
movl %r13d, %edx
callq 0x3fc3c
cmpl %r12d, %eax
movl $0x0, %eax
cmovnel %eax, %r12d
movq (%r15), %rax
movq -0x18(%rax), %rax
movq 0x8(%r15,%rax), %rcx
movq 0x20(%r15,%rax), %rdx
cmpq %rdx, %rcx
jae 0x3fec1
movq 0x10(%r15,%rax), %rdi
movq 0x18(%r15,%rax), %rsi
negq %rdx
incq %rcx
cmpb $0x20, -0x1(%rsi,%rcx)
jne 0x3fec1
movq %rcx, 0x8(%r15,%rax)
testq %rdi, %rdi
je 0x3feb1
movq $0x0, 0x10(%r15,%rax)
movl $0x0, 0x40(%r15,%rax)
xorl %edi, %edi
leaq (%rdx,%rcx), %r8
incq %r8
incq %rcx
cmpq $0x1, %r8
jne 0x3fe8c
movq (%r15), %rax
movq -0x18(%rax), %r14
leaq (%r15,%r14), %rbx
movq %rbx, %rdi
callq 0x1eae0
cmpq $0x0, 0x10(%r15,%r14)
jne 0x3fdbb
movq (%r15), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0x7d, %esi
callq 0x1df9e
movq -0x48(%rbp), %r13
jmp 0x3ff11
movq %r15, %rdi
movq -0x38(%rbp), %rbx
movq %rbx, %rsi
callq 0x4000c
movl 0x8(%rbx), %r12d
subl -0x2c(%rbp), %r12d
testl %r13d, %r13d
jne 0x3ffd0
movl -0x3c(%rbp), %eax
xorb $0x1, %al
jne 0x3ffd0
testl %r12d, %r12d
je 0x3ffd0
movq (%r15), %rax
movq -0x18(%rax), %rcx
movq 0x8(%r15,%rcx), %rdx
movq 0x20(%r15,%rcx), %rsi
cmpq %rsi, %rdx
jae 0x3ff8a
movq 0x10(%r15,%rcx), %r8
movq 0x18(%r15,%rcx), %rdi
negq %rsi
incq %rdx
cmpb $0x20, -0x1(%rdi,%rdx)
jne 0x3ff8a
movq %rdx, 0x8(%r15,%rcx)
testq %r8, %r8
je 0x3ff7a
movq $0x0, 0x10(%r15,%rcx)
movl $0x0, 0x40(%r15,%rcx)
xorl %r8d, %r8d
leaq (%rsi,%rdx), %r9
incq %r9
incq %rdx
cmpq $0x1, %r9
jne 0x3ff54
movq -0x18(%rax), %rbx
leaq (%r15,%rbx), %rdi
callq 0x1eae0
cmpq $0x0, 0x10(%r15,%rbx)
je 0x3ffdc
cmpl $0x6, 0x40(%r15,%rbx)
jne 0x3ffdc
movq (%r15), %rax
movq -0x18(%rax), %r14
leaq (%r15,%r14), %rbx
movq %rbx, %rdi
callq 0x1eae0
cmpq $0x0, 0x10(%r15,%r14)
je 0x3ffdc
movq 0x8(%rbx), %rax
movq 0x18(%rbx), %rcx
cmpb $0x2f, (%rcx,%rax)
jne 0x3ffdc
movq -0x38(%rbp), %rax
movl 0x8(%rax), %r12d
subl -0x2c(%rbp), %r12d
movq %r15, %rdi
movq -0x38(%rbp), %rbx
movq %rbx, %rsi
movl %r12d, %edx
callq 0x40634
movl 0x8(%rbx), %eax
subl -0x2c(%rbp), %eax
cmpl $0x2, %r13d
cmovbl %r12d, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop