	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ivtv_remove
_ivtv_remove:                           ## @ivtv_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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	callq	_dev_get_drvdata
	movq	%rax, %rdi
	callq	_to_ivtv
	movq	%rax, %r15
	leaq	L_.str(%rip), %rdi
	callq	_IVTV_DEBUG_INFO
	movq	%r15, %rdi
	callq	_flush_request_modules
	movq	_IVTV_F_I_INITED@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	72(%r15), %r14
	movq	%r14, %rsi
	callq	_test_bit
	testq	%rax, %rax
	je	LBB0_11
## %bb.1:
	leaq	L_.str.1(%rip), %rdi
	callq	_IVTV_DEBUG_INFO
	leaq	80(%r15), %rdi
	callq	_atomic_read
	testq	%rax, %rax
	jle	LBB0_3
## %bb.2:
	movq	%r15, %rdi
	callq	_ivtv_stop_all_captures
LBB0_3:
	leaq	L_.str.2(%rip), %rdi
	callq	_IVTV_DEBUG_INFO
	movq	_V4L2_CAP_VIDEO_OUTPUT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%r15)
	je	LBB0_5
## %bb.4:
	movq	_IVTV_HW_SAA7127@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_video@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_s_stream@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%r15, %rdi
	xorl	%r8d, %r8d
	callq	_ivtv_call_hw
LBB0_5:
	leaq	76(%r15), %rdi
	callq	_atomic_read
	testq	%rax, %rax
	jle	LBB0_10
## %bb.6:
	movq	_IVTV_F_I_DEC_YUV@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%r14, %rsi
	callq	_test_bit
	testq	%rax, %rax
	jne	LBB0_7
## %bb.8:
	movq	_IVTV_DEC_STREAM_TYPE_MPG@GOTPCREL(%rip), %rax
	jmp	LBB0_9
LBB0_7:
	movq	_IVTV_DEC_STREAM_TYPE_YUV@GOTPCREL(%rip), %rax
LBB0_9:
	movslq	(%rax), %rdi
	shlq	$2, %rdi
	addq	64(%r15), %rdi
	movq	_V4L2_DEC_CMD_STOP_TO_BLACK@GOTPCREL(%rip), %rax
	movq	_V4L2_DEC_CMD_STOP_IMMEDIATELY@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	orl	(%rax), %esi
	xorl	%edx, %edx
	callq	_ivtv_stop_v4l2_decode_stream
LBB0_10:
	movq	%r15, %rdi
	callq	_ivtv_halt_firmware
LBB0_11:
	movq	%r15, %rdi
	movl	$-1, %esi
	callq	_ivtv_set_irq_mask
	leaq	60(%r15), %rdi
	callq	_del_timer_sync
	leaq	56(%r15), %rdi
	callq	_kthread_flush_worker
	movl	52(%r15), %edi
	callq	_kthread_stop
	movq	%r15, %rdi
	callq	_ivtv_streams_cleanup
	movq	%r15, %rdi
	callq	_ivtv_udma_free
	leaq	48(%r15), %rdi
	callq	_v4l2_ctrl_handler_free
	movq	%r15, %rdi
	callq	_exit_ivtv_i2c
	movq	24(%r15), %rax
	movl	(%rax), %edi
	movq	%r15, %rsi
	callq	_free_irq
	movq	%r15, %rdi
	callq	_ivtv_iounmap
	movq	32(%r15), %rdi
	movq	_IVTV_ENCODER_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_release_mem_region
	movq	_IVTV_REG_OFFSET@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	32(%r15), %rdi
	movq	_IVTV_REG_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_release_mem_region
	cmpq	$0, 40(%r15)
	je	LBB0_13
## %bb.12:
	movq	_IVTV_DECODER_OFFSET@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	addq	32(%r15), %rdi
	movq	_IVTV_DECODER_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_release_mem_region
LBB0_13:
	movq	24(%r15), %rdi
	callq	_pci_disable_device
	movq	_IVTV_VBI_FRAMES@GOTPCREL(%rip), %r14
	cmpl	$0, (%r14)
	jle	LBB0_16
## %bb.14:
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_15:                                ## =>This Inner Loop Header: Depth=1
	movq	16(%r15), %rax
	movq	(%rax,%rbx,8), %rdi
	callq	_kfree
	incq	%rbx
	movslq	(%r14), %rax
	cmpq	%rax, %rbx
	jl	LBB0_15
