	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function r592_transfer_fifo_dma
_r592_transfer_fifo_dma:                ## @r592_transfer_fifo_dma
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	cmpl	$0, 28(%rdi)
	je	LBB0_2
## %bb.1:
	movq	%rdi, %rbx
	movq	8(%rdi), %rax
	cmpl	$0, 12(%rax)
	je	LBB0_2
## %bb.4:
	movl	8(%rax), %ecx
	movq	(%rax), %r12
	movq	_WRITE@GOTPCREL(%rip), %rax
	movq	(%rax), %r13
	xorl	%r14d, %r14d
	cmpq	%r13, %r12
	sete	%al
	movq	_R592_LFIFO_SIZE@GOTPCREL(%rip), %r15
	cmpl	(%r15), %ecx
	jne	LBB0_2
## %bb.5:
	movb	%al, -41(%rbp)                  ## 1-byte Spill
	leaq	L_.str(%rip), %rdi
	callq	_dbg_verbose
	movl	$0, (%rbx)
	leaq	24(%rbx), %rdi
	movq	%rdi, -56(%rbp)                 ## 8-byte Spill
	callq	_reinit_completion
	movq	8(%rbx), %rsi
	movq	16(%rbx), %rdi
	addq	$8, %rsi
	cmpq	%r13, %r12
	jne	LBB0_6
## %bb.7:
	movq	_PCI_DMA_TODEVICE@GOTPCREL(%rip), %rax
	jmp	LBB0_8
LBB0_2:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
LBB0_3:
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_17:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_6:
	movq	_PCI_DMA_FROMDEVICE@GOTPCREL(%rip), %rax
LBB0_8:
	movl	(%rax), %ecx
	movl	$1, %edx
	callq	_dma_map_sg
	cmpl	$1, %eax
	jne	LBB0_10
## %bb.9:
	movq	8(%rbx), %rdi
	addq	$8, %rdi
	callq	_sg_dma_len
	cmpl	(%r15), %eax
	jge	LBB0_11
LBB0_10:
	leaq	L_.str.1(%rip), %rdi
	callq	_message
	movq	_EIO@GOTPCREL(%rip), %rcx
	jmp	LBB0_3
LBB0_11:
	movb	-41(%rbp), %al                  ## 1-byte Reload
	movb	%al, %r14b
	movq	%rbx, %rdi
	movl	%r14d, %esi
	callq	_r592_start_dma
	movl	$1000, %edi                     ## imm = 0x3E8
	callq	_msecs_to_jiffies
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movl	%eax, %esi
	callq	_wait_for_completion_timeout
	testl	%eax, %eax
	jne	LBB0_13
## %bb.12:
	leaq	L_.str.2(%rip), %rdi
	callq	_message
	movq	_ETIMEDOUT@GOTPCREL(%rip), %rax
	xorl	%esi, %esi
	subl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_r592_stop_dma
LBB0_13:
	movq	8(%rbx), %rsi
	movq	16(%rbx), %rdi
	addq	$8, %rsi
	cmpq	%r13, %r12
	jne	LBB0_14
## %bb.15:
	movq	_PCI_DMA_TODEVICE@GOTPCREL(%rip), %rax
	jmp	LBB0_16
LBB0_14:
	movq	_PCI_DMA_FROMDEVICE@GOTPCREL(%rip), %rax
LBB0_16:
	movl	(%rax), %ecx
	movl	$1, %edx
	callq	_dma_unmap_sg
	movl	(%rbx), %eax
	jmp	LBB0_17
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_WRITE,8,3                      ## @WRITE
	.comm	_R592_LFIFO_SIZE,4,2            ## @R592_LFIFO_SIZE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"doing dma transfer"

	.comm	_PCI_DMA_TODEVICE,4,2           ## @PCI_DMA_TODEVICE
	.comm	_PCI_DMA_FROMDEVICE,4,2         ## @PCI_DMA_FROMDEVICE
L_.str.1:                               ## @.str.1
	.asciz	"problem in dma_map_sg"

	.comm	_EIO,4,2                        ## @EIO
