// File: /workspace/github_cpp_makefile_star2_O2/vsklad[P]cgen/commands.cpp
// Function: variables_define(bal::Formula&, std::map<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, CGenVariableInfo, std::less<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>>, std::allocator<std::pair<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const, CGenVariableInfo>>>&)
void variables_define(bal::Formula& formula, CGenVariablesMap& variables_map) {
    for (auto it = variables_map.begin(); it != variables_map.end(); it++ ) {
        if (is_binary_variable_name(it->first)) {
            if (it->second.mode == vmRandom && it->second.data.size() == 0) {
                variable_define_random(it->second, variable_get_template(formula, it->first.c_str()));
            };
        } else {
            auto vn_it = formula.get_named_variables().find(it->first);
            if (vn_it == formula.get_named_variables().end() || it->second.replace_existing) {
                if (it->second.mode != vmValue) {
                    throw std::invalid_argument(std::string("\"") + it->first + std::string("\" ") +
                                                std::string(ERROR_VARIABLE_DEFINITION_MODE));
                };
                if (it->second.except_count > 0 || it->second.except_range_size > 0) {
                    throw std::invalid_argument(std::string("\"") + it->first + std::string("\" ") +
                                                std::string(ERROR_VARIABLE_DEFINITION_EXCEPT));
                };
                formula.add_named_variable(it->first.c_str(), it->second.data);
            } else if (it->second.mode == vmRandom && it->second.data.size() == 0) {
                variable_define_random(it->second, vn_it->second);
            };
        };
    };
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xd8, %rsp
movq %rdi, %r14
movq 0x18(%rsi), %r15
addq $0x8, %rsi
movq %rsi, -0x38(%rbp)
leaq -0x58(%rbp), %r13
cmpq -0x38(%rbp), %r15
je 0x1a8f3
leaq 0x20(%r15), %rbx
cmpq $0x0, 0x28(%r15)
je 0x1a86c
movq (%rbx), %rdx
movsbl (%rdx), %eax
addl $-0x30, %eax
cmpl $0x9, %eax
ja 0x1a86c
cmpl $0x1, 0x40(%r15)
jne 0x1a8c3
cmpl $0x0, 0x60(%r15)
jne 0x1a8c3
leaq 0x40(%r15), %r12
movq %r13, %rdi
movq %r14, %rsi
callq 0x1a675
movq %r12, %rdi
movq %r13, %rsi
callq 0x1a597
movq %r13, %rdi
callq 0xde58
jmp 0x1a8c3
movq %r14, %rdi
callq 0x2e0f8
movq %rax, %rdi
movq %rbx, %rsi
callq 0x237da
movq %rax, %r12
movq %r14, %rdi
callq 0x2e0f8
addq $0x8, %rax
cmpq %rax, %r12
je 0x1a89a
cmpb $0x1, 0x78(%r15)
jne 0x1a8d3
cmpl $0x0, 0x40(%r15)
jne 0x1a9c3
cmpl $0x0, 0x48(%r15)
jne 0x1a905
cmpl $0x0, 0x50(%r15)
jne 0x1a905
movq 0x20(%r15), %rsi
leaq 0x58(%r15), %rdx
movq %r14, %rdi
callq 0x2e102
movq %r15, %rdi
callq 0xc1b0
movq %rax, %r15
jmp 0x1a813
cmpl $0x1, 0x40(%r15)
jne 0x1a8c3
cmpl $0x0, 0x60(%r15)
jne 0x1a8c3
leaq 0x40(%r15), %rdi
addq $0x40, %r12
movq %r12, %rsi
callq 0x1a597
jmp 0x1a8c3
addq $0xd8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
pushq $0x10
popq %rdi
callq 0xc130
movq %rax, %r12
leaq 0x222cc(%rip), %rsi     # 0x3cbe3
leaq -0xb8(%rbp), %rdi
leaq -0x2b(%rbp), %rdx
callq 0xc0e0
leaq -0xd8(%rbp), %rdi
leaq -0xb8(%rbp), %rsi
movq %rbx, %rdx
callq 0x1c3a5
leaq 0x1da56(%rip), %rsi     # 0x3839a
leaq -0x98(%rbp), %rdi
leaq -0x2a(%rbp), %rdx
callq 0xc0e0
leaq -0xf8(%rbp), %rdi
leaq -0xd8(%rbp), %rsi
leaq -0x98(%rbp), %rdx
callq 0x195f2
leaq 0x1db2f(%rip), %rsi     # 0x384a4
leaq -0x78(%rbp), %rdi
leaq -0x29(%rbp), %rdx
callq 0xc0e0
leaq -0x58(%rbp), %rdi
leaq -0xf8(%rbp), %rsi
leaq -0x78(%rbp), %rdx
callq 0x195f2
movb $0x1, %r15b
leaq -0x58(%rbp), %rsi
movq %r12, %rdi
callq 0xc4b0
xorl %r15d, %r15d
movq 0x36629(%rip), %rsi     # 0x50fd8
movq 0x3660a(%rip), %rdx     # 0x50fc0
movq %r12, %rdi
callq 0xc490
jmp 0x1aa7c
pushq $0x10
popq %rdi
callq 0xc130
movq %rax, %r12
leaq 0x2220e(%rip), %rsi     # 0x3cbe3
leaq -0xb8(%rbp), %rdi
leaq -0x2b(%rbp), %rdx
callq 0xc0e0
leaq -0xd8(%rbp), %rdi
leaq -0xb8(%rbp), %rsi
movq %rbx, %rdx
callq 0x1c3a5
leaq 0x1d998(%rip), %rsi     # 0x3839a
leaq -0x98(%rbp), %rdi
leaq -0x2a(%rbp), %rdx
callq 0xc0e0
leaq -0xf8(%rbp), %rdi
leaq -0xd8(%rbp), %rsi
leaq -0x98(%rbp), %rdx
callq 0x195f2
leaq 0x1da2c(%rip), %rsi     # 0x3845f
leaq -0x78(%rbp), %rdi
leaq -0x29(%rbp), %rdx
callq 0xc0e0
leaq -0x58(%rbp), %rdi
leaq -0xf8(%rbp), %rsi
leaq -0x78(%rbp), %rdx
callq 0x195f2
movb $0x1, %r15b
leaq -0x58(%rbp), %rsi
movq %r12, %rdi
callq 0xc4b0
xorl %r15d, %r15d
movq 0x3656b(%rip), %rsi     # 0x50fd8
movq 0x3654c(%rip), %rdx     # 0x50fc0
movq %r12, %rdi
callq 0xc490
jmp 0x1aa80
jmp 0x1aa8e
movq %rax, %r14
leaq -0x58(%rbp), %rdi
callq 0xc110
jmp 0x1aa94
movq %rax, %r14
movb $0x1, %r15b
leaq -0x78(%rbp), %rdi
callq 0xc110
jmp 0x1aaa7
jmp 0x1aaa1
movq %rax, %r14
movb $0x1, %r15b
leaq -0xf8(%rbp), %rdi
callq 0xc110
jmp 0x1aacb
jmp 0x1aac5
movq %rax, %r14
leaq -0x58(%rbp), %rdi
callq 0xde58
jmp 0x1ab17
movq %rax, %r14
movb $0x1, %r15b
leaq -0x98(%rbp), %rdi
callq 0xc110
jmp 0x1aae1
jmp 0x1aadb
movq %rax, %r14
movb $0x1, %r15b
leaq -0xd8(%rbp), %rdi
callq 0xc110
jmp 0x1aaf7
jmp 0x1aaf1
movq %rax, %r14
movb $0x1, %r15b
leaq -0xb8(%rbp), %rdi
callq 0xc110
testb %r15b, %r15b
jne 0x1ab0f
jmp 0x1ab17
jmp 0x1ab0c
movq %rax, %r14
movq %r12, %rdi
callq 0xc1d0
movq %r14, %rdi
callq 0xc4c0