	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function qdm2_restore_block
_qdm2_restore_block:                    ## @qdm2_restore_block
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r15
	movq	%rsi, %rbx
	movq	%rdi, %r13
	xorl	%edi, %edi
	cmpq	$0, (%r13)
	setg	%dil
	callq	_av_assert0
	movq	8(%r13), %rcx
	cmpl	$0, (%rcx)
	jle	LBB0_2
## %bb.1:
	movb	$1, %cl
	xorl	%r14d, %r14d
	jmp	LBB0_15
LBB0_2:
	movq	$-1, %rax
	.p2align	4, 0x90
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	cmpl	$0, 8(%rcx,%rax,4)
	jg	LBB0_8
## %bb.3:                               ##   in Loop: Header=BB0_7 Depth=1
	cmpl	$0, 12(%rcx,%rax,4)
	jg	LBB0_11
## %bb.4:                               ##   in Loop: Header=BB0_7 Depth=1
	cmpl	$0, 16(%rcx,%rax,4)
	jg	LBB0_10
## %bb.5:                               ##   in Loop: Header=BB0_7 Depth=1
	cmpq	$123, %rax
	je	LBB0_14
## %bb.6:                               ##   in Loop: Header=BB0_7 Depth=1
	leaq	4(%rax), %rdx
	cmpl	$0, 20(%rcx,%rax,4)
	movq	%rdx, %rax
	jle	LBB0_7
## %bb.9:
	cmpq	$127, %rdx
	setb	%cl
	incq	%rdx
	movl	%edx, %r14d
	jmp	LBB0_15
LBB0_8:
	addq	$2, %rax
	jmp	LBB0_12
LBB0_11:
	addq	$3, %rax
	jmp	LBB0_12
LBB0_10:
	addq	$4, %rax
LBB0_12:
	movb	$1, %cl
	movq	%rax, %rdx
	movl	%edx, %r14d
	jmp	LBB0_15
LBB0_14:
	addq	$4, %rax
	cmpq	$127, %rax
	setb	%cl
	movl	$128, %r14d
LBB0_15:
	movzbl	%cl, %edi
	callq	_av_assert0
	movq	16(%r13), %rsi
	movq	%r15, %rdi
	callq	_av_new_packet
	testl	%eax, %eax
	js	LBB0_16
## %bb.17:
	movq	8(%r15), %rdi
	movl	(%r15), %edx
	xorl	%esi, %esi
	callq	_memset
	movl	(%rbx), %eax
	movl	%eax, 16(%r15)
	movq	8(%r15), %rbx
	movq	8(%r13), %rax
	movslq	(%rax,%r14,4), %rsi
	movl	24(%r13), %eax
	movslq	%eax, %rcx
	cmpq	$256, %rsi                      ## imm = 0x100
	jl	LBB0_19
## %bb.18:
	orq	$128, %rcx
	movq	%rcx, (%rbx)
	addq	$8, %rbx
	movq	%rbx, %rdi
                                        ## kill: def $esi killed $esi killed $rsi
	callq	_AV_WB16
	movl	24(%r13), %eax
	jmp	LBB0_20
LBB0_16:
	movl	%eax, %r12d
	jmp	LBB0_37
LBB0_19:
	movq	%rcx, (%rbx)
	movq	%rsi, 8(%rbx)
LBB0_20:
	leaq	16(%rbx), %rcx
	cmpl	$4, %eax
	je	LBB0_23
## %bb.21:
	cmpl	$2, %eax
	jne	LBB0_22
LBB0_23:
	movq	%rcx, -56(%rbp)                 ## 8-byte Spill
	addq	$32, %rbx
	movl	$0, -44(%rbp)                   ## 4-byte Folded Spill
	jmp	LBB0_24
LBB0_22:
	movb	$1, %al
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movq	%rcx, %rbx
	xorl	%eax, %eax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
LBB0_24:
	movq	8(%r13), %rax
	movl	(%rax,%r14,4), %edi
	movl	(%r15), %esi
	movq	%rbx, %rax
	subq	8(%r15), %rax
	shrq	$3, %rax
	subl	%eax, %esi
	callq	_FFMIN
	movq	32(%r13), %rcx
	movl	(%rcx,%r14,4), %esi
	movq	%rbx, %rdi
	movl	%eax, %edx
	callq	_memcpy
	movq	8(%r13), %rax
	movl	$0, (%rax,%r14,4)
	xorl	%r12d, %r12d
	cmpb	$0, -44(%rbp)                   ## 1-byte Folded Reload
	jne	LBB0_37
