// File: 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
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0x30(%rbp)
movq -0x10(%rbp), %rax
movl 0x8(%rax), %eax
movl %eax, -0x18(%rbp)
movl $0x1, -0x1c(%rbp)
movq (%rdi), %rax
addq -0x18(%rax), %rdi
movl $0x6, %esi
callq 0x25bb0
movb %al, %cl
xorl %eax, %eax
testb $0x1, %cl
movb %al, -0x25(%rbp)
jne 0x59cbb
jmp 0x59cd3
movq -0x30(%rbp), %rdi
movq (%rdi), %rax
addq -0x18(%rax), %rdi
movl $0x7b, %esi
callq 0x263d0
movb %al, -0x25(%rbp)
movb -0x25(%rbp), %al
andb $0x1, %al
movb %al, -0x1d(%rbp)
testb $0x1, -0x1d(%rbp)
je 0x59db4
movq -0x30(%rbp), %rdi
movq (%rdi), %rax
addq -0x18(%rax), %rdi
callq 0x283f0
movq -0x30(%rbp), %rdi
movq (%rdi), %rax
addq -0x18(%rax), %rdi
callq 0x535f0
movq -0x30(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl -0x14(%rbp), %edx
addl $0x1, %edx
callq 0x59c70
movq -0x30(%rbp), %rdi
movl %eax, -0x1c(%rbp)
movq (%rdi), %rax
addq -0x18(%rax), %rdi
callq 0x535f0
movq -0x30(%rbp), %rdi
movq (%rdi), %rax
addq -0x18(%rax), %rdi
movl $0x2c, %esi
callq 0x263d0
testb $0x1, %al
jne 0x59d46
jmp 0x59d9d
movq -0x30(%rbp), %rdi
movq (%rdi), %rax
addq -0x18(%rax), %rdi
callq 0x283f0
movq -0x30(%rbp), %rdi
movq (%rdi), %rax
addq -0x18(%rax), %rdi
callq 0x535f0
movq -0x30(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl -0x14(%rbp), %edx
addl $0x1, %edx
callq 0x59c70
movl %eax, -0x24(%rbp)
movl -0x24(%rbp), %eax
cmpl -0x1c(%rbp), %eax
je 0x59d8b
movl $0x0, -0x1c(%rbp)
movq -0x30(%rbp), %rdi
movq (%rdi), %rax
addq -0x18(%rax), %rdi
callq 0x535f0
jmp 0x59d2b
movq -0x30(%rbp), %rdi
movq (%rdi), %rax
addq -0x18(%rax), %rdi
movl $0x7d, %esi
callq 0x26430
jmp 0x59dce
movq -0x30(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x59e70
movq -0x10(%rbp), %rax
movl 0x8(%rax), %eax
subl -0x18(%rbp), %eax
movl %eax, -0x1c(%rbp)
testb $0x1, -0x1d(%rbp)
je 0x59def
cmpl $0x0, -0x1c(%rbp)
je 0x59def
cmpl $0x1, -0x14(%rbp)
jae 0x59def
movq -0x30(%rbp), %rdi
callq 0x5a4d0
testb $0x1, %al
jne 0x59def
jmp 0x59dfc
movq -0x10(%rbp), %rax
movl 0x8(%rax), %eax
subl -0x18(%rbp), %eax
movl %eax, -0x1c(%rbp)
movq -0x30(%rbp), %rdi
movq -0x10(%rbp), %rsi
movl -0x1c(%rbp), %edx
callq 0x5a540
cmpl $0x1, -0x14(%rbp)
ja 0x59e1a
movl -0x1c(%rbp), %eax
movl %eax, -0x34(%rbp)
jmp 0x59e27
movq -0x10(%rbp), %rax
movl 0x8(%rax), %eax
subl -0x18(%rbp), %eax
movl %eax, -0x34(%rbp)
movl -0x34(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq