	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function commit_bitstream_and_slice_buffer
_commit_bitstream_and_slice_buffer:     ## @commit_bitstream_and_slice_buffer
	.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	$104, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, -104(%rbp)                ## 8-byte Spill
	movq	%rdi, %r14
	movq	16(%rdi), %rbx
	callq	_DXVA_CONTEXT
	movq	%rax, -96(%rbp)                 ## 8-byte Spill
	movq	24(%rbx), %rax
	movq	(%rax), %rsi
	movq	(%r14), %rcx
	movq	_AV_CODEC_ID_VC1@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	xorl	%r13d, %r13d
	movq	%rcx, -72(%rbp)                 ## 8-byte Spill
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	cmpq	%rax, %rcx
	sete	%dl
	movl	20(%rbx), %edi
	movb	(%rbx), %cl
	shrl	%cl, %edi
	imull	16(%rbx), %edi
	movl	(%rsi), %eax
	testl	%eax, %eax
	movq	%rsi, -48(%rbp)                 ## 8-byte Spill
	movl	%edi, -56(%rbp)                 ## 4-byte Spill
	je	LBB0_1
## %bb.2:
	movb	%dl, %r13b
	shll	$4, %r13d
	movl	%edi, %edi
	movq	16(%rsi), %rdx
	movl	(%rdx), %r15d
	movl	4(%rdx), %ecx
	leal	7(%rcx), %ebx
	testl	%ecx, %ecx
	cmovnsl	%ecx, %ebx
	movl	$0, (%rdx)
	movq	%rdi, -128(%rbp)                ## 8-byte Spill
	movq	%rdi, %rcx
	cmpl	$1, %eax
	je	LBB0_4
## %bb.3:
	movq	24(%rdx), %rcx
LBB0_4:
	leal	(,%r13,8), %eax
	movl	%eax, -52(%rbp)                 ## 4-byte Spill
	sarl	$3, %ebx
	subq	8(%rdx), %rcx
	movq	%rdx, %r12
	movq	%rcx, 8(%rdx)
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	cmpq	%rax, -72(%rbp)                 ## 8-byte Folded Reload
	jne	LBB0_6
## %bb.5:
	leaq	_commit_bitstream_and_slice_buffer.start_code(%rip), %rsi
	movl	%r13d, %edx
	callq	_memcpy
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	movl	-52(%rbp), %eax                 ## 4-byte Reload
	addl	%eax, 4(%r12)
LBB0_6:
	shlq	$2, %r15
	addq	8(%rsi), %r15
	movq	%r15, %rsi
	movl	%ebx, %edx
	callq	_memcpy
	movq	-48(%rbp), %rdx                 ## 8-byte Reload
	movl	(%rdx), %eax
	cmpl	$2, %eax
	jb	LBB0_7
## %bb.8:
	movq	%r14, -88(%rbp)                 ## 8-byte Spill
	movq	%r13, -120(%rbp)                ## 8-byte Spill
	movl	%r13d, %ecx
	movq	%rcx, -112(%rbp)                ## 8-byte Spill
	movl	$1, %r13d
	xorl	%r14d, %r14d
                                        ## implicit-def: $rbx
	jmp	LBB0_9
	.p2align	4, 0x90
LBB0_13:                                ##   in Loop: Header=BB0_9 Depth=1
	shlq	$2, %r12
	addq	8(%rdx), %r12
	movq	%rbx, %rdi
	movq	%r12, %rsi
	movl	%r15d, %edx
	callq	_memcpy
	movq	-48(%rbp), %rdx                 ## 8-byte Reload
	movl	%r15d, %eax
	leaq	(%rbx,%rax,4), %rbx
	incq	%r13
	movl	(%rdx), %eax
	addq	$16, %r14
	cmpq	%rax, %r13
	jae	LBB0_14
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	movq	16(%rdx), %rsi
	movl	20(%rsi,%r14), %ecx
	leal	7(%rcx), %r15d
	testl	%ecx, %ecx
	cmovnsl	%ecx, %r15d
	movl	16(%rsi,%r14), %r12d
	movl	$0, 16(%rsi,%r14)
	decl	%eax
	movq	-128(%rbp), %rcx                ## 8-byte Reload
	cmpq	%rax, %r13
	jae	LBB0_11
## %bb.10:                              ##   in Loop: Header=BB0_9 Depth=1
	movq	40(%rsi,%r14), %rcx
LBB0_11:                                ##   in Loop: Header=BB0_9 Depth=1
	sarl	$3, %r15d
	subq	24(%rsi,%r14), %rcx
	movq	%rcx, 24(%rsi,%r14)
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	cmpq	%rax, -72(%rbp)                 ## 8-byte Folded Reload
	movq	%rsi, -80(%rbp)                 ## 8-byte Spill
	jne	LBB0_13
## %bb.12:                              ##   in Loop: Header=BB0_9 Depth=1
	movq	%rbx, %rdi
	leaq	_commit_bitstream_and_slice_buffer.start_code(%rip), %rsi
	movq	-120(%rbp), %rdx                ## 8-byte Reload
                                        ## kill: def $edx killed $edx killed $rdx
	callq	_memcpy
	movq	-48(%rbp), %rdx                 ## 8-byte Reload
	movl	$11, 12(%rbx)
	movq	-112(%rbp), %rax                ## 8-byte Reload
	leaq	(%rbx,%rax,4), %rbx
	movl	-52(%rbp), %eax                 ## 4-byte Reload
	movq	-80(%rbp), %rcx                 ## 8-byte Reload
	addl	%eax, 20(%rcx,%r14)
	jmp	LBB0_13
LBB0_1:
	xorl	%r13d, %r13d
                                        ## implicit-def: $rbx
	xorl	%r12d, %r12d
	jmp	LBB0_15
LBB0_7:
	movl	$1, %r13d
                                        ## implicit-def: $rbx
	jmp	LBB0_15
LBB0_14:
	movq	-80(%rbp), %r12                 ## 8-byte Reload
	addq	%r14, %r12
	movq	-88(%rbp), %r14                 ## 8-byte Reload
LBB0_15:
	movl	$128, %edi
	callq	_FFMIN
	testq	%r12, %r12
	je	LBB0_18
## %bb.16:
	movl	%eax, %r15d
	testl	%eax, %eax
	je	LBB0_18
## %bb.17:
	movq	%rbx, %rdi
	xorl	%esi, %esi
	movl	%r15d, %edx
	callq	_memset
	shll	$3, %r15d
	addl	%r15d, 4(%r12)
LBB0_18:
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %r9d
	cmpl	%r9d, %r13d
	jae	LBB0_19
## %bb.20:
	movl	$-1, %eax
	jmp	LBB0_21
LBB0_19:
	movq	16(%rax), %r8
	shll	$4, %r9d
	movl	-56(%rbp), %eax                 ## 4-byte Reload
	movl	%eax, (%rsp)
	movq	%r14, %rdi
	movq	-96(%rbp), %rsi                 ## 8-byte Reload
	movq	-104(%rbp), %rdx                ## 8-byte Reload
	callq	_ff_dxva2_commit_buffer
LBB0_21:
	addq	$104, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__const
	.p2align	4                               ## @commit_bitstream_and_slice_buffer.start_code
