	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ivtv_yuv_close                 ## -- Begin function ivtv_yuv_close
	.p2align	4, 0x90
_ivtv_yuv_close:                        ## @ivtv_yuv_close
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %rbx
	leaq	L_.str(%rip), %rdi
	callq	_IVTV_DEBUG_YUV
	leaq	8(%rbx), %r14
	movq	%r14, %rdi
	callq	_mutex_unlock
	leaq	12(%rbx), %rdi
	callq	_ivtv_waitq
	movq	%r14, %rdi
	callq	_mutex_lock
	movq	$0, 224(%rbx)
	leaq	220(%rbx), %rdi
	movl	$-1, %esi
	callq	_atomic_set
	leaq	216(%rbx), %rdi
	xorl	%r14d, %r14d
	xorl	%esi, %esi
	callq	_atomic_set
	movl	$16777216, %edi                 ## imm = 0x1000000
	orl	16(%rbx), %edi
	movl	$10392, %esi                    ## imm = 0x2898
	callq	_write_reg
	movl	20(%rbx), %edi
	movl	$10292, %esi                    ## imm = 0x2834
	callq	_write_reg
	movl	24(%rbx), %edi
	movl	$10296, %esi                    ## imm = 0x2838
	callq	_write_reg
	movl	28(%rbx), %edi
	movl	$10300, %esi                    ## imm = 0x283C
	callq	_write_reg
	movl	32(%rbx), %edi
	movl	$10304, %esi                    ## imm = 0x2840
	callq	_write_reg
	movl	36(%rbx), %edi
	movl	$10308, %esi                    ## imm = 0x2844
	callq	_write_reg
	movl	40(%rbx), %edi
	movl	$10312, %esi                    ## imm = 0x2848
	callq	_write_reg
	movl	44(%rbx), %edi
	movl	$10324, %esi                    ## imm = 0x2854
	callq	_write_reg
	movl	48(%rbx), %edi
	movl	$10332, %esi                    ## imm = 0x285C
	callq	_write_reg
	movl	52(%rbx), %edi
	movl	$10340, %esi                    ## imm = 0x2864
	callq	_write_reg
	movl	56(%rbx), %edi
	movl	$10352, %esi                    ## imm = 0x2870
	callq	_write_reg
	movl	60(%rbx), %edi
	movl	$10356, %esi                    ## imm = 0x2874
	callq	_write_reg
	movl	64(%rbx), %edi
	movl	$10384, %esi                    ## imm = 0x2890
	callq	_write_reg
	movl	68(%rbx), %edi
	movl	$10396, %esi                    ## imm = 0x289C
	callq	_write_reg
	movl	72(%rbx), %edi
	movl	$10520, %esi                    ## imm = 0x2918
	callq	_write_reg
	movl	76(%rbx), %edi
	movl	$10524, %esi                    ## imm = 0x291C
	callq	_write_reg
	movl	80(%rbx), %edi
	movl	$10528, %esi                    ## imm = 0x2920
	callq	_write_reg
	movl	84(%rbx), %edi
	movl	$10532, %esi                    ## imm = 0x2924
	callq	_write_reg
	movl	88(%rbx), %edi
	movl	$10536, %esi                    ## imm = 0x2928
	callq	_write_reg
	movl	92(%rbx), %edi
	movl	$10540, %esi                    ## imm = 0x292C
	callq	_write_reg
	movl	96(%rbx), %edi
	movl	$10544, %esi                    ## imm = 0x2930
	callq	_write_reg
	movl	100(%rbx), %edi
	movl	$10548, %esi                    ## imm = 0x2934
	callq	_write_reg
	movl	104(%rbx), %edi
	movl	$10552, %esi                    ## imm = 0x2938
	callq	_write_reg
	movl	108(%rbx), %edi
	movl	$10556, %esi                    ## imm = 0x293C
	callq	_write_reg
	movl	112(%rbx), %edi
	movl	$10560, %esi                    ## imm = 0x2940
	callq	_write_reg
	movl	116(%rbx), %edi
	movl	$10564, %esi                    ## imm = 0x2944
	callq	_write_reg
	movl	120(%rbx), %edi
	movl	$10568, %esi                    ## imm = 0x2948
	callq	_write_reg
	movl	124(%rbx), %edi
	movl	$10572, %esi                    ## imm = 0x294C
	callq	_write_reg
	movl	128(%rbx), %edi
	movl	$10576, %esi                    ## imm = 0x2950
	callq	_write_reg
	movl	132(%rbx), %edi
	movl	$10580, %esi                    ## imm = 0x2954
	callq	_write_reg
	movl	136(%rbx), %edi
	movl	$10584, %esi                    ## imm = 0x2958
	callq	_write_reg
	movl	140(%rbx), %edi
	movl	$10588, %esi                    ## imm = 0x295C
	callq	_write_reg
	movl	144(%rbx), %edi
	movl	$10592, %esi                    ## imm = 0x2960
	callq	_write_reg
	movl	148(%rbx), %edi
	movl	$10596, %esi                    ## imm = 0x2964
	callq	_write_reg
	movl	152(%rbx), %edi
	movl	$10600, %esi                    ## imm = 0x2968
	callq	_write_reg
	movl	156(%rbx), %edi
	movl	$10604, %esi                    ## imm = 0x296C
	callq	_write_reg
	movl	160(%rbx), %edi
	movl	$10608, %esi                    ## imm = 0x2970
	callq	_write_reg
	movl	20(%rbx), %eax
	movzwl	%ax, %edx
	movl	%eax, %ecx
	sarl	$16, %ecx
	movl	$0, %esi
	cmpl	%ecx, %edx
	je	LBB0_2
