	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ivtv_dma_enc_start
_ivtv_dma_enc_start:                    ## @ivtv_dma_enc_start
	.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, %rbx
	movq	104(%rdi), %r12
	movq	32(%r12), %r13
	movq	_IVTV_ENC_STREAM_TYPE_VBI@GOTPCREL(%rip), %rax
	movq	(%rax), %r15
	callq	_ivtv_use_dma
	testq	%rax, %rax
	leaq	L_.str.2(%rip), %rax
	leaq	L_.str.1(%rip), %rsi
	cmoveq	%rax, %rsi
	movl	80(%rbx), %edx
	leaq	L_.str(%rip), %rdi
	xorl	%eax, %eax
	callq	_IVTV_DEBUG_HI_DMA
	movq	88(%rbx), %r8
	testq	%r8, %r8
	je	LBB0_2
## %bb.1:
	leaq	88(%rbx), %rsi
	leaq	96(%rbx), %rcx
	movq	%rbx, %rdi
	xorl	%edx, %edx
	callq	_ivtv_queue_move
LBB0_2:
	movq	%rbx, %rdi
	callq	_ivtv_use_dma
	testq	%rax, %rax
	je	LBB0_4
## %bb.3:
	movq	(%rbx), %rax
	movq	64(%rbx), %rcx
	addl	$256, -4(%rcx,%rax,4)           ## imm = 0x100
LBB0_4:
	movq	_IVTV_F_S_DMA_HAS_VBI@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	84(%rbx), %r14
	movq	%r14, %rsi
	callq	_clear_bit
	movq	8(%rbx), %rax
	movq	_IVTV_ENC_STREAM_TYPE_MPG@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_14
## %bb.5:
	movq	%r13, %rdx
	imulq	$112, %r15, %r13
	leaq	(%rdx,%r13), %r15
	movq	(%r15), %rax
	testq	%rax, %rax
	je	LBB0_14
## %bb.6:
	addq	(%rbx), %rax
	cmpq	16(%rbx), %rax
	ja	LBB0_14
## %bb.7:
	leaq	(%rdx,%r13), %rsi
	addq	$88, %rsi
	leaq	96(%rdx,%r13), %rcx
	movq	%rdx, -48(%rbp)                 ## 8-byte Spill
	movq	88(%rdx,%r13), %r8
	movq	%r15, %rdi
	xorl	%edx, %edx
	callq	_ivtv_queue_move
	movq	%r15, %rdi
	callq	_ivtv_use_dma
	testq	%rax, %rax
	je	LBB0_8
## %bb.9:
	movq	-48(%rbp), %r8                  ## 8-byte Reload
	movq	64(%r8,%r13), %rcx
	movq	(%r15), %rax
	addl	$256, -4(%rcx,%rax,4)           ## imm = 0x100
	jmp	LBB0_10
LBB0_8:
	movq	(%r15), %rax
	movq	-48(%rbp), %r8                  ## 8-byte Reload
LBB0_10:
	movq	_IVTV_F_S_DMA_HAS_VBI@GOTPCREL(%rip), %r9
	testq	%rax, %rax
	je	LBB0_13
## %bb.11:
	movq	64(%r8,%r13), %rax
	movq	(%rbx), %rcx
	leaq	1(%rcx), %rdx
	shlq	$2, %rcx
	addq	64(%rbx), %rcx
	xorl	%esi, %esi
	.p2align	4, 0x90
LBB0_12:                                ## =>This Inner Loop Header: Depth=1
	leaq	(%rdx,%rsi), %rdi
	movq	%rdi, (%rbx)
	movl	(%rax,%rsi,4), %edi
	movl	%edi, (%rcx,%rsi,4)
	incq	%rsi
	cmpq	%rsi, (%r15)
	ja	LBB0_12
