// File: /workspace/github_cpp_makefile_star2_O1/vsklad[P]cgen/./bal/variables/variablesio.cpp
// Function: bal::VariableTextReader::read_variable_elements_sequence_(bal::Container<unsigned int>&, unsigned int)
inline void VariableTextReader::read_variable_elements_sequence_(Container<literalid_t>& value,
                                                                     const variables_size_t element_size) {
        _assert_level_0(element_size > 0);
        _assert_level_0(value.size_ >= element_size);
        
        unsigned int sequence_size = 1;
        signed int step_size = 0;
        read_variable_element_sequence_(sequence_size, step_size);
        
        if (step_size != 0) {
            // require at least one variable within value
            bool b_no_variables = true;
            for (auto i = 0; (i < element_size) && b_no_variables; i++) {
                b_no_variables &= !literal_t__is_variable(value.data_[value.size_ - i - 1]);
            };
            if (b_no_variables) {
                parse_error("Sequence step can be non-zero for variable numbers sequence only");
            };
        };
        
        if (sequence_size > 1) {
            value.reserve((sequence_size - 1) * element_size);
            
            for (auto i = 0; i < sequence_size - 1; i++) {
                literalid_t* p_element = value.data_ + value.size_ + (i * element_size);
                for (auto j = 0; j < element_size; j++) {
                    // adjust variables, preserve constants/unassigned
                    const literalid_t literal = *(p_element + j - element_size);
                    if (literal_t__is_variable(literal)) {
                        if (literal_t__sequence_next_is_valid(literal, step_size)) {
                            *(p_element + j) = literal_t__sequence_next(literal, step_size);
                        } else {
                            parse_error("Sequence produces an invalid variable number");
                        };
                    } else {
                        *(p_element + j) = literal;
                    };
                };
                p_element ++;
            };
            
            value.size_ += (sequence_size - 1) * element_size;
        };
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x88, %rsp
movq %rdi, -0x38(%rbp)
testl %edx, %edx
je 0x408f8
movl %edx, %r15d
movq %rsi, %r13
cmpl %edx, 0x8(%rsi)
jb 0x40917
leaq -0x2c(%rbp), %rsi
movl $0x1, (%rsi)
leaq -0x3c(%rbp), %r14
movl $0x0, (%r14)
movq -0x38(%rbp), %rdi
movq %r14, %rdx
callq 0x40982
cmpl $0x0, (%r14)
movl %r15d, -0x30(%rbp)
je 0x40715
movq (%r13), %rax
movl 0x8(%r13), %ecx
movl %r15d, %edx
decl %ecx
movl $0x1, %esi
movl %ecx, %edi
movl (%rax,%rdi,4), %edi
incl %edi
cmpq %rdx, %rsi
jae 0x406ba
decl %ecx
incq %rsi
cmpl $0x3, %edi
jb 0x406a4
cmpl $0x3, %edi
jae 0x40715
movq -0x38(%rbp), %rcx
movq (%rcx), %rax
leaq -0x98(%rbp), %r15
movq -0x18(%rax), %r14
addq %rcx, %r14
movq %r15, -0x10(%r15)
leaq 0xdb29(%rip), %rsi      # 0x4e208
leaq 0xdb62(%rip), %rdx      # 0x4e248
leaq -0xa8(%rbp), %r12
movq %r12, %rdi
callq 0x1f29e
movq %r14, %rdi
movq %r12, %rsi
callq 0x1de0a
movq -0xa8(%rbp), %rdi
cmpq %r15, %rdi
movl -0x30(%rbp), %r15d
je 0x40715
callq 0xc280
movl -0x2c(%rbp), %ebx
cmpl $0x2, %ebx
jb 0x408e6
decl %ebx
imull %r15d, %ebx
movl 0x18(%r13), %eax
addl 0x8(%r13), %ebx
cmpl %ebx, %eax
jae 0x407b8
movl %eax, %ecx
shrl %ecx
addl %ecx, %ebx
cmpl %ebx, %eax
je 0x407b8
movq (%r13), %rdi
testq %rdi, %rdi
je 0x40768
testl %ebx, %ebx
je 0x4079f
movl %ebx, %esi
shlq $0x2, %rsi
callq 0xc470
testq %rax, %rax
je 0x40936
movq %rax, (%r13)
jmp 0x407b4
testl %ebx, %ebx
je 0x407ac
movl %ebx, %edi
shlq $0x2, %rdi
callq 0xc380
movq %rax, (%r13)
testq %rax, %rax
jne 0x407ac
leaq 0x109e(%rip), %rdi      # 0x41825
leaq 0x1029(%rip), %rsi      # 0x417b7
leaq 0x103a(%rip), %rcx      # 0x417cf
movl $0x38, %edx
callq 0xc180
callq 0xc350
movq $0x0, (%r13)
movl $0x0, 0x8(%r13)
movl %ebx, 0x18(%r13)
movl -0x2c(%rbp), %eax
decl %eax
je 0x408de
movl %r15d, %r14d
cmpl $0x1, %r15d
movl %r15d, %eax
adcl $0x0, %eax
movq %rax, -0x58(%rbp)
leaq -0x78(%rbp), %r8
shlq $0x2, %r14
negq %r14
xorl %ecx, %ecx
movq $0x0, -0x48(%rbp)
movq %r13, -0x50(%rbp)
movq %r14, -0x68(%rbp)
movq %rcx, -0x60(%rbp)
movl %ecx, %eax
shlq $0x2, %rax
movl 0x8(%r13), %ecx
leaq (%rax,%rcx,4), %r15
addq (%r13), %r15
movq -0x58(%rbp), %r13
movl (%r15,%r14), %eax
leal -0x2(%rax), %ecx
cmpl $-0x4, %ecx
ja 0x4089e
movl -0x3c(%rbp), %ecx
testl %ecx, %ecx
jg 0x40830
movl %eax, %edx
shrl %edx
decl %edx
movl %ecx, %esi
negl %esi
cmpl %esi, %edx
jae 0x408a3
testl %ecx, %ecx
jle 0x4083e
movl %eax, %edx
notl %edx
shrl %edx
cmpl %ecx, %edx
jae 0x408a3
movq -0x38(%rbp), %rcx
movq (%rcx), %rax
movq -0x18(%rax), %rbx
addq %rcx, %rbx
movq %r8, -0x88(%rbp)
leaq -0x88(%rbp), %r12
movq %r12, %rdi
leaq 0xd9e5(%rip), %rsi      # 0x4e249
leaq 0xda0a(%rip), %rdx      # 0x4e275
movq %r8, %r14
callq 0x1f29e
movq %rbx, %rdi
movq %r12, %rsi
callq 0x1de0a
movq -0x88(%rbp), %rdi
cmpq %r14, %rdi
movq %r14, %r8
movq -0x68(%rbp), %r14
je 0x408a9
movq %r8, %rbx
callq 0xc280
movq %rbx, %r8
jmp 0x408a9
movl %eax, (%r15)
jmp 0x408a9
leal (%rax,%rcx,2), %eax
movl %eax, (%r15)
addq $0x4, %r15
decq %r13
jne 0x4080b
movq -0x48(%rbp), %rsi
incq %rsi
movl -0x2c(%rbp), %eax
decl %eax
movl -0x30(%rbp), %r15d
movq -0x60(%rbp), %rcx
addl %r15d, %ecx
movq %rsi, -0x48(%rbp)
cmpq %rax, %rsi
movq -0x50(%rbp), %r13
jb 0x407f1
imull %r15d, %eax
addl %eax, 0x8(%r13)
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xd86b(%rip), %rdi      # 0x4e16a
leaq 0xd680(%rip), %rsi      # 0x4df86
leaq 0xd86e(%rip), %rcx      # 0x4e17b
movl $0x15f, %edx            # imm = 0x15F
callq 0xc180
leaq 0xd8ce(%rip), %rdi      # 0x4e1ec
leaq 0xd661(%rip), %rsi      # 0x4df86
leaq 0xd84f(%rip), %rcx      # 0x4e17b
movl $0x160, %edx            # imm = 0x160
callq 0xc180
leaq 0xe66(%rip), %rdi       # 0x417a3
leaq 0xe73(%rip), %rsi       # 0x417b7
leaq 0xe84(%rip), %rcx       # 0x417cf
movl $0x33, %edx
callq 0xc180
movq %rax, %rbx
movq -0xa8(%rbp), %rdi
cmpq %r15, %rdi
jne 0x40975
jmp 0x4097a
movq %rax, %rbx
movq -0x88(%rbp), %rdi
cmpq %r14, %rdi
je 0x4097a
callq 0xc280
movq %rbx, %rdi
callq 0xc4e0