	.file	"extr_sdcard.c_sdcard_write_data.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	sdcard_write_data, @function
sdcard_write_data:
.LFB0:
	.cfi_startproc
	endbr64
	push	r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	mov	edx, edi
	mov	edi, DWORD PTR m_spi_no[rip]
	xor	r9d, r9d
	push	0
	.cfi_def_cfa_offset 24
	xor	r8d, r8d
	xor	ecx, ecx
	mov	r12, rsi
	push	0
	.cfi_def_cfa_offset 32
	mov	esi, 8
	call	platform_spi_transaction@PLT
	mov	edi, DWORD PTR m_spi_no[rip]
	mov	rdx, r12
	mov	esi, 512
	call	platform_spi_blkwrite@PLT
	push	0
	.cfi_def_cfa_offset 40
	mov	edi, DWORD PTR m_spi_no[rip]
	xor	r8d, r8d
	push	0
	.cfi_def_cfa_offset 48
	xor	r9d, r9d
	xor	ecx, ecx
	mov	edx, 65535
	mov	esi, 16
	call	platform_spi_transaction@PLT
	mov	edi, DWORD PTR m_spi_no[rip]
	add	rsp, 32
	.cfi_def_cfa_offset 16
	mov	edx, 255
	mov	esi, 8
	call	platform_spi_send_recv@PLT
	mov	r8d, DWORD PTR TRUE[rip]
	mov	DWORD PTR m_status[rip], eax
	and	eax, DWORD PTR DATA_RES_MASK[rip]
	cmp	eax, DWORD PTR DATA_RES_ACCEPTED[rip]
	jne	.L6
	mov	eax, r8d
	pop	r12
	.cfi_remember_state
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L6:
	.cfi_restore_state
	mov	eax, DWORD PTR SD_CARD_ERROR_WRITE[rip]
	mov	DWORD PTR m_error[rip], eax
	xor	eax, eax
	call	sdcard_chipselect_high@PLT
	mov	r8d, DWORD PTR FALSE[rip]
	pop	r12
	.cfi_def_cfa_offset 8
	mov	eax, r8d
	ret
	.cfi_endproc
.LFE0:
	.size	sdcard_write_data, .-sdcard_write_data
	.comm	m_status,4,4
	.comm	m_spi_no,4,4
	.comm	m_error,4,4
	.comm	TRUE,4,4
	.comm	SD_CARD_ERROR_WRITE,4,4
	.comm	FALSE,4,4
	.comm	DATA_RES_MASK,4,4
	.comm	DATA_RES_ACCEPTED,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_sdcard_write_data.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	sdcard_write_data, %function
sdcard_write_data:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, lr}
	mov	r4, #0
	mov	r6, r1
	ldr	r5, .L7
	sub	sp, sp, #16
	mov	r2, r0
	mov	r3, r4
	mov	r1, #8
	ldr	r0, [r5]
	str	r4, [sp, #12]
	str	r4, [sp, #8]
	str	r4, [sp, #4]
	str	r4, [sp]
	bl	platform_spi_transaction
	mov	r2, r6
	mov	r1, #512
	ldr	r0, [r5]
	bl	platform_spi_blkwrite
	mov	r3, r4
	mov	r1, #16
	ldr	r2, .L7+4
	ldr	r0, [r5]
	str	r4, [sp, #12]
	str	r4, [sp, #8]
	str	r4, [sp, #4]
	str	r4, [sp]
	bl	platform_spi_transaction
	mov	r2, #255
	mov	r1, #8
	ldr	r0, [r5]
	bl	platform_spi_send_recv
	ldr	r3, .L7+8
	ldr	r2, .L7+12
	ldr	r3, [r3]
	ldr	r1, [r2]
	and	r3, r3, r0
	ldr	r2, .L7+16
	cmp	r3, r1
	str	r0, [r2]
	bne	.L6
	ldr	r3, .L7+20
	ldr	r0, [r3]
	add	sp, sp, #16
	@ sp needed
	pop	{r4, r5, r6, pc}
.L6:
	ldr	r2, .L7+24
	ldr	r3, .L7+28
	ldr	r2, [r2]
	str	r2, [r3]
	bl	sdcard_chipselect_high
	ldr	r3, .L7+32
	ldr	r0, [r3]
	add	sp, sp, #16
	@ sp needed
	pop	{r4, r5, r6, pc}
.L8:
	.align	2
.L7:
	.word	m_spi_no
	.word	65535
	.word	DATA_RES_MASK
	.word	DATA_RES_ACCEPTED
	.word	m_status
	.word	TRUE
	.word	SD_CARD_ERROR_WRITE
	.word	m_error
	.word	FALSE
	.size	sdcard_write_data, .-sdcard_write_data
	.comm	m_status,4,4
	.comm	m_spi_no,4,4
	.comm	m_error,4,4
	.comm	TRUE,4,4
	.comm	SD_CARD_ERROR_WRITE,4,4
	.comm	FALSE,4,4
	.comm	DATA_RES_MASK,4,4
	.comm	DATA_RES_ACCEPTED,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
