	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ivtv_irq_enc_pio_complete
_ivtv_irq_enc_pio_complete:             ## @ivtv_irq_enc_pio_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, %r12
	movl	(%rdi), %ebx
	testl	%ebx, %ebx
	js	LBB0_9
## %bb.1:
	movq	_IVTV_MAX_STREAMS@GOTPCREL(%rip), %rax
	cmpl	(%rax), %ebx
	jge	LBB0_9
## %bb.2:
	movq	8(%r12), %r13
	shlq	$4, %rbx
	leaq	(%rbx,%r13), %r15
	movl	12(%r13,%rbx), %esi
	leaq	L_.str(%rip), %rdi
	callq	_IVTV_DEBUG_HI_IRQ
	movq	_IVTV_F_I_PIO@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	16(%r12), %r14
	movq	%r14, %rsi
	callq	_clear_bit
	movl	$-1, (%r12)
	movq	%r15, %rdi
	callq	_dma_post
	movq	(%r13,%rbx), %rax
	movq	_IVTV_ENC_STREAM_TYPE_MPG@GOTPCREL(%rip), %rcx
	xorl	%r9d, %r9d
	cmpq	(%rcx), %rax
	je	LBB0_5
## %bb.3:
	movq	_IVTV_ENC_STREAM_TYPE_YUV@GOTPCREL(%rip), %rcx
	movl	$1, %r9d
	cmpq	(%rcx), %rax
	je	LBB0_5
## %bb.4:
	movq	_IVTV_ENC_STREAM_TYPE_PCM@GOTPCREL(%rip), %rcx
	movl	$2, %r9d
	cmpq	(%rcx), %rax
	jne	LBB0_6
LBB0_5:
	movq	_CX2341X_ENC_SCHED_DMA_TO_HOST@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r12, %rdi
	movl	$3, %edx
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	callq	_ivtv_vapi
LBB0_6:
	movq	_IVTV_F_I_PIO@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%r14, %rsi
	callq	_clear_bit
	movq	_IVTV_F_S_DMA_HAS_VBI@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	(%rbx,%r13), %rsi
	addq	$8, %rsi
	callq	_test_and_clear_bit
	testq	%rax, %rax
	je	LBB0_8
## %bb.7:
	movq	_IVTV_ENC_STREAM_TYPE_VBI@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	shlq	$4, %rdi
	addq	8(%r12), %rdi
	callq	_dma_post
LBB0_8:
	addq	$4, %r12
	movq	%r12, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_wake_up                        ## TAILCALL
LBB0_9:
	movl	$-1, (%r12)
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_IVTV_MAX_STREAMS,4,2           ## @IVTV_MAX_STREAMS
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"ENC PIO COMPLETE %s\n"

	.comm	_IVTV_F_I_PIO,4,2               ## @IVTV_F_I_PIO
	.comm	_IVTV_ENC_STREAM_TYPE_MPG,8,3   ## @IVTV_ENC_STREAM_TYPE_MPG
	.comm	_CX2341X_ENC_SCHED_DMA_TO_HOST,4,2 ## @CX2341X_ENC_SCHED_DMA_TO_HOST
	.comm	_IVTV_ENC_STREAM_TYPE_YUV,8,3   ## @IVTV_ENC_STREAM_TYPE_YUV
	.comm	_IVTV_ENC_STREAM_TYPE_PCM,8,3   ## @IVTV_ENC_STREAM_TYPE_PCM
	.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_pio_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_pio_complete
_ivtv_irq_enc_pio_complete:             ; @ivtv_irq_enc_pio_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
	mov	x19, x0
	ldr	w22, [x0]
	tbnz	w22, #31, LBB0_4
; %bb.1:
Lloh0:
	adrp	x8, _IVTV_MAX_STREAMS@GOTPAGE
