	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ov51x_disconnect
_ov51x_disconnect:                      ## @ov51x_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	%r13
	pushq	%r12
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r15
	callq	_usb_get_intfdata
	movq	%rax, %r12
	leaq	L_.str(%rip), %rsi
	movl	$3, %edi
	callq	_PDEBUG
	leaq	40(%r12), %r14
	movq	%r14, %rdi
	callq	_mutex_lock
	movq	%r15, %rdi
	xorl	%esi, %esi
	callq	_usb_set_intfdata
	testq	%r12, %r12
	je	LBB0_13
## %bb.1:
	movb	(%r12), %cl
	movl	$-2, %eax
	roll	%cl, %eax
	movq	_ov511_devused@GOTPCREL(%rip), %rcx
	andl	%eax, (%rcx)
	movq	72(%r12), %rdi
	testq	%rdi, %rdi
	je	LBB0_3
## %bb.2:
	callq	_video_unregister_device
LBB0_3:
	movq	_OV511_NUMFRAMES@GOTPCREL(%rip), %r15
	cmpl	$0, (%r15)
	jle	LBB0_4
## %bb.5:
	movq	64(%r12), %rax
	xorl	%ecx, %ecx
	movq	_FRAME_ERROR@GOTPCREL(%rip), %rdx
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%rdx), %esi
	movl	%esi, 4(%rax,%rcx,8)
	incq	%rcx
	movslq	(%r15), %rsi
	cmpq	%rsi, %rcx
	jl	LBB0_6
## %bb.7:
	movl	$-1, 4(%r12)
	testl	%esi, %esi
	jle	LBB0_10
## %bb.8:
	xorl	%r13d, %r13d
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	movq	64(%r12), %rdi
	addq	%r13, %rdi
	callq	_wake_up_interruptible
	incq	%rbx
	movslq	(%r15), %rax
	addq	$8, %r13
	cmpq	%rax, %rbx
	jl	LBB0_9
	jmp	LBB0_10
LBB0_13:
	movq	%r14, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_mutex_unlock                   ## TAILCALL
LBB0_4:
	movl	$-1, 4(%r12)
LBB0_10:
	leaq	56(%r12), %rdi
	callq	_wake_up_interruptible
	movq	$0, 48(%r12)
	movq	%r12, %rdi
	callq	_ov51x_unlink_isoc
	movq	%r14, %rdi
	callq	_mutex_unlock
	movq	$0, 32(%r12)
	cmpl	$0, 24(%r12)
	jne	LBB0_12
## %bb.11:
	movq	%r12, %r14
	addq	$8, %r14
	movq	%r14, %rdi
	callq	_mutex_lock
	movq	16(%r12), %rdi
	callq	_kfree
	movq	$0, 16(%r12)
	movq	%r14, %rdi
	callq	_mutex_unlock
	movq	%r12, %rdi
	callq	_ov51x_dealloc
	movq	%r12, %rdi
	callq	_kfree
LBB0_12:
	leaq	L_.str.1(%rip), %rsi
	movl	$3, %edi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_PDEBUG                         ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.space	1

	.comm	_ov511_devused,4,2              ## @ov511_devused
	.comm	_OV511_NUMFRAMES,4,2            ## @OV511_NUMFRAMES
	.comm	_FRAME_ERROR,4,2                ## @FRAME_ERROR
L_.str.1:                               ## @.str.1
	.asciz	"Disconnect complete"

	.no_dead_strip	_ov51x_disconnect
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ov51x_disconnect
_ov51x_disconnect:                      ; @ov51x_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
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	w0, #3
	bl	_PDEBUG
	add	x20, x19, #40
	mov	x0, x20
	bl	_mutex_lock
	mov	x0, x21
	mov	x1, #0
	bl	_usb_set_intfdata
	cbz	x19, LBB0_9
; %bb.1:
	ldr	w8, [x19]
	mov	w9, #1
	lsl	w8, w9, w8
Lloh2:
	adrp	x9, _ov511_devused@GOTPAGE
Lloh3:
	ldr	x9, [x9, _ov511_devused@GOTPAGEOFF]
	ldr	w10, [x9]
	bic	w8, w10, w8
	str	w8, [x9]
	ldr	x0, [x19, #72]
	cbz	x0, LBB0_3
; %bb.2:
	bl	_video_unregister_device
LBB0_3:
Lloh4:
	adrp	x21, _OV511_NUMFRAMES@GOTPAGE
Lloh5:
	ldr	x21, [x21, _OV511_NUMFRAMES@GOTPAGEOFF]
	ldr	w8, [x21]
	cmp	w8, #0
	b.le	LBB0_10
; %bb.4:
	mov	x8, #0
	ldr	x9, [x19, #64]
	add	x9, x9, #4
Lloh6:
	adrp	x10, _FRAME_ERROR@GOTPAGE
Lloh7:
	ldr	x10, [x10, _FRAME_ERROR@GOTPAGEOFF]
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w11, [x10]
	str	w11, [x9], #8
	add	x8, x8, #1
	ldrsw	x11, [x21]
	cmp	x8, x11
	b.lt	LBB0_5
; %bb.6:
	mov	w8, #-1
	str	w8, [x19, #4]
	cmp	w11, #1
	b.lt	LBB0_11
; %bb.7:
	mov	x22, #0
	mov	x23, #0
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #64]
	add	x0, x8, x22
	bl	_wake_up_interruptible
	add	x23, x23, #1
	ldrsw	x8, [x21]
	add	x22, x22, #8
	cmp	x23, x8
	b.lt	LBB0_8
	b	LBB0_11
LBB0_9:
	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	_mutex_unlock
LBB0_10:
	mov	w8, #-1
	str	w8, [x19, #4]
LBB0_11:
	add	x0, x19, #56
	bl	_wake_up_interruptible
	str	xzr, [x19, #48]
	mov	x0, x19
	bl	_ov51x_unlink_isoc
	mov	x0, x20
	bl	_mutex_unlock
	str	xzr, [x19, #32]
	ldr	w8, [x19, #24]
	cbnz	w8, LBB0_13
; %bb.12:
	add	x20, x19, #8
	mov	x0, x20
	bl	_mutex_lock
	ldr	x0, [x19, #16]
	bl	_kfree
	str	xzr, [x19, #16]
	mov	x0, x20
	bl	_mutex_unlock
	mov	x0, x19
	bl	_ov51x_dealloc
	mov	x0, x19
	bl	_kfree
LBB0_13:
Lloh8:
	adrp	x1, l_.str.1@PAGE
Lloh9:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	w0, #3
	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	_PDEBUG
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.space	1

	.comm	_ov511_devused,4,2              ; @ov511_devused
	.comm	_OV511_NUMFRAMES,4,2            ; @OV511_NUMFRAMES
	.comm	_FRAME_ERROR,4,2                ; @FRAME_ERROR
l_.str.1:                               ; @.str.1
	.asciz	"Disconnect complete"

	.no_dead_strip	_ov51x_disconnect
.subsections_via_symbols
