	.file	"extr_hwdisk.c_DiskRead.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	DiskRead, @function
DiskRead:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	mov	r12, rsi
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	mov	ebp, edx
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	sub	rsp, 40
	.cfi_def_cfa_offset 96
	mov	QWORD PTR 16[rsp], rcx
	call	FsGetDeviceSpecific@PLT
	xor	edi, edi
	mov	r14, rax
	mov	eax, DWORD PTR DiskReadBufferSize[rip]
	test	eax, eax
	setg	dil
	call	ASSERT@PLT
	mov	ecx, DWORD PTR [r14]
	mov	r13, QWORD PTR 16[r14]
	xor	edi, edi
	add	r13, QWORD PTR 8[r14]
	lea	eax, -1[rcx+rbp]
	cdq
	idiv	ecx
	mov	ebx, eax
	mov	eax, DWORD PTR DiskReadBufferSize[rip]
	cdq
	idiv	ecx
	test	eax, eax
	mov	DWORD PTR 12[rsp], eax
	setg	dil
	call	ASSERT@PLT
	mov	QWORD PTR 24[rsp], r12
	test	ebx, ebx
	jne	.L4
	jmp	.L2
	.p2align 4,,10
	.p2align 3
.L14:
	mov	edx, DWORD PTR [r14]
	mov	esi, DWORD PTR DiskReadBuffer[rip]
	mov	rdi, r12
	imul	edx, r15d
	cmp	edx, ebp
	cmovg	edx, ebp
	mov	DWORD PTR 8[rsp], edx
	call	RtlCopyMemory@PLT
	movsx	rax, DWORD PTR 8[rsp]
	lea	r12, [r12+rax*4]
	sub	ebp, eax
	movsx	rax, r15d
	add	r13, rax
	sub	ebx, r15d
	je	.L13
.L4:
	mov	eax, DWORD PTR 12[rsp]
	mov	edi, DWORD PTR 24[r14]
	mov	rsi, r13
	mov	ecx, DWORD PTR DiskReadBuffer[rip]
	cmp	eax, ebx
	mov	r15d, eax
	cmovg	r15d, ebx
	mov	edx, r15d
	call	MachDiskReadLogicalSectors@PLT
	test	eax, eax
	jne	.L14
	mov	rax, QWORD PTR 16[rsp]
	sub	r12, QWORD PTR 24[rsp]
	sub	r13, QWORD PTR 8[r14]
	mov	DWORD PTR [rax], r12d
	mov	QWORD PTR 16[r14], r13
.L8:
	mov	eax, DWORD PTR EIO[rip]
	add	rsp, 40
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	pop	rbx
	.cfi_def_cfa_offset 48
	pop	rbp
	.cfi_def_cfa_offset 40
	pop	r12
	.cfi_def_cfa_offset 32
	pop	r13
	.cfi_def_cfa_offset 24
	pop	r14
	.cfi_def_cfa_offset 16
	pop	r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L13:
	.cfi_restore_state
	mov	rax, QWORD PTR 16[rsp]
	sub	r12, QWORD PTR 24[rsp]
	sub	r13, QWORD PTR 8[r14]
	mov	DWORD PTR [rax], r12d
	mov	QWORD PTR 16[r14], r13
.L6:
	mov	eax, DWORD PTR ESUCCESS[rip]
	add	rsp, 40
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	pop	rbx
	.cfi_def_cfa_offset 48
	pop	rbp
	.cfi_def_cfa_offset 40
	pop	r12
	.cfi_def_cfa_offset 32
	pop	r13
	.cfi_def_cfa_offset 24
	pop	r14
	.cfi_def_cfa_offset 16
	pop	r15
	.cfi_def_cfa_offset 8
	ret
