	.file	"extr_pcibr_dma.c_sn_dma_flush.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.globl	sn_dma_flush
	.type	sn_dma_flush, @function
sn_dma_flush:
.LFB0:
	.cfi_startproc
	endbr64
	mov	eax, DWORD PTR sn_ioif_inited[rip]
	test	eax, eax
	jne	.L47
	ret
	.p2align 4,,10
	.p2align 3
.L47:
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	mov	rbx, rdi
	sub	rsp, 8
	.cfi_def_cfa_offset 64
	call	NASID_GET@PLT
	mov	edi, eax
	mov	ebp, eax
	call	nasid_to_cnodeid@PLT
	cmp	eax, -1
	je	.L1
	mov	edi, ebp
	call	nasid_to_cnodeid@PLT
	mov	edi, eax
	call	NODEPDA@PLT
	xor	edi, edi
	mov	r13, QWORD PTR [rax]
	test	r13, r13
	sete	dil
	call	BUG_ON@PLT
	cmp	QWORD PTR 8[r13], 0
	je	.L1
	mov	r12d, ebp
	mov	rdi, rbx
	and	r12d, 1
	jne	.L48
	call	BWIN_WINDOWNUM@PLT
	test	rax, rax
	je	.L9
	mov	r15, QWORD PTR 0[r13]
	mov	rdi, rbx
	call	BWIN_WINDOWNUM@PLT
	mov	rdi, QWORD PTR [r15+rax*8]
	call	IIO_ITTE_WIDGET@PLT
.L8:
	mov	rdx, QWORD PTR 8[r13]
	cdqe
	mov	r13, QWORD PTR [rdx+rax*8]
	test	r13, r13
	je	.L1
	mov	r9d, DWORD PTR DEV_PER_WIDGET[rip]
	test	r9d, r9d
	jle	.L10
	mov	r8d, DWORD PTR PCI_ROM_RESOURCE[rip]
	xor	esi, esi
	lea	edi, -1[r8]
	add	rdi, 1
	sal	rdi, 4
	.p2align 4,,10
	.p2align 3
.L15:
	mov	r14, QWORD PTR 8[r13]
	test	r8d, r8d
	jle	.L11
	mov	rax, QWORD PTR 32[r14]
	lea	rcx, [rdi+rax]
	jmp	.L14
	.p2align 4,,10
	.p2align 3
.L49:
	cmp	rdx, rbx
	jg	.L12
	cmp	QWORD PTR 8[rax], rbx
	jge	.L13
.L12:
	add	rax, 16
	cmp	rcx, rax
	je	.L11
.L14:
	mov	rdx, QWORD PTR [rax]
	test	rdx, rdx
	jne	.L49
.L11:
	add	esi, 1
	add	r13, 16
	cmp	esi, r9d
	jne	.L15
.L1:
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	pop	rbx
	.cfi_def_cfa_offset 48
	pop	rbp
	.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
.L48:
	.cfi_restore_state
	call	TIO_HWIN@PLT
	test	rax, rax
	jne	.L19
	mov	rdi, rbx
	call	TIO_BWIN_WINDOWNUM@PLT
	test	eax, eax
	je	.L7
	mov	rdi, rbx
	call	TIO_BWIN_WINDOWNUM@PLT
	test	eax, eax
	js	.L7
	cdqe
	sal	rax, 3
	jmp	.L6
.L10:
	je	.L1
	.p2align 4,,10
	.p2align 3
.L13:
	test	r12d, r12d
	je	.L16
	mov	esi, DWORD PTR TIO_NODE_ID[rip]
	mov	edi, ebp
	call	TIO_IOSPACE_ADDR@PLT
	mov	edi, eax
	call	HUB_L@PLT
	mov	edi, eax
	call	XWIDGET_PART_REV_NUM@PLT
	mov	ebx, DWORD PTR PV907516[rip]
	mov	edi, eax
	call	XWIDGET_PART_REV_NUM_REV@PLT
	bt	ebx, eax
	jc	.L1
	mov	rax, QWORD PTR 16[r14]
	mov	edi, DWORD PTR 24[r14]
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	pop	rbx
	.cfi_restore 3
	.cfi_def_cfa_offset 48
	pop	rbp
	.cfi_restore 6
	.cfi_def_cfa_offset 40
	lea	rsi, -1[rax]
	pop	r12
	.cfi_restore 12
	.cfi_def_cfa_offset 32
	pop	r13
	.cfi_restore 13
	.cfi_def_cfa_offset 24
	pop	r14
	.cfi_restore 14
	.cfi_def_cfa_offset 16
	pop	r15
	.cfi_restore 15
	.cfi_def_cfa_offset 8
	jmp	pcireg_wrb_flush_get@PLT
