	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ivtv_irq_enc_dma_complete
_ivtv_irq_enc_dma_complete:             ## @ivtv_irq_enc_dma_complete
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r15
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	_CX2341X_MBOX_MAX_DATA@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	shlq	$2, %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %rbx
	leaq	32(%r15), %rdi
	movq	_IVTV_MBOX_DMA_END@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$2, %edx
	movq	%rbx, %rcx
	callq	_ivtv_api_get_data
	movl	(%rbx), %esi
	movl	4(%rbx), %edx
	movq	(%r15), %rcx
	leaq	L_.str(%rip), %rdi
	callq	_IVTV_DEBUG_HI_IRQ
	leaq	28(%r15), %rdi
	callq	_del_timer
	movq	(%r15), %rax
	movq	16(%r15), %r12
	leaq	(%rax,%rax,2), %r13
	leaq	(%r12,%r13,8), %r14
	movq	%r14, %rdi
	callq	_ivtv_stream_sync_for_cpu
	movl	(%rbx), %esi
	testb	$24, %sil
	je	LBB0_1
## %bb.2:
	movl	20(%r12,%r13,8), %edx
	movq	(%r14), %rcx
	movq	8(%r12,%r13,8), %r8
	movl	8(%r15), %r9d
	leaq	L_.str.1(%rip), %rdi
	callq	_IVTV_DEBUG_WARN
	movq	_IVTV_REG_DMASTATUS@GOTPCREL(%rip), %rbx
	movl	(%rbx), %edi
	callq	_read_reg
	andl	$3, %eax
	movl	(%rbx), %esi
	movl	%eax, %edi
	callq	_write_reg
	movl	8(%r15), %eax
	cmpl	$3, %eax
	jne	LBB0_4
## %bb.3:
	leaq	(%r12,%r13,8), %rax
	addq	$8, %rax
	movl	$0, 8(%r15)
	movq	(%rax), %rax
	movq	%rax, (%r14)
	cmpq	8(%r12,%r13,8), %rax
	jl	LBB0_6
	jmp	LBB0_7
LBB0_1:
	movq	(%r14), %rax
	cmpq	8(%r12,%r13,8), %rax
	jge	LBB0_7
LBB0_6:
	movq	%r14, %rdi
	callq	_ivtv_dma_enc_start_xfer
	jmp	LBB0_10
LBB0_4:
	movq	$0, (%r14)
	incl	%eax
	movl	%eax, 8(%r15)
	xorl	%eax, %eax
	cmpq	8(%r12,%r13,8), %rax
	jl	LBB0_6
LBB0_7:
	movq	_IVTV_F_I_DMA@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	24(%r15), %rsi
	callq	_clear_bit
	movq	$-1, (%r15)
	movq	%r14, %rdi
	callq	_dma_post
	movq	_IVTV_F_S_DMA_HAS_VBI@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	(%r12,%r13,8), %rsi
	addq	$16, %rsi
	callq	_test_and_clear_bit
	testq	%rax, %rax
	je	LBB0_9
## %bb.8:
	movq	_IVTV_ENC_STREAM_TYPE_VBI@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	leaq	(%rax,%rax,2), %r14
	shlq	$3, %r14
	addq	16(%r15), %r14
	movq	%r14, %rdi
	callq	_dma_post
LBB0_9:
	addq	$12, %r15
	xorps	%xmm0, %xmm0
	movups	%xmm0, (%r14)
	movq	%r15, %rdi
	callq	_wake_up
LBB0_10:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_12
## %bb.11:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_12:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_CX2341X_MBOX_MAX_DATA,4,2      ## @CX2341X_MBOX_MAX_DATA
	.comm	_IVTV_MBOX_DMA_END,4,2          ## @IVTV_MBOX_DMA_END
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"ENC DMA COMPLETE %x %d (%d)\n"

L_.str.1:                               ## @.str.1
	.asciz	"ENC DMA ERROR %x (offset %08x, xfer %d of %d, retry %d)\n"

	.comm	_IVTV_REG_DMASTATUS,4,2         ## @IVTV_REG_DMASTATUS
	.comm	_IVTV_F_I_DMA,4,2               ## @IVTV_F_I_DMA
	.comm	_IVTV_F_S_DMA_HAS_VBI,4,2       ## @IVTV_F_S_DMA_HAS_VBI
	.comm	_IVTV_ENC_STREAM_TYPE_VBI,8,3   ## @IVTV_ENC_STREAM_TYPE_VBI
	.no_dead_strip	_ivtv_irq_enc_dma_complete
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ivtv_irq_enc_dma_complete
_ivtv_irq_enc_dma_complete:             ; @ivtv_irq_enc_dma_complete
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	sub	sp, sp, #16
	mov	x19, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-56]
Lloh3:
	adrp	x8, _CX2341X_MBOX_MAX_DATA@GOTPAGE
