	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_gx_video_Init                  ## -- Begin function gx_video_Init
	.p2align	4, 0x90
_gx_video_Init:                         ## @gx_video_Init
	.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
	xorl	%eax, %eax
	callq	_VIDEO_Init
	xorl	%edi, %edi
	callq	_VIDEO_GetPreferredMode
	movq	_vmode@GOTPCREL(%rip), %r14
	movq	%rax, (%r14)
	movl	(%rax), %edi
	sarl	$2, %edi
	cmpl	$128, %edi
	jne	LBB0_2
## %bb.1:
	movq	_VI_TVMODE_EURGB60_DS@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	_TV60hz_240p@GOTPCREL(%rip), %rdx
	movq	%rcx, (%rdx)
	movq	_VI_TVMODE_EURGB60_INT@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	_TV60hz_240i@GOTPCREL(%rip), %rdx
	movq	%rcx, (%rdx)
	jmp	LBB0_3
LBB0_2:
	movq	_VI_NON_INTERLACE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_VI_TVMODE
	movq	_TV60hz_240p@GOTPCREL(%rip), %rcx
	movq	%rax, (%rcx)
	movq	(%r14), %rax
	movl	(%rax), %edi
	sarl	$2, %edi
	movq	_VI_INTERLACE@GOTPCREL(%rip), %rbx
	movl	(%rbx), %esi
	callq	_VI_TVMODE
	movq	_TV60hz_240i@GOTPCREL(%rip), %rcx
	movq	%rax, (%rcx)
	movq	(%r14), %rax
	movl	(%rax), %edi
	sarl	$2, %edi
	movl	(%rbx), %esi
	callq	_VI_TVMODE
	movq	%rax, %rcx
	movq	(%r14), %rax
LBB0_3:
	movq	_TV60hz_480i@GOTPCREL(%rip), %rdx
	movq	%rcx, (%rdx)
	movq	%rax, %rdi
	callq	_VIDEO_Configure
	movq	_TV50hz_576i@GOTPCREL(%rip), %r15
	movq	%r15, %rdi
	callq	_SYS_AllocateFramebuffer
	movq	%rax, %rdi
	callq	_MEM_K0_TO_K1
	movq	_xfb@GOTPCREL(%rip), %r12
	movq	(%r12), %rcx
	movq	%rax, (%rcx)
	movq	%r15, %rdi
	callq	_SYS_AllocateFramebuffer
	movq	%rax, %rdi
	callq	_MEM_K0_TO_K1
	movq	(%r12), %rcx
	movq	%rax, 8(%rcx)
	movq	(%rcx), %rdi
	movl	$20, %esi
	movl	$64, %edx
	movl	$640, %ecx                      ## imm = 0x280
	movl	$574, %r8d                      ## imm = 0x23E
	movl	$1148, %r9d                     ## imm = 0x47C
	callq	_console_init
	movq	(%r14), %rdi
	movq	(%r12), %rax
	movq	(%rax), %rsi
	movq	_COLOR_BLACK@GOTPCREL(%rip), %rbx
	movl	(%rbx), %edx
	callq	_VIDEO_ClearFrameBuffer
	movq	(%r14), %rdi
	movq	(%r12), %rax
	movq	8(%rax), %rsi
	movl	(%rbx), %edx
	callq	_VIDEO_ClearFrameBuffer
	movq	(%r12), %rax
	movq	(%rax), %rdi
	callq	_VIDEO_SetNextFramebuffer
	movq	_FALSE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_VIDEO_SetBlack
	xorl	%eax, %eax
	callq	_VIDEO_Flush
	xorl	%eax, %eax
	callq	_VIDEO_WaitVSync
	xorl	%eax, %eax
	callq	_VIDEO_WaitVSync
	xorl	%eax, %eax
	callq	_gxStart
	movl	$1, %edi
	callq	_gxResetRendering
	movq	(%r14), %rdi
	movq	_GX_TRUE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_gxResetMode
	xorl	%eax, %eax
	callq	_FONT_Init
	movq	_TEX_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$32, %edi
	callq	_memalign
	movq	_texturemem@GOTPCREL(%rip), %rcx
	movq	%rax, (%rcx)
	movq	_HASPECT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_VASPECT@GOTPCREL(%rip), %rax
	imull	(%rax), %esi
	shll	$2, %esi
	movl	$32, %edi
	callq	_memalign
	movq	_screenshot@GOTPCREL(%rip), %rcx
	movq	%rax, (%rcx)
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_vmode,8,3                      ## @vmode
	.comm	_VI_TVMODE_EURGB60_DS,8,3       ## @VI_TVMODE_EURGB60_DS
	.comm	_TV60hz_240p,8,3                ## @TV60hz_240p
	.comm	_VI_TVMODE_EURGB60_INT,8,3      ## @VI_TVMODE_EURGB60_INT
	.comm	_TV60hz_240i,8,3                ## @TV60hz_240i
	.comm	_TV60hz_480i,8,3                ## @TV60hz_480i
	.comm	_VI_NON_INTERLACE,4,2           ## @VI_NON_INTERLACE
	.comm	_VI_INTERLACE,4,2               ## @VI_INTERLACE
	.comm	_TV50hz_576i,4,2                ## @TV50hz_576i
	.comm	_xfb,8,3                        ## @xfb
	.comm	_COLOR_BLACK,4,2                ## @COLOR_BLACK
	.comm	_FALSE,4,2                      ## @FALSE
	.comm	_GX_TRUE,4,2                    ## @GX_TRUE
	.comm	_TEX_SIZE,4,2                   ## @TEX_SIZE
	.comm	_texturemem,8,3                 ## @texturemem
	.comm	_HASPECT,4,2                    ## @HASPECT
	.comm	_VASPECT,4,2                    ## @VASPECT
	.comm	_screenshot,8,3                 ## @screenshot
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_gx_video_Init                  ; -- Begin function gx_video_Init
	.p2align	2
