	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function wiiu_init_frame_textures
_wiiu_init_frame_textures:              ## @wiiu_init_frame_textures
	.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	%edx, -48(%rbp)                 ## 4-byte Spill
	movl	%esi, -44(%rbp)                 ## 4-byte Spill
	movq	%rdi, %r14
	leaq	32(%rdi), %r12
	leaq	40(%rdi), %r13
	movq	64(%rdi), %rdi
	callq	_MEM2_free
	movq	16(%r14), %rax
	testq	%rax, %rax
	je	LBB0_7
## %bb.1:
	cmpl	$0, (%rax)
	je	LBB0_7
## %bb.2:
	movq	(%r14), %rax
	movl	$120, %ebx
	xorl	%r15d, %r15d
	jmp	LBB0_3
	.p2align	4, 0x90
LBB0_5:                                 ##   in Loop: Header=BB0_3 Depth=1
	callq	_MEM2_free
LBB0_6:                                 ##   in Loop: Header=BB0_3 Depth=1
	movq	(%r14), %rax
	movq	$0, (%rax,%rbx)
	incq	%r15
	movq	16(%r14), %rcx
	movl	(%rcx), %ecx
	addq	$168, %rbx
	cmpq	%rcx, %r15
	jae	LBB0_7
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	cmpl	$0, -120(%rax,%rbx)
	movq	(%rax,%rbx), %rdi
	je	LBB0_5
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	callq	_MEM1_free
	jmp	LBB0_6
LBB0_7:
	movq	%r12, %rdi
	xorl	%esi, %esi
	movl	$4, %edx
	callq	_memset
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	movl	%eax, 40(%r14)
	movl	-48(%rbp), %eax                 ## 4-byte Reload
	movl	%eax, 44(%r14)
	movl	$1, 48(%r14)
	movq	_GX2_SURFACE_DIM_TEXTURE_2D@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, 88(%r14)
	movq	_GX2_TILE_MODE_LINEAR_ALIGNED@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 96(%r14)
	movl	$1, 32(%r14)
	cmpq	$0, 112(%r14)
	movq	_GX2_SURFACE_FORMAT_UNORM_R5_G6_B5@GOTPCREL(%rip), %rax
	cmovneq	_GX2_SURFACE_FORMAT_UNORM_R8_G8_B8_A8@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, 80(%r14)
	movq	__B@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	__G@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, %edi
	cmovel	%esi, %edi
	cmovel	%eax, %esi
	movq	__R@GOTPCREL(%rip), %rax
	cmovneq	__A@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	__1@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	callq	_GX2_COMP_SEL
	movq	%rax, 104(%r14)
	movq	%r13, %rdi
	callq	_GX2CalcSurfaceSizeAndAlignment
	movq	%r12, %rdi
	callq	_GX2InitTextureRegs
	movl	52(%r14), %edi
	movl	72(%r14), %esi
	callq	_MEM2_alloc
	movq	%rax, 64(%r14)
	movl	52(%r14), %edx
	movq	%rax, %rdi
	xorl	%esi, %esi
	callq	_memset
	movq	_GX2_INVALIDATE_MODE_CPU_TEXTURE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	64(%r14), %rsi
	movl	52(%r14), %edx
	callq	_GX2Invalidate
	movq	16(%r14), %rdx
	movl	$1, %eax
	testq	%rdx, %rdx
	je	LBB0_41
## %bb.8:
	cmpl	$0, (%rdx)
	je	LBB0_41
## %bb.9:
	movl	$88, %r12d
	xorl	%r13d, %r13d
	xorl	%ebx, %ebx
	jmp	LBB0_10
	.p2align	4, 0x90
LBB0_35:                                ##   in Loop: Header=BB0_10 Depth=1
	movq	(%r14), %rax
	movl	$1, -88(%rax,%r12)
	movl	20(%rax,%r12), %edi
	movl	40(%rax,%r12), %esi
	callq	_MEM1_alloc
	movq	(%r14), %rcx
	movq	%rax, 32(%rcx,%r12)
	testq	%rax, %rax
	je	LBB0_36
