// File: sisong[P]ApkDiffPatch/src/zip_diff.cpp
// Function: checkSetCompress(hdiff_TCompress**, hpatch_TDecompress**, char const*, char const*)
static int _checkSetCompress(hdiff_TCompress** out_compressPlugin,
                             hpatch_TDecompress** out_decompressPlugin,
                             const char* ptype,const char* ptypeEnd){
    const char* isMatchedType=0;
    size_t      compressLevel=0;
#if (defined _CompressPlugin_lzma)||(defined _CompressPlugin_lzma2)
    size_t       dictSize=0;
    const size_t defaultDictSize=kDefaultLzmaDictSize;
#endif
#ifdef _CompressPlugin_zlib
    _options_check(_tryGetCompressSet(&isMatchedType,
                                      ptype,ptypeEnd,"zlib",0,&compressLevel,1,9,9),"-c-zlib-?");
     if ((isMatchedType)&&(0==strcmp(isMatchedType,"zlib"))){
         static TCompressPlugin_zlib _zlibCompressPlugin=zlibCompressPlugin;
         _zlibCompressPlugin.compress_level=(int)compressLevel;
         _zlibCompressPlugin.mem_level=kDefaultZlibCompressMemLevel;
         *out_compressPlugin=&_zlibCompressPlugin.base;
         *out_decompressPlugin=&zlibDecompressPlugin; }
#endif
#ifdef _CompressPlugin_lzma
    _options_check(_tryGetCompressSet(&isMatchedType,
                                      ptype,ptypeEnd,"lzma",0,&compressLevel,0,9,7, &dictSize,1<<12,
                                      (sizeof(size_t)<=4)?(1<<27):((size_t)3<<29),defaultDictSize),"-c-lzma-?");
     if ((isMatchedType)&&(0==strcmp(isMatchedType,"lzma"))){
         static TCompressPlugin_lzma _lzmaCompressPlugin=lzmaCompressPlugin;
         _lzmaCompressPlugin.compress_level=(int)compressLevel;
         _lzmaCompressPlugin.dict_size=(int)dictSize;
         *out_compressPlugin=&_lzmaCompressPlugin.base;
         *out_decompressPlugin=&lzmaDecompressPlugin;  }
#endif
#ifdef _CompressPlugin_lzma2
    _options_check(_tryGetCompressSet(&isMatchedType,ptype,ptypeEnd,"lzma2",0,
                                      &compressLevel,0,9,7, &dictSize,1<<12,
                                      (sizeof(size_t)<=4)?(1<<27):((size_t)3<<29),defaultDictSize),"-c-lzma2-?");
     if ((isMatchedType)&&(0==strcmp(isMatchedType,"lzma2"))){
         static TCompressPlugin_lzma2 _lzma2CompressPlugin=lzma2CompressPlugin;
         _lzma2CompressPlugin.compress_level=(int)compressLevel;
         _lzma2CompressPlugin.dict_size=(int)dictSize;
         *out_compressPlugin=&_lzma2CompressPlugin.base;
         *out_decompressPlugin=&lzma2DecompressPlugin;  }
#endif
    _options_check((*out_compressPlugin!=0)&&(*out_decompressPlugin!=0),"-c-?");
    return 0; //ok
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq $0x0, -0x30(%rbp)
movq $0x0, -0x38(%rbp)
movq $0x0, -0x40(%rbp)
movq $0x400000, -0x48(%rbp)  # imm = 0x400000
movq -0x20(%rbp), %rsi
movq -0x28(%rbp), %rdx
leaq -0x30(%rbp), %rdi
leaq 0xa725c(%rip), %rcx     # 0xacd1a
xorl %eax, %eax
movl %eax, %r8d
leaq -0x38(%rbp), %r9
movq $0x1, (%rsp)
movq $0x9, 0x8(%rsp)
movq $0x9, 0x10(%rsp)
movq $0x0, 0x18(%rsp)
movq $0x0, 0x20(%rsp)
movq $0x0, 0x28(%rsp)
movq $0x0, 0x30(%rsp)
callq 0x6200
testb $0x1, %al
jne 0x5b2d
leaq 0xa6ec9(%rip), %rdi     # 0xac9de
movb $0x0, %al
callq 0x4060
callq 0x5760
movl $0x1, -0x4(%rbp)
jmp 0x5d55
cmpq $0x0, -0x30(%rbp)
je 0x5b7c
movq -0x30(%rbp), %rdi
leaq 0xa71db(%rip), %rsi     # 0xacd1a
callq 0x44f0
movl %eax, %ecx
xorl %eax, %eax
cmpl %ecx, %eax
jne 0x5b7c
movq -0x38(%rbp), %rax
movl %eax, 0xe08fa(%rip)     # 0xe6450
movl $0x8, 0xe08f4(%rip)     # 0xe6454
movq -0x10(%rbp), %rax
leaq 0xe08bd(%rip), %rcx     # 0xe6428
movq %rcx, (%rax)
movq -0x18(%rbp), %rax
leaq 0xe08ef(%rip), %rcx     # 0xe6468
movq %rcx, (%rax)
movq -0x20(%rbp), %rsi
movq -0x28(%rbp), %rdx
leaq -0x30(%rbp), %rdi
leaq 0xa6e69(%rip), %rcx     # 0xac9f8
xorl %eax, %eax
movl %eax, %r8d
leaq -0x38(%rbp), %r9
leaq -0x40(%rbp), %rax
movq $0x0, (%rsp)
movq $0x9, 0x8(%rsp)
movq $0x7, 0x10(%rsp)
movq %rax, 0x18(%rsp)
movq $0x1000, 0x20(%rsp)     # imm = 0x1000
movq $0x60000000, 0x28(%rsp) # imm = 0x60000000
movq $0x400000, 0x30(%rsp)   # imm = 0x400000
callq 0x6200
testb $0x1, %al
jne 0x5bfe
leaq 0xa6e17(%rip), %rdi     # 0xac9fd
movb $0x0, %al
callq 0x4060
callq 0x5760
movl $0x1, -0x4(%rbp)
jmp 0x5d55
cmpq $0x0, -0x30(%rbp)
je 0x5c4d
movq -0x30(%rbp), %rdi
leaq 0xa6de8(%rip), %rsi     # 0xac9f8
callq 0x44f0
movl %eax, %ecx
xorl %eax, %eax
cmpl %ecx, %eax
jne 0x5c4d
movq -0x38(%rbp), %rax
movl %eax, 0xe0899(%rip)     # 0xe64c0
movq -0x40(%rbp), %rax
movl %eax, 0xe0893(%rip)     # 0xe64c4
movq -0x10(%rbp), %rax
leaq 0xe085c(%rip), %rcx     # 0xe6498
movq %rcx, (%rax)
movq -0x18(%rbp), %rax
leaq 0xe07ae(%rip), %rcx     # 0xe63f8
movq %rcx, (%rax)
movq -0x20(%rbp), %rsi
movq -0x28(%rbp), %rdx
leaq -0x30(%rbp), %rdi
leaq 0xa6db7(%rip), %rcx     # 0xaca17
xorl %eax, %eax
movl %eax, %r8d
leaq -0x38(%rbp), %r9
leaq -0x40(%rbp), %rax
movq $0x0, (%rsp)
movq $0x9, 0x8(%rsp)
movq $0x7, 0x10(%rsp)
movq %rax, 0x18(%rsp)
movq $0x1000, 0x20(%rsp)     # imm = 0x1000
movq $0x60000000, 0x28(%rsp) # imm = 0x60000000
movq $0x400000, 0x30(%rsp)   # imm = 0x400000
callq 0x6200
testb $0x1, %al
jne 0x5ccf
leaq 0xa6d66(%rip), %rdi     # 0xaca1d
movb $0x0, %al
callq 0x4060
callq 0x5760
movl $0x1, -0x4(%rbp)
jmp 0x5d55
cmpq $0x0, -0x30(%rbp)
je 0x5d1e
movq -0x30(%rbp), %rdi
leaq 0xa6d36(%rip), %rsi     # 0xaca17
callq 0x44f0
movl %eax, %ecx
xorl %eax, %eax
cmpl %ecx, %eax
jne 0x5d1e
movq -0x38(%rbp), %rax
movl %eax, 0xe0800(%rip)     # 0xe64f8
movq -0x40(%rbp), %rax
movl %eax, 0xe07fa(%rip)     # 0xe64fc
movq -0x10(%rbp), %rax
leaq 0xe07c3(%rip), %rcx     # 0xe64d0
movq %rcx, (%rax)
movq -0x18(%rbp), %rax
leaq 0xe07ed(%rip), %rcx     # 0xe6508
movq %rcx, (%rax)
movq -0x10(%rbp), %rax
cmpq $0x0, (%rax)
je 0x5d32
movq -0x18(%rbp), %rax
cmpq $0x0, (%rax)
jne 0x5d4e
leaq 0xa6cff(%rip), %rdi     # 0xaca38
movb $0x0, %al
callq 0x4060
callq 0x5760
movl $0x1, -0x4(%rbp)
jmp 0x5d55
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x80, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)