// File: 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
subq $0x2a0, %rsp            # imm = 0x2A0
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
callq 0x2e0b0
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rdi
callq 0x2e110
movq %rax, -0x20(%rbp)
leaq -0x18(%rbp), %rdi
leaq -0x20(%rbp), %rsi
callq 0x2e0e0
testb $0x1, %al
jne 0x2a813
jmp 0x2aeb3
leaq -0x18(%rbp), %rdi
callq 0x26cf0
movq %rax, %rdi
callq 0x26c60
testb $0x1, %al
jne 0x2a82d
jmp 0x2a8f5
leaq -0x18(%rbp), %rdi
callq 0x26cf0
cmpl $0x1, 0x20(%rax)
jne 0x2a8f0
leaq -0x18(%rbp), %rdi
callq 0x26cf0
movq %rax, %rdi
addq $0x20, %rdi
addq $0x18, %rdi
callq 0x102f0
cmpl $0x0, %eax
jne 0x2a8f0
leaq -0x18(%rbp), %rdi
movq %rdi, -0x238(%rbp)
callq 0x26cf0
movq -0x238(%rbp), %rdi
addq $0x20, %rax
movq %rax, -0x228(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x230(%rbp)
callq 0x26cf0
movq %rax, %rdi
callq 0xd120
movq -0x230(%rbp), %rsi
movq %rax, %rdx
leaq -0x40(%rbp), %rdi
movq %rdi, -0x220(%rbp)
callq 0x2a470
movq -0x228(%rbp), %rdi
movq -0x220(%rbp), %rsi
callq 0x2a2e0
jmp 0x2a8cb
leaq -0x40(%rbp), %rdi
callq 0x10850
jmp 0x2a8f0
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x10850
jmp 0x2aebc
jmp 0x2ae9a
movq -0x8(%rbp), %rdi
callq 0x54e00
movq %rax, -0x248(%rbp)
leaq -0x18(%rbp), %rdi
callq 0x26cf0
movq -0x248(%rbp), %rdi
movq %rax, %rsi
callq 0x2ddb0
movq %rax, -0x58(%rbp)
movq -0x8(%rbp), %rdi
callq 0x54e00
movq %rax, %rdi
callq 0x2de10
movq %rax, -0x60(%rbp)
leaq -0x58(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0x2dde0
movb %al, %cl
movb $0x1, %al
testb $0x1, %cl
movb %al, -0x239(%rbp)
jne 0x2a964
leaq -0x18(%rbp), %rdi
callq 0x26cf0
movb 0x58(%rax), %al
movb %al, -0x239(%rbp)
movb -0x239(%rbp), %al
testb $0x1, %al
jne 0x2a973
jmp 0x2ae39
leaq -0x18(%rbp), %rdi
callq 0x26cf0
cmpl $0x0, 0x20(%rax)
je 0x2aba4
movb $0x1, -0x132(%rbp)
movl $0x10, %edi
callq 0xd150
movq %rax, -0x258(%rbp)
leaq -0xe1(%rbp), %rdi
movq %rdi, -0x250(%rbp)
callq 0xd5b0
movq -0x250(%rbp), %rdx
leaq 0x3c717(%rip), %rsi     # 0x670d6
leaq -0xe0(%rbp), %rdi
callq 0xd440
jmp 0x2a9cd
leaq -0x18(%rbp), %rdi
callq 0x26cf0
movq %rax, %rdx
leaq -0xc0(%rbp), %rdi
leaq -0xe0(%rbp), %rsi
callq 0x2de40
jmp 0x2a9ee
leaq -0x109(%rbp), %rdi
movq %rdi, -0x260(%rbp)
callq 0xd5b0
movq -0x260(%rbp), %rdx
leaq 0x37a37(%rip), %rsi     # 0x62446
leaq -0x108(%rbp), %rdi
callq 0xd440
jmp 0x2aa1d
leaq -0xa0(%rbp), %rdi
leaq -0xc0(%rbp), %rsi
leaq -0x108(%rbp), %rdx
callq 0x28080
jmp 0x2aa39
leaq -0x131(%rbp), %rdi
movq %rdi, -0x268(%rbp)
callq 0xd5b0
movq -0x268(%rbp), %rdx
leaq 0x37ab1(%rip), %rsi     # 0x6250b
leaq -0x130(%rbp), %rdi
callq 0xd440
jmp 0x2aa68
leaq -0x80(%rbp), %rdi
leaq -0xa0(%rbp), %rsi
leaq -0x130(%rbp), %rdx
callq 0x28080
jmp 0x2aa81
movq -0x258(%rbp), %rdi
leaq -0x80(%rbp), %rsi
callq 0xd590
jmp 0x2aa93
movq -0x258(%rbp), %rdi
movb $0x0, -0x132(%rbp)
movq 0x58530(%rip), %rsi     # 0x82fd8
movq 0x58511(%rip), %rdx     # 0x82fc0
callq 0xd570
jmp 0x2aec5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x2ab7c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x2ab70
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x2ab58
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x2ab4c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x2ab34
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x2ab28
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x80(%rbp), %rdi
callq 0xd1b0
leaq -0x130(%rbp), %rdi
callq 0xd1b0
leaq -0x131(%rbp), %rdi
callq 0xd370
leaq -0xa0(%rbp), %rdi
callq 0xd1b0
leaq -0x108(%rbp), %rdi
callq 0xd1b0
leaq -0x109(%rbp), %rdi
callq 0xd370
leaq -0xc0(%rbp), %rdi
callq 0xd1b0
leaq -0xe0(%rbp), %rdi
callq 0xd1b0
leaq -0xe1(%rbp), %rdi
callq 0xd370
testb $0x1, -0x132(%rbp)
jne 0x2ab93
jmp 0x2ab9f
movq -0x258(%rbp), %rdi
callq 0xd210
jmp 0x2aebc
leaq -0x18(%rbp), %rdi
callq 0x26cf0
cmpl $0x0, 0x28(%rax)
ja 0x2abc6
leaq -0x18(%rbp), %rdi
callq 0x26cf0
cmpl $0x0, 0x30(%rax)
jbe 0x2aded
movb $0x1, -0x20a(%rbp)
movl $0x10, %edi
callq 0xd150
movq %rax, -0x278(%rbp)
leaq -0x1b9(%rbp), %rdi
movq %rdi, -0x270(%rbp)
callq 0xd5b0
movq -0x270(%rbp), %rdx
leaq 0x3c4d7(%rip), %rsi     # 0x670d6
leaq -0x1b8(%rbp), %rdi
callq 0xd440
jmp 0x2ac0d
leaq -0x18(%rbp), %rdi
callq 0x26cf0
movq %rax, %rdx
leaq -0x198(%rbp), %rdi
leaq -0x1b8(%rbp), %rsi
callq 0x2de40
jmp 0x2ac2e
leaq -0x1e1(%rbp), %rdi
movq %rdi, -0x280(%rbp)
callq 0xd5b0
movq -0x280(%rbp), %rdx
leaq 0x377f7(%rip), %rsi     # 0x62446
leaq -0x1e0(%rbp), %rdi
callq 0xd440
jmp 0x2ac5d
leaq -0x178(%rbp), %rdi
leaq -0x198(%rbp), %rsi
leaq -0x1e0(%rbp), %rdx
callq 0x28080
jmp 0x2ac79
leaq -0x209(%rbp), %rdi
movq %rdi, -0x288(%rbp)
callq 0xd5b0
movq -0x288(%rbp), %rdx
leaq 0x378b6(%rip), %rsi     # 0x62550
leaq -0x208(%rbp), %rdi
callq 0xd440
jmp 0x2aca8
leaq -0x158(%rbp), %rdi
leaq -0x178(%rbp), %rsi
leaq -0x208(%rbp), %rdx
callq 0x28080
jmp 0x2acc4
movq -0x278(%rbp), %rdi
leaq -0x158(%rbp), %rsi
callq 0xd590
jmp 0x2acd9
movq -0x278(%rbp), %rdi
movb $0x0, -0x20a(%rbp)
movq 0x582ea(%rip), %rsi     # 0x82fd8
movq 0x582cb(%rip), %rdx     # 0x82fc0
callq 0xd570
jmp 0x2aec5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x2adc5
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x2adb9
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x2ada1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x2ad95
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x2ad7d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x2ad71
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x158(%rbp), %rdi
callq 0xd1b0
leaq -0x208(%rbp), %rdi
callq 0xd1b0
leaq -0x209(%rbp), %rdi
callq 0xd370
leaq -0x178(%rbp), %rdi
callq 0xd1b0
leaq -0x1e0(%rbp), %rdi
callq 0xd1b0
leaq -0x1e1(%rbp), %rdi
callq 0xd370
leaq -0x198(%rbp), %rdi
callq 0xd1b0
leaq -0x1b8(%rbp), %rdi
callq 0xd1b0
leaq -0x1b9(%rbp), %rdi
callq 0xd370
testb $0x1, -0x20a(%rbp)
jne 0x2addc
jmp 0x2ade8
movq -0x278(%rbp), %rdi
callq 0xd210
jmp 0x2aebc
movq -0x8(%rbp), %rax
movq %rax, -0x298(%rbp)
leaq -0x18(%rbp), %rdi
callq 0x26cf0
movq %rax, %rdi
callq 0xd120
movq %rax, -0x290(%rbp)
leaq -0x18(%rbp), %rdi
callq 0x26cf0
movq -0x298(%rbp), %rdi
movq -0x290(%rbp), %rsi
movq %rax, %rdx
addq $0x20, %rdx
addq $0x18, %rdx
callq 0x54e20
jmp 0x2ae98
leaq -0x18(%rbp), %rdi
callq 0x26cf0
cmpl $0x1, 0x20(%rax)
jne 0x2ae96
leaq -0x18(%rbp), %rdi
callq 0x26cf0
movq %rax, %rdi
addq $0x20, %rdi
addq $0x18, %rdi
callq 0x102f0
cmpl $0x0, %eax
jne 0x2ae96
leaq -0x18(%rbp), %rdi
callq 0x26cf0
addq $0x20, %rax
movq %rax, -0x2a0(%rbp)
leaq -0x58(%rbp), %rdi
callq 0x2de90
movq -0x2a0(%rbp), %rdi
movq %rax, %rsi
addq $0x20, %rsi
callq 0x2a2e0
jmp 0x2ae98
jmp 0x2ae9a
jmp 0x2ae9c
leaq -0x18(%rbp), %rdi
xorl %esi, %esi
callq 0x2e140
movq %rax, -0x218(%rbp)
jmp 0x2a7f0
addq $0x2a0, %rsp            # imm = 0x2A0
popq %rbp
retq
movq -0x48(%rbp), %rdi
callq 0xd5a0
nopw %cs:(%rax,%rax)