LBB0_38:                                ##   in Loop: Header=BB0_10 Depth=1
	movl	20(%rcx,%r12), %edx
	movq	%rax, %rdi
	xorl	%esi, %esi
	callq	_memset
	movq	_GX2_INVALIDATE_MODE_CPU_TEXTURE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	(%r14), %rax
	movq	32(%rax,%r12), %rsi
	movl	20(%rax,%r12), %edx
	callq	_GX2Invalidate
LBB0_39:                                ##   in Loop: Header=BB0_10 Depth=1
	movq	(%r14), %rax
	leaq	(%rax,%r12), %rdi
	addq	$-80, %rdi
	xorl	%esi, %esi
	movl	$80, %edx
	callq	_memset
	movq	(%r14), %rax
	movups	8(%rax,%r12), %xmm0
	movups	24(%rax,%r12), %xmm1
	movups	40(%rax,%r12), %xmm2
	movups	56(%rax,%r12), %xmm3
	movups	%xmm0, -72(%rax,%r12)
	movups	%xmm1, -56(%rax,%r12)
	movups	%xmm2, -40(%rax,%r12)
	movups	%xmm3, -24(%rax,%r12)
	movq	(%r14), %rax
	leaq	(%rax,%r12), %rdi
	addq	$-80, %rdi
	callq	_GX2InitColorBufferRegs
	incq	%rbx
	movq	16(%r14), %rdx
	movl	(%rdx), %ecx
	addq	$40, %r13
	addq	$168, %r12
	cmpq	%rcx, %rbx
	jae	LBB0_40
LBB0_10:                                ## =>This Inner Loop Header: Depth=1
	movq	8(%rdx), %r15
	movl	(%r15,%r13), %eax
	cmpl	$128, %eax
	je	LBB0_14
## %bb.11:                              ##   in Loop: Header=BB0_10 Depth=1
	cmpl	$130, %eax
	je	LBB0_15
## %bb.12:                              ##   in Loop: Header=BB0_10 Depth=1
	cmpl	$129, %eax
	jne	LBB0_17
## %bb.13:                              ##   in Loop: Header=BB0_10 Depth=1
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	imull	4(%r15,%r13), %eax
	jmp	LBB0_16
	.p2align	4, 0x90
LBB0_36:                                ##   in Loop: Header=BB0_10 Depth=1
	leaq	L_str(%rip), %rdi
	callq	_puts
	movq	(%r14), %rax
	movl	$0, -88(%rax,%r12)
	movl	20(%rax,%r12), %edi
	movl	40(%rax,%r12), %esi
	callq	_MEM2_alloc
	movq	(%r14), %rcx
	movq	%rax, 32(%rcx,%r12)
	testq	%rax, %rax
	jne	LBB0_38
	jmp	LBB0_37
	.p2align	4, 0x90
LBB0_14:                                ##   in Loop: Header=BB0_10 Depth=1
	movl	4(%r15,%r13), %eax
	imull	8(%r14), %eax
	jmp	LBB0_16
	.p2align	4, 0x90
LBB0_15:                                ##   in Loop: Header=BB0_10 Depth=1
	movl	8(%r15,%r13), %eax
LBB0_16:                                ##   in Loop: Header=BB0_10 Depth=1
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
LBB0_17:                                ##   in Loop: Header=BB0_10 Depth=1
	movl	12(%r15,%r13), %eax
	cmpl	$128, %eax
	je	LBB0_22
## %bb.18:                              ##   in Loop: Header=BB0_10 Depth=1
	cmpl	$130, %eax
	je	LBB0_23
## %bb.19:                              ##   in Loop: Header=BB0_10 Depth=1
	cmpl	$129, %eax
	jne	LBB0_20
## %bb.21:                              ##   in Loop: Header=BB0_10 Depth=1
	movl	-48(%rbp), %eax                 ## 4-byte Reload
	imull	16(%r15,%r13), %eax
	cmpl	$0, -44(%rbp)                   ## 4-byte Folded Reload
	jne	LBB0_26
	jmp	LBB0_25
	.p2align	4, 0x90
LBB0_22:                                ##   in Loop: Header=BB0_10 Depth=1
	movl	16(%r15,%r13), %eax
	imull	12(%r14), %eax
	cmpl	$0, -44(%rbp)                   ## 4-byte Folded Reload
	jne	LBB0_26
	jmp	LBB0_25
	.p2align	4, 0x90
