	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function hdpvr_stop_streaming
_hdpvr_stop_streaming:                  ## @hdpvr_stop_streaming
	.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), %rax
	movq	_STATUS_IDLE@GOTPCREL(%rip), %r14
	xorl	%r13d, %r13d
	cmpq	(%r14), %rax
	je	LBB0_12
## %bb.1:
	movq	_STATUS_STREAMING@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_2
## %bb.3:
	movq	%rdi, %r12
	movl	12(%rdi), %edi
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_kmalloc
	movq	%rax, %r15
	testq	%rax, %rax
	jne	LBB0_5
## %bb.4:
	leaq	8(%r12), %rdi
	leaq	L_.str(%rip), %rsi
	callq	_v4l2_err
LBB0_5:
	movq	_STATUS_SHUTTING_DOWN@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, (%r12)
	movq	_CTRL_STOP_STREAMING_VALUE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%r13d, %r13d
	movq	%r12, %rdi
	xorl	%edx, %edx
	callq	_hdpvr_config_call
	leaq	24(%r12), %rbx
	movq	%rbx, %rdi
	callq	_mutex_unlock
	leaq	32(%r12), %rdi
	callq	_wake_up_interruptible
	movl	$50, %edi
	callq	_msleep
	leaq	28(%r12), %rdi
	callq	_flush_work
	movq	%rbx, %rdi
	callq	_mutex_lock
	movq	%r12, %rdi
	callq	_hdpvr_cancel_queue
	movl	$0, %ebx
	testq	%r15, %r15
	je	LBB0_11
## %bb.6:
	leaq	8(%r12), %r13
	movl	$1, %ebx
	.p2align	4, 0x90
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movl	16(%r12), %esi
	movl	20(%r12), %r14d
	movl	%r14d, %edi
	callq	_usb_rcvbulkpipe
	movl	12(%r12), %ecx
	movq	_BULK_URB_TIMEOUT@GOTPCREL(%rip), %rdx
	movl	(%rdx), %r9d
	movl	%r14d, %edi
	movl	%eax, %esi
	movq	%r15, %rdx
	leaq	-44(%rbp), %r8
	callq	_usb_bulk_msg
	testl	%eax, %eax
	jne	LBB0_10
## %bb.8:                               ##   in Loop: Header=BB0_7 Depth=1
	movq	_MSG_BUFFER@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_hdpvr_debug@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	-44(%rbp), %r9d
	movq	%r13, %rdx
	leaq	L_.str.1(%rip), %rcx
	movl	%ebx, %r8d
	xorl	%eax, %eax
	callq	_v4l2_dbg
	incl	%ebx
	cmpl	$500, %ebx                      ## imm = 0x1F4
	jne	LBB0_7
## %bb.9:
	movl	$500, %ebx                      ## imm = 0x1F4
LBB0_10:
	movq	_STATUS_IDLE@GOTPCREL(%rip), %r14
	xorl	%r13d, %r13d
LBB0_11:
	movq	%r15, %rdi
	callq	_kfree
	movq	_MSG_BUFFER@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_hdpvr_debug@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	8(%r12), %rdx
	decl	%ebx
	leaq	L_.str.2(%rip), %rcx
	movl	%ebx, %r8d
	xorl	%eax, %eax
	callq	_v4l2_dbg
	movl	$10, %edi
	callq	_msleep
	movq	(%r14), %rax
	movq	%rax, (%r12)
	jmp	LBB0_12
LBB0_2:
	movq	_EAGAIN@GOTPCREL(%rip), %rax
	xorl	%r13d, %r13d
	subl	(%rax), %r13d
LBB0_12:
	movl	%r13d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_STATUS_IDLE,8,3                ## @STATUS_IDLE
	.comm	_STATUS_STREAMING,8,3           ## @STATUS_STREAMING
	.comm	_EAGAIN,4,2                     ## @EAGAIN
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"failed to allocate temporary buffer for emptying the internal device buffer. Next capture start will be slow\n"

	.comm	_STATUS_SHUTTING_DOWN,8,3       ## @STATUS_SHUTTING_DOWN
	.comm	_CTRL_STOP_STREAMING_VALUE,4,2  ## @CTRL_STOP_STREAMING_VALUE
	.comm	_BULK_URB_TIMEOUT,4,2           ## @BULK_URB_TIMEOUT
	.comm	_MSG_BUFFER,4,2                 ## @MSG_BUFFER
	.comm	_hdpvr_debug,4,2                ## @hdpvr_debug
L_.str.1:                               ## @.str.1
	.asciz	"%2d: got %d bytes\n"

L_.str.2:                               ## @.str.2
	.asciz	"used %d urbs to empty device buffers\n"

	.no_dead_strip	_hdpvr_stop_streaming
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function hdpvr_stop_streaming
_hdpvr_stop_streaming:                  ; @hdpvr_stop_streaming
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	ldr	x8, [x0]
Lloh0:
	adrp	x25, _STATUS_IDLE@GOTPAGE
Lloh1:
	ldr	x25, [x25, _STATUS_IDLE@GOTPAGEOFF]
	ldr	x9, [x25]
	cmp	x8, x9
	b.ne	LBB0_2
; %bb.1:
	mov	w0, #0
	b	LBB0_12
LBB0_2:
Lloh2:
	adrp	x9, _STATUS_STREAMING@GOTPAGE
