// File: bjohnsonfl[P]Overhead-Chess-Engine-/position.cpp
// Function: position::do_move(move, returnState&)
void position::do_move(move m, returnState& newState)
{
   //castling
    //capturing
    //promoting
    //enpassent
    //update pieces
    
    if(m == move(86230))
    {
        printBoard();
        
    }

    newState.fiftyMove = state -> fiftyMove;
    newState.enPassent = state -> enPassent;
    newState.castling = state -> castling;
    newState.captured = state -> captured;
    newState.m = state -> m;
    newState.material[0] = state -> material[0];
    newState.material[1] = state -> material[1];
    
    //absolute pinned and pinners will be calculated later
    newState.prev = state;
    state = &newState;
    
    player us = get_sideToPlay();
    player them = player (!us);
    square from = source_sq(m);
    square to = destination_sq(m);
    moveFlag flag = move_flag(m);
    piece movingPiece = board[from];
    
    bool capture = false;
    piece captured =  not_piece;
    if((get_pieces(them) & squareBitMask[to]) && (flag != castling)){
        capture = true;
        captured = board[to];
        if(captured == b_king)
        {
           // std::cout<<"captured king\n";
            //printBoard();
        }
    }
    else{
        state -> captured = not_piece;
    }
    
    
    if(flag == castling)
    {
       
        square a_1 = us == white ? a1 : a8;
        square h_1 = us == white ? h1 : h8;
        piece king = us == white ? w_king : b_king;
        piece rook = us == white ? w_rook : b_rook;
        if(to == a_1)
        {
            square newKingSq =  us == white ? c1 : c8;
            square newRookSq =  us == white ? d1 : d8;
            remove_piece(from, king);
           // printBitboard(pieces[king]);
            remove_piece(to, rook);
            place_piece(newKingSq, king);
          //  printBitboard(pieces[king]);
            place_piece(newRookSq, rook);
            
            
        }
        else
        {
            square newKingSq =  us == white ? g1 : g8;
            square newRookSq =  us == white ? f1 : f8;
            remove_piece(from, king);
            //printBitboard(pieces[king]);
            remove_piece(to, rook);
            place_piece(newKingSq, king);
            //printBitboard(pieces[king]);
            place_piece(newRookSq, rook);
        }
        
        if(us == white) {
            state -> castling &= (~ W_OO);
            state -> castling &= (~ W_OOO);
        }
        else {
            state -> castling &= (~ B_OO);
            state -> castling &= (~ B_OOO);
        }
        state->captured = not_piece;
    }
    
    
    if(capture && (flag != castling))
    {
        //debug
       // printBoard();
        ++count;
       // std::cout <<count <<"\n";
        bitboard pieceColor = 0;
       
        if (us == white)
        {
            pieceColor = allWhitePieces;
        
        }
        else {
             pieceColor = allBlackPieces;
        }
        
        if(m == move(196) || m == move(2281))
        {
           // printBoard();
            //printBitboard(pieceColor);
        }
        ///////////////
        state -> captured = captured;
        remove_piece (to, captured);
        remove_piece (from, movingPiece);
        place_piece(to, movingPiece);
        state->fiftyMove = 0;
        
        bitboard pieceColor2 = 0;
        if (us == white)
        {
            pieceColor2= allWhitePieces;
            
        }
        else {
            pieceColor2 = allBlackPieces;
        }
        if(popcount(pieceColor2) < popcount(pieceColor2))
        {
            printBoard();
            printBitboard(pieceColor2);
            std::cout << "fail\n";
        }
        state->material[them] =  value(state->material[them] - pieceValue[piece_To_Piecetype(captured) + 1]);
    }
    
    if(flag == enPass)
    {
        state -> captured = captured;
        square enPsq = state -> enPassent;
        square capturedPawn = us == white ? square(enPsq + south) : square(enPsq + nort);
        remove_piece(from, movingPiece);
        remove_piece(capturedPawn, board[capturedPawn]);
        place_piece(enPsq, movingPiece);
        state->fiftyMove = 0;
        state->material[them] =  value(state->material[them] - pieceValue[p_pawn + 1]);
    }
    
    if(( flag == regular  || flag == promoting )&& !capture)
    {
        remove_piece(from, movingPiece);
        place_piece(to, movingPiece);
        
    }
    
   //Reset enPassent flag
    state -> enPassent = empty;
    
    if(movingPiece == w_pawn || movingPiece == b_pawn)
    {
        if(flag == promoting)
        {
            remove_piece(to, movingPiece);
            piece promo = piece(promo_pieceType(m));
            if(us == black) promo = piece(promo + 6);
            place_piece(to, promo);
            
            //remove pawn material and add promoting material
            state->material[us] =  value(state->material[us] - pieceValue[piece_To_Piecetype(movingPiece) + 1]);
            state->material[us] =  value(state->material[us] + pieceValue[piece_To_Piecetype(promo) + 1]);
        }
        if((us == white) && ((to - from) == 16)){
            bitboard attacks = attacksFromPawn(square(to + south ), us) & get_pieces(them, p_pawn);
            if(attacks) state -> enPassent = square(to + south );
        }
        if((us == black) && ((from - to) == 16))
        {
            bitboard attacks = attacksFromPawn(square(to + nort ), us) & get_pieces(them, p_pawn);
            if(attacks) state -> enPassent = square(to + nort );
        }
        state->fiftyMove = 0;
    }
    
    
    if(state->castling)
    {
        //KING MOVES
        if(movingPiece == w_king) state->castling = state->castling & (~ W_OO) & ( ~ W_OOO);
        else if (movingPiece == b_king) state->castling = state->castling & (~ B_OO) & ( ~ B_OOO);
        //ROOK MOVES
        else if(movingPiece == w_rook && (from == a1)) state -> castling = state -> castling & ( ~ W_OOO);
        else if(movingPiece == w_rook && (from == h1)) state -> castling = state -> castling & ( ~ W_OO);
        else if(movingPiece == b_rook && (from == a8)) state -> castling = state -> castling & ( ~ B_OOO);
        else if(movingPiece == b_rook && (from == h8)) state -> castling = state -> castling & ( ~ B_OO);
        //ROOK CAPTURED
        else if(captured == w_rook && (to == a1)) state -> castling = state -> castling & ( ~ W_OOO);
        else if(captured == w_rook && (to == h1)) state -> castling = state -> castling & ( ~ W_OO);
        else if(captured == b_rook && (to == a8)) state -> castling = state -> castling & ( ~ B_OOO);
        else if(captured == b_rook && (to == h8)) state -> castling = state -> castling & ( ~ B_OO);
        
    }
    
    ++ply;
    ++nodes;
    sideToPlay = them;
    state->m = m;
    update_check_boards(state);
    
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xc0, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x90(%rbp)
cmpl $0x150d6, -0xc(%rbp)    # imm = 0x150D6
jne 0x8726
movq -0x90(%rbp), %rdi
callq 0x9120
movq -0x90(%rbp), %rdi
movq 0x188(%rdi), %rax
movl (%rax), %ecx
movq -0x18(%rbp), %rax
movl %ecx, (%rax)
movq 0x188(%rdi), %rax
movl 0x4(%rax), %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x4(%rax)
movq 0x188(%rdi), %rax
movl 0x8(%rax), %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x8(%rax)
movq 0x188(%rdi), %rax
movl 0xc(%rax), %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0xc(%rax)
movq 0x188(%rdi), %rax
movl 0x10(%rax), %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x10(%rax)
movq 0x188(%rdi), %rax
movl 0x40(%rax), %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x40(%rax)
movq 0x188(%rdi), %rax
movl 0x44(%rax), %ecx
movq -0x18(%rbp), %rax
movl %ecx, 0x44(%rax)
movq 0x188(%rdi), %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x18(%rbp), %rax
movq %rax, 0x188(%rdi)
callq 0x75c0
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x1c(%rbp)
setne %al
xorb $-0x1, %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x20(%rbp)
movl -0xc(%rbp), %edi
callq 0x7860
movl %eax, -0x24(%rbp)
movl -0xc(%rbp), %edi
callq 0x7870
movl %eax, -0x28(%rbp)
movl -0xc(%rbp), %edi
callq 0x78b0
movq -0x90(%rbp), %rdi
movl %eax, -0x2c(%rbp)
movl -0x24(%rbp), %eax
movl (%rdi,%rax,4), %eax
movl %eax, -0x30(%rbp)
movb $0x0, -0x31(%rbp)
movl $0xc, -0x38(%rbp)
movl -0x20(%rbp), %esi
callq 0x7600
movl -0x28(%rbp), %ecx
movl %ecx, %edx
leaq 0xa67b(%rip), %rcx      # 0x12ea0
andq (%rcx,%rdx,8), %rax
cmpq $0x0, %rax
je 0x8853
cmpl $0x2, -0x2c(%rbp)
je 0x8853
movq -0x90(%rbp), %rax
movb $0x1, -0x31(%rbp)
movl -0x28(%rbp), %ecx
movl (%rax,%rcx,4), %eax
movl %eax, -0x38(%rbp)
cmpl $0xb, -0x38(%rbp)
jne 0x8851
jmp 0x8851
jmp 0x8868
movq -0x90(%rbp), %rax
movq 0x188(%rax), %rax
movl $0xc, 0xc(%rax)
cmpl $0x2, -0x2c(%rbp)
jne 0x8a24
movl -0x1c(%rbp), %edx
movl $0x38, %eax
xorl %ecx, %ecx
cmpl $0x0, %edx
cmovel %ecx, %eax
movl %eax, -0x3c(%rbp)
movl -0x1c(%rbp), %edx
movl $0x3f, %eax
movl $0x7, %ecx
cmpl $0x0, %edx
cmovel %ecx, %eax
movl %eax, -0x40(%rbp)
movl -0x1c(%rbp), %edx
movl $0xb, %eax
movl $0x5, %ecx
cmpl $0x0, %edx
cmovel %ecx, %eax
movl %eax, -0x44(%rbp)
movl -0x1c(%rbp), %edx
movl $0x9, %eax
movl $0x3, %ecx
cmpl $0x0, %edx
cmovel %ecx, %eax
movl %eax, -0x48(%rbp)
movl -0x28(%rbp), %eax
cmpl -0x3c(%rbp), %eax
jne 0x8945
movq -0x90(%rbp), %rdi
movl -0x1c(%rbp), %edx
movl $0x3a, %eax
movl $0x2, %ecx
cmpl $0x0, %edx
cmovel %ecx, %eax
movl %eax, -0x4c(%rbp)
movl -0x1c(%rbp), %edx
movl $0x3b, %eax
movl $0x3, %ecx
cmpl $0x0, %edx
cmovel %ecx, %eax
movl %eax, -0x50(%rbp)
movl -0x24(%rbp), %esi
movl -0x44(%rbp), %edx
callq 0x9200
movq -0x90(%rbp), %rdi
movl -0x28(%rbp), %esi
movl -0x48(%rbp), %edx
callq 0x9200
movq -0x90(%rbp), %rdi
movl -0x4c(%rbp), %esi
movl -0x44(%rbp), %edx
callq 0x8600
movq -0x90(%rbp), %rdi
movl -0x50(%rbp), %esi
movl -0x48(%rbp), %edx
callq 0x8600
jmp 0x89b9
movq -0x90(%rbp), %rdi
movl -0x1c(%rbp), %edx
movl $0x3e, %eax
movl $0x6, %ecx
cmpl $0x0, %edx
cmovel %ecx, %eax
movl %eax, -0x54(%rbp)
movl -0x1c(%rbp), %edx
movl $0x3d, %eax
movl $0x5, %ecx
cmpl $0x0, %edx
cmovel %ecx, %eax
movl %eax, -0x58(%rbp)
movl -0x24(%rbp), %esi
movl -0x44(%rbp), %edx
callq 0x9200
movq -0x90(%rbp), %rdi
movl -0x28(%rbp), %esi
movl -0x48(%rbp), %edx
callq 0x9200
movq -0x90(%rbp), %rdi
movl -0x54(%rbp), %esi
movl -0x44(%rbp), %edx
callq 0x8600
movq -0x90(%rbp), %rdi
movl -0x58(%rbp), %esi
movl -0x48(%rbp), %edx
callq 0x8600
cmpl $0x0, -0x1c(%rbp)
jne 0x89e8
movq -0x90(%rbp), %rax
movq 0x188(%rax), %rcx
movl 0x8(%rcx), %edx
andl $-0x2, %edx
movl %edx, 0x8(%rcx)
movq 0x188(%rax), %rax
movl 0x8(%rax), %ecx
andl $-0x3, %ecx
movl %ecx, 0x8(%rax)
jmp 0x8a0f
movq -0x90(%rbp), %rax
movq 0x188(%rax), %rcx
movl 0x8(%rcx), %edx
andl $-0x5, %edx
movl %edx, 0x8(%rcx)
movq 0x188(%rax), %rax
movl 0x8(%rax), %ecx
andl $-0x9, %ecx
movl %ecx, 0x8(%rax)
movq -0x90(%rbp), %rax
movq 0x188(%rax), %rax
movl $0xc, 0xc(%rax)
testb $0x1, -0x31(%rbp)
je 0x8bbb
cmpl $0x2, -0x2c(%rbp)
je 0x8bbb
movl 0xeebb2(%rip), %eax     # 0xf75f0
addl $0x1, %eax
movl %eax, 0xeeba9(%rip)     # 0xf75f0
movq $0x0, -0x60(%rbp)
cmpl $0x0, -0x1c(%rbp)
jne 0x8a69
movq -0x90(%rbp), %rax
movq 0x160(%rax), %rax
movq %rax, -0x60(%rbp)
jmp 0x8a7b
movq -0x90(%rbp), %rax
movq 0x168(%rax), %rax
movq %rax, -0x60(%rbp)
cmpl $0xc4, -0xc(%rbp)
je 0x8a8d
cmpl $0x8e9, -0xc(%rbp)      # imm = 0x8E9
jne 0x8a8f
jmp 0x8a8f
movq -0x90(%rbp), %rdi
movl -0x38(%rbp), %ecx
movq 0x188(%rdi), %rax
movl %ecx, 0xc(%rax)
movl -0x28(%rbp), %esi
movl -0x38(%rbp), %edx
callq 0x9200
movq -0x90(%rbp), %rdi
movl -0x24(%rbp), %esi
movl -0x30(%rbp), %edx
callq 0x9200
movq -0x90(%rbp), %rdi
movl -0x28(%rbp), %esi
movl -0x30(%rbp), %edx
callq 0x8600
movq -0x90(%rbp), %rax
movq 0x188(%rax), %rax
movl $0x0, (%rax)
movq $0x0, -0x68(%rbp)
cmpl $0x0, -0x1c(%rbp)
jne 0x8b08
movq -0x90(%rbp), %rax
movq 0x160(%rax), %rax
movq %rax, -0x68(%rbp)
jmp 0x8b1a
movq -0x90(%rbp), %rax
movq 0x168(%rax), %rax
movq %rax, -0x68(%rbp)
movq -0x68(%rbp), %rdi
callq 0x3fa0
movl %eax, -0x94(%rbp)
movq -0x68(%rbp), %rdi
callq 0x3fa0
movl %eax, %ecx
movl -0x94(%rbp), %eax
cmpl %ecx, %eax
jge 0x8b66
movq -0x90(%rbp), %rdi
callq 0x9120
movq -0x68(%rbp), %rdi
callq 0x58f0
movq 0x946e(%rip), %rdi      # 0x11fc8
leaq 0x5854(%rip), %rsi      # 0xe3b5
callq 0x31e0
movq -0x90(%rbp), %rax
movq 0x188(%rax), %rax
movl -0x20(%rbp), %ecx
movl 0x40(%rax,%rcx,4), %eax
movl %eax, -0x98(%rbp)
movl -0x38(%rbp), %edi
callq 0xa0d0
movl -0x98(%rbp), %edi
addl $0x1, %eax
movslq %eax, %rcx
leaq 0x9684(%rip), %rax      # 0x12220
movl (%rax,%rcx,4), %esi
callq 0xa0b0
movl %eax, %edx
movq -0x90(%rbp), %rax
movq 0x188(%rax), %rax
movl -0x20(%rbp), %ecx
movl %edx, 0x40(%rax,%rcx,4)
cmpl $0x1, -0x2c(%rbp)
jne 0x8c90
movq -0x90(%rbp), %rax
movl -0x38(%rbp), %edx
movq 0x188(%rax), %rcx
movl %edx, 0xc(%rcx)
movq 0x188(%rax), %rax
movl 0x4(%rax), %eax
movl %eax, -0x6c(%rbp)
cmpl $0x0, -0x1c(%rbp)
jne 0x8bfa
movl -0x6c(%rbp), %eax
addl $-0x8, %eax
movl %eax, -0x9c(%rbp)
jmp 0x8c06
movl -0x6c(%rbp), %eax
addl $0x8, %eax
movl %eax, -0x9c(%rbp)
movq -0x90(%rbp), %rdi
movl -0x9c(%rbp), %eax
movl %eax, -0x70(%rbp)
movl -0x24(%rbp), %esi
movl -0x30(%rbp), %edx
callq 0x9200
movq -0x90(%rbp), %rdi
movl -0x70(%rbp), %esi
movl -0x70(%rbp), %eax
movl (%rdi,%rax,4), %edx
callq 0x9200
movq -0x90(%rbp), %rdi
movl -0x6c(%rbp), %esi
movl -0x30(%rbp), %edx
callq 0x8600
movq -0x90(%rbp), %rax
movq 0x188(%rax), %rcx
movl $0x0, (%rcx)
movq 0x188(%rax), %rax
movl -0x20(%rbp), %ecx
movl 0x40(%rax,%rcx,4), %edi
leaq 0x95af(%rip), %rax      # 0x12220
movl 0x4(%rax), %esi
callq 0xa0b0
movl %eax, %edx
movq -0x90(%rbp), %rax
movq 0x188(%rax), %rax
movl -0x20(%rbp), %ecx
movl %edx, 0x40(%rax,%rcx,4)
cmpl $0x0, -0x2c(%rbp)
je 0x8c9c
cmpl $0x3, -0x2c(%rbp)
jne 0x8cc6
testb $0x1, -0x31(%rbp)
jne 0x8cc6
movq -0x90(%rbp), %rdi
movl -0x24(%rbp), %esi
movl -0x30(%rbp), %edx
callq 0x9200
movq -0x90(%rbp), %rdi
movl -0x28(%rbp), %esi
movl -0x30(%rbp), %edx
callq 0x8600
movq -0x90(%rbp), %rax
movq 0x188(%rax), %rax
movl $0x40, 0x4(%rax)
cmpl $0x0, -0x30(%rbp)
je 0x8ceb
cmpl $0x6, -0x30(%rbp)
jne 0x8ece
cmpl $0x3, -0x2c(%rbp)
jne 0x8dd6
movq -0x90(%rbp), %rdi
movl -0x28(%rbp), %esi
movl -0x30(%rbp), %edx
callq 0x9200
movl -0xc(%rbp), %edi
callq 0x7890
movl %eax, -0x74(%rbp)
cmpl $0x1, -0x1c(%rbp)
jne 0x8d21
movl -0x74(%rbp), %eax
addl $0x6, %eax
movl %eax, -0x74(%rbp)
movq -0x90(%rbp), %rdi
movl -0x28(%rbp), %esi
movl -0x74(%rbp), %edx
callq 0x8600
movq -0x90(%rbp), %rax
movq 0x188(%rax), %rax
movl -0x1c(%rbp), %ecx
movl 0x40(%rax,%rcx,4), %eax
movl %eax, -0xa4(%rbp)
movl -0x30(%rbp), %edi
callq 0xa0d0
movl -0xa4(%rbp), %edi
addl $0x1, %eax
movslq %eax, %rcx
leaq 0x94b7(%rip), %rax      # 0x12220
movl (%rax,%rcx,4), %esi
callq 0xa0b0
movl %eax, %esi
movq -0x90(%rbp), %rax
movq 0x188(%rax), %rcx
movl -0x1c(%rbp), %edx
movl %esi, 0x40(%rcx,%rdx,4)
movq 0x188(%rax), %rax
movl -0x1c(%rbp), %ecx
movl 0x40(%rax,%rcx,4), %eax
movl %eax, -0xa0(%rbp)
movl -0x74(%rbp), %edi
callq 0xa0d0
movl -0xa0(%rbp), %edi
addl $0x1, %eax
movslq %eax, %rcx
leaq 0x9469(%rip), %rax      # 0x12220
movl (%rax,%rcx,4), %esi
callq 0xa0f0
movl %eax, %edx
movq -0x90(%rbp), %rax
movq 0x188(%rax), %rax
movl -0x1c(%rbp), %ecx
movl %edx, 0x40(%rax,%rcx,4)
cmpl $0x0, -0x1c(%rbp)
jne 0x8e45
movl -0x28(%rbp), %eax
subl -0x24(%rbp), %eax
cmpl $0x10, %eax
jne 0x8e45
movq -0x90(%rbp), %rdi
movl -0x28(%rbp), %esi
addl $-0x8, %esi
movl -0x1c(%rbp), %edx
callq 0xa110
movq -0x90(%rbp), %rdi
movq %rax, -0xb0(%rbp)
movl -0x20(%rbp), %esi
xorl %edx, %edx
callq 0x76b0
movq %rax, %rcx
movq -0xb0(%rbp), %rax
andq %rcx, %rax
movq %rax, -0x80(%rbp)
cmpq $0x0, -0x80(%rbp)
je 0x8e43
movq -0x90(%rbp), %rax
movl -0x28(%rbp), %ecx
addl $-0x8, %ecx
movq 0x188(%rax), %rax
movl %ecx, 0x4(%rax)
jmp 0x8e45
cmpl $0x1, -0x1c(%rbp)
jne 0x8eba
movl -0x24(%rbp), %eax
subl -0x28(%rbp), %eax
cmpl $0x10, %eax
jne 0x8eba
movq -0x90(%rbp), %rdi
movl -0x28(%rbp), %esi
addl $0x8, %esi
movl -0x1c(%rbp), %edx
callq 0xa110
movq -0x90(%rbp), %rdi
movq %rax, -0xb8(%rbp)
movl -0x20(%rbp), %esi
xorl %edx, %edx
callq 0x76b0
movq %rax, %rcx
movq -0xb8(%rbp), %rax
andq %rcx, %rax
movq %rax, -0x88(%rbp)
cmpq $0x0, -0x88(%rbp)
je 0x8eb8
movq -0x90(%rbp), %rax
movl -0x28(%rbp), %ecx
addl $0x8, %ecx
movq 0x188(%rax), %rax
movl %ecx, 0x4(%rax)
jmp 0x8eba
movq -0x90(%rbp), %rax
movq 0x188(%rax), %rax
movl $0x0, (%rax)
movq -0x90(%rbp), %rax
movq 0x188(%rax), %rax
cmpl $0x0, 0x8(%rax)
je 0x90bf
cmpl $0x5, -0x30(%rbp)
jne 0x8f12
movq -0x90(%rbp), %rax
movq 0x188(%rax), %rcx
movl 0x8(%rcx), %ecx
andl $-0x2, %ecx
andl $-0x3, %ecx
movq 0x188(%rax), %rax
movl %ecx, 0x8(%rax)
jmp 0x90bd
cmpl $0xb, -0x30(%rbp)
jne 0x8f3e
movq -0x90(%rbp), %rax
movq 0x188(%rax), %rcx
movl 0x8(%rcx), %ecx
andl $-0x5, %ecx
andl $-0x9, %ecx
movq 0x188(%rax), %rax
movl %ecx, 0x8(%rax)
jmp 0x90bb
cmpl $0x3, -0x30(%rbp)
jne 0x8f6d
cmpl $0x0, -0x24(%rbp)
jne 0x8f6d
movq -0x90(%rbp), %rax
movq 0x188(%rax), %rcx
movl 0x8(%rcx), %ecx
andl $-0x3, %ecx
movq 0x188(%rax), %rax
movl %ecx, 0x8(%rax)
jmp 0x90b9
cmpl $0x3, -0x30(%rbp)
jne 0x8f9c
cmpl $0x7, -0x24(%rbp)
jne 0x8f9c
movq -0x90(%rbp), %rax
movq 0x188(%rax), %rcx
movl 0x8(%rcx), %ecx
andl $-0x2, %ecx
movq 0x188(%rax), %rax
movl %ecx, 0x8(%rax)
jmp 0x90b7
cmpl $0x9, -0x30(%rbp)
jne 0x8fcb
cmpl $0x38, -0x24(%rbp)
jne 0x8fcb
movq -0x90(%rbp), %rax
movq 0x188(%rax), %rcx
movl 0x8(%rcx), %ecx
andl $-0x9, %ecx
movq 0x188(%rax), %rax
movl %ecx, 0x8(%rax)
jmp 0x90b5
cmpl $0x9, -0x30(%rbp)
jne 0x8ffa
cmpl $0x3f, -0x24(%rbp)
jne 0x8ffa
movq -0x90(%rbp), %rax
movq 0x188(%rax), %rcx
movl 0x8(%rcx), %ecx
andl $-0x5, %ecx
movq 0x188(%rax), %rax
movl %ecx, 0x8(%rax)
jmp 0x90b3
cmpl $0x3, -0x38(%rbp)
jne 0x9029
cmpl $0x0, -0x28(%rbp)
jne 0x9029
movq -0x90(%rbp), %rax
movq 0x188(%rax), %rcx
movl 0x8(%rcx), %ecx
andl $-0x3, %ecx
movq 0x188(%rax), %rax
movl %ecx, 0x8(%rax)
jmp 0x90b1
cmpl $0x3, -0x38(%rbp)
jne 0x9055
cmpl $0x7, -0x28(%rbp)
jne 0x9055
movq -0x90(%rbp), %rax
movq 0x188(%rax), %rcx
movl 0x8(%rcx), %ecx
andl $-0x2, %ecx
movq 0x188(%rax), %rax
movl %ecx, 0x8(%rax)
jmp 0x90af
cmpl $0x9, -0x38(%rbp)
jne 0x9081
cmpl $0x38, -0x28(%rbp)
jne 0x9081
movq -0x90(%rbp), %rax
movq 0x188(%rax), %rcx
movl 0x8(%rcx), %ecx
andl $-0x9, %ecx
movq 0x188(%rax), %rax
movl %ecx, 0x8(%rax)
jmp 0x90ad
cmpl $0x9, -0x38(%rbp)
jne 0x90ab
cmpl $0x3f, -0x28(%rbp)
jne 0x90ab
movq -0x90(%rbp), %rax
movq 0x188(%rax), %rcx
movl 0x8(%rcx), %ecx
andl $-0x5, %ecx
movq 0x188(%rax), %rax
movl %ecx, 0x8(%rax)
jmp 0x90ad
jmp 0x90af
jmp 0x90b1
jmp 0x90b3
jmp 0x90b5
jmp 0x90b7
jmp 0x90b9
jmp 0x90bb
jmp 0x90bd
jmp 0x90bf
movq -0x90(%rbp), %rdi
movl 0x178(%rdi), %eax
addl $0x1, %eax
movl %eax, 0x178(%rdi)
movq 0x180(%rdi), %rax
addq $0x1, %rax
movq %rax, 0x180(%rdi)
movl -0x20(%rbp), %eax
movl %eax, 0x17c(%rdi)
movl -0xc(%rbp), %ecx
movq 0x188(%rdi), %rax
movl %ecx, 0x10(%rax)
movq 0x188(%rdi), %rsi
callq 0x8460
addq $0xc0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)