	.file	"extr_ff.c_f_read.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.globl	f_read
	.type	f_read, @function
f_read:
.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
	mov	r14, rcx
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	mov	r13, rsi
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	mov	r12, rdx
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	mov	rbp, rdi
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	sub	rsp, 56
	.cfi_def_cfa_offset 112
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 40[rsp], rax
	xor	eax, eax
	mov	QWORD PTR [rcx], 0
	lea	rax, 32[rdi]
	lea	rsi, 32[rsp]
	mov	rdi, rax
	mov	QWORD PTR 16[rsp], rax
	call	validate@PLT
	cmp	QWORD PTR FR_OK[rip], rax
	mov	rsi, rax
	jne	.L2
	mov	rax, QWORD PTR 56[rbp]
	cmp	rsi, rax
	je	.L3
	mov	rsi, rax
.L2:
	mov	rdi, QWORD PTR 32[rsp]
	call	LEAVE_FF@PLT
.L3:
	mov	rdi, QWORD PTR 32[rsp]
	mov	eax, DWORD PTR 0[rbp]
	test	DWORD PTR FA_READ[rip], eax
	je	.L40
.L4:
	mov	r15, QWORD PTR 8[rbp]
	mov	rdx, QWORD PTR 32[rbp]
	sub	rdx, r15
	cmp	rdx, r12
	cmovle	r12, rdx
	test	r12, r12
	jne	.L24
	jmp	.L5
	.p2align 4,,10
	.p2align 3
.L41:
	mov	rdi, QWORD PTR 32[rsp]
.L7:
	call	SS@PLT
	mov	rdi, QWORD PTR 32[rsp]
	mov	r15, QWORD PTR 8[rbp]
	movsx	rbx, eax
	call	SS@PLT
	mov	rdi, QWORD PTR 32[rsp]
	movsx	rcx, eax
	mov	rax, r15
	mov	r15, QWORD PTR 24[rbp]
	cqo
	idiv	rcx
	mov	rax, QWORD PTR 8[rbp]
	mov	QWORD PTR 8[rsp], rax
	sub	rbx, rdx
	cmp	rbx, r12
	cmovg	rbx, r12
	call	SS@PLT
	mov	rdi, r13
	movsx	rcx, eax
	mov	rax, QWORD PTR 8[rsp]
	cqo
	idiv	rcx
	lea	rsi, [r15+rdx*4]
	mov	rdx, rbx
	call	mem_cpy@PLT
.L19:
	add	QWORD PTR [r14], rbx
	mov	r15, QWORD PTR 8[rbp]
	lea	r13, 0[r13+rbx*4]
	mov	rdi, QWORD PTR 32[rsp]
	add	r15, rbx
	mov	QWORD PTR 8[rbp], r15
	sub	r12, rbx
	je	.L5
.L24:
	call	SS@PLT
	movsx	rcx, eax
	mov	rax, r15
	cqo
	idiv	rcx
	test	rdx, rdx
	jne	.L41
	mov	rdi, QWORD PTR 32[rsp]
	mov	r15, QWORD PTR 8[rbp]
	call	SS@PLT
	mov	rdi, QWORD PTR 32[rsp]
	movsx	rcx, eax
	mov	rax, r15
	cqo
	mov	esi, DWORD PTR [rdi]
	idiv	rcx
	lea	ebx, -1[rsi]
	movsx	rbx, ebx
	and	rbx, rax
	je	.L8
	mov	r15d, DWORD PTR 16[rbp]
	mov	esi, r15d
	call	clst2sect@PLT
	mov	r15d, eax
	test	eax, eax
	je	.L42
.L14:
	mov	rdi, QWORD PTR 32[rsp]
	add	r15d, ebx
	call	SS@PLT
	movsx	rcx, eax
	mov	rax, r12
	cqo
	idiv	rcx
	mov	r8, rax
	test	rax, rax
	jg	.L43
	mov	edx, DWORD PTR 20[rbp]
	mov	rdi, QWORD PTR 32[rsp]
	cmp	edx, r15d
	je	.L20
	mov	rsi, QWORD PTR 24[rbp]
	mov	edi, DWORD PTR 16[rdi]
	mov	eax, DWORD PTR 0[rbp]
	test	DWORD PTR FA_DIRTY[rip], eax
	jne	.L44
.L21:
	mov	ecx, 1
	mov	edx, r15d
	call	disk_read@PLT
	cmp	rax, QWORD PTR RES_OK[rip]
	je	.L38
	mov	esi, DWORD PTR FR_DISK_ERR[rip]
	mov	rdi, QWORD PTR 32[rsp]
	call	ABORT@PLT
