// File: /workspace/github_cpp_makefile_star2_O3/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 0x3e8fd
movl %edx, %r15d
movq %rsi, %r12
cmpl %edx, 0x8(%rsi)
jb 0x3e91c
leaq -0x2c(%rbp), %rsi
movl $0x1, (%rsi)
leaq -0x3c(%rbp), %r14
movl $0x0, (%r14)
movq -0x38(%rbp), %rdi
movq %r14, %rdx
callq 0x3e988
cmpl $0x0, (%r14)
movl %r15d, %r13d
movl %r15d, -0x30(%rbp)
je 0x3e71e
movq (%r12), %rax
movl 0x8(%r12), %ecx
decl %ecx
movl $0x1, %edx
movl %ecx, %esi
movl (%rax,%rsi,4), %esi
incl %esi
cmpq %r13, %rdx
jae 0x3e6bd
decl %ecx
incq %rdx
cmpl $0x3, %esi
jb 0x3e6a7
cmpl $0x3, %esi
jae 0x3e71e
movq %r12, %rbx
movq -0x38(%rbp), %rcx
movq (%rcx), %rax
leaq -0x98(%rbp), %r15
movq -0x18(%rax), %r14
addq %rcx, %r14
movq %r15, -0x10(%r15)
leaq 0xda23(%rip), %rsi      # 0x4c108
leaq 0xda5c(%rip), %rdx      # 0x4c148
leaq -0xa8(%rbp), %r12
movq %r12, %rdi
callq 0x1dab2
movq %r14, %rdi
movq %r12, %rsi
callq 0x1c690
movq -0xa8(%rbp), %rdi
cmpq %r15, %rdi
movq %rbx, %r12
movl -0x30(%rbp), %r15d
je 0x3e71e
callq 0xb280
movl -0x2c(%rbp), %ebx
cmpl $0x2, %ebx
jb 0x3e8eb
movq %r13, -0x48(%rbp)
decl %ebx
imull %r15d, %ebx
movl 0x18(%r12), %eax
addl 0x8(%r12), %ebx
cmpl %ebx, %eax
jae 0x3e7d9
movl %eax, %ecx
shrl %ecx
addl %ecx, %ebx
cmpl %ebx, %eax
je 0x3e7d9
movq (%r12), %rdi
testq %rdi, %rdi
je 0x3e77b
testl %ebx, %ebx
je 0x3e7b2
movl %ebx, %esi
shlq $0x2, %rsi
callq 0xb470
testq %rax, %rax
je 0x3e93b
movq %rax, (%r12)
jmp 0x3e7c8
testl %ebx, %ebx
je 0x3e7bf
movl %ebx, %edi
shlq $0x2, %rdi
callq 0xb380
movq %rax, (%r12)
testq %rax, %rax
jne 0x3e7bf
leaq 0x1077(%rip), %rdi      # 0x3f811
leaq 0x1002(%rip), %rsi      # 0x3f7a3
leaq 0x1013(%rip), %rcx      # 0x3f7bb
movl $0x38, %edx
callq 0xb180
callq 0xb350
movq $0x0, (%r12)
movl $0x0, 0x8(%r12)
movl %ebx, 0x18(%r12)
xorl %eax, %eax
cmpl $0x1, -0x2c(%rbp)
je 0x3e8e2
leaq -0x78(%rbp), %r8
movq -0x48(%rbp), %rax
leaq (,%rax,4), %r14
negq %r14
xorl %ecx, %ecx
movq $0x0, -0x50(%rbp)
movq %r12, -0x58(%rbp)
movq %r14, -0x68(%rbp)
movq %rcx, -0x60(%rbp)
movl %ecx, %eax
shlq $0x2, %rax
movl 0x8(%r12), %ecx
leaq (%rax,%rcx,4), %r15
addq (%r12), %r15
movq -0x48(%rbp), %r12
movl (%r15,%r14), %eax
leal -0x2(%rax), %ecx
cmpl $-0x4, %ecx
ja 0x3e896
movl -0x3c(%rbp), %ecx
movl %eax, %edx
testl %ecx, %ecx
jle 0x3e89b
notl %edx
shrl %edx
cmpl %ecx, %edx
jae 0x3e8a7
movq -0x38(%rbp), %rcx
movq (%rcx), %rax
movq -0x18(%rax), %rbx
addq %rcx, %rbx
movq %r8, -0x88(%rbp)
leaq -0x88(%rbp), %r13
movq %r13, %rdi
leaq 0xd8ed(%rip), %rsi      # 0x4c149
leaq 0xd912(%rip), %rdx      # 0x4c175
movq %r8, %r14
callq 0x1dab2
movq %rbx, %rdi
movq %r13, %rsi
callq 0x1c690
movq -0x88(%rbp), %rdi
cmpq %r14, %rdi
movq %r14, %r8
movq -0x68(%rbp), %r14
je 0x3e8ad
movq %r8, %rbx
callq 0xb280
movq %rbx, %r8
jmp 0x3e8ad
movl %eax, (%r15)
jmp 0x3e8ad
shrl %edx
decl %edx
movl %ecx, %esi
negl %esi
cmpl %esi, %edx
jb 0x3e836
leal (%rax,%rcx,2), %eax
movl %eax, (%r15)
addq $0x4, %r15
decq %r12
jne 0x3e819
movq -0x50(%rbp), %rsi
incq %rsi
movl -0x2c(%rbp), %eax
decl %eax
movl -0x30(%rbp), %r15d
movq -0x60(%rbp), %rcx
addl %r15d, %ecx
movq %rsi, -0x50(%rbp)
cmpq %rax, %rsi
movq -0x58(%rbp), %r12
jb 0x3e7fe
imull %r15d, %eax
addl %eax, 0x8(%r12)
addq $0x88, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xd766(%rip), %rdi      # 0x4c06a
leaq 0xd57b(%rip), %rsi      # 0x4be86
leaq 0xd769(%rip), %rcx      # 0x4c07b
movl $0x15f, %edx            # imm = 0x15F
callq 0xb180
leaq 0xd7c9(%rip), %rdi      # 0x4c0ec
leaq 0xd55c(%rip), %rsi      # 0x4be86
leaq 0xd74a(%rip), %rcx      # 0x4c07b
movl $0x160, %edx            # imm = 0x160
callq 0xb180
leaq 0x2935(%rip), %rdi      # 0x41277
leaq 0xe5a(%rip), %rsi       # 0x3f7a3
leaq 0xe6b(%rip), %rcx       # 0x3f7bb
movl $0x33, %edx
callq 0xb180
movq %rax, %rbx
movq -0xa8(%rbp), %rdi
cmpq %r15, %rdi
jne 0x3e97a
jmp 0x3e97f
movq %rax, %rbx
movq -0x88(%rbp), %rdi
cmpq %r14, %rdi
je 0x3e97f
callq 0xb280
movq %rbx, %rdi
callq 0xb4e0
nop