## %bb.1:
	shll	$16, %eax
	cltd
	idivl	%ecx
	movl	%eax, %esi
	sarl	$16, %esi
	btl	$15, %eax
	adcl	$0, %esi
	cmpl	$1, %esi
	adcl	$0, %esi
LBB0_2:
	movl	72(%rbx), %eax
	movzwl	%ax, %edx
	movl	%eax, %edi
	sarl	$16, %edi
	movl	$1, %ecx
	cmpl	%edi, %edx
	je	LBB0_4
## %bb.3:
	shll	$16, %eax
	cltd
	idivl	%edi
	movl	%eax, %r14d
	sarl	$16, %r14d
	btl	$15, %eax
	adcl	$0, %r14d
	cmpl	$1, %r14d
	adcl	$0, %r14d
	movl	%r14d, %ecx
LBB0_4:
	movq	%rbx, %rdi
	movl	%r14d, %edx
	callq	_ivtv_yuv_filter
	xorl	%edi, %edi
	movl	$10260, %esi                    ## imm = 0x2814
	callq	_write_reg
	xorl	%edi, %edi
	movl	$10284, %esi                    ## imm = 0x282C
	callq	_write_reg
	xorl	%edi, %edi
	movl	$10500, %esi                    ## imm = 0x2904
	callq	_write_reg
	xorl	%edi, %edi
	movl	$10512, %esi                    ## imm = 0x2910
	callq	_write_reg
	movq	208(%rbx), %rdi
	testq	%rdi, %rdi
	je	LBB0_6
## %bb.5:
	callq	_kfree
	movq	$0, 208(%rbx)
	movl	4(%rbx), %edi
	movl	200(%rbx), %esi
	movq	_PCI_DMA_TODEVICE@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movl	$11520, %edx                    ## imm = 0x2D00
	callq	_pci_unmap_single
LBB0_6:
	xorps	%xmm0, %xmm0
	movups	%xmm0, 184(%rbx)
	movups	%xmm0, 168(%rbx)
	movq	_IVTV_F_I_DECODING_YUV@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%rbx, %rsi
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmp	_clear_bit                      ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"ivtv_yuv_close\n"

	.comm	_PCI_DMA_TODEVICE,4,2           ## @PCI_DMA_TODEVICE
	.comm	_IVTV_F_I_DECODING_YUV,4,2      ## @IVTV_F_I_DECODING_YUV
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ivtv_yuv_close                 ; -- Begin function ivtv_yuv_close
	.p2align	2
