	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_PLATFORM_Initialise            ## -- Begin function PLATFORM_Initialise
	.p2align	4, 0x90
_PLATFORM_Initialise:                   ## @PLATFORM_Initialise
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -24
	movq	_Colours_table@GOTPCREL(%rip), %rax
	movq	(%rax), %r8
	movq	_clut@GOTPCREL(%rip), %rcx
	movq	(%rcx), %r9
	xorl	%edx, %edx
	xorl	%esi, %esi
	.p2align	4, 0x90
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r8,%rsi,4), %eax
	movl	%eax, %edi
	movzbl	%al, %ecx
	sarl	$16, %eax
	andl	$65280, %edi                    ## imm = 0xFF00
	addl	%eax, %edi
	shll	$16, %ecx
	addl	%edi, %ecx
	movl	%edx, %eax
	xorl	%esi, %eax
	movl	%esi, %edi
	xorl	$24, %edi
	testb	$16, %al
	cmoveq	%rsi, %rdi
	movl	%edi, %eax
	movl	%ecx, (%r9,%rax,4)
	incq	%rsi
	addl	$2, %edx
	cmpq	$256, %rsi                      ## imm = 0x100
	jne	LBB0_1
## %bb.2:
	xorl	%eax, %eax
	callq	_init_scr
	movq	_GS_MODE_NTSC@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_gsKit_init_global
	movq	_gsGlobal@GOTPCREL(%rip), %rbx
	movq	%rax, (%rbx)
	movq	_D_CTRL_RELE_ON@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_D_CTRL_MFD_OFF@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_D_CTRL_STS_UNSPEC@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_D_CTRL_STD_OFF@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	_D_CTRL_RCYC_8@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	callq	_dmaKit_init
	movq	_DMA_CHANNEL_GIF@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_dmaKit_chan_init
	movq	_GS_PSM_CT32@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	(%rbx), %rdi
	movl	%eax, 8(%rdi)
	movq	(%rdi), %rax
	movq	$0, (%rax)
	callq	_gsKit_init_screen
	xorl	%edi, %edi
	callq	_padInit
	movq	_PAD_PORT@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_PAD_SLOT@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_padBuf@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_padPortOpen
	movq	_TRUE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_Colours_table,8,3              ## @Colours_table
	.comm	_clut,8,3                       ## @clut
	.comm	_GS_MODE_NTSC,4,2               ## @GS_MODE_NTSC
	.comm	_gsGlobal,8,3                   ## @gsGlobal
	.comm	_D_CTRL_RELE_ON,4,2             ## @D_CTRL_RELE_ON
	.comm	_D_CTRL_MFD_OFF,4,2             ## @D_CTRL_MFD_OFF
	.comm	_D_CTRL_STS_UNSPEC,4,2          ## @D_CTRL_STS_UNSPEC
	.comm	_D_CTRL_STD_OFF,4,2             ## @D_CTRL_STD_OFF
	.comm	_D_CTRL_RCYC_8,4,2              ## @D_CTRL_RCYC_8
	.comm	_DMA_CHANNEL_GIF,4,2            ## @DMA_CHANNEL_GIF
	.comm	_GS_PSM_CT32,4,2                ## @GS_PSM_CT32
	.comm	_PAD_PORT,4,2                   ## @PAD_PORT
	.comm	_PAD_SLOT,4,2                   ## @PAD_SLOT
	.comm	_padBuf,4,2                     ## @padBuf
	.comm	_TRUE,4,2                       ## @TRUE
	.comm	_FALSE,4,2                      ## @FALSE
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_PLATFORM_Initialise            ; -- Begin function PLATFORM_Initialise
	.p2align	2
_PLATFORM_Initialise:                   ; @PLATFORM_Initialise
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	w8, #0
	mov	x9, #0
Lloh0:
	adrp	x10, _Colours_table@GOTPAGE
Lloh1:
	ldr	x10, [x10, _Colours_table@GOTPAGEOFF]
Lloh2:
	ldr	x10, [x10]
Lloh3:
	adrp	x11, _clut@GOTPAGE
Lloh4:
	ldr	x11, [x11, _clut@GOTPAGEOFF]
Lloh5:
	ldr	x11, [x11]