.L38:
	mov	rdi, QWORD PTR 32[rsp]
.L20:
	mov	DWORD PTR 20[rbp], r15d
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L8:
	cmp	QWORD PTR 8[rbp], 0
	jne	.L10
	mov	r15d, DWORD PTR 40[rbp]
	cmp	r15d, 1
	jle	.L45
.L12:
	mov	DWORD PTR 16[rbp], r15d
	mov	esi, r15d
	call	clst2sect@PLT
	mov	r15d, eax
	test	eax, eax
	jne	.L14
.L42:
	mov	esi, DWORD PTR FR_INT_ERR[rip]
	mov	rdi, QWORD PTR 32[rsp]
	call	ABORT@PLT
	jmp	.L14
	.p2align 4,,10
	.p2align 3
.L43:
	mov	rax, QWORD PTR 32[rsp]
	lea	rsi, [rbx+r8]
	movsx	rdx, DWORD PTR [rax]
	mov	edi, DWORD PTR 16[rax]
	mov	rcx, rdx
	sub	rcx, rbx
	cmp	rsi, rdx
	mov	edx, r15d
	mov	rsi, r13
	cmovg	r8, rcx
	mov	ecx, r8d
	mov	QWORD PTR 8[rsp], r8
	call	disk_read@PLT
	cmp	rax, QWORD PTR RES_OK[rip]
	mov	r8, QWORD PTR 8[rsp]
	je	.L17
	mov	esi, DWORD PTR FR_DISK_ERR[rip]
	mov	rdi, QWORD PTR 32[rsp]
	call	ABORT@PLT
	mov	r8, QWORD PTR 8[rsp]
.L17:
	mov	rdi, QWORD PTR 32[rsp]
	mov	eax, DWORD PTR 0[rbp]
	test	DWORD PTR FA_DIRTY[rip], eax
	je	.L18
	mov	eax, DWORD PTR 20[rbp]
	sub	eax, r15d
	cdqe
	cmp	rax, r8
	jl	.L46
.L18:
	mov	QWORD PTR 8[rsp], r8
	call	SS@PLT
	mov	r8, QWORD PTR 8[rsp]
	movsx	rbx, eax
	imul	rbx, r8
	jmp	.L19
	.p2align 4,,10
	.p2align 3
.L5:
	mov	rsi, QWORD PTR FR_OK[rip]
	call	LEAVE_FF@PLT
	mov	rax, QWORD PTR 40[rsp]
	xor	rax, QWORD PTR fs:40
	jne	.L47
	add	rsp, 56
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	xor	eax, eax
	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
.L10:
	.cfi_restore_state
	mov	rdi, QWORD PTR 16[rsp]
	mov	esi, DWORD PTR 16[rbp]
	call	get_fat@PLT
	mov	rdi, QWORD PTR 32[rsp]
	mov	r15d, eax
	cmp	r15d, 1
	jg	.L12
.L45:
	mov	esi, DWORD PTR FR_INT_ERR[rip]
	call	ABORT@PLT
	cmp	r15d, -1
	jne	.L37
	mov	esi, DWORD PTR FR_DISK_ERR[rip]
	mov	rdi, QWORD PTR 32[rsp]
	call	ABORT@PLT
.L37:
	mov	rdi, QWORD PTR 32[rsp]
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L44:
	mov	ecx, 1
	call	disk_write@PLT
	cmp	rax, QWORD PTR RES_OK[rip]
	jne	.L48
.L22:
	mov	eax, DWORD PTR FA_DIRTY[rip]
	mov	rsi, QWORD PTR 24[rbp]
	not	eax
	and	DWORD PTR 0[rbp], eax
	mov	rax, QWORD PTR 32[rsp]
	mov	edi, DWORD PTR 16[rax]
	jmp	.L21
	.p2align 4,,10
	.p2align 3
.L48:
	mov	esi, DWORD PTR FR_DISK_ERR[rip]
	mov	rdi, QWORD PTR 32[rsp]
	call	ABORT@PLT
	jmp	.L22
	.p2align 4,,10
	.p2align 3
