// File: /workspace/github_cpp_makefile_star2_O1/niekh1234[P]nnchesslib/board.cpp
// Function: nnchesslib::ChessBoard::isValidFen(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
bool ChessBoard::isValidFen(std::string fen)
{
    // Setup variables
    std::istringstream iss(fen);
    std::string board, sideToMove, castleRights, enpassant, movecount, plycount;

    // check if fen is provided
    if(!iss) return false;

    iss >> board;

    if(!iss) return false;

    iss >> sideToMove;

    if (!iss) 
    {
        castleRights = "-";
        enpassant = "-";
    } 
    else 
    {
        iss >> castleRights;
        if (iss)
            iss >> enpassant;
        else
            enpassant = "-";
    }
    
    iss >> movecount;

    iss >> plycount;

    boardinfo.plyCount = stoi(plycount);
    boardinfo.fiftyMoveRule = stoi(movecount);

    // Let's check that all components of the supposed FEN are OK.
    // Check side to move
    if (sideToMove != "w" && sideToMove != "b") return false;
    
    // Check castling rights
    if (castleRights != "-" && castleRights != "K" && castleRights != "Kk"
        && castleRights != "Kkq" && castleRights != "Kq" && castleRights !="KQ"
        && castleRights != "KQk" && castleRights != "KQq" && castleRights != "KQkq"
        && castleRights != "k" && castleRights != "q" && castleRights != "kq"
        && castleRights != "Q" && castleRights != "Qk" && castleRights != "Qq"
        && castleRights != "Qkq")
        return false;

    // Check valid en passant
    if (enpassant != "-") {
        if (enpassant.length() != 2) return false;
        if (!(enpassant[0] >= 'a' && enpassant[0] <= 'h')) return false;
        if (!((sideToMove == "w" && enpassant[1] == '6') || (sideToMove == "b" && enpassant[1] == '3')))
            return false;
    }

    // Check valid board
    // Seven board dividers
    if (std::count(board.begin(), board.end(), '/') != 7) return false;

    // Board contains only legal characters
    for (int i = 0; i < board.length(); i++)
        if (!(board[i] == '/' || (board[i] >= '1' && board[i] <= '8')
                || board[i] == 'p' || board[i] == 'P' || board[i] == 'r' || board[i] == 'R' || 
                board[i] == 'k' || board[i] == 'K' || board[i] == 'n' || board[i] == 'N' || board[i] == 'b' || board[i] == 'B'
                || board[i] == 'q' || board[i] == 'Q'))
            return false;
    
    // Check king amount
    if (std::count(board.begin(), board.end(), 'K') != 1) return false;
    if (std::count(board.begin(), board.end(), 'k') != 1) return false;

    // Count other piece amounts
    size_t wp = std::count(board.begin(), board.end(), 'P'),
        bp = std::count(board.begin(), board.end(), 'p'),
        wn = std::count(board.begin(), board.end(), 'N'),
        bn = std::count(board.begin(), board.end(), 'n'),
        wb = std::count(board.begin(), board.end(), 'B'),
        bb = std::count(board.begin(), board.end(), 'b'),
        wr = std::count(board.begin(), board.end(), 'R'),
        br = std::count(board.begin(), board.end(), 'r'),
        wq = std::count(board.begin(), board.end(), 'Q'),
        bq = std::count(board.begin(), board.end(), 'q');

    // Check if piece count is valid
    if (wp > 8 || bp > 8 || wn > 10 || bn > 10 || wb > 10 || bb > 10
        || wr > 10 || br > 10 || wq > 9 || bq > 9
        || wp + wn + wb + wr + wq > 15 || bp + bn + bb + br + bq > 15)
        return false;

    // setting some variables now that all the checks have been passed:
    // put this in dedicated function in the future.

    // changing who's turn it is.
    if(sideToMove == "w") boardinfo.whiteToMove = true;
    else boardinfo.whiteToMove = false;

    // setting the castling rights bools
    for (auto c : castleRights)
    {
        switch(c)
        {
            case 'K':
                boardinfo.whiteCastleShort = true;
                break;
            case 'Q':
                boardinfo.whiteCastleLong = true;
                break;
            case 'k':
                boardinfo.blackCastleShort = true;
                break;
            case 'q':
                boardinfo.blackCastleLong = true;
                break;
        }
    }

    // setting en passant bitboard.
    if(enpassant != "-")
    {
        if(boardinfo.whiteToMove)  boardinfo.whiteEnPassantTarget.set(getSquareInt(enpassant), true);
        if(!boardinfo.whiteToMove) boardinfo.blackEnPassantTarget.set(getSquareInt(enpassant), true);
    }
    // All checks passed
    return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x298, %rsp            # imm = 0x298
movq %rdi, %r12
leaq -0x2c0(%rbp), %r15
movq %r15, %rdi
movl $0x8, %edx
callq 0x2250
leaq -0x80(%rbp), %r13
movq %r13, -0x10(%r13)
xorl %r14d, %r14d
movq %r14, -0x8(%r13)
movb %r14b, (%r13)
leaq -0xa0(%rbp), %rax
movq %rax, -0x10(%rax)
movq %r14, -0x8(%rax)
movb %r14b, (%rax)
leaq -0x38(%rbp), %rax
movq %rax, -0x10(%rax)
movq %r14, -0x8(%rax)
movb %r14b, (%rax)
leaq -0x58(%rbp), %rax
movq %rax, -0x10(%rax)
movq %r14, -0x8(%rax)
movb %r14b, (%rax)
leaq -0xc8(%rbp), %rax
movq %rax, -0x10(%rax)
movq %r14, -0x8(%rax)
movb %r14b, (%rax)
leaq -0x130(%rbp), %rbx
movq %rbx, -0x10(%rbx)
movq %r14, -0x8(%rbx)
movb %r14b, (%rbx)
movq (%r15), %rax
movq -0x18(%rax), %rax
testb $0x5, -0x2a0(%rbp,%rax)
jne 0x3f46
movq %r12, -0x70(%rbp)
leaq -0x2c0(%rbp), %rdi
leaq -0x90(%rbp), %rsi
callq 0x21b0
movq -0x2c0(%rbp), %rax
movq -0x18(%rax), %rax
testb $0x5, -0x2a0(%rbp,%rax)
je 0x4023
xorl %r14d, %r14d
movq -0x140(%rbp), %rdi
cmpq %rbx, %rdi
je 0x3f61
movq -0x130(%rbp), %rsi
incq %rsi
callq 0x2150
movq -0xd8(%rbp), %rdi
leaq -0xc8(%rbp), %rax
cmpq %rax, %rdi
je 0x3f83
movq -0xc8(%rbp), %rsi
incq %rsi
callq 0x2150
movq -0x68(%rbp), %rdi
leaq -0x58(%rbp), %rax
cmpq %rax, %rdi
je 0x3f9c
movq -0x58(%rbp), %rsi
incq %rsi
callq 0x2150
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x3fb5
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x2150
movq -0xb0(%rbp), %rdi
leaq -0xa0(%rbp), %rax
cmpq %rax, %rdi
je 0x3fd7
movq -0xa0(%rbp), %rsi
incq %rsi
callq 0x2150
movq -0x90(%rbp), %rdi
cmpq %r13, %rdi
je 0x3fef
movq -0x80(%rbp), %rsi
incq %rsi
callq 0x2150
movq 0x8fda(%rip), %rsi      # 0xcfd0
leaq -0x2c0(%rbp), %rdi
callq 0x21d0
leaq -0x248(%rbp), %rdi
callq 0x2070
movl %r14d, %eax
addq $0x298, %rsp            # imm = 0x298
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq -0x2c0(%rbp), %rdi
leaq -0xb0(%rbp), %rsi
callq 0x21b0
movq -0x2c0(%rbp), %rax
movq -0x18(%rax), %rax
testb $0x5, -0x2a0(%rbp,%rax)
je 0x4069
leaq -0x48(%rbp), %rdi
movq 0x8(%rdi), %rdx
leaq 0x55ac(%rip), %rcx      # 0x9606
movl $0x1, %r8d
xorl %esi, %esi
callq 0x2210
jmp 0x4092
leaq -0x2c0(%rbp), %rdi
leaq -0x48(%rbp), %rsi
callq 0x21b0
movq -0x2c0(%rbp), %rax
movq -0x18(%rax), %rax
testb $0x5, -0x2a0(%rbp,%rax)
je 0x4422
leaq -0x68(%rbp), %rdi
movq 0x8(%rdi), %rdx
leaq 0x5565(%rip), %rcx      # 0x9606
movl $0x1, %r8d
xorl %esi, %esi
callq 0x2210
leaq -0x2c0(%rbp), %rdi
leaq -0xd8(%rbp), %rsi
callq 0x21b0
leaq -0x2c0(%rbp), %rdi
leaq -0x140(%rbp), %rsi
callq 0x21b0
movq -0x140(%rbp), %r15
callq 0x2040
movq %rax, %r14
movl (%rax), %r13d
movl $0x0, (%rax)
leaq -0xe0(%rbp), %r12
movq %r15, %rdi
movq %r12, %rsi
movl $0xa, %edx
callq 0x21c0
cmpq %r15, (%r12)
je 0x47f5
movslq %eax, %rcx
cmpq %rax, %rcx
movq -0x70(%rbp), %rdx
jne 0x4801
movl (%r14), %ecx
cmpl $0x22, %ecx
je 0x4801
testl %ecx, %ecx
jne 0x4130
movl %r13d, (%r14)
movl %eax, 0x4c(%rdx)
movq -0xd8(%rbp), %r15
movl (%r14), %r13d
movl $0x0, (%r14)
movq %r15, %rdi
movq %r12, %rsi
movl $0xa, %edx
callq 0x21c0
cmpq %r15, (%r12)
je 0x480d
movabsq $-0x100000000, %rcx     # imm = 0xFFFFFFFF00000000
leaq -0x80000000(%rax), %rdx
cmpq %rcx, %rdx
jb 0x4819
movl (%r14), %ecx
cmpl $0x22, %ecx
je 0x4819
testl %ecx, %ecx
movq -0x70(%rbp), %rcx
jne 0x418f
movl %r13d, (%r14)
movl %eax, 0x48(%rcx)
leaq 0x551f(%rip), %rsi      # 0x96b8
leaq -0xb0(%rbp), %rdi
callq 0x2050
testl %eax, %eax
je 0x41cc
leaq 0x550a(%rip), %rsi      # 0x96ba
leaq -0xb0(%rbp), %rdi
callq 0x2050
testl %eax, %eax
je 0x41cc
xorl %r14d, %r14d
leaq -0x80(%rbp), %r13
jmp 0x3f46
leaq 0x5433(%rip), %rsi      # 0x9606
leaq -0x48(%rbp), %rdi
callq 0x2050
testl %eax, %eax
leaq -0x80(%rbp), %r13
je 0x4338
leaq 0x55b9(%rip), %rsi      # 0x97a8
leaq -0x48(%rbp), %rdi
callq 0x2050
testl %eax, %eax
je 0x4338
leaq 0x54b5(%rip), %rsi      # 0x96bc
leaq -0x48(%rbp), %rdi
callq 0x2050
testl %eax, %eax
je 0x4338
leaq 0x54a0(%rip), %rsi      # 0x96bf
leaq -0x48(%rbp), %rdi
callq 0x2050
testl %eax, %eax
je 0x4338
leaq 0x548c(%rip), %rsi      # 0x96c3
leaq -0x48(%rbp), %rdi
callq 0x2050
testl %eax, %eax
je 0x4338
leaq 0x5477(%rip), %rsi      # 0x96c6
leaq -0x48(%rbp), %rdi
callq 0x2050
testl %eax, %eax
je 0x4338
leaq 0x5462(%rip), %rsi      # 0x96c9
leaq -0x48(%rbp), %rdi
callq 0x2050
testl %eax, %eax
je 0x4338
leaq 0x544e(%rip), %rsi      # 0x96cd
leaq -0x48(%rbp), %rdi
callq 0x2050
testl %eax, %eax
je 0x4338
leaq 0x543a(%rip), %rsi      # 0x96d1
leaq -0x48(%rbp), %rdi
callq 0x2050
testl %eax, %eax
je 0x4338
leaq 0x540e(%rip), %rsi      # 0x96bd
leaq -0x48(%rbp), %rdi
callq 0x2050
testl %eax, %eax
je 0x4338
leaq 0x5401(%rip), %rsi      # 0x96c4
leaq -0x48(%rbp), %rdi
callq 0x2050
testl %eax, %eax
je 0x4338
leaq 0x53e9(%rip), %rsi      # 0x96c0
leaq -0x48(%rbp), %rdi
callq 0x2050
testl %eax, %eax
je 0x4338
leaq 0x53dc(%rip), %rsi      # 0x96c7
leaq -0x48(%rbp), %rdi
callq 0x2050
testl %eax, %eax
je 0x4338
leaq 0x53cb(%rip), %rsi      # 0x96ca
leaq -0x48(%rbp), %rdi
callq 0x2050
testl %eax, %eax
je 0x4338
leaq 0x53bb(%rip), %rsi      # 0x96ce
leaq -0x48(%rbp), %rdi
callq 0x2050
testl %eax, %eax
je 0x4338
leaq 0x53ab(%rip), %rsi      # 0x96d2
leaq -0x48(%rbp), %rdi
callq 0x2050
testl %eax, %eax
jne 0x3f43
leaq 0x52c7(%rip), %rsi      # 0x9606
leaq -0x68(%rbp), %rdi
callq 0x2050
testl %eax, %eax
je 0x43b1
cmpq $0x2, -0x60(%rbp)
jne 0x3f43
movq -0x68(%rbp), %rax
movb (%rax), %al
addb $-0x61, %al
cmpb $0x7, %al
ja 0x3f43
leaq 0x534a(%rip), %rsi      # 0x96b8
leaq -0xb0(%rbp), %rdi
callq 0x2050
testl %eax, %eax
jne 0x4388
movq -0x68(%rbp), %rax
cmpb $0x36, 0x1(%rax)
je 0x43b1
leaq 0x532b(%rip), %rsi      # 0x96ba
leaq -0xb0(%rbp), %rdi
callq 0x2050
testl %eax, %eax
jne 0x3f43
movq -0x68(%rbp), %rax
cmpb $0x33, 0x1(%rax)
jne 0x3f43
movq -0x88(%rbp), %rax
testq %rax, %rax
je 0x3f43
movq -0x90(%rbp), %rcx
xorl %edx, %edx
xorl %esi, %esi
xorl %edi, %edi
cmpb $0x2f, (%rcx,%rdx)
sete %dil
addq %rdi, %rsi
incq %rdx
cmpq %rdx, %rax
jne 0x43cc
cmpq $0x7, %rsi
jne 0x3f43
xorl %edx, %edx
movabsq $-0x6ff7fff16ff7fc03, %rsi # imm = 0x9008000E900803FD
movzbl (%rcx,%rdx), %edi
leal -0x2f(%rdi), %r8d
cmpl $0x3f, %r8d
ja 0x4415
btq %r8, %rsi
jae 0x4415
incq %rdx
cmpq %rdx, %rax
jne 0x43f7
jmp 0x4437
addl $-0x70, %edi
cmpl $0x3, %edi
jb 0x440b
jmp 0x3f43
leaq -0x2c0(%rbp), %rdi
leaq -0x68(%rbp), %rsi
callq 0x21b0
jmp 0x40ae
xorl %esi, %esi
xorl %edx, %edx
xorl %edi, %edi
cmpb $0x4b, (%rcx,%rsi)
sete %dil
addq %rdi, %rdx
incq %rsi
cmpq %rsi, %rax
jne 0x443b
testq %rax, %rax
sete %sil
cmpq $0x1, %rdx
setne %dl
orb %sil, %dl
jne 0x3f43
xorl %edx, %edx
xorl %esi, %esi
xorl %edi, %edi
cmpb $0x6b, (%rcx,%rdx)
sete %dil
addq %rdi, %rsi
incq %rdx
cmpq %rdx, %rax
jne 0x446b
cmpq $0x1, %rsi
jne 0x3f43
testq %rax, %rax
je 0x44ab
xorl %edx, %edx
xorl %r12d, %r12d
xorl %esi, %esi
cmpb $0x50, (%rcx,%rdx)
sete %sil
addq %rsi, %r12
incq %rdx
cmpq %rdx, %rax
jne 0x4494
jmp 0x44ae
xorl %r12d, %r12d
testq %rax, %rax
je 0x44ce
xorl %edx, %edx
xorl %esi, %esi
xorl %edi, %edi
cmpb $0x70, (%rcx,%rdx)
sete %dil
addq %rdi, %rsi
incq %rdx
cmpq %rdx, %rax
jne 0x44b7
jmp 0x44d0
xorl %esi, %esi
testq %rax, %rax
je 0x44f1
xorl %edx, %edx
xorl %edi, %edi
xorl %r8d, %r8d
cmpb $0x4e, (%rcx,%rdx)
sete %r8b
addq %r8, %rdi
incq %rdx
cmpq %rdx, %rax
jne 0x44d9
jmp 0x44f3
xorl %edi, %edi
testq %rax, %rax
je 0x4515
xorl %edx, %edx
xorl %r8d, %r8d
xorl %r9d, %r9d
cmpb $0x6e, (%rcx,%rdx)
sete %r9b
addq %r9, %r8
incq %rdx
cmpq %rdx, %rax
jne 0x44fd
jmp 0x4518
xorl %r8d, %r8d
testq %rax, %rax
je 0x453a
xorl %edx, %edx
xorl %r9d, %r9d
xorl %r10d, %r10d
cmpb $0x42, (%rcx,%rdx)
sete %r10b
addq %r10, %r9
incq %rdx
cmpq %rdx, %rax
jne 0x4522
jmp 0x453d
xorl %r9d, %r9d
testq %rax, %rax
je 0x455f
xorl %edx, %edx
xorl %r10d, %r10d
xorl %r11d, %r11d
cmpb $0x62, (%rcx,%rdx)
sete %r11b
addq %r11, %r10
incq %rdx
cmpq %rdx, %rax
jne 0x4547
jmp 0x4562
xorl %r10d, %r10d
testq %rax, %rax
je 0x4584
xorl %edx, %edx
xorl %r11d, %r11d
xorl %r14d, %r14d
cmpb $0x52, (%rcx,%rdx)
sete %r14b
addq %r14, %r11
incq %rdx
cmpq %rdx, %rax
jne 0x456c
jmp 0x4587
xorl %r11d, %r11d
testq %rax, %rax
je 0x45a9
xorl %edx, %edx
xorl %r15d, %r15d
xorl %r14d, %r14d
cmpb $0x72, (%rcx,%rdx)
sete %r14b
addq %r14, %r15
incq %rdx
cmpq %rdx, %rax
jne 0x4591
jmp 0x45ac
xorl %r15d, %r15d
testq %rax, %rax
movq %r12, -0xb8(%rbp)
je 0x45d5
xorl %edx, %edx
xorl %r12d, %r12d
xorl %r14d, %r14d
cmpb $0x51, (%rcx,%rdx)
sete %r14b
addq %r14, %r12
incq %rdx
cmpq %rdx, %rax
jne 0x45bd
jmp 0x45d8
xorl %r12d, %r12d
testq %rax, %rax
je 0x45fb
xorl %r14d, %r14d
xorl %edx, %edx
xorl %r13d, %r13d
cmpb $0x71, (%rcx,%r14)
sete %r13b
addq %r13, %rdx
incq %r14
cmpq %r14, %rax
jne 0x45e2
jmp 0x45fd
xorl %edx, %edx
xorl %r14d, %r14d
cmpq $0x8, -0xb8(%rbp)
ja 0x41c3
cmpq $0x8, %rsi
leaq -0x80(%rbp), %r13
ja 0x3f46
cmpq $0xa, %rdi
ja 0x3f46
cmpq $0xa, %r8
ja 0x3f46
cmpq $0xa, %r9
ja 0x3f46
cmpq $0xa, %r10
ja 0x3f46
cmpq $0xa, %r11
ja 0x3f46
cmpq $0xa, %r15
ja 0x3f46
cmpq $0x9, %r12
ja 0x3f46
cmpq $0x9, %rdx
ja 0x3f46
addq -0xb8(%rbp), %rdi
addq %r11, %r9
addq %rdi, %r9
addq %r12, %r9
cmpq $0xf, %r9
ja 0x3f43
addq %rsi, %r8
addq %r15, %r10
addq %r8, %r10
addq %rdx, %r10
cmpq $0xf, %r10
ja 0x3f43
leaq 0x5015(%rip), %rsi      # 0x96b8
leaq -0xb0(%rbp), %rdi
callq 0x2050
testl %eax, %eax
movq -0x70(%rbp), %r15
sete 0x40(%r15)
movq -0x40(%rbp), %rax
testq %rax, %rax
je 0x4708
movq -0x48(%rbp), %rcx
xorl %edx, %edx
movzbl (%rcx,%rdx), %esi
cmpl $0x6a, %esi
jg 0x46e3
cmpl $0x4b, %esi
je 0x46f4
cmpl $0x51, %esi
jne 0x4700
movb $0x1, 0x42(%r15)
jmp 0x4700
cmpl $0x6b, %esi
je 0x46fb
cmpl $0x71, %esi
jne 0x4700
movb $0x1, 0x44(%r15)
jmp 0x4700
movb $0x1, 0x41(%r15)
jmp 0x4700
movb $0x1, 0x43(%r15)
incq %rdx
cmpq %rdx, %rax
jne 0x46c9
leaq 0x4ef7(%rip), %rsi      # 0x9606
leaq -0x68(%rbp), %rdi
callq 0x2050
movb $0x1, %r14b
testl %eax, %eax
je 0x3f46
cmpb $0x1, 0x40(%r15)
jne 0x4784
leaq -0x110(%rbp), %r12
movq %r12, -0x10(%r12)
movq -0x68(%rbp), %rsi
movq -0x60(%rbp), %rdx
addq %rsi, %rdx
leaq -0x120(%rbp), %rdi
callq 0x6722
leaq -0x120(%rbp), %rdi
callq 0x87ea
leaq 0x58(%r15), %rdi
movl %eax, %esi
movl $0x1, %edx
callq 0x3376
movq -0x120(%rbp), %rdi
cmpq %r12, %rdi
je 0x4784
movq -0x110(%rbp), %rsi
incq %rsi
callq 0x2150
cmpb $0x0, 0x40(%r15)
jne 0x3f46
leaq -0xf0(%rbp), %r12
movq %r12, -0x10(%r12)
movq -0x68(%rbp), %rsi
movq -0x60(%rbp), %rdx
addq %rsi, %rdx
leaq -0x100(%rbp), %rdi
callq 0x6722
leaq -0x100(%rbp), %rdi
callq 0x87ea
addq $0x60, %r15
movq %r15, %rdi
movl %eax, %esi
movl $0x1, %edx
callq 0x3376
movq -0x100(%rbp), %rdi
cmpq %r12, %rdi
je 0x41c3
movq -0xf0(%rbp), %rsi
incq %rsi
callq 0x2150
jmp 0x41c3
leaq 0x5085(%rip), %rdi      # 0x9881
callq 0x20b0
leaq 0x5079(%rip), %rdi      # 0x9881
callq 0x21e0
leaq 0x506d(%rip), %rdi      # 0x9881
callq 0x20b0
leaq 0x5061(%rip), %rdi      # 0x9881
callq 0x21e0
movq %rax, %r15
movq -0x100(%rbp), %rdi
cmpq %r12, %rdi
je 0x4872
movq -0xf0(%rbp), %rsi
jmp 0x4853
movq %rax, %r15
movq -0x120(%rbp), %rdi
cmpq %r12, %rdi
je 0x4872
movq -0x110(%rbp), %rsi
incq %rsi
callq 0x2150
jmp 0x4872
jmp 0x486f
jmp 0x4861
movq %rax, %r15
cmpl $0x0, (%r14)
jne 0x4872
movl %r13d, (%r14)
jmp 0x4872
movq %rax, %r15
movq -0x140(%rbp), %rdi
cmpq %rbx, %rdi
je 0x488d
movq -0x130(%rbp), %rsi
incq %rsi
callq 0x2150
movq -0xd8(%rbp), %rdi
leaq -0xc8(%rbp), %rax
cmpq %rax, %rdi
je 0x48af
movq -0xc8(%rbp), %rsi
incq %rsi
callq 0x2150
movq -0x68(%rbp), %rdi
leaq -0x58(%rbp), %rax
cmpq %rax, %rdi
je 0x48c8
movq -0x58(%rbp), %rsi
incq %rsi
callq 0x2150
movq -0x48(%rbp), %rdi
leaq -0x38(%rbp), %rax
cmpq %rax, %rdi
je 0x48e1
movq -0x38(%rbp), %rsi
incq %rsi
callq 0x2150
movq -0xb0(%rbp), %rdi
leaq -0xa0(%rbp), %rax
cmpq %rax, %rdi
je 0x4903
movq -0xa0(%rbp), %rsi
incq %rsi
callq 0x2150
movq -0x90(%rbp), %rdi
leaq -0x80(%rbp), %rax
cmpq %rax, %rdi
je 0x491f
movq -0x80(%rbp), %rsi
incq %rsi
callq 0x2150
movq 0x86aa(%rip), %rsi      # 0xcfd0
leaq -0x2c0(%rbp), %rdi
callq 0x21d0
leaq -0x248(%rbp), %rdi
callq 0x2070
movq %r15, %rdi
callq 0x2270