// File: sisong[P]ApkDiffPatch/HDiffPatch/libHDiffPatch/HDiff/match_block.cpp
// Function: create_single_compressed_diff_block(unsigned char*, unsigned char*, unsigned char*, unsigned char*, hpatch_TStreamOutput const*, hdiff_TCompress const*, int, unsigned long, bool, unsigned long, unsigned long)
void create_single_compressed_diff_block(unsigned char* newData,unsigned char* newData_end,
                                         unsigned char* oldData,unsigned char* oldData_end,
                                         const hpatch_TStreamOutput* out_diff,const hdiff_TCompress* compressPlugin,
                                         int kMinSingleMatchScore,size_t patchStepMemSize,
                                         bool isUseBigCacheMatch,size_t matchBlockSize,size_t threadNum){
    if (matchBlockSize==0){
        create_single_compressed_diff(newData,newData_end,oldData,oldData_end,
                                      out_diff,compressPlugin,kMinSingleMatchScore,
                                      patchStepMemSize,isUseBigCacheMatch,0,threadNum);
        return;
    }
    TCoversOptimMB<TMatchBlock> coversOp(newData,newData_end,oldData,oldData_end,matchBlockSize,threadNum);
    create_single_compressed_diff(newData,coversOp.matchBlock->newData_end_cur,oldData,coversOp.matchBlock->oldData_end_cur,
                                  out_diff,compressPlugin,kMinSingleMatchScore,
                                  patchStepMemSize,isUseBigCacheMatch,&coversOp,threadNum);                                      
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %rbx
subq $0x148, %rsp            # imm = 0x148
movq 0x30(%rbp), %rax
movq 0x28(%rbp), %rax
movb 0x20(%rbp), %al
movq 0x18(%rbp), %r10
movl 0x10(%rbp), %r10d
movq %rdi, -0x20(%rbp)
movq %rsi, -0x28(%rbp)
movq %rdx, -0x30(%rbp)
movq %rcx, -0x38(%rbp)
movq %r8, -0x40(%rbp)
movq %r9, -0x48(%rbp)
andb $0x1, %al
movb %al, -0x49(%rbp)
cmpq $0x0, 0x28(%rbp)
jne 0x31dce
movq -0x20(%rbp), %rdi
movq -0x28(%rbp), %rsi
movq -0x30(%rbp), %rdx
movq -0x38(%rbp), %rcx
movq -0x40(%rbp), %r8
movq -0x48(%rbp), %r9
movl 0x10(%rbp), %ebx
movq 0x18(%rbp), %r11
movb -0x49(%rbp), %r10b
movq 0x30(%rbp), %rax
xorl %r14d, %r14d
andb $0x1, %r10b
movl %ebx, (%rsp)
movq %r11, 0x8(%rsp)
movzbl %r10b, %r10d
movl %r10d, 0x10(%rsp)
movq $0x0, 0x18(%rsp)
movq %rax, 0x20(%rsp)
callq 0x1a160
jmp 0x31e55
movq -0x20(%rbp), %rsi
movq -0x28(%rbp), %rdx
movq -0x30(%rbp), %rcx
movq -0x38(%rbp), %r8
movq 0x28(%rbp), %r9
movq 0x30(%rbp), %rdi
movq %rsp, %rax
movq %rdi, (%rax)
leaq -0x120(%rbp), %r14
movq %r14, %rdi
callq 0x333b0
movq -0x20(%rbp), %rdi
movq -0xe0(%rbp), %rax
movq -0x30(%rbp), %rdx
movq 0x10(%rax), %rsi
movq 0x28(%rax), %rcx
movq -0x40(%rbp), %r8
movq -0x48(%rbp), %r9
movl 0x10(%rbp), %r10d
movq 0x18(%rbp), %r11
movq 0x30(%rbp), %r15
movzbl -0x49(%rbp), %ebx
movq %rsp, %rax
movq %r15, 0x20(%rax)
movq %r14, 0x18(%rax)
andl $0x1, %ebx
movl %ebx, 0x10(%rax)
movq %r11, 0x8(%rax)
movl %r10d, (%rax)
callq 0x1a160
jmp 0x31e49
leaq -0x120(%rbp), %rdi
callq 0x33460
addq $0x148, %rsp            # imm = 0x148
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x128(%rbp)
movl %eax, -0x12c(%rbp)
leaq -0x120(%rbp), %rdi
callq 0x33460
movq -0x128(%rbp), %rdi
callq 0x4680
nopl (%rax)