// File: /workspace/github_cpp_makefile_star2_O2/sisong[P]ApkDiffPatch/src/zip_diff.cpp
// Function: tryGetCompressSet(char const**, char const*, char const*, char const*, char const*, unsigned long*, unsigned long, unsigned long, unsigned long, unsigned long*, unsigned long, unsigned long, unsigned long)
static bool _tryGetCompressSet(const char** isMatchedType,const char* ptype,const char* ptypeEnd,
                               const char* cmpType,const char* cmpType2=0,
                               size_t* compressLevel=0,size_t levelMin=0,size_t levelMax=0,size_t levelDefault=0,
                               size_t* dictSize=0,size_t dictSizeMin=0,size_t dictSizeMax=0,size_t dictSizeDefault=0){
    if (*isMatchedType) return true; //ok
    const size_t ctypeLen=strlen(cmpType);
    const size_t ctype2Len=(cmpType2!=0)?strlen(cmpType2):0;
    if ( ((ctypeLen==(size_t)(ptypeEnd-ptype))&&(0==strncmp(ptype,cmpType,ctypeLen)))
        || ((cmpType2!=0)&&(ctype2Len==(size_t)(ptypeEnd-ptype))&&(0==strncmp(ptype,cmpType2,ctype2Len))) )
        *isMatchedType=cmpType; //ok
    else
        return true;//type mismatch
    
    if ((compressLevel)&&(ptypeEnd[0]=='-')){
        const char* plevel=ptypeEnd+1;
        const char* plevelEnd=findUntilEnd(plevel,'-');
        if (!a_to_size(plevel,plevelEnd-plevel,compressLevel)) return false; //error
        if (*compressLevel<levelMin) *compressLevel=levelMin;
        else if (*compressLevel>levelMax) *compressLevel=levelMax;
        if ((dictSize)&&(plevelEnd[0]=='-')){
            const char* pdictSize=plevelEnd+1;
            const char* pdictSizeEnd=findUntilEnd(pdictSize,'-');
            if (!kmg_to_size(pdictSize,pdictSizeEnd-pdictSize,dictSize)) return false; //error
            if (*dictSize<dictSizeMin) *dictSize=dictSizeMin;
            else if (*dictSize>dictSizeMax) *dictSize=dictSizeMax;
        }else{
            if (plevelEnd[0]!='\0') return false; //error
            if (dictSize) *dictSize=dictSizeDefault;
        }
    }else{
        if (ptypeEnd[0]!='\0') return false; //error
        if (compressLevel) *compressLevel=levelDefault;
        if (dictSize) *dictSize=dictSizeDefault;
    }
    return true;
}

// Assembly:
movb $0x1, %al
cmpq $0x0, (%rdi)
je 0x561d
retq
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r9, %r12
movq %r8, %r15
movq %rcx, %rbp
movq %rdx, %r13
movq %rsi, %rbx
movq %rdi, %r14
movq %rcx, %rdi
callq 0x4150
movq %r13, %rcx
subq %rbx, %rcx
cmpq %rcx, %rax
jne 0x565f
movq %rbx, %rdi
movq %rbp, %rsi
movq %rax, %rdx
callq 0x41b0
testl %eax, %eax
je 0x5670
movb $0x1, %al
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x60(%rsp), %rbx
movq 0x48(%rsp), %rcx
movq %rbp, (%r14)
movzbl (%r13), %eax
testq %r15, %r15
je 0x5732
testl %eax, %eax
je 0x573d
cmpl $0x2d, %eax
jne 0x5736
movq %rcx, %r14
incq %r13
movq %r13, %rdi
callq 0x538b
movq %rax, %rbp
movq %rax, %rsi
subq %r13, %rsi
movq %r13, %rdi
movq %r15, %rdx
callq 0x532b
testl %eax, %eax
je 0x5736
movq (%r15), %rax
cmpq %r12, %rax
movq %r14, %rcx
jb 0x56d7
cmpq $0xa, %rax
jb 0x56da
pushq $0x9
popq %r12
movq %r12, (%r15)
movzbl (%rbp), %eax
testq %rcx, %rcx
je 0x5756
testl %eax, %eax
je 0x574e
cmpl $0x2d, %eax
jne 0x5736
incq %rbp
movq %rbp, %rdi
movq %rcx, %rbx
callq 0x538b
subq %rbp, %rax
movq %rbp, %rdi
movq %rax, %rsi
movq %rbx, %rdx
callq 0x527c
testl %eax, %eax
je 0x5736
movq 0x50(%rsp), %rcx
movq (%rbx), %rax
cmpq %rcx, %rax
jb 0x572a
movq 0x58(%rsp), %rcx
cmpq %rcx, %rax
jbe 0x565f
movq %rcx, (%rbx)
jmp 0x565f
testl %eax, %eax
je 0x5745
xorl %eax, %eax
jmp 0x5661
movq 0x40(%rsp), %rax
movq %rax, (%r15)
testq %rcx, %rcx
je 0x565f
movq %rbx, (%rcx)
jmp 0x565f
testl %eax, %eax
sete %al
jmp 0x5661