	.file	"extr_ps2_gfx.c_vram_alloc.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC0:
	.string	"VRAM Allocation Failed. Will not upload texture.\n"
	.text
	.p2align 4
	.type	vram_alloc, @function
vram_alloc:
.LFB0:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rdi
	push	rbx
	.cfi_def_cfa_offset 24
	.cfi_offset 3, -24
	mov	rbx, rsi
	sub	rsp, 8
	.cfi_def_cfa_offset 32
	mov	edx, DWORD PTR 40[rsi]
	mov	edi, DWORD PTR [rbx]
	mov	esi, DWORD PTR 4[rsi]
	call	gsKit_texture_size@PLT
	mov	edx, DWORD PTR GSKIT_ALLOC_USERBUFFER[rip]
	mov	rdi, rbp
	mov	esi, eax
	call	gsKit_vram_alloc@PLT
	cmp	rax, QWORD PTR GSKIT_ALLOC_ERROR[rip]
	mov	QWORD PTR 8[rbx], rax
	je	.L6
.L2:
	cmp	QWORD PTR 32[rbx], 0
	jne	.L7
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	pop	rbx
	.cfi_def_cfa_offset 16
	pop	rbp
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L7:
	.cfi_restore_state
	mov	edx, DWORD PTR 24[rbx]
	mov	esi, 16
	mov	edi, 16
	call	gsKit_texture_size@PLT
	mov	edx, DWORD PTR GSKIT_ALLOC_USERBUFFER[rip]
	mov	rdi, rbp
	mov	esi, eax
	call	gsKit_vram_alloc@PLT
	mov	QWORD PTR 16[rbx], rax
	add	rsp, 8
	.cfi_remember_state
	.cfi_def_cfa_offset 24
	pop	rbx
	.cfi_def_cfa_offset 16
	pop	rbp
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L6:
	.cfi_restore_state
	lea	rdi, .LC0[rip]
	call	printf@PLT
	jmp	.L2
	.cfi_endproc
.LFE0:
	.size	vram_alloc, .-vram_alloc
	.comm	GSKIT_ALLOC_USERBUFFER,4,4
	.comm	GSKIT_ALLOC_ERROR,8,8
	.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_ps2_gfx.c_vram_alloc.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"VRAM Allocation Failed. Will not upload texture.\012"
	.ascii	"\000"
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	vram_alloc, %function
vram_alloc:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, lr}
	mov	r4, r1
	ldr	r2, [r1, #24]
	mov	r5, r0
	ldr	r1, [r1, #4]
	ldr	r0, [r4]
	bl	gsKit_texture_size
	ldr	r6, .L10
	mov	r1, r0
	ldr	r2, [r6]
	mov	r0, r5
	bl	gsKit_vram_alloc
	ldr	r3, .L10+4
	str	r0, [r4, #8]
	ldr	r3, [r3]
	cmp	r0, r3
	beq	.L9
.L2:
	ldr	r3, [r4, #20]
	cmp	r3, #0
	popeq	{r4, r5, r6, pc}
	mov	r1, #16
	ldr	r2, [r4, #16]
	mov	r0, r1
	bl	gsKit_texture_size
	ldr	r2, [r6]
	mov	r1, r0
	mov	r0, r5
	bl	gsKit_vram_alloc
	str	r0, [r4, #12]
	pop	{r4, r5, r6, pc}
.L9:
	ldr	r0, .L10+8
	bl	printf
	b	.L2
.L11:
	.align	2
.L10:
	.word	GSKIT_ALLOC_USERBUFFER
	.word	GSKIT_ALLOC_ERROR
	.word	.LC0
	.size	vram_alloc, .-vram_alloc
	.comm	GSKIT_ALLOC_USERBUFFER,4,4
	.comm	GSKIT_ALLOC_ERROR,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
