// File: vsklad[P]cgen/commands.cpp
// Function: variable_get_template(bal::Formula const&, char const*)
const bal::VariablesArray variable_get_template(const bal::Formula& formula, const char* const variable_name) {
    if (is_binary_variable_name(variable_name)) {
        const bal::literalid_t literal_id = bal::literal_t__from_cstr(variable_name);
        if (literal_t__variable_id(literal_id) >= formula.variables_size()) {
            throw std::invalid_argument("Variable number out of bounds: " + std::string(variable_name));
        };
        bal::VariablesArray result(1, 1);
        *result.data() = literal_id;
        return result;
    } else {
        return *get_formula_named_variable(formula, variable_name);
    };
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x130, %rsp            # imm = 0x130
movq %rdi, -0xe0(%rbp)
movq %rdi, %rax
movq %rax, -0xd8(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0xd0(%rbp)
leaq -0x39(%rbp), %rdi
movq %rdi, -0xc8(%rbp)
callq 0xd5b0
movq -0xd0(%rbp), %rsi
movq -0xc8(%rbp), %rdx
leaq -0x38(%rbp), %rdi
callq 0xd440
jmp 0x2a4cc
leaq -0x38(%rbp), %rdi
callq 0x26c60
movb %al, -0xe1(%rbp)
jmp 0x2a4dd
leaq -0x38(%rbp), %rdi
callq 0xd1b0
leaq -0x39(%rbp), %rdi
callq 0xd370
movb -0xe1(%rbp), %al
testb $0x1, %al
jne 0x2a4fe
jmp 0x2a6f2
movq -0x18(%rbp), %rdi
callq 0x2e030
movl %eax, -0x50(%rbp)
movl -0x50(%rbp), %eax
shrl %eax
subl $0x1, %eax
movl %eax, -0xe8(%rbp)
movq -0x10(%rbp), %rdi
movq (%rdi), %rax
callq *0x58(%rax)
movl %eax, %ecx
movl -0xe8(%rbp), %eax
cmpl %ecx, %eax
jb 0x2a66b
movb $0x1, -0x92(%rbp)
movl $0x10, %edi
callq 0xd150
movq %rax, -0x100(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0xf8(%rbp)
leaq -0x91(%rbp), %rdi
movq %rdi, -0xf0(%rbp)
callq 0xd5b0
movq -0xf8(%rbp), %rsi
movq -0xf0(%rbp), %rdx
leaq -0x90(%rbp), %rdi
callq 0xd440
jmp 0x2a584
leaq 0x37f60(%rip), %rsi     # 0x624eb
leaq -0x70(%rbp), %rdi
leaq -0x90(%rbp), %rdx
callq 0x2e060
jmp 0x2a59d
movq -0x100(%rbp), %rdi
leaq -0x70(%rbp), %rsi
callq 0xd590
jmp 0x2a5af
movq -0x100(%rbp), %rdi
movb $0x0, -0x92(%rbp)
movq 0x58a14(%rip), %rsi     # 0x82fd8
movq 0x589f5(%rip), %rdx     # 0x82fc0
callq 0xd570
jmp 0x2a7cf
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x2a5f8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x38(%rbp), %rdi
callq 0xd1b0
leaq -0x39(%rbp), %rdi
callq 0xd370
jmp 0x2a7c6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x2a643
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x2a637
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x70(%rbp), %rdi
callq 0xd1b0
leaq -0x90(%rbp), %rdi
callq 0xd1b0
leaq -0x91(%rbp), %rdi
callq 0xd370
testb $0x1, -0x92(%rbp)
jne 0x2a65a
jmp 0x2a666
movq -0x100(%rbp), %rdi
callq 0xd210
jmp 0x2a7c6
movq -0xe0(%rbp), %rdi
movb $0x0, -0x93(%rbp)
movl $0x1, %edx
movl %edx, %esi
callq 0x10330
movq -0xe0(%rbp), %rdi
movl -0x50(%rbp), %eax
movl %eax, -0x10c(%rbp)
callq 0x10310
movq %rax, -0x108(%rbp)
jmp 0x2a6a3
movq -0x108(%rbp), %rax
movl -0x10c(%rbp), %ecx
movl %ecx, (%rax)
movb $0x1, -0x93(%rbp)
testb $0x1, -0x93(%rbp)
jne 0x2a6ed
jmp 0x2a6e1
movq -0xe0(%rbp), %rdi
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
callq 0x10850
jmp 0x2a7c6
movq -0xe0(%rbp), %rdi
callq 0x10850
jmp 0x2a7b6
movq -0x10(%rbp), %rax
movq %rax, -0x128(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x120(%rbp)
leaq -0xb9(%rbp), %rdi
movq %rdi, -0x118(%rbp)
callq 0xd5b0
movq -0x120(%rbp), %rsi
movq -0x118(%rbp), %rdx
leaq -0xb8(%rbp), %rdi
callq 0xd440
jmp 0x2a737
movq -0x128(%rbp), %rdi
leaq -0xb8(%rbp), %rsi
callq 0x2a030
movq %rax, -0x130(%rbp)
jmp 0x2a753
movq -0x130(%rbp), %rsi
movq -0xe0(%rbp), %rdi
callq 0x106c0
jmp 0x2a768
leaq -0xb8(%rbp), %rdi
callq 0xd1b0
leaq -0xb9(%rbp), %rdi
callq 0xd370
jmp 0x2a7b6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0x2a7a8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0xb8(%rbp), %rdi
callq 0xd1b0
leaq -0xb9(%rbp), %rdi
callq 0xd370
jmp 0x2a7c6
movq -0xd8(%rbp), %rax
addq $0x130, %rsp            # imm = 0x130
popq %rbp
retq
movq -0x48(%rbp), %rdi
callq 0xd5a0
nop