Lloh3:
	ldr	x9, [x9, _STATUS_STREAMING@GOTPAGEOFF]
Lloh4:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_9
; %bb.3:
	mov	x19, x0
	ldr	w0, [x0, #12]
Lloh5:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh6:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
	bl	_kmalloc
	mov	x20, x0
	cbnz	x0, LBB0_5
; %bb.4:
	add	x0, x19, #8
Lloh8:
	adrp	x1, l_.str@PAGE
Lloh9:
	add	x1, x1, l_.str@PAGEOFF
	bl	_v4l2_err
LBB0_5:
Lloh10:
	adrp	x8, _STATUS_SHUTTING_DOWN@GOTPAGE
Lloh11:
	ldr	x8, [x8, _STATUS_SHUTTING_DOWN@GOTPAGEOFF]
Lloh12:
	ldr	x8, [x8]
	mov	x21, x19
	str	x8, [x21], #28
Lloh13:
	adrp	x8, _CTRL_STOP_STREAMING_VALUE@GOTPAGE
Lloh14:
	ldr	x8, [x8, _CTRL_STOP_STREAMING_VALUE@GOTPAGEOFF]
Lloh15:
	ldr	w1, [x8]
	mov	x0, x19
	mov	w2, #0
	bl	_hdpvr_config_call
	add	x22, x19, #24
	mov	x0, x22
	bl	_mutex_unlock
	add	x0, x19, #32
	bl	_wake_up_interruptible
	mov	w0, #50
	bl	_msleep
	mov	x0, x21
	bl	_flush_work
	mov	x0, x22
	bl	_mutex_lock
	mov	x0, x19
	bl	_hdpvr_cancel_queue
Lloh16:
	adrp	x26, _MSG_BUFFER@GOTPAGE
Lloh17:
	ldr	x26, [x26, _MSG_BUFFER@GOTPAGEOFF]
Lloh18:
	adrp	x27, _hdpvr_debug@GOTPAGE
Lloh19:
	ldr	x27, [x27, _hdpvr_debug@GOTPAGEOFF]
	cbz	x20, LBB0_10
; %bb.6:
	add	x22, x19, #8
	mov	w21, #1
Lloh20:
	adrp	x28, _BULK_URB_TIMEOUT@GOTPAGE
Lloh21:
	ldr	x28, [x28, _BULK_URB_TIMEOUT@GOTPAGEOFF]
Lloh22:
	adrp	x23, l_.str.1@PAGE
Lloh23:
	add	x23, x23, l_.str.1@PAGEOFF
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	ldp	w1, w24, [x19, #16]
	mov	x0, x24
	bl	_usb_rcvbulkpipe
	mov	x1, x0
	ldr	w3, [x19, #12]
	ldr	w5, [x28]
	add	x4, sp, #12
	mov	x0, x24
	mov	x2, x20
	bl	_usb_bulk_msg
	cbnz	w0, LBB0_11
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=1
	ldr	w0, [x26]
	ldr	w1, [x27]
	ldr	w8, [sp, #12]
	str	x8, [sp]
	mov	x2, x22
	mov	x3, x23
	mov	x4, x21
	bl	_v4l2_dbg
	add	w21, w21, #1
	cmp	w21, #500
	b.ne	LBB0_7
	b	LBB0_11
LBB0_9:
Lloh24:
	adrp	x8, _EAGAIN@GOTPAGE
Lloh25:
	ldr	x8, [x8, _EAGAIN@GOTPAGEOFF]
Lloh26:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_12
LBB0_10:
	mov	w21, #0
LBB0_11:
	mov	x0, x20
	bl	_kfree
	ldr	w0, [x26]
	ldr	w1, [x27]
	add	x2, x19, #8
	sub	w4, w21, #1
Lloh27:
	adrp	x3, l_.str.2@PAGE
Lloh28:
	add	x3, x3, l_.str.2@PAGEOFF
	bl	_v4l2_dbg
	mov	w0, #10
	bl	_msleep
	mov	w0, #0
	ldr	x8, [x25]
	str	x8, [x19]
LBB0_12:
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpAdd	Lloh27, Lloh28
	.cfi_endproc
                                        ; -- End function
	.comm	_STATUS_IDLE,8,3                ; @STATUS_IDLE
	.comm	_STATUS_STREAMING,8,3           ; @STATUS_STREAMING
	.comm	_EAGAIN,4,2                     ; @EAGAIN
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"failed to allocate temporary buffer for emptying the internal device buffer. Next capture start will be slow\n"

	.comm	_STATUS_SHUTTING_DOWN,8,3       ; @STATUS_SHUTTING_DOWN
	.comm	_CTRL_STOP_STREAMING_VALUE,4,2  ; @CTRL_STOP_STREAMING_VALUE
	.comm	_BULK_URB_TIMEOUT,4,2           ; @BULK_URB_TIMEOUT
	.comm	_MSG_BUFFER,4,2                 ; @MSG_BUFFER
	.comm	_hdpvr_debug,4,2                ; @hdpvr_debug
l_.str.1:                               ; @.str.1
	.asciz	"%2d: got %d bytes\n"

l_.str.2:                               ; @.str.2
	.asciz	"used %d urbs to empty device buffers\n"

	.no_dead_strip	_hdpvr_stop_streaming
.subsections_via_symbols
