	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cpia_disconnect
_cpia_disconnect:                       ## @cpia_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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r15
	callq	_usb_get_intfdata
	movq	%rax, %r14
	movq	%r15, %rdi
	xorl	%esi, %esi
	callq	_usb_set_intfdata
	testq	%r14, %r14
	je	LBB0_6
## %bb.1:
	movq	(%r14), %rbx
	movq	_cam_list_lock_usb@GOTPCREL(%rip), %r12
	movq	%r12, %rdi
	callq	_spin_lock
	movq	%r14, %rdi
	addq	$8, %rdi
	callq	_list_del
	movq	%r12, %rdi
	callq	_spin_unlock
	movq	$0, 40(%rbx)
	movq	%r14, %rdi
	callq	_cpia_unregister_camera
	cmpq	$0, 32(%rbx)
	je	LBB0_3
## %bb.2:
	movq	(%r14), %rdi
	callq	_cpia_usb_close
LBB0_3:
	movq	_FRAME_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	16(%rbx), %rcx
	movl	%eax, (%rcx)
	leaq	24(%rbx), %r12
	movq	%r12, %rdi
	callq	_waitqueue_active
	testq	%rax, %rax
	je	LBB0_5
## %bb.4:
	movq	%r12, %rdi
	callq	_wake_up_interruptible
LBB0_5:
	movq	%r15, %rdi
	callq	_interface_to_usbdev
	xorps	%xmm0, %xmm0
	movups	%xmm0, 8(%rbx)
	movq	(%rbx), %rax
	movq	16(%rax), %rdi
	callq	_vfree
	movq	(%rbx), %rax
	movq	$0, 16(%rax)
	movq	(%rbx), %rax
	movq	8(%rax), %rdi
	callq	_vfree
	movq	(%rbx), %rax
	movq	$0, 8(%rax)
	movq	(%rbx), %rax
	movq	(%rax), %rdi
	callq	_vfree
	movq	(%rbx), %rax
	movq	$0, (%rax)
	movq	$0, (%r14)
	movq	%rbx, %rdi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_kfree                          ## TAILCALL
LBB0_6:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_cam_list_lock_usb,4,2          ## @cam_list_lock_usb
	.comm	_FRAME_ERROR,4,2                ## @FRAME_ERROR
	.no_dead_strip	_cpia_disconnect
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function cpia_disconnect
_cpia_disconnect:                       ; @cpia_disconnect
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x21, x0
	bl	_usb_get_intfdata
	mov	x19, x0
	mov	x0, x21
	mov	x1, #0
	bl	_usb_set_intfdata
	cbz	x19, LBB0_6
; %bb.1:
	mov	x22, x19
	ldr	x20, [x22], #8
Lloh0:
	adrp	x23, _cam_list_lock_usb@GOTPAGE
Lloh1:
	ldr	x23, [x23, _cam_list_lock_usb@GOTPAGEOFF]
	mov	x0, x23
	bl	_spin_lock
	mov	x0, x22
	bl	_list_del
	mov	x0, x23
	bl	_spin_unlock
	str	xzr, [x20, #40]
	mov	x0, x19
	bl	_cpia_unregister_camera
	ldr	x8, [x20, #32]
	cbz	x8, LBB0_3
; %bb.2:
	ldr	x0, [x19]
	bl	_cpia_usb_close
LBB0_3:
Lloh2:
	adrp	x8, _FRAME_ERROR@GOTPAGE
Lloh3:
	ldr	x8, [x8, _FRAME_ERROR@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	ldr	x9, [x20, #16]
	str	w8, [x9]
	add	x22, x20, #24
	mov	x0, x22
	bl	_waitqueue_active
	cbz	x0, LBB0_5
; %bb.4:
	mov	x0, x22
	bl	_wake_up_interruptible
LBB0_5:
	mov	x0, x21
	bl	_interface_to_usbdev
	stp	xzr, xzr, [x20, #8]
	ldr	x8, [x20]
	ldr	x0, [x8, #16]
	bl	_vfree
	ldr	x8, [x20]
	str	xzr, [x8, #16]
	ldr	x8, [x20]
	ldr	x0, [x8, #8]
	bl	_vfree
	ldr	x8, [x20]
	str	xzr, [x8, #8]
	ldr	x8, [x20]
	ldr	x0, [x8]
	bl	_vfree
	ldr	x8, [x20]
	str	xzr, [x8]
	str	xzr, [x19]
	mov	x0, x20
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	b	_kfree
LBB0_6:
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_cam_list_lock_usb,4,2          ; @cam_list_lock_usb
	.comm	_FRAME_ERROR,4,2                ; @FRAME_ERROR
	.no_dead_strip	_cpia_disconnect
.subsections_via_symbols
