// File: jswaff[P]prophet3/test/move__test.cpp
// Function: test_set_promopiece()
void test_set_promopiece() {
    move mv = to_move(PAWN,B2,B1);
    assert(get_piece(mv)==PAWN);
    assert(get_from_sq(mv)==B2);
    assert(get_to_sq(mv)==B1);
    assert(!is_epcapture(mv));
    assert(!is_capture(mv));
    assert(!is_castle(mv));
    assert(get_promopiece(mv)==NO_PIECE);

    set_promopiece(&mv,ROOK);
    assert(get_piece(mv)==PAWN);
    assert(get_from_sq(mv)==B2);
    assert(get_to_sq(mv)==B1);
    assert(!is_epcapture(mv));
    assert(!is_capture(mv));
    assert(!is_castle(mv));
    assert(get_promopiece(mv)==ROOK);

    set_promopiece(&mv,BISHOP);
    assert(get_promopiece(mv)==BISHOP);

    set_promopiece(&mv,QUEEN);
    assert(get_promopiece(mv)==QUEEN);

    set_promopiece(&mv,KNIGHT);
    assert(get_promopiece(mv)==KNIGHT);

    set_promopiece(&mv,NO_PIECE);
    assert(get_piece(mv)==PAWN);
    assert(get_from_sq(mv)==B2);
    assert(get_to_sq(mv)==B1);
    assert(!is_epcapture(mv));
    assert(!is_capture(mv));
    assert(!is_castle(mv));
    assert(get_promopiece(mv)==NO_PIECE);

    ///////
    mv = to_capture(PAWN,B2,A1,ROOK);
    set_promopiece(&mv,QUEEN);
    assert(get_piece(mv)==PAWN);
    assert(get_from_sq(mv)==B2);
    assert(get_to_sq(mv)==A1);
    assert(!is_epcapture(mv));
    assert(is_capture(mv));
    assert(!is_castle(mv));
    assert(get_promopiece(mv)==QUEEN);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl $0x1, %edi
movl $0x31, %esi
movl $0x39, %edx
callq 0xa830
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rdi
callq 0xaac0
cmpl $0x1, %eax
jne 0x22720
jmp 0x2273f
leaq 0x1bee4(%rip), %rdi     # 0x3e60b
leaq 0x1cb74(%rip), %rsi     # 0x3f2a2
movl $0x1a, %edx
leaq 0x1cc04(%rip), %rcx     # 0x3f33e
callq 0x20c0
movq -0x8(%rbp), %rdi
callq 0xaa80
cmpl $0x31, %eax
jne 0x2274f
jmp 0x2276e
leaq 0x1cc03(%rip), %rdi     # 0x3f359
leaq 0x1cb45(%rip), %rsi     # 0x3f2a2
movl $0x1b, %edx
leaq 0x1cbd5(%rip), %rcx     # 0x3f33e
callq 0x20c0
movq -0x8(%rbp), %rdi
callq 0xaaa0
cmpl $0x39, %eax
jne 0x2277e
jmp 0x2279d
leaq 0x1cbe8(%rip), %rdi     # 0x3f36d
leaq 0x1cb16(%rip), %rsi     # 0x3f2a2
movl $0x1c, %edx
leaq 0x1cba6(%rip), %rcx     # 0x3f33e
callq 0x20c0
movq -0x8(%rbp), %rdi
callq 0xab50
xorb $-0x1, %al
testb $0x1, %al
jne 0x227ae
jmp 0x227b0
jmp 0x227cf
leaq 0x1cb39(%rip), %rdi     # 0x3f2f0
leaq 0x1cae4(%rip), %rsi     # 0x3f2a2
movl $0x1d, %edx
leaq 0x1cb74(%rip), %rcx     # 0x3f33e
callq 0x20c0
movq -0x8(%rbp), %rdi
callq 0xab20
xorb $-0x1, %al
testb $0x1, %al
jne 0x227e0
jmp 0x227e2
jmp 0x22801
leaq 0x1cb19(%rip), %rdi     # 0x3f302
leaq 0x1cab2(%rip), %rsi     # 0x3f2a2
movl $0x1e, %edx
leaq 0x1cb42(%rip), %rcx     # 0x3f33e
callq 0x20c0
movq -0x8(%rbp), %rdi
callq 0xab70
xorb $-0x1, %al
testb $0x1, %al
jne 0x22812
jmp 0x22814
jmp 0x22833
leaq 0x1caf7(%rip), %rdi     # 0x3f312
leaq 0x1ca80(%rip), %rsi     # 0x3f2a2
movl $0x1f, %edx
leaq 0x1cb10(%rip), %rcx     # 0x3f33e
callq 0x20c0
movq -0x8(%rbp), %rdi
callq 0xaae0
cmpl $0x0, %eax
jne 0x22843
jmp 0x22862
leaq 0x1cad7(%rip), %rdi     # 0x3f321
leaq 0x1ca51(%rip), %rsi     # 0x3f2a2
movl $0x20, %edx
leaq 0x1cae1(%rip), %rcx     # 0x3f33e
callq 0x20c0
leaq -0x8(%rbp), %rdi
movl $0x4, %esi
callq 0xa9e0
movq -0x8(%rbp), %rdi
callq 0xaac0
cmpl $0x1, %eax
jne 0x22880
jmp 0x2289f
leaq 0x1bd84(%rip), %rdi     # 0x3e60b
leaq 0x1ca14(%rip), %rsi     # 0x3f2a2
movl $0x23, %edx
leaq 0x1caa4(%rip), %rcx     # 0x3f33e
callq 0x20c0
movq -0x8(%rbp), %rdi
callq 0xaa80
cmpl $0x31, %eax
jne 0x228af
jmp 0x228ce
leaq 0x1caa3(%rip), %rdi     # 0x3f359
leaq 0x1c9e5(%rip), %rsi     # 0x3f2a2
movl $0x24, %edx
leaq 0x1ca75(%rip), %rcx     # 0x3f33e
callq 0x20c0
movq -0x8(%rbp), %rdi
callq 0xaaa0
cmpl $0x39, %eax
jne 0x228de
jmp 0x228fd
leaq 0x1ca88(%rip), %rdi     # 0x3f36d
leaq 0x1c9b6(%rip), %rsi     # 0x3f2a2
movl $0x25, %edx
leaq 0x1ca46(%rip), %rcx     # 0x3f33e
callq 0x20c0
movq -0x8(%rbp), %rdi
callq 0xab50
xorb $-0x1, %al
testb $0x1, %al
jne 0x2290e
jmp 0x22910
jmp 0x2292f
leaq 0x1c9d9(%rip), %rdi     # 0x3f2f0
leaq 0x1c984(%rip), %rsi     # 0x3f2a2
movl $0x26, %edx
leaq 0x1ca14(%rip), %rcx     # 0x3f33e
callq 0x20c0
movq -0x8(%rbp), %rdi
callq 0xab20
xorb $-0x1, %al
testb $0x1, %al
jne 0x22940
jmp 0x22942
jmp 0x22961
leaq 0x1c9b9(%rip), %rdi     # 0x3f302
leaq 0x1c952(%rip), %rsi     # 0x3f2a2
movl $0x27, %edx
leaq 0x1c9e2(%rip), %rcx     # 0x3f33e
callq 0x20c0
movq -0x8(%rbp), %rdi
callq 0xab70
xorb $-0x1, %al
testb $0x1, %al
jne 0x22972
jmp 0x22974
jmp 0x22993
leaq 0x1c997(%rip), %rdi     # 0x3f312
leaq 0x1c920(%rip), %rsi     # 0x3f2a2
movl $0x28, %edx
leaq 0x1c9b0(%rip), %rcx     # 0x3f33e
callq 0x20c0
movq -0x8(%rbp), %rdi
callq 0xaae0
cmpl $0x4, %eax
jne 0x229a3
jmp 0x229c2
leaq 0x1c9d5(%rip), %rdi     # 0x3f37f
leaq 0x1c8f1(%rip), %rsi     # 0x3f2a2
movl $0x29, %edx
leaq 0x1c981(%rip), %rcx     # 0x3f33e
callq 0x20c0
leaq -0x8(%rbp), %rdi
movl $0x3, %esi
callq 0xa9e0
movq -0x8(%rbp), %rdi
callq 0xaae0
cmpl $0x3, %eax
jne 0x229e0
jmp 0x229ff
leaq 0x1c9b1(%rip), %rdi     # 0x3f398
leaq 0x1c8b4(%rip), %rsi     # 0x3f2a2
movl $0x2c, %edx
leaq 0x1c944(%rip), %rcx     # 0x3f33e
callq 0x20c0
leaq -0x8(%rbp), %rdi
movl $0x5, %esi
callq 0xa9e0
movq -0x8(%rbp), %rdi
callq 0xaae0
cmpl $0x5, %eax
jne 0x22a1d
jmp 0x22a3c
leaq 0x1c98f(%rip), %rdi     # 0x3f3b3
leaq 0x1c877(%rip), %rsi     # 0x3f2a2
movl $0x2f, %edx
leaq 0x1c907(%rip), %rcx     # 0x3f33e
callq 0x20c0
leaq -0x8(%rbp), %rdi
movl $0x2, %esi
callq 0xa9e0
movq -0x8(%rbp), %rdi
callq 0xaae0
cmpl $0x2, %eax
jne 0x22a5a
jmp 0x22a79
leaq 0x1c96c(%rip), %rdi     # 0x3f3cd
leaq 0x1c83a(%rip), %rsi     # 0x3f2a2
movl $0x32, %edx
leaq 0x1c8ca(%rip), %rcx     # 0x3f33e
callq 0x20c0
leaq -0x8(%rbp), %rdi
xorl %esi, %esi
callq 0xa9e0
movq -0x8(%rbp), %rdi
callq 0xaac0
cmpl $0x1, %eax
jne 0x22a94
jmp 0x22ab3
leaq 0x1bb70(%rip), %rdi     # 0x3e60b
leaq 0x1c800(%rip), %rsi     # 0x3f2a2
movl $0x35, %edx
leaq 0x1c890(%rip), %rcx     # 0x3f33e
callq 0x20c0
movq -0x8(%rbp), %rdi
callq 0xaa80
cmpl $0x31, %eax
jne 0x22ac3
jmp 0x22ae2
leaq 0x1c88f(%rip), %rdi     # 0x3f359
leaq 0x1c7d1(%rip), %rsi     # 0x3f2a2
movl $0x36, %edx
leaq 0x1c861(%rip), %rcx     # 0x3f33e
callq 0x20c0
movq -0x8(%rbp), %rdi
callq 0xaaa0
cmpl $0x39, %eax
jne 0x22af2
jmp 0x22b11
leaq 0x1c874(%rip), %rdi     # 0x3f36d
leaq 0x1c7a2(%rip), %rsi     # 0x3f2a2
movl $0x37, %edx
leaq 0x1c832(%rip), %rcx     # 0x3f33e
callq 0x20c0
movq -0x8(%rbp), %rdi
callq 0xab50
xorb $-0x1, %al
testb $0x1, %al
jne 0x22b22
jmp 0x22b24
jmp 0x22b43
leaq 0x1c7c5(%rip), %rdi     # 0x3f2f0
leaq 0x1c770(%rip), %rsi     # 0x3f2a2
movl $0x38, %edx
leaq 0x1c800(%rip), %rcx     # 0x3f33e
callq 0x20c0
movq -0x8(%rbp), %rdi
callq 0xab20
xorb $-0x1, %al
testb $0x1, %al
jne 0x22b54
jmp 0x22b56
jmp 0x22b75
leaq 0x1c7a5(%rip), %rdi     # 0x3f302
leaq 0x1c73e(%rip), %rsi     # 0x3f2a2
movl $0x39, %edx
leaq 0x1c7ce(%rip), %rcx     # 0x3f33e
callq 0x20c0
movq -0x8(%rbp), %rdi
callq 0xab70
xorb $-0x1, %al
testb $0x1, %al
jne 0x22b86
jmp 0x22b88
jmp 0x22ba7
leaq 0x1c783(%rip), %rdi     # 0x3f312
leaq 0x1c70c(%rip), %rsi     # 0x3f2a2
movl $0x3a, %edx
leaq 0x1c79c(%rip), %rcx     # 0x3f33e
callq 0x20c0
movq -0x8(%rbp), %rdi
callq 0xaae0
cmpl $0x0, %eax
jne 0x22bb7
jmp 0x22bd6
leaq 0x1c763(%rip), %rdi     # 0x3f321
leaq 0x1c6dd(%rip), %rsi     # 0x3f2a2
movl $0x3b, %edx
leaq 0x1c76d(%rip), %rcx     # 0x3f33e
callq 0x20c0
movl $0x1, %edi
movl $0x31, %esi
movl $0x38, %edx
movl $0x4, %ecx
callq 0xa890
movq %rax, -0x8(%rbp)
leaq -0x8(%rbp), %rdi
movl $0x5, %esi
callq 0xa9e0
movq -0x8(%rbp), %rdi
callq 0xaac0
cmpl $0x1, %eax
jne 0x22c11
jmp 0x22c30
leaq 0x1b9f3(%rip), %rdi     # 0x3e60b
leaq 0x1c683(%rip), %rsi     # 0x3f2a2
movl $0x40, %edx
leaq 0x1c713(%rip), %rcx     # 0x3f33e
callq 0x20c0
movq -0x8(%rbp), %rdi
callq 0xaa80
cmpl $0x31, %eax
jne 0x22c40
jmp 0x22c5f
leaq 0x1c712(%rip), %rdi     # 0x3f359
leaq 0x1c654(%rip), %rsi     # 0x3f2a2
movl $0x41, %edx
leaq 0x1c6e4(%rip), %rcx     # 0x3f33e
callq 0x20c0
movq -0x8(%rbp), %rdi
callq 0xaaa0
cmpl $0x38, %eax
jne 0x22c6f
jmp 0x22c8e
leaq 0x1c772(%rip), %rdi     # 0x3f3e8
leaq 0x1c625(%rip), %rsi     # 0x3f2a2
movl $0x42, %edx
leaq 0x1c6b5(%rip), %rcx     # 0x3f33e
callq 0x20c0
movq -0x8(%rbp), %rdi
callq 0xab50
xorb $-0x1, %al
testb $0x1, %al
jne 0x22c9f
jmp 0x22ca1
jmp 0x22cc0
leaq 0x1c648(%rip), %rdi     # 0x3f2f0
leaq 0x1c5f3(%rip), %rsi     # 0x3f2a2
movl $0x43, %edx
leaq 0x1c683(%rip), %rcx     # 0x3f33e
callq 0x20c0
movq -0x8(%rbp), %rdi
callq 0xab20
testb $0x1, %al
jne 0x22ccf
jmp 0x22cd1
jmp 0x22cf0
leaq 0x1c62b(%rip), %rdi     # 0x3f303
leaq 0x1c5c3(%rip), %rsi     # 0x3f2a2
movl $0x44, %edx
leaq 0x1c653(%rip), %rcx     # 0x3f33e
callq 0x20c0
movq -0x8(%rbp), %rdi
callq 0xab70
xorb $-0x1, %al
testb $0x1, %al
jne 0x22d01
jmp 0x22d03
jmp 0x22d22
leaq 0x1c608(%rip), %rdi     # 0x3f312
leaq 0x1c591(%rip), %rsi     # 0x3f2a2
movl $0x45, %edx
leaq 0x1c621(%rip), %rcx     # 0x3f33e
callq 0x20c0
movq -0x8(%rbp), %rdi
callq 0xaae0
cmpl $0x5, %eax
jne 0x22d32
jmp 0x22d51
leaq 0x1c67a(%rip), %rdi     # 0x3f3b3
leaq 0x1c562(%rip), %rsi     # 0x3f2a2
movl $0x46, %edx
leaq 0x1c5f2(%rip), %rcx     # 0x3f33e
callq 0x20c0
addq $0x10, %rsp
popq %rbp
retq
nopw (%rax,%rax)