	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ps2_upload_font
_ps2_upload_font:                       ## @ps2_upload_font
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %rbx
	movq	%rdi, %r13
	movq	(%rsi), %rax
	movl	32(%rax), %edi
	movl	24(%rax), %edx
	movl	28(%rax), %esi
	callq	_gsKit_texture_size
	movl	%eax, %r15d
	movq	_FONTM_VRAM_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_GSKIT_ALLOC_USERBUFFER@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r13, %rdi
	callq	_gsKit_vram_alloc
	movq	(%rbx), %rcx
	movq	%rax, 8(%rcx)
	movq	_GS_FONTM_PAGE_COUNT@GOTPCREL(%rip), %r14
	cmpl	$0, (%r14)
	jle	LBB0_4
## %bb.1:
	xorl	%r12d, %r12d
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	_GSKIT_ALLOC_USERBUFFER@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r13, %rdi
	movl	%r15d, %esi
	callq	_gsKit_vram_alloc
	movq	24(%rbx), %rcx
	movq	%rax, (%rcx,%r12,8)
	movq	32(%rbx), %rax
	movq	$-1, (%rax,%r12,8)
	incq	%r12
	movslq	(%r14), %rax
	cmpq	%rax, %r12
	jl	LBB0_2
## %bb.3:
	movq	(%rbx), %rcx
