// File: /workspace/github_cpp_makefile_star2_O1/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 $0x188, %rsp            # imm = 0x188
movq %r8, %rbx
movq %rdx, %r15
movq %rdi, 0x8(%rsp)
movq (%rdx), %rax
movq %rax, %r14
subq %rcx, %r14
jbe 0x93a0
cmpq $0xe, %r14
ja 0x955d
xorps %xmm0, %xmm0
movq 0x8(%rsp), %rax
movups %xmm0, (%rax)
movq $0x0, 0x10(%rax)
movq %rcx, 0x140(%rsp)
cmpq %rcx, (%r15)
jbe 0x969d
leaq 0x120(%rsp), %rbp
leaq 0x100(%rsp), %r12
leaq 0x2eeb7(%rip), %r13     # 0x380e3
leaq 0xe0(%rsp), %rbx
leaq 0x18(%rsp), %r14
leaq 0x130(%rsp), %rax
movq %rax, 0x120(%rsp)
movq %rbp, %rdi
leaq 0x2ee47(%rip), %rsi     # 0x3809a
leaq 0x2ee43(%rip), %rdx     # 0x3809d
callq 0x54fc
leaq 0x110(%rsp), %rax
movq %rax, 0x100(%rsp)
movq %r12, %rdi
leaq 0x2ee1b(%rip), %rsi     # 0x38094
leaq 0x2ee15(%rip), %rdx     # 0x38095
callq 0x54fc
leaq 0xf0(%rsp), %rax
movq %rax, 0xe0(%rsp)
movq %rbx, %rdi
movq %r13, %rsi
movq %r13, %rdx
callq 0x54fc
movq %r14, %rdi
movq %rbp, %rsi
movq %r12, %rdx
movq %rbx, %rcx
callq 0xbe58
movq 0x8(%rsp), %rdi
movq %r14, %rsi
callq 0xcf0e
movq 0x58(%rsp), %rdi
leaq 0x68(%rsp), %rax
cmpq %rax, %rdi
je 0x92dd
movq 0x68(%rsp), %rsi
incq %rsi
callq 0x42a0
movq 0x38(%rsp), %rdi
leaq 0x48(%rsp), %rax
cmpq %rax, %rdi
je 0x92f9
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x42a0
movq 0x18(%rsp), %rdi
leaq 0x28(%rsp), %rax
cmpq %rax, %rdi
je 0x9315
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x42a0
movq 0xe0(%rsp), %rdi
leaq 0xf0(%rsp), %rax
cmpq %rax, %rdi
je 0x933a
movq 0xf0(%rsp), %rsi
incq %rsi
callq 0x42a0
movq 0x100(%rsp), %rdi
leaq 0x110(%rsp), %rax
cmpq %rax, %rdi
je 0x935f
movq 0x110(%rsp), %rsi
incq %rsi
callq 0x42a0
movq 0x120(%rsp), %rdi
leaq 0x130(%rsp), %rax
cmpq %rax, %rdi
je 0x9384
movq 0x130(%rsp), %rsi
incq %rsi
callq 0x42a0
movq (%r15), %rax
decq %rax
movq %rax, (%r15)
cmpq 0x140(%rsp), %rax
ja 0x9239
jmp 0x969d
jae 0x95b9
movq %rcx, %r14
subq %rax, %r14
cmpq $0xe, %r14
ja 0x9642
xorps %xmm0, %xmm0
movq 0x8(%rsp), %rax
movups %xmm0, (%rax)
movq $0x0, 0x10(%rax)
cmpq %rcx, (%r15)
jae 0x969d
movq %rcx, %r14
leaq 0xc0(%rsp), %r12
leaq 0x2ecff(%rip), %r13     # 0x380e3
leaq 0xa0(%rsp), %rbp
leaq 0x18(%rsp), %rbx
leaq 0x90(%rsp), %rax
movq %rax, 0x80(%rsp)
leaq 0x80(%rsp), %rdi
leaq 0x2ec8e(%rip), %rsi     # 0x3809e
leaq 0x2ec8a(%rip), %rdx     # 0x380a1
callq 0x54fc
leaq 0xd0(%rsp), %rax
movq %rax, 0xc0(%rsp)
movq %r12, %rdi
leaq 0x2ec5e(%rip), %rsi     # 0x38094
leaq 0x2ec58(%rip), %rdx     # 0x38095
callq 0x54fc
leaq 0xb0(%rsp), %rax
movq %rax, 0xa0(%rsp)
movq %rbp, %rdi
movq %r13, %rsi
movq %r13, %rdx
callq 0x54fc
movq %rbx, %rdi
leaq 0x80(%rsp), %rsi
movq %r12, %rdx
movq %rbp, %rcx
callq 0xbe58
movq 0x8(%rsp), %rdi
movq %rbx, %rsi
callq 0xcf0e
movq 0x58(%rsp), %rdi
leaq 0x68(%rsp), %rax
cmpq %rax, %rdi
je 0x949f
movq 0x68(%rsp), %rsi
incq %rsi
callq 0x42a0
movq 0x38(%rsp), %rdi
leaq 0x48(%rsp), %rax
cmpq %rax, %rdi
je 0x94bb
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x42a0
movq 0x18(%rsp), %rdi
leaq 0x28(%rsp), %rax
cmpq %rax, %rdi
je 0x94d7
movq 0x28(%rsp), %rsi
incq %rsi
callq 0x42a0
movq 0xa0(%rsp), %rdi
leaq 0xb0(%rsp), %rax
cmpq %rax, %rdi
je 0x94fc
movq 0xb0(%rsp), %rsi
incq %rsi
callq 0x42a0
movq 0xc0(%rsp), %rdi
leaq 0xd0(%rsp), %rax
cmpq %rax, %rdi
je 0x9521
movq 0xd0(%rsp), %rsi
incq %rsi
callq 0x42a0
movq 0x80(%rsp), %rdi
leaq 0x90(%rsp), %rax
cmpq %rax, %rdi
je 0x9546
movq 0x90(%rsp), %rsi
incq %rsi
callq 0x42a0
movq (%r15), %rax
incq %rax
movq %rax, (%r15)
cmpq %r14, %rax
jb 0x93f1
jmp 0x969d
leaq 0x178(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x2eb25(%rip), %rsi     # 0x38096
leaq 0x2eb21(%rip), %rdx     # 0x38099
leaq 0x168(%rsp), %r15
movq %r15, %rdi
callq 0x54fc
movq 0x8(%rsp), %rdi
movq %r14, %rdx
movq %rbx, %rcx
movq %r15, %r8
callq 0x9844
movq 0x168(%rsp), %rdi
cmpq %r12, %rdi
je 0x969d
movq 0x178(%rsp), %rsi
jmp 0x9695
leaq 0x28(%rsp), %rbx
movq %rbx, -0x10(%rbx)
xorl %eax, %eax
movq %rax, -0x8(%rbx)
movb %al, (%rbx)
leaq 0x48(%rsp), %r14
movq %r14, -0x10(%r14)
movq %rax, -0x8(%r14)
movb %al, (%r14)
leaq 0x68(%rsp), %r15
movq %r15, -0x10(%r15)
movq %rax, -0x8(%r15)
movb %al, (%r15)
leaq 0x18(%rsp), %rsi
leaq 0x17(%rsp), %rcx
movl $0x1, %edx
movq 0x8(%rsp), %rdi
callq 0xc13a
movq 0x58(%rsp), %rdi
cmpq %r15, %rdi
je 0x961a
movq 0x68(%rsp), %rsi
incq %rsi
callq 0x42a0
movq 0x38(%rsp), %rdi
cmpq %r14, %rdi
je 0x9631
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x42a0
movq 0x18(%rsp), %rdi
cmpq %rbx, %rdi
je 0x969d
movq 0x28(%rsp), %rsi
jmp 0x9695
leaq 0x158(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x2ea4c(%rip), %rsi     # 0x380a2
leaq 0x2ea48(%rip), %rdx     # 0x380a5
leaq 0x148(%rsp), %r15
movq %r15, %rdi
callq 0x54fc
movq 0x8(%rsp), %rdi
movq %r14, %rdx
movq %rbx, %rcx
movq %r15, %r8
callq 0x9844
movq 0x148(%rsp), %rdi
cmpq %r12, %rdi
je 0x969d
movq 0x158(%rsp), %rsi
incq %rsi
callq 0x42a0
movq 0x8(%rsp), %rax
addq $0x188, %rsp            # imm = 0x188
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
movq 0x148(%rsp), %rdi
cmpq %r12, %rdi
je 0x983b
movq 0x158(%rsp), %rsi
jmp 0x9700
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
callq 0xbf10
jmp 0x983b
movq %rax, %rbx
movq 0x168(%rsp), %rdi
cmpq %r12, %rdi
je 0x983b
movq 0x178(%rsp), %rsi
incq %rsi
callq 0x42a0
jmp 0x983b
jmp 0x979e
movq %rax, %rbx
jmp 0x9778
movq %rax, %rbx
jmp 0x9753
movq %rax, %rbx
jmp 0x972e
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
callq 0xbf10
movq 0xa0(%rsp), %rdi
leaq 0xb0(%rsp), %rax
cmpq %rax, %rdi
je 0x9753
movq 0xb0(%rsp), %rsi
incq %rsi
callq 0x42a0
movq 0xc0(%rsp), %rdi
leaq 0xd0(%rsp), %rax
cmpq %rax, %rdi
je 0x9778
movq 0xd0(%rsp), %rsi
incq %rsi
callq 0x42a0
movq 0x80(%rsp), %rdi
leaq 0x90(%rsp), %rax
cmpq %rax, %rdi
je 0x9831
movq 0x90(%rsp), %rsi
jmp 0x9829
movq %rax, %rbx
jmp 0x9831
movq %rax, %rbx
jmp 0x980c
movq %rax, %rbx
jmp 0x97e7
movq %rax, %rbx
jmp 0x97c2
movq %rax, %rbx
leaq 0x18(%rsp), %rdi
callq 0xbf10
movq 0xe0(%rsp), %rdi
leaq 0xf0(%rsp), %rax
cmpq %rax, %rdi
je 0x97e7
movq 0xf0(%rsp), %rsi
incq %rsi
callq 0x42a0
movq 0x100(%rsp), %rdi
leaq 0x110(%rsp), %rax
cmpq %rax, %rdi
je 0x980c
movq 0x110(%rsp), %rsi
incq %rsi
callq 0x42a0
movq 0x120(%rsp), %rdi
leaq 0x130(%rsp), %rax
cmpq %rax, %rdi
je 0x9831
movq 0x130(%rsp), %rsi
incq %rsi
callq 0x42a0
movq 0x8(%rsp), %rdi
callq 0xbf5e
movq %rbx, %rdi
callq 0x44c0
nop