LBB0_13:
	movl	44(%r8,%r13), %eax
	movl	%eax, 48(%r8,%r13)
	movq	$0, (%r15)
	incl	76(%r8,%r13)
	movl	(%r9), %edi
	movq	%r14, %rsi
	movq	%r8, %r14
	callq	_set_bit
	movslq	80(%r14,%r13), %rsi
	leaq	L_.str.3(%rip), %rdi
	xorl	%eax, %eax
	callq	_IVTV_DEBUG_HI_DMA
LBB0_14:
	incl	76(%rbx)
	movl	72(%rbx), %edi
	movq	64(%rbx), %rsi
	movl	(%rbx), %edx
	shll	$2, %edx
	callq	_memcpy
	movl	(%rbx), %eax
	movl	28(%rbx), %ecx
	movl	%eax, 24(%rbx)
	movq	$0, (%rbx)
	movq	$0, 56(%rbx)
	movl	44(%rbx), %eax
	movl	%eax, 48(%rbx)
	movl	36(%rbx), %eax
	movl	%eax, 40(%rbx)
	movl	%ecx, 32(%rbx)
	movq	%rbx, %rdi
	callq	_ivtv_use_pio
	testq	%rax, %rax
	je	LBB0_16
## %bb.15:
	movq	_IVTV_F_I_WORK_HANDLER_PIO@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	16(%r12), %r14
	movq	%r14, %rsi
	callq	_set_bit
	movq	_IVTV_F_I_HAVE_WORK@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%r14, %rsi
	callq	_set_bit
	movq	_IVTV_F_I_PIO@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%r14, %rsi
	callq	_set_bit
	movq	8(%rbx), %rax
	movq	%rax, (%r12)
	jmp	LBB0_17
LBB0_16:
	movq	$0, 24(%r12)
	movq	%rbx, %rdi
	callq	_ivtv_dma_enc_start_xfer
	movq	_IVTV_F_I_DMA@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	16(%r12), %rsi
	callq	_set_bit
	movq	8(%rbx), %rax
	movq	%rax, 8(%r12)
LBB0_17:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_IVTV_ENC_STREAM_TYPE_VBI,8,3   ## @IVTV_ENC_STREAM_TYPE_VBI
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"start %s for %s\n"

L_.str.1:                               ## @.str.1
	.asciz	"DMA"

L_.str.2:                               ## @.str.2
	.asciz	"PIO"

	.comm	_IVTV_F_S_DMA_HAS_VBI,4,2       ## @IVTV_F_S_DMA_HAS_VBI
	.comm	_IVTV_ENC_STREAM_TYPE_MPG,8,3   ## @IVTV_ENC_STREAM_TYPE_MPG
