// File: jswaff[P]prophet3/test/movegen__test.cpp
// Function: test_gen_king_moves()
void test_gen_king_moves() {
    position pos;

    set_pos(&pos,"8/8/3k4/2n1P3/8/8/3rP3/R3K2R b KQ - 0 1");
    move moves[20];
    move *mp = gen_king_moves(moves,&pos,true,true);
    assert((mp - moves) == 7);
    assert(is_in_move_list(to_move(KING,D6,D7),moves,mp));
    assert(is_in_move_list(to_move(KING,D6,E7),moves,mp));
    assert(is_in_move_list(to_move(KING,D6,E6),moves,mp));
    assert(is_in_move_list(to_capture(KING,D6,E5,PAWN),moves,mp));
    assert(is_in_move_list(to_move(KING,D6,D5),moves,mp));
    assert(is_in_move_list(to_move(KING,D6,C6),moves,mp));
    assert(is_in_move_list(to_move(KING,D6,C7),moves,mp));

    // flip sides
    set_pos(&pos,"8/8/3k4/2n1P3/8/8/3rP3/RN2K2R w KQ - 0 1");
    mp = gen_king_moves(moves,&pos,true,true);
    assert((mp - moves)==5);
    assert(is_in_move_list(to_move(KING,E1,F2),moves,mp));
    assert(is_in_move_list(to_move(KING,E1,F1),moves,mp));
    assert(is_in_move_list(to_move(KING,E1,D1),moves,mp)); // NOTE: illegal move
    assert(is_in_move_list(to_capture(KING,E1,D2,ROOK),moves,mp));
    move mv = to_move(KING,E1,G1);
    set_castle(&mv);
    assert(is_in_move_list(mv,moves,mp));

    // move to a corner
    set_pos(&pos,"k7/8/8/8/8/8/8/7K w - - 0 1");
    mp = gen_king_moves(moves,&pos,true,true);
    assert((mp - moves)==3);
    assert(is_in_move_list(to_move(KING,H1,G1),moves,mp));
    assert(is_in_move_list(to_move(KING,H1,G2),moves,mp));
    assert(is_in_move_list(to_move(KING,H1,H2),moves,mp));

    set_pos(&pos,"k7/8/8/8/8/8/8/7K b - - 0 1");
    mp = gen_king_moves(moves,&pos,true,true);
    assert((mp - moves)==3);
    assert(is_in_move_list(to_move(KING,A8,A7),moves,mp));
    assert(is_in_move_list(to_move(KING,A8,B7),moves,mp));
    assert(is_in_move_list(to_move(KING,A8,B8),moves,mp));

    // cannot castle while in check
    set_pos(&pos,"3k4/8/8/2N1P3/7q/8/4P3/R3K2R w KQ - 0 1");
    mp = gen_king_moves(moves,&pos,true,true);
    assert((mp - moves)==4);
    assert(is_in_move_list(to_move(KING,E1,F1),moves,mp));
    // e1f2 stays in check, but that's handled separately.
    assert(is_in_move_list(to_move(KING,E1,F2),moves,mp));
    assert(is_in_move_list(to_move(KING,E1,D1),moves,mp));
    assert(is_in_move_list(to_move(KING,E1,D2),moves,mp));


    // cannot castle if king will passed through attacked square
    set_pos(&pos,"r3k2r/8/8/8/8/5Q2/8/4K3 b kq - 0 1");
    mp = gen_king_moves(moves,&pos,true,true);
    assert((mp - moves)==6);
    assert(is_in_move_list(to_move(KING,E8,F8),moves,mp));
    assert(is_in_move_list(to_move(KING,E8,F7),moves,mp));
    assert(is_in_move_list(to_move(KING,E8,E7),moves,mp));
    assert(is_in_move_list(to_move(KING,E8,D7),moves,mp));
    assert(is_in_move_list(to_move(KING,E8,D8),moves,mp));
    mv = to_move(KING,E8,C8);
    set_castle(&mv);
    assert(is_in_move_list(mv,moves,mp)); // queenside ok, not kingside
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x280, %rsp            # imm = 0x280
leaq -0x1c8(%rbp), %rdi
leaq 0x1a3ec(%rip), %rsi     # 0x40375
callq 0xf3e0
leaq -0x270(%rbp), %rdi
leaq -0x1c8(%rbp), %rsi
movl $0x1, %ecx
movl %ecx, %edx
callq 0xb900
movq %rax, -0x278(%rbp)
movq -0x278(%rbp), %rax
leaq -0x270(%rbp), %rcx
subq %rcx, %rax
sarq $0x3, %rax
cmpq $0x7, %rax
jne 0x25fcc
jmp 0x25feb
leaq 0x1a3ca(%rip), %rdi     # 0x4039d
leaq 0x19616(%rip), %rsi     # 0x3f5f0
movl $0x105, %edx            # imm = 0x105
leaq 0x1a3c9(%rip), %rcx     # 0x403af
callq 0x20c0
movl $0x6, %edi
movl $0x13, %esi
movl $0xb, %edx
callq 0xa830
movq %rax, %rdi
leaq -0x270(%rbp), %rsi
movq -0x278(%rbp), %rdx
callq 0x14c10
testb $0x1, %al
jne 0x2601b
jmp 0x2601d
jmp 0x2603c
leaq 0x1a3a6(%rip), %rdi     # 0x403ca
leaq 0x195c5(%rip), %rsi     # 0x3f5f0
movl $0x106, %edx            # imm = 0x106
leaq 0x1a378(%rip), %rcx     # 0x403af
callq 0x20c0
movl $0x6, %edi
movl $0x13, %esi
movl $0xc, %edx
callq 0xa830
movq %rax, %rdi
leaq -0x270(%rbp), %rsi
movq -0x278(%rbp), %rdx
callq 0x14c10
testb $0x1, %al
jne 0x2606c
jmp 0x2606e
jmp 0x2608d
leaq 0x1a383(%rip), %rdi     # 0x403f8
leaq 0x19574(%rip), %rsi     # 0x3f5f0
movl $0x107, %edx            # imm = 0x107
leaq 0x1a327(%rip), %rcx     # 0x403af
callq 0x20c0
movl $0x6, %edi
movl $0x13, %esi
movl $0x14, %edx
callq 0xa830
movq %rax, %rdi
leaq -0x270(%rbp), %rsi
movq -0x278(%rbp), %rdx
callq 0x14c10
testb $0x1, %al
jne 0x260bd
jmp 0x260bf
jmp 0x260de
leaq 0x1a360(%rip), %rdi     # 0x40426
leaq 0x19523(%rip), %rsi     # 0x3f5f0
movl $0x108, %edx            # imm = 0x108
leaq 0x1a2d6(%rip), %rcx     # 0x403af
callq 0x20c0
movl $0x6, %edi
movl $0x13, %esi
movl $0x1c, %edx
movl $0x1, %ecx
callq 0xa890
movq %rax, %rdi
leaq -0x270(%rbp), %rsi
movq -0x278(%rbp), %rdx
callq 0x14c10
testb $0x1, %al
jne 0x26113
jmp 0x26115
jmp 0x26134
leaq 0x1a338(%rip), %rdi     # 0x40454
leaq 0x194cd(%rip), %rsi     # 0x3f5f0
movl $0x109, %edx            # imm = 0x109
leaq 0x1a280(%rip), %rcx     # 0x403af
callq 0x20c0
movl $0x6, %edi
movl $0x13, %esi
movl $0x1b, %edx
callq 0xa830
movq %rax, %rdi
leaq -0x270(%rbp), %rsi
movq -0x278(%rbp), %rdx
callq 0x14c10
testb $0x1, %al
jne 0x26164
jmp 0x26166
jmp 0x26185
leaq 0x1a31d(%rip), %rdi     # 0x4048a
leaq 0x1947c(%rip), %rsi     # 0x3f5f0
movl $0x10a, %edx            # imm = 0x10A
leaq 0x1a22f(%rip), %rcx     # 0x403af
callq 0x20c0
movl $0x6, %edi
movl $0x13, %esi
movl $0x12, %edx
callq 0xa830
movq %rax, %rdi
leaq -0x270(%rbp), %rsi
movq -0x278(%rbp), %rdx
callq 0x14c10
testb $0x1, %al
jne 0x261b5
jmp 0x261b7
jmp 0x261d6
leaq 0x1a2fa(%rip), %rdi     # 0x404b8
leaq 0x1942b(%rip), %rsi     # 0x3f5f0
movl $0x10b, %edx            # imm = 0x10B
leaq 0x1a1de(%rip), %rcx     # 0x403af
callq 0x20c0
movl $0x6, %edi
movl $0x13, %esi
movl $0xa, %edx
callq 0xa830
movq %rax, %rdi
leaq -0x270(%rbp), %rsi
movq -0x278(%rbp), %rdx
callq 0x14c10
testb $0x1, %al
jne 0x26206
jmp 0x26208
jmp 0x26227
leaq 0x1a2d7(%rip), %rdi     # 0x404e6
leaq 0x193da(%rip), %rsi     # 0x3f5f0
movl $0x10c, %edx            # imm = 0x10C
leaq 0x1a18d(%rip), %rcx     # 0x403af
callq 0x20c0
leaq -0x1c8(%rbp), %rdi
leaq 0x14a32(%rip), %rsi     # 0x3ac67
callq 0xf3e0
leaq -0x270(%rbp), %rdi
leaq -0x1c8(%rbp), %rsi
movl $0x1, %ecx
movl %ecx, %edx
callq 0xb900
movq %rax, -0x278(%rbp)
movq -0x278(%rbp), %rax
leaq -0x270(%rbp), %rcx
subq %rcx, %rax
sarq $0x3, %rax
cmpq $0x5, %rax
jne 0x26278
jmp 0x26297
leaq 0x1a295(%rip), %rdi     # 0x40514
leaq 0x1936a(%rip), %rsi     # 0x3f5f0
movl $0x111, %edx            # imm = 0x111
leaq 0x1a11d(%rip), %rcx     # 0x403af
callq 0x20c0
movl $0x6, %edi
movl $0x3c, %esi
movl $0x35, %edx
callq 0xa830
movq %rax, %rdi
leaq -0x270(%rbp), %rsi
movq -0x278(%rbp), %rdx
callq 0x14c10
testb $0x1, %al
jne 0x262c7
jmp 0x262c9
jmp 0x262e8
leaq 0x1a254(%rip), %rdi     # 0x40524
leaq 0x19319(%rip), %rsi     # 0x3f5f0
movl $0x112, %edx            # imm = 0x112
leaq 0x1a0cc(%rip), %rcx     # 0x403af
callq 0x20c0
movl $0x6, %edi
movl $0x3c, %esi
movl $0x3d, %edx
callq 0xa830
movq %rax, %rdi
leaq -0x270(%rbp), %rsi
movq -0x278(%rbp), %rdx
callq 0x14c10
testb $0x1, %al
jne 0x26318
jmp 0x2631a
jmp 0x26339
leaq 0x1a231(%rip), %rdi     # 0x40552
leaq 0x192c8(%rip), %rsi     # 0x3f5f0
movl $0x113, %edx            # imm = 0x113
leaq 0x1a07b(%rip), %rcx     # 0x403af
callq 0x20c0
movl $0x6, %edi
movl $0x3c, %esi
movl $0x3b, %edx
callq 0xa830
movq %rax, %rdi
leaq -0x270(%rbp), %rsi
movq -0x278(%rbp), %rdx
callq 0x14c10
testb $0x1, %al
jne 0x26369
jmp 0x2636b
jmp 0x2638a
leaq 0x1a20e(%rip), %rdi     # 0x40580
leaq 0x19277(%rip), %rsi     # 0x3f5f0
movl $0x114, %edx            # imm = 0x114
leaq 0x1a02a(%rip), %rcx     # 0x403af
callq 0x20c0
movl $0x6, %edi
movl $0x3c, %esi
movl $0x33, %edx
movl $0x4, %ecx
callq 0xa890
movq %rax, %rdi
leaq -0x270(%rbp), %rsi
movq -0x278(%rbp), %rdx
callq 0x14c10
testb $0x1, %al
jne 0x263bf
jmp 0x263c1
jmp 0x263e0
leaq 0x1a1e6(%rip), %rdi     # 0x405ae
leaq 0x19221(%rip), %rsi     # 0x3f5f0
movl $0x115, %edx            # imm = 0x115
leaq 0x19fd4(%rip), %rcx     # 0x403af
callq 0x20c0
movl $0x6, %edi
movl $0x3c, %esi
movl $0x3e, %edx
callq 0xa830
movq %rax, -0x280(%rbp)
leaq -0x280(%rbp), %rdi
callq 0xaa60
movq -0x280(%rbp), %rdi
leaq -0x270(%rbp), %rsi
movq -0x278(%rbp), %rdx
callq 0x14c10
testb $0x1, %al
jne 0x26427
jmp 0x26429
jmp 0x26448
leaq 0x1a1b4(%rip), %rdi     # 0x405e4
leaq 0x191b9(%rip), %rsi     # 0x3f5f0
movl $0x118, %edx            # imm = 0x118
leaq 0x19f6c(%rip), %rcx     # 0x403af
callq 0x20c0
leaq -0x1c8(%rbp), %rdi
leaq 0x1a1ab(%rip), %rsi     # 0x40601
callq 0xf3e0
leaq -0x270(%rbp), %rdi
leaq -0x1c8(%rbp), %rsi
movl $0x1, %ecx
movl %ecx, %edx
callq 0xb900
movq %rax, -0x278(%rbp)
movq -0x278(%rbp), %rax
leaq -0x270(%rbp), %rcx
subq %rcx, %rax
sarq $0x3, %rax
cmpq $0x3, %rax
jne 0x26499
jmp 0x264b8
leaq 0x1a17d(%rip), %rdi     # 0x4061d
leaq 0x19149(%rip), %rsi     # 0x3f5f0
movl $0x11d, %edx            # imm = 0x11D
leaq 0x19efc(%rip), %rcx     # 0x403af
callq 0x20c0
movl $0x6, %edi
movl $0x3f, %esi
movl $0x3e, %edx
callq 0xa830
movq %rax, %rdi
leaq -0x270(%rbp), %rsi
movq -0x278(%rbp), %rdx
callq 0x14c10
testb $0x1, %al
jne 0x264e8
jmp 0x264ea
jmp 0x26509
leaq 0x1a13c(%rip), %rdi     # 0x4062d
leaq 0x190f8(%rip), %rsi     # 0x3f5f0
movl $0x11e, %edx            # imm = 0x11E
leaq 0x19eab(%rip), %rcx     # 0x403af
callq 0x20c0
movl $0x6, %edi
movl $0x3f, %esi
movl $0x36, %edx
callq 0xa830
movq %rax, %rdi
leaq -0x270(%rbp), %rsi
movq -0x278(%rbp), %rdx
callq 0x14c10
testb $0x1, %al
jne 0x26539
jmp 0x2653b
jmp 0x2655a
leaq 0x1a119(%rip), %rdi     # 0x4065b
leaq 0x190a7(%rip), %rsi     # 0x3f5f0
movl $0x11f, %edx            # imm = 0x11F
leaq 0x19e5a(%rip), %rcx     # 0x403af
callq 0x20c0
movl $0x6, %edi
movl $0x3f, %esi
movl $0x37, %edx
callq 0xa830
movq %rax, %rdi
leaq -0x270(%rbp), %rsi
movq -0x278(%rbp), %rdx
callq 0x14c10
testb $0x1, %al
jne 0x2658a
jmp 0x2658c
jmp 0x265ab
leaq 0x1a0f6(%rip), %rdi     # 0x40689
leaq 0x19056(%rip), %rsi     # 0x3f5f0
movl $0x120, %edx            # imm = 0x120
leaq 0x19e09(%rip), %rcx     # 0x403af
callq 0x20c0
leaq -0x1c8(%rbp), %rdi
leaq 0x1a0fe(%rip), %rsi     # 0x406b7
callq 0xf3e0
leaq -0x270(%rbp), %rdi
leaq -0x1c8(%rbp), %rsi
movl $0x1, %ecx
movl %ecx, %edx
callq 0xb900
movq %rax, -0x278(%rbp)
movq -0x278(%rbp), %rax
leaq -0x270(%rbp), %rcx
subq %rcx, %rax
sarq $0x3, %rax
cmpq $0x3, %rax
jne 0x265fc
jmp 0x2661b
leaq 0x1a01a(%rip), %rdi     # 0x4061d
leaq 0x18fe6(%rip), %rsi     # 0x3f5f0
movl $0x124, %edx            # imm = 0x124
leaq 0x19d99(%rip), %rcx     # 0x403af
callq 0x20c0
movl $0x6, %edi
xorl %esi, %esi
movl $0x8, %edx
callq 0xa830
movq %rax, %rdi
leaq -0x270(%rbp), %rsi
movq -0x278(%rbp), %rdx
callq 0x14c10
testb $0x1, %al
jne 0x26648
jmp 0x2664a
jmp 0x26669
leaq 0x1a082(%rip), %rdi     # 0x406d3
leaq 0x18f98(%rip), %rsi     # 0x3f5f0
movl $0x125, %edx            # imm = 0x125
leaq 0x19d4b(%rip), %rcx     # 0x403af
callq 0x20c0
movl $0x6, %edi
xorl %esi, %esi
movl $0x9, %edx
callq 0xa830
movq %rax, %rdi
leaq -0x270(%rbp), %rsi
movq -0x278(%rbp), %rdx
callq 0x14c10
testb $0x1, %al
jne 0x26696
jmp 0x26698
jmp 0x266b7
leaq 0x1a062(%rip), %rdi     # 0x40701
leaq 0x18f4a(%rip), %rsi     # 0x3f5f0
movl $0x126, %edx            # imm = 0x126
leaq 0x19cfd(%rip), %rcx     # 0x403af
callq 0x20c0
movl $0x6, %edi
xorl %esi, %esi
movl $0x1, %edx
callq 0xa830
movq %rax, %rdi
leaq -0x270(%rbp), %rsi
movq -0x278(%rbp), %rdx
callq 0x14c10
testb $0x1, %al
jne 0x266e4
jmp 0x266e6
jmp 0x26705
leaq 0x1a042(%rip), %rdi     # 0x4072f
leaq 0x18efc(%rip), %rsi     # 0x3f5f0
movl $0x127, %edx            # imm = 0x127
leaq 0x19caf(%rip), %rcx     # 0x403af
callq 0x20c0
leaq -0x1c8(%rbp), %rdi
leaq 0x1a04a(%rip), %rsi     # 0x4075d
callq 0xf3e0
leaq -0x270(%rbp), %rdi
leaq -0x1c8(%rbp), %rsi
movl $0x1, %ecx
movl %ecx, %edx
callq 0xb900
movq %rax, -0x278(%rbp)
movq -0x278(%rbp), %rax
leaq -0x270(%rbp), %rcx
subq %rcx, %rax
sarq $0x3, %rax
cmpq $0x4, %rax
jne 0x26756
jmp 0x26775
leaq 0x1a028(%rip), %rdi     # 0x40785
leaq 0x18e8c(%rip), %rsi     # 0x3f5f0
movl $0x12c, %edx            # imm = 0x12C
leaq 0x19c3f(%rip), %rcx     # 0x403af
callq 0x20c0
movl $0x6, %edi
movl $0x3c, %esi
movl $0x3d, %edx
callq 0xa830
movq %rax, %rdi
leaq -0x270(%rbp), %rsi
movq -0x278(%rbp), %rdx
callq 0x14c10
testb $0x1, %al
jne 0x267a5
jmp 0x267a7
jmp 0x267c6
leaq 0x19da4(%rip), %rdi     # 0x40552
leaq 0x18e3b(%rip), %rsi     # 0x3f5f0
movl $0x12d, %edx            # imm = 0x12D
leaq 0x19bee(%rip), %rcx     # 0x403af
callq 0x20c0
movl $0x6, %edi
movl $0x3c, %esi
movl $0x35, %edx
callq 0xa830
movq %rax, %rdi
leaq -0x270(%rbp), %rsi
movq -0x278(%rbp), %rdx
callq 0x14c10
testb $0x1, %al
jne 0x267f6
jmp 0x267f8
jmp 0x26817
leaq 0x19d25(%rip), %rdi     # 0x40524
leaq 0x18dea(%rip), %rsi     # 0x3f5f0
movl $0x12f, %edx            # imm = 0x12F
leaq 0x19b9d(%rip), %rcx     # 0x403af
callq 0x20c0
movl $0x6, %edi
movl $0x3c, %esi
movl $0x3b, %edx
callq 0xa830
movq %rax, %rdi
leaq -0x270(%rbp), %rsi
movq -0x278(%rbp), %rdx
callq 0x14c10
testb $0x1, %al
jne 0x26847
jmp 0x26849
jmp 0x26868
leaq 0x19d30(%rip), %rdi     # 0x40580
leaq 0x18d99(%rip), %rsi     # 0x3f5f0
movl $0x130, %edx            # imm = 0x130
leaq 0x19b4c(%rip), %rcx     # 0x403af
callq 0x20c0
movl $0x6, %edi
movl $0x3c, %esi
movl $0x33, %edx
callq 0xa830
movq %rax, %rdi
leaq -0x270(%rbp), %rsi
movq -0x278(%rbp), %rdx
callq 0x14c10
testb $0x1, %al
jne 0x26898
jmp 0x2689a
jmp 0x268b9
leaq 0x19ef4(%rip), %rdi     # 0x40795
leaq 0x18d48(%rip), %rsi     # 0x3f5f0
movl $0x131, %edx            # imm = 0x131
leaq 0x19afb(%rip), %rcx     # 0x403af
callq 0x20c0
leaq -0x1c8(%rbp), %rdi
leaq 0x14400(%rip), %rsi     # 0x3acc7
callq 0xf3e0
leaq -0x270(%rbp), %rdi
leaq -0x1c8(%rbp), %rsi
movl $0x1, %ecx
movl %ecx, %edx
callq 0xb900
movq %rax, -0x278(%rbp)
movq -0x278(%rbp), %rax
leaq -0x270(%rbp), %rcx
subq %rcx, %rax
sarq $0x3, %rax
cmpq $0x6, %rax
jne 0x2690a
jmp 0x26929
leaq 0x19eb2(%rip), %rdi     # 0x407c3
leaq 0x18cd8(%rip), %rsi     # 0x3f5f0
movl $0x137, %edx            # imm = 0x137
leaq 0x19a8b(%rip), %rcx     # 0x403af
callq 0x20c0
movl $0x6, %edi
movl $0x4, %esi
movl $0x5, %edx
callq 0xa830
movq %rax, %rdi
leaq -0x270(%rbp), %rsi
movq -0x278(%rbp), %rdx
callq 0x14c10
testb $0x1, %al
jne 0x26959
jmp 0x2695b
jmp 0x2697a
leaq 0x19e71(%rip), %rdi     # 0x407d3
leaq 0x18c87(%rip), %rsi     # 0x3f5f0
movl $0x138, %edx            # imm = 0x138
leaq 0x19a3a(%rip), %rcx     # 0x403af
callq 0x20c0
movl $0x6, %edi
movl $0x4, %esi
movl $0xd, %edx
callq 0xa830
movq %rax, %rdi
leaq -0x270(%rbp), %rsi
movq -0x278(%rbp), %rdx
callq 0x14c10
testb $0x1, %al
jne 0x269aa
jmp 0x269ac
jmp 0x269cb
leaq 0x19e4e(%rip), %rdi     # 0x40801
leaq 0x18c36(%rip), %rsi     # 0x3f5f0
movl $0x139, %edx            # imm = 0x139
leaq 0x199e9(%rip), %rcx     # 0x403af
callq 0x20c0
movl $0x6, %edi
movl $0x4, %esi
movl $0xc, %edx
callq 0xa830
movq %rax, %rdi
leaq -0x270(%rbp), %rsi
movq -0x278(%rbp), %rdx
callq 0x14c10
testb $0x1, %al
jne 0x269fb
jmp 0x269fd
jmp 0x26a1c
leaq 0x19e2b(%rip), %rdi     # 0x4082f
leaq 0x18be5(%rip), %rsi     # 0x3f5f0
movl $0x13a, %edx            # imm = 0x13A
leaq 0x19998(%rip), %rcx     # 0x403af
callq 0x20c0
movl $0x6, %edi
movl $0x4, %esi
movl $0xb, %edx
callq 0xa830
movq %rax, %rdi
leaq -0x270(%rbp), %rsi
movq -0x278(%rbp), %rdx
callq 0x14c10
testb $0x1, %al
jne 0x26a4c
jmp 0x26a4e
jmp 0x26a6d
leaq 0x19e08(%rip), %rdi     # 0x4085d
leaq 0x18b94(%rip), %rsi     # 0x3f5f0
movl $0x13b, %edx            # imm = 0x13B
leaq 0x19947(%rip), %rcx     # 0x403af
callq 0x20c0
movl $0x6, %edi
movl $0x4, %esi
movl $0x3, %edx
callq 0xa830
movq %rax, %rdi
leaq -0x270(%rbp), %rsi
movq -0x278(%rbp), %rdx
callq 0x14c10
testb $0x1, %al
jne 0x26a9d
jmp 0x26a9f
jmp 0x26abe
leaq 0x19de5(%rip), %rdi     # 0x4088b
leaq 0x18b43(%rip), %rsi     # 0x3f5f0
movl $0x13c, %edx            # imm = 0x13C
leaq 0x198f6(%rip), %rcx     # 0x403af
callq 0x20c0
movl $0x6, %edi
movl $0x4, %esi
movl $0x2, %edx
callq 0xa830
movq %rax, -0x280(%rbp)
leaq -0x280(%rbp), %rdi
callq 0xaa60
movq -0x280(%rbp), %rdi
leaq -0x270(%rbp), %rsi
movq -0x278(%rbp), %rdx
callq 0x14c10
testb $0x1, %al
jne 0x26b05
jmp 0x26b07
jmp 0x26b26
leaq 0x19ad6(%rip), %rdi     # 0x405e4
leaq 0x18adb(%rip), %rsi     # 0x3f5f0
movl $0x13f, %edx            # imm = 0x13F
leaq 0x1988e(%rip), %rcx     # 0x403af
callq 0x20c0
addq $0x280, %rsp            # imm = 0x280
popq %rbp
retq
nop