	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function stv_set_video_mode
_stv_set_video_mode:                    ## @stv_set_video_mode
	.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
	movq	%r14, %rdi
	movl	$1, %esi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	callq	_stv_set_config
	testl	%eax, %eax
	js	LBB0_3
## %bb.4:
	movl	$2, %edi
	movq	%r14, %rsi
	movl	$6, %edx
	movl	$256, %ecx                      ## imm = 0x100
	movq	%r15, %r8
	movl	$18, %r9d
	callq	_stv_sndctrl
	testl	%eax, %eax
	jg	LBB0_10
## %bb.5:
	cmpb	$83, 8(%r15)
	jne	LBB0_10
## %bb.6:
	cmpb	$5, 9(%r15)
	jne	LBB0_10
## %bb.7:
	leaq	L_.str.1(%rip), %rsi
	movl	$1, %edi
	callq	_PDEBUG
	jmp	LBB0_8
LBB0_1:
	leaq	L_.str(%rip), %rsi
	xorl	%edi, %edi
	callq	_PDEBUG
	movl	$-1, %ebx
	jmp	LBB0_13
LBB0_10:
	movq	%r14, %rdi
	movl	$1, %esi
	xorl	%edx, %edx
	movl	$1, %ecx
	callq	_stv_set_config
	testl	%eax, %eax
	js	LBB0_8
## %bb.11:
	xorl	%edi, %edi
	movq	%r14, %rsi
	movl	$133, %edx
	xorl	%ecx, %ecx
	movq	%r15, %r8
	movl	$16, %r9d
	callq	_stv_sndctrl
	cmpl	$16, %eax
	jne	LBB0_8
## %bb.12:
	leaq	L_.str.2(%rip), %rsi
	movl	$1, %edi
	callq	_PDEBUG
	movl	(%r14), %ecx
	movl	$1, %edi
	movq	%r14, %rsi
	movl	$9, %edx
	movq	%r15, %r8
	xorl	%r9d, %r9d
	callq	_stv_sndctrl
	movl	%eax, %ebx
	movq	%r15, %rdi
	callq	_kfree
	sarl	$31, %ebx
	jmp	LBB0_13
LBB0_8:
	movq	%r15, %rdi
	callq	_kfree
	movq	%r14, %rdi
	callq	_stv_stop_video
	movl	$-1, %ebx
	jmp	LBB0_13
LBB0_3:
	movl	%eax, %ebx
	movq	%r15, %rdi
	callq	_kfree
LBB0_13:
	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(e): Could not get descriptor 0100."

L_.str.2:                               ## @.str.2
	.asciz	"STV(i): Setting video mode."

	.no_dead_strip	_stv_set_video_mode
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function stv_set_video_mode
_stv_set_video_mode:                    ; @stv_set_video_mode
	.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
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_6
; %bb.1:
	mov	x20, x0
	mov	x0, x19
	mov	w1, #1
	mov	w2, #0
	mov	w3, #0
	bl	_stv_set_config
	tbnz	w0, #31, LBB0_11
; %bb.2:
	mov	w0, #2
	mov	x1, x19
	mov	w2, #6
	mov	w3, #256
	mov	x4, x20
	mov	w5, #18
	bl	_stv_sndctrl
	cmp	w0, #0
	b.gt	LBB0_7
; %bb.3:
	ldrb	w8, [x20, #8]
	cmp	w8, #83
	b.ne	LBB0_7
; %bb.4:
	ldrb	w8, [x20, #9]
	cmp	w8, #5
	b.ne	LBB0_7
; %bb.5:
Lloh3:
	adrp	x1, l_.str.1@PAGE
Lloh4:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	w0, #1
	bl	_PDEBUG
	b	LBB0_10
LBB0_6:
Lloh5:
	adrp	x1, l_.str@PAGE
Lloh6:
	add	x1, x1, l_.str@PAGEOFF
	bl	_PDEBUG
	mov	w21, #-1
	b	LBB0_12
LBB0_7:
	mov	x0, x19
	mov	w1, #1
	mov	w2, #0
	mov	w3, #1
	bl	_stv_set_config
	tbnz	w0, #31, LBB0_10
; %bb.8:
	mov	w0, #0
	mov	x1, x19
	mov	w2, #133
	mov	w3, #0
	mov	x4, x20
	mov	w5, #16
	bl	_stv_sndctrl
	cmp	w0, #16
	b.ne	LBB0_10
; %bb.9:
Lloh7:
	adrp	x1, l_.str.2@PAGE
Lloh8:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	w0, #1
	bl	_PDEBUG
	ldr	w3, [x19]
	mov	w0, #1
	mov	x1, x19
	mov	w2, #9
	mov	x4, x20
	mov	w5, #0
	bl	_stv_sndctrl
	mov	x19, x0
	mov	x0, x20
	bl	_kfree
	asr	w21, w19, #31
	b	LBB0_12
LBB0_10:
	mov	x0, x20
	bl	_kfree
	mov	x0, x19
	bl	_stv_stop_video
	mov	w21, #-1
	b	LBB0_12
LBB0_11:
	mov	x21, x0
	mov	x0, x20
	bl	_kfree
LBB0_12:
	mov	x0, x21
	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
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpAdd	Lloh7, Lloh8
	.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(e): Could not get descriptor 0100."

l_.str.2:                               ; @.str.2
	.asciz	"STV(i): Setting video mode."

	.no_dead_strip	_stv_set_video_mode
.subsections_via_symbols
