	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function stv_stop_video
_stv_stop_video:                        ## @stv_stop_video
	.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, %r14
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$40, %edi
	callq	_kmalloc
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %r15
	movl	$1, %edi
	movq	%r14, %rsi
	movl	$4, %edx
	xorl	%ecx, %ecx
	movq	%rax, %r8
	xorl	%r9d, %r9d
	callq	_stv_sndctrl
	testl	%eax, %eax
	js	LBB0_3
## %bb.4:
	leaq	L_.str.2(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	callq	_PDEBUG
	jmp	LBB0_5
LBB0_1:
	leaq	L_.str(%rip), %rsi
	xorl	%edi, %edi
	xorl	%eax, %eax
	callq	_PDEBUG
	movl	$-1, %ebx
	jmp	LBB0_17
LBB0_3:
	xorl	%edi, %edi
	movq	%r14, %rsi
	movl	$128, %edx
	xorl	%ecx, %ecx
	movq	%r15, %r8
	movl	$2, %r9d
	callq	_stv_sndctrl
	movzbl	(%r15), %edx
	movzbl	1(%r15), %ecx
	leaq	L_.str.1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	callq	_PDEBUG
LBB0_5:
	movq	%r14, %rdi
	movl	$1, %esi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	callq	_stv_set_config
	testl	%eax, %eax
	jns	LBB0_7
## %bb.6:
	leaq	L_.str.3(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	callq	_PDEBUG
LBB0_7:
	movb	$-16, (%r15)
	xorl	%edi, %edi
	movq	%r14, %rsi
	movl	$135, %edx
	xorl	%ecx, %ecx
	movq	%r15, %r8
	movl	$8, %r9d
	callq	_stv_sndctrl
	movl	%eax, %ebx
	cmpl	$8, %eax
	je	LBB0_9
## %bb.8:
	leaq	L_.str.4(%rip), %rsi
	xorl	%edi, %edi
	xorl	%eax, %eax
	callq	_PDEBUG
LBB0_9:
	movb	(%r14), %al
	cmpb	(%r15), %al
	je	LBB0_16
## %bb.10:
	movq	%r15, %rdi
	xorl	%esi, %esi
	movl	$8, %edx
	callq	_memset
	movb	(%r14), %al
	movb	%al, (%r15)
	movl	$3, %edi
	movq	%r14, %rsi
	movl	$7, %edx
	movl	$256, %ecx                      ## imm = 0x100
	movq	%r15, %r8
	movl	$8, %r9d
	callq	_stv_sndctrl
	cmpl	$8, %eax
	je	LBB0_12
## %bb.11:
	leaq	L_.str.5(%rip), %rsi
	xorl	%edi, %edi
	xorl	%eax, %eax
	callq	_PDEBUG
LBB0_12:
	movb	$-16, (%r15)
	xorl	%edi, %edi
	movq	%r14, %rsi
	movl	$135, %edx
	xorl	%ecx, %ecx
	movq	%r15, %r8
	movl	$8, %r9d
	callq	_stv_sndctrl
	cmpl	$8, %eax
	jne	LBB0_13
## %bb.14:
	movb	(%r15), %al
	xorl	%ecx, %ecx
	cmpb	(%r14), %al
	sete	%cl
	leaq	L_.str.7(%rip), %rax
	leaq	L_.str.6(%rip), %rsi
	cmoveq	%rax, %rsi
	leal	(%rcx,%rcx,8), %ebx
	decl	%ebx
	jmp	LBB0_15
LBB0_13:
	movl	$-1, %ebx
	leaq	L_.str.6(%rip), %rsi
LBB0_15:
	xorl	%edi, %edi
	xorl	%eax, %eax
	callq	_PDEBUG
LBB0_16:
	movq	%r15, %rdi
	callq	_kfree
LBB0_17:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"STV(e): Out of (small buf) memory"

L_.str.1:                               ## @.str.1
	.asciz	"STV(i): last error: %i,  command = 0x%x"

L_.str.2:                               ## @.str.2
	.asciz	"STV(i): Camera reset to idle mode."

L_.str.3:                               ## @.str.3
	.asciz	"STV(e): Reset config during exit failed"

L_.str.4:                               ## @.str.4
	.asciz	"STV(e): Stop_video: problem setting original mode"

L_.str.5:                               ## @.str.5
	.asciz	"STV(e): Stop_video: Set_Camera_Mode failed"

L_.str.6:                               ## @.str.6
	.asciz	"STV(e): camera NOT set to original resolution."

L_.str.7:                               ## @.str.7
	.asciz	"STV(i): Camera set to original resolution"

	.no_dead_strip	_stv_stop_video
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function stv_stop_video
_stv_stop_video:                        ; @stv_stop_video
	.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
	mov	x20, x0
Lloh0:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	w0, #40
	bl	_kmalloc
	cbz	x0, LBB0_3
; %bb.1:
	mov	x19, x0
	mov	w0, #1
	mov	x1, x20
	mov	w2, #4
	mov	w3, #0
	mov	x4, x19
	mov	w5, #0
	bl	_stv_sndctrl
	tbnz	w0, #31, LBB0_4
; %bb.2:
Lloh3:
	adrp	x1, l_.str.2@PAGE
Lloh4:
	add	x1, x1, l_.str.2@PAGEOFF
	b	LBB0_5
LBB0_3:
Lloh5:
	adrp	x1, l_.str@PAGE
Lloh6:
	add	x1, x1, l_.str@PAGEOFF
	bl	_PDEBUG
	mov	w21, #-1
	b	LBB0_17
LBB0_4:
	mov	w0, #0
	mov	x1, x20
	mov	w2, #128
	mov	w3, #0
	mov	x4, x19
	mov	w5, #2
	bl	_stv_sndctrl
	ldrb	w8, [x19]
	ldrb	w9, [x19, #1]
	stp	x8, x9, [sp]
Lloh7:
	adrp	x1, l_.str.1@PAGE
Lloh8:
	add	x1, x1, l_.str.1@PAGEOFF
LBB0_5:
	mov	w0, #1
	bl	_PDEBUG
	mov	x0, x20
	mov	w1, #1
	mov	w2, #0
	mov	w3, #0
	bl	_stv_set_config
	tbz	w0, #31, LBB0_7
; %bb.6:
Lloh9:
	adrp	x1, l_.str.3@PAGE
Lloh10:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	w0, #1
	bl	_PDEBUG
LBB0_7:
	mov	w8, #240
	strb	w8, [x19]
	mov	w0, #0
	mov	x1, x20
	mov	w2, #135
	mov	w3, #0
	mov	x4, x19
	mov	w5, #8
	bl	_stv_sndctrl
	mov	x21, x0
	cmp	w0, #8
	b.eq	LBB0_9
; %bb.8:
Lloh11:
	adrp	x1, l_.str.4@PAGE
Lloh12:
	add	x1, x1, l_.str.4@PAGEOFF
	mov	w0, #0
	bl	_PDEBUG
LBB0_9:
	ldrb	w8, [x20]
	ldrb	w9, [x19]
	cmp	w8, w9
	b.eq	LBB0_16
; %bb.10:
	mov	x0, x19
	mov	w1, #0
	mov	w2, #8
	bl	_memset
	ldrb	w8, [x20]
	strb	w8, [x19]
	mov	w0, #3
	mov	x1, x20
	mov	w2, #7
	mov	w3, #256
	mov	x4, x19
	mov	w5, #8
	bl	_stv_sndctrl
	cmp	w0, #8
	b.eq	LBB0_12
; %bb.11:
Lloh13:
	adrp	x1, l_.str.5@PAGE
Lloh14:
	add	x1, x1, l_.str.5@PAGEOFF
	mov	w0, #0
	bl	_PDEBUG
LBB0_12:
	mov	w8, #240
	strb	w8, [x19]
	mov	w21, #8
	mov	w0, #0
	mov	x1, x20
	mov	w2, #135
	mov	w3, #0
	mov	x4, x19
	mov	w5, #8
	bl	_stv_sndctrl
Lloh15:
	adrp	x1, l_.str.6@PAGE
Lloh16:
	add	x1, x1, l_.str.6@PAGEOFF
	cmp	w0, #8
	b.ne	LBB0_14
; %bb.13:
	ldrb	w8, [x19]
	ldrb	w9, [x20]
Lloh17:
	adrp	x10, l_.str.7@PAGE
Lloh18:
	add	x10, x10, l_.str.7@PAGEOFF
	cmp	w8, w9
	csel	x1, x10, x1, eq
	csinv	w21, w21, wzr, eq
	b	LBB0_15
LBB0_14:
	mov	w21, #-1
LBB0_15:
	mov	w0, #0
	bl	_PDEBUG
LBB0_16:
	mov	x0, x19
	bl	_kfree
LBB0_17:
	mov	x0, x21
	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 AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpAdd	Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"STV(e): Out of (small buf) memory"

l_.str.1:                               ; @.str.1
	.asciz	"STV(i): last error: %i,  command = 0x%x"

l_.str.2:                               ; @.str.2
	.asciz	"STV(i): Camera reset to idle mode."

l_.str.3:                               ; @.str.3
	.asciz	"STV(e): Reset config during exit failed"

l_.str.4:                               ; @.str.4
	.asciz	"STV(e): Stop_video: problem setting original mode"

l_.str.5:                               ; @.str.5
	.asciz	"STV(e): Stop_video: Set_Camera_Mode failed"

l_.str.6:                               ; @.str.6
	.asciz	"STV(e): camera NOT set to original resolution."

l_.str.7:                               ; @.str.7
	.asciz	"STV(i): Camera set to original resolution"

	.no_dead_strip	_stv_stop_video
.subsections_via_symbols