LBB0_4:
	movq	24(%rbx), %rax
	movq	(%rax), %rax
	movq	%rax, 16(%rcx)
	movq	$0, 16(%rbx)
	movq	_FONTM_TEXTURE_SPACING@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 12(%rbx)
	movq	_GSKIT_FALIGN_LEFT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 8(%rbx)
	movq	_GS_VRAM_TBWALIGN_CLUT@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_GS_VRAM_TBWALIGN@GOTPCREL(%rip), %r14
	movl	(%r14), %esi
	callq	_memalign
	movq	(%rbx), %rcx
	movl	%eax, (%rcx)
	movq	_gsKit_fontm_clut@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movl	(%r14), %edx
	movl	%eax, %edi
	callq	_memcpy
	movq	(%rbx), %rax
	movq	8(%rax), %rcx
	movl	(%rax), %edi
	movl	4(%rax), %r8d
	movq	_GS_CLUT_PALLETE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%rsp)
	movl	$8, %esi
	movl	$2, %edx
	movl	$1, %r9d
	callq	_gsKit_texture_send
	movq	(%rbx), %rax
	movl	(%rax), %edi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_free                           ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_FONTM_VRAM_SIZE,4,2            ## @FONTM_VRAM_SIZE
	.comm	_GSKIT_ALLOC_USERBUFFER,4,2     ## @GSKIT_ALLOC_USERBUFFER
	.comm	_GS_FONTM_PAGE_COUNT,4,2        ## @GS_FONTM_PAGE_COUNT
	.comm	_FONTM_TEXTURE_SPACING,4,2      ## @FONTM_TEXTURE_SPACING
	.comm	_GSKIT_FALIGN_LEFT,4,2          ## @GSKIT_FALIGN_LEFT
	.comm	_GS_VRAM_TBWALIGN_CLUT,4,2      ## @GS_VRAM_TBWALIGN_CLUT
	.comm	_GS_VRAM_TBWALIGN,4,2           ## @GS_VRAM_TBWALIGN
	.comm	_gsKit_fontm_clut,4,2           ## @gsKit_fontm_clut
	.comm	_GS_CLUT_PALLETE,4,2            ## @GS_CLUT_PALLETE
	.no_dead_strip	_ps2_upload_font
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ps2_upload_font
_ps2_upload_font:                       ; @ps2_upload_font
	.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, x1
	mov	x20, x0
	ldr	x8, [x1]
	ldp	w1, w0, [x8, #28]
	ldr	w2, [x8, #24]
	bl	_gsKit_texture_size
	mov	x21, x0
Lloh0:
	adrp	x8, _FONTM_VRAM_SIZE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _FONTM_VRAM_SIZE@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
Lloh3:
	adrp	x22, _GSKIT_ALLOC_USERBUFFER@GOTPAGE
Lloh4:
	ldr	x22, [x22, _GSKIT_ALLOC_USERBUFFER@GOTPAGEOFF]
	ldr	w2, [x22]
	mov	x0, x20
	bl	_gsKit_vram_alloc
	ldr	x8, [x19]
	str	x0, [x8, #8]
Lloh5:
	adrp	x23, _GS_FONTM_PAGE_COUNT@GOTPAGE
Lloh6:
	ldr	x23, [x23, _GS_FONTM_PAGE_COUNT@GOTPAGEOFF]
	ldr	w9, [x23]
	cmp	w9, #1
	b.lt	LBB0_4
; %bb.1:
	mov	x24, #0
	mov	x25, #-1
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w2, [x22]
	mov	x0, x20
	mov	x1, x21
	bl	_gsKit_vram_alloc
	ldr	x8, [x19, #24]
	lsl	x9, x24, #3
	str	x0, [x8, x9]
	ldr	x8, [x19, #32]
	str	x25, [x8, x9]
	add	x24, x24, #1
	ldrsw	x8, [x23]
	cmp	x24, x8
	b.lt	LBB0_2
; %bb.3:
	ldr	x8, [x19]
LBB0_4:
	ldr	x9, [x19, #24]
	ldr	x9, [x9]
	str	x9, [x8, #16]
	str	xzr, [x19, #16]
Lloh7:
	adrp	x8, _FONTM_TEXTURE_SPACING@GOTPAGE
Lloh8:
	ldr	x8, [x8, _FONTM_TEXTURE_SPACING@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
Lloh10:
	adrp	x9, _GSKIT_FALIGN_LEFT@GOTPAGE
Lloh11:
	ldr	x9, [x9, _GSKIT_FALIGN_LEFT@GOTPAGEOFF]
Lloh12:
	ldr	w9, [x9]
	stp	w9, w8, [x19, #8]
Lloh13:
	adrp	x8, _GS_VRAM_TBWALIGN_CLUT@GOTPAGE
Lloh14:
	ldr	x8, [x8, _GS_VRAM_TBWALIGN_CLUT@GOTPAGEOFF]
Lloh15:
	ldr	w0, [x8]
Lloh16:
	adrp	x20, _GS_VRAM_TBWALIGN@GOTPAGE
Lloh17:
	ldr	x20, [x20, _GS_VRAM_TBWALIGN@GOTPAGEOFF]
	ldr	w1, [x20]
	bl	_memalign
	ldr	x8, [x19]
	str	w0, [x8]
Lloh18:
	adrp	x8, _gsKit_fontm_clut@GOTPAGE
Lloh19:
	ldr	x8, [x8, _gsKit_fontm_clut@GOTPAGEOFF]
Lloh20:
	ldr	w1, [x8]
	ldr	w2, [x20]
	bl	_memcpy
	ldr	x8, [x19]
	ldr	x3, [x8, #8]
	ldp	w0, w4, [x8]
Lloh21:
	adrp	x8, _GS_CLUT_PALLETE@GOTPAGE
Lloh22:
	ldr	x8, [x8, _GS_CLUT_PALLETE@GOTPAGEOFF]
Lloh23:
	ldr	w6, [x8]
	mov	w1, #8
	mov	w2, #2
	mov	w5, #1
	bl	_gsKit_texture_send
	ldr	x8, [x19]
	ldr	w0, [x8]
	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	_free
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_FONTM_VRAM_SIZE,4,2            ; @FONTM_VRAM_SIZE
	.comm	_GSKIT_ALLOC_USERBUFFER,4,2     ; @GSKIT_ALLOC_USERBUFFER
	.comm	_GS_FONTM_PAGE_COUNT,4,2        ; @GS_FONTM_PAGE_COUNT
	.comm	_FONTM_TEXTURE_SPACING,4,2      ; @FONTM_TEXTURE_SPACING
	.comm	_GSKIT_FALIGN_LEFT,4,2          ; @GSKIT_FALIGN_LEFT
	.comm	_GS_VRAM_TBWALIGN_CLUT,4,2      ; @GS_VRAM_TBWALIGN_CLUT
	.comm	_GS_VRAM_TBWALIGN,4,2           ; @GS_VRAM_TBWALIGN
	.comm	_gsKit_fontm_clut,4,2           ; @gsKit_fontm_clut
	.comm	_GS_CLUT_PALLETE,4,2            ; @GS_CLUT_PALLETE
	.no_dead_strip	_ps2_upload_font
.subsections_via_symbols
