// File: /workspace/github_cpp_makefile_star2_O3/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 $0x18, %rsp
movq %rdx, -0x38(%rbp)
movq %rsi, %r14
movq %rdi, %r15
movl 0x8(%rsi), %eax
movl %eax, -0x2c(%rbp)
movq (%rdi), %rax
movq -0x18(%rax), %rbx
addq %rbx, %rdi
callq 0x1d33a
cmpq $0x0, 0x10(%r15,%rbx)
je 0x3dd66
cmpl $0x6, 0x40(%r15,%rbx)
jne 0x3dd66
movq (%r15), %rax
movq -0x18(%rax), %r12
leaq (%r15,%r12), %rbx
movq %rbx, %rdi
callq 0x1d33a
cmpq $0x0, 0x10(%r15,%r12)
je 0x3dd66
movq 0x8(%rbx), %rax
movq 0x18(%rbx), %rcx
cmpb $0x7b, (%rcx,%rax)
jne 0x3dd66
movq (%r15), %rcx
movq -0x18(%rcx), %rax
cmpq $0x0, 0x10(%r15,%rax)
je 0x3dc8b
incq 0x8(%r15,%rax)
movq $0x0, 0x10(%r15,%rax)
movl $0x0, 0x40(%r15,%rax)
movq -0x18(%rcx), %rax
movq 0x8(%r15,%rax), %rcx
movq 0x20(%r15,%rax), %rdx
cmpq %rdx, %rcx
jae 0x3dce6
cmpq $0x0, 0x10(%r15,%rax)
movq 0x18(%r15,%rax), %rsi
sete %dil
negq %rdx
incq %rcx
cmpb $0x20, -0x1(%rsi,%rcx)
jne 0x3dce6
movq %rcx, 0x8(%r15,%rax)
testb $0x1, %dil
jne 0x3dcd3
movq $0x0, 0x10(%r15,%rax)
movl $0x0, 0x40(%r15,%rax)
leaq (%rdx,%rcx), %r8
incq %r8
incq %rcx
movb $0x1, %dil
cmpq $0x1, %r8
jne 0x3dcaf
movq -0x38(%rbp), %rax
leal 0x1(%rax), %edx
movq %r15, %rdi
movq %r14, %rsi
movl %edx, -0x3c(%rbp)
callq 0x3dbe8
movl %eax, %r12d
movq (%r15), %rax
movq -0x18(%rax), %r13
movq 0x8(%r15,%r13), %rcx
movq 0x20(%r15,%r13), %rdx
cmpq %rdx, %rcx
jae 0x3ddaa
cmpq $0x0, 0x10(%r15,%r13)
movq 0x18(%r15,%r13), %rsi
sete %dil
negq %rdx
incq %rcx
cmpb $0x20, -0x1(%rsi,%rcx)
jne 0x3dda6
movq %rcx, 0x8(%r15,%r13)
testb $0x1, %dil
jne 0x3dd51
movq $0x0, 0x10(%r15,%r13)
movl $0x0, 0x40(%r15,%r13)
leaq (%rdx,%rcx), %r8
incq %r8
incq %rcx
movb $0x1, %dil
cmpq $0x1, %r8
jne 0x3dd2d
jmp 0x3dda6
movq %r15, %rdi
movq %r14, %rsi
callq 0x3dfc8
movl -0x2c(%rbp), %ebx
movl 0x8(%r14), %r12d
subl %ebx, %r12d
movq %r15, %rdi
movq %r14, %rsi
movl %r12d, %edx
callq 0x3e636
movl 0x8(%r14), %eax
subl %ebx, %eax
cmpl $0x2, -0x38(%rbp)
cmovbl %r12d, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq -0x18(%rax), %r13
leaq (%r15,%r13), %rbx
movq %rbx, %rdi
callq 0x1d33a
cmpq $0x0, 0x10(%r15,%r13)
je 0x3dee2
movq 0x8(%rbx), %rax
movq 0x18(%rbx), %rcx
cmpb $0x2c, (%rcx,%rax)
jne 0x3dee2
movq (%r15), %rcx
movq -0x18(%rcx), %rax
cmpq $0x0, 0x10(%r15,%rax)
je 0x3ddfe
incq 0x8(%r15,%rax)
movq $0x0, 0x10(%r15,%rax)
movl $0x0, 0x40(%r15,%rax)
movq -0x18(%rcx), %rax
movq 0x8(%r15,%rax), %rcx
movq 0x20(%r15,%rax), %rdx
cmpq %rdx, %rcx
jae 0x3de59
cmpq $0x0, 0x10(%r15,%rax)
movq 0x18(%r15,%rax), %rsi
sete %dil
negq %rdx
incq %rcx
cmpb $0x20, -0x1(%rsi,%rcx)
jne 0x3de59
movq %rcx, 0x8(%r15,%rax)
testb $0x1, %dil
jne 0x3de46
movq $0x0, 0x10(%r15,%rax)
movl $0x0, 0x40(%r15,%rax)
leaq (%rdx,%rcx), %r8
incq %r8
incq %rcx
movb $0x1, %dil
cmpq $0x1, %r8
jne 0x3de22
movq %r15, %rdi
movq %r14, %rsi
movl -0x3c(%rbp), %edx
callq 0x3dbe8
cmpl %r12d, %eax
movl $0x0, %eax
cmovnel %eax, %r12d
movq (%r15), %rax
movq -0x18(%rax), %r13
movq 0x8(%r15,%r13), %rcx
movq 0x20(%r15,%r13), %rdx
cmpq %rdx, %rcx
jae 0x3ddaa
cmpq $0x0, 0x10(%r15,%r13)
movq 0x18(%r15,%r13), %rsi
sete %dil
negq %rdx
incq %rcx
cmpb $0x20, -0x1(%rsi,%rcx)
jne 0x3dda6
movq %rcx, 0x8(%r15,%r13)
testb $0x1, %dil
jne 0x3deca
movq $0x0, 0x10(%r15,%r13)
movl $0x0, 0x40(%r15,%r13)
leaq (%rdx,%rcx), %r8
incq %r8
incq %rcx
movb $0x1, %dil
cmpq $0x1, %r8
jne 0x3dea2
jmp 0x3dda6
movq (%r15), %rax
movq -0x18(%rax), %rdi
addq %r15, %rdi
movl $0x7d, %esi
callq 0x1c824
cmpl $0x0, -0x38(%rbp)
movl -0x2c(%rbp), %ebx
jne 0x3dd74
testl %r12d, %r12d
je 0x3dd74
movq (%r15), %rax
movq -0x18(%rax), %rbx
movq 0x8(%r15,%rbx), %rcx
movq 0x20(%r15,%rbx), %rdx
cmpq %rdx, %rcx
jae 0x3df72
cmpq $0x0, 0x10(%r15,%rbx)
movq 0x18(%r15,%rbx), %rsi
sete %dil
negq %rdx
incq %rcx
cmpb $0x20, -0x1(%rsi,%rcx)
jne 0x3df6e
movq %rcx, 0x8(%r15,%rbx)
testb $0x1, %dil
jne 0x3df5b
movq $0x0, 0x10(%r15,%rbx)
movl $0x0, 0x40(%r15,%rbx)
leaq (%rdx,%rcx), %r8
incq %r8
incq %rcx
movb $0x1, %dil
cmpq $0x1, %r8
jne 0x3df37
movq -0x18(%rax), %rbx
leaq (%r15,%rbx), %rdi
callq 0x1d33a
cmpq $0x0, 0x10(%r15,%rbx)
je 0x3dfc0
cmpl $0x6, 0x40(%r15,%rbx)
jne 0x3dfc0
movq (%r15), %rax
movq -0x18(%rax), %r13
leaq (%r15,%r13), %rbx
movq %rbx, %rdi
callq 0x1d33a
cmpq $0x0, 0x10(%r15,%r13)
je 0x3dfc0
movq 0x8(%rbx), %rax
movq 0x18(%rbx), %rcx
cmpb $0x2f, (%rcx,%rax)
movl -0x2c(%rbp), %ebx
je 0x3dd74
jmp 0x3dd7b
movl -0x2c(%rbp), %ebx
jmp 0x3dd7b