	.file	"extr_msdosfs_fat.c_updatefats.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	updatefats, @function
updatefats:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	mov	r15, rdi
	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
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	sub	rsp, 8
	.cfi_def_cfa_offset 64
	mov	eax, DWORD PTR [rdi]
	test	DWORD PTR MSDOSFS_FATMIRROR[rip], eax
	je	.L2
	mov	rbx, rdx
	cmp	QWORD PTR 8[rdi], rdx
	je	.L3
.L5:
	xor	r14d, r14d
.L4:
	cmp	DWORD PTR 16[r15], 1
	jle	.L2
	mov	r13d, 1
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L20:
	call	bwrite@PLT
	add	r13d, 1
	cmp	DWORD PTR 16[r15], r13d
	jle	.L2
.L10:
	add	rbx, QWORD PTR 24[r15]
	mov	edx, DWORD PTR 8[r12]
	xor	r9d, r9d
	xor	r8d, r8d
	mov	edi, DWORD PTR 32[r15]
	xor	ecx, ecx
	mov	rsi, rbx
	call	getblk@PLT
	mov	edx, DWORD PTR 8[r12]
	mov	rsi, QWORD PTR [r12]
	mov	rdi, QWORD PTR [rax]
	mov	rbp, rax
	call	memcpy@PLT
	cmp	r14d, 16
	je	.L19
	cmp	r14d, 32
	jne	.L7
	mov	rax, QWORD PTR 0[rbp]
	or	DWORD PTR 28[rax], 8
.L7:
	mov	rdi, r15
	call	SYNCHRONOUS_WRITES@PLT
	mov	rdi, rbp
	test	rax, rax
	jne	.L20
	call	bdwrite@PLT
	add	r13d, 1
	cmp	DWORD PTR 16[r15], r13d
	jg	.L10
.L2:
	mov	rdi, r15
	call	SYNCHRONOUS_WRITES@PLT
	mov	rdi, r12
	test	rax, rax
	je	.L11
	add	rsp, 8
	.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
	jmp	bwrite@PLT
	.p2align 4,,10
	.p2align 3
.L11:
	.cfi_restore_state
	add	rsp, 8
	.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
	jmp	bdwrite@PLT
	.p2align 4,,10
	.p2align 3
.L19:
	.cfi_restore_state
	mov	rax, QWORD PTR 0[rbp]
	or	DWORD PTR 12[rax], 128
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L3:
	call	FAT12@PLT
	test	rax, rax
	jne	.L5
	mov	rdi, r15
	call	FAT16@PLT
	cmp	rax, 1
	sbb	r14d, r14d
	and	r14d, 16
	add	r14d, 16
	jmp	.L4
	.cfi_endproc
.LFE0:
	.size	updatefats, .-updatefats
	.comm	MSDOSFS_FATMIRROR,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_msdosfs_fat.c_updatefats.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	updatefats, %function
updatefats:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, lr}
	ldr	r3, .L21
	ldr	ip, [r0]
	ldr	r3, [r3]
	mov	r5, r0
	tst	ip, r3
	mov	r6, r1
	sub	sp, sp, #8
	beq	.L2
	ldr	r3, [r0, #4]
	mov	r7, r2
	cmp	r3, r2
	beq	.L3
.L5:
	mov	r10, #0
.L4:
	ldr	r3, [r5, #8]
	cmp	r3, #1
	ble	.L2
	mov	r8, #1
	mov	r9, #0
	b	.L10
.L20:
	bl	bwrite
	ldr	r3, [r5, #8]
	add	r8, r8, #1
	cmp	r3, r8
	ble	.L2
.L10:
	ldr	r3, [r5, #12]
	str	r9, [sp, #4]
	str	r9, [sp]
	add	r7, r7, r3
	mov	r1, r7
	mov	r3, #0
	ldr	r2, [r6, #4]
	ldr	r0, [r5, #16]
	bl	getblk
	ldr	r2, [r6, #4]
	mov	r4, r0
	ldr	r1, [r6]
	ldr	r0, [r0]
	bl	memcpy
	cmp	r10, #16
	beq	.L19
	cmp	r10, #32
	ldreq	r2, [r4]
	ldreq	r3, [r2, #28]
	orreq	r3, r3, #8
	streq	r3, [r2, #28]
.L7:
	mov	r0, r5
	bl	SYNCHRONOUS_WRITES
	cmp	r0, #0
	mov	r0, r4
	bne	.L20
	bl	bdwrite
	ldr	r3, [r5, #8]
	add	r8, r8, #1
	cmp	r3, r8
	bgt	.L10
.L2:
	mov	r0, r5
	bl	SYNCHRONOUS_WRITES
	cmp	r0, #0
	mov	r0, r6
	beq	.L11
	add	sp, sp, #8
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, lr}
	b	bwrite
.L11:
	add	sp, sp, #8
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, lr}
	b	bdwrite
.L19:
	ldr	r2, [r4]
	ldr	r3, [r2, #12]
	orr	r3, r3, #128
	str	r3, [r2, #12]
	b	.L7
.L3:
	bl	FAT12
	cmp	r0, #0
	bne	.L5
	mov	r0, r5
	bl	FAT16
	cmp	r0, #0
	movne	r10, #16
	moveq	r10, #32
	b	.L4
.L22:
	.align	2
.L21:
	.word	MSDOSFS_FATMIRROR
	.size	updatefats, .-updatefats
	.comm	MSDOSFS_FATMIRROR,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
