// File: sisong[P]ApkDiffPatch/HDiffPatch/file_for_patch.c
// Function: TFileStreamInput_read_file
static hpatch_BOOL _TFileStreamInput_read_file(const hpatch_TStreamInput* stream,hpatch_StreamPos_t readFromPos,
                                                   TByte* out_data,TByte* out_data_end){
        size_t readLen;
        hpatch_TFileStreamInput* self=(hpatch_TFileStreamInput*)stream->streamImport;
        assert(out_data<=out_data_end);
        readLen=(size_t)(out_data_end-out_data);
        if (readLen==0) return hpatch_TRUE;
        if ((readLen>self->base.streamSize)
            ||(readFromPos>self->base.streamSize-readLen)) _ferr_returnv(EFBIG);
        if (self->m_fpos!=readFromPos+self->m_offset){
            if (!_import_fileSeek64To(self->m_file,readFromPos+self->m_offset)) _rw_ferr_return();
        }
        if (!_import_fileRead(self->m_file,out_data,out_data+readLen)) _rw_ferr_return();
        self->m_fpos=readFromPos+self->m_offset+readLen;
        return hpatch_TRUE;
    }

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x38(%rbp)
movq -0x20(%rbp), %rax
cmpq -0x28(%rbp), %rax
ja 0x8dd0f
jmp 0x8dd2e
leaq 0x27ec7(%rip), %rdi     # 0xb5bdd
leaq 0x27bff(%rip), %rsi     # 0xb591c
movl $0x23d, %edx            # imm = 0x23D
leaq 0x27ecb(%rip), %rcx     # 0xb5bf4
callq 0x4270
movq -0x28(%rbp), %rax
movq -0x20(%rbp), %rcx
subq %rcx, %rax
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
jne 0x8dd50
movl $0x1, -0x4(%rbp)
jmp 0x8df60
movq -0x30(%rbp), %rax
movq -0x38(%rbp), %rcx
cmpq 0x8(%rcx), %rax
ja 0x8dd73
movq -0x18(%rbp), %rax
movq -0x38(%rbp), %rcx
movq 0x8(%rcx), %rcx
subq -0x30(%rbp), %rcx
cmpq %rcx, %rax
jbe 0x8dde5
jmp 0x8dd75
jmp 0x8dd77
callq 0x4050
movl $0x1b, (%rax)
jmp 0x8dd84
movq -0x38(%rbp), %rax
cmpl $0x1b, 0x38(%rax)
je 0x8ddd5
movq -0x38(%rbp), %rax
cmpl $0x0, 0x38(%rax)
jne 0x8dda3
movq -0x38(%rbp), %rax
movl $0x1b, 0x38(%rax)
movq 0x58226(%rip), %rax     # 0xe5fd0
movq (%rax), %rax
movq %rax, -0x48(%rbp)
movl $0x1b, %edi
callq 0x4100
movq -0x48(%rbp), %rdi
movq %rax, %rcx
leaq 0x1ef56(%rip), %rsi     # 0xacd1f
movl $0x1b, %edx
movb $0x0, %al
callq 0x4520
jmp 0x8ddd7
jmp 0x8ddd9
movl $0x0, -0x4(%rbp)
jmp 0x8df60
movq -0x38(%rbp), %rax
movq 0x28(%rax), %rax
movq -0x18(%rbp), %rcx
movq -0x38(%rbp), %rdx
addq 0x30(%rdx), %rcx
cmpq %rcx, %rax
je 0x8dea6
movq -0x38(%rbp), %rax
movq 0x20(%rax), %rdi
movq -0x18(%rbp), %rsi
movq -0x38(%rbp), %rax
addq 0x30(%rax), %rsi
callq 0x8efe0
cmpl $0x0, %eax
jne 0x8dea4
movq -0x38(%rbp), %rax
movq $-0x1, 0x28(%rax)
callq 0x4050
movl (%rax), %eax
movl %eax, -0x3c(%rbp)
movq -0x38(%rbp), %rax
movl 0x38(%rax), %eax
cmpl -0x3c(%rbp), %eax
je 0x8de94
cmpl $0x0, -0x3c(%rbp)
je 0x8de94
movq -0x38(%rbp), %rax
cmpl $0x0, 0x38(%rax)
jne 0x8de60
movl -0x3c(%rbp), %ecx
movq -0x38(%rbp), %rax
movl %ecx, 0x38(%rax)
movq 0x58169(%rip), %rax     # 0xe5fd0
movq (%rax), %rax
movq %rax, -0x58(%rbp)
movl -0x3c(%rbp), %eax
movl %eax, -0x4c(%rbp)
movl -0x3c(%rbp), %edi
callq 0x4100
movq -0x58(%rbp), %rdi
movl -0x4c(%rbp), %edx
movq %rax, %rcx
leaq 0x1ee92(%rip), %rsi     # 0xacd1f
movb $0x0, %al
callq 0x4520
jmp 0x8de96
jmp 0x8de98
movl $0x0, -0x4(%rbp)
jmp 0x8df60
jmp 0x8dea6
movq -0x38(%rbp), %rax
movq 0x20(%rax), %rdi
movq -0x20(%rbp), %rsi
movq -0x20(%rbp), %rdx
addq -0x30(%rbp), %rdx
callq 0x8d8f0
cmpl $0x0, %eax
jne 0x8df41
movq -0x38(%rbp), %rax
movq $-0x1, 0x28(%rax)
callq 0x4050
movl (%rax), %eax
movl %eax, -0x40(%rbp)
movq -0x38(%rbp), %rax
movl 0x38(%rax), %eax
cmpl -0x40(%rbp), %eax
je 0x8df34
cmpl $0x0, -0x40(%rbp)
je 0x8df34
movq -0x38(%rbp), %rax
cmpl $0x0, 0x38(%rax)
jne 0x8df00
movl -0x40(%rbp), %ecx
movq -0x38(%rbp), %rax
movl %ecx, 0x38(%rax)
movq 0x580c9(%rip), %rax     # 0xe5fd0
movq (%rax), %rax
movq %rax, -0x68(%rbp)
movl -0x40(%rbp), %eax
movl %eax, -0x5c(%rbp)
movl -0x40(%rbp), %edi
callq 0x4100
movq -0x68(%rbp), %rdi
movl -0x5c(%rbp), %edx
movq %rax, %rcx
leaq 0x1edf2(%rip), %rsi     # 0xacd1f
movb $0x0, %al
callq 0x4520
jmp 0x8df36
jmp 0x8df38
movl $0x0, -0x4(%rbp)
jmp 0x8df60
movq -0x18(%rbp), %rcx
movq -0x38(%rbp), %rax
addq 0x30(%rax), %rcx
addq -0x30(%rbp), %rcx
movq -0x38(%rbp), %rax
movq %rcx, 0x28(%rax)
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x70, %rsp
popq %rbp
retq
nopl (%rax)