	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function em28xx_v4l2_close
_em28xx_v4l2_close:                     ## @em28xx_v4l2_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	%r15
	pushq	%r14
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	(%rdi), %rbx
	movq	40(%rbx), %r14
	movl	(%r14), %esi
	leaq	L_.str(%rip), %rdi
	xorl	%eax, %eax
	callq	_em28xx_videodbg
	movq	_EM28XX_RESOURCE_VIDEO@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	movq	%rbx, %rdi
	callq	_res_check
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	leaq	16(%rbx), %rdi
	callq	_videobuf_stop
	movl	(%r15), %esi
	movq	%rbx, %rdi
	callq	_res_free
LBB0_2:
	movq	_EM28XX_RESOURCE_VBI@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	movq	%rbx, %rdi
	callq	_res_check
	testq	%rax, %rax
	je	LBB0_4
## %bb.3:
	leaq	12(%rbx), %rdi
	callq	_videobuf_stop
	movl	(%r15), %esi
	movq	%rbx, %rdi
	callq	_res_free
LBB0_4:
	cmpl	$1, (%r14)
	jne	LBB0_9
## %bb.5:
	movq	_DEV_DISCONNECTED@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, 4(%r14)
	je	LBB0_7
## %bb.6:
	movq	%r14, %rdi
	callq	_em28xx_release_resources
	movq	%r14, %rdi
	callq	_kfree
	jmp	LBB0_10
LBB0_7:
	leaq	32(%r14), %rdi
	movq	_core@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_s_power@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	xorl	%esi, %esi
	xorl	%r8d, %r8d
	callq	_v4l2_device_call_all
	movq	%r14, %rdi
	callq	_em28xx_uninit_isoc
	movq	_EM28XX_SUSPEND@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	callq	_em28xx_set_mode
	movq	$0, 24(%r14)
	leaq	L_.str.1(%rip), %rdi
	xorl	%eax, %eax
	callq	_em28xx_videodbg
	movl	20(%r14), %edi
	xorl	%esi, %esi
	xorl	%edx, %edx
	callq	_usb_set_interface
	testl	%eax, %eax
	jns	LBB0_9
## %bb.8:
	leaq	L_.str.2(%rip), %rdi
	movl	%eax, %esi
	callq	_em28xx_errdev
LBB0_9:
	leaq	16(%rbx), %rdi
	callq	_videobuf_mmap_free
	leaq	12(%rbx), %rdi
	callq	_videobuf_mmap_free
	movq	%rbx, %rdi
	callq	_kfree
	decl	(%r14)
	addq	$8, %r14
	movq	%r14, %rdi
	movl	$1, %esi
	callq	_wake_up_interruptible_nr
LBB0_10:
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"users=%d\n"

	.comm	_EM28XX_RESOURCE_VIDEO,4,2      ## @EM28XX_RESOURCE_VIDEO
	.comm	_EM28XX_RESOURCE_VBI,4,2        ## @EM28XX_RESOURCE_VBI
	.comm	_DEV_DISCONNECTED,4,2           ## @DEV_DISCONNECTED
	.comm	_core,4,2                       ## @core
	.comm	_s_power,4,2                    ## @s_power
	.comm	_EM28XX_SUSPEND,4,2             ## @EM28XX_SUSPEND
L_.str.1:                               ## @.str.1
	.asciz	"setting alternate 0\n"

