	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function d3d11va_pool_alloc
_d3d11va_pool_alloc:                    ## @d3d11va_pool_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	%rdi, %rbx
	movq	(%rdi), %r14
	movl	(%r14), %edi
	testl	%edi, %edi
	je	LBB0_5
## %bb.1:
	movq	8(%rbx), %rax
	movq	(%rax), %r15
	leaq	-32(%rbp), %rsi
	callq	_ID3D11Texture2D_GetDesc
	movq	(%r15), %rax
	cmpq	-32(%rbp), %rax
	jge	LBB0_2
## %bb.3:
	movl	(%r14), %edi
	callq	_ID3D11Texture2D_AddRef
	movl	(%r14), %edi
	movq	(%r15), %rsi
	leaq	1(%rsi), %rax
	movq	%rax, (%r15)
                                        ## kill: def $esi killed $esi killed $rsi
	callq	_wrap_texture_buf
	jmp	LBB0_4
LBB0_5:
	movq	%rbx, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_d3d11va_alloc_single           ## TAILCALL
LBB0_2:
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdx
	movq	%rbx, %rdi
	callq	_av_log
	xorl	%eax, %eax
LBB0_4:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_AV_LOG_ERROR,4,2               ## @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Static surface pool size exceeded.\n"

	.no_dead_strip	_d3d11va_pool_alloc
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function d3d11va_pool_alloc
_d3d11va_pool_alloc:                    ; @d3d11va_pool_alloc
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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, x0
	ldr	x20, [x0]
	ldr	w0, [x20]
	cbz	w0, LBB0_3
; %bb.1:
	ldr	x8, [x19, #8]
	ldr	x21, [x8]
	add	x1, sp, #8
	bl	_ID3D11Texture2D_GetDesc
	ldr	x8, [x21]
	ldr	x9, [sp, #8]
	cmp	x8, x9
	b.ge	LBB0_4
; %bb.2:
	ldr	w0, [x20]
	bl	_ID3D11Texture2D_AddRef
	ldr	w0, [x20]
	ldr	x1, [x21]
	add	x8, x1, #1
	str	x8, [x21]
                                        ; kill: def $w1 killed $w1 killed $x1
	bl	_wrap_texture_buf
	b	LBB0_5
LBB0_3:
	mov	x0, x19
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	b	_d3d11va_alloc_single
LBB0_4:
Lloh0:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh1:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
Lloh3:
	adrp	x2, l_.str@PAGE
Lloh4:
	add	x2, x2, l_.str@PAGEOFF
	mov	x0, x19
	bl	_av_log
	mov	x0, #0
LBB0_5:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_AV_LOG_ERROR,4,2               ; @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Static surface pool size exceeded.\n"

	.no_dead_strip	_d3d11va_pool_alloc
.subsections_via_symbols