L_.str.2:                               ## @.str.2
	.asciz	"DMA timeout"

	.comm	_ETIMEDOUT,4,2                  ## @ETIMEDOUT
	.no_dead_strip	_r592_transfer_fifo_dma
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function r592_transfer_fifo_dma
_r592_transfer_fifo_dma:                ; @r592_transfer_fifo_dma
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	ldr	w8, [x0, #28]
	cbz	w8, LBB0_6
; %bb.1:
	mov	x19, x0
	ldr	x8, [x0, #8]
	ldr	w9, [x8, #12]
	cbz	w9, LBB0_6
; %bb.2:
	ldr	w9, [x8, #8]
	ldr	x22, [x8]
Lloh0:
	adrp	x8, _WRITE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _WRITE@GOTPAGEOFF]
Lloh2:
	ldr	x23, [x8]
	cmp	x22, x23
	cset	w20, eq
Lloh3:
	adrp	x26, _R592_LFIFO_SIZE@GOTPAGE
Lloh4:
	ldr	x26, [x26, _R592_LFIFO_SIZE@GOTPAGEOFF]
	ldr	w8, [x26]
	cmp	w9, w8
	b.ne	LBB0_6
; %bb.3:
Lloh5:
	adrp	x0, l_.str@PAGE
Lloh6:
	add	x0, x0, l_.str@PAGEOFF
	bl	_dbg_verbose
	str	wzr, [x19]
	add	x21, x19, #24
	mov	x0, x21
	bl	_reinit_completion
	ldp	x8, x0, [x19, #8]
Lloh7:
	adrp	x24, _PCI_DMA_TODEVICE@GOTPAGE
Lloh8:
	ldr	x24, [x24, _PCI_DMA_TODEVICE@GOTPAGEOFF]
	add	x1, x8, #8
Lloh9:
	adrp	x25, _PCI_DMA_FROMDEVICE@GOTPAGE
Lloh10:
	ldr	x25, [x25, _PCI_DMA_FROMDEVICE@GOTPAGEOFF]
	cmp	x22, x23
	csel	x8, x24, x25, eq
	ldr	w3, [x8]
	mov	w2, #1
	bl	_dma_map_sg
	cmp	w0, #1
	b.ne	LBB0_5
; %bb.4:
	ldr	x8, [x19, #8]
	add	x0, x8, #8
	bl	_sg_dma_len
	ldr	w8, [x26]
	cmp	w0, w8
	b.ge	LBB0_9
LBB0_5:
Lloh11:
	adrp	x0, l_.str.1@PAGE
Lloh12:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_message
Lloh13:
	adrp	x8, _EIO@GOTPAGE
Lloh14:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
	b	LBB0_7
LBB0_6:
Lloh15:
	adrp	x8, _EINVAL@GOTPAGE
Lloh16:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_7:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_8:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_9:
	mov	x0, x19
	mov	x1, x20
	bl	_r592_start_dma
	mov	w0, #1000
	bl	_msecs_to_jiffies
	mov	x1, x0
	mov	x0, x21
	bl	_wait_for_completion_timeout
	cbnz	w0, LBB0_11
; %bb.10:
Lloh17:
	adrp	x0, l_.str.2@PAGE
Lloh18:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_message
Lloh19:
	adrp	x8, _ETIMEDOUT@GOTPAGE
Lloh20:
	ldr	x8, [x8, _ETIMEDOUT@GOTPAGEOFF]
Lloh21:
	ldr	w8, [x8]
	neg	w1, w8
	mov	x0, x19
	bl	_r592_stop_dma
LBB0_11:
	ldp	x8, x0, [x19, #8]
	add	x1, x8, #8
	cmp	x22, x23
	csel	x8, x24, x25, eq
	ldr	w3, [x8]
	mov	w2, #1
	bl	_dma_unmap_sg
	ldr	w0, [x19]
	b	LBB0_8
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpAdd	Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_WRITE,8,3                      ; @WRITE
	.comm	_R592_LFIFO_SIZE,4,2            ; @R592_LFIFO_SIZE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"doing dma transfer"

	.comm	_PCI_DMA_TODEVICE,4,2           ; @PCI_DMA_TODEVICE
	.comm	_PCI_DMA_FROMDEVICE,4,2         ; @PCI_DMA_FROMDEVICE
l_.str.1:                               ; @.str.1
	.asciz	"problem in dma_map_sg"

	.comm	_EIO,4,2                        ; @EIO
l_.str.2:                               ; @.str.2
	.asciz	"DMA timeout"

	.comm	_ETIMEDOUT,4,2                  ; @ETIMEDOUT
	.no_dead_strip	_r592_transfer_fifo_dma
.subsections_via_symbols
