	.file	"extr_ctr_gfx.c_ctr_set_texture_frame.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	ctr_set_texture_frame, @function
ctr_set_texture_frame:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	sub	rsp, 24
	.cfi_def_cfa_offset 80
	mov	DWORD PTR 12[rsp], ecx
	test	rdi, rdi
	je	.L1
	mov	rbx, rsi
	test	rsi, rsi
	je	.L1
	mov	eax, ecx
	mov	r13d, ecx
	cmp	DWORD PTR 8[rdi], eax
	cmovle	r13d, DWORD PTR 8[rdi]
	cmp	DWORD PTR 12[rdi], r8d
	cmovbe	r8d, DWORD PTR 12[rdi]
	mov	rbp, rdi
	mov	r14, QWORD PTR 24[rdi]
	mov	r12d, r8d
	test	r8d, r8d
	je	.L3
	sal	rax, 2
	sal	r13d, 2
	xor	r15d, r15d
	mov	QWORD PTR [rsp], rax
	.p2align 4,,10
	.p2align 3
.L4:
	mov	rsi, rbx
	mov	rdi, r14
	mov	edx, r13d
	add	r15d, 1
	call	memcpy@PLT
	movsx	rax, DWORD PTR 8[rbp]
	add	rbx, QWORD PTR [rsp]
	lea	r14, [r14+rax*4]
	cmp	r15d, r12d
	jne	.L4
.L3:
	mov	ecx, DWORD PTR 12[rsp]
	mov	edx, DWORD PTR CTR_TOP_FRAMEBUFFER_WIDTH[rip]
	mov	esi, 4
	mov	eax, DWORD PTR CTR_TOP_FRAMEBUFFER_HEIGHT[rip]
	mov	rdi, QWORD PTR 32[rbp]
	sub	edx, ecx
	sub	eax, r12d
	shr	edx
	mov	DWORD PTR 16[rdi], ecx
	shr	eax
	mov	DWORD PTR [rdi], edx
	add	edx, ecx
	mov	DWORD PTR 4[rdi], eax
	add	eax, r12d
	mov	DWORD PTR 8[rdi], edx
	mov	DWORD PTR 12[rdi], eax
	mov	QWORD PTR 32[rdi], 0
	mov	QWORD PTR 24[rdi], 0
	mov	DWORD PTR 20[rdi], r12d
	call	GSPGPU_FlushDataCache@PLT
	mov	esi, DWORD PTR 8[rbp]
	imul	esi, DWORD PTR 12[rbp]
	mov	DWORD PTR 0[rbp], 1
	mov	rdi, QWORD PTR 24[rbp]
	sal	esi, 2
	call	GSPGPU_FlushDataCache@PLT
	mov	edx, DWORD PTR 8[rbp]
	mov	ecx, DWORD PTR 12[rbp]
	xor	r9d, r9d
	mov	r8d, DWORD PTR CTRGU_RGBA4444[rip]
	mov	rsi, QWORD PTR 24[rbp]
	push	1
	.cfi_def_cfa_offset 88
	xor	edi, edi
	push	r8
	.cfi_def_cfa_offset 96
	push	rdx
	.cfi_def_cfa_offset 104
	mov	eax, DWORD PTR 16[rbp]
	push	rax
	.cfi_def_cfa_offset 112
	call	ctrGuCopyImage@PLT
	add	rsp, 32
	.cfi_def_cfa_offset 80
.L1:
	add	rsp, 24
	.cfi_def_cfa_offset 56
	pop	rbx
	.cfi_def_cfa_offset 48
	pop	rbp
	.cfi_def_cfa_offset 40
	pop	r12
	.cfi_def_cfa_offset 32
	pop	r13
	.cfi_def_cfa_offset 24
	pop	r14
	.cfi_def_cfa_offset 16
	pop	r15
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE0:
	.size	ctr_set_texture_frame, .-ctr_set_texture_frame
	.comm	CTR_TOP_FRAMEBUFFER_WIDTH,4,4
	.comm	CTR_TOP_FRAMEBUFFER_HEIGHT,4,4
	.comm	CTRGU_RGBA4444,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	 1f - 0f
	.long	 4f - 1f
	.long	 5
