	.file	"extr_chm_lib.c__chm_fetch_bytes.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	_chm_fetch_bytes, @function
_chm_fetch_bytes:
.LFB0:
	.cfi_startproc
	endbr64
	push	r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	push	r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	push	r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	xor	r12d, r12d
	push	rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	push	rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	sub	rsp, 32
	.cfi_def_cfa_offset 80
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 24[rsp], rax
	xor	eax, eax
	mov	rax, QWORD PTR CHM_NULL_FD[rip]
	cmp	QWORD PTR [rdi], rax
	je	.L1
	mov	rbx, rdi
	mov	edi, DWORD PTR 8[rdi]
	mov	r14, rsi
	mov	rbp, rdx
	mov	r13, rcx
	call	CHM_ACQUIRE_LOCK@PLT
	mov	ecx, DWORD PTR FILE_CURRENT[rip]
	mov	rdi, QWORD PTR [rbx]
	xor	esi, esi
	mov	QWORD PTR 16[rsp], 0
	lea	rdx, 8[rsp]
	call	SetFilePointerEx@PLT
	mov	ecx, DWORD PTR FILE_BEGIN[rip]
	mov	rdi, QWORD PTR [rbx]
	xor	edx, edx
	mov	rsi, rbp
	call	SetFilePointerEx@PLT
	mov	rdi, QWORD PTR [rbx]
	xor	r8d, r8d
	lea	rcx, 16[rsp]
	mov	rdx, r13
	mov	rsi, r14
	call	ReadFile@PLT
	mov	rdi, QWORD PTR [rbx]
	mov	ecx, DWORD PTR FILE_BEGIN[rip]
	mov	rsi, QWORD PTR 8[rsp]
	test	rax, rax
	mov	r12, rax
	cmovne	r12, QWORD PTR 16[rsp]
	xor	edx, edx
	call	SetFilePointerEx@PLT
	mov	edi, DWORD PTR 8[rbx]
	call	CHM_RELEASE_LOCK@PLT
.L1:
	mov	rax, QWORD PTR 24[rsp]
	xor	rax, QWORD PTR fs:40
	jne	.L11
	add	rsp, 32
	.cfi_remember_state
	.cfi_def_cfa_offset 48
	mov	rax, r12
	pop	rbx
	.cfi_def_cfa_offset 40
	pop	rbp
	.cfi_def_cfa_offset 32
	pop	r12
	.cfi_def_cfa_offset 24
	pop	r13
	.cfi_def_cfa_offset 16
	pop	r14
	.cfi_def_cfa_offset 8
	ret
.L11:
	.cfi_restore_state
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	_chm_fetch_bytes, .-_chm_fetch_bytes
	.comm	FILE_CURRENT,4,4
	.comm	FILE_BEGIN,4,4
	.comm	CHM_NULL_FD,8,8
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	 1f - 0f
	.long	 4f - 1f
	.long	 5
0:
	.string	 "GNU"
1:
	.align 8
	.long	 0xc0000002
	.long	 3f - 2f
2:
	.long	 0x3
3:
	.align 8
4:

	.arch armv5t
	.eabi_attribute 20, 1
	.eabi_attribute 21, 1
	.eabi_attribute 23, 3
	.eabi_attribute 24, 1
	.eabi_attribute 25, 1
	.eabi_attribute 26, 2
	.eabi_attribute 30, 2
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"extr_chm_lib.c__chm_fetch_bytes.c"
	.text
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	_chm_fetch_bytes, %function
_chm_fetch_bytes:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, lr}
	mov	r4, r0
	ldr	r0, .L12
	ldr	ip, [r4]
	ldr	r0, [r0]
	mov	r6, r3
	ldr	r3, .L12+4
	sub	sp, sp, #28
	cmp	ip, r0
	ldr	r3, [r3]
	str	r3, [sp, #20]
	mov	r3,#0
	moveq	r5, #0
	beq	.L1
	mov	r8, #0
	mov	r7, r2
	mov	r5, r1
	ldr	r0, [r4, #4]
	bl	CHM_ACQUIRE_LOCK
	ldr	r3, .L12+8
	ldr	r9, .L12+12
	mov	r1, r8
	ldr	r3, [r3]
	add	r2, sp, #12
	ldr	r0, [r4]
	str	r8, [sp, #16]
	bl	SetFilePointerEx
	mov	r1, r7
	mov	r2, r8
	ldr	r3, [r9]
	ldr	r0, [r4]
	bl	SetFilePointerEx
	str	r8, [sp]
	mov	r1, r5
	mov	r2, r6
	add	r3, sp, #16
	ldr	r0, [r4]
	bl	ReadFile
	mov	r2, #0
	subs	r5, r0, #0
	ldr	r3, [r9]
	ldr	r1, [sp, #12]
	ldr	r0, [r4]
	ldrne	r5, [sp, #16]
	bl	SetFilePointerEx
	ldr	r0, [r4, #4]
	bl	CHM_RELEASE_LOCK
.L1:
	ldr	r3, .L12+4
	ldr	r2, [r3]
	ldr	r3, [sp, #20]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L11
	mov	r0, r5
	add	sp, sp, #28
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, pc}
.L11:
	bl	__stack_chk_fail
.L13:
	.align	2
.L12:
	.word	CHM_NULL_FD
	.word	.LC0
	.word	FILE_CURRENT
	.word	FILE_BEGIN
	.size	_chm_fetch_bytes, .-_chm_fetch_bytes
	.comm	FILE_CURRENT,4,4
	.comm	FILE_BEGIN,4,4
	.comm	CHM_NULL_FD,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
