	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_set_video                      ## -- Begin function set_video
	.p2align	4, 0x90
_set_video:                             ## @set_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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	_boot_params@GOTPCREL(%rip), %r15
	movq	(%r15), %rbx
	xorl	%eax, %eax
	callq	_RESET_HEAP
	xorl	%eax, %eax
	callq	_store_mode_params
	xorl	%eax, %eax
	callq	_save_screen
	xorl	%edi, %edi
	callq	_probe_cards
	movq	_ASK_VGA@GOTPCREL(%rip), %r12
	movq	(%r12), %rax
	leaq	L_.str(%rip), %r14
	cmpq	%rax, %rbx
	jne	LBB0_3
	.p2align	4, 0x90
LBB0_2:
	xorl	%eax, %eax
	callq	_mode_menu
	movq	%rax, %rbx
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movq	%rbx, %rdi
	callq	_set_mode
	testl	%eax, %eax
	je	LBB0_5
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	%r14, %rdi
	movq	%rbx, %rsi
	callq	_printf
	movq	(%r12), %rax
	movq	%rax, %rbx
	cmpq	%rax, %rbx
	je	LBB0_2
	jmp	LBB0_3
LBB0_5:
	movq	%rbx, (%r15)
	xorl	%eax, %eax
	callq	_vesa_store_edid
	xorl	%eax, %eax
	callq	_store_mode_params
	movq	_do_restore@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_6
## %bb.7:
	xorl	%eax, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_restore_screen                 ## TAILCALL
LBB0_6:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_boot_params,8,3                ## @boot_params
	.comm	_ASK_VGA,8,3                    ## @ASK_VGA
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Undefined video mode number: %x\n"

	.comm	_do_restore,8,3                 ## @do_restore
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_set_video                      ; -- Begin function set_video
	.p2align	2
_set_video:                             ; @set_video
	.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
Lloh0:
	adrp	x21, _boot_params@GOTPAGE
Lloh1:
	ldr	x21, [x21, _boot_params@GOTPAGEOFF]
	ldr	x19, [x21]
	bl	_RESET_HEAP
	bl	_store_mode_params
	bl	_save_screen
	mov	w0, #0
	bl	_probe_cards
Lloh2:
	adrp	x22, _ASK_VGA@GOTPAGE
Lloh3:
	ldr	x22, [x22, _ASK_VGA@GOTPAGEOFF]
	ldr	x8, [x22]
Lloh4:
	adrp	x20, l_.str@PAGE
Lloh5:
	add	x20, x20, l_.str@PAGEOFF
	cmp	x19, x8
	b.ne	LBB0_2
LBB0_1:
	bl	_mode_menu
	mov	x19, x0
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x19
	bl	_set_mode
	cbz	w0, LBB0_4
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	mov	x0, x20
	mov	x1, x19
	bl	_printf
	ldr	x8, [x22]
	mov	x19, x8
	cmp	x19, x8
	b.eq	LBB0_1
	b	LBB0_2
LBB0_4:
	str	x19, [x21]
	bl	_vesa_store_edid
	bl	_store_mode_params
Lloh6:
	adrp	x8, _do_restore@GOTPAGE
Lloh7:
	ldr	x8, [x8, _do_restore@GOTPAGEOFF]
Lloh8:
	ldr	x8, [x8]
	cbz	x8, LBB0_6
; %bb.5:
	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
	b	_restore_screen
LBB0_6:
	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 AdrpAdd	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_boot_params,8,3                ; @boot_params
	.comm	_ASK_VGA,8,3                    ; @ASK_VGA
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Undefined video mode number: %x\n"

	.comm	_do_restore,8,3                 ; @do_restore
.subsections_via_symbols
