// File: bjohnsonfl[P]Overhead-Chess-Engine-/moveGen.cpp
// Function: printmove(move)
void printmove (move m)
{
   /* square from ,to;
    char mv [4];
    
        from = source_sq(m);
    to = destination_sq(m);
        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';
        std::cout << mv[0] << mv[1] << mv[2] << mv[3] << "\n";
    
    */
    std::string pieceletters = "_NBRQ";
    std::string flagletters = "_recp";
    square from ,to;
    char mv [7];
    
    from = source_sq(m);
    to = destination_sq(m);
    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(m)] ;
    mv[6] = flagletters[move_flag(m)+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";
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x100, %rsp            # imm = 0x100
movl %edi, -0x4(%rbp)
leaq -0x29(%rbp), %rdi
movq %rdi, -0x80(%rbp)
callq 0x33a0
movq -0x80(%rbp), %rdx
leaq 0x727a(%rip), %rsi      # 0xe260
leaq -0x28(%rbp), %rdi
callq 0x3b70
jmp 0x6ff1
leaq -0x29(%rbp), %rdi
callq 0x3230
leaq -0x61(%rbp), %rdi
movq %rdi, -0x88(%rbp)
callq 0x33a0
movq -0x88(%rbp), %rdx
leaq 0x724e(%rip), %rsi      # 0xe266
leaq -0x60(%rbp), %rdi
callq 0x3b70
jmp 0x7023
leaq -0x61(%rbp), %rdi
callq 0x3230
movl -0x4(%rbp), %edi
callq 0x7860
movl %eax, -0x8c(%rbp)
jmp 0x703c
movl -0x8c(%rbp), %eax
movl %eax, -0x68(%rbp)
movl -0x4(%rbp), %edi
callq 0x7870
movl %eax, -0x90(%rbp)
jmp 0x7055
movl -0x90(%rbp), %eax
movl %eax, -0x6c(%rbp)
movl -0x68(%rbp), %edi
callq 0x59f0
movl %eax, -0x94(%rbp)
jmp 0x706e
movl -0x94(%rbp), %eax
addb $0x41, %al
movb %al, -0x73(%rbp)
movl -0x68(%rbp), %edi
callq 0x59d0
movl %eax, -0x98(%rbp)
jmp 0x7089
movl -0x98(%rbp), %eax
addb $0x31, %al
movb %al, -0x72(%rbp)
movl -0x6c(%rbp), %edi
callq 0x59f0
movl %eax, -0x9c(%rbp)
jmp 0x70a4
movl -0x9c(%rbp), %eax
addb $0x41, %al
movb %al, -0x71(%rbp)
movl -0x6c(%rbp), %edi
callq 0x59d0
movl %eax, -0xa0(%rbp)
jmp 0x70bf
movl -0xa0(%rbp), %eax
addb $0x31, %al
movb %al, -0x70(%rbp)
movb $0x20, -0x6f(%rbp)
movl -0x4(%rbp), %edi
callq 0x7890
movl %eax, -0xa4(%rbp)
jmp 0x70de
movl -0xa4(%rbp), %eax
movl %eax, %eax
movl %eax, %esi
leaq -0x28(%rbp), %rdi
callq 0x33f0
movq %rax, -0xb0(%rbp)
jmp 0x70fa
movq -0xb0(%rbp), %rax
movb (%rax), %al
movb %al, -0x6e(%rbp)
movl -0x4(%rbp), %edi
callq 0x78b0
movl %eax, -0xb4(%rbp)
jmp 0x7116
movl -0xb4(%rbp), %eax
incl %eax
movslq %eax, %rsi
leaq -0x60(%rbp), %rdi
callq 0x33f0
movq %rax, -0xc0(%rbp)
jmp 0x7133
movq -0xc0(%rbp), %rax
movb (%rax), %al
movb %al, -0x6d(%rbp)
movsbl -0x73(%rbp), %esi
movq 0xae7e(%rip), %rdi      # 0x11fc8
callq 0x3270
movq %rax, -0xc8(%rbp)
jmp 0x7158
movq -0xc8(%rbp), %rdi
movsbl -0x72(%rbp), %esi
callq 0x3270
movq %rax, -0xd0(%rbp)
jmp 0x7171
movq -0xd0(%rbp), %rdi
movsbl -0x71(%rbp), %esi
callq 0x3270
movq %rax, -0xd8(%rbp)
jmp 0x718a
movq -0xd8(%rbp), %rdi
movsbl -0x70(%rbp), %esi
callq 0x3270
movq %rax, -0xe0(%rbp)
jmp 0x71a3
movq -0xe0(%rbp), %rdi
movsbl -0x6f(%rbp), %esi
callq 0x3270
movq %rax, -0xe8(%rbp)
jmp 0x71bc
movq -0xe8(%rbp), %rdi
movsbl -0x6e(%rbp), %esi
callq 0x3270
movq %rax, -0xf0(%rbp)
jmp 0x71d5
movq -0xf0(%rbp), %rdi
movsbl -0x6d(%rbp), %esi
callq 0x3270
movq %rax, -0xf8(%rbp)
jmp 0x71ee
movq -0xf8(%rbp), %rdi
leaq 0x71c9(%rip), %rsi      # 0xe3c5
callq 0x31e0
jmp 0x7203
leaq -0x60(%rbp), %rdi
callq 0x3408
leaq -0x28(%rbp), %rdi
callq 0x3408
addq $0x100, %rsp            # imm = 0x100
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x29(%rbp), %rdi
callq 0x3230
jmp 0x726a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x61(%rbp), %rdi
callq 0x3230
jmp 0x7261
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x60(%rbp), %rdi
callq 0x3408
leaq -0x28(%rbp), %rdi
callq 0x3408
movq -0x38(%rbp), %rdi
callq 0x3390
nopw %cs:(%rax,%rax)