	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ivtv_irq_dma_read
_ivtv_irq_dma_read:                     ## @ivtv_irq_dma_read
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r15
	leaq	L_.str(%rip), %rdi
	callq	_IVTV_DEBUG_HI_IRQ
	leaq	32(%r15), %rdi
	callq	_del_timer
	movq	_IVTV_F_I_UDMA@GOTPCREL(%rip), %r14
	movl	(%r14), %edi
	leaq	16(%r15), %rbx
	movq	%rbx, %rsi
	callq	_test_bit
	movl	(%r14), %edi
	movq	%rbx, %rsi
	callq	_test_bit
	testl	%eax, %eax
	jne	LBB0_11
## %bb.1:
	movq	(%r15), %rax
	movq	24(%r15), %r12
	leaq	(%rax,%rax,4), %r14
	leaq	(%r12,%r14,8), %r13
	movq	%r13, %rdi
	callq	_ivtv_stream_sync_for_cpu
	movq	_IVTV_REG_DMASTATUS@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_read_reg
	testb	$20, %al
	je	LBB0_2
## %bb.3:
	movq	_IVTV_REG_DMASTATUS@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_read_reg
	movq	(%r13), %rdx
	movq	8(%r12,%r14,8), %rcx
	movl	8(%r15), %r8d
	leaq	L_.str.1(%rip), %rdi
	movl	%eax, %esi
	callq	_IVTV_DEBUG_WARN
	movq	_IVTV_REG_DMASTATUS@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_read_reg
	andl	$3, %eax
	movq	_IVTV_REG_DMASTATUS@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movl	%eax, %edi
	callq	_write_reg
	movl	8(%r15), %eax
	cmpl	$3, %eax
	jne	LBB0_5
## %bb.4:
	leaq	(%r12,%r14,8), %rax
	addq	$8, %rax
	movl	$0, 8(%r15)
	movq	(%rax), %rax
	movq	%rax, (%r13)
	cmpq	8(%r12,%r14,8), %rax
	jge	LBB0_7
	jmp	LBB0_12
LBB0_2:
	movq	(%r13), %rax
	cmpq	8(%r12,%r14,8), %rax
	jl	LBB0_12
LBB0_7:
	movq	%rbx, -72(%rbp)                 ## 8-byte Spill
	movq	16(%r12,%r14,8), %rax
	movq	_IVTV_DEC_STREAM_TYPE_YUV@GOTPCREL(%rip), %rcx
	xorl	%edx, %edx
	cmpq	(%rcx), %rax
	sete	%dl
	addl	%edx, %edx
	movl	%edx, -44(%rbp)                 ## 4-byte Spill
	movl	36(%r12,%r14,8), %esi
	movq	%r12, %rbx
	leaq	(%r12,%r14,8), %r12
	addq	$32, %r12
	movl	32(%rbx,%r14,8), %edx
	leaq	L_.str.2(%rip), %rdi
	callq	_IVTV_DEBUG_HI_DMA
	movq	_CX2341X_DEC_SCHED_DMA_FROM_HOST@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, -64(%rbp)                 ## 8-byte Spill
	movq	%r14, -56(%rbp)                 ## 8-byte Spill
	movl	32(%rbx,%r14,8), %r8d
	movq	%r15, %rdi
	movl	$3, %edx
	xorl	%ecx, %ecx
	movl	-44(%rbp), %r9d                 ## 4-byte Reload
	callq	_ivtv_vapi
	movq	%r13, %rdi
	movq	%r12, %rsi
	callq	_ivtv_dequeue
	testq	%rax, %rax
	je	LBB0_10
## %bb.8:
	movq	%rax, %r14
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	leaq	(%rax,%rcx,8), %rbx
	addq	$28, %rbx
	.p2align	4, 0x90
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r13, %rdi
	movq	%r14, %rsi
	callq	_ivtv_buf_sync_for_cpu
	movq	%r13, %rdi
	movq	%r14, %rsi
	movq	%rbx, %rdx
	callq	_ivtv_enqueue
	movq	%r13, %rdi
	movq	%r12, %rsi
	callq	_ivtv_dequeue
	movq	%rax, %r14
	testq	%rax, %rax
	jne	LBB0_9