L_.str.2:                               ## @.str.2
	.asciz	"cannot change alternate number to 0 (error=%i)\n"

	.no_dead_strip	_em28xx_v4l2_close
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function em28xx_v4l2_close
_em28xx_v4l2_close:                     ; @em28xx_v4l2_close
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
	ldr	x20, [x0]
	ldr	x19, [x20, #40]
	ldr	w8, [x19]
	str	x8, [sp]
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_em28xx_videodbg
Lloh2:
	adrp	x21, _EM28XX_RESOURCE_VIDEO@GOTPAGE
Lloh3:
	ldr	x21, [x21, _EM28XX_RESOURCE_VIDEO@GOTPAGEOFF]
	ldr	w1, [x21]
	mov	x0, x20
	bl	_res_check
	cbz	x0, LBB0_2
; %bb.1:
	add	x0, x20, #16
	bl	_videobuf_stop
	ldr	w1, [x21]
	mov	x0, x20
	bl	_res_free
LBB0_2:
Lloh4:
	adrp	x21, _EM28XX_RESOURCE_VBI@GOTPAGE
Lloh5:
	ldr	x21, [x21, _EM28XX_RESOURCE_VBI@GOTPAGEOFF]
	ldr	w1, [x21]
	mov	x0, x20
	bl	_res_check
	cbz	x0, LBB0_4
; %bb.3:
	add	x0, x20, #12
	bl	_videobuf_stop
	ldr	w1, [x21]
	mov	x0, x20
	bl	_res_free
LBB0_4:
	ldr	w8, [x19]
	cmp	w8, #1
	b.ne	LBB0_9
; %bb.5:
	ldr	w8, [x19, #4]
Lloh6:
	adrp	x9, _DEV_DISCONNECTED@GOTPAGE
Lloh7:
	ldr	x9, [x9, _DEV_DISCONNECTED@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_7
; %bb.6:
	mov	x0, x19
	bl	_em28xx_release_resources
	mov	x0, x19
	bl	_kfree
	b	LBB0_10
LBB0_7:
	add	x0, x19, #32
Lloh9:
	adrp	x8, _core@GOTPAGE
Lloh10:
	ldr	x8, [x8, _core@GOTPAGEOFF]
Lloh11:
	ldr	w2, [x8]
Lloh12:
	adrp	x8, _s_power@GOTPAGE
Lloh13:
	ldr	x8, [x8, _s_power@GOTPAGEOFF]
Lloh14:
	ldr	w3, [x8]
	mov	w1, #0
	mov	w4, #0
	bl	_v4l2_device_call_all
	mov	x0, x19
	bl	_em28xx_uninit_isoc
Lloh15:
	adrp	x8, _EM28XX_SUSPEND@GOTPAGE
Lloh16:
	ldr	x8, [x8, _EM28XX_SUSPEND@GOTPAGEOFF]
Lloh17:
	ldr	w1, [x8]
	mov	x0, x19
	bl	_em28xx_set_mode
	str	xzr, [x19, #24]
Lloh18:
	adrp	x0, l_.str.1@PAGE
Lloh19:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_em28xx_videodbg
	ldr	w0, [x19, #20]
	mov	w1, #0
	mov	w2, #0
	bl	_usb_set_interface
	tbz	w0, #31, LBB0_9
; %bb.8:
	mov	x1, x0
Lloh20:
	adrp	x0, l_.str.2@PAGE
Lloh21:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_em28xx_errdev
LBB0_9:
	add	x0, x20, #16
	bl	_videobuf_mmap_free
	add	x0, x20, #12
	bl	_videobuf_mmap_free
	mov	x0, x20
	bl	_kfree
	ldr	w8, [x19]
	sub	w8, w8, #1
	str	w8, [x19], #8
	mov	x0, x19
	mov	w1, #1
	bl	_wake_up_interruptible_nr
LBB0_10:
	mov	w0, #0
	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
	add	sp, sp, #64
	ret
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh20, Lloh21
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"users=%d\n"

	.comm	_EM28XX_RESOURCE_VIDEO,4,2      ; @EM28XX_RESOURCE_VIDEO
	.comm	_EM28XX_RESOURCE_VBI,4,2        ; @EM28XX_RESOURCE_VBI
	.comm	_DEV_DISCONNECTED,4,2           ; @DEV_DISCONNECTED
	.comm	_core,4,2                       ; @core
	.comm	_s_power,4,2                    ; @s_power
	.comm	_EM28XX_SUSPEND,4,2             ; @EM28XX_SUSPEND
l_.str.1:                               ; @.str.1
	.asciz	"setting alternate 0\n"

l_.str.2:                               ; @.str.2
	.asciz	"cannot change alternate number to 0 (error=%i)\n"

	.no_dead_strip	_em28xx_v4l2_close
.subsections_via_symbols