LBB0_23:                                ##   in Loop: Header=BB0_10 Depth=1
	movl	20(%r15,%r13), %eax
	cmpl	$0, -44(%rbp)                   ## 4-byte Folded Reload
	jne	LBB0_26
	jmp	LBB0_25
	.p2align	4, 0x90
LBB0_20:                                ##   in Loop: Header=BB0_10 Depth=1
	movl	-48(%rbp), %eax                 ## 4-byte Reload
	cmpl	$0, -44(%rbp)                   ## 4-byte Folded Reload
	jne	LBB0_26
LBB0_25:                                ##   in Loop: Header=BB0_10 Depth=1
	movl	24(%r14), %ecx
	movl	%ecx, -44(%rbp)                 ## 4-byte Spill
LBB0_26:                                ##   in Loop: Header=BB0_10 Depth=1
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	testl	%eax, %eax
	jne	LBB0_28
## %bb.27:                              ##   in Loop: Header=BB0_10 Depth=1
	movl	28(%r14), %eax
LBB0_28:                                ##   in Loop: Header=BB0_10 Depth=1
	movq	(%r14), %rdi
	addq	%r12, %rdi
	xorl	%esi, %esi
	movl	$80, %edx
	movl	%eax, %ebx
	callq	_memset
	movq	_GX2_SURFACE_DIM_TEXTURE_2D@GOTPCREL(%rip), %rax
	movq	(%rax), %rcx
	movq	(%r14), %rax
	movq	%rcx, 56(%rax,%r12)
	movl	-44(%rbp), %ecx                 ## 4-byte Reload
	movl	%ecx, 8(%rax,%r12)
	movl	%ebx, -48(%rbp)                 ## 4-byte Spill
	movl	%ebx, 12(%rax,%r12)
	movl	$1, 16(%rax,%r12)
	cmpq	$0, 32(%r15,%r13)
	je	LBB0_30
## %bb.29:                              ##   in Loop: Header=BB0_10 Depth=1
	movq	_GX2_SURFACE_FORMAT_FLOAT_R32_G32_B32_A32@GOTPCREL(%rip), %rcx
	jmp	LBB0_32
	.p2align	4, 0x90
LBB0_30:                                ##   in Loop: Header=BB0_10 Depth=1
	cmpq	$0, 24(%r15,%r13)
	movq	_GX2_SURFACE_FORMAT_SRGB_R8_G8_B8_A8@GOTPCREL(%rip), %rcx
	jne	LBB0_32
## %bb.31:                              ##   in Loop: Header=BB0_10 Depth=1
	movq	_GX2_SURFACE_FORMAT_UNORM_R8_G8_B8_A8@GOTPCREL(%rip), %rcx
	.p2align	4, 0x90
LBB0_32:                                ##   in Loop: Header=BB0_10 Depth=1
	movq	(%rcx), %rcx
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	movq	%rcx, 48(%rax,%r12)
	movq	_GX2_SURFACE_USE_COLOR_BUFFER@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movq	_GX2_SURFACE_USE_TEXTURE@GOTPCREL(%rip), %rdx
	orl	(%rdx), %ecx
	movl	%ecx, 28(%rax,%r12)
	movl	$1, (%rax,%r12)
	movq	__R@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	__G@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	__B@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	__A@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	callq	_GX2_COMP_SEL
	movq	(%r14), %rcx
	movq	%rax, 72(%rcx,%r12)
	leaq	(%rcx,%r12), %rdi
	addq	$8, %rdi
	callq	_GX2CalcSurfaceSizeAndAlignment
	movq	(%r14), %rdi
	addq	%r12, %rdi
	callq	_GX2InitTextureRegs
	movq	16(%r14), %rax
	movl	(%rax), %eax
	decl	%eax
	cmpq	%rax, %rbx
	jne	LBB0_35
## %bb.33:                              ##   in Loop: Header=BB0_10 Depth=1
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	cmpl	8(%r14), %eax
	jne	LBB0_35
## %bb.34:                              ##   in Loop: Header=BB0_10 Depth=1
	movl	-48(%rbp), %eax                 ## 4-byte Reload
	cmpl	12(%r14), %eax
	jne	LBB0_35
	jmp	LBB0_39
