// File: 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
subq $0xd0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0xa0(%rbp)
cmpl $0x0, -0x14(%rbp)
jbe 0x5a569
jmp 0x5a588
leaq 0xe1e2(%rip), %rdi      # 0x68752
leaq 0xdff7(%rip), %rsi      # 0x6856e
movl $0x15f, %edx            # imm = 0x15F
leaq 0xe1e0(%rip), %rcx      # 0x68763
callq 0xd1c0
movq -0x10(%rbp), %rax
movl 0x8(%rax), %eax
cmpl -0x14(%rbp), %eax
jb 0x5a596
jmp 0x5a5b5
leaq 0xe237(%rip), %rdi      # 0x687d4
leaq 0xdfca(%rip), %rsi      # 0x6856e
movl $0x160, %edx            # imm = 0x160
leaq 0xe1b3(%rip), %rcx      # 0x68763
callq 0xd1c0
movq -0xa0(%rbp), %rdi
movl $0x1, -0x18(%rbp)
movl $0x0, -0x1c(%rbp)
leaq -0x18(%rbp), %rsi
leaq -0x1c(%rbp), %rdx
callq 0x5a990
cmpl $0x0, -0x1c(%rbp)
je 0x5a72e
movb $0x1, -0x1d(%rbp)
movl $0x0, -0x24(%rbp)
movl -0x24(%rbp), %ecx
xorl %eax, %eax
cmpl -0x14(%rbp), %ecx
movb %al, -0xa1(%rbp)
jae 0x5a605
movb -0x1d(%rbp), %al
movb %al, -0xa1(%rbp)
movb -0xa1(%rbp), %al
testb $0x1, %al
jne 0x5a611
jmp 0x5a68a
movq -0x10(%rbp), %rax
movq (%rax), %rcx
movq -0x10(%rbp), %rax
movl 0x8(%rax), %eax
subl -0x24(%rbp), %eax
subl $0x1, %eax
movl %eax, %eax
movl %eax, %edx
xorl %eax, %eax
cmpl $0x1, (%rcx,%rdx,4)
movb %al, -0xa2(%rbp)
jbe 0x5a65a
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq -0x10(%rbp), %rcx
movl 0x8(%rcx), %ecx
subl -0x24(%rbp), %ecx
subl $0x1, %ecx
movl %ecx, %ecx
cmpl $-0x2, (%rax,%rcx,4)
setbe %al
movb %al, -0xa2(%rbp)
movb -0xa2(%rbp), %al
xorb $-0x1, %al
andb $0x1, %al
movzbl %al, %ecx
movb -0x1d(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
andl %ecx, %eax
cmpl $0x0, %eax
setne %al
andb $0x1, %al
movb %al, -0x1d(%rbp)
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x5a5ec
testb $0x1, -0x1d(%rbp)
je 0x5a72c
movq -0xa0(%rbp), %rax
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
addq %rcx, %rax
movq %rax, -0xb8(%rbp)
leaq -0x49(%rbp), %rdi
movq %rdi, -0xb0(%rbp)
callq 0xd5b0
movq -0xb0(%rbp), %rdx
leaq 0xe126(%rip), %rsi      # 0x687f0
leaq -0x48(%rbp), %rdi
callq 0xd440
jmp 0x5a6d5
movq -0xb8(%rbp), %rdi
leaq -0x48(%rbp), %rsi
callq 0x262a0
jmp 0x5a6e7
leaq -0x48(%rbp), %rdi
callq 0xd1b0
leaq -0x49(%rbp), %rdi
callq 0xd370
jmp 0x5a72c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x5a71e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x48(%rbp), %rdi
callq 0xd1b0
leaq -0x49(%rbp), %rdi
callq 0xd370
jmp 0x5a95e
jmp 0x5a72e
cmpl $0x1, -0x18(%rbp)
jbe 0x5a955
movq -0x10(%rbp), %rdi
movl -0x18(%rbp), %esi
subl $0x1, %esi
imull -0x14(%rbp), %esi
callq 0x13d70
movl $0x0, -0x60(%rbp)
movl -0x60(%rbp), %eax
movl -0x18(%rbp), %ecx
subl $0x1, %ecx
cmpl %ecx, %eax
jae 0x5a941
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq -0x10(%rbp), %rcx
movl 0x8(%rcx), %ecx
shlq $0x2, %rcx
addq %rcx, %rax
movl -0x60(%rbp), %ecx
imull -0x14(%rbp), %ecx
movl %ecx, %ecx
shlq $0x2, %rcx
addq %rcx, %rax
movq %rax, -0x68(%rbp)
movl $0x0, -0x6c(%rbp)
movl -0x6c(%rbp), %eax
cmpl -0x14(%rbp), %eax
jae 0x5a927
movq -0x68(%rbp), %rax
movslq -0x6c(%rbp), %rcx
shlq $0x2, %rcx
addq %rcx, %rax
movl -0x14(%rbp), %ecx
movl %ecx, %edx
xorl %ecx, %ecx
subq %rdx, %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x70(%rbp)
xorl %eax, %eax
cmpl $0x1, -0x70(%rbp)
movb %al, -0xb9(%rbp)
jbe 0x5a7d9
cmpl $-0x2, -0x70(%rbp)
setbe %al
movb %al, -0xb9(%rbp)
movb -0xb9(%rbp), %al
testb $0x1, %al
jne 0x5a7e8
jmp 0x5a909
xorl %eax, %eax
cmpl $0x1, -0x70(%rbp)
movb %al, -0xba(%rbp)
jbe 0x5a803
cmpl $-0x2, -0x70(%rbp)
setbe %al
movb %al, -0xba(%rbp)
movb -0xba(%rbp), %al
testb $0x1, %al
jne 0x5a80f
jmp 0x5a85d
cmpl $0x0, -0x1c(%rbp)
jg 0x5a829
movl -0x70(%rbp), %eax
shrl %eax
subl $0x1, %eax
subl $0x0, %eax
xorl %ecx, %ecx
subl -0x1c(%rbp), %ecx
cmpl %ecx, %eax
jae 0x5a843
cmpl $0x0, -0x1c(%rbp)
jle 0x5a85d
movl -0x70(%rbp), %ecx
shrl %ecx
subl $0x1, %ecx
movl $0x7ffffffe, %eax       # imm = 0x7FFFFFFE
subl %ecx, %eax
cmpl -0x1c(%rbp), %eax
jb 0x5a85d
movl -0x70(%rbp), %edx
movl -0x1c(%rbp), %eax
shll %eax
addl %eax, %edx
movq -0x68(%rbp), %rax
movslq -0x6c(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
jmp 0x5a907
movq -0xa0(%rbp), %rax
movq (%rax), %rcx
movq -0x18(%rcx), %rcx
addq %rcx, %rax
movq %rax, -0xd0(%rbp)
leaq -0x91(%rbp), %rdi
movq %rdi, -0xc8(%rbp)
callq 0xd5b0
movq -0xc8(%rbp), %rdx
leaq 0xdf9b(%rip), %rsi      # 0x68831
leaq -0x90(%rbp), %rdi
callq 0xd440
jmp 0x5a8a4
movq -0xd0(%rbp), %rdi
leaq -0x90(%rbp), %rsi
callq 0x262a0
jmp 0x5a8b9
leaq -0x90(%rbp), %rdi
callq 0xd1b0
leaq -0x91(%rbp), %rdi
callq 0xd370
jmp 0x5a907
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
jmp 0x5a8f9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x58(%rbp)
movl %eax, -0x5c(%rbp)
leaq -0x90(%rbp), %rdi
callq 0xd1b0
leaq -0x91(%rbp), %rdi
callq 0xd370
jmp 0x5a95e
jmp 0x5a917
movl -0x70(%rbp), %edx
movq -0x68(%rbp), %rax
movslq -0x6c(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
jmp 0x5a919
movl -0x6c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x6c(%rbp)
jmp 0x5a793
movq -0x68(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x68(%rbp)
movl -0x60(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x60(%rbp)
jmp 0x5a752
movl -0x18(%rbp), %ecx
subl $0x1, %ecx
imull -0x14(%rbp), %ecx
movq -0x10(%rbp), %rax
addl 0x8(%rax), %ecx
movl %ecx, 0x8(%rax)
addq $0xd0, %rsp
popq %rbp
retq
movq -0x58(%rbp), %rdi
callq 0xd5a0
nopw (%rax,%rax)