// File: /workspace/github_cpp_makefile_star2_O1/sisong[P]ApkDiffPatch/HDiffPatch/libHDiffPatch/HPatch/patch.c
// Function: patch_cache
static hpatch_BOOL _patch_cache(hpatch_TCovers** out_covers,
                                const hpatch_TStreamInput** poldData,hpatch_StreamPos_t newDataSize,
                                const hpatch_TStreamInput*  diffData,hpatch_BOOL isCompressedDiff,
                                hpatch_TDecompress* decompressPlugin,size_t kCacheCount,
                                TByte** ptemp_cache,TByte** ptemp_cache_end,hpatch_BOOL* out_isReadError){
    const hpatch_TStreamInput* oldData=*poldData;
    const hpatch_size_t kMinCacheSize=hpatch_kStreamCacheSize*kCacheCount;
#if (_IS_NEED_CACHE_OLD_BY_COVERS)
    const hpatch_size_t kBestACacheSize=hpatch_kFileIOBufBetterSize;   //内存足够时比较好的hpatch_kStreamCacheSize值;
    const hpatch_size_t _minActiveSize=(1<<20)*8;
    const hpatch_StreamPos_t _betterActiveSize=kBestACacheSize*kCacheCount*2+oldData->streamSize/8;
    const hpatch_size_t kActiveCacheOldMemorySize = //尝试激活CacheOld功能的内存下限;
                (_betterActiveSize>_minActiveSize)?_minActiveSize:(hpatch_size_t)_betterActiveSize;
#endif //_IS_NEED_CACHE_OLD_BY_COVERS
    TByte* temp_cache=*ptemp_cache;
    TByte* temp_cache_end=*ptemp_cache_end;
    *out_isReadError=hpatch_FALSE;
    if ((hpatch_size_t)(temp_cache_end-temp_cache)>=oldData->streamSize+kMinCacheSize
        +sizeof(hpatch_TStreamInput)+sizeof(hpatch_StreamPos_t)){//load all oldData
        hpatch_TStreamInput* replace_oldData=0;
        _cache_alloc(replace_oldData,hpatch_TStreamInput,sizeof(hpatch_TStreamInput),
                     temp_cache,temp_cache_end);
        if (!_cache_load_all(oldData,temp_cache_end-oldData->streamSize,
                             temp_cache_end)){ *out_isReadError=hpatch_TRUE; return _hpatch_FALSE; }
        
        mem_as_hStreamInput(replace_oldData,temp_cache_end-oldData->streamSize,temp_cache_end);
        temp_cache_end-=oldData->streamSize;
        // [          patch cache            |       oldData cache     ]
        // [ (cacheSize-oldData->streamSize) |  (oldData->streamSize)  ]
        *out_covers=0;
        *poldData=replace_oldData;
        *ptemp_cache=temp_cache;
        *ptemp_cache_end=temp_cache_end;
        return hpatch_TRUE;
    }
#if (_IS_NEED_CACHE_OLD_BY_COVERS)
    else if ((hpatch_size_t)(temp_cache_end-temp_cache)>=kActiveCacheOldMemorySize) {
        hpatch_BOOL         isUsedCover32;
        TByte*              temp_cache_end_back=temp_cache_end;
        _TArrayCovers*      arrayCovers=0;
        assert((hpatch_size_t)(temp_cache_end-temp_cache)>kBestACacheSize*kCacheCount);
        assert(kBestACacheSize>sizeof(_TCompressedCovers)+sizeof(_TPackedCovers));
        if (isCompressedDiff){
            hpatch_compressedDiffInfo diffInfo;
            _TCompressedCovers* compressedCovers=0;
            if (!_compressedCovers_open(&compressedCovers,&diffInfo,diffData,decompressPlugin,
                                        temp_cache_end-kBestACacheSize-sizeof(_TCompressedCovers),temp_cache_end))
                { *out_isReadError=hpatch_TRUE; return _hpatch_FALSE; }
            if ((oldData->streamSize!=diffInfo.oldDataSize)||(newDataSize!=diffInfo.newDataSize))
                { *out_isReadError=hpatch_TRUE; return _hpatch_FALSE; }
            temp_cache_end-=kBestACacheSize+sizeof(_TCompressedCovers);
            // [                       ...                                 |   compressedCovers cache   ]
            // [           (cacheSize-kBestACacheSize)                     |      (kBestACacheSize)     ]
            *out_covers=&compressedCovers->base.ICovers;
            isUsedCover32=(diffInfo.oldDataSize|diffInfo.newDataSize)<((hpatch_StreamPos_t)1<<32);
        }else{
            _TPackedCovers* packedCovers=0;
            _THDiffHead     diffHead;
            hpatch_StreamPos_t oldDataSize=oldData->streamSize;
            if (!_packedCovers_open(&packedCovers,&diffHead,diffData,
                                    temp_cache_end-kBestACacheSize*3-sizeof(_TPackedCovers),temp_cache_end))
                { *out_isReadError=hpatch_TRUE; return _hpatch_FALSE; }
            temp_cache_end-=kBestACacheSize*3+sizeof(_TPackedCovers);
            // [                       ...                                 |     packedCovers cache     ]
            // [          (cacheSize-kBestACacheSize*3)                    |    (kBestACacheSize*3)     ]
            *out_covers=&packedCovers->base.ICovers;
            isUsedCover32=(oldDataSize|newDataSize)<((hpatch_StreamPos_t)1<<32);
        }
        
        if (!_arrayCovers_load(&arrayCovers,*out_covers,isUsedCover32,
                               out_isReadError,&temp_cache,temp_cache_end-kBestACacheSize)){
            if (*out_isReadError) return _hpatch_FALSE;
            // [                    patch cache                            |       *edCovers cache      ]
            // [           (cacheSize-kBestACacheSize*?)                   |     (kBestACacheSize*?)    ]
            *ptemp_cache=temp_cache;
            *ptemp_cache_end=temp_cache_end;
            return hpatch_FALSE;
        }else{
            // [         arrayCovers cache         |                         ...                        ]
            // [((new temp_cache)-(old temp_cache))|          (cacheSize-(arrayCovers cache size))      ]
            TByte* old_cache_end;
            hpatch_TStreamInput* replace_oldData=0;
            assert(!(*out_isReadError));
            if (!((*out_covers)->close(*out_covers))) return _hpatch_FALSE;
            *out_covers=&arrayCovers->ICovers;
            temp_cache_end=temp_cache_end_back; //free compressedCovers or packedCovers memory
            old_cache_end=temp_cache_end-kBestACacheSize*kCacheCount;
            // [       arrayCovers cache           |        ...        |      patch reserve cache       ]
            // [                                   |        ...        | (kBestACacheSize*kCacheCount) ]
            if (((hpatch_size_t)(temp_cache_end-temp_cache)<=kBestACacheSize*kCacheCount)
                ||(!_cache_old(&replace_oldData,oldData,arrayCovers,out_isReadError,
                               temp_cache,&old_cache_end,temp_cache_end))){
                if (*out_isReadError) return _hpatch_FALSE;
            // [         arrayCovers cache         |                   patch cache                      ]
                *ptemp_cache=temp_cache;
                *ptemp_cache_end=temp_cache_end;
                return hpatch_FALSE;
            }else{
            // [         arrayCovers cache         | oldData cache |             patch cache            ]
            // [                                   |               |(temp_cache_end-(new old_cache_end))]
                assert(!(*out_isReadError));
                assert((hpatch_size_t)(temp_cache_end-old_cache_end)>=kBestACacheSize*kCacheCount);
                temp_cache=old_cache_end;
                
                *poldData=replace_oldData;
                *ptemp_cache=temp_cache;
                *ptemp_cache_end=temp_cache_end;
                return hpatch_TRUE;
            }
        }
    }
#endif//_IS_NEED_CACHE_OLD_BY_COVERS
    return hpatch_FALSE;//not cache oldData
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1b8, %rsp            # imm = 0x1B8
movq %rdx, %rbx
movq %rdi, %r12
movq 0x208(%rsp), %rax
movq 0x200(%rsp), %rbp
movq 0x1f8(%rsp), %r13
movq 0x1f0(%rsp), %r10
movq (%rsi), %rdi
movq %r10, %rdx
shlq $0xc, %rdx
movq %rdi, 0x28(%rsp)
movq 0x8(%rdi), %r15
movq (%r13), %rdi
movq (%rbp), %r14
movl $0x0, (%rax)
movq %r14, %rax
movq %rdi, 0x30(%rsp)
subq %rdi, %rax
addq %r15, %rdx
addq $0x28, %rdx
cmpq %rdx, %rax
jae 0x4528b
movq %r10, %rdx
shlq $0x11, %rdx
movq %r15, %rdi
shrq $0x3, %rdi
addq %rdx, %rdi
movl $0x800000, %edx         # imm = 0x800000
cmpq %rdx, %rdi
cmovaeq %rdx, %rdi
cmpq %rdi, %rax
jb 0x45bb9
shlq $0x10, %r10
cmpq %r10, %rax
jbe 0x45bf9
movq %r10, 0x38(%rsp)
movq %rsi, 0x78(%rsp)
leaq 0x80(%rsp), %rdi
testl %r8d, %r8d
je 0x4532c
movq $0x0, (%rdi)
leaq -0x100b8(%r14), %r15
leaq 0xa0(%rsp), %rsi
movq %rcx, %rdx
movq %r9, %rcx
movq %r15, %r8
movq %r14, %r9
callq 0x468ca
testl %eax, %eax
je 0x452fc
movq 0xa0(%rsp), %rax
movq 0xa8(%rsp), %rcx
movq 0x28(%rsp), %rdx
movq 0x8(%rdx), %rdx
xorq %rcx, %rdx
xorq %rax, %rbx
orq %rdx, %rbx
jne 0x452fc
movq 0x80(%rsp), %rdx
movq %rdx, (%r12)
orq %rcx, %rax
xorl %ecx, %ecx
shrq $0x20, %rax
sete %cl
movl %ecx, (%rsp)
movb $0x1, %al
jmp 0x4530f
cmpq $0x28, %rax
jb 0x45bb9
movq %rsi, %rbx
movq %r14, %rdx
subq %r15, %rdx
movq 0x28(%rsp), %r15
movq %r15, %rdi
xorl %esi, %esi
movq %r14, %rcx
callq *0x10(%r15)
testl %eax, %eax
je 0x45319
movq 0x30(%rsp), %rsi
addq $0x7, %rsi
andq $-0x8, %rsi
leaq 0x20(%rsi), %rax
movq 0x8(%r15), %rcx
movq %r14, %rdx
subq %rcx, %rdx
movq %rdx, (%rsi)
movq %rcx, 0x8(%rsi)
leaq -0x1996(%rip), %rcx     # 0x43946
movq %rcx, 0x10(%rsi)
subq 0x8(%r15), %r14
movq $0x0, (%r12)
movq %rsi, (%rbx)
movq %rax, (%r13)
movq %r14, (%rbp)
jmp 0x45bb9
movq 0x208(%rsp), %rax
movl $0x1, (%rax)
xorl %eax, %eax
movq %r14, %r15
testb %al, %al
je 0x45bb9
jmp 0x45390
movq 0x208(%rsp), %rax
movl $0x1, (%rax)
jmp 0x45bb9
movq $0x0, (%rdi)
leaq -0x300e8(%r14), %rax
leaq 0xa0(%rsp), %rsi
movq %rcx, %rdx
movq %rax, %r13
movq %rax, %rcx
movq %r14, %r8
callq 0x4666a
testl %eax, %eax
je 0x45377
movq 0x80(%rsp), %rcx
movq %rcx, (%r12)
orq %rbx, %r15
xorl %ecx, %ecx
shrq $0x20, %r15
sete %cl
movl %ecx, (%rsp)
movq %r13, %r15
jmp 0x45388
movq 0x208(%rsp), %rcx
movl $0x1, (%rcx)
movq %r14, %r15
testl %eax, %eax
je 0x45bb9
movq (%r12), %rbx
movq %r15, 0x8(%rsp)
addq $-0x10000, %r15         # imm = 0xFFFF0000
movq %rbx, %rdi
callq *(%rbx)
movq %rax, %rdx
cmpl $0x0, (%rsp)
sete %cl
orb $0x4, %cl
movq %rax, %r13
shlq %cl, %r13
movq 0x208(%rsp), %rax
movl $0x0, (%rax)
movq %r15, %rax
movq 0x30(%rsp), %rcx
subq %rcx, %rax
cmpq $0x48, %rax
jb 0x453f6
addq $0x7, %rcx
andq $-0x8, %rcx
leaq 0x40(%rcx), %rsi
subq %rsi, %r15
movq %r13, %rax
orq $0x8, %rax
cmpq %rax, %r15
jae 0x4549f
xorl %ecx, %ecx
movq 0x8(%rsp), %rdx
movb $0x1, %sil
movq 0x208(%rsp), %rax
movl (%rax), %eax
testb %sil, %sil
movq 0x1f8(%rsp), %r13
je 0x45431
testl %eax, %eax
jne 0x45bb9
movq 0x30(%rsp), %rax
movq %rax, (%r13)
movq %rdx, (%rbp)
jmp 0x45bb9
movq %rcx, (%rsp)
testl %eax, %eax
jne 0x45c18
movq (%r12), %rdi
callq *0x18(%rdi)
testl %eax, %eax
movq 0x78(%rsp), %r11
movq 0x38(%rsp), %rsi
je 0x45bb9
movq (%rsp), %r9
movq %r9, (%r12)
movq %r14, %rax
movq 0x30(%rsp), %rcx
subq %rcx, %rax
cmpq %rsi, %rax
jbe 0x45bac
movq %r14, %r8
subq %rsi, %r8
movq 0x208(%rsp), %rax
movl $0x0, (%rax)
movq %r8, %rax
subq %rcx, %rax
movb $0x1, %dl
cmpq $0x28, %rax
jae 0x455c6
xorl %edi, %edi
jmp 0x45ba8
movq %rsi, 0x10(%rsp)
movq %rcx, 0x18(%rsp)
cmpl $0x0, (%rsp)
movq %rdx, 0x20(%rsp)
je 0x45523
testq %rdx, %rdx
je 0x4554c
movq 0x18(%rsp), %rax
leaq 0x48(%rax), %rbp
movq 0x20(%rsp), %r15
movq %rbx, %rdi
leaq 0xa0(%rsp), %rsi
callq *0x8(%rbx)
testl %eax, %eax
je 0x454fd
movl 0xa0(%rsp), %ecx
movl %ecx, -0x8(%rbp)
movl 0xa8(%rsp), %ecx
movl %ecx, -0x4(%rbp)
movl 0xb0(%rsp), %ecx
movl %ecx, (%rbp)
jmp 0x4550b
movq 0x208(%rsp), %rcx
movl $0x1, (%rcx)
testl %eax, %eax
movl $0x0, %ecx
je 0x45671
addq $0x10, %rbp
decq %r15
jne 0x454cb
jmp 0x4554c
testq %rdx, %rdx
je 0x4554c
movq 0x20(%rsp), %r15
movq 0x10(%rsp), %rbp
movq %rbx, %rdi
movq %rbp, %rsi
callq *0x8(%rbx)
testl %eax, %eax
je 0x45661
addq $0x20, %rbp
decq %r15
jne 0x45532
movq %rbx, %rdi
callq *0x10(%rbx)
testl %eax, %eax
movq 0x200(%rsp), %rbp
movq 0x8(%rsp), %rdx
je 0x4564c
movq 0x10(%rsp), %rax
addq %rax, %r13
movq 0x18(%rsp), %rcx
movq %rax, 0x20(%rcx)
movl (%rsp), %eax
movl %eax, 0x38(%rcx)
movq 0x20(%rsp), %rax
movq %rax, 0x28(%rcx)
movq $0x0, 0x30(%rcx)
leaq 0x22da(%rip), %rax      # 0x47870
movq %rax, 0x18(%rcx)
leaq 0x22d5(%rip), %rax      # 0x47876
movq %rax, 0x10(%rcx)
leaq 0x22d8(%rip), %rax      # 0x47884
movq %rax, (%rcx)
leaq 0x22d7(%rip), %rax      # 0x4788d
movq %rax, 0x8(%rcx)
xorl %esi, %esi
movq %r13, 0x30(%rsp)
jmp 0x45400
leaq 0x7(%rcx), %rdi
andq $-0x8, %rdi
leaq 0x20(%rdi), %rcx
movq %r8, %rax
subq %rcx, %rax
cmpq $0x80, %rax
jb 0x45ba8
movq %rcx, 0x90(%rsp)
movq %rdi, %r12
addq $0x98, %r12
movq 0x28(%r9), %rbx
movl 0x38(%r9), %ebp
movq %r8, %r15
subq %r12, %r15
testl %ebp, %ebp
sete %cl
orb $0x4, %cl
movq %rbx, %rdx
shlq %cl, %rdx
leaq 0x8(%rdx), %rax
cmpq %rax, %r15
movq %rdi, 0x50(%rsp)
movq %r8, 0x48(%rsp)
movq %r12, 0x68(%rsp)
jb 0x456e2
movq 0x20(%r9), %rsi
movq %r12, %rdi
callq 0x4290
testl %ebp, %ebp
je 0x4567e
leaq 0x23ac(%rip), %rcx      # 0x479f1
movl $0x10, %edx
jmp 0x4568a
movq 0x208(%rsp), %rax
movl $0x1, (%rax)
xorl %ecx, %ecx
jmp 0x453fd
movq 0x208(%rsp), %rax
movl $0x1, (%rax)
xorl %ecx, %ecx
movq 0x200(%rsp), %rbp
jmp 0x453f8
leaq 0x2380(%rip), %rcx      # 0x47a05
movl $0x20, %edx
movq %r12, %rdi
movq %rbx, %rsi
callq 0x4630
testq %rbx, %rbx
movq 0x78(%rsp), %r11
movq 0x38(%rsp), %rsi
movq (%rsp), %r9
movq 0x50(%rsp), %rdi
movq 0x48(%rsp), %r8
je 0x456e2
xorl %eax, %eax
xorl %ecx, %ecx
testl %ebp, %ebp
je 0x456c3
movl 0xa0(%rdi,%rax), %edx
jmp 0x456cb
movq 0xa8(%rdi,%rax,2), %rdx
addq %rdx, %rcx
cmpq %r15, %rcx
ja 0x4584a
addq $0x10, %rax
decq %rbx
jne 0x456b6
jmp 0x456e4
xorl %edx, %edx
testq %rdx, %rdx
je 0x457b8
movq %rdx, 0x8(%rsp)
movq 0x28(%r9), %rdx
movq %rdx, %rcx
shrq $0x3, %rcx
testq %rdx, %rdx
movq 0x200(%rsp), %rbp
movq %rdx, 0x10(%rsp)
je 0x457c5
movq 0x20(%r9), %rsi
movq $-0x1, %rax
xorl %edi, %edi
movq %rdx, %r8
xorl %r12d, %r12d
xorl %edx, %edx
movq $0x0, 0x60(%rsp)
movq 0x28(%rsp), %rbx
movl 0x38(%r9), %r10d
testl %r10d, %r10d
je 0x45746
movl 0x8(%rsi,%rdi), %r9d
jmp 0x4574b
movq 0x10(%rsi,%rdi,2), %r9
cmpq 0x8(%rsp), %r9
ja 0x457a9
testl %r10d, %r10d
je 0x45766
movq (%rsp), %r15
movq 0x20(%r15), %r10
movl %r12d, 0xc(%r10,%rdi)
jmp 0x45773
movq (%rsp), %r15
movq 0x20(%r15), %r10
movq %r12, 0x18(%r10,%rdi,2)
cmpl $0x0, 0x38(%r15)
movq 0x20(%r15), %r10
je 0x45784
movl (%r10,%rdi), %r10d
jmp 0x45788
movq (%r10,%rdi,2), %r10
addq %r9, %r12
incq %rdx
cmpq %rax, %r10
cmovbq %r10, %rax
addq %r9, %r10
movq 0x60(%rsp), %r9
cmpq %r9, %r10
cmovaq %r10, %r9
movq %r9, 0x60(%rsp)
addq $0x10, %rdi
decq %r8
movq (%rsp), %r9
jne 0x45736
jmp 0x457df
movq 0x200(%rsp), %rbp
jmp 0x45ba6
movq $-0x1, %rax
movq $0x0, 0x60(%rsp)
xorl %edx, %edx
xorl %r12d, %r12d
movq 0x28(%rsp), %rbx
cmpq %rcx, %rdx
jbe 0x45852
testq %r12, %r12
movq 0x38(%rsp), %rsi
movq 0x50(%rsp), %rdi
movq 0x48(%rsp), %r8
je 0x45ba6
movq 0x68(%rsp), %rcx
leaq (%rcx,%r12), %rdx
movq %r14, %rcx
subq %rdx, %rcx
movq %rdx, %r15
movq %r14, 0x58(%rsp)
cmpq $0x2000, %rcx           # imm = 0x2000
movq 0x10(%rsp), %rsi
jb 0x45875
leaq 0xfff(%rdx), %r15
andq $-0x1000, %r15          # imm = 0xF000
movq %r14, %rcx
subq %r15, %rcx
cmpq $0x200000, %rcx         # imm = 0x200000
jb 0x45866
movq %r15, %rcx
addq $0x200000, %rcx         # imm = 0x200000
jmp 0x45870
decq %rdx
jmp 0x456e4
movq 0x38(%rsp), %rsi
movq 0x50(%rsp), %rdi
movq 0x48(%rsp), %r8
jmp 0x45ba6
movq %r14, %rcx
andq $-0x1000, %rcx          # imm = 0xF000
movq %rcx, 0x58(%rsp)
movq %rdx, 0x88(%rsp)
movq %rax, %rcx
andq $-0x1000, %rcx          # imm = 0xF000
xorl %edx, %edx
cmpq $0x400000, %rax         # imm = 0x400000
cmovaeq %rcx, %rdx
movq %rdx, 0x20(%rsp)
cmpl $0x0, 0x38(%r9)
movq 0x20(%r9), %rdi
je 0x458b1
leaq 0x2171(%rip), %rcx      # 0x47a1b
movl $0x10, %edx
jmp 0x458bd
leaq 0x2175(%rip), %rcx      # 0x47a2d
movl $0x20, %edx
callq 0x4630
subq %r15, 0x58(%rsp)
movl $0x1, 0x40(%rsp)
xorl %r13d, %r13d
movq (%rsp), %r10
movq 0x10(%rsp), %r8
movq 0x20(%rsp), %rsi
movq %r14, 0x98(%rsp)
movq %rbx, %rdi
movq %r15, 0x70(%rsp)
cmpq %r8, %r13
jae 0x45ab6
movq 0x60(%rsp), %rbp
subq %rsi, %rbp
jbe 0x45aae
movq %r12, 0x18(%rsp)
movq 0x58(%rsp), %rax
cmpq %rbp, %rax
cmovbq %rax, %rbp
leaq (%r15,%rbp), %rcx
movq %r15, %rdx
movq %rsi, %rbx
movq %rdi, %r12
callq *0x10(%rdi)
testl %eax, %eax
je 0x45a80
movl %eax, 0x44(%rsp)
addq %rbx, %rbp
movq %r13, %r12
shlq $0x4, %r12
movq %r13, %r15
movq (%rsp), %r10
movq 0x8(%rsp), %rdi
movq 0x10(%rsp), %r8
movq %rbx, %r9
movl 0x38(%r10), %eax
movq 0x20(%r10), %rcx
testl %eax, %eax
je 0x45965
movl 0x8(%rcx,%r12), %ebx
jmp 0x4596a
movq 0x10(%rcx,%r12,2), %rbx
cmpq %rdi, %rbx
ja 0x459a0
movq 0x20(%r10), %rcx
testl %eax, %eax
je 0x4597d
movl (%rcx,%r12), %ecx
jmp 0x45981
movq (%rcx,%r12,2), %rcx
addq %rcx, %rbx
cmpq %r9, %rbx
jbe 0x459a0
movq %rcx, %rdx
subq %rbp, %rdx
jae 0x459c6
movq 0x20(%r10), %rdx
testl %eax, %eax
je 0x459e3
movl 0xc(%rdx,%r12), %edi
jmp 0x459e8
xorl %eax, %eax
cmpq %r13, %r15
sete %al
addq %rax, %r13
movb $0x1, %al
testb %al, %al
je 0x45a60
incq %r15
addq $0x10, %r12
cmpq %r8, %r15
jb 0x45952
jmp 0x45a60
andq $-0x1000, %rcx          # imm = 0xF000
cmpq $0x400000, %rdx         # imm = 0x400000
cmovbq %rbp, %rcx
cmpq %r13, %r15
cmoveq %rcx, %rbp
xorl %eax, %eax
jmp 0x459ad
movq 0x18(%rdx,%r12,2), %rdi
cmpq %r9, %rcx
movq %r9, %rsi
cmovaq %rcx, %rsi
movq %r9, %rax
subq %rcx, %rax
movl $0x0, %ecx
cmovaeq %rax, %rcx
cmpq %rbp, %rbx
setbe 0x20(%rsp)
cmovaeq %rbp, %rbx
subq %rsi, %rbx
addq 0x68(%rsp), %rdi
addq %rcx, %rdi
subq %r9, %rsi
addq 0x70(%rsp), %rsi
movq %rbx, %rdx
movq %r9, %r14
callq 0x4290
movq %r14, %r9
subq %rbx, 0x18(%rsp)
cmpq %r13, %r15
sete %al
andb 0x20(%rsp), %al
movzbl %al, %eax
addq %rax, %r13
movb $0x1, %al
movq (%rsp), %r10
movq 0x8(%rsp), %rdi
movq 0x10(%rsp), %r8
movq 0x98(%rsp), %r14
jmp 0x459ad
movq %rbp, %rsi
movq 0x200(%rsp), %rbp
movq 0x28(%rsp), %rdi
movq 0x18(%rsp), %r12
movq 0x70(%rsp), %r15
movl 0x44(%rsp), %eax
jmp 0x45aa4
movl $0x0, 0x40(%rsp)
movq 0x200(%rsp), %rbp
movq (%rsp), %r10
movq 0x10(%rsp), %r8
movq %rbx, %rsi
movq %r12, %rdi
movq 0x18(%rsp), %r12
testl %eax, %eax
jne 0x458f0
jmp 0x45ab6
movq 0x200(%rsp), %rbp
movq %rdi, %rbx
cmpl $0x0, 0x38(%r10)
movq 0x20(%r10), %rdi
movq 0x28(%r10), %rsi
movq 0x1f8(%rsp), %r13
je 0x45ade
leaq 0x1f6a(%rip), %rcx      # 0x47a41
movl $0x10, %edx
jmp 0x45aea
leaq 0x1f70(%rip), %rcx      # 0x47a55
movl $0x20, %edx
callq 0x4630
testq %r12, %r12
movq 0x78(%rsp), %r11
movq 0x38(%rsp), %rsi
movq 0x50(%rsp), %rdi
movq 0x48(%rsp), %r8
movq 0x8(%rsp), %rcx
jne 0x45c75
cmpl $0x0, 0x40(%rsp)
movq (%rsp), %rax
je 0x45b98
movups (%rax), %xmm0
movups 0x10(%rax), %xmm1
movups 0x20(%rax), %xmm2
movups 0x30(%rax), %xmm3
movq 0x90(%rsp), %rax
movups %xmm3, 0x30(%rax)
movups %xmm2, 0x20(%rax)
movups %xmm1, 0x10(%rax)
movups %xmm0, (%rax)
movq $0x0, 0x50(%rdi)
movl $0x0, 0x60(%rdi)
movq %rcx, 0x68(%rdi)
movq 0x68(%rsp), %rcx
movq %rcx, 0x80(%rdi)
movq 0x88(%rsp), %r8
movq %r8, 0x88(%rdi)
xorps %xmm0, %xmm0
movups %xmm0, 0x70(%rdi)
movq %rbx, 0x90(%rdi)
movq %rax, (%rdi)
movq 0x8(%rbx), %rax
movq %rax, 0x8(%rdi)
leaq 0x1d5a(%rip), %rax      # 0x478ea
movq %rax, 0x10(%rdi)
xorl %edx, %edx
jmp 0x45ba8
movq 0x208(%rsp), %rax
movl $0x1, (%rax)
movb $0x1, %dl
testb %dl, %dl
je 0x45bd5
movq 0x208(%rsp), %rax
cmpl $0x0, (%rax)
je 0x45bcb
addq $0x1b8, %rsp            # imm = 0x1B8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x30(%rsp), %rax
jmp 0x452ef
movq 0x208(%rsp), %rax
cmpl $0x0, (%rax)
jne 0x45c37
movq %r14, %rax
subq %r8, %rax
cmpq %rsi, %rax
jb 0x45c56
movq %rdi, (%r11)
movq %r8, (%r13)
jmp 0x452f3
leaq 0x1bfb5(%rip), %rdi     # 0x61bb5
leaq 0x1b707(%rip), %rsi     # 0x6130e
leaq 0x1bfee(%rip), %rcx     # 0x61bfc
movl $0x72b, %edx            # imm = 0x72B
callq 0x4200
leaq 0x1c0a6(%rip), %rdi     # 0x61cc5
leaq 0x1b6e8(%rip), %rsi     # 0x6130e
leaq 0x1bfcf(%rip), %rcx     # 0x61bfc
movl $0x755, %edx            # imm = 0x755
callq 0x4200
leaq 0x1c087(%rip), %rdi     # 0x61cc5
leaq 0x1b6c9(%rip), %rsi     # 0x6130e
leaq 0x1bfb0(%rip), %rcx     # 0x61bfc
movl $0x767, %edx            # imm = 0x767
callq 0x4200
leaq 0x1c07c(%rip), %rdi     # 0x61cd9
leaq 0x1b6aa(%rip), %rsi     # 0x6130e
leaq 0x1bf91(%rip), %rcx     # 0x61bfc
movl $0x768, %edx            # imm = 0x768
callq 0x4200
leaq 0x1c153(%rip), %rdi     # 0x61dcf
leaq 0x1b68b(%rip), %rsi     # 0x6130e
leaq 0x1c09a(%rip), %rcx     # 0x61d24
movl $0x6a9, %edx            # imm = 0x6A9
callq 0x4200