.L16:
	.cfi_restore_state
	xor	esi, esi
	mov	rdi, r13
	call	spin_lock_irqsave@PLT
	mov	rax, QWORD PTR [r14]
	mov	rdx, QWORD PTR 8[r14]
	mov	DWORD PTR [rax], 0
	mov	DWORD PTR [rdx], 1
	cmp	DWORD PTR [rax], 271
	je	.L18
	.p2align 4,,10
	.p2align 3
.L17:
	xor	eax, eax
	call	cpu_relax@PLT
	mov	rax, QWORD PTR [r14]
	cmp	DWORD PTR [rax], 271
	jne	.L17
.L18:
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	mov	rdi, r13
	xor	esi, esi
	pop	rbx
	.cfi_restore 3
	.cfi_def_cfa_offset 48
	pop	rbp
	.cfi_restore 6
	.cfi_def_cfa_offset 40
	pop	r12
	.cfi_restore 12
	.cfi_def_cfa_offset 32
	pop	r13
	.cfi_restore 13
	.cfi_def_cfa_offset 24
	pop	r14
	.cfi_restore 14
	.cfi_def_cfa_offset 16
	pop	r15
	.cfi_restore 15
	.cfi_def_cfa_offset 8
	jmp	spin_unlock_irqrestore@PLT
.L19:
	.cfi_restore_state
	xor	eax, eax
.L6:
	mov	rdx, QWORD PTR 0[r13]
	mov	r15, QWORD PTR [rdx+rax]
	mov	rdi, r15
	call	TIO_ITTE_VALID@PLT
	test	eax, eax
	je	.L1
	mov	rdi, r15
	call	TIO_ITTE_WIDGET@PLT
	jmp	.L8
.L9:
	mov	rdi, rbx
	call	SWIN_WIDGETNUM@PLT
	jmp	.L8
.L7:
	mov	rdi, rbx
	call	TIO_SWIN_WIDGETNUM@PLT
	jmp	.L8
	.cfi_endproc
.LFE0:
	.size	sn_dma_flush, .-sn_dma_flush
	.comm	sn_ioif_inited,4,4
	.comm	TIO_NODE_ID,4,4
	.comm	PV907516,4,4
	.comm	PCI_ROM_RESOURCE,4,4
	.comm	DEV_PER_WIDGET,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_pcibr_dma.c_sn_dma_flush.c"
	.text
	.align	2
	.global	sn_dma_flush
	.syntax unified
	.arm
	.fpu softvfp
	.type	sn_dma_flush, %function
