// File: /workspace/github_cpp_makefile_star2_O1/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:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movb $0x1, %bl
cmpq $0x0, (%rdi)
jne 0x61e5
movq %r8, %r15
movq %rcx, %r14
movq %rdx, %r13
movq %rsi, %r12
movq %rdi, %rbp
movq %r9, (%rsp)
movq %rcx, %rdi
callq 0x4140
movq %r13, %rcx
subq %r12, %rcx
cmpq %rcx, %rax
jne 0x61e5
movq %r12, %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0x4180
testl %eax, %eax
jne 0x61e5
movq 0x60(%rsp), %r12
movq 0x48(%rsp), %rcx
movq %r14, (%rbp)
testq %r15, %r15
je 0x61c3
cmpb $0x2d, (%r13)
jne 0x61c3
leaq 0x1(%r13), %r14
movq %r14, %rdi
movl $0x2d, %esi
callq 0x4100
movq %rax, %rbp
testq %rax, %rax
jne 0x60d7
movq %r14, %rdi
callq 0x4140
movq %rax, %rbp
addq %r14, %rbp
movq %rbp, %rax
subq %r14, %rax
je 0x61ca
cmpq $0x1, %rax
je 0x60f3
cmpb $0x30, (%r14)
je 0x61ca
movq 0x58(%rsp), %r11
movq 0x50(%rsp), %r14
movabsq $0x1999999999999999, %rcx # imm = 0x1999999999999999
movq %rbp, %rdx
subq %r13, %rdx
movl $0x1, %esi
xorl %eax, %eax
movq (%rsp), %r10
movzbl (%r13,%rsi), %edi
leal -0x30(%rdi), %r8d
cmpb $0x9, %r8b
ja 0x6142
addq $-0x30, %rdi
cmpq %rcx, %rax
jb 0x6146
setne %r8b
cmpq $0x6, %rdi
setae %r9b
orb %r8b, %r9b
je 0x6146
xorl %edi, %edi
jmp 0x6151
leaq (%rax,%rax,4), %rax
leaq (%rdi,%rax,2), %rax
movb $0x1, %dil
testb %dil, %dil
je 0x61ca
incq %rsi
cmpq %rsi, %rdx
jne 0x6118
movq %rax, (%r15)
cmpq %r10, %rax
jb 0x6172
movl $0x9, %r10d
cmpq $0xa, %rax
jb 0x6175
movq %r10, (%r15)
movq 0x48(%rsp), %rcx
testq %rcx, %rcx
je 0x61f6
cmpb $0x2d, (%rbp)
jne 0x61f6
movq %r11, %r13
incq %rbp
movq %rbp, %rdi
movq %rcx, %r15
callq 0x5d78
subq %rbp, %rax
movq %rbp, %rdi
movq %rax, %rsi
movq %r15, %rdx
callq 0x5c81
testl %eax, %eax
je 0x61ca
movq (%r15), %rax
movq %r14, %r12
cmpq %r14, %rax
movq %r15, %rcx
jb 0x61e0
movq %r13, %r12
cmpq %r13, %rax
ja 0x61e0
jmp 0x61e5
cmpb $0x0, (%r13)
je 0x61ce
xorl %ebx, %ebx
jmp 0x61e5
testq %r15, %r15
je 0x61db
movq 0x40(%rsp), %rax
movq %rax, (%r15)
testq %rcx, %rcx
je 0x61e5
movq %r12, (%rcx)
movb $0x1, %bl
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movb (%rbp), %al
testb %al, %al
sete %bl
testq %rcx, %rcx
je 0x61e5
testb %al, %al
je 0x61e0
jmp 0x61e5