LBB0_40:
	movl	$1, %eax
	jmp	LBB0_41
LBB0_37:
	leaq	L_str.2(%rip), %rdi
	callq	_puts
	movq	%r14, %rdi
	callq	_wiiu_free_shader_preset
	xorl	%eax, %eax
LBB0_41:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_GX2_SURFACE_DIM_TEXTURE_2D,8,3 ## @GX2_SURFACE_DIM_TEXTURE_2D
	.comm	_GX2_TILE_MODE_LINEAR_ALIGNED,4,2 ## @GX2_TILE_MODE_LINEAR_ALIGNED
	.comm	_GX2_SURFACE_FORMAT_UNORM_R8_G8_B8_A8,8,3 ## @GX2_SURFACE_FORMAT_UNORM_R8_G8_B8_A8
	.comm	__G,4,2                         ## @_G
	.comm	__B,4,2                         ## @_B
	.comm	__A,4,2                         ## @_A
	.comm	__1,4,2                         ## @_1
	.comm	_GX2_SURFACE_FORMAT_UNORM_R5_G6_B5,8,3 ## @GX2_SURFACE_FORMAT_UNORM_R5_G6_B5
	.comm	__R,4,2                         ## @_R
	.comm	_GX2_INVALIDATE_MODE_CPU_TEXTURE,4,2 ## @GX2_INVALIDATE_MODE_CPU_TEXTURE
	.comm	_GX2_SURFACE_FORMAT_FLOAT_R32_G32_B32_A32,8,3 ## @GX2_SURFACE_FORMAT_FLOAT_R32_G32_B32_A32
	.comm	_GX2_SURFACE_FORMAT_SRGB_R8_G8_B8_A8,8,3 ## @GX2_SURFACE_FORMAT_SRGB_R8_G8_B8_A8
	.comm	_GX2_SURFACE_USE_TEXTURE,4,2    ## @GX2_SURFACE_USE_TEXTURE
	.comm	_GX2_SURFACE_USE_COLOR_BUFFER,4,2 ## @GX2_SURFACE_USE_COLOR_BUFFER
	.section	__TEXT,__cstring,cstring_literals
L_str:                                  ## @str
	.asciz	"failed to allocate Render target memory from MEM1. trying MEM2."

