// File: /workspace/github_cpp_makefile_star2_O3/sisong[P]ApkDiffPatch/HDiffPatch/libHDiffPatch/HDiff/private_diff/bytes_rle.cpp
// Function: hdiff_private::_maxCodeSize(hdiff_private::TLastType&, unsigned long long&, unsigned long long&, unsigned long long&, unsigned char const*, unsigned char const*)
static void _maxCodeSize(TLastType& lastType,hpatch_StreamPos_t& curLen0,hpatch_StreamPos_t& curLenv,
                             hpatch_StreamPos_t& fixedLen,const unsigned char* appendData,const unsigned char* appendData_end){
        while (appendData!=appendData_end) {
            unsigned char v;
            size_t sLen0=0;
            do {
                v=*appendData++;
                if (0==v)
                    ++sLen0;
                else
                    break;
            }while (appendData!=appendData_end);
            if (sLen0>0){
                if (lastType==lastType_v){
                    fixedLen += _out_uncompressData_codeSize(curLenv);
                    curLenv = 0;
                }
                curLen0+=sLen0;
                lastType=lastType_same;
                if (v==0)
                    break;//appendData==appendData_end
            }
            if (lastType==lastType_same){
                fixedLen += _out_0Data_codeSize(curLen0);
                curLen0 = 0;
            }
            ++curLenv;
            lastType=lastType_v;
        }
    }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rcx, 0x18(%rsp)
movq %rdx, 0x8(%rsp)
movq %rsi, (%rsp)
cmpq %r9, %r8
je 0x1b0cf
movq %r9, %r13
movq %r8, %r15
movq %rdi, 0x10(%rsp)
movq %r9, 0x20(%rsp)
movq %r13, %rax
subq %r15, %rax
xorl %r14d, %r14d
movb (%r15), %bpl
incq %r15
testb %bpl, %bpl
jne 0x1afa0
incq %r14
cmpq %r13, %r15
jne 0x1af87
movq %r13, %r15
movq %rax, %r14
movl (%rdi), %eax
testq %r14, %r14
je 0x1b0a6
cmpl $0x1, %eax
jne 0x1b028
movq 0x8(%rsp), %rax
movq (%rax), %r12
xorl %r13d, %r13d
testq $-0x80000000, %r12      # imm = 0x80000000
je 0x1aff8
movl $0x7fffffff, %edi       # imm = 0x7FFFFFFF
xorl %esi, %esi
callq 0x43313
movl %eax, %ebx
addq %r13, %rbx
xorl %edi, %edi
xorl %esi, %esi
callq 0x43313
movl %eax, %r13d
movl $0x7fffffff, %eax       # imm = 0x7FFFFFFF
addq %rax, %r13
addq %rbx, %r13
addq $-0x7fffffff, %r12      # imm = 0x80000001
cmpq %rax, %r12
ja 0x1afc4
movq %r12, %rdi
xorl %esi, %esi
callq 0x43313
movl %eax, %eax
addq %r12, %rax
addq %r13, %rax
movq 0x18(%rsp), %rcx
addq %rax, (%rcx)
movq 0x8(%rsp), %rax
movq $0x0, (%rax)
movq 0x20(%rsp), %r13
movq 0x10(%rsp), %rdi
movq (%rsp), %rax
addq (%rax), %r14
movq %r14, (%rax)
movl $0x0, (%rdi)
testb %bpl, %bpl
je 0x1b0cf
movq %r14, %rax
xorl %r12d, %r12d
shrq $0x1f, %rax
je 0x1b07d
movl $0x7fffffff, %edi       # imm = 0x7FFFFFFF
xorl %esi, %esi
callq 0x43313
movl %eax, %ebx
addq %r12, %rbx
xorl %edi, %edi
xorl %esi, %esi
callq 0x43313
movl %eax, %r12d
addq %rbx, %r12
addq $-0x7fffffff, %r14      # imm = 0x80000001
cmpq $0x7fffffff, %r14       # imm = 0x7FFFFFFF
ja 0x1b04d
movq %r14, %rdi
xorl %esi, %esi
callq 0x43313
movl %eax, %eax
addq %r12, %rax
movq 0x18(%rsp), %rcx
addq %rax, (%rcx)
movq (%rsp), %rax
movq $0x0, (%rax)
movq 0x10(%rsp), %rdi
jmp 0x1b0aa
testl %eax, %eax
je 0x1b0c3
movq 0x8(%rsp), %rax
incq (%rax)
movl $0x1, (%rdi)
cmpq %r13, %r15
jne 0x1af7e
jmp 0x1b0cf
movq (%rsp), %rax
movq (%rax), %r14
jmp 0x1b041
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq