// File: /workspace/github_cpp_makefile_star2_O2/Merulo[P]CompilerJFTT/src/Register/RegisterBlock.cpp
// Function: RegisterBlock::generateNumberFrom(unsigned long long&, unsigned long long, Register&)
std::vector<Line> RegisterBlock::generateNumberFrom(unsigned long long& firstNumber, unsigned long long second, Register& usedRegister)
{
    if (firstNumber > second)
    {
        if (firstNumber - second < 15)
        {
            std::vector<Line> lines;
            while(firstNumber > second)
            {
                lines.push_back({"DEC", "A"});
                firstNumber--;
            }
            return lines;
        }
        else
        {            
            firstNumber = second;
            return NumberGenerator::generateConstFrom(second, {{"A", 0}});     
        }
    }
    else if (firstNumber < second )
    {
        if (second - firstNumber < 15)
        {
            std::vector<Line> lines;
            while( firstNumber < second)
            {
                lines.push_back({"INC", "A"});
                firstNumber++;
            }
            return lines;
        }
        else
        {         
            firstNumber = second;
            return NumberGenerator::generateConstFrom(second, {{"A", 0}});   
        }
    }
    return {{}};
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x178, %rsp            # imm = 0x178
movq %rcx, %r14
movq %rdx, %r15
movq %rdi, 0x10(%rsp)
movq (%rdx), %rax
movq %rax, %rcx
subq %r14, %rcx
jbe 0x5623
cmpq $0xe, %rcx
ja 0x56f7
movq 0x10(%rsp), %rcx
andq $0x0, 0x10(%rcx)
xorps %xmm0, %xmm0
movups %xmm0, (%rcx)
leaq 0x158(%rsp), %r13
leaq 0x138(%rsp), %r12
leaq 0x118(%rsp), %rbp
leaq 0x20(%rsp), %rbx
cmpq %r14, %rax
jbe 0x5806
movq %r13, %rdi
leaq 0x1daf5(%rip), %rsi     # 0x2309a
leaq 0x1c(%rsp), %rdx
callq 0x4a54
movq %r12, %rdi
leaq 0x1dadb(%rip), %rsi     # 0x23094
leaq 0xe(%rsp), %rdx
callq 0x4a54
movq %rbp, %rdi
leaq 0x1db16(%rip), %rsi     # 0x230e3
leaq 0xf(%rsp), %rdx
callq 0x4a54
movq %rbx, %rdi
movq %r13, %rsi
movq %r12, %rdx
movq %rbp, %rcx
callq 0x816a
movq 0x10(%rsp), %rdi
movq %rbx, %rsi
callq 0x8f90
movq %rbx, %rdi
callq 0x81fe
movq %rbp, %rdi
callq 0x4548
movq %r12, %rdi
callq 0x4548
movq %r13, %rdi
callq 0x4548
movq (%r15), %rax
decq %rax
movq %rax, (%r15)
jmp 0x5592
jae 0x574f
movq %r14, %rcx
subq %rax, %rcx
cmpq $0xe, %rcx
ja 0x57a4
movq 0x10(%rsp), %rcx
andq $0x0, 0x10(%rcx)
xorps %xmm0, %xmm0
movups %xmm0, (%rcx)
leaq 0xf8(%rsp), %r13
leaq 0xd8(%rsp), %rbx
leaq 0xb8(%rsp), %rbp
leaq 0x20(%rsp), %r12
cmpq %r14, %rax
jae 0x5806
movq %r13, %rdi
leaq 0x1da25(%rip), %rsi     # 0x2309e
leaq 0x1c(%rsp), %rdx
callq 0x4a54
movq %rbx, %rdi
leaq 0x1da07(%rip), %rsi     # 0x23094
leaq 0xe(%rsp), %rdx
callq 0x4a54
movq %rbp, %rdi
leaq 0x1da42(%rip), %rsi     # 0x230e3
leaq 0xf(%rsp), %rdx
callq 0x4a54
movq %r12, %rdi
movq %r13, %rsi
movq %rbx, %rdx
movq %rbp, %rcx
callq 0x816a
movq 0x10(%rsp), %rdi
movq %r12, %rsi
callq 0x8f90
movq %r12, %rdi
callq 0x81fe
movq %rbp, %rdi
callq 0x4548
movq %rbx, %rdi
callq 0x4548
movq %r13, %rdi
callq 0x4548
movq (%r15), %rax
incq %rax
movq %rax, (%r15)
jmp 0x5666
movq %r14, (%r15)
leaq 0x1c(%rsp), %rdx
andl $0x0, (%rdx)
leaq 0x1d98b(%rip), %rsi     # 0x23094
leaq 0x20(%rsp), %rdi
callq 0x83d4
leaq 0xa0(%rsp), %rdi
leaq 0x20(%rsp), %rsi
pushq $0x1
popq %rdx
leaq 0xe(%rsp), %rcx
callq 0x83f8
leaq 0xa0(%rsp), %rdx
movq 0x10(%rsp), %rdi
movq %r14, %rsi
callq 0xf140
leaq 0xa0(%rsp), %rdi
jmp 0x57f7
leaq 0x30(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
xorl %ecx, %ecx
movb %cl, (%rax)
leaq 0x50(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb %cl, (%rax)
leaq 0x70(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb %cl, (%rax)
leaq 0x20(%rsp), %rsi
pushq $0x1
popq %rdx
leaq 0x1c(%rsp), %rcx
movq 0x10(%rsp), %rdi
callq 0x839a
leaq 0x20(%rsp), %rdi
callq 0x81fe
jmp 0x5806
movq %r14, (%r15)
leaq 0x1c(%rsp), %rdx
andl $0x0, (%rdx)
leaq 0x1d8de(%rip), %rsi     # 0x23094
leaq 0x20(%rsp), %rdi
callq 0x83d4
leaq 0x88(%rsp), %rdi
leaq 0x20(%rsp), %rsi
pushq $0x1
popq %rdx
leaq 0xe(%rsp), %rcx
callq 0x83f8
leaq 0x88(%rsp), %rdx
movq 0x10(%rsp), %rdi
movq %r14, %rsi
callq 0xf140
leaq 0x88(%rsp), %rdi
callq 0x8432
leaq 0x20(%rsp), %rdi
callq 0x4548
movq 0x10(%rsp), %rax
addq $0x178, %rsp            # imm = 0x178
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
leaq 0x88(%rsp), %rdi
jmp 0x5839
jmp 0x5840
jmp 0x5864
movq %rax, %r14
leaq 0xa0(%rsp), %rdi
callq 0x8432
jmp 0x5843
movq %rax, %r14
leaq 0x20(%rsp), %rdi
callq 0x4548
jmp 0x5900
movq %rax, %r14
leaq 0x20(%rsp), %rdi
callq 0x81fe
jmp 0x5900
movq %rax, %r14
jmp 0x5900
movq %rax, %r14
jmp 0x58a2
movq %rax, %r14
jmp 0x5895
movq %rax, %r14
jmp 0x5888
movq %rax, %r14
leaq 0x20(%rsp), %rdi
callq 0x81fe
leaq 0xb8(%rsp), %rdi
callq 0x4548
leaq 0xd8(%rsp), %rdi
callq 0x4548
leaq 0xf8(%rsp), %rdi
jmp 0x58ec
jmp 0x58f3
movq %rax, %r14
leaq 0x20(%rsp), %rdi
callq 0x81fe
jmp 0x58c0
movq %rax, %r14
leaq 0x118(%rsp), %rdi
callq 0x4548
jmp 0x58d7
movq %rax, %r14
jmp 0x58e4
movq %rax, %r14
leaq 0x138(%rsp), %rdi
callq 0x4548
leaq 0x158(%rsp), %rdi
callq 0x4548
jmp 0x58f6
movq %rax, %r14
movq 0x10(%rsp), %rdi
callq 0x8236
movq %r14, %rdi
callq 0x4490