## %bb.25:
	movq	16(%r13), %rcx
	xorl	%r12d, %r12d
	movl	$0, %esi
	testq	%rcx, %rcx
	jle	LBB0_36
## %bb.26:
	movq	8(%r15), %rax
	leaq	(%rax,%rcx,8), %rcx
	leaq	8(%rax), %rsi
	cmpq	%rsi, %rcx
	cmovaq	%rcx, %rsi
	movq	%rax, %rdx
	notq	%rdx
	addq	%rsi, %rdx
	xorl	%esi, %esi
	cmpq	$24, %rdx
	jb	LBB0_35
## %bb.27:
	shrq	$3, %rdx
	incq	%rdx
	movq	%rdx, %r8
	andq	$-4, %r8
	leaq	-4(%r8), %rsi
	movq	%rsi, %rdi
	shrq	$2, %rdi
	incq	%rdi
	testq	%rsi, %rsi
	je	LBB0_28
## %bb.29:
	movq	%rdi, %rsi
	andq	$-2, %rsi
	pxor	%xmm0, %xmm0
	xorl	%ebx, %ebx
	pxor	%xmm1, %xmm1
	.p2align	4, 0x90
LBB0_30:                                ## =>This Inner Loop Header: Depth=1
	movdqu	(%rax,%rbx,8), %xmm2
	movdqu	16(%rax,%rbx,8), %xmm3
	movdqu	32(%rax,%rbx,8), %xmm4
	movdqu	48(%rax,%rbx,8), %xmm5
	pshufd	$232, %xmm2, %xmm2              ## xmm2 = xmm2[0,2,2,3]
	paddd	%xmm0, %xmm2
	pshufd	$232, %xmm3, %xmm3              ## xmm3 = xmm3[0,2,2,3]
	paddd	%xmm1, %xmm3
	pshufd	$232, %xmm4, %xmm0              ## xmm0 = xmm4[0,2,2,3]
	paddd	%xmm2, %xmm0
	pshufd	$232, %xmm5, %xmm1              ## xmm1 = xmm5[0,2,2,3]
	paddd	%xmm3, %xmm1
	addq	$8, %rbx
	addq	$-2, %rsi
	jne	LBB0_30
## %bb.31:
	testb	$1, %dil
	je	LBB0_33
LBB0_32:
	movdqu	(%rax,%rbx,8), %xmm2
	movdqu	16(%rax,%rbx,8), %xmm3
	pshufd	$232, %xmm2, %xmm2              ## xmm2 = xmm2[0,2,2,3]
	paddd	%xmm2, %xmm0
	pshufd	$232, %xmm3, %xmm2              ## xmm2 = xmm3[0,2,2,3]
	paddd	%xmm2, %xmm1
LBB0_33:
	paddd	%xmm1, %xmm0
	pshufd	$85, %xmm0, %xmm1               ## xmm1 = xmm0[1,1,1,1]
	paddd	%xmm0, %xmm1
	movd	%xmm1, %esi
	cmpq	%r8, %rdx
	je	LBB0_36
## %bb.34:
	leaq	(%rax,%r8,8), %rax
	.p2align	4, 0x90
LBB0_35:                                ## =>This Inner Loop Header: Depth=1
	addl	(%rax), %esi
	addq	$8, %rax
	cmpq	%rcx, %rax
	jb	LBB0_35
LBB0_36:
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_AV_WB16
LBB0_37:
	movl	%r12d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_28:
	pxor	%xmm0, %xmm0
	xorl	%ebx, %ebx
	pxor	%xmm1, %xmm1
	testb	$1, %dil
	jne	LBB0_32
	jmp	LBB0_33
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_qdm2_restore_block
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function qdm2_restore_block
_qdm2_restore_block:                    ; @qdm2_restore_block
	.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	x19, x2
	mov	x21, x1
	mov	x20, x0
	ldr	x8, [x0]
	cmp	x8, #0
	cset	w0, gt
	bl	_av_assert0
	ldr	x8, [x20, #8]
	ldr	w9, [x8]
	cmp	w9, #0
	b.le	LBB0_2
; %bb.1:
	mov	x23, #0
	mov	w0, #1
	b	LBB0_7
LBB0_2:
	mov	x23, #0
	add	x8, x8, #4
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	cmp	x23, #127
	b.eq	LBB0_6
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	w9, [x8, x23, lsl #2]
	add	x23, x23, #1
	cmp	w9, #0
	b.le	LBB0_3
; %bb.5:
	sub	x8, x23, #1
	cmp	x8, #127
	cset	w0, lo
	b	LBB0_7
LBB0_6:
	cset	w0, lo
	mov	w23, #128
LBB0_7:
	bl	_av_assert0
	ldr	x1, [x20, #16]
	mov	x0, x19
	bl	_av_new_packet
	tbnz	w0, #31, LBB0_25
; %bb.8:
	ldr	x0, [x19, #8]
	ldr	w2, [x19]
	mov	w1, #0
	bl	_memset
	ldr	w8, [x21]
	str	w8, [x19, #16]
	ldr	x22, [x19, #8]
	ldr	x8, [x20, #8]
	ldrsw	x1, [x8, x23, lsl #2]
	ldr	w8, [x20, #24]
	sxtw	x9, w8
	cmp	w1, #256
	b.lt	LBB0_10
; %bb.9:
	orr	x8, x9, #0x80
	str	x8, [x22], #8
	mov	x0, x22
                                        ; kill: def $w1 killed $w1 killed $x1
	bl	_AV_WB16
	ldr	w8, [x20, #24]
	b	LBB0_11
LBB0_10:
	stp	x9, x1, [x22]
LBB0_11:
	add	x21, x22, #16
	cmp	w8, #4
	b.eq	LBB0_13
; %bb.12:
	cmp	w8, #2
	b.ne	LBB0_14
LBB0_13:
	mov	w24, #0
	add	x22, x22, #32
	b	LBB0_15
LBB0_14:
	mov	w24, #1
	mov	x22, x21
	mov	x21, #0
LBB0_15:
	ldr	x8, [x20, #8]
	lsl	x23, x23, #2
	ldr	w0, [x8, x23]
	ldr	w8, [x19]
	ldr	x9, [x19, #8]
	sub	x9, x22, x9
	lsr	x9, x9, #3
	sub	w1, w8, w9
	bl	_FFMIN
	mov	x2, x0
	ldr	x8, [x20, #32]
	ldr	w1, [x8, x23]
	mov	x0, x22
	bl	_memcpy
	mov	w0, #0
	ldr	x8, [x20, #8]
	str	wzr, [x8, x23]
	tbnz	w24, #0, LBB0_25
; %bb.16:
	ldr	x8, [x20, #16]
	cmp	x8, #1
	b.lt	LBB0_19
; %bb.17:
	ldr	x12, [x19, #8]
	add	x8, x12, x8, lsl #3
	add	x9, x12, #8
	cmp	x8, x9
	csel	x9, x8, x9, hi
	mvn	x10, x12
	add	x9, x9, x10
	cmp	x9, #56
	b.hs	LBB0_20
; %bb.18:
	mov	w1, #0
	mov	x9, x12
	b	LBB0_23
LBB0_19:
	mov	w1, #0
	b	LBB0_24
LBB0_20:
	lsr	x9, x9, #3
	add	x10, x9, #1
	and	x11, x10, #0x3ffffffffffffff8
	add	x9, x12, x11, lsl #3
	movi.2d	v0, #0000000000000000
	add	x12, x12, #32
	mov	x13, x11
	movi.2d	v1, #0000000000000000
	movi.2d	v2, #0000000000000000
	movi.2d	v3, #0000000000000000
LBB0_21:                                ; =>This Inner Loop Header: Depth=1
	ldp	q4, q5, [x12, #-32]
	ldp	q6, q7, [x12], #64
	xtn.2s	v4, v4
	xtn.2s	v5, v5
	xtn.2s	v6, v6
	xtn.2s	v7, v7
	add.2s	v0, v0, v4
	add.2s	v1, v1, v5
	add.2s	v2, v2, v6
	add.2s	v3, v3, v7
	subs	x13, x13, #8
	b.ne	LBB0_21
; %bb.22:
	add.2s	v0, v1, v0
	add.2s	v0, v2, v0
	add.2s	v0, v3, v0
	addp.2s	v0, v0, v0
	fmov	w1, s0
	cmp	x10, x11
	b.eq	LBB0_24
LBB0_23:                                ; =>This Inner Loop Header: Depth=1
	ldr	w10, [x9], #8
	add	w1, w1, w10
	cmp	x9, x8
	b.lo	LBB0_23
LBB0_24:
	mov	x0, x21
	bl	_AV_WB16
	mov	w0, #0
LBB0_25:
	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
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_qdm2_restore_block
.subsections_via_symbols
