// File: sisong[P]ApkDiffPatch/HDiffPatch/libHDiffPatch/HPatch/patch.c
// Function: rle0_decoder_add
static hpatch_BOOL _rle0_decoder_add(rle0_decoder_t* self,TByte* out_data,hpatch_size_t decodeSize){
    if (self->len0){
    _0_process:
        if (self->len0>=decodeSize){
            self->len0-=decodeSize;
            return hpatch_TRUE;
        }else{
            decodeSize-=self->len0;
            out_data+=self->len0;
            self->len0=0;
            goto _decode_v_process;
        }
    }
    
    if (self->lenv){
    _v_process:
        if (self->lenv>=decodeSize){
            addData(out_data,self->code,decodeSize);
            self->code+=decodeSize;
            self->lenv-=decodeSize;
            return hpatch_TRUE;
        }else{
            addData(out_data,self->code,self->lenv);
            out_data+=self->lenv;
            decodeSize-=self->lenv;
            self->code+=self->lenv;
            self->lenv=0;
            goto _decode_0_process;
        }
    }
    
    assert(decodeSize>0);
    if (self->isNeedDecode0){
        hpatch_StreamPos_t len0;
    _decode_0_process:
        self->isNeedDecode0=hpatch_FALSE;
        if (!hpatch_unpackUInt(&self->code,self->code_end,&len0)) return _hpatch_FALSE;
        if (len0!=(hpatch_size_t)len0) return _hpatch_FALSE;
        self->len0=(hpatch_size_t)len0;
        goto _0_process;
    }else{
        hpatch_StreamPos_t lenv;
    _decode_v_process:
        self->isNeedDecode0=hpatch_TRUE;
        if (!hpatch_unpackUInt(&self->code,self->code_end,&lenv)) return _hpatch_FALSE;
        if (lenv>(size_t)(self->code_end-self->code)) return _hpatch_FALSE;
        self->lenv=(hpatch_size_t)lenv;
        goto _v_process;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x10(%rax)
je 0x8cd62
jmp 0x8cd01
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
cmpq -0x20(%rbp), %rax
jb 0x8cd2e
movq -0x20(%rbp), %rdx
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rcx
subq %rdx, %rcx
movq %rcx, 0x10(%rax)
movl $0x1, -0x4(%rbp)
jmp 0x8cf0f
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rcx
movq -0x20(%rbp), %rax
subq %rcx, %rax
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
addq -0x18(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq $0x0, 0x10(%rax)
jmp 0x8ceaa
movq -0x10(%rbp), %rax
cmpq $0x0, 0x18(%rax)
je 0x8ce1d
jmp 0x8cd73
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
cmpq -0x20(%rbp), %rax
jb 0x8cdc2
movq -0x18(%rbp), %rdi
movq -0x10(%rbp), %rax
movq (%rax), %rsi
movq -0x20(%rbp), %rdx
callq 0x86620
movq -0x20(%rbp), %rcx
movq -0x10(%rbp), %rax
addq (%rax), %rcx
movq %rcx, (%rax)
movq -0x20(%rbp), %rdx
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rcx
subq %rdx, %rcx
movq %rcx, 0x18(%rax)
movl $0x1, -0x4(%rbp)
jmp 0x8cf0f
movq -0x18(%rbp), %rdi
movq -0x10(%rbp), %rax
movq (%rax), %rsi
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdx
callq 0x86620
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
addq -0x18(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rcx
movq -0x20(%rbp), %rax
subq %rcx, %rax
movq %rax, -0x20(%rbp)
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rcx
movq -0x10(%rbp), %rax
addq (%rax), %rcx
movq %rcx, (%rax)
movq -0x10(%rbp), %rax
movq $0x0, 0x18(%rax)
jmp 0x8ce51
cmpq $0x0, -0x20(%rbp)
jbe 0x8ce26
jmp 0x8ce45
leaq 0x28a8b(%rip), %rdi     # 0xb58b8
leaq 0x27ba6(%rip), %rsi     # 0xb49da
movl $0x861, %edx            # imm = 0x861
leaq 0x28a85(%rip), %rcx     # 0xb58c5
callq 0x4270
movq -0x10(%rbp), %rax
cmpl $0x0, 0x20(%rax)
je 0x8cea8
jmp 0x8ce51
movq -0x10(%rbp), %rax
movl $0x0, 0x20(%rax)
movq -0x10(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rsi
leaq -0x28(%rbp), %rdx
xorl %ecx, %ecx
callq 0x85a10
cmpl $0x0, %eax
jne 0x8ce84
movl $0x0, -0x4(%rbp)
jmp 0x8cf0f
movq -0x28(%rbp), %rax
cmpq -0x28(%rbp), %rax
je 0x8ce97
movl $0x0, -0x4(%rbp)
jmp 0x8cf0f
movq -0x28(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x10(%rax)
jmp 0x8cd01
jmp 0x8ceaa
movq -0x10(%rbp), %rax
movl $0x1, 0x20(%rax)
movq -0x10(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rsi
leaq -0x30(%rbp), %rdx
xorl %ecx, %ecx
callq 0x85a10
cmpl $0x0, %eax
jne 0x8ceda
movl $0x0, -0x4(%rbp)
jmp 0x8cf0f
movq -0x30(%rbp), %rax
movq -0x10(%rbp), %rcx
movq 0x8(%rcx), %rcx
movq -0x10(%rbp), %rdx
movq (%rdx), %rdx
subq %rdx, %rcx
cmpq %rcx, %rax
jbe 0x8cefe
movl $0x0, -0x4(%rbp)
jmp 0x8cf0f
movq -0x30(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x18(%rax)
jmp 0x8cd73
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax,%rax)