_commit_bitstream_and_slice_buffer.start_code:
	.long	0                               ## 0x0
	.long	0                               ## 0x0
	.long	1                               ## 0x1
	.long	13                              ## 0xd

	.comm	_AV_CODEC_ID_VC1,8,3            ## @AV_CODEC_ID_VC1
	.comm	_AV_LOG_ERROR,4,2               ## @AV_LOG_ERROR
	.comm	_AV_PIX_FMT_DXVA2_VLD,8,3       ## @AV_PIX_FMT_DXVA2_VLD
	.comm	_D3D11_VIDEO_DECODER_BUFFER_BITSTREAM,4,2 ## @D3D11_VIDEO_DECODER_BUFFER_BITSTREAM
	.comm	_D3D11_VIDEO_DECODER_BUFFER_SLICE_CONTROL,4,2 ## @D3D11_VIDEO_DECODER_BUFFER_SLICE_CONTROL
	.comm	_DXVA2_BitStreamDateBufferType,4,2 ## @DXVA2_BitStreamDateBufferType
	.comm	_DXVA2_SliceControlBufferType,4,2 ## @DXVA2_SliceControlBufferType
	.no_dead_strip	_commit_bitstream_and_slice_buffer
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function commit_bitstream_and_slice_buffer
_commit_bitstream_and_slice_buffer:     ; @commit_bitstream_and_slice_buffer
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #160
	.cfi_def_cfa_offset 160
	stp	x28, x27, [sp, #64]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #80]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #96]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #112]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #128]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #144]            ; 16-byte Folded Spill
	add	x29, sp, #144
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x22, x2
	mov	x26, x0
	ldr	x20, [x0, #16]
	bl	_DXVA_CONTEXT
	str	x0, [sp, #24]                   ; 8-byte Folded Spill
	ldr	x8, [x20, #24]
	ldr	x27, [x8]
	ldr	x9, [x26]
Lloh0:
	adrp	x8, _AV_CODEC_ID_VC1@GOTPAGE
Lloh1:
	ldr	x8, [x8, _AV_CODEC_ID_VC1@GOTPAGEOFF]
Lloh2:
	ldr	x23, [x8]
	str	x9, [sp, #56]                   ; 8-byte Folded Spill
	cmp	x9, x23
	cset	w9, eq
	ldp	w8, w10, [x20, #16]
	ldr	w11, [x20]
	lsr	w10, w10, w11
	mul	w28, w10, w8
	ldr	w8, [x27]
	cbz	w8, LBB0_12
; %bb.1:
	lsl	w9, w9, #4
	str	x9, [sp, #40]                   ; 8-byte Folded Spill
	ldr	x25, [x27, #16]
	ldp	w20, w9, [x25]
	add	w10, w9, #7
	cmp	w9, #0
	csel	w9, w10, w9, lt
	asr	w24, w9, #3
	str	wzr, [x25]
	mov	x9, x28
	cmp	w8, #1
	b.eq	LBB0_3
; %bb.2:
	ldr	x9, [x25, #24]
LBB0_3:
	ldr	x8, [sp, #40]                   ; 8-byte Folded Reload
	lsl	w8, w8, #3
	str	w8, [sp, #36]                   ; 4-byte Folded Spill
	ldr	x8, [x25, #8]
	sub	x8, x9, x8
	str	x8, [x25, #8]
	ldr	x8, [sp, #56]                   ; 8-byte Folded Reload
	cmp	x8, x23
	b.ne	LBB0_5
; %bb.4:
Lloh3:
	adrp	x1, _commit_bitstream_and_slice_buffer.start_code@PAGE
Lloh4:
	add	x1, x1, _commit_bitstream_and_slice_buffer.start_code@PAGEOFF
	ldr	x2, [sp, #40]                   ; 8-byte Folded Reload
                                        ; kill: def $w2 killed $w2 killed $x2
	bl	_memcpy
	ldr	w8, [x25, #4]
	ldr	w9, [sp, #36]                   ; 4-byte Folded Reload
	add	w8, w8, w9
	str	w8, [x25, #4]
LBB0_5:
	ldr	x8, [x27, #8]
	add	x1, x8, x20, lsl #2
	mov	x2, x24
	bl	_memcpy
	ldr	w8, [x27]
	cmp	w8, #2
	b.lo	LBB0_13
; %bb.6:
	str	x28, [sp, #48]                  ; 8-byte Folded Spill
	stp	x26, x22, [sp, #8]              ; 16-byte Folded Spill
	mov	x25, #0
	mov	w21, #1
                                        ; implicit-def: $x24
	ldr	x19, [sp, #40]                  ; 8-byte Folded Reload
	b	LBB0_8
LBB0_7:                                 ;   in Loop: Header=BB0_8 Depth=1
	asr	w26, w26, #3
	ldr	x8, [x27, #8]
	add	x1, x8, x22, lsl #2
	mov	x0, x24
	mov	x2, x26
	bl	_memcpy
	add	x24, x24, w26, uxtw #2
	add	x21, x21, #1
	ldr	w8, [x27]
	add	x25, x25, #16
	cmp	x21, x8
	b.hs	LBB0_14
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x20, [x27, #16]
	add	x28, x20, x25
	ldp	w22, w9, [x28, #16]
	add	w10, w9, #7
	cmp	w9, #0
	csel	w26, w10, w9, lt
	str	wzr, [x28, #16]
	sub	w9, w8, #1
	ldr	x8, [sp, #48]                   ; 8-byte Folded Reload
	cmp	x21, x9
	b.hs	LBB0_10
; %bb.9:                                ;   in Loop: Header=BB0_8 Depth=1
	ldr	x8, [x28, #40]
LBB0_10:                                ;   in Loop: Header=BB0_8 Depth=1
	ldr	x9, [x28, #24]
	sub	x8, x8, x9
	str	x8, [x28, #24]
	ldr	x8, [sp, #56]                   ; 8-byte Folded Reload
	cmp	x8, x23
	b.ne	LBB0_7
; %bb.11:                               ;   in Loop: Header=BB0_8 Depth=1
	mov	x0, x24
Lloh5:
	adrp	x1, _commit_bitstream_and_slice_buffer.start_code@PAGE
Lloh6:
	add	x1, x1, _commit_bitstream_and_slice_buffer.start_code@PAGEOFF
	mov	x2, x19
	bl	_memcpy
	mov	w8, #11
	str	w8, [x24, #12]
	add	x24, x24, x19, lsl #2
	ldr	w8, [x28, #20]
	ldr	w9, [sp, #36]                   ; 4-byte Folded Reload
	add	w8, w8, w9
	str	w8, [x28, #20]
	b	LBB0_7
LBB0_12:
	mov	w21, #0
	mov	x25, #0
                                        ; implicit-def: $x24
	b	LBB0_15
LBB0_13:
	mov	w21, #1
                                        ; implicit-def: $x24
	b	LBB0_15
LBB0_14:
	add	x25, x20, x25
	ldp	x26, x22, [sp, #8]              ; 16-byte Folded Reload
	ldr	x28, [sp, #48]                  ; 8-byte Folded Reload
LBB0_15:
	mov	w0, #128
	bl	_FFMIN
	cbz	x25, LBB0_18
; %bb.16:
	mov	x23, x0
	cbz	w0, LBB0_18
; %bb.17:
	mov	x0, x24
	mov	w1, #0
	mov	x2, x23
	bl	_memset
	ldr	w8, [x25, #4]
	add	w8, w8, w23, lsl #3
	str	w8, [x25, #4]
LBB0_18:
	ldr	w8, [x27]
	cmp	w21, w8
	b.hs	LBB0_20
; %bb.19:
	mov	w0, #-1
	ldp	x29, x30, [sp, #144]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #128]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #112]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #96]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #80]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #64]             ; 16-byte Folded Reload
	add	sp, sp, #160
	ret
LBB0_20:
	ldr	x4, [x27, #16]
	lsl	w5, w8, #4
	mov	x0, x26
	ldr	x1, [sp, #24]                   ; 8-byte Folded Reload
	mov	x2, x22
	mov	x6, x28
	ldp	x29, x30, [sp, #144]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #128]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #112]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #96]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #80]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #64]             ; 16-byte Folded Reload
	add	sp, sp, #160
	b	_ff_dxva2_commit_buffer
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__const
	.p2align	2                               ; @commit_bitstream_and_slice_buffer.start_code
_commit_bitstream_and_slice_buffer.start_code:
	.long	0                               ; 0x0
	.long	0                               ; 0x0
	.long	1                               ; 0x1
	.long	13                              ; 0xd

	.comm	_AV_CODEC_ID_VC1,8,3            ; @AV_CODEC_ID_VC1
	.comm	_AV_LOG_ERROR,4,2               ; @AV_LOG_ERROR
	.comm	_AV_PIX_FMT_DXVA2_VLD,8,3       ; @AV_PIX_FMT_DXVA2_VLD
	.comm	_D3D11_VIDEO_DECODER_BUFFER_BITSTREAM,4,2 ; @D3D11_VIDEO_DECODER_BUFFER_BITSTREAM
	.comm	_D3D11_VIDEO_DECODER_BUFFER_SLICE_CONTROL,4,2 ; @D3D11_VIDEO_DECODER_BUFFER_SLICE_CONTROL
	.comm	_DXVA2_BitStreamDateBufferType,4,2 ; @DXVA2_BitStreamDateBufferType
	.comm	_DXVA2_SliceControlBufferType,4,2 ; @DXVA2_SliceControlBufferType
	.no_dead_strip	_commit_bitstream_and_slice_buffer
.subsections_via_symbols