_gx_video_Init:                         ; @gx_video_Init
	.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
	bl	_VIDEO_Init
	mov	x0, #0
	bl	_VIDEO_GetPreferredMode
Lloh0:
	adrp	x20, _vmode@GOTPAGE
Lloh1:
	ldr	x20, [x20, _vmode@GOTPAGEOFF]
	str	x0, [x20]
	ldr	w8, [x0]
	asr	w8, w8, #2
	cmp	w8, #128
	b.ne	LBB0_2
; %bb.1:
Lloh2:
	adrp	x8, _VI_TVMODE_EURGB60_DS@GOTPAGE
Lloh3:
	ldr	x8, [x8, _VI_TVMODE_EURGB60_DS@GOTPAGEOFF]
Lloh4:
	ldr	x8, [x8]
Lloh5:
	adrp	x9, _TV60hz_240p@GOTPAGE
Lloh6:
	ldr	x9, [x9, _TV60hz_240p@GOTPAGEOFF]
Lloh7:
	str	x8, [x9]
Lloh8:
	adrp	x8, _VI_TVMODE_EURGB60_INT@GOTPAGE
Lloh9:
	ldr	x8, [x8, _VI_TVMODE_EURGB60_INT@GOTPAGEOFF]
Lloh10:
	ldr	x8, [x8]
Lloh11:
	adrp	x9, _TV60hz_240i@GOTPAGE
Lloh12:
	ldr	x9, [x9, _TV60hz_240i@GOTPAGEOFF]
Lloh13:
	str	x8, [x9]
	b	LBB0_3
LBB0_2:
Lloh14:
	adrp	x9, _VI_NON_INTERLACE@GOTPAGE
Lloh15:
	ldr	x9, [x9, _VI_NON_INTERLACE@GOTPAGEOFF]
Lloh16:
	ldr	w1, [x9]
	mov	x0, x8
	bl	_VI_TVMODE
Lloh17:
	adrp	x8, _TV60hz_240p@GOTPAGE
Lloh18:
	ldr	x8, [x8, _TV60hz_240p@GOTPAGEOFF]
Lloh19:
	str	x0, [x8]
	ldr	x8, [x20]
	ldr	w8, [x8]
	asr	w0, w8, #2
Lloh20:
	adrp	x19, _VI_INTERLACE@GOTPAGE
Lloh21:
	ldr	x19, [x19, _VI_INTERLACE@GOTPAGEOFF]
	ldr	w1, [x19]
	bl	_VI_TVMODE
Lloh22:
	adrp	x8, _TV60hz_240i@GOTPAGE
Lloh23:
	ldr	x8, [x8, _TV60hz_240i@GOTPAGEOFF]
Lloh24:
	str	x0, [x8]
	ldr	x8, [x20]
	ldr	w8, [x8]
	asr	w0, w8, #2
	ldr	w1, [x19]
	bl	_VI_TVMODE
	mov	x8, x0
	ldr	x0, [x20]
LBB0_3:
Lloh25:
	adrp	x9, _TV60hz_480i@GOTPAGE
Lloh26:
	ldr	x9, [x9, _TV60hz_480i@GOTPAGEOFF]
Lloh27:
	str	x8, [x9]
	bl	_VIDEO_Configure
Lloh28:
	adrp	x19, _TV50hz_576i@GOTPAGE
Lloh29:
	ldr	x19, [x19, _TV50hz_576i@GOTPAGEOFF]
	mov	x0, x19
	bl	_SYS_AllocateFramebuffer
	bl	_MEM_K0_TO_K1
Lloh30:
	adrp	x21, _xfb@GOTPAGE