_ivtv_yuv_close:                        ; @ivtv_yuv_close
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x0
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_IVTV_DEBUG_YUV
	add	x20, x19, #8
	mov	x0, x20
	bl	_mutex_unlock
	add	x0, x19, #12
	bl	_ivtv_waitq
	mov	x0, x20
	bl	_mutex_lock
	str	xzr, [x19, #224]
	add	x0, x19, #220
	mov	w1, #-1
	bl	_atomic_set
	add	x0, x19, #216
	mov	w1, #0
	bl	_atomic_set
	ldr	w8, [x19, #16]
	orr	w0, w8, #0x1000000
	mov	w1, #10392
	bl	_write_reg
	ldr	w0, [x19, #20]
	mov	w1, #10292
	bl	_write_reg
	ldr	w0, [x19, #24]
	mov	w1, #10296
	bl	_write_reg
	ldr	w0, [x19, #28]
	mov	w1, #10300
	bl	_write_reg
	ldr	w0, [x19, #32]
	mov	w1, #10304
	bl	_write_reg
	ldr	w0, [x19, #36]
	mov	w1, #10308
	bl	_write_reg
	ldr	w0, [x19, #40]
	mov	w1, #10312
	bl	_write_reg
	ldr	w0, [x19, #44]
	mov	w1, #10324
	bl	_write_reg
	ldr	w0, [x19, #48]
	mov	w1, #10332
	bl	_write_reg
	ldr	w0, [x19, #52]
	mov	w1, #10340
	bl	_write_reg
	ldr	w0, [x19, #56]
	mov	w1, #10352
	bl	_write_reg
	ldr	w0, [x19, #60]
	mov	w1, #10356
	bl	_write_reg
	ldr	w0, [x19, #64]
	mov	w1, #10384
	bl	_write_reg
	ldr	w0, [x19, #68]
	mov	w1, #10396
	bl	_write_reg
	ldr	w0, [x19, #72]
	mov	w1, #10520
	bl	_write_reg
	ldr	w0, [x19, #76]
	mov	w1, #10524
	bl	_write_reg
	ldr	w0, [x19, #80]
	mov	w1, #10528
	bl	_write_reg
	ldr	w0, [x19, #84]
	mov	w1, #10532
	bl	_write_reg
	ldr	w0, [x19, #88]
	mov	w1, #10536
	bl	_write_reg
	ldr	w0, [x19, #92]
	mov	w1, #10540
	bl	_write_reg
	ldr	w0, [x19, #96]
	mov	w1, #10544
	bl	_write_reg
	ldr	w0, [x19, #100]
	mov	w1, #10548
	bl	_write_reg
	ldr	w0, [x19, #104]
	mov	w1, #10552
	bl	_write_reg
	ldr	w0, [x19, #108]
	mov	w1, #10556
	bl	_write_reg
	ldr	w0, [x19, #112]
	mov	w1, #10560
	bl	_write_reg
	ldr	w0, [x19, #116]
	mov	w1, #10564
	bl	_write_reg
	ldr	w0, [x19, #120]
	mov	w1, #10568
	bl	_write_reg
	ldr	w0, [x19, #124]
	mov	w1, #10572
	bl	_write_reg
	ldr	w0, [x19, #128]
	mov	w1, #10576
	bl	_write_reg
	ldr	w0, [x19, #132]
	mov	w1, #10580
	bl	_write_reg
	ldr	w0, [x19, #136]
	mov	w1, #10584
	bl	_write_reg
	ldr	w0, [x19, #140]
	mov	w1, #10588
	bl	_write_reg
	ldr	w0, [x19, #144]
	mov	w1, #10592
	bl	_write_reg
	ldr	w0, [x19, #148]
	mov	w1, #10596
	bl	_write_reg
	ldr	w0, [x19, #152]
	mov	w1, #10600
	bl	_write_reg
	ldr	w0, [x19, #156]
	mov	w1, #10604
	bl	_write_reg
	ldr	w0, [x19, #160]
	mov	w1, #10608
	bl	_write_reg
	mov	w1, #0
	ldr	w8, [x19, #20]
	asr	w9, w8, #16
	cmp	w9, w8, uxth
	b.eq	LBB0_2
; %bb.1:
	lsl	w8, w8, #16
	sdiv	w8, w8, w9
	ubfx	w9, w8, #15, #1
	add	w8, w9, w8, asr #16
	cmp	w8, #0
	cinc	w1, w8, eq
LBB0_2:
	ldr	w8, [x19, #72]
	asr	w9, w8, #16
	cmp	w9, w8, uxth
	b.ne	LBB0_4
; %bb.3:
	mov	w2, #0
	mov	w3, #1
	b	LBB0_5
LBB0_4:
	lsl	w8, w8, #16
	sdiv	w8, w8, w9
	ubfx	w9, w8, #15, #1
	add	w8, w9, w8, asr #16
	cmp	w8, #0
	cinc	w2, w8, eq
	mov	x3, x2
LBB0_5:
	mov	x0, x19
	bl	_ivtv_yuv_filter
	mov	w0, #0
	mov	w1, #10260
	bl	_write_reg
	mov	w0, #0
	mov	w1, #10284
	bl	_write_reg
	mov	w0, #0
	mov	w1, #10500
	bl	_write_reg
	mov	w0, #0
	mov	w1, #10512
	bl	_write_reg
	ldr	x0, [x19, #208]
	cbz	x0, LBB0_7
; %bb.6:
	bl	_kfree
	str	xzr, [x19, #208]
	ldr	w0, [x19, #4]
	ldr	w1, [x19, #200]
Lloh2:
	adrp	x8, _PCI_DMA_TODEVICE@GOTPAGE
Lloh3:
	ldr	x8, [x8, _PCI_DMA_TODEVICE@GOTPAGEOFF]
Lloh4:
	ldr	w3, [x8]
	mov	w2, #11520
	bl	_pci_unmap_single
LBB0_7:
	movi.2d	v0, #0000000000000000
	stur	q0, [x19, #184]
	stur	q0, [x19, #168]
Lloh5:
	adrp	x8, _IVTV_F_I_DECODING_YUV@GOTPAGE
Lloh6:
	ldr	x8, [x8, _IVTV_F_I_DECODING_YUV@GOTPAGEOFF]
Lloh7:
	ldr	w0, [x8]
	mov	x1, x19
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_clear_bit
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"ivtv_yuv_close\n"

	.comm	_PCI_DMA_TODEVICE,4,2           ; @PCI_DMA_TODEVICE
	.comm	_IVTV_F_I_DECODING_YUV,4,2      ; @IVTV_F_I_DECODING_YUV
.subsections_via_symbols
