	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_TPL_GetTexture                 ## -- Begin function TPL_GetTexture
	.p2align	4, 0x90
_TPL_GetTexture:                        ## @TPL_GetTexture
	.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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	$-1, %r13d
	testl	%esi, %esi
	js	LBB0_11
## %bb.1:
	movq	%rdi, %rbx
	testq	%rdi, %rdi
	je	LBB0_11
## %bb.2:
	movq	%rdx, %r15
	testq	%rdx, %rdx
	je	LBB0_11
## %bb.3:
	cmpl	%esi, (%rbx)
	jle	LBB0_11
## %bb.4:
	movq	24(%rbx), %rax
	testq	%rax, %rax
	je	LBB0_11
## %bb.5:
	movl	%esi, %ecx
	movq	(%rax,%rcx,8), %r14
	testq	%r14, %r14
	je	LBB0_11
## %bb.6:
	movq	_GX_DISABLE@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	movl	44(%r14), %edi
	movl	36(%r14), %edx
	movl	40(%r14), %esi
	callq	_TPL_GetTextureSize
	movl	%eax, %esi
	movq	8(%rbx), %rax
	movq	_TPL_FILE_TYPE_DISC@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_9
## %bb.7:
	movq	16(%rbx), %rbx
	movq	48(%r14), %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	_PPC_CACHE_ALIGNMENT@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	%esi, -56(%rbp)                 ## 4-byte Spill
	callq	_memalign
	movq	%rax, 48(%r14)
	testq	%rax, %rax
	je	LBB0_11
## %bb.8:
	movq	_SEEK_SET@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%rbx, %r13
	movq	%rbx, %rdi
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
                                        ## kill: def $esi killed $esi killed $rsi
	callq	_fseek
	movq	48(%r14), %rdi
	movl	$1, %esi
	movl	-56(%rbp), %ebx                 ## 4-byte Reload
	movl	%ebx, %edx
	movq	%r13, %rcx
	callq	_fread
	movl	%ebx, %esi
LBB0_9:
	movq	%r12, -56(%rbp)                 ## 8-byte Spill
	movq	(%r14), %r12
	xorl	%ebx, %ebx
	testq	%r12, %r12
	setg	%bl
	movss	8(%r14), %xmm0                  ## xmm0 = mem[0],zero,zero,zero
	movss	%xmm0, -48(%rbp)                ## 4-byte Spill
	movq	_GX_ENABLE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -60(%rbp)                 ## 4-byte Spill
	movq	48(%r14), %rdi
	callq	_DCFlushRange
	movq	48(%r14), %rsi
	movl	44(%r14), %edx
	movl	40(%r14), %ecx
	movl	36(%r14), %r8d
	movl	28(%r14), %eax
	movl	32(%r14), %r9d
	movq	%r15, %rdi
	pushq	%rbx
	pushq	%rax
	callq	_GX_InitTexObj
	addq	$16, %rsp
	xorl	%r13d, %r13d
	testq	%r12, %r12
	jle	LBB0_11
## %bb.10:
	xorps	%xmm0, %xmm0
	movss	-48(%rbp), %xmm1                ## 4-byte Reload
                                        ## xmm1 = mem[0],zero,zero,zero
	ucomiss	%xmm0, %xmm1
	movq	-56(%rbp), %r9                  ## 8-byte Reload
	cmoval	-60(%rbp), %r9d                 ## 4-byte Folded Reload
	movl	24(%r14), %esi
	movl	20(%r14), %edx
	movl	16(%r14), %ecx
	movq	(%r14), %r8
	movss	8(%r14), %xmm0                  ## xmm0 = mem[0],zero,zero,zero
	movl	12(%r14), %eax
	movq	%r15, %rdi
	pushq	%rax
	pushq	%r9
	callq	_GX_InitTexObjLOD
	addq	$16, %rsp
LBB0_11:
	movl	%r13d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_GX_DISABLE,4,2                 ## @GX_DISABLE
	.comm	_TPL_FILE_TYPE_DISC,8,3         ## @TPL_FILE_TYPE_DISC
	.comm	_PPC_CACHE_ALIGNMENT,4,2        ## @PPC_CACHE_ALIGNMENT
	.comm	_SEEK_SET,4,2                   ## @SEEK_SET
	.comm	_GX_ENABLE,4,2                  ## @GX_ENABLE
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_TPL_GetTexture                 ; -- Begin function TPL_GetTexture
	.p2align	2
