	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function dxva2_frames_uninit
_dxva2_frames_uninit:                   ## @dxva2_frames_uninit
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	16(%rdi), %rax
	movq	(%rax), %r15
	movq	(%rdi), %rax
	movq	8(%rdi), %r12
	movq	(%rax), %r14
	movq	8(%r12), %rdi
	testq	%rdi, %rdi
	je	LBB0_2
## %bb.1:
	callq	_IDirectXVideoDecoder_Release
LBB0_2:
	leaq	16(%r14), %r13
	movq	16(%r14), %rcx
	testq	%rcx, %rcx
	je	LBB0_9
## %bb.3:
	movl	(%r12), %eax
	testl	%eax, %eax
	jle	LBB0_9
## %bb.4:
	movl	$1, %ebx
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movq	-8(%rcx,%rbx,8), %rdi
	testq	%rdi, %rdi
	je	LBB0_7
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=1
	callq	_IDirect3DSurface9_Release
	movl	(%r12), %eax
LBB0_7:                                 ##   in Loop: Header=BB0_5 Depth=1
	movslq	%eax, %rcx
	cmpq	%rcx, %rbx
	jge	LBB0_9
## %bb.8:                               ##   in Loop: Header=BB0_5 Depth=1
	movq	(%r13), %rcx
	incq	%rbx
	jmp	LBB0_5
LBB0_9:
	movq	%r13, %rdi
	callq	_av_freep
	movq	8(%r14), %rdi
	testq	%rdi, %rdi
	je	LBB0_11
## %bb.10:
	callq	_IDirectXVideoAccelerationService_Release
	movq	$0, 8(%r14)
LBB0_11:
	movq	(%r14), %rsi
	movq	_INVALID_HANDLE_VALUE@GOTPCREL(%rip), %rbx
	cmpq	(%rbx), %rsi
	je	LBB0_13
## %bb.12:
	movl	(%r15), %edi
	callq	_IDirect3DDeviceManager9_CloseDeviceHandle
	movq	(%rbx), %rax
	movq	%rax, (%r14)
LBB0_13:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_INVALID_HANDLE_VALUE,8,3       ## @INVALID_HANDLE_VALUE
	.no_dead_strip	_dxva2_frames_uninit
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function dxva2_frames_uninit
_dxva2_frames_uninit:                   ; @dxva2_frames_uninit
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	ldp	x22, x8, [x0, #8]
	ldr	x21, [x8]
	ldr	x8, [x0]
	ldr	x20, [x8]
	ldr	x0, [x22, #8]
	cbz	x0, LBB0_2
; %bb.1:
	bl	_IDirectXVideoDecoder_Release
LBB0_2:
	mov	x19, x20
	ldr	x9, [x19, #16]!
	cbz	x9, LBB0_8
; %bb.3:
	ldr	w8, [x22]
	cmp	w8, #1
	b.lt	LBB0_8
; %bb.4:
	mov	x23, #0
	ldr	x0, [x9, x23, lsl #3]
	cbz	x0, LBB0_6
LBB0_5:
	bl	_IDirect3DSurface9_Release
	ldr	w8, [x22]
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	add	x23, x23, #1
	cmp	x23, w8, sxtw
	b.ge	LBB0_8
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	ldr	x9, [x19]
	ldr	x0, [x9, x23, lsl #3]
	cbnz	x0, LBB0_5
	b	LBB0_6
LBB0_8:
	mov	x0, x19
	bl	_av_freep
	ldr	x0, [x20, #8]
	cbz	x0, LBB0_10
; %bb.9:
	bl	_IDirectXVideoAccelerationService_Release
	str	xzr, [x20, #8]
LBB0_10:
	ldr	x1, [x20]
Lloh0:
	adrp	x19, _INVALID_HANDLE_VALUE@GOTPAGE
Lloh1:
	ldr	x19, [x19, _INVALID_HANDLE_VALUE@GOTPAGEOFF]
	ldr	x8, [x19]
	cmp	x1, x8
	b.eq	LBB0_12
; %bb.11:
	ldr	w0, [x21]
	bl	_IDirect3DDeviceManager9_CloseDeviceHandle
	ldr	x8, [x19]
	str	x8, [x20]
LBB0_12:
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.comm	_INVALID_HANDLE_VALUE,8,3       ; @INVALID_HANDLE_VALUE
	.no_dead_strip	_dxva2_frames_uninit
.subsections_via_symbols