sn_dma_flush:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	ldr	r3, .L50
	ldr	r3, [r3]
	cmp	r3, #0
	bxeq	lr
	push	{r4, r5, r6, r7, r8, r9, r10, lr}
	mov	r4, r0
	bl	NASID_GET
	mov	r5, r0
	bl	nasid_to_cnodeid
	cmn	r0, #1
	popeq	{r4, r5, r6, r7, r8, r9, r10, pc}
	mov	r0, r5
	bl	nasid_to_cnodeid
	bl	NODEPDA
	ldr	r7, [r0]
	clz	r0, r7
	lsr	r0, r0, #5
	bl	BUG_ON
	ldr	r3, [r7, #4]
	cmp	r3, #0
	popeq	{r4, r5, r6, r7, r8, r9, r10, pc}
	ands	r6, r5, #1
	mov	r0, r4
	bne	.L48
	bl	BWIN_WINDOWNUM
	cmp	r0, #0
	mov	r0, r4
	beq	.L9
	ldr	r9, [r7]
	bl	BWIN_WINDOWNUM
	ldr	r0, [r9, r0, lsl #2]
	bl	IIO_ITTE_WIDGET
.L8:
	ldr	r3, [r7, #4]
	ldr	r7, [r3, r0, lsl #2]
	cmp	r7, #0
	popeq	{r4, r5, r6, r7, r8, r9, r10, pc}
	ldr	r3, .L50+4
	ldr	r9, [r3]
	cmp	r9, #0
	ble	.L10
	mov	lr, #0
	ldr	r3, .L50+8
	ldr	ip, [r3]
.L15:
	cmp	ip, #0
	ldr	r8, [r7, #4]
	ble	.L11
	ldr	r1, [r8, #16]
	mov	r3, #0
	add	r0, r1, #4
	b	.L14
.L49:
	cmp	r2, r4
	bgt	.L12
	ldr	r2, [r0, r3, lsl #3]
	cmp	r2, r4
	bge	.L13
.L12:
	add	r3, r3, #1
	cmp	r3, ip
	beq	.L11
.L14:
	ldr	r2, [r1, r3, lsl #3]
	cmp	r2, #0
	bne	.L49
.L11:
	add	lr, lr, #1
	cmp	lr, r9
	add	r7, r7, #8
	bne	.L15
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L48:
	bl	TIO_HWIN
	cmp	r0, #0
	bne	.L19
	mov	r0, r4
	bl	TIO_BWIN_WINDOWNUM
	cmp	r0, #0
	beq	.L7
	mov	r0, r4
	bl	TIO_BWIN_WINDOWNUM
	subs	r3, r0, #0
	lslge	r3, r3, #2
	bge	.L6
.L7:
	mov	r0, r4
	bl	TIO_SWIN_WIDGETNUM
	b	.L8
.L10:
	popeq	{r4, r5, r6, r7, r8, r9, r10, pc}
.L13:
	cmp	r6, #0
	beq	.L16
	ldr	r3, .L50+12
	mov	r0, r5
	ldr	r1, [r3]
	bl	TIO_IOSPACE_ADDR
	bl	HUB_L
	bl	XWIDGET_PART_REV_NUM
	ldr	r3, .L50+16
	ldr	r4, [r3]
	bl	XWIDGET_PART_REV_NUM_REV
	asr	r4, r4, r0
	tst	r4, #1
	popne	{r4, r5, r6, r7, r8, r9, r10, pc}
	ldr	r1, [r8, #8]
	ldr	r0, [r8, #12]
	sub	r1, r1, #1
	pop	{r4, r5, r6, r7, r8, r9, r10, lr}
	b	pcireg_wrb_flush_get
.L16:
	mov	r1, #0
	mov	r0, r7
	bl	spin_lock_irqsave
	mov	r1, #1
	ldr	r3, [r8]
	ldr	r2, [r8, #4]
	str	r6, [r3]
	str	r1, [r2]
	ldr	r3, [r3]
	ldr	r4, .L50+20
	cmp	r3, r4
	beq	.L18
.L17:
	bl	cpu_relax
	ldr	r3, [r8]
	ldr	r3, [r3]
	cmp	r3, r4
	bne	.L17
.L18:
	mov	r0, r7
	pop	{r4, r5, r6, r7, r8, r9, r10, lr}
	mov	r1, #0
	b	spin_unlock_irqrestore
.L19:
	mov	r3, #0
.L6:
	ldr	r2, [r7]
	ldr	r9, [r2, r3]
	mov	r0, r9
	bl	TIO_ITTE_VALID
	cmp	r0, #0
	popeq	{r4, r5, r6, r7, r8, r9, r10, pc}
	mov	r0, r9
	bl	TIO_ITTE_WIDGET
	b	.L8
.L9:
	bl	SWIN_WIDGETNUM
	b	.L8
.L51:
	.align	2
.L50:
	.word	sn_ioif_inited
	.word	DEV_PER_WIDGET
	.word	PCI_ROM_RESOURCE
	.word	TIO_NODE_ID
	.word	PV907516
	.word	271
	.size	sn_dma_flush, .-sn_dma_flush
	.comm	sn_ioif_inited,4,4
	.comm	TIO_NODE_ID,4,4
	.comm	PV907516,4,4
	.comm	PCI_ROM_RESOURCE,4,4
	.comm	DEV_PER_WIDGET,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