Lloh31:
	ldr	x21, [x21, _xfb@GOTPAGEOFF]
	ldr	x8, [x21]
	str	x0, [x8]
	mov	x0, x19
	bl	_SYS_AllocateFramebuffer
	bl	_MEM_K0_TO_K1
	ldr	x8, [x21]
	str	x0, [x8, #8]
	ldr	x0, [x8]
	mov	w1, #20
	mov	w2, #64
	mov	w3, #640
	mov	w4, #574
	mov	w5, #1148
	bl	_console_init
	ldr	x0, [x20]
	ldr	x8, [x21]
	ldr	x1, [x8]
Lloh32:
	adrp	x19, _COLOR_BLACK@GOTPAGE
Lloh33:
	ldr	x19, [x19, _COLOR_BLACK@GOTPAGEOFF]
	ldr	w2, [x19]
	bl	_VIDEO_ClearFrameBuffer
	ldr	x0, [x20]
	ldr	x8, [x21]
	ldr	x1, [x8, #8]
	ldr	w2, [x19]
	bl	_VIDEO_ClearFrameBuffer
	ldr	x8, [x21]
	ldr	x0, [x8]
	bl	_VIDEO_SetNextFramebuffer
Lloh34:
	adrp	x8, _FALSE@GOTPAGE
Lloh35:
	ldr	x8, [x8, _FALSE@GOTPAGEOFF]
Lloh36:
	ldr	w0, [x8]
	bl	_VIDEO_SetBlack
	bl	_VIDEO_Flush
	bl	_VIDEO_WaitVSync
	bl	_VIDEO_WaitVSync
	bl	_gxStart
	mov	w0, #1
	bl	_gxResetRendering
	ldr	x0, [x20]
Lloh37:
	adrp	x8, _GX_TRUE@GOTPAGE
Lloh38:
	ldr	x8, [x8, _GX_TRUE@GOTPAGEOFF]
Lloh39:
	ldr	w1, [x8]
	bl	_gxResetMode
	bl	_FONT_Init
Lloh40:
	adrp	x8, _TEX_SIZE@GOTPAGE
Lloh41:
	ldr	x8, [x8, _TEX_SIZE@GOTPAGEOFF]
Lloh42:
	ldr	w1, [x8]
	mov	w0, #32
	bl	_memalign
Lloh43:
	adrp	x8, _texturemem@GOTPAGE
Lloh44:
	ldr	x8, [x8, _texturemem@GOTPAGEOFF]
Lloh45:
	str	x0, [x8]
Lloh46:
	adrp	x8, _HASPECT@GOTPAGE
Lloh47:
	ldr	x8, [x8, _HASPECT@GOTPAGEOFF]
Lloh48:
	ldr	w8, [x8]
Lloh49:
	adrp	x9, _VASPECT@GOTPAGE
Lloh50:
	ldr	x9, [x9, _VASPECT@GOTPAGEOFF]
Lloh51:
	ldr	w9, [x9]
	mul	w8, w8, w9
	lsl	w1, w8, #2
	mov	w0, #32
	bl	_memalign
Lloh52:
	adrp	x8, _screenshot@GOTPAGE
Lloh53:
	ldr	x8, [x8, _screenshot@GOTPAGEOFF]
Lloh54:
	str	x0, [x8]
	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 AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotStr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotStr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotStr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGotStr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotStr	Lloh52, Lloh53, Lloh54
	.loh AdrpLdrGotLdr	Lloh49, Lloh50, Lloh51
	.loh AdrpLdrGotLdr	Lloh46, Lloh47, Lloh48
	.loh AdrpLdrGotStr	Lloh43, Lloh44, Lloh45
	.loh AdrpLdrGotLdr	Lloh40, Lloh41, Lloh42
	.loh AdrpLdrGotLdr	Lloh37, Lloh38, Lloh39
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.loh AdrpLdrGot	Lloh32, Lloh33
	.loh AdrpLdrGot	Lloh30, Lloh31
	.loh AdrpLdrGot	Lloh28, Lloh29
	.loh AdrpLdrGotStr	Lloh25, Lloh26, Lloh27
	.cfi_endproc
                                        ; -- End function
	.comm	_vmode,8,3                      ; @vmode
	.comm	_VI_TVMODE_EURGB60_DS,8,3       ; @VI_TVMODE_EURGB60_DS
	.comm	_TV60hz_240p,8,3                ; @TV60hz_240p
	.comm	_VI_TVMODE_EURGB60_INT,8,3      ; @VI_TVMODE_EURGB60_INT
	.comm	_TV60hz_240i,8,3                ; @TV60hz_240i
	.comm	_TV60hz_480i,8,3                ; @TV60hz_480i
	.comm	_VI_NON_INTERLACE,4,2           ; @VI_NON_INTERLACE
	.comm	_VI_INTERLACE,4,2               ; @VI_INTERLACE
	.comm	_TV50hz_576i,4,2                ; @TV50hz_576i
	.comm	_xfb,8,3                        ; @xfb
	.comm	_COLOR_BLACK,4,2                ; @COLOR_BLACK
	.comm	_FALSE,4,2                      ; @FALSE
	.comm	_GX_TRUE,4,2                    ; @GX_TRUE
	.comm	_TEX_SIZE,4,2                   ; @TEX_SIZE
	.comm	_texturemem,8,3                 ; @texturemem
	.comm	_HASPECT,4,2                    ; @HASPECT
	.comm	_VASPECT,4,2                    ; @VASPECT
	.comm	_screenshot,8,3                 ; @screenshot
.subsections_via_symbols