_TPL_GetTexture:                        ; @TPL_GetTexture
	.cfi_startproc
; %bb.0:
	stp	d9, d8, [sp, #-96]!             ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	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
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset b8, -88
	.cfi_offset b9, -96
	mov	x21, x0
	mov	w0, #-1
	tbnz	w1, #31, LBB0_13
; %bb.1:
	cbz	x21, LBB0_13
; %bb.2:
	mov	x19, x2
	cbz	x2, LBB0_13
; %bb.3:
	ldr	w8, [x21]
	cmp	w8, w1
	b.le	LBB0_12
; %bb.4:
	ldr	x8, [x21, #24]
	cbz	x8, LBB0_12
; %bb.5:
	ldr	x23, [x8, w1, uxtw #3]
	cbz	x23, LBB0_12
; %bb.6:
Lloh0:
	adrp	x8, _GX_DISABLE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GX_DISABLE@GOTPAGEOFF]
Lloh2:
	ldr	w24, [x8]
	ldp	w1, w0, [x23, #40]
	ldr	w2, [x23, #36]
	bl	_TPL_GetTextureSize
	mov	x20, x0
	ldr	x8, [x21, #8]
Lloh3:
	adrp	x9, _TPL_FILE_TYPE_DISC@GOTPAGE
Lloh4:
	ldr	x9, [x9, _TPL_FILE_TYPE_DISC@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_9
; %bb.7:
	ldr	x21, [x21, #16]
	ldr	x22, [x23, #48]
Lloh6:
	adrp	x8, _PPC_CACHE_ALIGNMENT@GOTPAGE
Lloh7:
	ldr	x8, [x8, _PPC_CACHE_ALIGNMENT@GOTPAGEOFF]
Lloh8:
	ldr	w0, [x8]
	mov	x1, x20
	bl	_memalign
	str	x0, [x23, #48]
	cbz	x0, LBB0_12
; %bb.8:
Lloh9:
	adrp	x8, _SEEK_SET@GOTPAGE
Lloh10:
	ldr	x8, [x8, _SEEK_SET@GOTPAGEOFF]
Lloh11:
	ldr	w2, [x8]
	mov	x0, x21
	mov	x1, x22
	bl	_fseek
	ldr	x0, [x23, #48]
	mov	w1, #1
	mov	x2, x20
	mov	x3, x21
	bl	_fread
LBB0_9:
	ldr	x25, [x23]
	cmp	x25, #0
	cset	w21, gt
	ldr	s8, [x23, #8]
Lloh12:
	adrp	x8, _GX_ENABLE@GOTPAGE
Lloh13:
	ldr	x8, [x8, _GX_ENABLE@GOTPAGEOFF]
Lloh14:
	ldr	w22, [x8]
	ldr	x0, [x23, #48]
	mov	x1, x20
	bl	_DCFlushRange
	ldr	x1, [x23, #48]
	ldp	w3, w2, [x23, #40]
	ldp	w5, w4, [x23, #32]
	ldr	w6, [x23, #28]
	mov	x0, x19
	mov	x7, x21
	bl	_GX_InitTexObj
	cmp	x25, #1
	b.lt	LBB0_11
; %bb.10:
	fcmp	s8, #0.0
	csel	w5, w22, w24, gt
	ldp	w2, w1, [x23, #20]
	ldr	x4, [x23]
	ldr	s0, [x23, #8]
	ldp	w7, w3, [x23, #12]
	mov	x0, x19
	mov	x6, x5
	bl	_GX_InitTexObjLOD
LBB0_11:
	mov	w0, #0
	b	LBB0_13
LBB0_12:
	mov	w0, #-1
LBB0_13:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	d9, d8, [sp], #96               ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_GX_DISABLE,4,2                 ; @GX_DISABLE
	.comm	_TPL_FILE_TYPE_DISC,8,3         ; @TPL_FILE_TYPE_DISC
	.comm	_PPC_CACHE_ALIGNMENT,4,2        ; @PPC_CACHE_ALIGNMENT
	.comm	_SEEK_SET,4,2                   ; @SEEK_SET
	.comm	_GX_ENABLE,4,2                  ; @GX_ENABLE
.subsections_via_symbols
