// File: /workspace/github_cpp_makefile_star2_O1/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
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x18(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x3f1a(%rip), %rsi      # 0x8230
leaq 0x3f18(%rip), %rdx      # 0x8235
leaq 0x8(%rsp), %rdi
callq 0x44f4
leaq 0x38(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x3eff(%rip), %rsi      # 0x8236
leaq 0x3efd(%rip), %rdx      # 0x823b
leaq 0x28(%rsp), %rdi
callq 0x44f4
cmpq %rbx, %r14
je 0x445f
leaq 0x7(%rsp), %r12
movl (%r14), %r13d
movl %r13d, %eax
andb $0x7, %al
addb $0x41, %al
movl %r13d, %ecx
shrl $0xc, %ecx
andl $0x3, %ecx
movq 0x8(%rsp), %rdx
movb 0x1(%rdx,%rcx), %r15b
movl %r13d, %ecx
shrl $0xe, %ecx
andl $0x3, %ecx
movq 0x28(%rsp), %rdx
movb 0x1(%rdx,%rcx), %bpl
movb %al, 0x7(%rsp)
movl $0x1, %edx
movq 0x6c2a(%rip), %rdi      # 0xafc0
movq %r12, %rsi
callq 0x2180
movl %r13d, %ecx
shrb $0x3, %cl
andb $0x7, %cl
addb $0x31, %cl
movb %cl, 0x7(%rsp)
movl $0x1, %edx
movq %rax, %rdi
movq %r12, %rsi
callq 0x2180
movl %r13d, %ecx
shrl $0x6, %ecx
andb $0x7, %cl
addb $0x41, %cl
movb %cl, 0x7(%rsp)
movl $0x1, %edx
movq %rax, %rdi
movq %r12, %rsi
callq 0x2180
shrl $0x9, %r13d
andb $0x7, %r13b
addb $0x31, %r13b
movb %r13b, 0x7(%rsp)
movl $0x1, %edx
movq %rax, %rdi
movq %r12, %rsi
callq 0x2180
movb $0x20, 0x7(%rsp)
movl $0x1, %edx
movq %rax, %rdi
movq %r12, %rsi
callq 0x2180
movb %r15b, 0x7(%rsp)
movl $0x1, %edx
movq %rax, %rdi
movq %r12, %rsi
callq 0x2180
movb %bpl, 0x7(%rsp)
movl $0x1, %edx
movq %rax, %rdi
movq %r12, %rsi
callq 0x2180
movl $0x1, %edx
movq %rax, %rdi
leaq 0x3f24(%rip), %rsi      # 0x8371
callq 0x2180
addq $0x8, %r14
cmpq %rbx, %r14
jne 0x4356
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
je 0x447b
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x2160
movq 0x8(%rsp), %rdi
leaq 0x18(%rsp), %rax
cmpq %rax, %rdi
je 0x4497
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2160
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rbx
leaq 0x18(%rsp), %r14
jmp 0x44d4
movq %rax, %rbx
movq 0x28(%rsp), %rdi
leaq 0x38(%rsp), %rax
cmpq %rax, %rdi
leaq 0x18(%rsp), %r14
je 0x44d4
movq 0x38(%rsp), %rsi
incq %rsi
callq 0x2160
movq 0x8(%rsp), %rdi
cmpq %r14, %rdi
je 0x44eb
movq 0x18(%rsp), %rsi
incq %rsi
callq 0x2160
movq %rbx, %rdi
callq 0x2230
nop