	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function vbox_do_modeset
_vbox_do_modeset:                       ## @vbox_do_modeset
	.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	%r13
	pushq	%r12
	pushq	%rbx
	subq	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movq	24(%rdi), %rax
	movq	(%rax), %rax
	movq	(%rax), %r13
	callq	_to_vbox_crtc
	movq	%rax, %r15
	movq	16(%r14), %rax
	movq	(%rax), %r8
	movl	(%r15), %eax
	movl	4(%r15), %ecx
	testl	%eax, %eax
	movl	$640, %r11d                     ## imm = 0x280
	cmovnel	%eax, %r11d
	testl	%ecx, %ecx
	movl	$480, %eax                      ## imm = 0x1E0
	cmovnel	%ecx, %eax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	testq	%r13, %r13
	je	LBB0_2
## %bb.1:
	movq	(%r13), %rax
	movq	8(%r13), %rcx
	movq	(%rcx), %rcx
	movl	(%rcx), %r12d
	shll	$3, %r12d
	movl	(%rax), %r9d
	jmp	LBB0_3
LBB0_2:
	leal	(,%r11,4), %r9d
	movl	$32, %r12d
LBB0_3:
	xorl	%eax, %eax
	cmpq	$0, 8(%r8)
	sete	%al
	movl	8(%r15,%rax,4), %r10d
	movl	16(%r15,%rax,4), %ecx
	cmpq	$0, 24(%r15)
	jne	LBB0_8
## %bb.4:
	testq	%r13, %r13
	je	LBB0_8
## %bb.5:
	movl	32(%r15), %edi
	movl	%edi, %eax
	cltd
	idivl	%r9d
	movl	$65535, %edx                    ## imm = 0xFFFF
	subl	(%r14), %edx
	cmpl	%edx, %eax
	jge	LBB0_8
## %bb.6:
	leal	7(%r12), %esi
	testl	%r12d, %r12d
	cmovnsl	%r12d, %esi
	sarl	$3, %esi
	movl	%edi, %eax
	cltd
	idivl	%esi
	testl	%edx, %edx
	jne	LBB0_8
## %bb.7:
	movq	_VBE_DISPI_INDEX_XRES@GOTPCREL(%rip), %rax
	movq	%r8, -72(%rbp)                  ## 8-byte Spill
	movl	(%rax), %edi
	movl	%r11d, %esi
	movq	%r9, -48(%rbp)                  ## 8-byte Spill
	movl	%r10d, -56(%rbp)                ## 4-byte Spill
	movl	%ecx, -52(%rbp)                 ## 4-byte Spill
	movq	%r11, %rbx
	callq	_vbox_write_ioport
	movq	_VBE_DISPI_INDEX_YRES@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	-64(%rbp), %rsi                 ## 8-byte Reload
                                        ## kill: def $esi killed $esi killed $rsi
	callq	_vbox_write_ioport
	movq	_VBE_DISPI_INDEX_VIRT_WIDTH@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	leal	(,%rax,8), %eax
	cltd
	idivl	%r12d
	movl	%eax, %esi
	callq	_vbox_write_ioport
	movq	_VBE_DISPI_INDEX_BPP@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	%r12d, %esi
	callq	_vbox_write_ioport
	movq	_VBE_DISPI_INDEX_ENABLE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_VBE_DISPI_ENABLED@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_vbox_write_ioport
	movq	_VBE_DISPI_INDEX_X_OFFSET@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	32(%r15), %eax
	cltd
	idivl	-48(%rbp)                       ## 4-byte Folded Reload
	movl	%edx, %eax
	cltd
	idivl	%r12d
                                        ## kill: def $eax killed $eax def $rax
	leal	(,%rax,8), %esi
	addl	8(%r15), %esi
	callq	_vbox_write_ioport
	movq	_VBE_DISPI_INDEX_Y_OFFSET@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	32(%r15), %eax
	cltd
	idivl	-48(%rbp)                       ## 4-byte Folded Reload
	addl	16(%r15), %eax
	movl	%eax, %esi
	callq	_vbox_write_ioport
	movq	%rbx, %r11
	movl	-52(%rbp), %ecx                 ## 4-byte Reload
	movl	-56(%rbp), %r10d                ## 4-byte Reload
	movq	-48(%rbp), %r9                  ## 8-byte Reload
	movq	-72(%rbp), %r8                  ## 8-byte Reload
