	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_PLATFORM_DisplayScreen         ## -- Begin function PLATFORM_DisplayScreen
	.p2align	4, 0x90
_PLATFORM_DisplayScreen:                ## @PLATFORM_DisplayScreen
	.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	$48, %rsp
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	_Screen_WIDTH@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -24(%rbp)
	movq	_Screen_HEIGHT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -28(%rbp)
	movq	_GS_PSM_T8@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -32(%rbp)
	movq	_Screen_atari@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -40(%rbp)
	movq	_clut@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -44(%rbp)
	movabsq	$11258999070523392, %rax        ## imm = 0x28000000200000
	movq	%rax, -56(%rbp)
	movq	_GS_FILTER_LINEAR@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -48(%rbp)
	movq	_gsGlobal@GOTPCREL(%rip), %r14
	movq	(%r14), %rdi
	leaq	-56(%rbp), %rbx
	movq	%rbx, %rsi
	callq	_gsKit_texture_upload
	movq	(%r14), %rdi
	movq	%rbx, %rsi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	movl	$32, %r8d
	xorl	%r9d, %r9d
	pushq	$-2139062144                    ## imm = 0x80808080
	pushq	$0
	pushq	$240
	pushq	$352                            ## imm = 0x160
	pushq	$480                            ## imm = 0x1E0
	pushq	$640                            ## imm = 0x280
	callq	_gsKit_prim_sprite_texture
	addq	$48, %rsp
	movq	(%r14), %rax
	movq	(%rax), %rcx
	movl	8(%rax), %edx
	andl	$1, %edx
	movl	(%rcx,%rdx,4), %ecx
	leal	8191(%rcx), %edi
	testl	%ecx, %ecx
	cmovnsl	%ecx, %edi
	sarl	$13, %edi
	movl	12(%rax), %ecx
	leal	63(%rcx), %esi
	testl	%ecx, %ecx
	cmovnsl	%ecx, %esi
	sarl	$6, %esi
	movl	24(%rax), %edx
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	callq	_GS_SET_DISPFB2
	movq	(%r14), %rdi
	xorl	$1, 8(%rdi)
	xorb	$1, 16(%rdi)
	movq	_GS_CSR@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movl	(%rax), %eax
	movl	%eax, 20(%rdi)
	callq	_gsKit_setactive
	addq	$48, %rsp
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_Screen_WIDTH,4,2               ## @Screen_WIDTH
	.comm	_Screen_HEIGHT,4,2              ## @Screen_HEIGHT
	.comm	_GS_PSM_T8,4,2                  ## @GS_PSM_T8
	.comm	_Screen_atari,8,3               ## @Screen_atari
	.comm	_clut,4,2                       ## @clut
	.comm	_GS_FILTER_LINEAR,4,2           ## @GS_FILTER_LINEAR
	.comm	_gsGlobal,8,3                   ## @gsGlobal
	.comm	_GS_CSR,8,3                     ## @GS_CSR
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal8,8byte_literals
	.p2align	3                               ; -- Begin function PLATFORM_DisplayScreen
lCPI0_0:
	.long	2097152                         ; 0x200000
	.long	2621440                         ; 0x280000
	.section	__TEXT,__text,regular,pure_instructions
	.globl	_PLATFORM_DisplayScreen
	.p2align	2
_PLATFORM_DisplayScreen:                ; @PLATFORM_DisplayScreen
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	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
Lloh0:
	adrp	x8, _Screen_WIDTH@GOTPAGE
Lloh1:
	ldr	x8, [x8, _Screen_WIDTH@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	str	w8, [sp, #56]
Lloh3:
	adrp	x8, _Screen_HEIGHT@GOTPAGE
Lloh4:
	ldr	x8, [x8, _Screen_HEIGHT@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
Lloh6:
	adrp	x9, _GS_PSM_T8@GOTPAGE
Lloh7:
	ldr	x9, [x9, _GS_PSM_T8@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	stp	w9, w8, [sp, #48]
Lloh9:
	adrp	x8, _Screen_atari@GOTPAGE
Lloh10:
	ldr	x8, [x8, _Screen_atari@GOTPAGEOFF]
Lloh11:
	ldr	x8, [x8]
	str	x8, [sp, #40]
Lloh12:
	adrp	x8, _clut@GOTPAGE
Lloh13:
	ldr	x8, [x8, _clut@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
Lloh15:
	adrp	x9, lCPI0_0@PAGE
Lloh16:
	ldr	d0, [x9, lCPI0_0@PAGEOFF]
	str	d0, [sp, #24]
Lloh17:
	adrp	x9, _GS_FILTER_LINEAR@GOTPAGE
Lloh18:
	ldr	x9, [x9, _GS_FILTER_LINEAR@GOTPAGEOFF]
Lloh19:
	ldr	w9, [x9]
	stp	w9, w8, [sp, #32]
Lloh20:
	adrp	x19, _gsGlobal@GOTPAGE
Lloh21:
	ldr	x19, [x19, _gsGlobal@GOTPAGEOFF]
	ldr	x0, [x19]
	add	x1, sp, #24
	bl	_gsKit_texture_upload
	ldr	x0, [x19]
	mov	x8, #141287244169216
	movk	x8, #32896, lsl #48
	mov	x9, #352
	movk	x9, #240, lsl #32
	stp	x9, x8, [sp]
	add	x1, sp, #24
	mov	w2, #0
	mov	w3, #0
	mov	w4, #32
	mov	w5, #0
	mov	w6, #640
	mov	w7, #480
	bl	_gsKit_prim_sprite_texture
	ldr	x8, [x19]
	ldr	x9, [x8]
	ldp	w10, w11, [x8, #8]
	and	x10, x10, #0x1
	ldr	w9, [x9, x10, lsl #2]
	mov	w10, #8191
	add	w10, w9, w10
	cmp	w9, #0
	csel	w9, w10, w9, lt
	asr	w0, w9, #13
	add	w9, w11, #63
	cmp	w11, #0
	csel	w9, w9, w11, lt
	asr	w1, w9, #6
	ldr	w2, [x8, #24]
	mov	w3, #0
	mov	w4, #0
	bl	_GS_SET_DISPFB2
	ldr	x0, [x19]
	ldr	w8, [x0, #8]
	eor	w8, w8, #0x1
	str	w8, [x0, #8]
	ldr	w8, [x0, #16]
	eor	w8, w8, #0x1
	str	w8, [x0, #16]
Lloh22:
	adrp	x8, _GS_CSR@GOTPAGE
Lloh23:
	ldr	x8, [x8, _GS_CSR@GOTPAGEOFF]
Lloh24:
	ldr	x8, [x8]
	ldr	w8, [x8]
	str	w8, [x0, #20]
	bl	_gsKit_setactive
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpAdrp	Lloh15, Lloh17
	.loh AdrpLdr	Lloh15, Lloh16
	.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
	.cfi_endproc
                                        ; -- End function
	.comm	_Screen_WIDTH,4,2               ; @Screen_WIDTH
	.comm	_Screen_HEIGHT,4,2              ; @Screen_HEIGHT
	.comm	_GS_PSM_T8,4,2                  ; @GS_PSM_T8
	.comm	_Screen_atari,8,3               ; @Screen_atari
	.comm	_clut,4,2                       ; @clut
	.comm	_GS_FILTER_LINEAR,4,2           ; @GS_FILTER_LINEAR
	.comm	_gsGlobal,8,3                   ; @gsGlobal
	.comm	_GS_CSR,8,3                     ; @GS_CSR
.subsections_via_symbols