LBB0_1:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w12, [x10, x9, lsl #2]
	and	w13, w12, #0xff00
	add	w13, w13, w12, asr #16
	ubfiz	w12, w12, #16, #8
	add	w12, w13, w12
	eor	w13, w8, w9
	eor	w14, w9, #0x18
	tst	w13, #0x10
	csel	x13, x9, x14, eq
	str	w12, [x11, w13, uxtw #2]
	add	x9, x9, #1
	add	w8, w8, #2
	cmp	x9, #256
	b.ne	LBB0_1
; %bb.2:
	bl	_init_scr
Lloh6:
	adrp	x8, _GS_MODE_NTSC@GOTPAGE
Lloh7:
	ldr	x8, [x8, _GS_MODE_NTSC@GOTPAGEOFF]
Lloh8:
	ldr	w0, [x8]
	bl	_gsKit_init_global
Lloh9:
	adrp	x19, _gsGlobal@GOTPAGE
Lloh10:
	ldr	x19, [x19, _gsGlobal@GOTPAGEOFF]
	str	x0, [x19]
Lloh11:
	adrp	x8, _D_CTRL_RELE_ON@GOTPAGE
Lloh12:
	ldr	x8, [x8, _D_CTRL_RELE_ON@GOTPAGEOFF]
Lloh13:
	ldr	w0, [x8]
Lloh14:
	adrp	x8, _D_CTRL_MFD_OFF@GOTPAGE
Lloh15:
	ldr	x8, [x8, _D_CTRL_MFD_OFF@GOTPAGEOFF]
Lloh16:
	ldr	w1, [x8]
Lloh17:
	adrp	x8, _D_CTRL_STS_UNSPEC@GOTPAGE
Lloh18:
	ldr	x8, [x8, _D_CTRL_STS_UNSPEC@GOTPAGEOFF]
Lloh19:
	ldr	w2, [x8]
Lloh20:
	adrp	x8, _D_CTRL_STD_OFF@GOTPAGE
Lloh21:
	ldr	x8, [x8, _D_CTRL_STD_OFF@GOTPAGEOFF]
Lloh22:
	ldr	w3, [x8]
Lloh23:
	adrp	x8, _D_CTRL_RCYC_8@GOTPAGE
Lloh24:
	ldr	x8, [x8, _D_CTRL_RCYC_8@GOTPAGEOFF]
Lloh25:
	ldr	w4, [x8]
	bl	_dmaKit_init
Lloh26:
	adrp	x8, _DMA_CHANNEL_GIF@GOTPAGE
Lloh27:
	ldr	x8, [x8, _DMA_CHANNEL_GIF@GOTPAGEOFF]
Lloh28:
	ldr	w0, [x8]
	bl	_dmaKit_chan_init
Lloh29:
	adrp	x8, _GS_PSM_CT32@GOTPAGE
Lloh30:
	ldr	x8, [x8, _GS_PSM_CT32@GOTPAGEOFF]
Lloh31:
	ldr	w8, [x8]
	ldr	x0, [x19]
	str	w8, [x0, #8]
	ldr	x8, [x0]
	str	xzr, [x8]
	bl	_gsKit_init_screen
	mov	w0, #0
	bl	_padInit
Lloh32:
	adrp	x8, _PAD_PORT@GOTPAGE
Lloh33:
	ldr	x8, [x8, _PAD_PORT@GOTPAGEOFF]
Lloh34:
	ldr	w0, [x8]
Lloh35:
	adrp	x8, _PAD_SLOT@GOTPAGE
Lloh36:
	ldr	x8, [x8, _PAD_SLOT@GOTPAGEOFF]
Lloh37:
	ldr	w1, [x8]
Lloh38:
	adrp	x8, _padBuf@GOTPAGE
Lloh39:
	ldr	x8, [x8, _padBuf@GOTPAGEOFF]
Lloh40:
	ldr	w2, [x8]
	bl	_padPortOpen
Lloh41:
	adrp	x8, _TRUE@GOTPAGE
Lloh42:
	ldr	x8, [x8, _TRUE@GOTPAGEOFF]
Lloh43:
	ldr	w0, [x8]
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh41, Lloh42, Lloh43
	.loh AdrpLdrGotLdr	Lloh38, Lloh39, Lloh40
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_Colours_table,8,3              ; @Colours_table
	.comm	_clut,8,3                       ; @clut
	.comm	_GS_MODE_NTSC,4,2               ; @GS_MODE_NTSC
	.comm	_gsGlobal,8,3                   ; @gsGlobal
	.comm	_D_CTRL_RELE_ON,4,2             ; @D_CTRL_RELE_ON
	.comm	_D_CTRL_MFD_OFF,4,2             ; @D_CTRL_MFD_OFF
	.comm	_D_CTRL_STS_UNSPEC,4,2          ; @D_CTRL_STS_UNSPEC
	.comm	_D_CTRL_STD_OFF,4,2             ; @D_CTRL_STD_OFF
	.comm	_D_CTRL_RCYC_8,4,2              ; @D_CTRL_RCYC_8
	.comm	_DMA_CHANNEL_GIF,4,2            ; @DMA_CHANNEL_GIF
	.comm	_GS_PSM_CT32,4,2                ; @GS_PSM_CT32
	.comm	_PAD_PORT,4,2                   ; @PAD_PORT
	.comm	_PAD_SLOT,4,2                   ; @PAD_SLOT
	.comm	_padBuf,4,2                     ; @padBuf
	.comm	_TRUE,4,2                       ; @TRUE
	.comm	_FALSE,4,2                      ; @FALSE
.subsections_via_symbols