0:
	.string	 "GNU"
1:
	.align 8
	.long	 0xc0000002
	.long	 3f - 2f
2:
	.long	 0x3
3:
	.align 8
4:

	.arch armv5t
	.eabi_attribute 20, 1
	.eabi_attribute 21, 1
	.eabi_attribute 23, 3
	.eabi_attribute 24, 1
	.eabi_attribute 25, 1
	.eabi_attribute 26, 2
	.eabi_attribute 30, 2
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"extr_ctr_gfx.c_ctr_set_texture_frame.c"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	ctr_set_texture_frame, %function
ctr_set_texture_frame:
	@ args = 8, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	clz	r4, r1
	cmp	r0, #0
	lsr	r4, r4, #5
	moveq	r4, #1
	sub	sp, sp, #28
	cmp	r4, #0
	ldr	r8, [sp, #64]
	bne	.L1
	mov	r9, r3
	ldr	fp, [r0, #4]
	ldr	r3, [r0, #8]
	cmp	r9, fp
	movlt	fp, r9
	cmp	r8, r3
	movcs	r8, r3
	cmp	r8, #0
	mov	r6, r0
	ldr	r7, [r0, #16]
	beq	.L3
	mov	r5, r1
	lsl	fp, fp, #2
	lsl	r10, r9, #2
.L4:
	mov	r1, r5
	mov	r0, r7
	mov	r2, fp
	bl	memcpy
	add	r4, r4, #1
	ldr	r1, [r6, #4]
	cmp	r4, r8
	add	r5, r5, r10
	add	r7, r7, r1, lsl #2
	bne	.L4
.L3:
	mov	r4, #1
	mov	r5, #0
	ldr	r2, .L11
	ldr	r3, .L11+4
	ldr	r2, [r2]
	ldr	r3, [r3]
	ldr	r0, [r6, #20]
	sub	r2, r2, r9
	sub	r3, r3, r8
	lsr	r3, r3, r4
	lsr	r2, r2, r4
	add	r1, r2, r9
	str	r2, [r0]
	add	r2, r3, r8
	str	r2, [r0, #12]
	str	r1, [r0, #8]
	str	r3, [r0, #4]
	mov	r1, #4
	str	r9, [r0, #16]
	str	r8, [r0, #20]
	str	r5, [r0, #28]
	str	r5, [r0, #24]
	bl	GSPGPU_FlushDataCache
	ldmib	r6, {r1, r3}
	mul	r1, r3, r1
	ldr	r0, [r6, #16]
	lsl	r1, r1, #2
	str	r4, [r6]
	bl	GSPGPU_FlushDataCache
	ldr	r3, .L11+8
	ldr	r1, [r6, #12]
	ldr	r3, [r3]
	ldr	r2, [r6, #4]
	str	r4, [sp, #20]
	str	r5, [sp, #4]
	str	r3, [sp, #16]
	str	r3, [sp]
	str	r2, [sp, #12]
	str	r1, [sp, #8]
	mov	r0, r5
	ldr	r3, [r6, #8]
	ldr	r1, [r6, #16]
	bl	ctrGuCopyImage
.L1:
	add	sp, sp, #28
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L12:
	.align	2
.L11:
	.word	CTR_TOP_FRAMEBUFFER_WIDTH
	.word	CTR_TOP_FRAMEBUFFER_HEIGHT
	.word	CTRGU_RGBA4444
	.size	ctr_set_texture_frame, .-ctr_set_texture_frame
	.comm	CTR_TOP_FRAMEBUFFER_WIDTH,4,4
	.comm	CTR_TOP_FRAMEBUFFER_HEIGHT,4,4
	.comm	CTRGU_RGBA4444,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
