	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function setup_video_mode
_setup_video_mode:                      ## @setup_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	%r14
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %rbx
	movq	(%rdi), %rax
	cmpl	$0, (%rax)
	jne	LBB0_2
## %bb.1:
	movq	_VI_DISPLAY_PIX_SZ@GOTPCREL(%rip), %r14
	imull	$368640, (%r14), %esi           ## imm = 0x5A000
	movl	$32, %edi
	callq	_memalign
	movl	%eax, %edi
	callq	_MEM_K0_TO_K1
	movq	(%rbx), %rcx
	movl	%eax, (%rcx)
	imull	$368640, (%r14), %esi           ## imm = 0x5A000
	movl	$32, %edi
	callq	_memalign
	movl	%eax, %edi
	callq	_MEM_K0_TO_K1
	movq	(%rbx), %rcx
	movl	%eax, 4(%rcx)
LBB0_2:
	movq	_ORIENTATION_NORMAL@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_g_orientation@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
	movq	_g_video_cond@GOTPCREL(%rip), %rdi
	callq	_OSInitThreadQueue
	leaq	-24(%rbp), %rsi
	leaq	-20(%rbp), %rdx
	movq	%rbx, %rdi
	callq	_gx_get_video_output_size
	movl	-24(%rbp), %esi
	movl	-20(%rbp), %edx
	movq	%rbx, %rdi
	movl	$1, %ecx
	callq	_gx_set_video_mode
	addq	$16, %rsp
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_VI_DISPLAY_PIX_SZ,4,2          ## @VI_DISPLAY_PIX_SZ
	.comm	_ORIENTATION_NORMAL,4,2         ## @ORIENTATION_NORMAL
	.comm	_g_orientation,4,2              ## @g_orientation
	.comm	_g_video_cond,4,2               ## @g_video_cond
	.no_dead_strip	_setup_video_mode
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function setup_video_mode
_setup_video_mode:                      ; @setup_video_mode
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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	x8, [x0]
	ldr	w8, [x8]
	cbnz	w8, LBB0_2
; %bb.1:
Lloh0:
	adrp	x20, _VI_DISPLAY_PIX_SZ@GOTPAGE
Lloh1:
	ldr	x20, [x20, _VI_DISPLAY_PIX_SZ@GOTPAGEOFF]
	ldr	w8, [x20]
	mov	w21, #40960
	movk	w21, #5, lsl #16
	mul	w1, w8, w21
	mov	w0, #32
	bl	_memalign
	bl	_MEM_K0_TO_K1
	ldr	x8, [x19]
	str	w0, [x8]
	ldr	w8, [x20]
	mul	w1, w8, w21
	mov	w0, #32
	bl	_memalign
	bl	_MEM_K0_TO_K1
	ldr	x8, [x19]
	str	w0, [x8, #4]
LBB0_2:
Lloh2:
	adrp	x8, _ORIENTATION_NORMAL@GOTPAGE
Lloh3:
	ldr	x8, [x8, _ORIENTATION_NORMAL@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
Lloh5:
	adrp	x9, _g_orientation@GOTPAGE
Lloh6:
	ldr	x9, [x9, _g_orientation@GOTPAGEOFF]
Lloh7:
	str	w8, [x9]
Lloh8:
	adrp	x0, _g_video_cond@GOTPAGE
Lloh9:
	ldr	x0, [x0, _g_video_cond@GOTPAGEOFF]
	bl	_OSInitThreadQueue
	add	x1, sp, #12
	add	x2, sp, #8
	mov	x0, x19
	bl	_gx_get_video_output_size
	ldp	w2, w1, [sp, #8]
	mov	x0, x19
	mov	w3, #1
	bl	_gx_set_video_mode
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotStr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_VI_DISPLAY_PIX_SZ,4,2          ; @VI_DISPLAY_PIX_SZ
	.comm	_ORIENTATION_NORMAL,4,2         ; @ORIENTATION_NORMAL
	.comm	_g_orientation,4,2              ; @g_orientation
	.comm	_g_video_cond,4,2               ; @g_video_cond
	.no_dead_strip	_setup_video_mode
.subsections_via_symbols
