// File: /workspace/github_c_makefile_star2_O3/ArchLuke[P]YouSuck/Engine.c
// Function: GenerateAllMoves
static
void GenerateAllMoves(const S_BOARD *pos, S_MOVELIST *list, int cap_only) {
    
    
    list->count = 0;    
    
    int pce = EMPTY;
    int side = pos->side;
    int sq = 0; int t_sq = 0;
    int pceNum = 0;
    int dir = 0;
    int index = 0;
    int pceIndex = 0;
    
    if(side == WHITE) {
        
        for(pceNum = 0; pceNum < pos->pceNum[wP]; ++pceNum) {
            sq = pos->pList[wP][pceNum];
            
            if(pos->pieces[sq + 10] == EMPTY && !cap_only) {
                AddPawnMove(pos, sq, sq+10, list);
                if(RanksBrd[sq] == RANK_2 && pos->pieces[sq + 20] == EMPTY) {
                    AddQuietMove(pos, MOVE(sq,(sq+20),EMPTY,EMPTY,MFLAGPS),list);
                }
            }
            
            if(!SQOFFBOARD(sq + 9) && PieceCol[pos->pieces[sq + 9]] == BLACK) {
                AddPawnCapMove(pos, sq, sq+9, pos->pieces[sq + 9], list);
            }  
            if(!SQOFFBOARD(sq + 11) && PieceCol[pos->pieces[sq + 11]] == BLACK) {
                AddPawnCapMove(pos, sq, sq+11, pos->pieces[sq + 11], list);
            }
            
            if(pos->enPas != NO_SQ) {
                if(sq + 9 == pos->enPas) {
                    AddEnPassantMove(pos, MOVE(sq,sq + 9,EMPTY,EMPTY,MFLAGEP), list);
                }
                if(sq + 11 == pos->enPas) {
                    AddEnPassantMove(pos, MOVE(sq,sq + 11,EMPTY,EMPTY,MFLAGEP), list);
                }
            }
        }
        
        if(pos->castlePerm & WKCA && !cap_only) {
            if(pos->pieces[F1] == EMPTY && pos->pieces[G1] == EMPTY) {
                if(!SqAttacked(E1,BLACK,pos) && !SqAttacked(F1,BLACK,pos) ) {
                    AddQuietMove(pos, MOVE(E1, G1, EMPTY, EMPTY, MFLAGCA), list);
                }
            }
        }
        
        if(pos->castlePerm & WQCA && !cap_only) {
            if(pos->pieces[D1] == EMPTY && pos->pieces[C1] == EMPTY && pos->pieces[B1] == EMPTY) {
                if(!SqAttacked(E1,BLACK,pos) && !SqAttacked(D1,BLACK,pos) ) {
                    AddQuietMove(pos, MOVE(E1, C1, EMPTY, EMPTY, MFLAGCA), list);
                }
            }
        }
        
    } else {
        
        for(pceNum = 0; pceNum < pos->pceNum[bP]; ++pceNum) {
            sq = pos->pList[bP][pceNum];
            
            if(pos->pieces[sq - 10] == EMPTY && !cap_only) {
                AddPawnMove(pos, sq, sq-10, list);
                if(RanksBrd[sq] == RANK_7 && pos->pieces[sq - 20] == EMPTY) {
                    AddQuietMove(pos, MOVE(sq,(sq-20),EMPTY,EMPTY,MFLAGPS),list);
                }
            }
            
            if(!SQOFFBOARD(sq - 9) && PieceCol[pos->pieces[sq - 9]] == WHITE) {
                AddPawnCapMove(pos, sq, sq-9, pos->pieces[sq - 9], list);
            }
            
            if(!SQOFFBOARD(sq - 11) && PieceCol[pos->pieces[sq - 11]] == WHITE) {
                AddPawnCapMove(pos, sq, sq-11, pos->pieces[sq - 11], list);
            }
            if(pos->enPas != NO_SQ) {
                if(sq - 9 == pos->enPas) {
                    AddEnPassantMove(pos, MOVE(sq,sq - 9,EMPTY,EMPTY,MFLAGEP), list);
                }
                if(sq - 11 == pos->enPas) {
                    AddEnPassantMove(pos, MOVE(sq,sq - 11,EMPTY,EMPTY,MFLAGEP), list);
                }
            }
        }        
        
        // castling
        if(pos->castlePerm &  BKCA && !cap_only) {
            if(pos->pieces[F8] == EMPTY && pos->pieces[G8] == EMPTY) {
                if(!SqAttacked(E8,WHITE,pos) && !SqAttacked(F8,WHITE,pos) ) {
                    AddQuietMove(pos, MOVE(E8, G8, EMPTY, EMPTY, MFLAGCA), list);
                }
            }
        }
        
        if(pos->castlePerm &  BQCA && !cap_only) {
            if(pos->pieces[D8] == EMPTY && pos->pieces[C8] == EMPTY && pos->pieces[B8] == EMPTY) {
                if(!SqAttacked(E8,WHITE,pos) && !SqAttacked(D8,WHITE,pos) ) {
                    AddQuietMove(pos, MOVE(E8, C8, EMPTY, EMPTY, MFLAGCA), list);
                }
            }
        }
    }
    
    /* Loop for slide pieces */
    pceIndex = LoopSlideIndex[side];
    pce = LoopSlidePce[pceIndex++];
    while( pce != 0) {
        
        for(pceNum = 0; pceNum < pos->pceNum[pce]; ++pceNum) {
            sq = pos->pList[pce][pceNum];
            
            for(index = 0; index < NumDir[pce]; ++index) {
                dir = PceDir[pce][index];
                t_sq = sq + dir;
                
                while(!SQOFFBOARD(t_sq)) {                
                    // BLACK ^ 1 == WHITE       WHITE ^ 1 == BLACK
                    if(pos->pieces[t_sq] != EMPTY) {
                        if( PieceCol[pos->pieces[t_sq]] == (side ^ 1)) {
                            AddCaptureMove(pos, MOVE(sq, t_sq, pos->pieces[t_sq], EMPTY, 0), list);
                        }
                        break;
                    }
                    if (!cap_only)    
                        AddQuietMove(pos, MOVE(sq, t_sq, EMPTY, EMPTY, 0), list);
                    t_sq += dir;
                }
            }
        }
        
        pce = LoopSlidePce[pceIndex++];
    }

    /* Loop for non slide */
    pceIndex = LoopNonSlideIndex[side];
    pce = LoopNonSlidePce[pceIndex++];
    
    while( pce != 0) {
        
        for(pceNum = 0; pceNum < pos->pceNum[pce]; ++pceNum) {
            sq = pos->pList[pce][pceNum];
            
            for(index = 0; index < NumDir[pce]; ++index) {
                dir = PceDir[pce][index];
                t_sq = sq + dir;
                
                if(SQOFFBOARD(t_sq)) {                    
                    continue;
                }
                
                // BLACK ^ 1 == WHITE       WHITE ^ 1 == BLACK
                if(pos->pieces[t_sq] != EMPTY) {
                    if( PieceCol[pos->pieces[t_sq]] == (side ^ 1)) {
                        AddCaptureMove(pos, MOVE(sq, t_sq, pos->pieces[t_sq], EMPTY, 0), list);
                    }
                    continue;
                }    
                if (!cap_only)
                    AddQuietMove(pos, MOVE(sq, t_sq, EMPTY, EMPTY, 0), list);
            }
        }
                
        pce = LoopNonSlidePce[pceIndex++];
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x78, %rsp
movq %rdi, 0x8(%rsp)
movl $0x0, 0x800(%rdi)
movslq 0x8516(%rip), %rcx      # 0xbea0
movq %rcx, 0x10(%rsp)
testq %rcx, %rcx
movl %esi, 0x4(%rsp)
je 0x3ca9
cmpl $0x0, 0x8541(%rip)      # 0xbee4
jle 0x3b04
leaq 0x82f0(%rip), %rbx      # 0xbca0
xorl %ebp, %ebp
leaq 0x80f7(%rip), %rdi      # 0xbab0
movq %rdi, %r14
movslq 0xc388(%rbx,%rbp,4), %r15
movl -0x28(%rbx,%r15,4), %eax
orl %esi, %eax
jne 0x3a1c
leaq -0xa(%r15), %rsi
movl %r15d, %edi
movq 0x8(%rsp), %rdx
callq 0x43b5
movq %r14, %rdi
movl 0x4(%rsp), %esi
leaq 0x20454(%rip), %rax     # 0x23e40
cmpl $0x6, (%rax,%r15,4)
jne 0x3a1c
cmpl $0x0, -0x50(%rbx,%r15,4)
jne 0x3a1c
leaq -0x14(%r15), %rdi
shll $0x7, %edi
orl %r15d, %edi
orl $0x80000, %edi          # imm = 0x80000
movq 0x8(%rsp), %rsi
callq 0x445d
movq %r14, %rdi
movl 0x4(%rsp), %esi
leaq -0x9(%r15), %r12
cmpl $0x64, -0x24(%rdi,%r15,4)
je 0x3a4e
movslq -0x24(%rbx,%r15,4), %rdx
leaq -0x1(%rdx), %rax
cmpq $0x5, %rax
ja 0x3a4e
movl %r15d, %edi
movl %r12d, %esi
movq 0x8(%rsp), %rcx
callq 0x44c3
movq %r14, %rdi
movl 0x4(%rsp), %esi
leaq -0xb(%r15), %r13
cmpl $0x64, -0x2c(%rdi,%r15,4)
je 0x3a80
movslq -0x2c(%rbx,%r15,4), %rdx
leaq -0x1(%rdx), %rax
cmpq $0x5, %rax
ja 0x3a80
movl %r15d, %edi
movl %r13d, %esi
movq 0x8(%rsp), %rcx
callq 0x44c3
movq %r14, %rdi
movl 0x4(%rsp), %esi
movl 0x841e(%rip), %eax      # 0xbea4
cmpl $0x63, %eax
je 0x3af1
cmpl %eax, %r12d
jne 0x3abe
shll $0x7, %r12d
orl %r15d, %r12d
orl $0x40000, %r12d         # imm = 0x40000
movq 0x8(%rsp), %rdx
movslq 0x800(%rdx), %rcx
movl %r12d, (%rdx,%rcx,8)
movl $0xf42a9, 0x4(%rdx,%rcx,8) # imm = 0xF42A9
incl %ecx
movl %ecx, 0x800(%rdx)
cmpl %eax, %r13d
jne 0x3af1
shll $0x7, %r13d
orl %r15d, %r13d
orl $0x40000, %r13d         # imm = 0x40000
movq 0x8(%rsp), %rcx
movslq 0x800(%rcx), %rax
movl %r13d, (%rcx,%rax,8)
movl $0xf42a9, 0x4(%rcx,%rax,8) # imm = 0xF42A9
incl %eax
movl %eax, 0x800(%rcx)
incq %rbp
movslq 0x83e9(%rip), %rax      # 0xbee4
cmpq %rax, %rbp
jl 0x39bc
movl 0x83aa(%rip), %ebp      # 0xbeb4
testl %esi, %esi
jne 0x3bd8
movl %ebp, %eax
andl $0x4, %eax
je 0x3bd8
cmpl $0x0, 0x82fc(%rip)      # 0xbe20
jne 0x3bd8
cmpl $0x0, 0x82f3(%rip)      # 0xbe24
jne 0x3bd8
leaq 0x8162(%rip), %rdx      # 0xbca0
movl $0x5f, %edi
xorl %esi, %esi
callq 0x1547
movl 0x4(%rsp), %esi
testl %eax, %eax
jne 0x3bd8
leaq 0x8143(%rip), %r15      # 0xbca0
movl $0x60, %edi
xorl %esi, %esi
movq %r15, %rdx
callq 0x1547
movl 0x4(%rsp), %esi
testl %eax, %eax
jne 0x3bd8
movq 0x8(%rsp), %rcx
movslq 0x800(%rcx), %rax
movl $0x10030df, %edi        # imm = 0x10030DF
movl %edi, (%rcx,%rax,8)
movslq 0x831d(%rip), %rdx      # 0xbeac
movl $0xdbba0, %ecx          # imm = 0xDBBA0
cmpl %edi, 0xde18(%r15,%rdx,4)
je 0x3bc7
movl $0xc3500, %ecx          # imm = 0xC3500
cmpl $0x10030df, 0xdf18(%r15,%rdx,4) # imm = 0x10030DF
je 0x3bc7
movslq 0x8264(%rip), %rcx      # 0xbe1c
imulq $0x1e0, %rcx, %rcx      # imm = 0x1E0
movl 0xc73c(%rcx,%r15), %ecx
movq 0x8(%rsp), %rdx
movl %ecx, 0x4(%rdx,%rax,8)
incl %eax
movl %eax, 0x800(%rdx)
testl %esi, %esi
jne 0x3fdd
andl $0x8, %ebp
je 0x3fdd
cmpl $0x0, 0x8228(%rip)      # 0xbe18
jne 0x3fdd
cmpl $0x0, 0x8217(%rip)      # 0xbe14
jne 0x3fdd
cmpl $0x0, 0x8206(%rip)      # 0xbe10
jne 0x3fdd
leaq 0x8089(%rip), %rdx      # 0xbca0
movl $0x5f, %edi
xorl %esi, %esi
callq 0x1547
movl 0x4(%rsp), %esi
testl %eax, %eax
jne 0x3fdd
leaq 0x806a(%rip), %r15      # 0xbca0
movl $0x5e, %edi
xorl %esi, %esi
movq %r15, %rdx
callq 0x1547
movl 0x4(%rsp), %esi
testl %eax, %eax
jne 0x3fdd
movq 0x8(%rsp), %rdx
movl 0x800(%rdx), %eax
movslq %eax, %rcx
movl $0x1002edf, %edi        # imm = 0x1002EDF
movl %edi, (%rdx,%rcx,8)
movslq 0x823e(%rip), %r8       # 0xbeac
movl $0xdbba0, %edx          # imm = 0xDBBA0
cmpl %edi, 0xde18(%r15,%r8,4)
je 0x3fcc
movl $0xc3500, %edx          # imm = 0xC3500
cmpl $0x1002edf, 0xdf18(%r15,%r8,4) # imm = 0x1002EDF
je 0x3fcc
movl $0x5d, %edx
leaq 0x8178(%rip), %rdi      # 0xbe1c
jmp 0x3fb1
cmpl $0x0, 0x821c(%rip)      # 0xbecc
jle 0x3e11
xorl %ebp, %ebp
leaq 0x7fe1(%rip), %rbx      # 0xbca0
leaq 0x7dea(%rip), %rdi      # 0xbab0
movq %rdi, %r14
movslq 0xc298(%rbx,%rbp,4), %r15
movl 0x28(%rbx,%r15,4), %eax
orl %esi, %eax
jne 0x3d29
leaq 0xa(%r15), %rsi
movl %r15d, %edi
movq 0x8(%rsp), %rdx
callq 0x43b5
movq %r14, %rdi
movl 0x4(%rsp), %esi
leaq 0x20147(%rip), %rax     # 0x23e40
cmpl $0x1, (%rax,%r15,4)
jne 0x3d29
cmpl $0x0, 0x50(%rbx,%r15,4)
jne 0x3d29
leaq 0x14(%r15), %rdi
shll $0x7, %edi
orl %r15d, %edi
orl $0x80000, %edi          # imm = 0x80000
movq 0x8(%rsp), %rsi
callq 0x445d
movq %r14, %rdi
movl 0x4(%rsp), %esi
leaq 0x9(%r15), %r12
cmpl $0x64, 0x24(%rdi,%r15,4)
je 0x3d5b
movslq 0x24(%rbx,%r15,4), %rdx
leaq -0x7(%rdx), %rax
cmpq $0x5, %rax
ja 0x3d5b
movl %r15d, %edi
movl %r12d, %esi
movq 0x8(%rsp), %rcx
callq 0x44c3
movq %r14, %rdi
movl 0x4(%rsp), %esi
leaq 0xb(%r15), %r13
cmpl $0x64, 0x2c(%rdi,%r15,4)
je 0x3d8d
movslq 0x2c(%rbx,%r15,4), %rdx
leaq -0x7(%rdx), %rax
cmpq $0x5, %rax
ja 0x3d8d
movl %r15d, %edi
movl %r13d, %esi
movq 0x8(%rsp), %rcx
callq 0x44c3
movq %r14, %rdi
movl 0x4(%rsp), %esi
movl 0x8111(%rip), %eax      # 0xbea4
cmpl $0x63, %eax
je 0x3dfe
cmpl %eax, %r12d
jne 0x3dcb
shll $0x7, %r12d
orl %r15d, %r12d
orl $0x40000, %r12d         # imm = 0x40000
movq 0x8(%rsp), %rdx
movslq 0x800(%rdx), %rcx
movl %r12d, (%rdx,%rcx,8)
movl $0xf42a9, 0x4(%rdx,%rcx,8) # imm = 0xF42A9
incl %ecx
movl %ecx, 0x800(%rdx)
cmpl %eax, %r13d
jne 0x3dfe
shll $0x7, %r13d
orl %r15d, %r13d
orl $0x40000, %r13d         # imm = 0x40000
movq 0x8(%rsp), %rcx
movslq 0x800(%rcx), %rax
movl %r13d, (%rcx,%rax,8)
movl $0xf42a9, 0x4(%rcx,%rax,8) # imm = 0xF42A9
incl %eax
movl %eax, 0x800(%rcx)
incq %rbp
movslq 0x80c4(%rip), %rax      # 0xbecc
cmpq %rax, %rbp
jl 0x3cc9
movl 0x809d(%rip), %ebp      # 0xbeb4
testl %esi, %esi
jne 0x3eeb
movl %ebp, %eax
andl $0x1, %eax
je 0x3eeb
cmpl $0x0, 0x7ed7(%rip)      # 0xbd08
jne 0x3eeb
cmpl $0x0, 0x7ece(%rip)      # 0xbd0c
jne 0x3eeb
leaq 0x7e55(%rip), %rdx      # 0xbca0
movl $0x19, %edi
movl $0x1, %esi
callq 0x1547
movl 0x4(%rsp), %esi
testl %eax, %eax
jne 0x3eeb
leaq 0x7e33(%rip), %r15      # 0xbca0
movl $0x1a, %edi
movl $0x1, %esi
movq %r15, %rdx
callq 0x1547
movl 0x4(%rsp), %esi
testl %eax, %eax
jne 0x3eeb
movq 0x8(%rsp), %rcx
movslq 0x800(%rcx), %rax
movl $0x1000d99, %edi        # imm = 0x1000D99
movl %edi, (%rcx,%rax,8)
movslq 0x800a(%rip), %rdx      # 0xbeac
movl $0xdbba0, %ecx          # imm = 0xDBBA0
cmpl %edi, 0xde18(%r15,%rdx,4)
je 0x3eda
movl $0xc3500, %ecx          # imm = 0xC3500
cmpl $0x1000d99, 0xdf18(%r15,%rdx,4) # imm = 0x1000D99
je 0x3eda
movslq 0x7e39(%rip), %rcx      # 0xbd04
imulq $0x1e0, %rcx, %rcx      # imm = 0x1E0
movl 0xc624(%rcx,%r15), %ecx
movq 0x8(%rsp), %rdx
movl %ecx, 0x4(%rdx,%rax,8)
incl %eax
movl %eax, 0x800(%rdx)
testl %esi, %esi
jne 0x3fdd
andl $0x2, %ebp
je 0x3fdd
cmpl $0x0, 0x7dfd(%rip)      # 0xbd00
jne 0x3fdd
cmpl $0x0, 0x7dec(%rip)      # 0xbcfc
jne 0x3fdd
cmpl $0x0, 0x7ddb(%rip)      # 0xbcf8
jne 0x3fdd
leaq 0x7d76(%rip), %rdx      # 0xbca0
movl $0x19, %edi
movl $0x1, %esi
callq 0x1547
movl 0x4(%rsp), %esi
testl %eax, %eax
jne 0x3fdd
leaq 0x7d54(%rip), %r15      # 0xbca0
movl $0x18, %edi
movl $0x1, %esi
movq %r15, %rdx
callq 0x1547
movl 0x4(%rsp), %esi
testl %eax, %eax
jne 0x3fdd
movq 0x8(%rsp), %rdx
movl 0x800(%rdx), %eax
movslq %eax, %rcx
movl $0x1000b99, %edi        # imm = 0x1000B99
movl %edi, (%rdx,%rcx,8)
movslq 0x7f29(%rip), %r8       # 0xbeac
movl $0xdbba0, %edx          # imm = 0xDBBA0
cmpl %edi, 0xde18(%r15,%r8,4)
je 0x3fcc
movl $0xc3500, %edx          # imm = 0xC3500
cmpl $0x1000b99, 0xdf18(%r15,%r8,4) # imm = 0x1000B99
je 0x3fcc
movl $0x17, %edx
leaq 0x7d53(%rip), %rdi      # 0xbd04
movslq (%rdi), %rdi
imulq $0x1e0, %rdi, %r8       # imm = 0x1E0
leaq 0x7cde(%rip), %rdi      # 0xbca0
addq %r8, %rdi
movl 0xc5b8(%rdi,%rdx,4), %edx
movq 0x8(%rsp), %rdi
movl %edx, 0x4(%rdi,%rcx,8)
incl %eax
movl %eax, 0x800(%rdi)
leaq 0x3714(%rip), %rax      # 0x76f8
movq 0x10(%rsp), %rcx
movslq (%rax,%rcx,4), %rcx
leaq 0x7cac(%rip), %r9       # 0xbca0
leaq 0x3765(%rip), %rbx      # 0x7760
movq %rcx, 0x48(%rsp)
leaq 0x36f9(%rip), %rax      # 0x7700
movslq (%rax,%rcx,4), %rax
movq %rax, 0x40(%rsp)
movl 0x228(%r9,%rax,4), %eax
testl %eax, %eax
jle 0x41dd
leaq 0x36f9(%rip), %rcx      # 0x7720
movq 0x40(%rsp), %rdx
movl (%rcx,%rdx,4), %edi
movl $0x1f7c, %r8d           # imm = 0x1F7C
movl %edx, %ecx
shrq %cl, %r8
cmpl $0x2, %edi
movl $0x1, %ecx
cmovll %ecx, %edi
movq %rdi, 0x28(%rsp)
leaq (%rdx,%rdx,4), %rcx
leaq (%r9,%rcx,8), %rcx
movq %rcx, 0x50(%rsp)
shlq $0x5, %rdx
addq %rbx, %rdx
movq %rdx, 0x20(%rsp)
xorl %edx, %edx
movq %r8, 0x58(%rsp)
testb $0x1, %r8b
je 0x41ce
movq 0x50(%rsp), %rax
movq %rdx, 0x60(%rsp)
movl 0xc270(%rax,%rdx,4), %edx
movl %edx, %eax
andl $0x7f, %eax
movq %rax, 0x68(%rsp)
movslq %edx, %rax
leaq 0x7a17(%rip), %rcx      # 0xbab0
leaq (%rcx,%rax,4), %rax
movq %rax, 0x70(%rsp)
movq %rdx, 0x18(%rsp)
movslq %edx, %rax
movq %rax, 0x30(%rsp)
xorl %ecx, %ecx
movq 0x20(%rsp), %rax
movq %rcx, 0x38(%rsp)
movslq (%rax,%rcx,4), %rbx
movq 0x30(%rsp), %rax
leaq (%rax,%rbx), %r14
leaq 0x79e1(%rip), %rax      # 0xbab0
cmpl $0x64, (%rax,%r14,4)
je 0x419d
movl %r14d, %r15d
shll $0x7, %r15d
movl %ebx, %r12d
shll $0x7, %r12d
shlq $0x2, %r14
movq 0x70(%rsp), %rax
leaq (%rax,%rbx,8), %r13
shlq $0x2, %rbx
xorl %ebp, %ebp
leaq (%r14,%rbp), %rax
movslq (%r9,%rax), %rax
testq %rax, %rax
jne 0x413a
testl %esi, %esi
jne 0x4128
movl %r15d, %edi
orl 0x18(%rsp), %edi
movq 0x8(%rsp), %rsi
callq 0x445d
leaq 0x7b7c(%rip), %r9       # 0xbca0
movl 0x4(%rsp), %esi
addl %r12d, %r15d
cmpl $0x64, (%r13,%rbp)
leaq (%rbp,%rbx), %rbp
jne 0x40fb
jmp 0x419d
leaq 0x322f(%rip), %rcx      # 0x7370
movl (%rcx,%rax,4), %ecx
xorl 0x10(%rsp), %ecx
cmpl $0x1, %ecx
jne 0x419d
shll $0xe, %eax
orl 0x18(%rsp), %r15d
orl %eax, %r15d
movq 0x8(%rsp), %rdi
movslq 0x800(%rdi), %rax
movl %r15d, (%rdi,%rax,8)
shrl $0xe, %r15d
andl $0xf, %r15d
movq 0x68(%rsp), %rcx
movslq (%r9,%rcx,4), %rcx
imulq $0x34, %r15, %rdx
leaq 0x2302c(%rip), %r8      # 0x271b0
addq %r8, %rdx
movl (%rdx,%rcx,4), %ecx
movl $0xf4240, %edx          # imm = 0xF4240
addl %edx, %ecx
movl %ecx, 0x4(%rdi,%rax,8)
incl %eax
movl %eax, 0x800(%rdi)
movq 0x38(%rsp), %rcx
incq %rcx
cmpq 0x28(%rsp), %rcx
jne 0x40b1
movq 0x40(%rsp), %rax
movl 0x228(%r9,%rax,4), %eax
leaq 0x359c(%rip), %rbx      # 0x7760
movq 0x58(%rsp), %r8
movq 0x60(%rsp), %rdx
incq %rdx
movslq %eax, %rcx
cmpq %rcx, %rdx
jl 0x406a
movq 0x48(%rsp), %rcx
incq %rcx
movl %ecx, %eax
andl $-0x5, %eax
cmpl $0x3, %eax
jne 0x3ffb
leaq 0x34d6(%rip), %rax      # 0x76d0
movq 0x10(%rsp), %rcx
movslq (%rax,%rcx,4), %rcx
movl $0xf4240, %r10d         # imm = 0xF4240
cmpl $0x2, %ecx
je 0x43a6
cmpl $0x5, %ecx
je 0x43a6
leaq 0x34be(%rip), %rax      # 0x76e0
movslq (%rax,%rcx,4), %rdx
incq %rcx
movl 0x228(%r9,%rdx,4), %eax
testl %eax, %eax
jle 0x4209
movq %rcx, 0x20(%rsp)
leaq 0x34df(%rip), %rcx      # 0x7720
movl (%rcx,%rdx,4), %r15d
movl $0x1f7c, %edi           # imm = 0x1F7C
movl %edx, %ecx
shrq %cl, %rdi
cmpl $0x2, %r15d
movl $0x1, %ecx
cmovll %ecx, %r15d
movq %rdx, %rbp
shlq $0x5, %rbp
leaq (%rdx,%rdx,4), %rcx
leaq (%r9,%rcx,8), %rcx
movq %rcx, 0x30(%rsp)
xorl %r8d, %r8d
movq %rdi, 0x38(%rsp)
movq %rdx, 0x28(%rsp)
testb $0x1, %dil
je 0x438d
movq 0x30(%rsp), %rax
movq %r8, 0x18(%rsp)
movl 0xc270(%rax,%r8,4), %r11d
movl %r11d, %r12d
andl $0x7f, %r12d
movslq %r11d, %r14
xorl %r13d, %r13d
leaq (,%r13,4), %rax
addq %rbp, %rax
movslq (%rbx,%rax), %rdi
addq %r14, %rdi
leaq 0x77f1(%rip), %rax      # 0xbab0
cmpl $0x64, (%rax,%rdi,4)
je 0x436a
movslq (%r9,%rdi,4), %rax
testq %rax, %rax
je 0x4332
leaq 0x3097(%rip), %rcx      # 0x7370
movl (%rcx,%rax,4), %ecx
xorl 0x10(%rsp), %ecx
cmpl $0x1, %ecx
jne 0x436a
shll $0x7, %edi
shll $0xe, %eax
orl %r11d, %edi
orl %eax, %edi
movq 0x8(%rsp), %r8
movslq 0x800(%r8), %rax
movl %edi, (%r8,%rax,8)
shrl $0xe, %edi
andl $0xf, %edi
movslq (%r9,%r12,4), %rcx
imulq $0x34, %rdi, %rdx
leaq 0x22e97(%rip), %rdi     # 0x271b0
addq %rdi, %rdx
movl (%rdx,%rcx,4), %ecx
addl %r10d, %ecx
movl %ecx, 0x4(%r8,%rax,8)
incl %eax
movl %eax, 0x800(%r8)
jmp 0x436a
testl %esi, %esi
jne 0x436a
shll $0x7, %edi
orl %r11d, %edi
movq 0x8(%rsp), %rsi
movq %r12, %rbx
movq %r11, %r12
callq 0x445d
movq %r12, %r11
movq %rbx, %r12
leaq 0x3407(%rip), %rbx      # 0x7760
movl $0xf4240, %r10d         # imm = 0xF4240
leaq 0x793a(%rip), %r9       # 0xbca0
movl 0x4(%rsp), %esi
incq %r13
cmpq %r13, %r15
jne 0x42a6
movq 0x28(%rsp), %rdx
movl 0x228(%r9,%rdx,4), %eax
movq 0x38(%rsp), %rdi
movq 0x18(%rsp), %r8
incq %r8
movslq %eax, %rcx
cmpq %rcx, %r8
jl 0x427d
movq 0x20(%rsp), %rcx
jmp 0x4209
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq