	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function bttv_remove
_bttv_remove:                           ## @bttv_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	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	callq	_pci_get_drvdata
	movq	%rax, %rdi
	callq	_to_bttv
	movq	%rax, %rbx
	movq	_bttv_verbose@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_2
## %bb.1:
	movq	8(%rbx), %rsi
	leaq	L_.str(%rip), %rdi
	callq	_pr_info
LBB0_2:
	movq	_bttv_tvcards@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	16(%rbx), %rcx
	cmpq	$0, (%rax,%rcx,8)
	je	LBB0_4
## %bb.3:
	movq	%rbx, %rdi
	callq	_flush_request_modules
LBB0_4:
	movq	_BT848_GPIO_DMA_CTL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$-16, %edi
	callq	_btand
	movq	_BT848_INT_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%edi, %edi
	callq	_btwrite
	movq	_BT848_INT_STAT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$-1, %edi
	callq	_btwrite
	movq	_BT848_GPIO_OUT_EN@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%edi, %edi
	callq	_btwrite
	movq	_bttv_gpio@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_6
## %bb.5:
	leaq	L_.str.1(%rip), %rsi
	movq	%rbx, %rdi
	callq	_bttv_gpio_tracking
LBB0_6:
	leaq	8(%rbx), %r14
	movl	$1, (%rbx)
	movq	%rbx, %rdi
	callq	_bttv_input_fini
	movq	%r14, %rdi
	callq	_bttv_sub_del_devices
	movq	%rbx, %rdi
	callq	_fini_bttv_i2c
	movq	%rbx, %rdi
	callq	_bttv_unregister_video
	leaq	52(%rbx), %rdi
	callq	_v4l2_ctrl_handler_free
	leaq	48(%rbx), %rdi
	callq	_v4l2_ctrl_handler_free
	movq	32(%rbx), %rdi
	leaq	44(%rbx), %rsi
	callq	_btcx_riscmem_free
	movq	32(%rbx), %rax
	movl	(%rax), %edi
	movq	%rbx, %rsi
	callq	_free_irq
	movl	40(%rbx), %edi
	callq	_iounmap
	movq	32(%rbx), %rdi
	xorl	%esi, %esi
	callq	_pci_resource_start
	movl	%eax, %r14d
	movq	32(%rbx), %rdi
	xorl	%esi, %esi
	callq	_pci_resource_len
	movl	%r14d, %edi
	movl	%eax, %esi
	callq	_release_mem_region
	movq	32(%rbx), %rdi
	callq	_pci_disable_device
	movq	%rbx, %rdi
	addq	$24, %rdi
	callq	_v4l2_device_unregister
	movq	_bttvs@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	8(%rbx), %rcx
	movq	$0, (%rax,%rcx,8)
	movq	%rbx, %rdi
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmp	_kfree                          ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_bttv_verbose,8,3               ## @bttv_verbose
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%d: unloading\n"

	.comm	_bttv_tvcards,8,3               ## @bttv_tvcards
	.comm	_BT848_GPIO_DMA_CTL,4,2         ## @BT848_GPIO_DMA_CTL
	.comm	_BT848_INT_MASK,4,2             ## @BT848_INT_MASK
	.comm	_BT848_INT_STAT,4,2             ## @BT848_INT_STAT
	.comm	_BT848_GPIO_OUT_EN,4,2          ## @BT848_GPIO_OUT_EN
	.comm	_bttv_gpio,8,3                  ## @bttv_gpio
L_.str.1:                               ## @.str.1
	.asciz	"cleanup"

	.comm	_bttvs,8,3                      ## @bttvs
	.no_dead_strip	_bttv_remove
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function bttv_remove
_bttv_remove:                           ; @bttv_remove
	.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
	bl	_pci_get_drvdata
	bl	_to_bttv
	mov	x19, x0
Lloh0:
	adrp	x8, _bttv_verbose@GOTPAGE