LBB0_8:
	movq	_VBVA_SCREEN_F_ACTIVE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	testq	%r13, %r13
	je	LBB0_10
## %bb.9:
	movq	8(%r14), %rdx
	xorl	%eax, %eax
	cmpq	$0, (%rdx)
	jne	LBB0_11
LBB0_10:
	movq	_VBVA_SCREEN_F_BLANK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
LBB0_11:
	orl	%esi, %eax
	xorl	%edx, %edx
	cmpq	$0, 40(%r15)
	je	LBB0_13
## %bb.12:
	movq	_VBVA_SCREEN_F_DISABLED@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
LBB0_13:
	orl	%edx, %eax
	movl	(%r8), %edi
	movq	24(%r15), %rsi
	movl	8(%r15), %ebx
	imull	%r12d, %ebx
	leal	7(%rbx), %edx
	testl	%ebx, %ebx
	cmovnsl	%ebx, %edx
	sarl	$3, %edx
	movl	16(%r15), %r8d
	imull	%r9d, %r8d
	addl	%edx, %r8d
	movl	%r10d, %edx
                                        ## kill: def $r9d killed $r9d killed $r9
	pushq	%rax
	pushq	%r12
	pushq	-64(%rbp)                       ## 8-byte Folded Reload
	pushq	%r11
	callq	_hgsmi_process_display_info
	addq	$72, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_VBE_DISPI_INDEX_XRES,4,2       ## @VBE_DISPI_INDEX_XRES
	.comm	_VBE_DISPI_INDEX_YRES,4,2       ## @VBE_DISPI_INDEX_YRES
	.comm	_VBE_DISPI_INDEX_VIRT_WIDTH,4,2 ## @VBE_DISPI_INDEX_VIRT_WIDTH
	.comm	_VBE_DISPI_INDEX_BPP,4,2        ## @VBE_DISPI_INDEX_BPP
	.comm	_VBE_DISPI_INDEX_ENABLE,4,2     ## @VBE_DISPI_INDEX_ENABLE
	.comm	_VBE_DISPI_ENABLED,4,2          ## @VBE_DISPI_ENABLED
	.comm	_VBE_DISPI_INDEX_X_OFFSET,4,2   ## @VBE_DISPI_INDEX_X_OFFSET
	.comm	_VBE_DISPI_INDEX_Y_OFFSET,4,2   ## @VBE_DISPI_INDEX_Y_OFFSET
	.comm	_VBVA_SCREEN_F_ACTIVE,4,2       ## @VBVA_SCREEN_F_ACTIVE
	.comm	_VBVA_SCREEN_F_BLANK,4,2        ## @VBVA_SCREEN_F_BLANK
	.comm	_VBVA_SCREEN_F_DISABLED,4,2     ## @VBVA_SCREEN_F_DISABLED
	.no_dead_strip	_vbox_do_modeset
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function vbox_do_modeset
_vbox_do_modeset:                       ; @vbox_do_modeset
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x24, x0
	ldr	x8, [x0, #24]
	ldr	x8, [x8]
	ldr	x28, [x8]
	bl	_to_vbox_crtc
	mov	x21, x0
	ldr	x8, [x24, #16]
	ldr	x27, [x8]
	mov	w8, #640
	ldp	w9, w10, [x0]
	cmp	w9, #0
	csel	w19, w8, w9, eq
	mov	w8, #480
	cmp	w10, #0
	csel	w20, w8, w10, eq
	cbz	x28, LBB0_2
; %bb.1:
	ldp	x9, x8, [x28]
	ldr	x8, [x8]
	ldr	w8, [x8]
	lsl	w23, w8, #3
	ldr	w22, [x9]
	b	LBB0_3
LBB0_2:
	lsl	w22, w19, #2
	mov	w23, #32
LBB0_3:
	ldr	x8, [x27, #8]
	mov	w9, #8
	mov	w10, #12
	cmp	x8, #0
	csel	x8, x10, x9, eq
	ldr	w25, [x21, x8]
	mov	w8, #16
	mov	w9, #20
	csel	x8, x9, x8, eq
	ldr	w26, [x21, x8]
	ldr	x8, [x21, #24]
	cbnz	x8, LBB0_8
; %bb.4:
	cbz	x28, LBB0_8
; %bb.5:
	ldr	w8, [x21, #32]
	sdiv	w9, w8, w22
	ldr	w10, [x24]
	mov	w11, #65535
	sub	w10, w11, w10
	cmp	w9, w10
	b.ge	LBB0_8
; %bb.6:
	add	w9, w23, #7
	cmp	w23, #0
	csel	w9, w9, w23, lt
	asr	w9, w9, #3
	sdiv	w10, w8, w9
	msub	w8, w10, w9, w8
	cbnz	w8, LBB0_8
; %bb.7:
Lloh0:
	adrp	x8, _VBE_DISPI_INDEX_XRES@GOTPAGE
Lloh1:
	ldr	x8, [x8, _VBE_DISPI_INDEX_XRES@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	mov	x1, x19
	bl	_vbox_write_ioport
Lloh3:
	adrp	x8, _VBE_DISPI_INDEX_YRES@GOTPAGE
Lloh4:
	ldr	x8, [x8, _VBE_DISPI_INDEX_YRES@GOTPAGEOFF]
Lloh5:
	ldr	w0, [x8]
	mov	x1, x20
	bl	_vbox_write_ioport
Lloh6:
	adrp	x8, _VBE_DISPI_INDEX_VIRT_WIDTH@GOTPAGE
Lloh7:
	ldr	x8, [x8, _VBE_DISPI_INDEX_VIRT_WIDTH@GOTPAGEOFF]
Lloh8:
	ldr	w0, [x8]
	lsl	w8, w22, #3
	sdiv	w1, w8, w23
	bl	_vbox_write_ioport
Lloh9:
	adrp	x8, _VBE_DISPI_INDEX_BPP@GOTPAGE
Lloh10:
	ldr	x8, [x8, _VBE_DISPI_INDEX_BPP@GOTPAGEOFF]
Lloh11:
	ldr	w0, [x8]
	mov	x1, x23
	bl	_vbox_write_ioport
Lloh12:
	adrp	x8, _VBE_DISPI_INDEX_ENABLE@GOTPAGE
Lloh13:
	ldr	x8, [x8, _VBE_DISPI_INDEX_ENABLE@GOTPAGEOFF]
Lloh14:
	ldr	w0, [x8]
Lloh15:
	adrp	x8, _VBE_DISPI_ENABLED@GOTPAGE
Lloh16:
	ldr	x8, [x8, _VBE_DISPI_ENABLED@GOTPAGEOFF]
Lloh17:
	ldr	w1, [x8]
	bl	_vbox_write_ioport
Lloh18:
	adrp	x8, _VBE_DISPI_INDEX_X_OFFSET@GOTPAGE
Lloh19:
	ldr	x8, [x8, _VBE_DISPI_INDEX_X_OFFSET@GOTPAGEOFF]
Lloh20:
	ldr	w0, [x8]
	ldr	w8, [x21, #32]
	sdiv	w9, w8, w22
	msub	w8, w9, w22, w8
	sdiv	w8, w8, w23
	ldr	w9, [x21, #8]
	add	w1, w9, w8, lsl #3
	bl	_vbox_write_ioport
Lloh21:
	adrp	x8, _VBE_DISPI_INDEX_Y_OFFSET@GOTPAGE
Lloh22:
	ldr	x8, [x8, _VBE_DISPI_INDEX_Y_OFFSET@GOTPAGEOFF]
Lloh23:
	ldr	w0, [x8]
	ldr	w8, [x21, #32]
	sdiv	w8, w8, w22
	ldr	w9, [x21, #16]
	add	w1, w9, w8
	bl	_vbox_write_ioport
LBB0_8:
Lloh24:
	adrp	x8, _VBVA_SCREEN_F_ACTIVE@GOTPAGE
Lloh25:
	ldr	x8, [x8, _VBVA_SCREEN_F_ACTIVE@GOTPAGEOFF]
Lloh26:
	ldr	w8, [x8]
	cbz	x28, LBB0_11
; %bb.9:
	ldr	x9, [x24, #8]
	ldr	x9, [x9]
	cbz	x9, LBB0_11
; %bb.10:
	mov	w9, #0
	b	LBB0_12
LBB0_11:
Lloh27:
	adrp	x9, _VBVA_SCREEN_F_BLANK@GOTPAGE
Lloh28:
	ldr	x9, [x9, _VBVA_SCREEN_F_BLANK@GOTPAGEOFF]
Lloh29:
	ldr	w9, [x9]
LBB0_12:
	orr	w8, w9, w8
	ldr	x9, [x21, #40]
Lloh30:
	adrp	x10, _VBVA_SCREEN_F_DISABLED@GOTPAGE
Lloh31:
	ldr	x10, [x10, _VBVA_SCREEN_F_DISABLED@GOTPAGEOFF]
Lloh32:
	ldr	w10, [x10]
	cmp	x9, #0
	csel	w9, wzr, w10, eq
	orr	w8, w8, w9
	ldr	w0, [x27]
	ldr	x1, [x21, #24]
	ldr	w9, [x21, #8]
	mul	w9, w9, w23
	add	w10, w9, #7
	cmp	w9, #0
	csel	w9, w10, w9, lt
	ldr	w10, [x21, #16]
	mul	w10, w10, w22
	add	w4, w10, w9, asr #3
	stp	w23, w8, [sp]
	mov	x2, x25
	mov	x3, x26
	mov	x5, x22
	mov	x6, x19
	mov	x7, x20
	bl	_hgsmi_process_display_info
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.cfi_endproc
                                        ; -- End function
	.comm	_VBE_DISPI_INDEX_XRES,4,2       ; @VBE_DISPI_INDEX_XRES
	.comm	_VBE_DISPI_INDEX_YRES,4,2       ; @VBE_DISPI_INDEX_YRES
	.comm	_VBE_DISPI_INDEX_VIRT_WIDTH,4,2 ; @VBE_DISPI_INDEX_VIRT_WIDTH
	.comm	_VBE_DISPI_INDEX_BPP,4,2        ; @VBE_DISPI_INDEX_BPP
	.comm	_VBE_DISPI_INDEX_ENABLE,4,2     ; @VBE_DISPI_INDEX_ENABLE
	.comm	_VBE_DISPI_ENABLED,4,2          ; @VBE_DISPI_ENABLED
	.comm	_VBE_DISPI_INDEX_X_OFFSET,4,2   ; @VBE_DISPI_INDEX_X_OFFSET
	.comm	_VBE_DISPI_INDEX_Y_OFFSET,4,2   ; @VBE_DISPI_INDEX_Y_OFFSET
	.comm	_VBVA_SCREEN_F_ACTIVE,4,2       ; @VBVA_SCREEN_F_ACTIVE
	.comm	_VBVA_SCREEN_F_BLANK,4,2        ; @VBVA_SCREEN_F_BLANK
	.comm	_VBVA_SCREEN_F_DISABLED,4,2     ; @VBVA_SCREEN_F_DISABLED
	.no_dead_strip	_vbox_do_modeset
.subsections_via_symbols
