// File: 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:
subq $0x478, %rsp            # imm = 0x478
movq %rdi, 0x120(%rsp)
movq %rdi, %rax
movq %rax, 0x128(%rsp)
movq %rdi, 0x470(%rsp)
movq %rsi, 0x468(%rsp)
movq %rdx, 0x460(%rsp)
movq %rcx, 0x458(%rsp)
movq %r8, 0x450(%rsp)
movq 0x460(%rsp), %rax
movq (%rax), %rax
cmpq 0x458(%rsp), %rax
jbe 0x6ca2
movq 0x460(%rsp), %rax
movq (%rax), %rax
subq 0x458(%rsp), %rax
cmpq $0xf, %rax
jae 0x6a5f
movq 0x120(%rsp), %rdi
movb $0x0, 0x44f(%rsp)
callq 0xda20
movq 0x460(%rsp), %rax
movq (%rax), %rax
cmpq 0x458(%rsp), %rax
jbe 0x6a3b
leaq 0x3bf(%rsp), %rdi
movq %rdi, 0x118(%rsp)
callq 0x4600
movq 0x118(%rsp), %rdx
leaq 0x4a898(%rip), %rsi     # 0x510d2
leaq 0x3c0(%rsp), %rdi
callq 0x4f10
jmp 0x6849
leaq 0x387(%rsp), %rdi
movq %rdi, 0x110(%rsp)
callq 0x4600
movq 0x110(%rsp), %rdx
leaq 0x4a85f(%rip), %rsi     # 0x510cc
leaq 0x388(%rsp), %rdi
callq 0x4f10
jmp 0x687c
leaq 0x35f(%rsp), %rdi
movq %rdi, 0x108(%rsp)
callq 0x4600
movq 0x108(%rsp), %rdx
leaq 0x4a87b(%rip), %rsi     # 0x5111b
leaq 0x360(%rsp), %rdi
callq 0x4f10
jmp 0x68af
leaq 0x3e0(%rsp), %rdi
leaq 0x3c0(%rsp), %rsi
leaq 0x388(%rsp), %rdx
leaq 0x360(%rsp), %rcx
callq 0xd3b0
jmp 0x68d6
movq 0x120(%rsp), %rdi
leaq 0x3e0(%rsp), %rsi
callq 0xd380
jmp 0x68ed
leaq 0x3e0(%rsp), %rdi
callq 0xd490
leaq 0x360(%rsp), %rdi
callq 0x46e8
leaq 0x35f(%rsp), %rdi
callq 0x43b0
leaq 0x388(%rsp), %rdi
callq 0x46e8
leaq 0x387(%rsp), %rdi
callq 0x43b0
leaq 0x3c0(%rsp), %rdi
callq 0x46e8
leaq 0x3bf(%rsp), %rdi
callq 0x43b0
movq 0x460(%rsp), %rax
movq (%rax), %rcx
addq $-0x1, %rcx
movq %rcx, (%rax)
jmp 0x67fd
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x3b0(%rsp)
movl %eax, 0x3ac(%rsp)
jmp 0x6a1c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x3b0(%rsp)
movl %eax, 0x3ac(%rsp)
jmp 0x6a02
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x3b0(%rsp)
movl %eax, 0x3ac(%rsp)
jmp 0x69e8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x3b0(%rsp)
movl %eax, 0x3ac(%rsp)
jmp 0x69db
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x3b0(%rsp)
movl %eax, 0x3ac(%rsp)
leaq 0x3e0(%rsp), %rdi
callq 0xd490
leaq 0x360(%rsp), %rdi
callq 0x46e8
leaq 0x35f(%rsp), %rdi
callq 0x43b0
leaq 0x388(%rsp), %rdi
callq 0x46e8
leaq 0x387(%rsp), %rdi
callq 0x43b0
leaq 0x3c0(%rsp), %rdi
callq 0x46e8
leaq 0x3bf(%rsp), %rdi
callq 0x43b0
movq 0x120(%rsp), %rdi
callq 0xd550
jmp 0x72ec
movb $0x1, 0x44f(%rsp)
testb $0x1, 0x44f(%rsp)
jne 0x6a5a
movq 0x120(%rsp), %rdi
callq 0xd550
jmp 0x72dc
movq 0x458(%rsp), %rcx
movq 0x460(%rsp), %rax
movq %rcx, (%rax)
movq 0x458(%rsp), %rax
movq %rax, 0x100(%rsp)
leaq 0x308(%rsp), %rdi
movq %rdi, 0x300(%rsp)
movl $0x0, 0x2fc(%rsp)
leaq 0x4a628(%rip), %rsi     # 0x510cc
leaq 0x2fc(%rsp), %rdx
callq 0xdb20
jmp 0x6ab3
leaq 0x308(%rsp), %rax
movq %rax, 0x330(%rsp)
movq $0x1, 0x338(%rsp)
leaq 0x2fb(%rsp), %rdi
movq %rdi, 0xf8(%rsp)
callq 0xdbc0
movq 0xf8(%rsp), %rcx
movq 0x330(%rsp), %rsi
movq 0x338(%rsp), %rdx
leaq 0x340(%rsp), %rdi
callq 0xdbd0
jmp 0x6b0b
movq 0x100(%rsp), %rsi
movq 0x120(%rsp), %rdi
leaq 0x340(%rsp), %rdx
callq 0x1db90
jmp 0x6b2a
leaq 0x340(%rsp), %rdi
callq 0xdc60
leaq 0x2fb(%rsp), %rdi
callq 0xdcc0
leaq 0x308(%rsp), %rax
movq %rax, 0xe8(%rsp)
addq $0x28, %rax
movq %rax, 0xf0(%rsp)
movq 0xf0(%rsp), %rdi
addq $-0x28, %rdi
movq %rdi, 0xe0(%rsp)
callq 0xdbb0
movq 0xe8(%rsp), %rcx
movq 0xe0(%rsp), %rax
cmpq %rcx, %rax
movq %rax, 0xf0(%rsp)
jne 0x6b60
jmp 0x72dc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x3b0(%rsp)
movl %eax, 0x3ac(%rsp)
movq 0x300(%rsp), %rax
leaq 0x308(%rsp), %rcx
cmpq %rax, %rcx
movq %rax, 0xd8(%rsp)
je 0x6c02
movq 0xd8(%rsp), %rdi
addq $-0x28, %rdi
movq %rdi, 0xd0(%rsp)
callq 0xdbb0
movq 0xd0(%rsp), %rax
leaq 0x308(%rsp), %rcx
cmpq %rcx, %rax
movq %rax, 0xd8(%rsp)
jne 0x6bcc
jmp 0x72ec
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x3b0(%rsp)
movl %eax, 0x3ac(%rsp)
jmp 0x6c3e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x3b0(%rsp)
movl %eax, 0x3ac(%rsp)
leaq 0x340(%rsp), %rdi
callq 0xdc60
leaq 0x2fb(%rsp), %rdi
callq 0xdcc0
leaq 0x308(%rsp), %rax
movq %rax, 0xc0(%rsp)
addq $0x28, %rax
movq %rax, 0xc8(%rsp)
movq 0xc8(%rsp), %rdi
addq $-0x28, %rdi
movq %rdi, 0xb8(%rsp)
callq 0xdbb0
movq 0xc0(%rsp), %rcx
movq 0xb8(%rsp), %rax
cmpq %rcx, %rax
movq %rax, 0xc8(%rsp)
jne 0x6c67
jmp 0x72ec
movq 0x460(%rsp), %rax
movq (%rax), %rax
cmpq 0x458(%rsp), %rax
jae 0x7168
movq 0x458(%rsp), %rax
movq 0x460(%rsp), %rcx
subq (%rcx), %rax
cmpq $0xf, %rax
jae 0x6f4f
movq 0x120(%rsp), %rdi
movb $0x0, 0x2fa(%rsp)
callq 0xda20
movq 0x460(%rsp), %rax
movq (%rax), %rax
cmpq 0x458(%rsp), %rax
jae 0x6f2b
leaq 0x26f(%rsp), %rdi
movq %rdi, 0xb0(%rsp)
callq 0x4600
movq 0xb0(%rsp), %rdx
leaq 0x4a3ac(%rip), %rsi     # 0x510d6
leaq 0x270(%rsp), %rdi
callq 0x4f10
jmp 0x6d39
leaq 0x247(%rsp), %rdi
movq %rdi, 0xa8(%rsp)
callq 0x4600
movq 0xa8(%rsp), %rdx
leaq 0x4a36f(%rip), %rsi     # 0x510cc
leaq 0x248(%rsp), %rdi
callq 0x4f10
jmp 0x6d6c
leaq 0x21f(%rsp), %rdi
movq %rdi, 0xa0(%rsp)
callq 0x4600
movq 0xa0(%rsp), %rdx
leaq 0x4a38b(%rip), %rsi     # 0x5111b
leaq 0x220(%rsp), %rdi
callq 0x4f10
jmp 0x6d9f
leaq 0x290(%rsp), %rdi
leaq 0x270(%rsp), %rsi
leaq 0x248(%rsp), %rdx
leaq 0x220(%rsp), %rcx
callq 0xd3b0
jmp 0x6dc6
movq 0x120(%rsp), %rdi
leaq 0x290(%rsp), %rsi
callq 0xd380
jmp 0x6ddd
leaq 0x290(%rsp), %rdi
callq 0xd490
leaq 0x220(%rsp), %rdi
callq 0x46e8
leaq 0x21f(%rsp), %rdi
callq 0x43b0
leaq 0x248(%rsp), %rdi
callq 0x46e8
leaq 0x247(%rsp), %rdi
callq 0x43b0
leaq 0x270(%rsp), %rdi
callq 0x46e8
leaq 0x26f(%rsp), %rdi
callq 0x43b0
movq 0x460(%rsp), %rax
movq (%rax), %rcx
addq $0x1, %rcx
movq %rcx, (%rax)
jmp 0x6ced
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x3b0(%rsp)
movl %eax, 0x3ac(%rsp)
jmp 0x6f0c
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x3b0(%rsp)
movl %eax, 0x3ac(%rsp)
jmp 0x6ef2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x3b0(%rsp)
movl %eax, 0x3ac(%rsp)
jmp 0x6ed8
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x3b0(%rsp)
movl %eax, 0x3ac(%rsp)
jmp 0x6ecb
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x3b0(%rsp)
movl %eax, 0x3ac(%rsp)
leaq 0x290(%rsp), %rdi
callq 0xd490
leaq 0x220(%rsp), %rdi
callq 0x46e8
leaq 0x21f(%rsp), %rdi
callq 0x43b0
leaq 0x248(%rsp), %rdi
callq 0x46e8
leaq 0x247(%rsp), %rdi
callq 0x43b0
leaq 0x270(%rsp), %rdi
callq 0x46e8
leaq 0x26f(%rsp), %rdi
callq 0x43b0
movq 0x120(%rsp), %rdi
callq 0xd550
jmp 0x72ec
movb $0x1, 0x2fa(%rsp)
testb $0x1, 0x2fa(%rsp)
jne 0x6f4a
movq 0x120(%rsp), %rdi
callq 0xd550
jmp 0x72dc
movq 0x458(%rsp), %rcx
movq 0x460(%rsp), %rax
movq %rcx, (%rax)
movq 0x458(%rsp), %rax
movq %rax, 0x98(%rsp)
leaq 0x1c8(%rsp), %rdi
movq %rdi, 0x1c0(%rsp)
movl $0x0, 0x1bc(%rsp)
leaq 0x4a138(%rip), %rsi     # 0x510cc
leaq 0x1bc(%rsp), %rdx
callq 0xdb20
jmp 0x6fa3
leaq 0x1c8(%rsp), %rax
movq %rax, 0x1f0(%rsp)
movq $0x1, 0x1f8(%rsp)
leaq 0x1bb(%rsp), %rdi
movq %rdi, 0x90(%rsp)
callq 0xdbc0
movq 0x90(%rsp), %rcx
movq 0x1f0(%rsp), %rsi
movq 0x1f8(%rsp), %rdx
leaq 0x200(%rsp), %rdi
callq 0xdbd0
jmp 0x6ffb
movq 0x98(%rsp), %rsi
movq 0x120(%rsp), %rdi
leaq 0x200(%rsp), %rdx
callq 0x1db90
jmp 0x701a
leaq 0x200(%rsp), %rdi
callq 0xdc60
leaq 0x1bb(%rsp), %rdi
callq 0xdcc0
leaq 0x1c8(%rsp), %rax
movq %rax, 0x80(%rsp)
addq $0x28, %rax
movq %rax, 0x88(%rsp)
movq 0x88(%rsp), %rdi
addq $-0x28, %rdi
movq %rdi, 0x78(%rsp)
callq 0xdbb0
movq 0x80(%rsp), %rcx
movq 0x78(%rsp), %rax
cmpq %rcx, %rax
movq %rax, 0x88(%rsp)
jne 0x7050
jmp 0x72dc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x3b0(%rsp)
movl %eax, 0x3ac(%rsp)
movq 0x1c0(%rsp), %rax
leaq 0x1c8(%rsp), %rcx
cmpq %rax, %rcx
movq %rax, 0x70(%rsp)
je 0x70dd
movq 0x70(%rsp), %rdi
addq $-0x28, %rdi
movq %rdi, 0x68(%rsp)
callq 0xdbb0
movq 0x68(%rsp), %rax
leaq 0x1c8(%rsp), %rcx
cmpq %rcx, %rax
movq %rax, 0x70(%rsp)
jne 0x70b3
jmp 0x72ec
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x3b0(%rsp)
movl %eax, 0x3ac(%rsp)
jmp 0x7119
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x3b0(%rsp)
movl %eax, 0x3ac(%rsp)
leaq 0x200(%rsp), %rdi
callq 0xdc60
leaq 0x1bb(%rsp), %rdi
callq 0xdcc0
leaq 0x1c8(%rsp), %rax
movq %rax, 0x58(%rsp)
addq $0x28, %rax
movq %rax, 0x60(%rsp)
movq 0x60(%rsp), %rdi
addq $-0x28, %rdi
movq %rdi, 0x50(%rsp)
callq 0xdbb0
movq 0x58(%rsp), %rcx
movq 0x50(%rsp), %rax
cmpq %rcx, %rax
movq %rax, 0x60(%rsp)
jne 0x713c
jmp 0x72ec
jmp 0x716a
leaq 0x140(%rsp), %rdi
movq %rdi, 0x138(%rsp)
callq 0xda30
jmp 0x7181
leaq 0x140(%rsp), %rax
movq %rax, 0x1a8(%rsp)
movq $0x1, 0x1b0(%rsp)
leaq 0x137(%rsp), %rdi
movq %rdi, 0x48(%rsp)
callq 0xda70
movq 0x120(%rsp), %rdi
movq 0x48(%rsp), %rcx
movq 0x1a8(%rsp), %rsi
movq 0x1b0(%rsp), %rdx
callq 0xda80
jmp 0x71d3
leaq 0x137(%rsp), %rdi
callq 0xdb10
leaq 0x140(%rsp), %rax
movq %rax, 0x38(%rsp)
addq $0x68, %rax
movq %rax, 0x40(%rsp)
movq 0x40(%rsp), %rdi
addq $-0x68, %rdi
movq %rdi, 0x30(%rsp)
callq 0xd490
movq 0x38(%rsp), %rcx
movq 0x30(%rsp), %rax
cmpq %rcx, %rax
movq %rax, 0x40(%rsp)
jne 0x71f6
jmp 0x72dc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x3b0(%rsp)
movl %eax, 0x3ac(%rsp)
movq 0x138(%rsp), %rax
leaq 0x140(%rsp), %rcx
cmpq %rax, %rcx
movq %rax, 0x28(%rsp)
je 0x727a
movq 0x28(%rsp), %rdi
addq $-0x68, %rdi
movq %rdi, 0x20(%rsp)
callq 0xd490
movq 0x20(%rsp), %rax
leaq 0x140(%rsp), %rcx
cmpq %rcx, %rax
movq %rax, 0x28(%rsp)
jne 0x7250
jmp 0x72ec
movq %rax, %rcx
movl %edx, %eax
movq %rcx, 0x3b0(%rsp)
movl %eax, 0x3ac(%rsp)
leaq 0x137(%rsp), %rdi
callq 0xdb10
leaq 0x140(%rsp), %rax
movq %rax, 0x10(%rsp)
addq $0x68, %rax
movq %rax, 0x18(%rsp)
movq 0x18(%rsp), %rdi
addq $-0x68, %rdi
movq %rdi, 0x8(%rsp)
callq 0xd490
movq 0x10(%rsp), %rcx
movq 0x8(%rsp), %rax
cmpq %rcx, %rax
movq %rax, 0x18(%rsp)
jne 0x72b3
jmp 0x72ec
movq 0x128(%rsp), %rax
addq $0x478, %rsp            # imm = 0x478
retq
movq 0x3b0(%rsp), %rdi
callq 0x45f0
nopl (%rax)