Lloh1:
	ldr	x8, [x8, _IVTV_MAX_STREAMS@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w22, w8
	b.ge	LBB0_4
; %bb.2:
	ldr	x23, [x19, #8]
	add	x21, x23, x22, lsl #4
	ldr	w1, [x21, #12]
Lloh3:
	adrp	x0, l_.str@PAGE
Lloh4:
	add	x0, x0, l_.str@PAGEOFF
	bl	_IVTV_DEBUG_HI_IRQ
Lloh5:
	adrp	x24, _IVTV_F_I_PIO@GOTPAGE
Lloh6:
	ldr	x24, [x24, _IVTV_F_I_PIO@GOTPAGEOFF]
	ldr	w0, [x24]
	add	x20, x19, #16
	mov	x1, x20
	bl	_clear_bit
	mov	w8, #-1
	str	w8, [x19]
	mov	x0, x21
	bl	_dma_post
	ldr	x8, [x21]
Lloh7:
	adrp	x9, _IVTV_ENC_STREAM_TYPE_MPG@GOTPAGE
Lloh8:
	ldr	x9, [x9, _IVTV_ENC_STREAM_TYPE_MPG@GOTPAGEOFF]
Lloh9:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_5
; %bb.3:
	mov	w5, #0
	b	LBB0_9
LBB0_4:
	mov	w8, #-1
	str	w8, [x19]
	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_5:
Lloh10:
	adrp	x9, _IVTV_ENC_STREAM_TYPE_YUV@GOTPAGE
Lloh11:
	ldr	x9, [x9, _IVTV_ENC_STREAM_TYPE_YUV@GOTPAGEOFF]
Lloh12:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_7
; %bb.6:
	mov	w5, #1
	b	LBB0_9
LBB0_7:
Lloh13:
	adrp	x9, _IVTV_ENC_STREAM_TYPE_PCM@GOTPAGE
Lloh14:
	ldr	x9, [x9, _IVTV_ENC_STREAM_TYPE_PCM@GOTPAGEOFF]
Lloh15:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_10
; %bb.8:
	mov	w5, #2
LBB0_9:
Lloh16:
	adrp	x8, _CX2341X_ENC_SCHED_DMA_TO_HOST@GOTPAGE
Lloh17:
	ldr	x8, [x8, _CX2341X_ENC_SCHED_DMA_TO_HOST@GOTPAGEOFF]
Lloh18:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #3
	mov	w3, #0
	mov	w4, #0
	bl	_ivtv_vapi
LBB0_10:
	ldr	w0, [x24]
	mov	x1, x20
	bl	_clear_bit
Lloh19:
	adrp	x8, _IVTV_F_S_DMA_HAS_VBI@GOTPAGE
Lloh20:
	ldr	x8, [x8, _IVTV_F_S_DMA_HAS_VBI@GOTPAGEOFF]
Lloh21:
	ldr	w0, [x8]
	add	x8, x23, x22, lsl #4
	add	x1, x8, #8
	bl	_test_and_clear_bit
	cbz	x0, LBB0_12
; %bb.11:
	ldr	x8, [x19, #8]
Lloh22:
	adrp	x9, _IVTV_ENC_STREAM_TYPE_VBI@GOTPAGE
Lloh23:
	ldr	x9, [x9, _IVTV_ENC_STREAM_TYPE_VBI@GOTPAGEOFF]
Lloh24:
	ldr	x9, [x9]
	add	x0, x8, x9, lsl #4
	bl	_dma_post
LBB0_12:
	add	x0, x19, #4
	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
	b	_wake_up
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.cfi_endproc
                                        ; -- End function
	.comm	_IVTV_MAX_STREAMS,4,2           ; @IVTV_MAX_STREAMS
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"ENC PIO COMPLETE %s\n"

	.comm	_IVTV_F_I_PIO,4,2               ; @IVTV_F_I_PIO
	.comm	_IVTV_ENC_STREAM_TYPE_MPG,8,3   ; @IVTV_ENC_STREAM_TYPE_MPG
	.comm	_CX2341X_ENC_SCHED_DMA_TO_HOST,4,2 ; @CX2341X_ENC_SCHED_DMA_TO_HOST
	.comm	_IVTV_ENC_STREAM_TYPE_YUV,8,3   ; @IVTV_ENC_STREAM_TYPE_YUV
	.comm	_IVTV_ENC_STREAM_TYPE_PCM,8,3   ; @IVTV_ENC_STREAM_TYPE_PCM
	.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_pio_complete
.subsections_via_symbols
