// File: bjohnsonfl[P]Overhead-Chess-Engine-/moveGen.cpp
// Function: printMoves(candidate*, candidate*)
void printMoves (candidate* start, candidate* end)
{
    std::string pieceletters = "_NBRQ";
    std::string flagletters = "_recp";
    square from ,to;
    char mv [7];
    
    while( start!= end)
    {
        from = source_sq(start-> mv);
        to = destination_sq(start -> mv);
        mv[0] = square_to_file(from) + 'A';
        mv[1] = square_to_rank(from) + '1';
        mv[2] = square_to_file(to) + 'A';
        mv[3] = square_to_rank(to) + '1';
        mv[4] = ' ';
        mv[5] = pieceletters[promo_pieceType(start->mv)] ;
        mv[6] = flagletters[move_flag(start->mv)+1]; //for non promotions, shows up at N because the offset of piece promotion
        std::cout << mv[0] << mv[1] << mv[2] << mv[3] << mv[4] << mv[5] << mv[6]  << "\n";
         start++;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x100, %rsp            # imm = 0x100
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
leaq -0x31(%rbp), %rdi
movq %rdi, -0x88(%rbp)
callq 0x33a0
movq -0x88(%rbp), %rdx
leaq 0x6faf(%rip), %rsi      # 0xe260
leaq -0x30(%rbp), %rdi
callq 0x3b70
jmp 0x72bc
leaq -0x31(%rbp), %rdi
callq 0x3230
leaq -0x69(%rbp), %rdi
movq %rdi, -0x90(%rbp)
callq 0x33a0
movq -0x90(%rbp), %rdx
leaq 0x6f83(%rip), %rsi      # 0xe266
leaq -0x68(%rbp), %rdi
callq 0x3b70
jmp 0x72ee
leaq -0x69(%rbp), %rdi
callq 0x3230
movq -0x8(%rbp), %rax
cmpq -0x10(%rbp), %rax
je 0x753e
movq -0x8(%rbp), %rax
movl (%rax), %edi
callq 0x7860
movl %eax, -0x94(%rbp)
jmp 0x7318
movl -0x94(%rbp), %eax
movl %eax, -0x70(%rbp)
movq -0x8(%rbp), %rax
movl (%rax), %edi
callq 0x7870
movl %eax, -0x98(%rbp)
jmp 0x7334
movl -0x98(%rbp), %eax
movl %eax, -0x74(%rbp)
movl -0x70(%rbp), %edi
callq 0x59f0
movl %eax, -0x9c(%rbp)
jmp 0x734d
movl -0x9c(%rbp), %eax
addb $0x41, %al
movb %al, -0x7b(%rbp)
movl -0x70(%rbp), %edi
callq 0x59d0
movl %eax, -0xa0(%rbp)
jmp 0x7368
movl -0xa0(%rbp), %eax
addb $0x31, %al
movb %al, -0x7a(%rbp)
movl -0x74(%rbp), %edi
callq 0x59f0
movl %eax, -0xa4(%rbp)
jmp 0x7383
movl -0xa4(%rbp), %eax
addb $0x41, %al
movb %al, -0x79(%rbp)
movl -0x74(%rbp), %edi
callq 0x59d0
movl %eax, -0xa8(%rbp)
jmp 0x739e
movl -0xa8(%rbp), %eax
addb $0x31, %al
movb %al, -0x78(%rbp)
movb $0x20, -0x77(%rbp)
movq -0x8(%rbp), %rax
movl (%rax), %edi
callq 0x7890
movl %eax, -0xac(%rbp)
jmp 0x73c0
movl -0xac(%rbp), %eax
movl %eax, %eax
movl %eax, %esi
leaq -0x30(%rbp), %rdi
callq 0x33f0
movq %rax, -0xb8(%rbp)
jmp 0x73dc
movq -0xb8(%rbp), %rax
movb (%rax), %al
movb %al, -0x76(%rbp)
movq -0x8(%rbp), %rax
movl (%rax), %edi
callq 0x78b0
movl %eax, -0xbc(%rbp)
jmp 0x73fb
movl -0xbc(%rbp), %eax
incl %eax
movslq %eax, %rsi
leaq -0x68(%rbp), %rdi
callq 0x33f0
movq %rax, -0xc8(%rbp)
jmp 0x7418
movq -0xc8(%rbp), %rax
movb (%rax), %al
movb %al, -0x75(%rbp)
movsbl -0x7b(%rbp), %esi
movq 0xab99(%rip), %rdi      # 0x11fc8
callq 0x3270
movq %rax, -0xd0(%rbp)
jmp 0x743d
movq -0xd0(%rbp), %rdi
movsbl -0x7a(%rbp), %esi
callq 0x3270
movq %rax, -0xd8(%rbp)
jmp 0x7456
movq -0xd8(%rbp), %rdi
movsbl -0x79(%rbp), %esi
callq 0x3270
movq %rax, -0xe0(%rbp)
jmp 0x746f
movq -0xe0(%rbp), %rdi
movsbl -0x78(%rbp), %esi
callq 0x3270
movq %rax, -0xe8(%rbp)
jmp 0x7488
movq -0xe8(%rbp), %rdi
movsbl -0x77(%rbp), %esi
callq 0x3270
movq %rax, -0xf0(%rbp)
jmp 0x74a1
movq -0xf0(%rbp), %rdi
movsbl -0x76(%rbp), %esi
callq 0x3270
movq %rax, -0xf8(%rbp)
jmp 0x74ba
movq -0xf8(%rbp), %rdi
movsbl -0x75(%rbp), %esi
callq 0x3270
movq %rax, -0x100(%rbp)
jmp 0x74d3
movq -0x100(%rbp), %rdi
leaq 0x6ee4(%rip), %rsi      # 0xe3c5
callq 0x31e0
jmp 0x74e8
movq -0x8(%rbp), %rax
addq $0x8, %rax
movq %rax, -0x8(%rbp)
jmp 0x72f7
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x31(%rbp), %rdi
callq 0x3230
jmp 0x7562
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x69(%rbp), %rdi
callq 0x3230
jmp 0x7559
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x68(%rbp), %rdi
callq 0x3408
jmp 0x7559
leaq -0x68(%rbp), %rdi
callq 0x3408
leaq -0x30(%rbp), %rdi
callq 0x3408
addq $0x100, %rsp            # imm = 0x100
popq %rbp
retq
leaq -0x30(%rbp), %rdi
callq 0x3408
movq -0x40(%rbp), %rdi
callq 0x3390
nopl (%rax,%rax)