	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function vram_alloc
_vram_alloc:                            ## @vram_alloc
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %rbx
	movq	%rdi, %r14
	movl	(%rsi), %edi
	movl	4(%rsi), %esi
	movl	40(%rbx), %edx
	callq	_gsKit_texture_size
	movq	_GSKIT_ALLOC_USERBUFFER@GOTPCREL(%rip), %r15
	movl	(%r15), %edx
	movq	%r14, %rdi
	movl	%eax, %esi
	callq	_gsKit_vram_alloc
	movq	%rax, 8(%rbx)
	movq	_GSKIT_ALLOC_ERROR@GOTPCREL(%rip), %rcx
	cmpq	%rax, (%rcx)
	jne	LBB0_2
## %bb.1:
	leaq	L_str(%rip), %rdi
	callq	_puts
LBB0_2:
	cmpq	$0, 32(%rbx)
	je	LBB0_4
## %bb.3:
	movl	24(%rbx), %edx
	movl	$16, %edi
	movl	$16, %esi
	callq	_gsKit_texture_size
	movl	(%r15), %edx
	movq	%r14, %rdi
	movl	%eax, %esi
	callq	_gsKit_vram_alloc
	movq	%rax, 16(%rbx)
LBB0_4:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_GSKIT_ALLOC_USERBUFFER,4,2     ## @GSKIT_ALLOC_USERBUFFER
	.comm	_GSKIT_ALLOC_ERROR,8,3          ## @GSKIT_ALLOC_ERROR
	.section	__TEXT,__cstring,cstring_literals
L_str:                                  ## @str
	.asciz	"VRAM Allocation Failed. Will not upload texture."

	.no_dead_strip	_vram_alloc
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function vram_alloc
_vram_alloc:                            ; @vram_alloc
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x19, x1
	mov	x20, x0
	ldp	w0, w1, [x1]
	ldr	w2, [x19, #40]
	bl	_gsKit_texture_size
	mov	x1, x0
Lloh0:
	adrp	x21, _GSKIT_ALLOC_USERBUFFER@GOTPAGE
Lloh1:
	ldr	x21, [x21, _GSKIT_ALLOC_USERBUFFER@GOTPAGEOFF]
	ldr	w2, [x21]
	mov	x0, x20
	bl	_gsKit_vram_alloc
	str	x0, [x19, #8]
Lloh2:
	adrp	x8, _GSKIT_ALLOC_ERROR@GOTPAGE
Lloh3:
	ldr	x8, [x8, _GSKIT_ALLOC_ERROR@GOTPAGEOFF]
Lloh4:
	ldr	x8, [x8]
	cmp	x8, x0
	b.ne	LBB0_2
; %bb.1:
Lloh5:
	adrp	x0, l_str@PAGE
Lloh6:
	add	x0, x0, l_str@PAGEOFF
	bl	_puts
LBB0_2:
	ldr	x8, [x19, #32]
	cbz	x8, LBB0_4
; %bb.3:
	ldr	w2, [x19, #24]
	mov	w0, #16
	mov	w1, #16
	bl	_gsKit_texture_size
	mov	x1, x0
	ldr	w2, [x21]
	mov	x0, x20
	bl	_gsKit_vram_alloc
	str	x0, [x19, #16]
LBB0_4:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.comm	_GSKIT_ALLOC_USERBUFFER,4,2     ; @GSKIT_ALLOC_USERBUFFER
	.comm	_GSKIT_ALLOC_ERROR,8,3          ; @GSKIT_ALLOC_ERROR
	.section	__TEXT,__cstring,cstring_literals
l_str:                                  ; @str
	.asciz	"VRAM Allocation Failed. Will not upload texture."

	.no_dead_strip	_vram_alloc
.subsections_via_symbols