.L40:
	mov	rsi, QWORD PTR FR_DENIED[rip]
	call	LEAVE_FF@PLT
	mov	rdi, QWORD PTR 32[rsp]
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L46:
	mov	QWORD PTR 24[rsp], r8
	call	SS@PLT
	mov	rsi, QWORD PTR 24[rbp]
	mov	rdi, QWORD PTR 32[rsp]
	mov	ebx, eax
	mov	eax, DWORD PTR 20[rbp]
	mov	QWORD PTR 8[rsp], rsi
	sub	eax, r15d
	mov	r15d, eax
	call	SS@PLT
	mov	rsi, QWORD PTR 8[rsp]
	movsx	rdx, ebx
	imul	r15d, eax
	movsx	r15, r15d
	lea	rdi, 0[r13+r15*4]
	call	mem_cpy@PLT
	mov	rdi, QWORD PTR 32[rsp]
	mov	r8, QWORD PTR 24[rsp]
	jmp	.L18
.L47:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	f_read, .-f_read
	.comm	RES_OK,8,8
	.comm	FR_OK,8,8
	.comm	FR_INT_ERR,4,4
	.comm	FR_DISK_ERR,4,4
	.comm	FR_DENIED,8,8
	.comm	FA_READ,4,4
	.comm	FA_DIRTY,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_ff.c_f_read.c"
	.text
	.global	__aeabi_idivmod
	.global	__aeabi_idiv
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	f_read
	.syntax unified
	.arm
	.fpu softvfp
	.type	f_read, %function
