	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ivtv_unfinished_dma            ## -- Begin function ivtv_unfinished_dma
	.p2align	4, 0x90
_ivtv_unfinished_dma:                   ## @ivtv_unfinished_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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	_dma_timer@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rdi, %rsi
	callq	_from_timer
	movq	%rax, %rbx
	movq	_IVTV_F_I_DMA@GOTPCREL(%rip), %r15
	movl	(%r15), %edi
	leaq	8(%rax), %r14
	movq	%r14, %rsi
	callq	_test_bit
	testl	%eax, %eax
	je	LBB0_1
## %bb.2:
	movq	_IVTV_REG_DMASTATUS@GOTPCREL(%rip), %r12
	movl	(%r12), %edi
	callq	_read_reg
	movl	(%rbx), %edx
	leaq	L_.str(%rip), %rdi
	movl	%eax, %esi
	callq	_IVTV_ERR
	movl	(%r12), %edi
	callq	_read_reg
	andl	$3, %eax
	movl	(%r12), %esi
	movl	%eax, %edi
	callq	_write_reg
	movq	_IVTV_F_I_UDMA@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%r14, %rsi
	callq	_clear_bit
	movl	(%r15), %edi
	movq	%r14, %rsi
	callq	_clear_bit
	movl	$-1, (%rbx)
	addq	$4, %rbx
	movq	%rbx, %rdi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_wake_up                        ## TAILCALL
LBB0_1:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_dma_timer,4,2                  ## @dma_timer
	.comm	_IVTV_F_I_DMA,4,2               ## @IVTV_F_I_DMA
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"DMA TIMEOUT %08x %d\n"

	.comm	_IVTV_REG_DMASTATUS,4,2         ## @IVTV_REG_DMASTATUS
	.comm	_IVTV_F_I_UDMA,4,2              ## @IVTV_F_I_UDMA
	.comm	_itv,8,3                        ## @itv
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ivtv_unfinished_dma            ; -- Begin function ivtv_unfinished_dma
	.p2align	2
_ivtv_unfinished_dma:                   ; @ivtv_unfinished_dma
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
Lloh0:
	adrp	x8, _dma_timer@GOTPAGE
Lloh1:
	ldr	x8, [x8, _dma_timer@GOTPAGEOFF]
Lloh2:
	ldr	w2, [x8]
	mov	x1, x0
	bl	_from_timer
	mov	x19, x0
Lloh3:
	adrp	x21, _IVTV_F_I_DMA@GOTPAGE
Lloh4:
	ldr	x21, [x21, _IVTV_F_I_DMA@GOTPAGEOFF]
	ldr	w0, [x21]
	add	x20, x19, #8
	mov	x1, x20
	bl	_test_bit
	cbz	w0, LBB0_2
; %bb.1:
Lloh5:
	adrp	x22, _IVTV_REG_DMASTATUS@GOTPAGE
Lloh6:
	ldr	x22, [x22, _IVTV_REG_DMASTATUS@GOTPAGEOFF]
	ldr	w0, [x22]
	bl	_read_reg
	mov	x1, x0
	ldr	w2, [x19]
Lloh7:
	adrp	x0, l_.str@PAGE
Lloh8:
	add	x0, x0, l_.str@PAGEOFF
	bl	_IVTV_ERR
	ldr	w0, [x22]
	bl	_read_reg
	and	w0, w0, #0x3
	ldr	w1, [x22]
	bl	_write_reg
Lloh9:
	adrp	x8, _IVTV_F_I_UDMA@GOTPAGE
Lloh10:
	ldr	x8, [x8, _IVTV_F_I_UDMA@GOTPAGEOFF]
Lloh11:
	ldr	w0, [x8]
	mov	x1, x20
	bl	_clear_bit
	ldr	w0, [x21]
	mov	x1, x20
	bl	_clear_bit
	mov	w8, #-1
	str	w8, [x19], #4
	mov	x0, x19
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	_wake_up
LBB0_2:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.comm	_dma_timer,4,2                  ; @dma_timer
	.comm	_IVTV_F_I_DMA,4,2               ; @IVTV_F_I_DMA
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"DMA TIMEOUT %08x %d\n"

	.comm	_IVTV_REG_DMASTATUS,4,2         ; @IVTV_REG_DMASTATUS
	.comm	_IVTV_F_I_UDMA,4,2              ; @IVTV_F_I_UDMA
	.comm	_itv,8,3                        ; @itv
.subsections_via_symbols
