	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function image_copy_16_to_8
_image_copy_16_to_8:                    ## @image_copy_16_to_8
	.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	$120, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %rbx
	movq	%rdi, -72(%rbp)                 ## 8-byte Spill
	movl	16(%rdi), %edi
	callq	_av_pix_fmt_desc_get
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	movl	(%rax), %eax
	testl	%eax, %eax
	jle	LBB0_28
## %bb.1:
	xorl	%r9d, %r9d
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_26:                                ##   in Loop: Header=BB0_2 Depth=1
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %eax
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
LBB0_27:                                ##   in Loop: Header=BB0_2 Depth=1
	incq	%r9
	movslq	%eax, %rcx
	cmpq	%rcx, %r9
	jge	LBB0_28
LBB0_2:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_6 Depth 2
                                        ##       Child Loop BB0_12 Depth 3
                                        ##       Child Loop BB0_15 Depth 3
                                        ##       Child Loop BB0_20 Depth 3
                                        ##       Child Loop BB0_24 Depth 3
	movl	(%rbx), %esi
	movl	4(%rbx), %r11d
	testq	%r9, %r9
	je	LBB0_4
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	8(%rbx), %ecx
	movl	12(%rbx), %edx
	addl	%ecx, %esi
                                        ## kill: def $cl killed $cl killed $ecx
	sarl	%cl, %esi
	addl	%edx, %r11d
	movl	%edx, %ecx
	sarl	%cl, %r11d
LBB0_4:                                 ##   in Loop: Header=BB0_2 Depth=1
	testl	%r11d, %r11d
	jle	LBB0_27
## %bb.5:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	16(%rbx), %rax
	movq	%rax, -152(%rbp)                ## 8-byte Spill
	movq	24(%rbx), %rax
	movq	(%rax,%r9,8), %rax
	movq	%rax, -144(%rbp)                ## 8-byte Spill
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rcx
	movq	%rcx, -136(%rbp)                ## 8-byte Spill
	movq	8(%rax), %rax
	movq	(%rax,%r9,8), %r10
	leal	-1(%rsi), %eax
	movq	%rax, -128(%rbp)                ## 8-byte Spill
	incq	%rax
	movq	%rax, -120(%rbp)                ## 8-byte Spill
	movq	%rax, %rcx
	movabsq	$8589934584, %rax               ## imm = 0x1FFFFFFF8
	andq	%rax, %rcx
	movq	%rcx, -48(%rbp)                 ## 8-byte Spill
	leaq	-8(%rcx), %rax
	movq	%rax, -112(%rbp)                ## 8-byte Spill
	shrq	$3, %rax
	incq	%rax
	movl	%eax, %r15d
	andl	$3, %r15d
	andq	$-4, %rax
	movq	%rax, -88(%rbp)                 ## 8-byte Spill
	leaq	112(%r10), %rax
	movq	%rax, -80(%rbp)                 ## 8-byte Spill
	leaq	16(%r10), %rax
	movq	%rax, -96(%rbp)                 ## 8-byte Spill
	movq	%r15, -104(%rbp)                ## 8-byte Spill
	shlq	$5, %r15
	xorl	%r12d, %r12d
	jmp	LBB0_6
	.p2align	4, 0x90
LBB0_25:                                ##   in Loop: Header=BB0_6 Depth=2
	incl	%r12d
	cmpl	%r11d, %r12d
	je	LBB0_26
LBB0_6:                                 ##   Parent Loop BB0_2 Depth=1
                                        ## =>  This Loop Header: Depth=2
                                        ##       Child Loop BB0_12 Depth 3
                                        ##       Child Loop BB0_15 Depth 3
                                        ##       Child Loop BB0_20 Depth 3
                                        ##       Child Loop BB0_24 Depth 3
	testl	%esi, %esi
	jle	LBB0_25
## %bb.7:                               ##   in Loop: Header=BB0_6 Depth=2
	movq	-136(%rbp), %rax                ## 8-byte Reload
	movl	(%rax,%r9,4), %eax
	imull	%r12d, %eax
	movq	-152(%rbp), %rcx                ## 8-byte Reload
	movslq	(%rcx,%r9,4), %rcx
	movslq	%r12d, %r14
	imulq	%rcx, %r14
	addq	-144(%rbp), %r14                ## 8-byte Folded Reload
	xorl	%r8d, %r8d
	movslq	%eax, %r13
	leaq	(%r10,%r13,4), %rax
	cmpl	$7, -128(%rbp)                  ## 4-byte Folded Reload
	jb	LBB0_18
## %bb.8:                               ##   in Loop: Header=BB0_6 Depth=2
	leaq	(%r10,%r13,4), %rcx
	subq	%r14, %rcx
	cmpq	$32, %rcx
	jb	LBB0_18
## %bb.9:                               ##   in Loop: Header=BB0_6 Depth=2
	cmpq	$24, -112(%rbp)                 ## 8-byte Folded Reload
	jae	LBB0_11
## %bb.10:                              ##   in Loop: Header=BB0_6 Depth=2
	xorl	%ecx, %ecx
	jmp	LBB0_13
