// File: /workspace/github_c_makefile_star2_O1/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 0x84d1(%rip), %rcx      # 0xbea0
movq %rcx, 0x10(%rsp)
testq %rcx, %rcx
movl %esi, 0x4(%rsp)
je 0x3cee
cmpl $0x0, 0x84fc(%rip)      # 0xbee4
jle 0x3b49
leaq 0x82ab(%rip), %rbx      # 0xbca0
xorl %ebp, %ebp
leaq 0x80b2(%rip), %rdi      # 0xbab0
movq %rdi, %r14
movslq 0xc388(%rbx,%rbp,4), %r15
movl -0x28(%rbx,%r15,4), %eax
orl %esi, %eax
jne 0x3a61
leaq -0xa(%r15), %rsi
movl %r15d, %edi
movq 0x8(%rsp), %rdx
callq 0x43e2
movq %r14, %rdi
movl 0x4(%rsp), %esi
leaq 0x2040f(%rip), %rax     # 0x23e40
cmpl $0x6, (%rax,%r15,4)
jne 0x3a61
cmpl $0x0, -0x50(%rbx,%r15,4)
jne 0x3a61
leaq -0x14(%r15), %rdi
shll $0x7, %edi
orl %r15d, %edi
orl $0x80000, %edi          # imm = 0x80000
movq 0x8(%rsp), %rsi
callq 0x448a
movq %r14, %rdi
movl 0x4(%rsp), %esi
leaq -0x9(%r15), %r12
cmpl $0x64, -0x24(%rdi,%r15,4)
je 0x3a93
movslq -0x24(%rbx,%r15,4), %rdx
leaq -0x1(%rdx), %rax
cmpq $0x5, %rax
ja 0x3a93
movl %r15d, %edi
movl %r12d, %esi
movq 0x8(%rsp), %rcx
callq 0x44f0
movq %r14, %rdi
movl 0x4(%rsp), %esi
leaq -0xb(%r15), %r13
cmpl $0x64, -0x2c(%rdi,%r15,4)
je 0x3ac5
movslq -0x2c(%rbx,%r15,4), %rdx
leaq -0x1(%rdx), %rax
cmpq $0x5, %rax
ja 0x3ac5
movl %r15d, %edi
movl %r13d, %esi
movq 0x8(%rsp), %rcx
callq 0x44f0
movq %r14, %rdi
movl 0x4(%rsp), %esi
movl 0x83d9(%rip), %eax      # 0xbea4
cmpl $0x63, %eax
je 0x3b36
cmpl %eax, %r12d
jne 0x3b03
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 0x3b36
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 0x83a4(%rip), %rax      # 0xbee4
cmpq %rax, %rbp
jl 0x3a01
movl 0x8365(%rip), %ebp      # 0xbeb4
testl %esi, %esi
jne 0x3c1d
movl %ebp, %eax
andl $0x4, %eax
je 0x3c1d
cmpl $0x0, 0x82b7(%rip)      # 0xbe20
jne 0x3c1d
cmpl $0x0, 0x82ae(%rip)      # 0xbe24
jne 0x3c1d
leaq 0x811d(%rip), %rdx      # 0xbca0
movl $0x5f, %edi
xorl %esi, %esi
callq 0x1543
movl 0x4(%rsp), %esi
testl %eax, %eax
jne 0x3c1d
leaq 0x80fe(%rip), %r15      # 0xbca0
movl $0x60, %edi
xorl %esi, %esi
movq %r15, %rdx
callq 0x1543
movl 0x4(%rsp), %esi
testl %eax, %eax
jne 0x3c1d
movq 0x8(%rsp), %rcx
movslq 0x800(%rcx), %rax
movl $0x10030df, %edi        # imm = 0x10030DF
movl %edi, (%rcx,%rax,8)
movslq 0x82d8(%rip), %rdx      # 0xbeac
movl $0xdbba0, %ecx          # imm = 0xDBBA0
cmpl %edi, 0xde18(%r15,%rdx,4)
je 0x3c0c
movl $0xc3500, %ecx          # imm = 0xC3500
cmpl $0x10030df, 0xdf18(%r15,%rdx,4) # imm = 0x10030DF
je 0x3c0c
movslq 0x821f(%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 0x4022
andl $0x8, %ebp
je 0x4022
cmpl $0x0, 0x81e3(%rip)      # 0xbe18
jne 0x4022
cmpl $0x0, 0x81d2(%rip)      # 0xbe14
jne 0x4022
cmpl $0x0, 0x81c1(%rip)      # 0xbe10
jne 0x4022
leaq 0x8044(%rip), %rdx      # 0xbca0
movl $0x5f, %edi
xorl %esi, %esi
callq 0x1543
movl 0x4(%rsp), %esi
testl %eax, %eax
jne 0x4022
leaq 0x8025(%rip), %r15      # 0xbca0
movl $0x5e, %edi
xorl %esi, %esi
movq %r15, %rdx
callq 0x1543
movl 0x4(%rsp), %esi
testl %eax, %eax
jne 0x4022
movq 0x8(%rsp), %rdx
movl 0x800(%rdx), %eax
movslq %eax, %rcx
movl $0x1002edf, %edi        # imm = 0x1002EDF
movl %edi, (%rdx,%rcx,8)
movslq 0x81f9(%rip), %r8       # 0xbeac
movl $0xdbba0, %edx          # imm = 0xDBBA0
cmpl %edi, 0xde18(%r15,%r8,4)
je 0x4011
movl $0xc3500, %edx          # imm = 0xC3500
cmpl $0x1002edf, 0xdf18(%r15,%r8,4) # imm = 0x1002EDF
je 0x4011
movl $0x5d, %edx
leaq 0x8133(%rip), %rdi      # 0xbe1c
jmp 0x3ff6
cmpl $0x0, 0x81d7(%rip)      # 0xbecc
jle 0x3e56
xorl %ebp, %ebp
leaq 0x7f9c(%rip), %rbx      # 0xbca0
leaq 0x7da5(%rip), %rdi      # 0xbab0
movq %rdi, %r14
movslq 0xc298(%rbx,%rbp,4), %r15
movl 0x28(%rbx,%r15,4), %eax
orl %esi, %eax
jne 0x3d6e
leaq 0xa(%r15), %rsi
movl %r15d, %edi
movq 0x8(%rsp), %rdx
callq 0x43e2
movq %r14, %rdi
movl 0x4(%rsp), %esi
leaq 0x20102(%rip), %rax     # 0x23e40
cmpl $0x1, (%rax,%r15,4)
jne 0x3d6e
cmpl $0x0, 0x50(%rbx,%r15,4)
jne 0x3d6e
leaq 0x14(%r15), %rdi
shll $0x7, %edi
orl %r15d, %edi
orl $0x80000, %edi          # imm = 0x80000
movq 0x8(%rsp), %rsi
callq 0x448a
movq %r14, %rdi
movl 0x4(%rsp), %esi
leaq 0x9(%r15), %r12
cmpl $0x64, 0x24(%rdi,%r15,4)
je 0x3da0
movslq 0x24(%rbx,%r15,4), %rdx
leaq -0x7(%rdx), %rax
cmpq $0x5, %rax
ja 0x3da0
movl %r15d, %edi
movl %r12d, %esi
movq 0x8(%rsp), %rcx
callq 0x44f0
movq %r14, %rdi
movl 0x4(%rsp), %esi
leaq 0xb(%r15), %r13
cmpl $0x64, 0x2c(%rdi,%r15,4)
je 0x3dd2
movslq 0x2c(%rbx,%r15,4), %rdx
leaq -0x7(%rdx), %rax
cmpq $0x5, %rax
ja 0x3dd2
movl %r15d, %edi
movl %r13d, %esi
movq 0x8(%rsp), %rcx
callq 0x44f0
movq %r14, %rdi
movl 0x4(%rsp), %esi
movl 0x80cc(%rip), %eax      # 0xbea4
cmpl $0x63, %eax
je 0x3e43
cmpl %eax, %r12d
jne 0x3e10
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 0x3e43
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 0x807f(%rip), %rax      # 0xbecc
cmpq %rax, %rbp
jl 0x3d0e
movl 0x8058(%rip), %ebp      # 0xbeb4
testl %esi, %esi
jne 0x3f30
movl %ebp, %eax
andl $0x1, %eax
je 0x3f30
cmpl $0x0, 0x7e92(%rip)      # 0xbd08
jne 0x3f30
cmpl $0x0, 0x7e89(%rip)      # 0xbd0c
jne 0x3f30
leaq 0x7e10(%rip), %rdx      # 0xbca0
movl $0x19, %edi
movl $0x1, %esi
callq 0x1543
movl 0x4(%rsp), %esi
testl %eax, %eax
jne 0x3f30
leaq 0x7dee(%rip), %r15      # 0xbca0
movl $0x1a, %edi
movl $0x1, %esi
movq %r15, %rdx
callq 0x1543
movl 0x4(%rsp), %esi
testl %eax, %eax
jne 0x3f30
movq 0x8(%rsp), %rcx
movslq 0x800(%rcx), %rax
movl $0x1000d99, %edi        # imm = 0x1000D99
movl %edi, (%rcx,%rax,8)
movslq 0x7fc5(%rip), %rdx      # 0xbeac
movl $0xdbba0, %ecx          # imm = 0xDBBA0
cmpl %edi, 0xde18(%r15,%rdx,4)
je 0x3f1f
movl $0xc3500, %ecx          # imm = 0xC3500
cmpl $0x1000d99, 0xdf18(%r15,%rdx,4) # imm = 0x1000D99
je 0x3f1f
movslq 0x7df4(%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 0x4022
andl $0x2, %ebp
je 0x4022
cmpl $0x0, 0x7db8(%rip)      # 0xbd00
jne 0x4022
cmpl $0x0, 0x7da7(%rip)      # 0xbcfc
jne 0x4022
cmpl $0x0, 0x7d96(%rip)      # 0xbcf8
jne 0x4022
leaq 0x7d31(%rip), %rdx      # 0xbca0
movl $0x19, %edi
movl $0x1, %esi
callq 0x1543
movl 0x4(%rsp), %esi
testl %eax, %eax
jne 0x4022
leaq 0x7d0f(%rip), %r15      # 0xbca0
movl $0x18, %edi
movl $0x1, %esi
movq %r15, %rdx
callq 0x1543
movl 0x4(%rsp), %esi
testl %eax, %eax
jne 0x4022
movq 0x8(%rsp), %rdx
movl 0x800(%rdx), %eax
movslq %eax, %rcx
movl $0x1000b99, %edi        # imm = 0x1000B99
movl %edi, (%rdx,%rcx,8)
movslq 0x7ee4(%rip), %r8       # 0xbeac
movl $0xdbba0, %edx          # imm = 0xDBBA0
cmpl %edi, 0xde18(%r15,%r8,4)
je 0x4011
movl $0xc3500, %edx          # imm = 0xC3500
cmpl $0x1000b99, 0xdf18(%r15,%r8,4) # imm = 0x1000B99
je 0x4011
movl $0x17, %edx
leaq 0x7d0e(%rip), %rdi      # 0xbd04
movslq (%rdi), %rdi
imulq $0x1e0, %rdi, %r8       # imm = 0x1E0
leaq 0x7c99(%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 0x36cf(%rip), %rax      # 0x76f8
movq 0x10(%rsp), %rcx
movslq (%rax,%rcx,4), %rcx
leaq 0x7c67(%rip), %r9       # 0xbca0
movq %rcx, 0x50(%rsp)
leaq 0x36bb(%rip), %rax      # 0x7700
movslq (%rax,%rcx,4), %rax
movq %rax, 0x48(%rsp)
cmpl $0x0, 0x228(%r9,%rax,4)
jle 0x4215
leaq 0x36bc(%rip), %rax      # 0x7720
movq 0x48(%rsp), %rcx
movl (%rax,%rcx,4), %edx
movl $0x1f7c, %eax           # imm = 0x1F7C
shrq %cl, %rax
movq %rax, 0x60(%rsp)
cmpl $0x2, %edx
movl $0x1, %eax
cmovll %eax, %edx
movq %rdx, 0x30(%rsp)
leaq (%rcx,%rcx,4), %rax
leaq (%r9,%rax,8), %rax
movq %rax, 0x58(%rsp)
shlq $0x5, %rcx
leaq 0x36bf(%rip), %rax      # 0x7760
addq %rax, %rcx
movq %rcx, 0x28(%rsp)
movq $0x0, 0x20(%rsp)
testb $0x1, 0x60(%rsp)
je 0x41f2
movq 0x58(%rsp), %rax
movq 0x20(%rsp), %rcx
movl 0xc270(%rax,%rcx,4), %edx
movl %edx, %eax
andl $0x7f, %eax
movq %rax, 0x68(%rsp)
movslq %edx, %rax
leaq 0x79ce(%rip), %rcx      # 0xbab0
leaq (%rcx,%rax,4), %rax
movq %rax, 0x70(%rsp)
movq %rdx, 0x18(%rsp)
movslq %edx, %rax
movq %rax, 0x38(%rsp)
xorl %ecx, %ecx
movq 0x28(%rsp), %rax
movq %rcx, 0x40(%rsp)
movslq (%rax,%rcx,4), %rbx
movq 0x38(%rsp), %rax
leaq (%rax,%rbx), %r14
leaq 0x7998(%rip), %rax      # 0xbab0
cmpl $0x64, (%rax,%r14,4)
je 0x41df
movl %r14d, %ebp
shll $0x7, %ebp
movl %ebx, %r12d
shll $0x7, %r12d
shlq $0x2, %r14
movq 0x70(%rsp), %rax
leaq (%rax,%rbx,8), %r13
shlq $0x2, %rbx
xorl %r15d, %r15d
leaq (%r14,%r15), %rax
movslq (%r9,%rax), %rax
testq %rax, %rax
jne 0x4181
testl %esi, %esi
jne 0x4170
movl %ebp, %edi
orl 0x18(%rsp), %edi
movq 0x8(%rsp), %rsi
callq 0x448a
leaq 0x7b34(%rip), %r9       # 0xbca0
movl 0x4(%rsp), %esi
addl %r12d, %ebp
cmpl $0x64, (%r13,%r15)
leaq (%r15,%rbx), %r15
jne 0x4144
jmp 0x41df
leaq 0x31e8(%rip), %rcx      # 0x7370
movl (%rcx,%rax,4), %ecx
xorl 0x10(%rsp), %ecx
cmpl $0x1, %ecx
jne 0x41df
shll $0xe, %eax
orl 0x18(%rsp), %ebp
orl %eax, %ebp
movq 0x8(%rsp), %rdi
movslq 0x800(%rdi), %rax
movl %ebp, (%rdi,%rax,8)
shrl $0xe, %ebp
andl $0xf, %ebp
movq 0x68(%rsp), %rcx
movslq (%r9,%rcx,4), %rcx
imulq $0x34, %rbp, %rdx
leaq 0x22fea(%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 0x40(%rsp), %rcx
incq %rcx
cmpq 0x30(%rsp), %rcx
jne 0x40fa
movq 0x20(%rsp), %rdx
incq %rdx
movq 0x48(%rsp), %rax
movslq 0x228(%r9,%rax,4), %rax
movq %rdx, 0x20(%rsp)
cmpq %rax, %rdx
jl 0x40b2
movq 0x50(%rsp), %rcx
incq %rcx
movl %ecx, %eax
andl $-0x5, %eax
cmpl $0x3, %eax
jne 0x4039
leaq 0x349e(%rip), %rax      # 0x76d0
movq 0x10(%rsp), %rcx
movslq (%rax,%rcx,4), %rdx
movl $0xf4240, %r10d         # imm = 0xF4240
leaq 0x3518(%rip), %rbx      # 0x7760
cmpl $0x2, %edx
je 0x43d3
cmpl $0x5, %edx
je 0x43d3
leaq 0x347f(%rip), %rax      # 0x76e0
movslq (%rax,%rdx,4), %rcx
incq %rdx
cmpl $0x0, 0x228(%r9,%rcx,4)
jle 0x4248
movq %rdx, 0x28(%rsp)
leaq 0x34a1(%rip), %rax      # 0x7720
movl (%rax,%rcx,4), %r13d
movl $0x1f7c, %eax           # imm = 0x1F7C
shrq %cl, %rax
movq %rax, 0x40(%rsp)
cmpl $0x2, %r13d
movl $0x1, %eax
cmovll %eax, %r13d
movq %rcx, %r15
shlq $0x5, %r15
leaq (%rcx,%rcx,4), %rax
leaq (%r9,%rax,8), %rax
movq %rax, 0x30(%rsp)
xorl %r11d, %r11d
movq %rcx, 0x38(%rsp)
testb $0x1, 0x40(%rsp)
je 0x43b0
movq 0x30(%rsp), %rax
movl 0xc270(%rax,%r11,4), %r12d
movl %r12d, %eax
andl $0x7f, %eax
movq %rax, 0x18(%rsp)
movslq %r12d, %rbp
xorl %r14d, %r14d
leaq (%r15,%r14,4), %rax
movslq (%rbx,%rax), %rdi
addq %rbp, %rdi
leaq 0x77bc(%rip), %rax      # 0xbab0
cmpl $0x64, (%rax,%rdi,4)
je 0x43a4
movslq (%r9,%rdi,4), %rax
testq %rax, %rax
je 0x436c
leaq 0x3062(%rip), %rcx      # 0x7370
movl (%rcx,%rax,4), %ecx
xorl 0x10(%rsp), %ecx
cmpl $0x1, %ecx
jne 0x43a4
shll $0x7, %edi
shll $0xe, %eax
orl %r12d, %edi
orl %eax, %edi
movq 0x8(%rsp), %r8
movslq 0x800(%r8), %rax
movl %edi, (%r8,%rax,8)
shrl $0xe, %edi
andl $0xf, %edi
movq 0x18(%rsp), %rcx
movslq (%r9,%rcx,4), %rcx
imulq $0x34, %rdi, %rdx
leaq 0x22e5d(%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 0x43a4
testl %esi, %esi
jne 0x43a4
shll $0x7, %edi
orl %r12d, %edi
movq 0x8(%rsp), %rsi
movq %r12, %rbx
movq %r11, %r12
callq 0x448a
movq %r12, %r11
movq %rbx, %r12
leaq 0x33cd(%rip), %rbx      # 0x7760
movl $0xf4240, %r10d         # imm = 0xF4240
leaq 0x7900(%rip), %r9       # 0xbca0
movl 0x4(%rsp), %esi
incq %r14
cmpq %r14, %r13
jne 0x42e2
incq %r11
movq 0x38(%rsp), %rcx
movslq 0x228(%r9,%rcx,4), %rax
cmpq %rax, %r11
jl 0x42b9
movq 0x28(%rsp), %rdx
jmp 0x4248
addq $0x78, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq