	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function dxva2_map_frame
_dxva2_map_frame:                       ## @dxva2_map_frame
	.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
	subq	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%ecx, %r15d
	movq	%rdx, %r13
	movq	%rsi, %r12
	movq	%rdi, %rbx
	movq	8(%rdx), %rax
	movq	24(%rax), %r14
	movq	(%rsi), %rdi
	callq	_av_pix_fmt_count_planes
	movl	%eax, -76(%rbp)                 ## 4-byte Spill
	leaq	-72(%rbp), %rsi
	movq	%r14, %rdi
	callq	_IDirect3DSurface9_GetDesc
	movl	%eax, %edi
	callq	_FAILED
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdx
	movq	%rbx, %rdi
	jmp	LBB0_8
LBB0_2:
	movq	%r14, -88(%rbp)                 ## 8-byte Spill
	movq	_AV_HWFRAME_MAP_WRITE@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	movl	(%rcx), %ecx
	andl	%r15d, %ecx
	jne	LBB0_4
## %bb.3:
	movq	_D3DLOCK_READONLY@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
LBB0_4:
	movq	_AV_HWFRAME_MAP_OVERWRITE@GOTPCREL(%rip), %rcx
	andl	(%rcx), %r15d
	movq	-88(%rbp), %rdi                 ## 8-byte Reload
	movq	%rbx, %r14
	je	LBB0_6
## %bb.5:
	movq	_D3DLOCK_DISCARD@GOTPCREL(%rip), %rcx
	movl	(%rcx), %r15d
LBB0_6:
	orl	%eax, %r15d
	leaq	-64(%rbp), %rsi
	xorl	%edx, %edx
	movl	%r15d, %ecx
	callq	_IDirect3DSurface9_LockRect
	movl	%eax, %edi
	callq	_FAILED
	testq	%rax, %rax
	je	LBB0_10
## %bb.7:
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.1(%rip), %rdx
	movq	%r14, %rdi
LBB0_8:
	callq	_av_log
	movq	_AVERROR_UNKNOWN@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
LBB0_9:
	movl	%ebx, %eax
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_10:
	movl	$8, %edi
	callq	_av_mallocz
	movq	%rax, -96(%rbp)
	testq	%rax, %rax
	je	LBB0_15
## %bb.11:
	movq	%rax, %r14
	movl	24(%r13), %edi
	movq	_dxva2_unmap_frame@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%r12, %rsi
	movq	%r13, %rdx
	movq	%r14, %r8
	callq	_ff_hwframe_map_create
	testl	%eax, %eax
	js	LBB0_16
## %bb.12:
	movl	-76(%rbp), %r13d                ## 4-byte Reload
	testl	%r13d, %r13d
	jle	LBB0_18
## %bb.13:
	movq	16(%r12), %r8
	movl	%r13d, %eax
	cmpl	$8, %r13d
	jb	LBB0_14
## %bb.19:
	leaq	-52(%rbp), %rcx
	cmpq	%rcx, %r8
	jae	LBB0_22
## %bb.20:
	leaq	(%r8,%rax,4), %rcx
	leaq	-56(%rbp), %rdx
	cmpq	%rcx, %rdx
	jae	LBB0_22
LBB0_14:
	xorl	%ecx, %ecx
LBB0_29:
	movq	%rcx, %rdx
	notq	%rdx
	addq	%rax, %rdx
	movq	%rax, %rsi
	andq	$3, %rsi
	je	LBB0_31
	.p2align	4, 0x90
LBB0_30:                                ## =>This Inner Loop Header: Depth=1
	movl	-56(%rbp), %edi
	movl	%edi, (%r8,%rcx,4)
	incq	%rcx
	decq	%rsi
	jne	LBB0_30
LBB0_31:
	cmpq	$3, %rdx
	jb	LBB0_33
	.p2align	4, 0x90
LBB0_32:                                ## =>This Inner Loop Header: Depth=1
	movl	-56(%rbp), %edx
	movl	%edx, (%r8,%rcx,4)
	movl	-56(%rbp), %edx
	movl	%edx, 4(%r8,%rcx,4)
	movl	-56(%rbp), %edx
	movl	%edx, 8(%r8,%rcx,4)
	movl	-56(%rbp), %edx
	movl	%edx, 12(%r8,%rcx,4)
	addq	$4, %rcx
	cmpq	%rcx, %rax
	jne	LBB0_32
	jmp	LBB0_33
LBB0_15:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_AVERROR
	movl	%eax, %ebx
	jmp	LBB0_17
LBB0_16:
	movl	%eax, %ebx
	leaq	-96(%rbp), %rdi
	callq	_av_freep
LBB0_17:
	movq	-88(%rbp), %rdi                 ## 8-byte Reload
	callq	_IDirect3DSurface9_UnlockRect
	jmp	LBB0_9
LBB0_18:
	movq	16(%r12), %r8
LBB0_33:
	movq	(%r12), %rsi
	movq	8(%r12), %rdi
	movl	-72(%rbp), %edx
	movq	-64(%rbp), %rcx
	callq	_av_image_fill_pointers
	movq	(%r12), %rax
	movq	_AV_PIX_FMT_PAL8@GOTPCREL(%rip), %rcx
	xorl	%ebx, %ebx
	cmpq	(%rcx), %rax
	jne	LBB0_9
## %bb.34:
	movq	(%r14), %rax
	movq	8(%r12), %rcx
	movq	%rax, 8(%rcx)
	jmp	LBB0_9
LBB0_22:
	movl	%eax, %ecx
	andl	$-8, %ecx
	leaq	-8(%rcx), %rsi
	movq	%rsi, %rdx
	shrq	$3, %rdx
	incq	%rdx
	testq	%rsi, %rsi
	je	LBB0_25
## %bb.23:
	movq	%rdx, %rdi
	andq	$-2, %rdi
	pshufd	$170, -64(%rbp), %xmm0          ## xmm0 = mem[2,2,2,2]
	xorl	%esi, %esi
LBB0_24:                                ## =>This Inner Loop Header: Depth=1
	movdqu	%xmm0, (%r8,%rsi,4)
	movdqu	%xmm0, 16(%r8,%rsi,4)
	movdqu	%xmm0, 32(%r8,%rsi,4)
	movdqu	%xmm0, 48(%r8,%rsi,4)
	addq	$16, %rsi
	addq	$-2, %rdi
	jne	LBB0_24
	jmp	LBB0_26
LBB0_25:
	xorl	%esi, %esi
LBB0_26:
	testb	$1, %dl
	je	LBB0_28
## %bb.27:
	movd	-56(%rbp), %xmm0                ## xmm0 = mem[0],zero,zero,zero
	pshufd	$0, %xmm0, %xmm0                ## xmm0 = xmm0[0,0,0,0]
	movdqu	%xmm0, (%r8,%rsi,4)
	movdqu	%xmm0, 16(%r8,%rsi,4)
LBB0_28:
	cmpq	%rax, %rcx
	je	LBB0_33
	jmp	LBB0_29
	.cfi_endproc
                                        ## -- End function
	.comm	_AV_LOG_ERROR,4,2               ## @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Error getting a surface description\n"

	.comm	_AVERROR_UNKNOWN,4,2            ## @AVERROR_UNKNOWN
	.comm	_AV_HWFRAME_MAP_WRITE,4,2       ## @AV_HWFRAME_MAP_WRITE
	.comm	_D3DLOCK_READONLY,4,2           ## @D3DLOCK_READONLY
	.comm	_AV_HWFRAME_MAP_OVERWRITE,4,2   ## @AV_HWFRAME_MAP_OVERWRITE
	.comm	_D3DLOCK_DISCARD,4,2            ## @D3DLOCK_DISCARD
L_.str.1:                               ## @.str.1
	.asciz	"Unable to lock DXVA2 surface\n"

	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_dxva2_unmap_frame,4,2          ## @dxva2_unmap_frame
	.comm	_AV_PIX_FMT_PAL8,8,3            ## @AV_PIX_FMT_PAL8
	.no_dead_strip	_dxva2_map_frame
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function dxva2_map_frame
_dxva2_map_frame:                       ; @dxva2_map_frame
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	mov	x24, x3
	mov	x23, x2
	mov	x19, x1
	mov	x20, x0
	ldr	x8, [x2, #8]
	ldr	x21, [x8, #24]
	ldr	x0, [x1]
	bl	_av_pix_fmt_count_planes
	mov	x22, x0
	add	x1, sp, #16
	mov	x0, x21
	bl	_IDirect3DSurface9_GetDesc
	bl	_FAILED
	cbz	x0, LBB0_2
; %bb.1:
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
	b	LBB0_4
LBB0_2:
Lloh5:
	adrp	x8, _AV_HWFRAME_MAP_WRITE@GOTPAGE
Lloh6:
	ldr	x8, [x8, _AV_HWFRAME_MAP_WRITE@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
Lloh8:
	adrp	x9, _D3DLOCK_READONLY@GOTPAGE
Lloh9:
	ldr	x9, [x9, _D3DLOCK_READONLY@GOTPAGEOFF]
Lloh10:
	ldr	w9, [x9]
	tst	w8, w24
	csel	w8, w9, wzr, eq
Lloh11:
	adrp	x9, _AV_HWFRAME_MAP_OVERWRITE@GOTPAGE
Lloh12:
	ldr	x9, [x9, _AV_HWFRAME_MAP_OVERWRITE@GOTPAGEOFF]
Lloh13:
	ldr	w9, [x9]
Lloh14:
	adrp	x10, _D3DLOCK_DISCARD@GOTPAGE
Lloh15:
	ldr	x10, [x10, _D3DLOCK_DISCARD@GOTPAGEOFF]
Lloh16:
	ldr	w10, [x10]
	tst	w9, w24
	csel	w9, wzr, w10, eq
	orr	w3, w9, w8
	mov	x1, sp
	mov	x0, x21
	mov	x2, #0
	bl	_IDirect3DSurface9_LockRect
	bl	_FAILED
	cbz	x0, LBB0_6
; %bb.3:
Lloh17:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh18:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh19:
	ldr	w1, [x8]
Lloh20:
	adrp	x2, l_.str.1@PAGE
Lloh21:
	add	x2, x2, l_.str.1@PAGEOFF
LBB0_4:
	mov	x0, x20
	bl	_av_log
Lloh22:
	adrp	x8, _AVERROR_UNKNOWN@GOTPAGE
Lloh23:
	ldr	x8, [x8, _AVERROR_UNKNOWN@GOTPAGEOFF]
Lloh24:
	ldr	w23, [x8]
LBB0_5:
	mov	x0, x23
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
LBB0_6:
	mov	w0, #8
	bl	_av_mallocz
	str	x0, [sp, #24]
	cbz	x0, LBB0_11
; %bb.7:
	mov	x20, x0
	ldr	w0, [x23, #24]
Lloh25:
	adrp	x8, _dxva2_unmap_frame@GOTPAGE
Lloh26:
	ldr	x8, [x8, _dxva2_unmap_frame@GOTPAGEOFF]
Lloh27:
	ldr	w3, [x8]
	mov	x1, x19
	mov	x2, x23
	mov	x4, x20
	bl	_ff_hwframe_map_create
	tbnz	w0, #31, LBB0_12
; %bb.8:
	cmp	w22, #0
	b.le	LBB0_14
; %bb.9:
	ldr	x4, [x19, #16]
	mov	w8, w22
	cmp	w22, #16
	b.hs	LBB0_15
; %bb.10:
	mov	x9, #0
	b	LBB0_21
LBB0_11:
Lloh28:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh29:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh30:
	ldr	w0, [x8]
	bl	_AVERROR
	mov	x23, x0
	b	LBB0_13
LBB0_12:
	mov	x23, x0
	add	x0, sp, #24
	bl	_av_freep
LBB0_13:
	mov	x0, x21
	bl	_IDirect3DSurface9_UnlockRect
	b	LBB0_5
LBB0_14:
	ldr	x4, [x19, #16]
	b	LBB0_22
LBB0_15:
	mov	x9, sp
	add	x11, x9, #8
	add	x9, x9, #12
	cmp	x4, x9
	b.hs	LBB0_18
; %bb.16:
	add	x9, x4, x8, lsl #2
	cmp	x11, x9
	b.hs	LBB0_18
; %bb.17:
	mov	x9, #0
	b	LBB0_21
LBB0_18:
	mov	x10, #0
	and	x9, x8, #0xfffffff0
	ld1r.4s	{ v0 }, [x11]
	lsl	x11, x8, #2
	and	x11, x11, #0x3ffffffc0
LBB0_19:                                ; =>This Inner Loop Header: Depth=1
	ldr	d1, [sp, #8]
	dup.4s	v1, v1[0]
	add	x12, x4, x10
	stp	q0, q0, [x12]
	stp	q0, q1, [x12, #32]
	add	x10, x10, #64
	cmp	x11, x10
	b.ne	LBB0_19
; %bb.20:
	cmp	x9, x8
	b.eq	LBB0_22
LBB0_21:                                ; =>This Inner Loop Header: Depth=1
	ldr	w10, [sp, #8]
	str	w10, [x4, x9, lsl #2]
	add	x9, x9, #1
	cmp	x8, x9
	b.ne	LBB0_21
LBB0_22:
	ldp	x1, x0, [x19]
	ldr	w2, [sp, #16]
	ldr	x3, [sp]
	bl	_av_image_fill_pointers
	ldr	x8, [x19]
Lloh31:
	adrp	x9, _AV_PIX_FMT_PAL8@GOTPAGE
Lloh32:
	ldr	x9, [x9, _AV_PIX_FMT_PAL8@GOTPAGEOFF]
Lloh33:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_24
; %bb.23:
	mov	w23, #0
	ldr	x8, [x20]
	ldr	x9, [x19, #8]
	str	x8, [x9, #8]
	b	LBB0_5
LBB0_24:
	mov	w23, #0
	b	LBB0_5
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.cfi_endproc
                                        ; -- End function
	.comm	_AV_LOG_ERROR,4,2               ; @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Error getting a surface description\n"

	.comm	_AVERROR_UNKNOWN,4,2            ; @AVERROR_UNKNOWN
	.comm	_AV_HWFRAME_MAP_WRITE,4,2       ; @AV_HWFRAME_MAP_WRITE
	.comm	_D3DLOCK_READONLY,4,2           ; @D3DLOCK_READONLY
	.comm	_AV_HWFRAME_MAP_OVERWRITE,4,2   ; @AV_HWFRAME_MAP_OVERWRITE
	.comm	_D3DLOCK_DISCARD,4,2            ; @D3DLOCK_DISCARD
l_.str.1:                               ; @.str.1
	.asciz	"Unable to lock DXVA2 surface\n"

	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_dxva2_unmap_frame,4,2          ; @dxva2_unmap_frame
	.comm	_AV_PIX_FMT_PAL8,8,3            ; @AV_PIX_FMT_PAL8
	.no_dead_strip	_dxva2_map_frame
.subsections_via_symbols
