	.file	"extr_dma.c_iomd_get_next_sg.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	iomd_get_next_sg, @function
iomd_get_next_sg:
.LFB0:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	push	rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	mov	rbx, rdi
	sub	rsp, 8
	.cfi_def_cfa_offset 32
	mov	r8, QWORD PTR 40[rdi]
	test	r8, r8
	je	.L2
	mov	rdx, QWORD PTR PAGE_MASK[rip]
	mov	rax, QWORD PTR 8[rdi]
	mov	rcx, QWORD PTR 16[rdi]
	not	rdx
	mov	QWORD PTR [rdi], rax
	mov	rdi, QWORD PTR TRANSFER_SIZE[rip]
	and	rdx, rax
	add	rcx, rdx
	cmp	QWORD PTR PAGE_SIZE[rip], rcx
	lea	r9, [rdi+rdx]
	mov	rsi, rcx
	cmovbe	rsi, QWORD PTR PAGE_SIZE[rip]
	cmp	rsi, r9
	mov	r10, rsi
	mov	r9d, 0
	cmovbe	r9, QWORD PTR DMA_END_L[rip]
	sub	rax, rdx
	sub	r10, rdi
	sub	rcx, rsi
	add	rax, rsi
	mov	QWORD PTR 24[rbx], r10
	mov	rbp, r9
	mov	QWORD PTR 16[rbx], rcx
	mov	QWORD PTR 8[rbx], rax
	test	rcx, rcx
	jne	.L10
	cmp	DWORD PTR 32[rbx], 1
	jg	.L11
	mov	rax, QWORD PTR DMA_END_S[rip]
	mov	QWORD PTR 40[rbx], 0
	or	rax, r10
	or	rax, r9
	mov	QWORD PTR 24[rbx], rax
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	pop	rbx
	.cfi_def_cfa_offset 16
	pop	rbp
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L10:
	.cfi_restore_state
	mov	rax, r10
	or	rax, r9
	mov	QWORD PTR 24[rbx], rax
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	pop	rbx
	.cfi_def_cfa_offset 16
	pop	rbp
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L2:
	.cfi_restore_state
	mov	rax, QWORD PTR DMA_END_S[rip]
	or	rax, QWORD PTR DMA_END_L[rip]
	mov	QWORD PTR [rdi], 0
	mov	QWORD PTR 24[rbx], rax
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	pop	rbx
	.cfi_def_cfa_offset 16
	pop	rbp
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L11:
	.cfi_restore_state
	mov	rdi, r8
	call	sg_next@PLT
	mov	rdx, QWORD PTR [rax]
	mov	QWORD PTR 40[rbx], rax
	mov	rax, QWORD PTR 8[rax]
	sub	DWORD PTR 32[rbx], 1
	mov	QWORD PTR 8[rbx], rdx
	mov	QWORD PTR 16[rbx], rax
	mov	rax, QWORD PTR 24[rbx]
	or	rax, rbp
	mov	QWORD PTR 24[rbx], rax
	add	rsp, 8
	.cfi_def_cfa_offset 24
	pop	rbx
	.cfi_def_cfa_offset 16
	pop	rbp
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE0:
	.size	iomd_get_next_sg, .-iomd_get_next_sg
	.comm	TRANSFER_SIZE,8,8
	.comm	PAGE_SIZE,8,8
	.comm	PAGE_MASK,8,8
	.comm	DMA_END_S,8,8
	.comm	DMA_END_L,8,8
	.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_dma.c_iomd_get_next_sg.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	iomd_get_next_sg, %function
iomd_get_next_sg:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, lr}
	mov	r4, r0
	ldr	r0, [r0, #20]
	cmp	r0, #0
	beq	.L2
	ldr	r3, .L12
	ldr	r1, [r4, #4]
	ldr	ip, [r3]
	ldr	r3, .L12+4
	ldr	r2, [r4, #8]
	ldr	r3, [r3]
	bic	ip, r1, ip
	add	r2, ip, r2
	cmp	r2, r3
	movcc	r3, r2
	ldr	lr, .L12+8
	sub	r2, r2, r3
	ldr	lr, [lr]
	str	r1, [r4]
	add	r5, lr, ip
	cmp	r3, r5
	ldrls	r5, .L12+12
	sub	r1, r1, ip
	add	r1, r1, r3
	movhi	r5, #0
	ldrls	r5, [r5]
	sub	r3, r3, lr
	cmp	r2, #0
	stmib	r4, {r1, r2, r3}
	bne	.L9
	ldr	r1, [r4, #16]
	cmp	r1, #1
	bgt	.L11
	ldr	r1, .L12+16
	str	r2, [r4, #20]
	ldr	r2, [r1]
	orr	r3, r3, r2
	orr	r3, r3, r5
	str	r3, [r4, #12]
	pop	{r4, r5, r6, pc}
.L11:
	bl	sg_next
	ldr	r2, [r4, #16]
	ldr	ip, [r0]
	ldr	r1, [r0, #4]
	sub	r2, r2, #1
	ldr	r3, [r4, #12]
	str	r0, [r4, #20]
	str	ip, [r4, #4]
	str	r1, [r4, #8]
	str	r2, [r4, #16]
.L9:
	orr	r3, r5, r3
	str	r3, [r4, #12]
	pop	{r4, r5, r6, pc}
.L2:
	ldr	r3, .L12+16
	ldr	r2, .L12+12
	ldr	r3, [r3]
	ldr	r2, [r2]
	str	r0, [r4]
	orr	r3, r3, r2
	str	r3, [r4, #12]
	pop	{r4, r5, r6, pc}
.L13:
	.align	2
.L12:
	.word	PAGE_MASK
	.word	PAGE_SIZE
	.word	TRANSFER_SIZE
	.word	DMA_END_L
	.word	DMA_END_S
	.size	iomd_get_next_sg, .-iomd_get_next_sg
	.comm	TRANSFER_SIZE,4,4
	.comm	PAGE_SIZE,4,4
	.comm	PAGE_MASK,4,4
	.comm	DMA_END_S,4,4
	.comm	DMA_END_L,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