LBB0_16:
	movl	8(%r15), %esi
	leaq	L_.str.3(%rip), %rdi
	callq	_pr_info
	movq	%r15, %rdi
	addq	$4, %rdi
	callq	_v4l2_device_unregister
	movq	%r15, %rdi
	addq	$8, %rsp
	popq	%rbx
	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"

	.comm	_IVTV_F_I_INITED,4,2            ## @IVTV_F_I_INITED
L_.str.1:                               ## @.str.1
	.asciz	"Stopping all streams\n"

L_.str.2:                               ## @.str.2
	.asciz	"Stopping decoding\n"

	.comm	_V4L2_CAP_VIDEO_OUTPUT,4,2      ## @V4L2_CAP_VIDEO_OUTPUT
	.comm	_IVTV_HW_SAA7127,4,2            ## @IVTV_HW_SAA7127
	.comm	_video,4,2                      ## @video
	.comm	_s_stream,4,2                   ## @s_stream
	.comm	_IVTV_F_I_DEC_YUV,4,2           ## @IVTV_F_I_DEC_YUV
	.comm	_IVTV_DEC_STREAM_TYPE_YUV,4,2   ## @IVTV_DEC_STREAM_TYPE_YUV
	.comm	_IVTV_DEC_STREAM_TYPE_MPG,4,2   ## @IVTV_DEC_STREAM_TYPE_MPG
	.comm	_V4L2_DEC_CMD_STOP_TO_BLACK,4,2 ## @V4L2_DEC_CMD_STOP_TO_BLACK
	.comm	_V4L2_DEC_CMD_STOP_IMMEDIATELY,4,2 ## @V4L2_DEC_CMD_STOP_IMMEDIATELY
	.comm	_IVTV_ENCODER_SIZE,4,2          ## @IVTV_ENCODER_SIZE
	.comm	_IVTV_REG_OFFSET,8,3            ## @IVTV_REG_OFFSET
	.comm	_IVTV_REG_SIZE,4,2              ## @IVTV_REG_SIZE
	.comm	_IVTV_DECODER_OFFSET,8,3        ## @IVTV_DECODER_OFFSET
	.comm	_IVTV_DECODER_SIZE,4,2          ## @IVTV_DECODER_SIZE
	.comm	_IVTV_VBI_FRAMES,4,2            ## @IVTV_VBI_FRAMES
L_.str.3:                               ## @.str.3
	.asciz	"Removed %s\n"

	.no_dead_strip	_ivtv_remove
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ivtv_remove
_ivtv_remove:                           ; @ivtv_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	_dev_get_drvdata
	bl	_to_ivtv
	mov	x19, x0
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_IVTV_DEBUG_INFO
	mov	x0, x19
	bl	_flush_request_modules
Lloh2:
	adrp	x8, _IVTV_F_I_INITED@GOTPAGE
Lloh3:
	ldr	x8, [x8, _IVTV_F_I_INITED@GOTPAGEOFF]
Lloh4:
	ldr	w0, [x8]
	add	x20, x19, #72
	mov	x1, x20
	bl	_test_bit
	cbz	x0, LBB0_8
; %bb.1:
Lloh5:
	adrp	x0, l_.str.1@PAGE
Lloh6:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_IVTV_DEBUG_INFO
	add	x0, x19, #80
	bl	_atomic_read
	cmp	x0, #1
	b.lt	LBB0_3
; %bb.2:
	mov	x0, x19
	bl	_ivtv_stop_all_captures
LBB0_3:
Lloh7:
	adrp	x0, l_.str.2@PAGE
Lloh8:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_IVTV_DEBUG_INFO
	ldr	w8, [x19]
Lloh9:
	adrp	x9, _V4L2_CAP_VIDEO_OUTPUT@GOTPAGE