LBB0_10:
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	leaq	(%rax,%rcx,8), %rdi
	addq	$24, %rdi
	callq	_wake_up
	movq	-72(%rbp), %rbx                 ## 8-byte Reload
	movq	_IVTV_F_I_UDMA@GOTPCREL(%rip), %r14
LBB0_11:
	movl	(%r14), %edi
	movq	%rbx, %rsi
	callq	_clear_bit
	movq	_IVTV_F_I_DMA@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%rbx, %rsi
	callq	_clear_bit
	movq	$-1, (%r15)
	addq	$12, %r15
	movq	%r15, %rdi
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_wake_up                        ## TAILCALL
LBB0_5:
	movq	$0, (%r13)
	incl	%eax
	movl	%eax, 8(%r15)
	xorl	%eax, %eax
	cmpq	8(%r12,%r14,8), %rax
	jge	LBB0_7
LBB0_12:
	movq	%r13, %rdi
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_ivtv_dma_dec_start_xfer        ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"DEC DMA READ\n"

	.comm	_IVTV_F_I_UDMA,4,2              ## @IVTV_F_I_UDMA
	.comm	_IVTV_REG_DMASTATUS,4,2         ## @IVTV_REG_DMASTATUS
L_.str.1:                               ## @.str.1
	.asciz	"DEC DMA ERROR %x (xfer %d of %d, retry %d)\n"

	.comm	_IVTV_DEC_STREAM_TYPE_YUV,8,3   ## @IVTV_DEC_STREAM_TYPE_YUV
L_.str.2:                               ## @.str.2
	.asciz	"DEC DATA READ %s: %d\n"

	.comm	_CX2341X_DEC_SCHED_DMA_FROM_HOST,4,2 ## @CX2341X_DEC_SCHED_DMA_FROM_HOST
	.comm	_IVTV_F_I_DMA,4,2               ## @IVTV_F_I_DMA
	.no_dead_strip	_ivtv_irq_dma_read
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ivtv_irq_dma_read
_ivtv_irq_dma_read:                     ; @ivtv_irq_dma_read
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x19, x0
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_IVTV_DEBUG_HI_IRQ
	add	x0, x19, #32
	bl	_del_timer
Lloh2:
	adrp	x25, _IVTV_F_I_UDMA@GOTPAGE
Lloh3:
	ldr	x25, [x25, _IVTV_F_I_UDMA@GOTPAGEOFF]
	ldr	w0, [x25]
	add	x20, x19, #16
	mov	x1, x20
	bl	_test_bit
	ldr	w0, [x25]
	mov	x1, x20
	bl	_test_bit
	cbnz	w0, LBB0_12