L_.str.3:                               ## @.str.3
	.asciz	"include DMA for %s\n"

	.comm	_IVTV_F_I_WORK_HANDLER_PIO,4,2  ## @IVTV_F_I_WORK_HANDLER_PIO
	.comm	_IVTV_F_I_HAVE_WORK,4,2         ## @IVTV_F_I_HAVE_WORK
	.comm	_IVTV_F_I_PIO,4,2               ## @IVTV_F_I_PIO
	.comm	_IVTV_F_I_DMA,4,2               ## @IVTV_F_I_DMA
	.no_dead_strip	_ivtv_dma_enc_start
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ivtv_dma_enc_start
_ivtv_dma_enc_start:                    ; @ivtv_dma_enc_start
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.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
	mov	x19, x0
	ldr	x22, [x0, #104]
	ldr	x23, [x22, #32]
Lloh0:
	adrp	x8, _IVTV_ENC_STREAM_TYPE_VBI@GOTPAGE
Lloh1:
	ldr	x8, [x8, _IVTV_ENC_STREAM_TYPE_VBI@GOTPAGEOFF]
Lloh2:
	ldr	x24, [x8]
	bl	_ivtv_use_dma
Lloh3:
	adrp	x8, l_.str.1@PAGE
Lloh4:
	add	x8, x8, l_.str.1@PAGEOFF
Lloh5:
	adrp	x9, l_.str.2@PAGE
Lloh6:
	add	x9, x9, l_.str.2@PAGEOFF
	cmp	x0, #0
	csel	x1, x9, x8, eq
	ldr	w8, [x19, #80]
	str	x8, [sp]
Lloh7:
	adrp	x0, l_.str@PAGE
Lloh8:
	add	x0, x0, l_.str@PAGEOFF
	bl	_IVTV_DEBUG_HI_DMA
	mov	x1, x19
	ldr	x4, [x1, #88]!
	cbz	x4, LBB0_2
; %bb.1:
	add	x3, x19, #96
	mov	x0, x19
	mov	x2, #0
	bl	_ivtv_queue_move
LBB0_2:
	mov	x0, x19
	bl	_ivtv_use_dma
	cbz	x0, LBB0_4
; %bb.3:
	ldr	x8, [x19, #64]
	ldr	x9, [x19]
	add	x8, x8, x9, lsl #2
	ldur	w9, [x8, #-4]
	add	w9, w9, #256
	stur	w9, [x8, #-4]
LBB0_4:
Lloh9:
	adrp	x25, _IVTV_F_S_DMA_HAS_VBI@GOTPAGE
Lloh10:
	ldr	x25, [x25, _IVTV_F_S_DMA_HAS_VBI@GOTPAGEOFF]
	ldr	w0, [x25]
	add	x20, x19, #84
	mov	x1, x20
	bl	_clear_bit
	ldr	x8, [x19, #8]
Lloh11:
	adrp	x9, _IVTV_ENC_STREAM_TYPE_MPG@GOTPAGE
Lloh12:
	ldr	x9, [x9, _IVTV_ENC_STREAM_TYPE_MPG@GOTPAGEOFF]
Lloh13:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_13
; %bb.5:
	mov	w8, #112
	madd	x21, x24, x8, x23
	ldr	x8, [x21]
	cbz	x8, LBB0_13
; %bb.6:
	ldr	x9, [x19]
	ldr	x10, [x19, #16]
	add	x8, x9, x8
	cmp	x8, x10
	b.hi	LBB0_13
; %bb.7:
	mov	w8, #112
	madd	x1, x24, x8, x23
	ldr	x4, [x1, #88]!
	add	x3, x1, #8
	mov	x0, x21
	mov	x2, #0
	bl	_ivtv_queue_move
	mov	x0, x21
	bl	_ivtv_use_dma
	cbz	x0, LBB0_9
; %bb.8:
	mov	w8, #112
	madd	x8, x24, x8, x23
	ldr	x9, [x8, #64]
	ldr	x8, [x21]
	add	x9, x9, x8, lsl #2
	ldur	w10, [x9, #-4]
	add	w10, w10, #256
	stur	w10, [x9, #-4]
	cbnz	x8, LBB0_10
	b	LBB0_12
LBB0_9:
	ldr	x8, [x21]
	cbz	x8, LBB0_12
LBB0_10:
	mov	x8, #0
	ldr	x11, [x19, #64]
	mov	w9, #112
	madd	x9, x24, x9, x23
	ldr	x9, [x9, #64]
	ldr	x12, [x19]
	add	x10, x12, #1
	add	x11, x11, x12, lsl #2
LBB0_11:                                ; =>This Inner Loop Header: Depth=1
	add	x12, x10, x8
	lsl	x13, x8, #2
	ldr	w14, [x9, x13]
	str	x12, [x19]
	str	w14, [x11, x13]
	add	x8, x8, #1
	ldr	x12, [x21]
	cmp	x12, x8
	b.hi	LBB0_11
LBB0_12:
	mov	w8, #112
	mul	x8, x24, x8
	add	x23, x23, x8
	ldr	w8, [x23, #44]
	str	w8, [x23, #48]
	str	xzr, [x21]
	ldr	w8, [x23, #76]
	add	w8, w8, #1
	str	w8, [x23, #76]
	ldr	w0, [x25]
	mov	x1, x20
	bl	_set_bit
	ldrsw	x1, [x23, #80]
Lloh14:
	adrp	x0, l_.str.3@PAGE
Lloh15:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_IVTV_DEBUG_HI_DMA
LBB0_13:
	ldp	w0, w8, [x19, #72]
	add	w8, w8, #1
	str	w8, [x19, #76]
	ldr	x1, [x19, #64]
	ldr	w8, [x19]
	lsl	w2, w8, #2
	bl	_memcpy
	ldr	x8, [x19]
	str	w8, [x19, #24]
	str	xzr, [x19]
	str	xzr, [x19, #56]
	ldr	w8, [x19, #44]
	str	w8, [x19, #48]
	ldr	w8, [x19, #36]
	str	w8, [x19, #40]
	ldr	w8, [x19, #28]
	str	w8, [x19, #32]
	mov	x0, x19
	bl	_ivtv_use_pio
	cbz	x0, LBB0_15
; %bb.14:
Lloh16:
	adrp	x8, _IVTV_F_I_WORK_HANDLER_PIO@GOTPAGE
Lloh17:
	ldr	x8, [x8, _IVTV_F_I_WORK_HANDLER_PIO@GOTPAGEOFF]
Lloh18:
	ldr	w0, [x8]
	add	x20, x22, #16
	mov	x1, x20
	bl	_set_bit
Lloh19:
	adrp	x8, _IVTV_F_I_HAVE_WORK@GOTPAGE
Lloh20:
	ldr	x8, [x8, _IVTV_F_I_HAVE_WORK@GOTPAGEOFF]
Lloh21:
	ldr	w0, [x8]
	mov	x1, x20
	bl	_set_bit
Lloh22:
	adrp	x8, _IVTV_F_I_PIO@GOTPAGE
Lloh23:
	ldr	x8, [x8, _IVTV_F_I_PIO@GOTPAGEOFF]
Lloh24:
	ldr	w0, [x8]
	mov	x1, x20
	bl	_set_bit
	ldr	x8, [x19, #8]
	str	x8, [x22]
	b	LBB0_16
LBB0_15:
	str	xzr, [x22, #24]
	mov	x0, x19
	bl	_ivtv_dma_enc_start_xfer
Lloh25:
	adrp	x8, _IVTV_F_I_DMA@GOTPAGE
Lloh26:
	ldr	x8, [x8, _IVTV_F_I_DMA@GOTPAGEOFF]
Lloh27:
	ldr	w0, [x8]
	add	x1, x22, #16
	bl	_set_bit
	ldr	x8, [x19, #8]
	str	x8, [x22, #8]
LBB0_16:
	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
	add	sp, sp, #96
	ret
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.cfi_endproc
                                        ; -- End function
	.comm	_IVTV_ENC_STREAM_TYPE_VBI,8,3   ; @IVTV_ENC_STREAM_TYPE_VBI
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"start %s for %s\n"

l_.str.1:                               ; @.str.1
	.asciz	"DMA"

l_.str.2:                               ; @.str.2
	.asciz	"PIO"

	.comm	_IVTV_F_S_DMA_HAS_VBI,4,2       ; @IVTV_F_S_DMA_HAS_VBI
	.comm	_IVTV_ENC_STREAM_TYPE_MPG,8,3   ; @IVTV_ENC_STREAM_TYPE_MPG
l_.str.3:                               ; @.str.3
	.asciz	"include DMA for %s\n"

	.comm	_IVTV_F_I_WORK_HANDLER_PIO,4,2  ; @IVTV_F_I_WORK_HANDLER_PIO
	.comm	_IVTV_F_I_HAVE_WORK,4,2         ; @IVTV_F_I_HAVE_WORK
	.comm	_IVTV_F_I_PIO,4,2               ; @IVTV_F_I_PIO
	.comm	_IVTV_F_I_DMA,4,2               ; @IVTV_F_I_DMA
	.no_dead_strip	_ivtv_dma_enc_start
.subsections_via_symbols