LBB0_11:                                ##   in Loop: Header=BB0_6 Depth=2
	movq	-80(%rbp), %rcx                 ## 8-byte Reload
	leaq	(%rcx,%r13,4), %rdx
	leaq	112(%r14), %rbx
	movq	-88(%rbp), %rdi                 ## 8-byte Reload
	xorl	%ecx, %ecx
	.p2align	4, 0x90
LBB0_12:                                ##   Parent Loop BB0_2 Depth=1
                                        ##     Parent Loop BB0_6 Depth=2
                                        ## =>    This Inner Loop Header: Depth=3
	movups	-112(%rbx,%rcx,4), %xmm0
	movups	-96(%rbx,%rcx,4), %xmm1
	movups	%xmm0, -112(%rdx,%rcx,4)
	movups	%xmm1, -96(%rdx,%rcx,4)
	movups	-80(%rbx,%rcx,4), %xmm0
	movups	-64(%rbx,%rcx,4), %xmm1
	movups	%xmm0, -80(%rdx,%rcx,4)
	movups	%xmm1, -64(%rdx,%rcx,4)
	movups	-48(%rbx,%rcx,4), %xmm0
	movups	-32(%rbx,%rcx,4), %xmm1
	movups	%xmm0, -48(%rdx,%rcx,4)
	movups	%xmm1, -32(%rdx,%rcx,4)
	movups	-16(%rbx,%rcx,4), %xmm0
	movups	(%rbx,%rcx,4), %xmm1
	movups	%xmm0, -16(%rdx,%rcx,4)
	movups	%xmm1, (%rdx,%rcx,4)
	addq	$32, %rcx
	addq	$-4, %rdi
	jne	LBB0_12
LBB0_13:                                ##   in Loop: Header=BB0_6 Depth=2
	cmpq	$0, -104(%rbp)                  ## 8-byte Folded Reload
	je	LBB0_16
## %bb.14:                              ##   in Loop: Header=BB0_6 Depth=2
	leaq	(%r14,%rcx,4), %rdx
	addq	$16, %rdx
	addq	%rcx, %r13
	movq	-96(%rbp), %rcx                 ## 8-byte Reload
	leaq	(%rcx,%r13,4), %rcx
	xorl	%edi, %edi
	.p2align	4, 0x90
LBB0_15:                                ##   Parent Loop BB0_2 Depth=1
                                        ##     Parent Loop BB0_6 Depth=2
                                        ## =>    This Inner Loop Header: Depth=3
	movups	-16(%rdx,%rdi), %xmm0
	movups	(%rdx,%rdi), %xmm1
	movups	%xmm0, -16(%rcx,%rdi)
	movups	%xmm1, (%rcx,%rdi)
	addq	$32, %rdi
	cmpq	%rdi, %r15
	jne	LBB0_15
LBB0_16:                                ##   in Loop: Header=BB0_6 Depth=2
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	cmpq	%rcx, -120(%rbp)                ## 8-byte Folded Reload
	je	LBB0_25
## %bb.17:                              ##   in Loop: Header=BB0_6 Depth=2
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	leaq	(%rax,%rcx,4), %rax
	leaq	(%r14,%rcx,4), %r14
	movl	%ecx, %r8d
	.p2align	4, 0x90
LBB0_18:                                ##   in Loop: Header=BB0_6 Depth=2
	movl	%esi, %edx
	subl	%r8d, %edx
	movl	%r8d, %ecx
	notl	%ecx
	addl	%esi, %ecx
	andl	$7, %edx
	je	LBB0_22
## %bb.19:                              ##   in Loop: Header=BB0_6 Depth=2
	negl	%edx
	xorl	%edi, %edi
	.p2align	4, 0x90
LBB0_20:                                ##   Parent Loop BB0_2 Depth=1
                                        ##     Parent Loop BB0_6 Depth=2
                                        ## =>    This Inner Loop Header: Depth=3
	movl	(%r14), %ebx
	addq	$4, %r14
	movl	%ebx, (%rax)
	addq	$4, %rax
	decl	%edi
	cmpl	%edi, %edx
	jne	LBB0_20
## %bb.21:                              ##   in Loop: Header=BB0_6 Depth=2
	subl	%edi, %r8d
LBB0_22:                                ##   in Loop: Header=BB0_6 Depth=2
	cmpl	$7, %ecx
	jb	LBB0_25
## %bb.23:                              ##   in Loop: Header=BB0_6 Depth=2
	movl	%esi, %ecx
	subl	%r8d, %ecx
	xorl	%edx, %edx
	.p2align	4, 0x90
