// File: /workspace/github_cpp_makefile_star2_O1/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 $0xc8, %rsp
movq %rsi, %rbx
movq 0x18(%rsi), %r15
addq $0x8, %rbx
cmpq %rbx, %r15
je 0x205e6
movq %rdi, %r14
leaq 0x20(%r15), %r13
cmpq $0x0, 0x28(%r15)
je 0x20559
movq (%r13), %rax
movsbl (%rax), %eax
addl $-0x30, %eax
cmpl $0x9, %eax
ja 0x20559
cmpl $0x1, 0x40(%r15)
jne 0x205b0
cmpl $0x0, 0x60(%r15)
jne 0x205b0
leaq 0x40(%r15), %r12
movq (%r13), %rdx
leaq -0x48(%rbp), %r13
movq %r13, %rdi
movq %r14, %rsi
callq 0x202df
movq %r12, %rdi
movq %r13, %rsi
callq 0x201e6
cmpl $0x0, -0x30(%rbp)
je 0x205b0
movq -0x48(%rbp), %rdi
testq %rdi, %rdi
je 0x2054f
callq 0xc350
movq $0x0, -0x48(%rbp)
xorl %eax, %eax
movl %eax, -0x40(%rbp)
movl %eax, -0x30(%rbp)
jmp 0x205b0
movq %r14, %rdi
callq 0x3ce9e
movq %rax, %rdi
movq %r13, %rsi
callq 0x2deda
movq %rax, %r12
movq %r14, %rdi
callq 0x3ce9e
addq $0x8, %rax
cmpq %rax, %r12
je 0x20587
cmpb $0x1, 0x78(%r15)
jne 0x205c6
cmpl $0x0, 0x40(%r15)
jne 0x206dd
cmpl $0x0, 0x48(%r15)
jne 0x205f8
cmpl $0x0, 0x50(%r15)
jne 0x205f8
movq 0x20(%r15), %rsi
leaq 0x58(%r15), %rdx
movq %r14, %rdi
callq 0x3cea8
movq %r15, %rdi
callq 0xc1b0
movq %rax, %r15
cmpq %rbx, %rax
jne 0x204e1
jmp 0x205e6
cmpl $0x1, 0x40(%r15)
jne 0x205b0
cmpl $0x0, 0x60(%r15)
jne 0x205b0
leaq 0x40(%r15), %rdi
addq $0x40, %r12
movq %r12, %rsi
callq 0x201e6
jmp 0x205b0
addq $0xc8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x10, %edi
callq 0xc130
movq %rax, %r14
leaq -0x98(%rbp), %r15
movq %r15, -0x10(%r15)
leaq 0x2c4c3(%rip), %rsi     # 0x4cada
leaq 0x2c4bd(%rip), %rdx     # 0x4cadb
leaq -0xa8(%rbp), %rdi
callq 0x1f29e
leaq -0xc8(%rbp), %rdi
leaq -0xa8(%rbp), %rsi
movq %r13, %rdx
callq 0x22f08
leaq -0x78(%rbp), %r12
movq %r12, -0x10(%r12)
leaq 0x27dfa(%rip), %rsi     # 0x4844a
leaq 0x27df5(%rip), %rdx     # 0x4844c
leaq -0x88(%rbp), %rdi
callq 0x1f29e
leaq -0xe8(%rbp), %rdi
leaq -0xc8(%rbp), %rsi
leaq -0x88(%rbp), %rdx
callq 0x22e56
leaq -0x58(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0x27ec8(%rip), %rsi     # 0x48554
leaq 0x27efc(%rip), %rdx     # 0x4858f
leaq -0x68(%rbp), %rdi
callq 0x1f29e
leaq -0x48(%rbp), %rdi
leaq -0xe8(%rbp), %rsi
leaq -0x68(%rbp), %rdx
callq 0x22e56
movb $0x1, %r13b
leaq -0x48(%rbp), %rsi
movq %r14, %rdi
callq 0xc4d0
xorl %r13d, %r13d
movq 0x3e907(%rip), %rsi     # 0x5efd0
movq 0x3e8e8(%rip), %rdx     # 0x5efb8
movq %r14, %rdi
callq 0xc4b0
jmp 0x207bd
movl $0x10, %edi
callq 0xc130
movq %rax, %r14
leaq -0x98(%rbp), %r15
movq %r15, -0x10(%r15)
leaq 0x2c3de(%rip), %rsi     # 0x4cada
leaq 0x2c3d8(%rip), %rdx     # 0x4cadb
leaq -0xa8(%rbp), %rdi
callq 0x1f29e
leaq -0xc8(%rbp), %rdi
leaq -0xa8(%rbp), %rsi
movq %r13, %rdx
callq 0x22f08
leaq -0x78(%rbp), %r12
movq %r12, -0x10(%r12)
leaq 0x27d15(%rip), %rsi     # 0x4844a
leaq 0x27d10(%rip), %rdx     # 0x4844c
leaq -0x88(%rbp), %rdi
callq 0x1f29e
leaq -0xe8(%rbp), %rdi
leaq -0xc8(%rbp), %rsi
leaq -0x88(%rbp), %rdx
callq 0x22e56
leaq -0x58(%rbp), %rax
movq %rax, -0x10(%rax)
leaq 0x27d9e(%rip), %rsi     # 0x4850f
leaq 0x27ddb(%rip), %rdx     # 0x48553
leaq -0x68(%rbp), %rdi
callq 0x1f29e
leaq -0x48(%rbp), %rdi
leaq -0xe8(%rbp), %rsi
leaq -0x68(%rbp), %rdx
callq 0x22e56
movb $0x1, %r13b
leaq -0x48(%rbp), %rsi
movq %r14, %rdi
callq 0xc4d0
xorl %r13d, %r13d
movq 0x3e822(%rip), %rsi     # 0x5efd0
movq 0x3e803(%rip), %rdx     # 0x5efb8
movq %r14, %rdi
callq 0xc4b0
jmp 0x207c1
jmp 0x207d8
movq %rax, %rbx
leaq -0x38(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x207de
callq 0xc280
jmp 0x207de
movq %rax, %rbx
movb $0x1, %r13b
movq -0x68(%rbp), %rdi
leaq -0x58(%rbp), %rax
cmpq %rax, %rdi
je 0x207fa
callq 0xc280
jmp 0x207fa
jmp 0x207f4
movq %rax, %rbx
movb $0x1, %r13b
leaq -0xd8(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x20831
callq 0xc280
jmp 0x20831
jmp 0x2082b
movq %rax, %rbx
cmpl $0x0, -0x30(%rbp)
je 0x20893
leaq -0x30(%rbp), %rsi
leaq -0x48(%rbp), %rdi
callq 0xc640
jmp 0x20893
movq %rax, %rbx
movb $0x1, %r13b
movq -0x88(%rbp), %rdi
cmpq %r12, %rdi
je 0x2084c
callq 0xc280
jmp 0x2084c
jmp 0x20846
movq %rax, %rbx
movb $0x1, %r13b
leaq -0xb8(%rbp), %rax
movq -0x10(%rax), %rdi
cmpq %rax, %rdi
je 0x2086b
callq 0xc280
jmp 0x2086b
jmp 0x20865
movq %rax, %rbx
movb $0x1, %r13b
movq -0xa8(%rbp), %rdi
cmpq %r15, %rdi
je 0x20886
callq 0xc280
jmp 0x20886
jmp 0x20880
movq %rax, %rbx
movb $0x1, %r13b
testb %r13b, %r13b
je 0x20893
movq %r14, %rdi
callq 0xc1e0
movq %rbx, %rdi
callq 0xc4e0