	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function stv_open
_stv_open:                              ## @stv_open
	.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, %r14
	callq	_video_devdata
	movq	%rax, %r12
	movq	%rax, %rdi
	callq	_video_get_drvdata
	movq	%rax, %rbx
	xorl	%eax, %eax
	callq	_lock_kernel
	movl	$1, (%rbx)
	movq	%rbx, %rdi
	callq	_stv_init
	movl	%eax, %r15d
	testl	%eax, %eax
	js	LBB0_5
## %bb.1:
	movq	_STV680_NUMFRAMES@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	imull	4(%rbx), %edi
	callq	_rvmalloc
	movl	%eax, 8(%rbx)
	testl	%eax, %eax
	jne	LBB0_3
## %bb.2:
	leaq	L_.str(%rip), %rsi
	xorl	%r15d, %r15d
	xorl	%edi, %edi
	callq	_PDEBUG
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	subl	(%rax), %r15d
LBB0_3:
	movq	%r12, (%r14)
	testl	%r15d, %r15d
	je	LBB0_4
LBB0_5:
	movl	$0, (%rbx)
	jmp	LBB0_6
LBB0_4:
	xorl	%r15d, %r15d
LBB0_6:
	xorl	%eax, %eax
	callq	_unlock_kernel
	movl	%r15d, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_STV680_NUMFRAMES,4,2           ## @STV680_NUMFRAMES
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"STV(e): Could not rvmalloc frame bufer"

	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.no_dead_strip	_stv_open
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function stv_open
_stv_open:                              ; @stv_open
	.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	x19, x0
	bl	_video_devdata
	mov	x21, x0
	bl	_video_get_drvdata
	mov	x20, x0
	bl	_lock_kernel
	mov	w8, #1
	str	w8, [x20]
	mov	x0, x20
	bl	_stv_init
	mov	x22, x0
	tbnz	w0, #31, LBB0_3
; %bb.1:
	ldr	w8, [x20, #4]
Lloh0:
	adrp	x9, _STV680_NUMFRAMES@GOTPAGE
Lloh1:
	ldr	x9, [x9, _STV680_NUMFRAMES@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	mul	w0, w9, w8
	bl	_rvmalloc
	str	w0, [x20, #8]
	cbz	w0, LBB0_5
; %bb.2:
	str	x21, [x19]
	cbz	w22, LBB0_4
LBB0_3:
	str	wzr, [x20]
LBB0_4:
	bl	_unlock_kernel
	mov	x0, x22
	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
	ret
LBB0_5:
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	bl	_PDEBUG
Lloh5:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh6:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	neg	w22, w8
	str	x21, [x19]
	cbnz	w22, LBB0_3
	b	LBB0_4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_STV680_NUMFRAMES,4,2           ; @STV680_NUMFRAMES
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"STV(e): Could not rvmalloc frame bufer"

	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.no_dead_strip	_stv_open
.subsections_via_symbols
