// File: /workspace/github_cpp_makefile_star2_O2/Merulo[P]CompilerJFTT/src/Register/RegisterBlock.cpp
// Function: RegisterBlock::generateNumber(unsigned long long&, unsigned long long, Register&)
std::vector<Line> RegisterBlock::generateNumber(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
        {         
            return generateNumberShift(firstNumber - second, usedRegister, "SUB");     
        }
    }
    else if (firstNumber < second )
    {
        if (second - firstNumber < 15)
        {
            std::vector<Line> lines;
            while( firstNumber < second)
            {
                lines.push_back({"INC", "A"});
                firstNumber++;
            }
            return lines;
        }
        else
        {         
            return generateNumberShift(second - firstNumber, usedRegister, "ADD"); 
        }
    }
    return {{}};
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x178, %rsp            # imm = 0x178
movq %r8, %rbx
movq %rcx, %r14
movq %rdx, %r15
movq %rdi, 0x8(%rsp)
movq (%rdx), %rax
movq %rax, %r12
subq %rcx, %r12
jbe 0x67fa
cmpq $0xe, %r12
ja 0x68ce
movq 0x8(%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 0x50(%rsp), %rbx
cmpq %r14, %rax
jbe 0x6993
movq %r13, %rdi
leaq 0x1c91e(%rip), %rsi     # 0x2309a
leaq 0x5(%rsp), %rdx
callq 0x4a54
movq %r12, %rdi
leaq 0x1c904(%rip), %rsi     # 0x23094
leaq 0x7(%rsp), %rdx
callq 0x4a54
movq %rbp, %rdi
leaq 0x1c93f(%rip), %rsi     # 0x230e3
leaq 0x6(%rsp), %rdx
callq 0x4a54
movq %rbx, %rdi
movq %r13, %rsi
movq %r12, %rdx
movq %rbp, %rcx
callq 0x816a
movq 0x8(%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 0x6769
jae 0x6903
movq %r14, %r12
subq %rax, %r12
cmpq $0xe, %r12
ja 0x695e
movq 0x8(%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 0x50(%rsp), %r12
cmpq %r14, %rax
jae 0x6993
movq %r13, %rdi
leaq 0x1c84e(%rip), %rsi     # 0x2309e
leaq 0x5(%rsp), %rdx
callq 0x4a54
movq %rbx, %rdi
leaq 0x1c830(%rip), %rsi     # 0x23094
leaq 0x7(%rsp), %rdx
callq 0x4a54
movq %rbp, %rdi
leaq 0x1c86b(%rip), %rsi     # 0x230e3
leaq 0x6(%rsp), %rdx
callq 0x4a54
movq %r12, %rdi
movq %r13, %rsi
movq %rbx, %rdx
movq %rbp, %rcx
callq 0x816a
movq 0x8(%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 0x683d
leaq 0x1c7c1(%rip), %rsi     # 0x23096
leaq 0x30(%rsp), %rdi
leaq 0x50(%rsp), %rdx
callq 0x4a54
leaq 0x30(%rsp), %r8
movq 0x8(%rsp), %rdi
movq %r12, %rdx
movq %rbx, %rcx
callq 0x6a7e
leaq 0x30(%rsp), %rdi
jmp 0x698e
leaq 0x60(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
xorl %ecx, %ecx
movb %cl, (%rax)
leaq 0x80(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb %cl, (%rax)
leaq 0xa0(%rsp), %rax
movq %rax, -0x10(%rax)
andq $0x0, -0x8(%rax)
movb %cl, (%rax)
leaq 0x50(%rsp), %rsi
pushq $0x1
popq %rdx
leaq 0x5(%rsp), %rcx
movq 0x8(%rsp), %rdi
callq 0x839a
leaq 0x50(%rsp), %rdi
callq 0x81fe
jmp 0x6993
leaq 0x1c73d(%rip), %rsi     # 0x230a2
leaq 0x10(%rsp), %rdi
leaq 0x50(%rsp), %rdx
callq 0x4a54
leaq 0x10(%rsp), %r8
movq 0x8(%rsp), %rdi
movq %r12, %rdx
movq %rbx, %rcx
callq 0x6a7e
leaq 0x10(%rsp), %rdi
callq 0x4548
movq 0x8(%rsp), %rax
addq $0x178, %rsp            # imm = 0x178
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
leaq 0x10(%rsp), %rdi
jmp 0x69be
jmp 0x69da
movq %rax, %r14
leaq 0x30(%rsp), %rdi
callq 0x4548
jmp 0x6a76
movq %rax, %r14
leaq 0x50(%rsp), %rdi
callq 0x81fe
jmp 0x6a76
movq %rax, %r14
jmp 0x6a76
movq %rax, %r14
jmp 0x6a18
movq %rax, %r14
jmp 0x6a0b
movq %rax, %r14
jmp 0x69fe
movq %rax, %r14
leaq 0x50(%rsp), %rdi
callq 0x81fe
leaq 0xb8(%rsp), %rdi
callq 0x4548
leaq 0xd8(%rsp), %rdi
callq 0x4548
leaq 0xf8(%rsp), %rdi
jmp 0x6a62
jmp 0x6a69
movq %rax, %r14
leaq 0x50(%rsp), %rdi
callq 0x81fe
jmp 0x6a36
movq %rax, %r14
leaq 0x118(%rsp), %rdi
callq 0x4548
jmp 0x6a4d
movq %rax, %r14
jmp 0x6a5a
movq %rax, %r14
leaq 0x138(%rsp), %rdi
callq 0x4548
leaq 0x158(%rsp), %rdi
callq 0x4548
jmp 0x6a6c
movq %rax, %r14
movq 0x8(%rsp), %rdi
callq 0x8236
movq %r14, %rdi
callq 0x4490