Lloh10:
	ldr	x9, [x9, _V4L2_CAP_VIDEO_OUTPUT@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_5
; %bb.4:
Lloh12:
	adrp	x8, _IVTV_HW_SAA7127@GOTPAGE
Lloh13:
	ldr	x8, [x8, _IVTV_HW_SAA7127@GOTPAGEOFF]
Lloh14:
	ldr	w1, [x8]
Lloh15:
	adrp	x8, _video@GOTPAGE
Lloh16:
	ldr	x8, [x8, _video@GOTPAGEOFF]
Lloh17:
	ldr	w2, [x8]
Lloh18:
	adrp	x8, _s_stream@GOTPAGE
Lloh19:
	ldr	x8, [x8, _s_stream@GOTPAGEOFF]
Lloh20:
	ldr	w3, [x8]
	mov	x0, x19
	mov	w4, #0
	bl	_ivtv_call_hw
LBB0_5:
	add	x0, x19, #76
	bl	_atomic_read
	cmp	x0, #1
	b.lt	LBB0_7
; %bb.6:
Lloh21:
	adrp	x8, _IVTV_F_I_DEC_YUV@GOTPAGE
Lloh22:
	ldr	x8, [x8, _IVTV_F_I_DEC_YUV@GOTPAGEOFF]
Lloh23:
	ldr	w0, [x8]
	mov	x1, x20
	bl	_test_bit
Lloh24:
	adrp	x8, _IVTV_DEC_STREAM_TYPE_MPG@GOTPAGE
Lloh25:
	ldr	x8, [x8, _IVTV_DEC_STREAM_TYPE_MPG@GOTPAGEOFF]
Lloh26:
	adrp	x9, _IVTV_DEC_STREAM_TYPE_YUV@GOTPAGE
Lloh27:
	ldr	x9, [x9, _IVTV_DEC_STREAM_TYPE_YUV@GOTPAGEOFF]
	ldr	x10, [x19, #64]
	cmp	x0, #0
	csel	x8, x8, x9, eq
	ldrsw	x8, [x8]
Lloh28:
	adrp	x9, _V4L2_DEC_CMD_STOP_TO_BLACK@GOTPAGE
Lloh29:
	ldr	x9, [x9, _V4L2_DEC_CMD_STOP_TO_BLACK@GOTPAGEOFF]
	add	x0, x10, x8, lsl #2
Lloh30:
	ldr	w8, [x9]
Lloh31:
	adrp	x9, _V4L2_DEC_CMD_STOP_IMMEDIATELY@GOTPAGE
Lloh32:
	ldr	x9, [x9, _V4L2_DEC_CMD_STOP_IMMEDIATELY@GOTPAGEOFF]
Lloh33:
	ldr	w9, [x9]
	orr	w1, w9, w8
	mov	w2, #0
	bl	_ivtv_stop_v4l2_decode_stream
LBB0_7:
	mov	x0, x19
	bl	_ivtv_halt_firmware
LBB0_8:
	mov	x0, x19
	mov	w1, #-1
	bl	_ivtv_set_irq_mask
	add	x0, x19, #60
	bl	_del_timer_sync
	add	x0, x19, #56
	bl	_kthread_flush_worker
	ldr	w0, [x19, #52]
	bl	_kthread_stop
	mov	x0, x19
	bl	_ivtv_streams_cleanup
	mov	x0, x19
	bl	_ivtv_udma_free
	add	x0, x19, #48
	bl	_v4l2_ctrl_handler_free
	mov	x0, x19
	bl	_exit_ivtv_i2c
	ldr	x8, [x19, #24]
	ldr	w0, [x8]
	mov	x1, x19
	bl	_free_irq
	mov	x0, x19
	bl	_ivtv_iounmap
	ldr	x0, [x19, #32]
Lloh34:
	adrp	x8, _IVTV_ENCODER_SIZE@GOTPAGE
Lloh35:
	ldr	x8, [x8, _IVTV_ENCODER_SIZE@GOTPAGEOFF]
Lloh36:
	ldr	w1, [x8]
	bl	_release_mem_region
Lloh37:
	adrp	x8, _IVTV_REG_OFFSET@GOTPAGE
Lloh38:
	ldr	x8, [x8, _IVTV_REG_OFFSET@GOTPAGEOFF]
	ldr	x9, [x19, #32]
Lloh39:
	ldr	x8, [x8]
	add	x0, x8, x9
Lloh40:
	adrp	x8, _IVTV_REG_SIZE@GOTPAGE
Lloh41:
	ldr	x8, [x8, _IVTV_REG_SIZE@GOTPAGEOFF]
Lloh42:
	ldr	w1, [x8]
	bl	_release_mem_region
	ldr	x8, [x19, #40]
	cbz	x8, LBB0_10
; %bb.9:
Lloh43:
	adrp	x8, _IVTV_DECODER_OFFSET@GOTPAGE
Lloh44:
	ldr	x8, [x8, _IVTV_DECODER_OFFSET@GOTPAGEOFF]
	ldr	x9, [x19, #32]
Lloh45:
	ldr	x8, [x8]
	add	x0, x8, x9
Lloh46:
	adrp	x8, _IVTV_DECODER_SIZE@GOTPAGE
Lloh47:
	ldr	x8, [x8, _IVTV_DECODER_SIZE@GOTPAGEOFF]
Lloh48:
	ldr	w1, [x8]
	bl	_release_mem_region
LBB0_10:
	ldr	x0, [x19, #24]
	bl	_pci_disable_device
Lloh49:
	adrp	x20, _IVTV_VBI_FRAMES@GOTPAGE
Lloh50:
	ldr	x20, [x20, _IVTV_VBI_FRAMES@GOTPAGEOFF]
	ldr	w8, [x20]
	cmp	w8, #1
	b.lt	LBB0_13
; %bb.11:
	mov	x21, #0
LBB0_12:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #16]
	ldr	x0, [x8, x21, lsl #3]
	bl	_kfree
	add	x21, x21, #1
	ldrsw	x8, [x20]
	cmp	x21, x8
	b.lt	LBB0_12
LBB0_13:
	ldr	w1, [x19, #8]
Lloh51:
	adrp	x0, l_.str.3@PAGE
Lloh52:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_pr_info
	add	x0, x19, #4
	bl	_v4l2_device_unregister
	mov	x0, x19
	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 AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGot	Lloh26, Lloh27
	.loh AdrpLdrGot	Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh40, Lloh41, Lloh42
	.loh AdrpLdrGotLdr	Lloh37, Lloh38, Lloh39
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.loh AdrpLdrGotLdr	Lloh46, Lloh47, Lloh48
	.loh AdrpLdrGotLdr	Lloh43, Lloh44, Lloh45
	.loh AdrpLdrGot	Lloh49, Lloh50
	.loh AdrpAdd	Lloh51, Lloh52
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Removing card\n"

	.comm	_IVTV_F_I_INITED,4,2            ; @IVTV_F_I_INITED
l_.str.1:                               ; @.str.1
	.asciz	"Stopping all streams\n"

l_.str.2:                               ; @.str.2
	.asciz	"Stopping decoding\n"

	.comm	_V4L2_CAP_VIDEO_OUTPUT,4,2      ; @V4L2_CAP_VIDEO_OUTPUT
	.comm	_IVTV_HW_SAA7127,4,2            ; @IVTV_HW_SAA7127
	.comm	_video,4,2                      ; @video
	.comm	_s_stream,4,2                   ; @s_stream
	.comm	_IVTV_F_I_DEC_YUV,4,2           ; @IVTV_F_I_DEC_YUV
	.comm	_IVTV_DEC_STREAM_TYPE_YUV,4,2   ; @IVTV_DEC_STREAM_TYPE_YUV
	.comm	_IVTV_DEC_STREAM_TYPE_MPG,4,2   ; @IVTV_DEC_STREAM_TYPE_MPG
	.comm	_V4L2_DEC_CMD_STOP_TO_BLACK,4,2 ; @V4L2_DEC_CMD_STOP_TO_BLACK
	.comm	_V4L2_DEC_CMD_STOP_IMMEDIATELY,4,2 ; @V4L2_DEC_CMD_STOP_IMMEDIATELY
	.comm	_IVTV_ENCODER_SIZE,4,2          ; @IVTV_ENCODER_SIZE
	.comm	_IVTV_REG_OFFSET,8,3            ; @IVTV_REG_OFFSET
	.comm	_IVTV_REG_SIZE,4,2              ; @IVTV_REG_SIZE
	.comm	_IVTV_DECODER_OFFSET,8,3        ; @IVTV_DECODER_OFFSET
	.comm	_IVTV_DECODER_SIZE,4,2          ; @IVTV_DECODER_SIZE
	.comm	_IVTV_VBI_FRAMES,4,2            ; @IVTV_VBI_FRAMES
l_.str.3:                               ; @.str.3
	.asciz	"Removed %s\n"

	.no_dead_strip	_ivtv_remove
.subsections_via_symbols
