	.file	"extr_aha152x.c_datao_end.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	datao_end, @function
datao_end:
.LFB0:
	.cfi_startproc
	endbr64
	mov	esi, DWORD PTR DFIFOEMP[rip]
	mov	edi, DWORD PTR DMASTAT[rip]
	push	r12
	.cfi_def_cfa_offset 16
	.cfi_offset 12, -16
	push	rbp
	.cfi_def_cfa_offset 24
	.cfi_offset 6, -24
	push	rbx
	.cfi_def_cfa_offset 32
	.cfi_offset 3, -32
	call	TESTLO@PLT
	test	rax, rax
	jne	.L15
.L2:
	mov	edi, DWORD PTR SXFRCTL0[rip]
	mov	esi, DWORD PTR CH1[rip]
	or	esi, DWORD PTR CLRCH1[rip]
	or	esi, DWORD PTR CLRSTCNT[rip]
	call	SETPORT@PLT
	mov	esi, DWORD PTR CH1[rip]
	mov	edi, DWORD PTR SXFRCTL0[rip]
	call	SETPORT@PLT
	mov	edi, DWORD PTR DMACNTRL0[rip]
	pop	rbx
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	xor	esi, esi
	pop	rbp
	.cfi_def_cfa_offset 16
	pop	r12
	.cfi_def_cfa_offset 8
	jmp	SETPORT@PLT
	.p2align 4,,10
	.p2align 3
.L15:
	.cfi_restore_state
	xor	eax, eax
	call	GETSTCNT@PLT
	mov	rdi, QWORD PTR CURRENT_SC[rip]
	mov	ebx, DWORD PTR DATA_LEN[rip]
	mov	r12, rax
	call	scsi_get_resid@PLT
	mov	rdi, QWORD PTR CURRENT_SC[rip]
	sub	ebx, eax
	call	scsi_sglist@PLT
	mov	rdi, QWORD PTR CURRENT_SC[rip]
	movsx	rsi, ebx
	sub	rsi, r12
	mov	rbp, rax
	call	CMD_INC_RESID@PLT
	mov	rdi, QWORD PTR CURRENT_SC[rip]
	call	scsi_bufflen@PLT
	mov	rdi, QWORD PTR CURRENT_SC[rip]
	mov	ebx, eax
	call	scsi_get_resid@PLT
	sub	ebx, eax
	test	ebx, ebx
	jg	.L3
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L5:
	mov	eax, DWORD PTR 0[rbp]
	cmp	eax, ebx
	jg	.L4
	mov	rdi, rbp
	sub	ebx, eax
	call	sg_next@PLT
	mov	rbp, rax
	test	ebx, ebx
	je	.L4
.L3:
	mov	rdi, rbp
	call	sg_is_last@PLT
	test	eax, eax
	je	.L5
.L4:
	mov	rax, QWORD PTR CURRENT_SC[rip]
	mov	rdi, rbp
	mov	QWORD PTR 8[rax], rbp
	call	SG_ADDRESS@PLT
	mov	rdx, QWORD PTR CURRENT_SC[rip]
	mov	r8, rax
	movsx	rax, ebx
	add	rax, r8
	mov	QWORD PTR 16[rdx], rax
	mov	rax, QWORD PTR 8[rdx]
	mov	eax, DWORD PTR [rax]
	sub	eax, ebx
	mov	DWORD PTR [rdx], eax
	jmp	.L2
	.cfi_endproc
.LFE0:
	.size	datao_end, .-datao_end
	.comm	SXFRCTL0,4,4
	.comm	DMASTAT,4,4
	.comm	DMACNTRL0,4,4
	.comm	DFIFOEMP,4,4
	.comm	DATA_LEN,4,4
	.comm	CURRENT_SC,8,8
	.comm	CLRSTCNT,4,4
	.comm	CLRCH1,4,4
	.comm	CH1,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_aha152x.c_datao_end.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	datao_end, %function
datao_end:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	ldr	r2, .L16
	ldr	r3, .L16+4
	push	{r4, r5, r6, r7, r8, lr}
	ldr	r1, [r2]
	ldr	r0, [r3]
	bl	TESTLO
	cmp	r0, #0
	bne	.L15
.L2:
	ldr	r5, .L16+8
	ldr	r2, .L16+12
	ldr	r1, .L16+16
	ldr	r3, [r5]
	ldr	r2, [r2]
	ldr	r4, .L16+20
	ldr	r1, [r1]
	orr	r3, r3, r2
	orr	r1, r3, r1
	ldr	r0, [r4]
	bl	SETPORT
	ldr	r1, [r5]
	ldr	r0, [r4]
	bl	SETPORT
	pop	{r4, r5, r6, r7, r8, lr}
	ldr	r3, .L16+24
	mov	r1, #0
	ldr	r0, [r3]
	b	SETPORT
.L15:
	bl	GETSTCNT
	ldr	r6, .L16+28
	ldr	r3, .L16+32
	mov	r5, r0
	ldr	r0, [r6]
	ldr	r7, [r3]
	bl	scsi_get_resid
	mov	r1, r0
	ldr	r0, [r6]
	sub	r7, r7, r1
	bl	scsi_sglist
	sub	r1, r7, r5
	mov	r4, r0
	ldr	r0, [r6]
	bl	CMD_INC_RESID
	ldr	r0, [r6]
	bl	scsi_bufflen
	mov	r5, r0
	ldr	r0, [r6]
	bl	scsi_get_resid
	sub	r5, r5, r0
	cmp	r5, #0
	bgt	.L3
	b	.L4
.L5:
	ldr	r3, [r4]
	cmp	r3, r5
	bgt	.L4
	mov	r0, r4
	sub	r5, r5, r3
	bl	sg_next
	cmp	r5, #0
	mov	r4, r0
	beq	.L4
.L3:
	mov	r0, r4
	bl	sg_is_last
	cmp	r0, #0
	beq	.L5
.L4:
	ldr	r3, [r6]
	mov	r0, r4
	str	r4, [r3, #4]
	bl	SG_ADDRESS
	ldr	r3, [r6]
	add	r0, r0, r5
	ldr	r2, [r3, #4]
	str	r0, [r3, #8]
	ldr	r0, [r2]
	sub	r5, r0, r5
	str	r5, [r3]
	b	.L2
.L17:
	.align	2
.L16:
	.word	DFIFOEMP
	.word	DMASTAT
	.word	CH1
	.word	CLRCH1
	.word	CLRSTCNT
	.word	SXFRCTL0
	.word	DMACNTRL0
	.word	CURRENT_SC
	.word	DATA_LEN
	.size	datao_end, .-datao_end
	.comm	SXFRCTL0,4,4
	.comm	DMASTAT,4,4
	.comm	DMACNTRL0,4,4
	.comm	DFIFOEMP,4,4
	.comm	DATA_LEN,4,4
	.comm	CURRENT_SC,4,4
	.comm	CLRSTCNT,4,4
	.comm	CLRCH1,4,4
	.comm	CH1,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