Lloh4:
	ldr	x8, [x8, _CX2341X_MBOX_MAX_DATA@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	lsl	x8, x8, #2
	mov	x9, x8
Lloh6:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh7:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x9, sp
	add	x8, x8, #15
	and	x8, x8, #0x7fffffff0
	sub	x21, x9, x8
	mov	sp, x21
	add	x0, x0, #32
Lloh8:
	adrp	x8, _IVTV_MBOX_DMA_END@GOTPAGE
Lloh9:
	ldr	x8, [x8, _IVTV_MBOX_DMA_END@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
	mov	w2, #2
	mov	x3, x21
	bl	_ivtv_api_get_data
	ldp	w1, w2, [x21]
	ldr	x3, [x19]
Lloh11:
	adrp	x0, l_.str@PAGE
Lloh12:
	add	x0, x0, l_.str@PAGEOFF
	bl	_IVTV_DEBUG_HI_IRQ
	add	x0, x19, #28
	bl	_del_timer
	ldr	x22, [x19]
	ldr	x23, [x19, #16]
	mov	w8, #24
	madd	x20, x22, x8, x23
	mov	x0, x20
	bl	_ivtv_stream_sync_for_cpu
	ldr	w1, [x21]
	tst	w1, #0x18
	b.eq	LBB0_3
; %bb.1:
	mov	w8, #24
	madd	x21, x22, x8, x23
	ldr	x4, [x21, #8]!
	ldr	w2, [x21, #12]
	ldr	x3, [x20]
	ldr	w5, [x19, #8]
Lloh13:
	adrp	x0, l_.str.1@PAGE
Lloh14:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_IVTV_DEBUG_WARN
Lloh15:
	adrp	x24, _IVTV_REG_DMASTATUS@GOTPAGE
Lloh16:
	ldr	x24, [x24, _IVTV_REG_DMASTATUS@GOTPAGEOFF]
	ldr	w0, [x24]
	bl	_read_reg
	and	w0, w0, #0x3
	ldr	w1, [x24]
	bl	_write_reg
	ldr	w9, [x19, #8]
	cmp	w9, #3
	b.ne	LBB0_4
; %bb.2:
	str	wzr, [x19, #8]
	ldr	x8, [x21]
	str	x8, [x20]
	b	LBB0_5
LBB0_3:
	ldr	x8, [x20]
	b	LBB0_5
LBB0_4:
	mov	x8, #0
	str	xzr, [x20]
	add	w9, w9, #1
	str	w9, [x19, #8]
LBB0_5:
	mov	w9, #24
	madd	x9, x22, x9, x23
	ldr	x9, [x9, #8]
	cmp	x8, x9
	b.ge	LBB0_7
; %bb.6:
	mov	x0, x20
	bl	_ivtv_dma_enc_start_xfer
	b	LBB0_10
LBB0_7:
Lloh17:
	adrp	x8, _IVTV_F_I_DMA@GOTPAGE
Lloh18:
	ldr	x8, [x8, _IVTV_F_I_DMA@GOTPAGEOFF]
Lloh19:
	ldr	w0, [x8]
	add	x1, x19, #24
	bl	_clear_bit
	mov	x8, #-1
	str	x8, [x19]
	mov	x0, x20
	bl	_dma_post
Lloh20:
	adrp	x8, _IVTV_F_S_DMA_HAS_VBI@GOTPAGE
Lloh21:
	ldr	x8, [x8, _IVTV_F_S_DMA_HAS_VBI@GOTPAGEOFF]
Lloh22:
	ldr	w0, [x8]
	mov	w8, #24
	madd	x8, x22, x8, x23
	add	x1, x8, #16
	bl	_test_and_clear_bit
	cbz	x0, LBB0_9
; %bb.8:
	ldr	x8, [x19, #16]
Lloh23:
	adrp	x9, _IVTV_ENC_STREAM_TYPE_VBI@GOTPAGE
Lloh24:
	ldr	x9, [x9, _IVTV_ENC_STREAM_TYPE_VBI@GOTPAGEOFF]
Lloh25:
	ldr	x9, [x9]
	mov	w10, #24
	madd	x20, x9, x10, x8
	mov	x0, x20
	bl	_dma_post
LBB0_9:
	add	x0, x19, #12
	stp	xzr, xzr, [x20]
	bl	_wake_up
LBB0_10:
	ldur	x8, [x29, #-56]
Lloh26:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh27:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh28:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_12
; %bb.11:
	sub	sp, x29, #48
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_12:
	bl	___stack_chk_fail
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.cfi_endproc
                                        ; -- End function
	.comm	_CX2341X_MBOX_MAX_DATA,4,2      ; @CX2341X_MBOX_MAX_DATA
	.comm	_IVTV_MBOX_DMA_END,4,2          ; @IVTV_MBOX_DMA_END
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"ENC DMA COMPLETE %x %d (%d)\n"

l_.str.1:                               ; @.str.1
	.asciz	"ENC DMA ERROR %x (offset %08x, xfer %d of %d, retry %d)\n"

	.comm	_IVTV_REG_DMASTATUS,4,2         ; @IVTV_REG_DMASTATUS
	.comm	_IVTV_F_I_DMA,4,2               ; @IVTV_F_I_DMA
	.comm	_IVTV_F_S_DMA_HAS_VBI,4,2       ; @IVTV_F_S_DMA_HAS_VBI
	.comm	_IVTV_ENC_STREAM_TYPE_VBI,8,3   ; @IVTV_ENC_STREAM_TYPE_VBI
	.no_dead_strip	_ivtv_irq_enc_dma_complete
.subsections_via_symbols