; %bb.1:
	ldr	x26, [x19, #24]
	ldr	x27, [x19]
	mov	w8, #40
	madd	x21, x27, x8, x26
	mov	x0, x21
	bl	_ivtv_stream_sync_for_cpu
Lloh4:
	adrp	x22, _IVTV_REG_DMASTATUS@GOTPAGE
Lloh5:
	ldr	x22, [x22, _IVTV_REG_DMASTATUS@GOTPAGEOFF]
	ldr	w0, [x22]
	bl	_read_reg
	mov	w8, #20
	tst	w0, w8
	b.eq	LBB0_4
; %bb.2:
	ldr	w0, [x22]
	bl	_read_reg
	mov	x1, x0
	ldr	x2, [x21]
	mov	w8, #40
	madd	x23, x27, x8, x26
	ldr	x3, [x23, #8]!
	ldr	w4, [x19, #8]
Lloh6:
	adrp	x0, l_.str.1@PAGE
Lloh7:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_IVTV_DEBUG_WARN
	ldr	w0, [x22]
	bl	_read_reg
	and	w0, w0, #0x3
	ldr	w1, [x22]
	bl	_write_reg
	ldr	w9, [x19, #8]
	cmp	w9, #3
	b.ne	LBB0_5
; %bb.3:
	str	wzr, [x19, #8]
	ldr	x8, [x23]
	str	x8, [x21]
	b	LBB0_6
LBB0_4:
	ldr	x8, [x21]
	b	LBB0_6
LBB0_5:
	mov	x8, #0
	str	xzr, [x21]
	add	w9, w9, #1
	str	w9, [x19, #8]
LBB0_6:
	mov	w9, #40
	madd	x9, x27, x9, x26
	ldr	x9, [x9, #8]
	cmp	x8, x9
	b.ge	LBB0_8
; %bb.7:
	mov	x0, x21
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	b	_ivtv_dma_dec_start_xfer
LBB0_8:
	mov	w8, #40
	madd	x22, x27, x8, x26
	ldr	w2, [x22, #32]!
Lloh8:
	adrp	x8, _IVTV_DEC_STREAM_TYPE_YUV@GOTPAGE
Lloh9:
	ldr	x8, [x8, _IVTV_DEC_STREAM_TYPE_YUV@GOTPAGEOFF]
	ldur	x9, [x22, #-16]
Lloh10:
	ldr	x8, [x8]
	cmp	x9, x8
	cset	w8, eq
	lsl	w23, w8, #1
	ldr	w1, [x22, #4]
Lloh11:
	adrp	x0, l_.str.2@PAGE
Lloh12:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_IVTV_DEBUG_HI_DMA
Lloh13:
	adrp	x8, _CX2341X_DEC_SCHED_DMA_FROM_HOST@GOTPAGE
Lloh14:
	ldr	x8, [x8, _CX2341X_DEC_SCHED_DMA_FROM_HOST@GOTPAGEOFF]
Lloh15:
	ldr	w1, [x8]
	ldr	w4, [x22]
	mov	x0, x19
	mov	w2, #3
	mov	w3, #0
	mov	x5, x23
	bl	_ivtv_vapi
	mov	x0, x21
	mov	x1, x22
	bl	_ivtv_dequeue
	cbz	x0, LBB0_11
; %bb.9:
	mov	x24, x0
	mov	w8, #40
	madd	x8, x27, x8, x26
	add	x23, x8, #28
LBB0_10:                                ; =>This Inner Loop Header: Depth=1
	mov	x0, x21
	mov	x1, x24
	bl	_ivtv_buf_sync_for_cpu
	mov	x0, x21
	mov	x1, x24
	mov	x2, x23
	bl	_ivtv_enqueue
	mov	x0, x21
	mov	x1, x22
	bl	_ivtv_dequeue
	mov	x24, x0
	cbnz	x0, LBB0_10
LBB0_11:
	mov	w8, #40
	madd	x8, x27, x8, x26
	add	x0, x8, #24
	bl	_wake_up
LBB0_12:
	ldr	w0, [x25]
	mov	x1, x20
	bl	_clear_bit
Lloh16:
	adrp	x8, _IVTV_F_I_DMA@GOTPAGE
Lloh17:
	ldr	x8, [x8, _IVTV_F_I_DMA@GOTPAGEOFF]
Lloh18:
	ldr	w0, [x8]
	mov	x1, x20
	bl	_clear_bit
	mov	x8, #-1
	str	x8, [x19], #12
	mov	x0, x19
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	b	_wake_up
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"DEC DMA READ\n"

	.comm	_IVTV_F_I_UDMA,4,2              ; @IVTV_F_I_UDMA
	.comm	_IVTV_REG_DMASTATUS,4,2         ; @IVTV_REG_DMASTATUS
l_.str.1:                               ; @.str.1
	.asciz	"DEC DMA ERROR %x (xfer %d of %d, retry %d)\n"

	.comm	_IVTV_DEC_STREAM_TYPE_YUV,8,3   ; @IVTV_DEC_STREAM_TYPE_YUV
l_.str.2:                               ; @.str.2
	.asciz	"DEC DATA READ %s: %d\n"

	.comm	_CX2341X_DEC_SCHED_DMA_FROM_HOST,4,2 ; @CX2341X_DEC_SCHED_DMA_FROM_HOST
	.comm	_IVTV_F_I_DMA,4,2               ; @IVTV_F_I_DMA
	.no_dead_strip	_ivtv_irq_dma_read
.subsections_via_symbols
