	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function SetVideoMode
_SetVideoMode:                          ## @SetVideoMode
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%r9d, -48(%rbp)                 ## 4-byte Spill
	movl	%r8d, -44(%rbp)                 ## 4-byte Spill
	movl	%ecx, %r15d
	movq	%rdi, -56(%rbp)                 ## 8-byte Spill
	movq	_VIDEOMODE_actual_width@GOTPCREL(%rip), %rax
	movl	%edx, (%rax)
	movq	_display_modes@GOTPCREL(%rip), %rbx
	movq	(%rbx), %rax
	movq	%rsi, -64(%rbp)                 ## 8-byte Spill
	leaq	(,%rsi,8), %rcx
	leaq	(%rcx,%rcx,2), %r14
	movl	%edx, %edi
	callq	*(%rax,%r14)
	movq	_VIDEOMODE_src_width@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
	movq	_VIDEOMODE_src_height@GOTPCREL(%rip), %rcx
	movl	%r15d, (%rcx)
	movq	(%rbx), %r10
	movl	8(%r10,%r14), %ecx
	subl	%eax, %ecx
	movl	%ecx, %r13d
	shrl	$31, %r13d
	addl	%ecx, %r13d
	sarl	%r13d
	movq	_VIDEOMODE_src_offset_left@GOTPCREL(%rip), %rcx
	movl	%r13d, (%rcx)
	movl	12(%r10,%r14), %ecx
	subl	%r15d, %ecx
	movl	%ecx, %edi
	shrl	$31, %edi
	addl	%ecx, %edi
	sarl	%edi
	movq	_VIDEOMODE_src_offset_top@GOTPCREL(%rip), %rcx
	movl	%edi, (%rcx)
	movq	_VIDEOMODE_horizontal_offset@GOTPCREL(%rip), %r8
	movl	(%r8), %ebx
	movq	_VIDEOMODE_MAX_HORIZONTAL_AREA@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, %esi
	negl	%esi
	cmpl	%esi, %ebx
	jl	LBB0_2
## %bb.1:
	movl	%ecx, %esi
	cmpl	%ecx, %ebx
	jle	LBB0_3
LBB0_2:
	movl	%esi, (%r8)
	movl	%esi, %ebx
LBB0_3:
	movl	%r13d, %ecx
	negl	%ecx
	movq	_VIDEOMODE_vertical_offset@GOTPCREL(%rip), %r12
	movl	(%r12), %r8d
	movq	_VIDEOMODE_MAX_VERTICAL_AREA@GOTPCREL(%rip), %rsi
	movl	(%rsi), %r9d
	movl	%r9d, %r11d
	negl	%r11d
	cmpl	%r11d, %r8d
	jl	LBB0_5
## %bb.4:
	movl	%r9d, %r11d
	cmpl	%r9d, %r8d
	jle	LBB0_6
LBB0_5:
	movl	%r11d, (%r12)
	movl	%r11d, %r8d
LBB0_6:
	movl	%edi, %esi
	negl	%esi
	movq	-64(%rbp), %r12                 ## 8-byte Reload
	leaq	(%r12,%r12,2), %rdx
	imull	16(%r10,%rdx,8), %ebx
	cmpl	%ecx, %ebx
	jl	LBB0_8
## %bb.7:
	leaq	(%r10,%r14), %rcx
	addq	$8, %rcx
	movl	(%rcx), %ecx
	addl	%r13d, %eax
	subl	%eax, %ecx
	cmpl	%ecx, %ebx
	cmovll	%ebx, %ecx
LBB0_8:
	cmpl	%esi, %r8d
	jl	LBB0_10
## %bb.9:
	leaq	(%r10,%r14), %rax
	addq	$12, %rax
	movl	(%rax), %esi
	addl	%edi, %r15d
	subl	%r15d, %esi
	cmpl	%esi, %r8d
	cmovll	%r8d, %esi