Lloh1:
	ldr	x8, [x8, _bttv_verbose@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cbz	x8, LBB0_2
; %bb.1:
	ldr	x1, [x19, #8]
Lloh3:
	adrp	x0, l_.str@PAGE
Lloh4:
	add	x0, x0, l_.str@PAGEOFF
	bl	_pr_info
LBB0_2:
Lloh5:
	adrp	x8, _bttv_tvcards@GOTPAGE
Lloh6:
	ldr	x8, [x8, _bttv_tvcards@GOTPAGEOFF]
Lloh7:
	ldr	x8, [x8]
	ldr	x9, [x19, #16]
	ldr	x8, [x8, x9, lsl #3]
	cbz	x8, LBB0_4
; %bb.3:
	mov	x0, x19
	bl	_flush_request_modules
LBB0_4:
Lloh8:
	adrp	x8, _BT848_GPIO_DMA_CTL@GOTPAGE
Lloh9:
	ldr	x8, [x8, _BT848_GPIO_DMA_CTL@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
	mov	w0, #-16
	bl	_btand
Lloh11:
	adrp	x8, _BT848_INT_MASK@GOTPAGE
Lloh12:
	ldr	x8, [x8, _BT848_INT_MASK@GOTPAGEOFF]
Lloh13:
	ldr	w1, [x8]
	mov	w0, #0
	bl	_btwrite
Lloh14:
	adrp	x8, _BT848_INT_STAT@GOTPAGE
Lloh15:
	ldr	x8, [x8, _BT848_INT_STAT@GOTPAGEOFF]
Lloh16:
	ldr	w1, [x8]
	mov	w0, #-1
	bl	_btwrite
Lloh17:
	adrp	x8, _BT848_GPIO_OUT_EN@GOTPAGE
Lloh18:
	ldr	x8, [x8, _BT848_GPIO_OUT_EN@GOTPAGEOFF]
Lloh19:
	ldr	w1, [x8]
	mov	w0, #0
	bl	_btwrite
Lloh20:
	adrp	x8, _bttv_gpio@GOTPAGE
Lloh21:
	ldr	x8, [x8, _bttv_gpio@GOTPAGEOFF]
Lloh22:
	ldr	x8, [x8]
	cbz	x8, LBB0_6
; %bb.5:
Lloh23:
	adrp	x1, l_.str.1@PAGE
Lloh24:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_bttv_gpio_tracking
LBB0_6:
	add	x20, x19, #8
	mov	w8, #1
	str	w8, [x19]
	mov	x0, x19
	bl	_bttv_input_fini
	mov	x0, x20
	bl	_bttv_sub_del_devices
	mov	x0, x19
	bl	_fini_bttv_i2c
	mov	x0, x19
	bl	_bttv_unregister_video
	add	x0, x19, #52
	bl	_v4l2_ctrl_handler_free
	add	x0, x19, #48
	bl	_v4l2_ctrl_handler_free
	ldr	x0, [x19, #32]
	add	x1, x19, #44
	bl	_btcx_riscmem_free
	ldr	x8, [x19, #32]
	ldr	w0, [x8]
	mov	x1, x19
	bl	_free_irq
	ldr	w0, [x19, #40]
	bl	_iounmap
	ldr	x0, [x19, #32]
	mov	w1, #0
	bl	_pci_resource_start
	mov	x20, x0
	ldr	x0, [x19, #32]
	mov	w1, #0
	bl	_pci_resource_len
	mov	x1, x0
	mov	x0, x20
	bl	_release_mem_region
	ldr	x0, [x19, #32]
	bl	_pci_disable_device
	add	x0, x19, #24
	bl	_v4l2_device_unregister
Lloh25:
	adrp	x8, _bttvs@GOTPAGE
Lloh26:
	ldr	x8, [x8, _bttvs@GOTPAGEOFF]
Lloh27:
	ldr	x8, [x8]
	ldr	x9, [x19, #8]
	str	xzr, [x8, x9, lsl #3]
	mov	x0, x19
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_kfree
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.cfi_endproc
                                        ; -- End function
	.comm	_bttv_verbose,8,3               ; @bttv_verbose
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%d: unloading\n"

	.comm	_bttv_tvcards,8,3               ; @bttv_tvcards
	.comm	_BT848_GPIO_DMA_CTL,4,2         ; @BT848_GPIO_DMA_CTL
	.comm	_BT848_INT_MASK,4,2             ; @BT848_INT_MASK
	.comm	_BT848_INT_STAT,4,2             ; @BT848_INT_STAT
	.comm	_BT848_GPIO_OUT_EN,4,2          ; @BT848_GPIO_OUT_EN
	.comm	_bttv_gpio,8,3                  ; @bttv_gpio
l_.str.1:                               ; @.str.1
	.asciz	"cleanup"

	.comm	_bttvs,8,3                      ; @bttvs
	.no_dead_strip	_bttv_remove
.subsections_via_symbols
