	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cx18_remove
_cx18_remove:                           ## @cx18_remove
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	callq	_pci_get_drvdata
	movq	%rax, %r14
	movq	%rax, %rdi
	callq	_to_cx18
	movq	%rax, %r12
	leaq	L_.str(%rip), %rdi
	callq	_CX18_DEBUG_INFO
	movq	%r12, %rdi
	callq	_flush_request_modules
	leaq	L_.str.1(%rip), %rdi
	callq	_CX18_DEBUG_INFO
	leaq	32(%r12), %rdi
	callq	_atomic_read
	testq	%rax, %rax
	jle	LBB0_2
## %bb.1:
	movq	%r12, %rdi
	callq	_cx18_stop_all_captures
LBB0_2:
	movq	_IRQ_CPU_TO_EPU@GOTPCREL(%rip), %rax
	movq	_IRQ_APU_TO_EPU@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	orl	(%rax), %esi
	movq	%r12, %rdi
	callq	_cx18_sw1_irq_disable
	movq	%r12, %rdi
	callq	_cx18_cancel_in_work_orders
	movq	%r12, %rdi
	callq	_cx18_cancel_out_work_orders
	movq	_IRQ_CPU_TO_EPU_ACK@GOTPCREL(%rip), %rax
	movq	_IRQ_APU_TO_EPU_ACK@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	orl	(%rax), %esi
	movq	%r12, %rdi
	callq	_cx18_sw2_irq_disable
	movq	%r12, %rdi
	callq	_cx18_halt_firmware
	movl	28(%r12), %edi
	callq	_destroy_workqueue
	movq	%r12, %rdi
	movl	$1, %esi
	callq	_cx18_streams_cleanup
	movq	%r12, %rdi
	callq	_exit_cx18_i2c
	movq	16(%r12), %rax
	movl	(%rax), %edi
	movq	%r12, %rsi
	callq	_free_irq
	movq	%r12, %rdi
	callq	_cx18_iounmap
	movl	24(%r12), %edi
	movq	_CX18_MEM_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_release_mem_region
	movq	16(%r12), %rdi
	callq	_pci_disable_device
	movq	8(%r12), %rax
	movq	(%rax), %rdi
	testq	%rdi, %rdi
	je	LBB0_7
## %bb.3:
	movq	_CX18_VBI_FRAMES@GOTPCREL(%rip), %r15
	cmpl	$0, (%r15)
	jle	LBB0_7
## %bb.4:
	callq	_kfree
	cmpl	$2, (%r15)
	jl	LBB0_7
## %bb.5:
	movl	$1, %ebx
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movq	8(%r12), %rax
	movq	(%rax,%rbx,8), %rdi
	callq	_kfree
	incq	%rbx
	movslq	(%r15), %rax
	cmpq	%rax, %rbx
	jl	LBB0_6
LBB0_7:
	movq	%r12, %rdi
	addq	$4, %rdi
	callq	_v4l2_ctrl_handler_free
	movl	(%r12), %esi
	leaq	L_.str.2(%rip), %rdi
	callq	_CX18_INFO
	movq	%r14, %rdi
	callq	_v4l2_device_unregister
	movq	%r12, %rdi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_kfree                          ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Removing Card\n"

L_.str.1:                               ## @.str.1
	.asciz	"Stopping all streams\n"

	.comm	_IRQ_CPU_TO_EPU,4,2             ## @IRQ_CPU_TO_EPU
	.comm	_IRQ_APU_TO_EPU,4,2             ## @IRQ_APU_TO_EPU
	.comm	_IRQ_CPU_TO_EPU_ACK,4,2         ## @IRQ_CPU_TO_EPU_ACK
	.comm	_IRQ_APU_TO_EPU_ACK,4,2         ## @IRQ_APU_TO_EPU_ACK
	.comm	_CX18_MEM_SIZE,4,2              ## @CX18_MEM_SIZE
	.comm	_CX18_VBI_FRAMES,4,2            ## @CX18_VBI_FRAMES
L_.str.2:                               ## @.str.2
	.asciz	"Removed %s\n"

	.no_dead_strip	_cx18_remove
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function cx18_remove
_cx18_remove:                           ; @cx18_remove
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	bl	_pci_get_drvdata
	mov	x19, x0
	bl	_to_cx18
	mov	x20, x0
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_CX18_DEBUG_INFO
	mov	x0, x20
	bl	_flush_request_modules
Lloh2:
	adrp	x0, l_.str.1@PAGE
Lloh3:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_CX18_DEBUG_INFO
	add	x0, x20, #32
	bl	_atomic_read
	cmp	x0, #1
	b.lt	LBB0_2