LBB0_24:                                ##   Parent Loop BB0_2 Depth=1
                                        ##     Parent Loop BB0_6 Depth=2
                                        ## =>    This Inner Loop Header: Depth=3
	movl	(%r14,%rdx,4), %edi
	movl	%edi, (%rax,%rdx,4)
	movl	4(%r14,%rdx,4), %edi
	movl	%edi, 4(%rax,%rdx,4)
	movl	8(%r14,%rdx,4), %edi
	movl	%edi, 8(%rax,%rdx,4)
	movl	12(%r14,%rdx,4), %edi
	movl	%edi, 12(%rax,%rdx,4)
	movl	16(%r14,%rdx,4), %edi
	movl	%edi, 16(%rax,%rdx,4)
	movl	20(%r14,%rdx,4), %edi
	movl	%edi, 20(%rax,%rdx,4)
	movl	24(%r14,%rdx,4), %edi
	movl	%edi, 24(%rax,%rdx,4)
	movl	28(%r14,%rdx,4), %edi
	movl	%edi, 28(%rax,%rdx,4)
	addq	$8, %rdx
	cmpl	%edx, %ecx
	jne	LBB0_24
	jmp	LBB0_25
LBB0_28:
	addq	$120, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_image_copy_16_to_8
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function image_copy_16_to_8
_image_copy_16_to_8:                    ; @image_copy_16_to_8
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x1
	mov	x20, x0
	ldr	w0, [x0, #16]
	bl	_av_pix_fmt_desc_get
	ldr	w10, [x0]
	cmp	w10, #1
	b.lt	LBB0_18
; %bb.1:
	mov	x8, #0
	b	LBB0_4
LBB0_2:                                 ;   in Loop: Header=BB0_4 Depth=1
	ldr	w10, [x0]
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	add	x8, x8, #1
	cmp	x8, w10, sxtw
	b.ge	LBB0_18
LBB0_4:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_9 Depth 2
                                        ;       Child Loop BB0_16 Depth 3
                                        ;       Child Loop BB0_14 Depth 3
	ldr	d0, [x19]
	cbz	x8, LBB0_6
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	d1, [x19, #8]
	add.2s	v0, v1, v0
	neg.2s	v1, v1
	sshl.2s	v0, v0, v1
LBB0_6:                                 ;   in Loop: Header=BB0_4 Depth=1
	mov.s	w9, v0[1]
	cmp	w9, #1
	b.lt	LBB0_3
; %bb.7:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	w10, #0
	lsl	x14, x8, #3
	ldp	x11, x12, [x19, #16]
	ldr	x12, [x12, x14]
	ldp	x13, x15, [x20]
	ldr	x14, [x15, x14]
	fmov	w15, s0
	sub	w16, w15, #1
	add	x17, x16, #1
	and	x1, x17, #0x1fffffff0
	add	x2, x14, #32
	b	LBB0_9
LBB0_8:                                 ;   in Loop: Header=BB0_9 Depth=2
	add	w10, w10, #1
	cmp	w10, w9
	b.eq	LBB0_2
LBB0_9:                                 ;   Parent Loop BB0_4 Depth=1
                                        ; =>  This Loop Header: Depth=2
                                        ;       Child Loop BB0_16 Depth 3
                                        ;       Child Loop BB0_14 Depth 3
	cmp	w15, #1
	b.lt	LBB0_8
; %bb.10:                               ;   in Loop: Header=BB0_9 Depth=2
	lsl	x4, x8, #2
	ldr	w3, [x13, x4]
	mul	w5, w3, w10
	add	x3, x14, w5, sxtw #2
	ldrsw	x4, [x11, x4]
	sxtw	x6, w10
	madd	x6, x4, x6, x12
	cmp	w16, #15
	b.lo	LBB0_12
; %bb.11:                               ;   in Loop: Header=BB0_9 Depth=2
	sxtw	x4, w5
	add	x4, x14, x4, lsl #2
	sub	x4, x4, x6
	cmp	x4, #64
	b.hs	LBB0_15
LBB0_12:                                ;   in Loop: Header=BB0_9 Depth=2
	mov	w5, #0
	mov	x4, x6
LBB0_13:                                ;   in Loop: Header=BB0_9 Depth=2
	sub	w5, w15, w5
LBB0_14:                                ;   Parent Loop BB0_4 Depth=1
                                        ;     Parent Loop BB0_9 Depth=2
                                        ; =>    This Inner Loop Header: Depth=3
	ldr	w6, [x4], #4
	str	w6, [x3], #4
	subs	w5, w5, #1
	b.ne	LBB0_14
	b	LBB0_8
LBB0_15:                                ;   in Loop: Header=BB0_9 Depth=2
	lsl	x4, x1, #2
	add	x3, x3, x4
	add	x4, x6, x4
	add	x5, x2, w5, sxtw #2
	add	x6, x6, #32
	mov	x7, x1
LBB0_16:                                ;   Parent Loop BB0_4 Depth=1
                                        ;     Parent Loop BB0_9 Depth=2
                                        ; =>    This Inner Loop Header: Depth=3
	ldp	q0, q1, [x6, #-32]
	ldp	q2, q3, [x6], #64
	stp	q0, q1, [x5, #-32]
	stp	q2, q3, [x5], #64
	subs	x7, x7, #16
	b.ne	LBB0_16
; %bb.17:                               ;   in Loop: Header=BB0_9 Depth=2
	mov	x5, x1
	cmp	x17, x1
	b.eq	LBB0_8
	b	LBB0_13
LBB0_18:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_image_copy_16_to_8
.subsections_via_symbols
