	.file	"extr_sdcard.c_platform_sdcard_write_blocks.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.globl	platform_sdcard_write_blocks
	.type	platform_sdcard_write_blocks, @function
platform_sdcard_write_blocks:
.LFB0:
	.cfi_startproc
	endbr64
	push	r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	mov	r12, rdx
	push	rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	mov	ebp, esi
	push	rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	mov	rbx, rcx
	call	CHECK_SSPIN@PLT
	mov	edi, DWORD PTR ACMD23[rip]
	mov	rsi, r12
	call	sdcard_acmd@PLT
	test	rax, rax
	jne	.L21
	mov	rax, QWORD PTR SD_CARD_TYPE_SDHC[rip]
	cmp	QWORD PTR m_type[rip], rax
	je	.L4
	sal	ebp, 9
.L4:
	mov	edi, DWORD PTR CMD25[rip]
	mov	esi, ebp
	call	sdcard_command@PLT
	test	rax, rax
	je	.L5
	mov	eax, DWORD PTR SD_CARD_ERROR_CMD25[rip]
	mov	DWORD PTR m_error[rip], eax
.L3:
	xor	eax, eax
	call	sdcard_chipselect_high@PLT
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	mov	eax, DWORD PTR FALSE[rip]
	pop	rbp
	.cfi_def_cfa_offset 16
	pop	r12
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L5:
	.cfi_restore_state
	xor	eax, eax
	call	sdcard_chipselect_high@PLT
	test	r12, r12
	je	.L6
	xor	ebp, ebp
	jmp	.L8
	.p2align 4,,10
	.p2align 3
.L22:
	mov	edi, DWORD PTR WRITE_MULTIPLE_TOKEN[rip]
	mov	rsi, rbx
	call	sdcard_write_data@PLT
	test	eax, eax
	je	.L7
	xor	eax, eax
	add	rbp, 1
	add	rbx, 2048
	call	sdcard_chipselect_high@PLT
	cmp	r12, rbp
	je	.L6
.L8:
	xor	eax, eax
	call	sdcard_chipselect_low@PLT
	mov	edi, 100000
	call	sdcard_wait_not_busy@PLT
	test	eax, eax
	jne	.L22
.L7:
	mov	eax, DWORD PTR SD_CARD_ERROR_WRITE_MULTIPLE[rip]
	mov	DWORD PTR m_error[rip], eax
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L21:
	mov	eax, DWORD PTR SD_CARD_ERROR_ACMD23[rip]
	mov	DWORD PTR m_error[rip], eax
	jmp	.L3
	.p2align 4,,10
	.p2align 3
.L6:
	pop	rbx
	.cfi_def_cfa_offset 24
	xor	eax, eax
	pop	rbp
	.cfi_def_cfa_offset 16
	pop	r12
	.cfi_def_cfa_offset 8
	jmp	sdcard_write_stop@PLT
	.cfi_endproc
.LFE0:
	.size	platform_sdcard_write_blocks, .-platform_sdcard_write_blocks
	.comm	m_type,8,8
	.comm	m_error,4,4
	.comm	WRITE_MULTIPLE_TOKEN,4,4
	.comm	SD_CARD_TYPE_SDHC,8,8
	.comm	SD_CARD_ERROR_WRITE_MULTIPLE,4,4
	.comm	SD_CARD_ERROR_CMD25,4,4
	.comm	SD_CARD_ERROR_ACMD23,4,4
	.comm	FALSE,4,4
	.comm	CMD25,4,4
	.comm	ACMD23,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_sdcard.c_platform_sdcard_write_blocks.c"
	.text
	.align	2
	.global	platform_sdcard_write_blocks
	.syntax unified
	.arm
	.fpu softvfp
	.type	platform_sdcard_write_blocks, %function
platform_sdcard_write_blocks:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, lr}
	mov	r6, r2
	mov	r4, r1
	mov	r5, r3
	bl	CHECK_SSPIN
	ldr	r3, .L23
	mov	r1, r6
	ldr	r0, [r3]
	bl	sdcard_acmd
	cmp	r0, #0
	bne	.L21
	ldr	r2, .L23+4
	ldr	r3, .L23+8
	ldr	r2, [r2]
	ldr	r3, [r3]
	cmp	r2, r3
	ldr	r3, .L23+12
	lslne	r4, r4, #9
	mov	r1, r4
	ldr	r0, [r3]
	bl	sdcard_command
	subs	r4, r0, #0
	beq	.L5
	ldr	r2, .L23+16
	ldr	r3, .L23+20
	ldr	r2, [r2]
	str	r2, [r3]
.L3:
	bl	sdcard_chipselect_high
	ldr	r3, .L23+24
	ldr	r0, [r3]
	pop	{r4, r5, r6, r7, r8, pc}
.L5:
	bl	sdcard_chipselect_high
	cmp	r6, #0
	beq	.L6
	ldr	r7, .L23+28
	ldr	r8, .L23+32
	b	.L8
.L22:
	mov	r1, r5
	ldr	r0, [r8]
	bl	sdcard_write_data
	cmp	r0, #0
	beq	.L7
	bl	sdcard_chipselect_high
	cmp	r6, r4
	add	r5, r5, #2048
	beq	.L6
.L8:
	bl	sdcard_chipselect_low
	mov	r0, r7
	bl	sdcard_wait_not_busy
	cmp	r0, #0
	add	r4, r4, #1
	bne	.L22
.L7:
	ldr	r2, .L23+36
	ldr	r3, .L23+20
	ldr	r2, [r2]
	str	r2, [r3]
	b	.L3
.L21:
	ldr	r2, .L23+40
	ldr	r3, .L23+20
	ldr	r2, [r2]
	str	r2, [r3]
	b	.L3
.L6:
	pop	{r4, r5, r6, r7, r8, lr}
	b	sdcard_write_stop
.L24:
	.align	2
.L23:
	.word	ACMD23
	.word	m_type
	.word	SD_CARD_TYPE_SDHC
	.word	CMD25
	.word	SD_CARD_ERROR_CMD25
	.word	m_error
	.word	FALSE
	.word	100000
	.word	WRITE_MULTIPLE_TOKEN
	.word	SD_CARD_ERROR_WRITE_MULTIPLE
	.word	SD_CARD_ERROR_ACMD23
	.size	platform_sdcard_write_blocks, .-platform_sdcard_write_blocks
	.comm	m_type,4,4
	.comm	m_error,4,4
	.comm	WRITE_MULTIPLE_TOKEN,4,4
	.comm	SD_CARD_TYPE_SDHC,4,4
	.comm	SD_CARD_ERROR_WRITE_MULTIPLE,4,4
	.comm	SD_CARD_ERROR_CMD25,4,4
	.comm	SD_CARD_ERROR_ACMD23,4,4
	.comm	FALSE,4,4
	.comm	CMD25,4,4
	.comm	ACMD23,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
