	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function vesa_set_mode
_vesa_set_mode:                         ## @vesa_set_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	%r12
	pushq	%rbx
	subq	$48, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movl	(%rdi), %ebx
	movq	_VIDEO_FIRST_VESA@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
	movq	_vminfo@GOTPCREL(%rip), %r15
	movq	%r15, %rdi
	xorl	%esi, %esi
	movl	$4, %edx
	callq	_memset
	leaq	-56(%rbp), %r12
	movq	%r12, %rdi
	callq	_initregs
	movl	$20225, -56(%rbp)               ## imm = 0x4F01
	movl	%ebx, -52(%rbp)
	movq	%r15, -48(%rbp)
	leaq	-80(%rbp), %rdx
	movl	$16, %edi
	movq	%r12, %rsi
	callq	_intcall
	movl	$-1, %r12d
	cmpl	$79, -80(%rbp)
	jne	LBB0_4
## %bb.1:
	movl	(%r15), %eax
	andl	$21, %eax
	cmpl	$5, %eax
	jne	LBB0_4
## %bb.2:
	leaq	-56(%rbp), %r15
	movq	%r15, %rdi
	callq	_initregs
	movl	$20226, -56(%rbp)               ## imm = 0x4F02
	movl	%ebx, -40(%rbp)
	leaq	-80(%rbp), %rdx
	movl	$16, %edi
	movq	%r15, %rsi
	callq	_intcall
	cmpl	$79, -80(%rbp)
	jne	LBB0_4
## %bb.3:
	movq	_graphic_mode@GOTPCREL(%rip), %rax
	movl	$0, (%rax)
	movl	8(%r14), %eax
	movq	_force_x@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
	movl	4(%r14), %eax
	movq	_force_y@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
	movq	_do_restore@GOTPCREL(%rip), %rax
	movl	$1, (%rax)
	xorl	%r12d, %r12d
LBB0_4:
	movl	%r12d, %eax
	addq	$48, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_VIDEO_FIRST_VESA,4,2           ## @VIDEO_FIRST_VESA
	.comm	_vminfo,4,2                     ## @vminfo
	.comm	_graphic_mode,4,2               ## @graphic_mode
	.comm	_force_x,4,2                    ## @force_x
	.comm	_force_y,4,2                    ## @force_y
	.comm	_do_restore,4,2                 ## @do_restore
	.no_dead_strip	_vesa_set_mode
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function vesa_set_mode
_vesa_set_mode:                         ; @vesa_set_mode
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	ldr	w8, [x0]
Lloh0:
	adrp	x9, _VIDEO_FIRST_VESA@GOTPAGE
Lloh1:
	ldr	x9, [x9, _VIDEO_FIRST_VESA@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	sub	w21, w8, w9
Lloh3:
	adrp	x20, _vminfo@GOTPAGE
Lloh4:
	ldr	x20, [x20, _vminfo@GOTPAGEOFF]
	mov	x0, x20
	mov	w1, #0
	mov	w2, #4
	bl	_memset
	add	x0, sp, #24
	bl	_initregs
	mov	w8, #20225
	stp	w8, w21, [sp, #24]
	str	x20, [sp, #32]
	add	x1, sp, #24
	mov	x2, sp
	mov	w0, #16
	bl	_intcall
	ldr	w8, [sp]
	cmp	w8, #79
	b.ne	LBB0_4
; %bb.1:
	ldr	w8, [x20]
	mov	w9, #21
	and	w8, w8, w9
	cmp	w8, #5
	b.ne	LBB0_4
; %bb.2:
	add	x0, sp, #24
	bl	_initregs
	mov	w8, #20226
	str	w8, [sp, #24]
	str	w21, [sp, #40]
	add	x1, sp, #24
	mov	x2, sp
	mov	w0, #16
	bl	_intcall
	ldr	w8, [sp]
	cmp	w8, #79
	b.ne	LBB0_4
; %bb.3:
	mov	w0, #0
Lloh5:
	adrp	x8, _graphic_mode@GOTPAGE
Lloh6:
	ldr	x8, [x8, _graphic_mode@GOTPAGEOFF]
Lloh7:
	str	wzr, [x8]
Lloh8:
	adrp	x8, _force_x@GOTPAGE
Lloh9:
	ldr	x8, [x8, _force_x@GOTPAGEOFF]
	ldp	w10, w9, [x19, #4]
Lloh10:
	adrp	x11, _force_y@GOTPAGE
Lloh11:
	ldr	x11, [x11, _force_y@GOTPAGEOFF]
Lloh12:
	str	w9, [x8]
Lloh13:
	str	w10, [x11]
Lloh14:
	adrp	x8, _do_restore@GOTPAGE
Lloh15:
	ldr	x8, [x8, _do_restore@GOTPAGEOFF]
	mov	w9, #1
Lloh16:
	str	w9, [x8]
	b	LBB0_5
LBB0_4:
	mov	w0, #-1
LBB0_5:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotStr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotStr	Lloh10, Lloh11, Lloh13
	.loh AdrpLdrGotStr	Lloh8, Lloh9, Lloh12
	.loh AdrpLdrGotStr	Lloh5, Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_VIDEO_FIRST_VESA,4,2           ; @VIDEO_FIRST_VESA
	.comm	_vminfo,4,2                     ; @vminfo
	.comm	_graphic_mode,4,2               ; @graphic_mode
	.comm	_force_x,4,2                    ; @force_x
	.comm	_force_y,4,2                    ; @force_y
	.comm	_do_restore,4,2                 ; @do_restore
	.no_dead_strip	_vesa_set_mode
.subsections_via_symbols