; %bb.1:
	mov	x0, x20
	bl	_cx18_stop_all_captures
LBB0_2:
Lloh4:
	adrp	x8, _IRQ_CPU_TO_EPU@GOTPAGE
Lloh5:
	ldr	x8, [x8, _IRQ_CPU_TO_EPU@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
Lloh7:
	adrp	x9, _IRQ_APU_TO_EPU@GOTPAGE
Lloh8:
	ldr	x9, [x9, _IRQ_APU_TO_EPU@GOTPAGEOFF]
Lloh9:
	ldr	w9, [x9]
	orr	w1, w9, w8
	mov	x0, x20
	bl	_cx18_sw1_irq_disable
	mov	x0, x20
	bl	_cx18_cancel_in_work_orders
	mov	x0, x20
	bl	_cx18_cancel_out_work_orders
Lloh10:
	adrp	x8, _IRQ_CPU_TO_EPU_ACK@GOTPAGE
Lloh11:
	ldr	x8, [x8, _IRQ_CPU_TO_EPU_ACK@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
Lloh13:
	adrp	x9, _IRQ_APU_TO_EPU_ACK@GOTPAGE
Lloh14:
	ldr	x9, [x9, _IRQ_APU_TO_EPU_ACK@GOTPAGEOFF]
Lloh15:
	ldr	w9, [x9]
	orr	w1, w9, w8
	mov	x0, x20
	bl	_cx18_sw2_irq_disable
	mov	x0, x20
	bl	_cx18_halt_firmware
	ldr	w0, [x20, #28]
	bl	_destroy_workqueue
	mov	x0, x20
	mov	w1, #1
	bl	_cx18_streams_cleanup
	mov	x0, x20
	bl	_exit_cx18_i2c
	ldr	x8, [x20, #16]
	ldr	w0, [x8]
	mov	x1, x20
	bl	_free_irq
	mov	x0, x20
	bl	_cx18_iounmap
	ldr	w0, [x20, #24]
Lloh16:
	adrp	x8, _CX18_MEM_SIZE@GOTPAGE
Lloh17:
	ldr	x8, [x8, _CX18_MEM_SIZE@GOTPAGEOFF]
Lloh18:
	ldr	w1, [x8]
	bl	_release_mem_region
	ldr	x0, [x20, #16]
	bl	_pci_disable_device
	ldr	x8, [x20, #8]
	ldr	x0, [x8]
	cbz	x0, LBB0_7
; %bb.3:
Lloh19:
	adrp	x21, _CX18_VBI_FRAMES@GOTPAGE
Lloh20:
	ldr	x21, [x21, _CX18_VBI_FRAMES@GOTPAGEOFF]
	ldr	w8, [x21]
	cmp	w8, #1
	b.lt	LBB0_7
; %bb.4:
	bl	_kfree
	ldr	w8, [x21]
	cmp	w8, #2
	b.lt	LBB0_7
; %bb.5:
	mov	w22, #1
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x20, #8]
	ldr	x0, [x8, x22, lsl #3]
	bl	_kfree
	add	x22, x22, #1
	ldrsw	x8, [x21]
	cmp	x22, x8
	b.lt	LBB0_6
LBB0_7:
	add	x0, x20, #4
	bl	_v4l2_ctrl_handler_free
	ldr	w1, [x20]
Lloh21:
	adrp	x0, l_.str.2@PAGE
Lloh22:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_CX18_INFO
	mov	x0, x19
	bl	_v4l2_device_unregister
	mov	x0, x20
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	_kfree
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpAdd	Lloh21, Lloh22
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Removing Card\n"

l_.str.1:                               ; @.str.1
	.asciz	"Stopping all streams\n"

	.comm	_IRQ_CPU_TO_EPU,4,2             ; @IRQ_CPU_TO_EPU
	.comm	_IRQ_APU_TO_EPU,4,2             ; @IRQ_APU_TO_EPU
	.comm	_IRQ_CPU_TO_EPU_ACK,4,2         ; @IRQ_CPU_TO_EPU_ACK
	.comm	_IRQ_APU_TO_EPU_ACK,4,2         ; @IRQ_APU_TO_EPU_ACK
	.comm	_CX18_MEM_SIZE,4,2              ; @CX18_MEM_SIZE
	.comm	_CX18_VBI_FRAMES,4,2            ; @CX18_VBI_FRAMES
l_.str.2:                               ; @.str.2
	.asciz	"Removed %s\n"

	.no_dead_strip	_cx18_remove
.subsections_via_symbols