LBB0_10:
	addl	%r13d, %ecx
	movq	_VIDEOMODE_src_offset_left@GOTPCREL(%rip), %rax
	movl	%ecx, (%rax)
	addl	%edi, %esi
	movq	_VIDEOMODE_src_offset_top@GOTPCREL(%rip), %rax
	movl	%esi, (%rax)
	movl	-48(%rbp), %r14d                ## 4-byte Reload
	testl	%r14d, %r14d
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	je	LBB0_12
## %bb.11:
	movq	_VIDEOMODE_dest_width@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	_VIDEOMODE_dest_height@GOTPCREL(%rip), %rdx
	movl	(%rdx), %esi
	movl	%esi, (%rax)
	movl	%ecx, (%rdx)
	movq	%rbx, %rdi
	callq	_RotateResolution
LBB0_12:
	movl	(%rbx), %eax
	movq	_VIDEOMODE_dest_width@GOTPCREL(%rip), %rcx
	subl	(%rcx), %eax
	movl	%eax, %ecx
	shrl	$31, %ecx
	addl	%eax, %ecx
	sarl	%ecx
	movq	_VIDEOMODE_dest_offset_left@GOTPCREL(%rip), %rax
	movl	%ecx, (%rax)
	movl	4(%rbx), %eax
	movq	_VIDEOMODE_dest_height@GOTPCREL(%rip), %rcx
	subl	(%rcx), %eax
	movl	%eax, %ecx
	shrl	$31, %ecx
	addl	%eax, %ecx
	sarl	%ecx
	movq	_VIDEOMODE_dest_offset_top@GOTPCREL(%rip), %rax
	movl	%ecx, (%rax)
	movq	_VIDEOMODE_MODE_LASTWITHHUD@GOTPCREL(%rip), %rax
	cmpq	%r12, (%rax)
	jb	LBB0_14
## %bb.13:
	xorl	%eax, %eax
	callq	_SetScreenVisible
LBB0_14:
	movq	%rbx, %rdi
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	movq	%r12, %rdx
	movl	%r14d, %ecx
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_PLATFORM_SetVideoMode          ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_VIDEOMODE_actual_width,4,2     ## @VIDEOMODE_actual_width
	.comm	_display_modes,8,3              ## @display_modes
	.comm	_VIDEOMODE_src_width,4,2        ## @VIDEOMODE_src_width
	.comm	_VIDEOMODE_src_height,4,2       ## @VIDEOMODE_src_height
	.comm	_VIDEOMODE_src_offset_left,4,2  ## @VIDEOMODE_src_offset_left
	.comm	_VIDEOMODE_src_offset_top,4,2   ## @VIDEOMODE_src_offset_top
	.comm	_VIDEOMODE_horizontal_offset,4,2 ## @VIDEOMODE_horizontal_offset
	.comm	_VIDEOMODE_MAX_HORIZONTAL_AREA,4,2 ## @VIDEOMODE_MAX_HORIZONTAL_AREA
	.comm	_VIDEOMODE_vertical_offset,4,2  ## @VIDEOMODE_vertical_offset
	.comm	_VIDEOMODE_MAX_VERTICAL_AREA,4,2 ## @VIDEOMODE_MAX_VERTICAL_AREA
	.comm	_VIDEOMODE_dest_width,4,2       ## @VIDEOMODE_dest_width
	.comm	_VIDEOMODE_dest_height,4,2      ## @VIDEOMODE_dest_height
	.comm	_VIDEOMODE_dest_offset_left,4,2 ## @VIDEOMODE_dest_offset_left
	.comm	_VIDEOMODE_dest_offset_top,4,2  ## @VIDEOMODE_dest_offset_top
	.comm	_VIDEOMODE_MODE_LASTWITHHUD,8,3 ## @VIDEOMODE_MODE_LASTWITHHUD
	.no_dead_strip	_SetVideoMode
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function SetVideoMode
_SetVideoMode:                          ; @SetVideoMode
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x19, x5
	mov	x20, x4
	mov	x23, x3
	mov	x21, x1
	mov	x22, x0
Lloh0:
	adrp	x8, _VIDEOMODE_actual_width@GOTPAGE
Lloh1:
	ldr	x8, [x8, _VIDEOMODE_actual_width@GOTPAGEOFF]
Lloh2:
	adrp	x24, _display_modes@GOTPAGE
Lloh3:
	ldr	x24, [x24, _display_modes@GOTPAGEOFF]