L_str.2:                                ## @str.2
	.asciz	"failed to allocate Render target memory from MEM2. falling back to stock."

	.no_dead_strip	_wiiu_init_frame_textures
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function wiiu_init_frame_textures
_wiiu_init_frame_textures:              ; @wiiu_init_frame_textures
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [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 w27, -88
	.cfi_offset w28, -96
	mov	x20, x2
	mov	x21, x1
	mov	x19, x0
	add	x23, x0, #32
	add	x24, x0, #40
	ldr	x0, [x0, #64]
	bl	_MEM2_free
	ldr	x8, [x19, #16]
	cbz	x8, LBB0_7
; %bb.1:
	ldr	w8, [x8]
	cbz	w8, LBB0_7
; %bb.2:
	mov	x22, #0
	mov	x25, #0
	ldr	x8, [x19]
	b	LBB0_5
LBB0_3:                                 ;   in Loop: Header=BB0_5 Depth=1
	bl	_MEM2_free
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=1
	ldr	x8, [x19]
	add	x9, x8, x22
	str	xzr, [x9, #120]
	add	x25, x25, #1
	ldr	x9, [x19, #16]
	ldr	w9, [x9]
	add	x22, x22, #168
	cmp	x25, x9
	b.hs	LBB0_7
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	add	x8, x8, x22
	ldr	w9, [x8]
	ldr	x0, [x8, #120]
	cbz	w9, LBB0_3
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	bl	_MEM1_free
	b	LBB0_4
LBB0_7:
	mov	x0, x23
	mov	w1, #0
	mov	w2, #4
	bl	_memset
	stp	w21, w20, [x19, #40]
	mov	w22, #1
	str	w22, [x19, #48]
Lloh0:
	adrp	x8, _GX2_SURFACE_DIM_TEXTURE_2D@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GX2_SURFACE_DIM_TEXTURE_2D@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
Lloh3:
	adrp	x9, _GX2_TILE_MODE_LINEAR_ALIGNED@GOTPAGE
Lloh4:
	ldr	x9, [x9, _GX2_TILE_MODE_LINEAR_ALIGNED@GOTPAGEOFF]
	str	x8, [x19, #88]
Lloh5:
	ldr	w8, [x9]
	str	w8, [x19, #96]
	str	w22, [x19, #32]
Lloh6:
	adrp	x8, _GX2_SURFACE_FORMAT_UNORM_R5_G6_B5@GOTPAGE
Lloh7:
	ldr	x8, [x8, _GX2_SURFACE_FORMAT_UNORM_R5_G6_B5@GOTPAGEOFF]
	ldr	x9, [x19, #112]
Lloh8:
	adrp	x10, _GX2_SURFACE_FORMAT_UNORM_R8_G8_B8_A8@GOTPAGE
Lloh9:
	ldr	x10, [x10, _GX2_SURFACE_FORMAT_UNORM_R8_G8_B8_A8@GOTPAGEOFF]
	cmp	x9, #0
	csel	x8, x8, x10, eq
	ldr	x8, [x8]
	str	x8, [x19, #80]
Lloh10:
	adrp	x8, __B@GOTPAGE
Lloh11:
	ldr	x8, [x8, __B@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
Lloh13:
	adrp	x9, __G@GOTPAGE
Lloh14:
	ldr	x9, [x9, __G@GOTPAGEOFF]
Lloh15:
	ldr	w9, [x9]
	csel	w0, w8, w9, eq
Lloh16:
	adrp	x10, __R@GOTPAGE
Lloh17:
	ldr	x10, [x10, __R@GOTPAGEOFF]
Lloh18:
	adrp	x11, __A@GOTPAGE
Lloh19:
	ldr	x11, [x11, __A@GOTPAGEOFF]
	csel	w1, w9, w8, eq
	csel	x8, x10, x11, eq
	ldr	w2, [x8]
Lloh20:
	adrp	x8, __1@GOTPAGE
Lloh21:
	ldr	x8, [x8, __1@GOTPAGEOFF]
Lloh22:
	ldr	w3, [x8]
	bl	_GX2_COMP_SEL
	str	x0, [x19, #104]
	mov	x0, x24
	bl	_GX2CalcSurfaceSizeAndAlignment
	mov	x0, x23
	bl	_GX2InitTextureRegs
	ldr	w0, [x19, #52]
	ldr	w1, [x19, #72]
	bl	_MEM2_alloc
	str	x0, [x19, #64]
	ldr	w2, [x19, #52]
	mov	w1, #0
	bl	_memset
Lloh23:
	adrp	x8, _GX2_INVALIDATE_MODE_CPU_TEXTURE@GOTPAGE
Lloh24:
	ldr	x8, [x8, _GX2_INVALIDATE_MODE_CPU_TEXTURE@GOTPAGEOFF]
Lloh25:
	ldr	w0, [x8]
	ldr	x1, [x19, #64]
	ldr	w2, [x19, #52]
	bl	_GX2Invalidate
	ldr	x8, [x19, #16]
	cbz	x8, LBB0_38
; %bb.8:
	ldr	w9, [x8]
	mov	w22, #1
	cbz	w9, LBB0_38
; %bb.9:
	mov	x23, #0
	mov	x24, #0
	mov	w27, #88
Lloh26:
	adrp	x28, _GX2_SURFACE_USE_TEXTURE@GOTPAGE
Lloh27:
	ldr	x28, [x28, _GX2_SURFACE_USE_TEXTURE@GOTPAGEOFF]
Lloh28:
	adrp	x26, _GX2_SURFACE_USE_COLOR_BUFFER@GOTPAGE
Lloh29:
	ldr	x26, [x26, _GX2_SURFACE_USE_COLOR_BUFFER@GOTPAGEOFF]
	b	LBB0_13
LBB0_10:                                ;   in Loop: Header=BB0_13 Depth=1
	ldr	x8, [x19]
	add	x8, x8, x27
	stur	w22, [x8, #-88]
	ldr	w0, [x8, #20]
	ldr	w1, [x8, #40]
	bl	_MEM1_alloc
	ldr	x8, [x19]
	add	x9, x8, x27
	str	x0, [x9, #32]
	cbz	x0, LBB0_17
LBB0_11:                                ;   in Loop: Header=BB0_13 Depth=1
	add	x8, x8, x27
	ldr	w2, [x8, #20]
	mov	w1, #0
	bl	_memset
Lloh30:
	adrp	x8, _GX2_INVALIDATE_MODE_CPU_TEXTURE@GOTPAGE
Lloh31:
	ldr	x8, [x8, _GX2_INVALIDATE_MODE_CPU_TEXTURE@GOTPAGEOFF]
Lloh32:
	ldr	w0, [x8]
	ldr	x8, [x19]
	add	x8, x8, x27
	ldr	x1, [x8, #32]
	ldr	w2, [x8, #20]
	bl	_GX2Invalidate
LBB0_12:                                ;   in Loop: Header=BB0_13 Depth=1
	ldr	x8, [x19]
	add	x8, x8, x27
	sub	x0, x8, #80
	mov	w1, #0
	mov	w2, #80
	bl	_memset
	ldr	x8, [x19]
	add	x8, x8, x27
	ldur	q0, [x8, #56]
	stur	q0, [x8, #-24]
	ldur	q0, [x8, #40]
	stur	q0, [x8, #-40]
	ldur	q0, [x8, #24]
	stur	q0, [x8, #-56]
	ldur	q0, [x8, #8]
	stur	q0, [x8, #-72]
	ldr	x8, [x19]
	add	x8, x8, x27
	sub	x0, x8, #80
	bl	_GX2InitColorBufferRegs
	add	x24, x24, #1
	ldr	x8, [x19, #16]
	ldr	w9, [x8]
	add	x23, x23, #40
	add	x27, x27, #168
	cmp	x24, x9
	b.hs	LBB0_36
LBB0_13:                                ; =>This Inner Loop Header: Depth=1
	ldr	x25, [x8, #8]
	ldr	w8, [x25, x23]
	cmp	w8, #128
	b.eq	LBB0_18
; %bb.14:                               ;   in Loop: Header=BB0_13 Depth=1
	cmp	w8, #130
	b.eq	LBB0_19
; %bb.15:                               ;   in Loop: Header=BB0_13 Depth=1
	cmp	w8, #129
	b.ne	LBB0_20
; %bb.16:                               ;   in Loop: Header=BB0_13 Depth=1
	add	x8, x25, x23
	ldr	w8, [x8, #4]
	mul	w21, w8, w21
	b	LBB0_20
LBB0_17:                                ;   in Loop: Header=BB0_13 Depth=1
Lloh33:
	adrp	x0, l_str@PAGE
Lloh34:
	add	x0, x0, l_str@PAGEOFF
	bl	_puts
	ldr	x8, [x19]
	add	x8, x8, x27
	stur	wzr, [x8, #-88]
	ldr	w0, [x8, #20]
	ldr	w1, [x8, #40]
	bl	_MEM2_alloc
	ldr	x8, [x19]
	add	x9, x8, x27
	str	x0, [x9, #32]
	cbnz	x0, LBB0_11
	b	LBB0_37
LBB0_18:                                ;   in Loop: Header=BB0_13 Depth=1
	ldr	w8, [x19, #8]
	add	x9, x25, x23
	ldr	w9, [x9, #4]
	mul	w21, w9, w8
	b	LBB0_20
LBB0_19:                                ;   in Loop: Header=BB0_13 Depth=1
	add	x8, x25, x23
	ldr	w21, [x8, #8]
LBB0_20:                                ;   in Loop: Header=BB0_13 Depth=1
	add	x9, x25, x23
	ldr	w8, [x9, #12]
	cmp	w8, #128
	b.eq	LBB0_31
; %bb.21:                               ;   in Loop: Header=BB0_13 Depth=1
	cmp	w8, #130
	b.eq	LBB0_32
; %bb.22:                               ;   in Loop: Header=BB0_13 Depth=1
	cmp	w8, #129
	b.eq	LBB0_33
; %bb.23:                               ;   in Loop: Header=BB0_13 Depth=1
	cbz	w21, LBB0_34
LBB0_24:                                ;   in Loop: Header=BB0_13 Depth=1
	cbz	w20, LBB0_35
LBB0_25:                                ;   in Loop: Header=BB0_13 Depth=1
	ldr	x8, [x19]
	add	x0, x8, x27
	mov	w1, #0
	mov	w2, #80
	bl	_memset
Lloh35:
	adrp	x8, _GX2_SURFACE_DIM_TEXTURE_2D@GOTPAGE
Lloh36:
	ldr	x8, [x8, _GX2_SURFACE_DIM_TEXTURE_2D@GOTPAGEOFF]
Lloh37:
	ldr	x9, [x8]
	ldr	x8, [x19]
	add	x10, x8, x27
	str	x9, [x10, #56]
	stp	w21, w20, [x10, #8]
	str	w22, [x10, #16]
	add	x9, x25, x23
	ldr	x10, [x9, #32]
	cbz	x10, LBB0_27
; %bb.26:                               ;   in Loop: Header=BB0_13 Depth=1
Lloh38:
	adrp	x9, _GX2_SURFACE_FORMAT_FLOAT_R32_G32_B32_A32@GOTPAGE
Lloh39:
	ldr	x9, [x9, _GX2_SURFACE_FORMAT_FLOAT_R32_G32_B32_A32@GOTPAGEOFF]
	b	LBB0_28
LBB0_27:                                ;   in Loop: Header=BB0_13 Depth=1
	ldr	x9, [x9, #24]
	cmp	x9, #0
Lloh40:
	adrp	x9, _GX2_SURFACE_FORMAT_UNORM_R8_G8_B8_A8@GOTPAGE
Lloh41:
	ldr	x9, [x9, _GX2_SURFACE_FORMAT_UNORM_R8_G8_B8_A8@GOTPAGEOFF]
Lloh42:
	adrp	x10, _GX2_SURFACE_FORMAT_SRGB_R8_G8_B8_A8@GOTPAGE
Lloh43:
	ldr	x10, [x10, _GX2_SURFACE_FORMAT_SRGB_R8_G8_B8_A8@GOTPAGEOFF]
	csel	x9, x9, x10, eq
LBB0_28:                                ;   in Loop: Header=BB0_13 Depth=1
	ldr	x9, [x9]
	add	x8, x8, x27
	str	x9, [x8, #48]
	ldr	w9, [x28]
	ldr	w10, [x26]
	orr	w9, w10, w9
	str	w9, [x8, #28]
	str	w22, [x8]
Lloh44:
	adrp	x8, __R@GOTPAGE
Lloh45:
	ldr	x8, [x8, __R@GOTPAGEOFF]
Lloh46:
	ldr	w0, [x8]
Lloh47:
	adrp	x8, __G@GOTPAGE
Lloh48:
	ldr	x8, [x8, __G@GOTPAGEOFF]
Lloh49:
	ldr	w1, [x8]
Lloh50:
	adrp	x8, __B@GOTPAGE
Lloh51:
	ldr	x8, [x8, __B@GOTPAGEOFF]
Lloh52:
	ldr	w2, [x8]
Lloh53:
	adrp	x8, __A@GOTPAGE
Lloh54:
	ldr	x8, [x8, __A@GOTPAGEOFF]
Lloh55:
	ldr	w3, [x8]
	bl	_GX2_COMP_SEL
	ldr	x8, [x19]
	add	x8, x8, x27
	str	x0, [x8, #72]
	add	x0, x8, #8
	bl	_GX2CalcSurfaceSizeAndAlignment
	ldr	x8, [x19]
	add	x0, x8, x27
	bl	_GX2InitTextureRegs
	ldr	x8, [x19, #16]
	ldr	w8, [x8]
	sub	w8, w8, #1
	cmp	x24, x8
	b.ne	LBB0_10
; %bb.29:                               ;   in Loop: Header=BB0_13 Depth=1
	ldr	w8, [x19, #8]
	cmp	w21, w8
	b.ne	LBB0_10
; %bb.30:                               ;   in Loop: Header=BB0_13 Depth=1
	ldr	w8, [x19, #12]
	cmp	w20, w8
	b.ne	LBB0_10
	b	LBB0_12
LBB0_31:                                ;   in Loop: Header=BB0_13 Depth=1
	ldr	w8, [x19, #12]
	ldr	w9, [x9, #16]
	mul	w20, w9, w8
	cbnz	w21, LBB0_24
	b	LBB0_34
LBB0_32:                                ;   in Loop: Header=BB0_13 Depth=1
	add	x8, x25, x23
	ldr	w20, [x8, #20]
	cbnz	w21, LBB0_24
	b	LBB0_34
LBB0_33:                                ;   in Loop: Header=BB0_13 Depth=1
	add	x8, x25, x23
	ldr	w8, [x8, #16]
	mul	w20, w8, w20
	cbnz	w21, LBB0_24
LBB0_34:                                ;   in Loop: Header=BB0_13 Depth=1
	ldr	w21, [x19, #24]
	cbnz	w20, LBB0_25
LBB0_35:                                ;   in Loop: Header=BB0_13 Depth=1
	ldr	w20, [x19, #28]
	b	LBB0_25
LBB0_36:
	mov	w22, #1
	b	LBB0_38
LBB0_37:
Lloh56:
	adrp	x0, l_str.2@PAGE
Lloh57:
	add	x0, x0, l_str.2@PAGEOFF
	bl	_puts
	mov	x0, x19
	bl	_wiiu_free_shader_preset
	mov	w22, #0
LBB0_38:
	mov	x0, x22
	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	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh28, Lloh29
	.loh AdrpLdrGot	Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpAdd	Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.loh AdrpLdrGot	Lloh38, Lloh39
	.loh AdrpLdrGot	Lloh42, Lloh43
	.loh AdrpLdrGot	Lloh40, Lloh41
	.loh AdrpLdrGotLdr	Lloh53, Lloh54, Lloh55
	.loh AdrpLdrGotLdr	Lloh50, Lloh51, Lloh52
	.loh AdrpLdrGotLdr	Lloh47, Lloh48, Lloh49
	.loh AdrpLdrGotLdr	Lloh44, Lloh45, Lloh46
	.loh AdrpAdd	Lloh56, Lloh57
	.cfi_endproc
                                        ; -- End function
	.comm	_GX2_SURFACE_DIM_TEXTURE_2D,8,3 ; @GX2_SURFACE_DIM_TEXTURE_2D
	.comm	_GX2_TILE_MODE_LINEAR_ALIGNED,4,2 ; @GX2_TILE_MODE_LINEAR_ALIGNED
	.comm	_GX2_SURFACE_FORMAT_UNORM_R8_G8_B8_A8,8,3 ; @GX2_SURFACE_FORMAT_UNORM_R8_G8_B8_A8
	.comm	__G,4,2                         ; @_G
	.comm	__B,4,2                         ; @_B
	.comm	__A,4,2                         ; @_A
	.comm	__1,4,2                         ; @_1
	.comm	_GX2_SURFACE_FORMAT_UNORM_R5_G6_B5,8,3 ; @GX2_SURFACE_FORMAT_UNORM_R5_G6_B5
	.comm	__R,4,2                         ; @_R
	.comm	_GX2_INVALIDATE_MODE_CPU_TEXTURE,4,2 ; @GX2_INVALIDATE_MODE_CPU_TEXTURE
	.comm	_GX2_SURFACE_FORMAT_FLOAT_R32_G32_B32_A32,8,3 ; @GX2_SURFACE_FORMAT_FLOAT_R32_G32_B32_A32
	.comm	_GX2_SURFACE_FORMAT_SRGB_R8_G8_B8_A8,8,3 ; @GX2_SURFACE_FORMAT_SRGB_R8_G8_B8_A8
	.comm	_GX2_SURFACE_USE_TEXTURE,4,2    ; @GX2_SURFACE_USE_TEXTURE
	.comm	_GX2_SURFACE_USE_COLOR_BUFFER,4,2 ; @GX2_SURFACE_USE_COLOR_BUFFER
	.section	__TEXT,__cstring,cstring_literals
l_str:                                  ; @str
	.asciz	"failed to allocate Render target memory from MEM1. trying MEM2."

l_str.2:                                ; @str.2
	.asciz	"failed to allocate Render target memory from MEM2. falling back to stock."

	.no_dead_strip	_wiiu_init_frame_textures
.subsections_via_symbols
