	.file	"extr_shuttle_usbat.c_usbat_read_block.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	usbat_read_block, @function
usbat_read_block:
.LFB0:
	.cfi_startproc
	endbr64
	test	dx, dx
	jne	.L2
	mov	eax, DWORD PTR USB_STOR_TRANSPORT_GOOD[rip]
	ret
	.p2align 4,,10
	.p2align 3
.L2:
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	mov	r15, rsi
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	mov	r14d, ecx
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	mov	r13, rdi
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	movzx	r12d, dx
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	mov	rbp, QWORD PTR [rdi]
	mov	edi, r12d
	mov	BYTE PTR 0[rbp], -64
	movzx	eax, BYTE PTR USBAT_ATA[rip]
	or	al, BYTE PTR USBAT_CMD_READ_BLOCK[rip]
	mov	BYTE PTR 5[rbp], 0
	mov	BYTE PTR 1[rbp], al
	movzx	eax, BYTE PTR USBAT_ATA_DATA[rip]
	mov	BYTE PTR 2[rbp], al
	xor	eax, eax
	mov	WORD PTR 3[rbp], ax
	call	LSB_of@PLT
	mov	edi, r12d
	mov	BYTE PTR 6[rbp], al
	call	MSB_of@PLT
	mov	edx, 8
	mov	rsi, rbp
	mov	rdi, r13
	mov	BYTE PTR 7[rbp], al
	call	usbat_execute_command@PLT
	cmp	DWORD PTR USB_STOR_XFER_GOOD[rip], eax
	je	.L4
	mov	eax, DWORD PTR USB_STOR_TRANSPORT_ERROR[rip]
.L1:
	pop	rbp
	.cfi_remember_state
	.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
.L4:
	.cfi_restore_state
	mov	ecx, r14d
	mov	edx, r12d
	mov	rsi, r15
	mov	rdi, r13
	call	usbat_bulk_read@PLT
	mov	r8d, eax
	cmp	DWORD PTR USB_STOR_XFER_GOOD[rip], r8d
	mov	eax, DWORD PTR USB_STOR_TRANSPORT_ERROR[rip]
	jne	.L1
	mov	eax, DWORD PTR USB_STOR_TRANSPORT_GOOD[rip]
	jmp	.L1
	.cfi_endproc
.LFE0:
	.size	usbat_read_block, .-usbat_read_block
	.comm	USB_STOR_XFER_GOOD,4,4
	.comm	USB_STOR_TRANSPORT_GOOD,4,4
	.comm	USB_STOR_TRANSPORT_ERROR,4,4
	.comm	USBAT_CMD_READ_BLOCK,1,1
	.comm	USBAT_ATA_DATA,1,1
	.comm	USBAT_ATA,1,1
	.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_shuttle_usbat.c_usbat_read_block.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	usbat_read_block, %function
usbat_read_block:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, lr}
	subs	r6, r2, #0
	bne	.L2
.L7:
	ldr	r3, .L9
	ldr	r0, [r3]
	pop	{r4, r5, r6, r7, r8, pc}
.L2:
	mov	r8, r1
	mvn	r1, #63
	mov	r7, r3
	mov	r3, #0
	ldr	r4, [r0]
	ldr	r2, .L9+4
	strb	r1, [r4]
	ldr	r1, .L9+8
	mov	r5, r0
	ldrb	r0, [r1]	@ zero_extendqisi2
	ldr	r1, .L9+12
	ldrb	r2, [r2]	@ zero_extendqisi2
	ldrb	r1, [r1]	@ zero_extendqisi2
	orr	r2, r2, r0
	strb	r2, [r4, #1]
	strb	r1, [r4, #2]
	strb	r3, [r4, #3]
	strb	r3, [r4, #4]
	strb	r3, [r4, #5]
	mov	r0, r6
	bl	LSB_of
	mov	r3, r0
	mov	r0, r6
	strb	r3, [r4, #6]
	bl	MSB_of
	mov	r1, r4
	strb	r0, [r4, #7]
	mov	r2, #8
	mov	r0, r5
	bl	usbat_execute_command
	ldr	r4, .L9+16
	ldr	r3, [r4]
	cmp	r3, r0
	beq	.L4
.L5:
	ldr	r3, .L9+20
	ldr	r0, [r3]
	pop	{r4, r5, r6, r7, r8, pc}
.L4:
	mov	r3, r7
	mov	r2, r6
	mov	r1, r8
	mov	r0, r5
	bl	usbat_bulk_read
	ldr	r3, [r4]
	cmp	r3, r0
	bne	.L5
	b	.L7
.L10:
	.align	2
.L9:
	.word	USB_STOR_TRANSPORT_GOOD
	.word	USBAT_ATA
	.word	USBAT_CMD_READ_BLOCK
	.word	USBAT_ATA_DATA
	.word	USB_STOR_XFER_GOOD
	.word	USB_STOR_TRANSPORT_ERROR
	.size	usbat_read_block, .-usbat_read_block
	.comm	USB_STOR_XFER_GOOD,4,4
	.comm	USB_STOR_TRANSPORT_GOOD,4,4
	.comm	USB_STOR_TRANSPORT_ERROR,4,4
	.comm	USBAT_CMD_READ_BLOCK,1,1
	.comm	USBAT_ATA_DATA,1,1
	.comm	USBAT_ATA,1,1
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