f_read:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	mov	r9, r3
	mov	r3, #0
	sub	sp, sp, #20
	mov	r4, r0
	mov	r8, r1
	add	r1, r0, #20
	ldr	r0, .L48
	str	r1, [sp, #4]
	ldr	r0, [r0]
	str	r0, [sp, #12]
	mov	r0,#0
	mov	r0, r1
	str	r3, [r9]
	add	r1, sp, #8
	mov	r5, r2
	bl	validate
	ldr	r3, .L48+4
	mov	r1, r0
	ldr	r3, [r3]
	cmp	r3, r0
	bne	.L2
	ldr	r3, [r4, #32]
	cmp	r0, r3
	beq	.L3
	mov	r1, r3
.L2:
	ldr	r0, [sp, #8]
	bl	LEAVE_FF
.L3:
	ldr	r3, .L48+8
	ldr	r2, [r4]
	ldr	r3, [r3]
	ldr	r0, [sp, #8]
	tst	r2, r3
	beq	.L39
.L4:
	ldr	r6, [r4, #4]
	ldr	r2, [r4, #20]
	sub	r2, r2, r6
	cmp	r2, r5
	movlt	r5, r2
	cmp	r5, #0
	beq	.L5
	ldr	fp, .L48+12
	b	.L24
.L43:
	ldr	r7, [r4, #8]
.L9:
	mov	r0, r10
	mov	r1, r7
	bl	clst2sect
	subs	r10, r0, #0
	beq	.L40
.L14:
	ldr	r0, [sp, #8]
	bl	SS
	mov	r1, r0
	mov	r0, r5
	bl	__aeabi_idiv
	subs	r7, r0, #0
	add	r10, r6, r10
	bgt	.L41
	ldr	r2, [r4, #12]
	ldr	r0, [sp, #8]
	cmp	r2, r10
	beq	.L20
	ldr	r1, [r4]
	ldr	r3, [fp]
	ldr	r0, [r0, #12]
	tst	r1, r3
	ldr	r1, [r4, #16]
	bne	.L42
.L21:
	mov	r3, #1
	mov	r2, r10
	bl	disk_read
	ldr	r3, .L48+16
	ldr	r3, [r3]
	cmp	r0, r3
	beq	.L37
	ldr	r3, .L48+20
	ldr	r0, [sp, #8]
	ldr	r1, [r3]
	bl	ABORT
.L37:
	ldr	r0, [sp, #8]
.L20:
	str	r10, [r4, #12]
.L7:
	bl	SS
	mov	r6, r0
	ldr	r0, [sp, #8]
	ldr	r10, [r4, #4]
	bl	SS
	mov	r1, r0
	mov	r0, r10
	bl	__aeabi_idivmod
	sub	r6, r6, r1
	cmp	r6, r5
	ldr	r0, [sp, #8]
	movge	r6, r5
	ldr	r7, [r4, #4]
	ldr	r10, [r4, #16]
	bl	SS
	mov	r1, r0
	mov	r0, r7
	bl	__aeabi_idivmod
	mov	r2, r6
	mov	r0, r8
	add	r1, r10, r1, lsl #2
	bl	mem_cpy
.L19:
	ldr	r3, [r9]
	subs	r5, r5, r6
	add	r3, r3, r6
	str	r3, [r9]
	ldr	r2, [r4, #4]
	add	r8, r8, r6, lsl #2
	add	r6, r6, r2
	ldr	r0, [sp, #8]
	str	r6, [r4, #4]
	beq	.L5
.L24:
	bl	SS
	mov	r1, r0
	mov	r0, r6
	bl	__aeabi_idivmod
	cmp	r1, #0
	ldr	r0, [sp, #8]
	bne	.L7
	ldr	r7, [r4, #4]
	bl	SS
	mov	r1, r0
	mov	r0, r7
	bl	__aeabi_idiv
	ldr	r10, [sp, #8]
	ldr	r6, [r10]
	sub	r6, r6, #1
	ands	r6, r6, r0
	bne	.L43
	ldr	r3, [r4, #4]
	cmp	r3, #0
	bne	.L10
	ldr	r7, [r4, #24]
	cmp	r7, #1
	ble	.L44
.L12:
	str	r7, [r4, #8]
	b	.L9
.L41:
	ldr	r1, [sp, #8]
	add	r2, r6, r7
	ldr	r0, [r1]
	cmp	r2, r0
	subgt	r7, r0, r6
	mov	r3, r7
	mov	r2, r10
	ldr	r0, [r1, #12]
	mov	r1, r8
	bl	disk_read
	ldr	r3, .L48+16
	ldr	r2, [r3]
	cmp	r0, r2
	beq	.L17
	ldr	r3, .L48+20
	ldr	r0, [sp, #8]
	ldr	r1, [r3]
	bl	ABORT
.L17:
	ldr	r1, [r4]
	ldr	r2, [fp]
	ldr	r0, [sp, #8]
	tst	r1, r2
	beq	.L18
	ldr	r2, [r4, #12]
	sub	r10, r2, r10
	cmp	r10, r7
	blt	.L45
.L18:
	bl	SS
	mul	r6, r7, r0
	b	.L19
.L40:
	ldr	r3, .L48+24
	ldr	r0, [sp, #8]
	ldr	r1, [r3]
	bl	ABORT
	b	.L14
.L5:
	ldr	r3, .L48+4
	ldr	r1, [r3]
	bl	LEAVE_FF
	ldr	r3, .L48
	ldr	r2, [r3]
	ldr	r3, [sp, #12]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L46
	mov	r0, #0
	add	sp, sp, #20
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L10:
	ldr	r1, [r4, #8]
	ldr	r0, [sp, #4]
	bl	get_fat
	mov	r7, r0
	cmp	r7, #1
	ldr	r10, [sp, #8]
	bgt	.L12
.L44:
	ldr	r3, .L48+24
	mov	r0, r10
	ldr	r1, [r3]
	bl	ABORT
	cmn	r7, #1
	bne	.L36
	ldr	r3, .L48+20
	ldr	r0, [sp, #8]
	ldr	r1, [r3]
	bl	ABORT
.L36:
	ldr	r10, [sp, #8]
	b	.L12
.L42:
	mov	r3, #1
	bl	disk_write
	ldr	r3, .L48+16
	ldr	r3, [r3]
	cmp	r0, r3
	bne	.L47
.L22:
	ldr	r1, [fp]
	ldr	r3, [r4]
	ldr	r2, [sp, #8]
	bic	r3, r3, r1
	ldr	r0, [r2, #12]
	ldr	r1, [r4, #16]
	str	r3, [r4]
	b	.L21
.L47:
	ldr	r3, .L48+20
	ldr	r0, [sp, #8]
	ldr	r1, [r3]
	bl	ABORT
	b	.L22
.L39:
	ldr	r3, .L48+28
	ldr	r1, [r3]
	bl	LEAVE_FF
	ldr	r0, [sp, #8]
	b	.L4
.L45:
	bl	SS
	mul	r10, r0, r10
	ldr	r0, [sp, #8]
	ldr	r6, [r4, #16]
	bl	SS
	add	r10, r8, r10, lsl #2
	mov	r2, r0
	mov	r1, r6
	mov	r0, r10
	bl	mem_cpy
	ldr	r0, [sp, #8]
	b	.L18
.L46:
	bl	__stack_chk_fail
.L49:
	.align	2
.L48:
	.word	.LC0
	.word	FR_OK
	.word	FA_READ
	.word	FA_DIRTY
	.word	RES_OK
	.word	FR_DISK_ERR
	.word	FR_INT_ERR
	.word	FR_DENIED
	.size	f_read, .-f_read
	.comm	RES_OK,4,4
	.comm	FR_OK,4,4
	.comm	FR_INT_ERR,4,4
	.comm	FR_DISK_ERR,4,4
	.comm	FR_DENIED,4,4
	.comm	FA_READ,4,4
	.comm	FA_DIRTY,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
