	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cpia2_usb_disconnect
_cpia2_usb_disconnect:                  ## @cpia2_usb_disconnect
	.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, %r15
	callq	_usb_get_intfdata
	movq	%rax, %rbx
	movq	%rax, %r14
	movq	%r15, %rdi
	xorl	%esi, %esi
	callq	_usb_set_intfdata
	movq	$0, 32(%rbx)
	leaq	L_.str(%rip), %rdi
	callq	_DBG
	movq	%rbx, %rdi
	callq	_cpia2_usb_stream_stop
	leaq	L_.str.1(%rip), %rdi
	callq	_DBG
	movq	%rbx, %rdi
	callq	_cpia2_unregister_camera
	cmpq	$0, 24(%rbx)
	je	LBB0_3
## %bb.1:
	leaq	L_.str.2(%rip), %rdi
	callq	_DBG
	movq	_FRAME_READY@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	16(%r14), %rcx
	movl	%eax, 8(%rcx)
	movq	$0, (%rcx)
	addq	$8, %rbx
	movq	%rbx, %rdi
	callq	_waitqueue_active
	testq	%rax, %rax
	je	LBB0_3
## %bb.2:
	movq	%rbx, %rdi
	callq	_wake_up_interruptible
LBB0_3:
	leaq	L_.str.3(%rip), %rdi
	callq	_DBG
	movq	_cpia2_driver@GOTPCREL(%rip), %rdi
	movq	%r15, %rsi
	callq	_usb_driver_release_interface
	cmpq	$0, (%r14)
	jne	LBB0_5
## %bb.4:
	leaq	L_.str.4(%rip), %rdi
	callq	_DBG
	movq	%r14, %rdi
	callq	_kfree
LBB0_5:
	leaq	L_.str.5(%rip), %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_LOG                            ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Stopping stream\n"

L_.str.1:                               ## @.str.1
	.asciz	"Unregistering camera\n"

L_.str.2:                               ## @.str.2
	.asciz	"Wakeup waiting processes\n"

	.comm	_FRAME_READY,4,2                ## @FRAME_READY
L_.str.3:                               ## @.str.3
	.asciz	"Releasing interface\n"

	.comm	_cpia2_driver,4,2               ## @cpia2_driver
L_.str.4:                               ## @.str.4
	.asciz	"Freeing camera structure\n"

L_.str.5:                               ## @.str.5
	.asciz	"CPiA2 camera disconnected.\n"

	.no_dead_strip	_cpia2_usb_disconnect
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function cpia2_usb_disconnect
_cpia2_usb_disconnect:                  ; @cpia2_usb_disconnect
	.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
	mov	x20, x0
	bl	_usb_get_intfdata
	mov	x19, x0
	mov	x0, x20
	mov	x1, #0
	bl	_usb_set_intfdata
	str	xzr, [x19, #32]
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DBG
	mov	x0, x19
	bl	_cpia2_usb_stream_stop
Lloh2:
	adrp	x0, l_.str.1@PAGE
Lloh3:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_DBG
	mov	x0, x19
	bl	_cpia2_unregister_camera
	ldr	x8, [x19, #24]
	cbz	x8, LBB0_3
; %bb.1:
Lloh4:
	adrp	x0, l_.str.2@PAGE
Lloh5:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_DBG
Lloh6:
	adrp	x8, _FRAME_READY@GOTPAGE
Lloh7:
	ldr	x8, [x8, _FRAME_READY@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	ldr	x9, [x19, #16]
	str	w8, [x9, #8]
	str	xzr, [x9]
	add	x21, x19, #8
	mov	x0, x21
	bl	_waitqueue_active
	cbz	x0, LBB0_3
; %bb.2:
	mov	x0, x21
	bl	_wake_up_interruptible
LBB0_3:
Lloh9:
	adrp	x0, l_.str.3@PAGE
Lloh10:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_DBG
Lloh11:
	adrp	x0, _cpia2_driver@GOTPAGE
Lloh12:
	ldr	x0, [x0, _cpia2_driver@GOTPAGEOFF]
	mov	x1, x20
	bl	_usb_driver_release_interface
	ldr	x8, [x19]
	cbnz	x8, LBB0_5
; %bb.4:
Lloh13:
	adrp	x0, l_.str.4@PAGE
Lloh14:
	add	x0, x0, l_.str.4@PAGEOFF
	bl	_DBG
	mov	x0, x19
	bl	_kfree
LBB0_5:
Lloh15:
	adrp	x0, l_.str.5@PAGE
Lloh16:
	add	x0, x0, l_.str.5@PAGEOFF
	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	_LOG
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpAdd	Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Stopping stream\n"

l_.str.1:                               ; @.str.1
	.asciz	"Unregistering camera\n"

l_.str.2:                               ; @.str.2
	.asciz	"Wakeup waiting processes\n"

	.comm	_FRAME_READY,4,2                ; @FRAME_READY
l_.str.3:                               ; @.str.3
	.asciz	"Releasing interface\n"

	.comm	_cpia2_driver,4,2               ; @cpia2_driver
l_.str.4:                               ; @.str.4
	.asciz	"Freeing camera structure\n"

l_.str.5:                               ; @.str.5
	.asciz	"CPiA2 camera disconnected.\n"

	.no_dead_strip	_cpia2_usb_disconnect
.subsections_via_symbols
