	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function qsv_setup_mids
_qsv_setup_mids:                        ## @qsv_setup_mids
	.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	%rdx, %rbx
	movq	%rsi, %r12
	movq	%rdi, %r15
	movq	(%rsi), %rax
	movq	(%rax), %rax
	movq	(%rdx), %r14
	movl	(%rax), %r13d
	leal	2(%r13), %edi
	movl	$8, %esi
	callq	_av_mallocz_array
	movq	%rax, 8(%r15)
	testq	%rax, %rax
	je	LBB0_14
## %bb.1:
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	leaq	8(%r15), %rbx
	testl	%r13d, %r13d
	jle	LBB0_10
## %bb.2:
	movq	%r14, (%rax)
	cmpl	$1, %r13d
	je	LBB0_10
## %bb.3:
	leaq	-1(%r13), %r8
	leaq	-2(%r13), %rsi
	movl	%r8d, %eax
	andl	$3, %eax
	movl	$1, %ecx
	cmpq	$3, %rsi
	jb	LBB0_7
## %bb.4:
	andq	$-4, %r8
	movq	$-1, %rcx
	xorl	%esi, %esi
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%rbx), %rdi
	leaq	(%r14,%rsi), %rdx
	addq	$4, %rdx
	movq	%rdx, 8(%rdi,%rsi,2)
	movq	(%rbx), %rdx
	leaq	8(%r14,%rsi), %rdi
	movq	%rdi, 16(%rdx,%rsi,2)
	movq	(%rbx), %rdx
	leaq	12(%r14,%rsi), %rdi
	movq	%rdi, 24(%rdx,%rsi,2)
	movq	(%rbx), %rdx
	leaq	(%r14,%rsi), %rdi
	addq	$16, %rdi
	movq	%rdi, 32(%rdx,%rsi,2)
	addq	$16, %rsi
	leaq	(%r8,%rcx), %rdx
	addq	$-4, %rdx
	addq	$-4, %rcx
	cmpq	$-1, %rdx
	jne	LBB0_5
## %bb.6:
	negq	%rcx
LBB0_7:
	testq	%rax, %rax
	je	LBB0_10
## %bb.8:
	shlq	$2, %rcx
	.p2align	4, 0x90
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%rbx), %rdx
	leaq	(%r14,%rcx), %rsi
	movq	%rsi, (%rdx,%rcx,2)
	addq	$4, %rcx
	decq	%rax
	jne	LBB0_9
LBB0_10:
	movl	%r13d, (%r15)
	movq	%r12, %rdi
	callq	_av_buffer_ref
	movq	8(%r15), %rcx
	movslq	(%r15), %rdx
	movq	%rax, (%rcx,%rdx,8)
	movq	8(%r15), %rax
	cmpq	$0, (%rax,%rdx,8)
	je	LBB0_13
## %bb.11:
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_av_buffer_ref
	movq	8(%r15), %rdx
	movslq	(%r15), %rcx
	movq	%rax, 8(%rdx,%rcx,8)
	movq	8(%r15), %rax
	cmpq	$0, 8(%rax,%rcx,8)
	je	LBB0_12
## %bb.15:
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_12:
	leaq	(%rax,%rcx,8), %rdi
	callq	_av_buffer_unref
LBB0_13:
	movq	%rbx, %rdi
	callq	_av_freep
LBB0_14:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_AVERROR                        ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.no_dead_strip	_qsv_setup_mids
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function qsv_setup_mids
_qsv_setup_mids:                        ; @qsv_setup_mids
	.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
	mov	x21, x2
	mov	x22, x1
	mov	x19, x0
	ldr	x8, [x1]
	ldr	x8, [x8]
	ldr	x24, [x2]
	ldr	w23, [x8]
	add	w0, w23, #2
	mov	w1, #8
	bl	_av_mallocz_array
	mov	x20, x19
	str	x0, [x20, #8]!
	cbz	x0, LBB0_10
; %bb.1:
	cmp	w23, #1
	b.lt	LBB0_5
; %bb.2:
	str	x24, [x0]
	b.eq	LBB0_5
; %bb.3:
	add	x8, x24, #4
	mov	w9, #1
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x10, [x20]
	str	x8, [x10, x9, lsl #3]
	add	x9, x9, #1
	add	x8, x8, #4
	cmp	x23, x9
	b.ne	LBB0_4
LBB0_5:
	str	w23, [x19]
	mov	x0, x22
	bl	_av_buffer_ref
	ldr	x8, [x19, #8]
	ldrsw	x9, [x19]
	lsl	x9, x9, #3
	str	x0, [x8, x9]
	ldr	x8, [x19, #8]
	ldr	x8, [x8, x9]
	cbz	x8, LBB0_9
; %bb.6:
	mov	x0, x21
	bl	_av_buffer_ref
	ldr	x9, [x19, #8]
	ldrsw	x8, [x19]
	lsl	x10, x8, #3
	add	x10, x10, #8
	str	x0, [x9, x10]
	ldr	x9, [x19, #8]
	ldr	x10, [x9, x10]
	cbz	x10, LBB0_8
; %bb.7:
	mov	w0, #0
	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
LBB0_8:
	add	x0, x9, x8, lsl #3
	bl	_av_buffer_unref
LBB0_9:
	mov	x0, x20
	bl	_av_freep
LBB0_10:
Lloh0:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	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
	b	_AVERROR
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.no_dead_strip	_qsv_setup_mids
.subsections_via_symbols