Lloh4:
	str	w2, [x8]
	ldr	x8, [x24]
	add	x9, x1, x1, lsl #1
	lsl	x25, x9, #3
	ldr	x8, [x8, x25]
	mov	x0, x2
	blr	x8
Lloh5:
	adrp	x8, _VIDEOMODE_src_width@GOTPAGE
Lloh6:
	ldr	x8, [x8, _VIDEOMODE_src_width@GOTPAGEOFF]
Lloh7:
	str	w0, [x8]
Lloh8:
	adrp	x8, _VIDEOMODE_src_height@GOTPAGE
Lloh9:
	ldr	x8, [x8, _VIDEOMODE_src_height@GOTPAGEOFF]
Lloh10:
	str	w23, [x8]
	ldr	x14, [x24]
	add	x10, x14, x25
	mov	x13, x10
	ldr	w8, [x13, #8]!
	sub	w8, w8, w0
	cmp	w8, #0
	cinc	w8, w8, lt
	asr	w8, w8, #1
Lloh11:
	adrp	x9, _VIDEOMODE_src_offset_left@GOTPAGE
Lloh12:
	ldr	x9, [x9, _VIDEOMODE_src_offset_left@GOTPAGEOFF]
	str	w8, [x9]
	ldr	w11, [x10, #12]!
	sub	w11, w11, w23
	cmp	w11, #0
	cinc	w11, w11, lt
	asr	w11, w11, #1
Lloh13:
	adrp	x12, _VIDEOMODE_src_offset_top@GOTPAGE
Lloh14:
	ldr	x12, [x12, _VIDEOMODE_src_offset_top@GOTPAGEOFF]
	str	w11, [x12]
Lloh15:
	adrp	x15, _VIDEOMODE_horizontal_offset@GOTPAGE
Lloh16:
	ldr	x15, [x15, _VIDEOMODE_horizontal_offset@GOTPAGEOFF]
	ldr	w16, [x15]
Lloh17:
	adrp	x17, _VIDEOMODE_MAX_HORIZONTAL_AREA@GOTPAGE
Lloh18:
	ldr	x17, [x17, _VIDEOMODE_MAX_HORIZONTAL_AREA@GOTPAGEOFF]
Lloh19:
	ldr	w1, [x17]
	neg	w17, w1
	cmp	w16, w17
	b.lt	LBB0_2
; %bb.1:
	mov	x17, x1
	cmp	w16, w1
	b.le	LBB0_3
LBB0_2:
	str	w17, [x15]
	mov	x16, x17
LBB0_3:
	neg	w15, w8
Lloh20:
	adrp	x1, _VIDEOMODE_vertical_offset@GOTPAGE
Lloh21:
	ldr	x1, [x1, _VIDEOMODE_vertical_offset@GOTPAGEOFF]
	ldr	w17, [x1]
Lloh22:
	adrp	x2, _VIDEOMODE_MAX_VERTICAL_AREA@GOTPAGE
Lloh23:
	ldr	x2, [x2, _VIDEOMODE_MAX_VERTICAL_AREA@GOTPAGEOFF]
Lloh24:
	ldr	w3, [x2]
	neg	w2, w3
	cmp	w17, w2
	b.lt	LBB0_5
; %bb.4:
	mov	x2, x3
	cmp	w17, w3
	b.le	LBB0_6
LBB0_5:
	str	w2, [x1]
	mov	x17, x2
LBB0_6:
	neg	w1, w11
	mov	w2, #24
	madd	x14, x21, x2, x14
	ldr	w14, [x14, #16]
	mul	w14, w14, w16
	cmp	w14, w15
	b.lt	LBB0_8
; %bb.7:
	ldr	w13, [x13]
	add	w15, w8, w0
	sub	w13, w13, w15
	cmp	w14, w13
	csel	w15, w14, w13, lt
LBB0_8:
	cmp	w17, w1
	b.lt	LBB0_10
; %bb.9:
	ldr	w10, [x10]
	add	w13, w11, w23
	sub	w10, w10, w13
	cmp	w17, w10
	csel	w1, w17, w10, lt
LBB0_10:
	add	w8, w15, w8
	str	w8, [x9]
	add	w8, w1, w11
	str	w8, [x12]
Lloh25:
	adrp	x24, _VIDEOMODE_dest_width@GOTPAGE
Lloh26:
	ldr	x24, [x24, _VIDEOMODE_dest_width@GOTPAGEOFF]
Lloh27:
	adrp	x23, _VIDEOMODE_dest_height@GOTPAGE
Lloh28:
	ldr	x23, [x23, _VIDEOMODE_dest_height@GOTPAGEOFF]
	cbz	w19, LBB0_12
; %bb.11:
	ldr	w8, [x24]
	ldr	w9, [x23]
	str	w9, [x24]
	str	w8, [x23]
	mov	x0, x22
	bl	_RotateResolution
LBB0_12:
	ldr	w8, [x24]
	ldp	w9, w10, [x22]
	sub	w8, w9, w8
	cmp	w8, #0
	cinc	w8, w8, lt
	asr	w8, w8, #1
Lloh29:
	adrp	x9, _VIDEOMODE_dest_offset_left@GOTPAGE
Lloh30:
	ldr	x9, [x9, _VIDEOMODE_dest_offset_left@GOTPAGEOFF]
Lloh31:
	str	w8, [x9]
	ldr	w8, [x23]
	sub	w8, w10, w8
	cmp	w8, #0
	cinc	w8, w8, lt
Lloh32:
	adrp	x9, _VIDEOMODE_dest_offset_top@GOTPAGE
Lloh33:
	ldr	x9, [x9, _VIDEOMODE_dest_offset_top@GOTPAGEOFF]
	asr	w8, w8, #1
Lloh34:
	str	w8, [x9]
Lloh35:
	adrp	x8, _VIDEOMODE_MODE_LASTWITHHUD@GOTPAGE
Lloh36:
	ldr	x8, [x8, _VIDEOMODE_MODE_LASTWITHHUD@GOTPAGEOFF]
Lloh37:
	ldr	x8, [x8]
	cmp	x8, x21
	b.lo	LBB0_14
; %bb.13:
	bl	_SetScreenVisible
LBB0_14:
	mov	x0, x22
	mov	x1, x20
	mov	x2, x21
	mov	x3, x19
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	b	_PLATFORM_SetVideoMode
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotStr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotStr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotStr	Lloh0, Lloh1, Lloh4
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh27, Lloh28
	.loh AdrpLdrGot	Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.loh AdrpLdrGotStr	Lloh32, Lloh33, Lloh34
	.loh AdrpLdrGotStr	Lloh29, Lloh30, Lloh31
	.cfi_endproc
                                        ; -- End function
	.comm	_VIDEOMODE_actual_width,4,2     ; @VIDEOMODE_actual_width
	.comm	_display_modes,8,3              ; @display_modes
	.comm	_VIDEOMODE_src_width,4,2        ; @VIDEOMODE_src_width
	.comm	_VIDEOMODE_src_height,4,2       ; @VIDEOMODE_src_height
	.comm	_VIDEOMODE_src_offset_left,4,2  ; @VIDEOMODE_src_offset_left
	.comm	_VIDEOMODE_src_offset_top,4,2   ; @VIDEOMODE_src_offset_top
	.comm	_VIDEOMODE_horizontal_offset,4,2 ; @VIDEOMODE_horizontal_offset
	.comm	_VIDEOMODE_MAX_HORIZONTAL_AREA,4,2 ; @VIDEOMODE_MAX_HORIZONTAL_AREA
	.comm	_VIDEOMODE_vertical_offset,4,2  ; @VIDEOMODE_vertical_offset
	.comm	_VIDEOMODE_MAX_VERTICAL_AREA,4,2 ; @VIDEOMODE_MAX_VERTICAL_AREA
	.comm	_VIDEOMODE_dest_width,4,2       ; @VIDEOMODE_dest_width
	.comm	_VIDEOMODE_dest_height,4,2      ; @VIDEOMODE_dest_height
	.comm	_VIDEOMODE_dest_offset_left,4,2 ; @VIDEOMODE_dest_offset_left
	.comm	_VIDEOMODE_dest_offset_top,4,2  ; @VIDEOMODE_dest_offset_top
	.comm	_VIDEOMODE_MODE_LASTWITHHUD,8,3 ; @VIDEOMODE_MODE_LASTWITHHUD
	.no_dead_strip	_SetVideoMode
.subsections_via_symbols