.L2:
	.cfi_restore_state
	mov	eax, DWORD PTR TRUE[rip]
	mov	rcx, QWORD PTR 16[rsp]
	sub	r13, QWORD PTR 8[r14]
	mov	DWORD PTR [rcx], 0
	mov	QWORD PTR 16[r14], r13
	test	eax, eax
	jne	.L6
	jmp	.L8
	.cfi_endproc
.LFE0:
	.size	DiskRead, .-DiskRead
	.comm	TRUE,4,4
	.comm	ESUCCESS,4,4
	.comm	EIO,4,4
	.comm	DiskReadBufferSize,4,4
	.comm	DiskReadBuffer,4,4
	.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_hwdisk.c_DiskRead.c"
	.text
	.global	__aeabi_idiv
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	DiskRead, %function
DiskRead:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	sub	sp, sp, #20
	mov	r6, r2
	str	r3, [sp, #8]
	mov	r7, r1
	bl	FsGetDeviceSpecific
	mov	r9, r0
	ldr	r8, .L15
	str	r7, [sp, #12]
	ldr	r0, [r8]
	cmp	r0, #0
	movle	r0, #0
	movgt	r0, #1
	bl	ASSERT
	ldr	r4, [r9]
	add	r0, r4, r6
	mov	r1, r4
	sub	r0, r0, #1
	bl	__aeabi_idiv
	mov	r1, r4
	mov	r5, r0
	ldr	r0, [r8]
	bl	__aeabi_idiv
	ldr	r8, [r9, #4]
	cmp	r0, #0
	ldr	r3, [r9, #8]
	mov	r10, r0
	movle	r0, #0
	movgt	r0, #1
	add	r8, r8, r3
	bl	ASSERT
	cmp	r5, #0
	beq	.L2
	ldr	fp, .L15+4
	b	.L4
.L14:
	ldr	r2, [r9]
	mov	r0, r7
	mul	r2, r4, r2
	cmp	r2, r6
	movge	r2, r6
	ldr	r1, [fp]
	str	r2, [sp, #4]
	bl	RtlCopyMemory
	ldr	r2, [sp, #4]
	subs	r5, r5, r4
	add	r8, r8, r4
	sub	r6, r6, r2
	add	r7, r7, r2, lsl #2
	beq	.L13
.L4:
	cmp	r10, r5
	movlt	r4, r10
	movge	r4, r5
	mov	r1, r8
	mov	r2, r4
	ldr	r3, [fp]
	ldr	r0, [r9, #12]
	bl	MachDiskReadLogicalSectors
	cmp	r0, #0
	bne	.L14
	ldr	r3, [r9, #4]
	ldr	r2, [sp, #12]
	sub	r8, r8, r3
	ldr	r3, [sp, #8]
	sub	r7, r7, r2
	str	r7, [r3]
	str	r8, [r9, #8]
.L8:
	ldr	r3, .L15+8
	ldr	r0, [r3]
	add	sp, sp, #20
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L13:
	ldr	r3, [r9, #4]
	ldr	r2, [sp, #12]
	sub	r8, r8, r3
	ldr	r3, [sp, #8]
	sub	r7, r7, r2
	str	r7, [r3]
	str	r8, [r9, #8]
.L6:
	ldr	r3, .L15+12
	ldr	r0, [r3]
	add	sp, sp, #20
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L2:
	ldr	r1, .L15+16
	ldr	r2, [r9, #4]
	ldr	r1, [r1]
	sub	r8, r8, r2
	ldr	r2, [sp, #8]
	cmp	r1, #0
	str	r5, [r2]
	str	r8, [r9, #8]
	bne	.L6
	b	.L8
.L16:
	.align	2
.L15:
	.word	DiskReadBufferSize
	.word	DiskReadBuffer
	.word	EIO
	.word	ESUCCESS
	.word	TRUE
	.size	DiskRead, .-DiskRead
	.comm	TRUE,4,4
	.comm	ESUCCESS,4,4
	.comm	EIO,4,4
	.comm	DiskReadBufferSize,4,4
	.comm	DiskReadBuffer,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
