	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ctr_set_texture_frame
_ctr_set_texture_frame:                 ## @ctr_set_texture_frame
	.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
	testq	%rdi, %rdi
	je	LBB0_6
## %bb.1:
	movq	%rsi, %rbx
	testq	%rsi, %rsi
	je	LBB0_6
## %bb.2:
	movq	%rdi, %r13
	movl	%ecx, -44(%rbp)                 ## 4-byte Spill
	movl	12(%rdi), %eax
	cmpl	%r8d, %eax
	cmovbl	%eax, %r8d
	movl	%r8d, -48(%rbp)                 ## 4-byte Spill
	testl	%r8d, %r8d
	je	LBB0_5
## %bb.3:
	movl	8(%r13), %ecx
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	cmpl	%eax, %ecx
	cmovgel	%eax, %ecx
	movq	24(%r13), %r15
	shll	$2, %ecx
	movl	%ecx, -52(%rbp)                 ## 4-byte Spill
	movl	%eax, %r14d
	shlq	$2, %r14
	movl	-48(%rbp), %r12d                ## 4-byte Reload
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r15, %rdi
	movq	%rbx, %rsi
	movl	-52(%rbp), %edx                 ## 4-byte Reload
	callq	_memcpy
	movslq	8(%r13), %rax
	leaq	(%r15,%rax,4), %r15
	addq	%r14, %rbx
	decl	%r12d
	jne	LBB0_4
LBB0_5:
	movq	_CTR_TOP_FRAMEBUFFER_WIDTH@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	subl	%esi, %eax
	shrl	%eax
	movq	32(%r13), %rdi
	movl	%eax, (%rdi)
	movq	_CTR_TOP_FRAMEBUFFER_HEIGHT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	-48(%rbp), %edx                 ## 4-byte Reload
	subl	%edx, %ecx
	shrl	%ecx
	movl	%ecx, 4(%rdi)
	addl	%esi, %eax
	movl	%eax, 8(%rdi)
	addl	%edx, %ecx
	movl	%ecx, 12(%rdi)
	xorps	%xmm0, %xmm0
	movups	%xmm0, 24(%rdi)
	movl	%esi, 16(%rdi)
	movl	%edx, 20(%rdi)
	movl	$4, %esi
	callq	_GSPGPU_FlushDataCache
	movl	$1, (%r13)
	movq	24(%r13), %rdi
	movl	8(%r13), %esi
	imull	12(%r13), %esi
	shll	$2, %esi
	callq	_GSPGPU_FlushDataCache
	movq	24(%r13), %rsi
	movl	8(%r13), %edx
	movl	12(%r13), %ecx
	movq	_CTRGU_RGBA4444@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	movl	16(%r13), %eax
	xorl	%edi, %edi
	xorl	%r9d, %r9d
	pushq	$1
	pushq	%r8
	pushq	%rdx
	pushq	%rax
	callq	_ctrGuCopyImage
	addq	$56, %rsp
	jmp	LBB0_7
LBB0_6:
	addq	$24, %rsp
LBB0_7:
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_CTR_TOP_FRAMEBUFFER_WIDTH,4,2  ## @CTR_TOP_FRAMEBUFFER_WIDTH
	.comm	_CTR_TOP_FRAMEBUFFER_HEIGHT,4,2 ## @CTR_TOP_FRAMEBUFFER_HEIGHT
	.comm	_CTRGU_RGBA4444,4,2             ## @CTRGU_RGBA4444
	.no_dead_strip	_ctr_set_texture_frame
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ctr_set_texture_frame
_ctr_set_texture_frame:                 ; @ctr_set_texture_frame
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.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
	cbz	x0, LBB0_6
; %bb.1:
	mov	x21, x1
	cbz	x1, LBB0_6
; %bb.2:
	mov	x20, x3
	mov	x19, x0
	ldr	w8, [x0, #12]
	cmp	w8, w4
	csel	w24, w8, w4, lo
	cbz	w24, LBB0_5
; %bb.3:
	ldr	x22, [x19, #24]
	ldr	w8, [x19, #8]
	cmp	w8, w20
	csel	w8, w8, w20, lt
	lsl	w23, w8, #2
	mov	w8, w20
	lsl	x25, x8, #2
	mov	x26, x24
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x22
	mov	x1, x21
	mov	x2, x23
	bl	_memcpy
	ldrsw	x8, [x19, #8]
	add	x22, x22, x8, lsl #2
	add	x21, x21, x25
	subs	w26, w26, #1
	b.ne	LBB0_4
LBB0_5:
Lloh0:
	adrp	x8, _CTR_TOP_FRAMEBUFFER_WIDTH@GOTPAGE
Lloh1:
	ldr	x8, [x8, _CTR_TOP_FRAMEBUFFER_WIDTH@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	sub	w8, w8, w20
	lsr	w8, w8, #1
	ldr	x0, [x19, #32]
	str	w8, [x0]
Lloh3:
	adrp	x9, _CTR_TOP_FRAMEBUFFER_HEIGHT@GOTPAGE
Lloh4:
	ldr	x9, [x9, _CTR_TOP_FRAMEBUFFER_HEIGHT@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	sub	w9, w9, w24
	lsr	w9, w9, #1
	add	w8, w8, w20
	stp	w9, w8, [x0, #4]
	add	w8, w9, w24
	stp	xzr, xzr, [x0, #24]
	stp	w8, w20, [x0, #12]
	str	w24, [x0, #20]
	mov	w1, #4
	bl	_GSPGPU_FlushDataCache
	mov	w20, #1
	str	w20, [x19]
	ldr	x0, [x19, #24]
	ldp	w8, w9, [x19, #8]
	mul	w8, w8, w9
	lsl	w1, w8, #2
	bl	_GSPGPU_FlushDataCache
	ldr	x1, [x19, #24]
	ldp	w2, w3, [x19, #8]
Lloh6:
	adrp	x8, _CTRGU_RGBA4444@GOTPAGE
Lloh7:
	ldr	x8, [x8, _CTRGU_RGBA4444@GOTPAGEOFF]
Lloh8:
	ldr	w4, [x8]
	ldr	w6, [x19, #16]
	stp	w4, w20, [sp]
	mov	w0, #0
	mov	w5, #0
	mov	x7, x2
	bl	_ctrGuCopyImage
LBB0_6:
	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
	add	sp, sp, #96
	ret
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_CTR_TOP_FRAMEBUFFER_WIDTH,4,2  ; @CTR_TOP_FRAMEBUFFER_WIDTH
	.comm	_CTR_TOP_FRAMEBUFFER_HEIGHT,4,2 ; @CTR_TOP_FRAMEBUFFER_HEIGHT
	.comm	_CTRGU_RGBA4444,4,2             ; @CTRGU_RGBA4444
	.no_dead_strip	_ctr_set_texture_frame
.subsections_via_symbols
