	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_av_image_copy_to_buffer        ## -- Begin function av_image_copy_to_buffer
	.p2align	4, 0x90
_av_image_copy_to_buffer:               ## @av_image_copy_to_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	$88, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%r8d, %r15d
	movq	%rcx, -120(%rbp)                ## 8-byte Spill
	movq	%rdx, -112(%rbp)                ## 8-byte Spill
	movl	%esi, %r14d
	movq	%rdi, %rbx
	movl	24(%rbp), %r13d
	movl	16(%rbp), %edx
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movl	%r8d, %edi
	movl	%r9d, -80(%rbp)                 ## 4-byte Spill
	movl	%r9d, %esi
	movl	%edx, -68(%rbp)                 ## 4-byte Spill
	movl	%r13d, %ecx
	callq	_av_image_get_buffer_size
	movl	%eax, %r12d
	movl	%r15d, -96(%rbp)                ## 4-byte Spill
	movl	%r15d, %edi
	callq	_av_pix_fmt_desc_get
	cmpl	%r14d, %r12d
	jg	LBB0_5
## %bb.1:
	testl	%r12d, %r12d
	js	LBB0_5
## %bb.2:
	movq	%rax, %rcx
	testq	%rax, %rax
	je	LBB0_5
## %bb.3:
	cmpl	$0, (%rcx)
	movq	%rcx, -88(%rbp)                 ## 8-byte Spill
	jle	LBB0_4
## %bb.7:
	xorl	%r14d, %r14d
	xorl	%esi, %esi
	.p2align	4, 0x90
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movq	16(%rcx), %rax
	movl	(%rax,%r14,4), %edi
                                        ## kill: def $esi killed $esi killed $rsi
	callq	_FFMAX
	movq	-88(%rbp), %rcx                 ## 8-byte Reload
	movl	%eax, %esi
	incq	%r14
	movslq	(%rcx), %rax
	cmpq	%rax, %r14
	jl	LBB0_8
	jmp	LBB0_9
LBB0_5:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_22
## %bb.6:
	addq	$88, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_AVERROR                        ## TAILCALL
LBB0_4:
	xorl	%esi, %esi
LBB0_9:
	movl	%r12d, -92(%rbp)                ## 4-byte Spill
	leaq	-64(%rbp), %rdi
	movq	%rsi, %r14
	movl	-96(%rbp), %esi                 ## 4-byte Reload
	movl	-80(%rbp), %edx                 ## 4-byte Reload
	callq	_av_image_fill_linesizes
	notl	%eax
	shrl	$31, %eax
	movl	%eax, %edi
	callq	_av_assert0
	movq	%r14, %rdx
	testl	%edx, %edx
	js	LBB0_17
## %bb.10:
	decl	-68(%rbp)                       ## 4-byte Folded Spill
	incl	%edx
	xorl	%r14d, %r14d
	movq	%rdx, -80(%rbp)                 ## 8-byte Spill
	movl	%r13d, -100(%rbp)               ## 4-byte Spill
	movq	-120(%rbp), %r13                ## 8-byte Reload
	jmp	LBB0_11
	.p2align	4, 0x90
LBB0_16:                                ##   in Loop: Header=BB0_11 Depth=1
	incq	%r14
	movq	-80(%rbp), %rdx                 ## 8-byte Reload
	cmpq	%rdx, %r14
	je	LBB0_17
LBB0_11:                                ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_15 Depth 2
	leal	-1(%r14), %eax
	movl	$0, %ecx
	cmpl	$1, %eax
	ja	LBB0_13
## %bb.12:                              ##   in Loop: Header=BB0_11 Depth=1
	movq	-88(%rbp), %rax                 ## 8-byte Reload
	movl	4(%rax), %ecx
LBB0_13:                                ##   in Loop: Header=BB0_11 Depth=1
	movl	$1, %r12d
	shll	%cl, %r12d
	addl	-68(%rbp), %r12d                ## 4-byte Folded Reload
                                        ## kill: def $cl killed $cl killed $ecx
	sarl	%cl, %r12d
	testl	%r12d, %r12d
	jle	LBB0_16
## %bb.14:                              ##   in Loop: Header=BB0_11 Depth=1
	movq	-112(%rbp), %rax                ## 8-byte Reload
	movq	(%rax,%r14,8), %r15
	.p2align	4, 0x90
LBB0_15:                                ##   Parent Loop BB0_11 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movl	-64(%rbp,%r14,4), %edx
	movq	%rbx, %rdi
	movq	%r15, %rsi
	callq	_memcpy
	movl	-64(%rbp,%r14,4), %edi
	movl	-100(%rbp), %esi                ## 4-byte Reload
	callq	_FFALIGN
	cltq
	leaq	(%rbx,%rax,4), %rbx
	movslq	(%r13,%r14,4), %rax
	leaq	(%r15,%rax,4), %r15
	decl	%r12d
	jne	LBB0_15
	jmp	LBB0_16
LBB0_17:
	movq	_AV_PIX_FMT_FLAG_PAL@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	-88(%rbp), %rcx                 ## 8-byte Reload
	testl	%eax, 8(%rcx)
	movq	-112(%rbp), %r15                ## 8-byte Reload
	je	LBB0_20
## %bb.18:
	xorl	%r14d, %r14d
	.p2align	4, 0x90
LBB0_19:                                ## =>This Inner Loop Header: Depth=1
	movq	8(%r15), %rdi
	addq	%r14, %rdi
	callq	_AV_RN32
	movq	%rbx, %rdi
	movl	%eax, %esi
	callq	_AV_WL32
	addq	$4, %rbx
	addq	$16, %r14
	cmpq	$4096, %r14                     ## imm = 0x1000
	jne	LBB0_19
LBB0_20:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	movl	-92(%rbp), %eax                 ## 4-byte Reload
	jne	LBB0_22
## %bb.21:
	addq	$88, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_22:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_AV_PIX_FMT_FLAG_PAL,4,2        ## @AV_PIX_FMT_FLAG_PAL
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_av_image_copy_to_buffer        ; -- Begin function av_image_copy_to_buffer
	.p2align	2
_av_image_copy_to_buffer:               ; @av_image_copy_to_buffer
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #144
	.cfi_def_cfa_offset 144
	stp	x28, x27, [sp, #48]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #64]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #80]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #96]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #112]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #128]            ; 16-byte Folded Spill
	add	x29, sp, #128
	.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, x7
	mov	x25, x6
	mov	x26, x5
	mov	x27, x4
	mov	x23, x3
	mov	x19, x2
	mov	x28, x1
	mov	x20, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [sp, #40]
	mov	x0, x4
	mov	x1, x5
	mov	x2, x6
	mov	x3, x7
	bl	_av_image_get_buffer_size
	mov	x21, x0
	mov	x0, x27
	bl	_av_pix_fmt_desc_get
	cmp	w21, w28
	b.gt	LBB0_6
; %bb.1:
	tbnz	w21, #31, LBB0_6
; %bb.2:
	mov	x24, x0
	cbz	x0, LBB0_6
; %bb.3:
	ldr	w8, [x24]
	cmp	w8, #1
	str	x19, [sp, #8]                   ; 8-byte Folded Spill
	str	w21, [sp, #4]                   ; 4-byte Folded Spill
	b.lt	LBB0_8
; %bb.4:
	mov	x19, #0
	mov	w28, #0
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x24, #16]
	ldr	w0, [x8, x19, lsl #2]
	mov	x1, x28
	bl	_FFMAX
	mov	x28, x0
	add	x19, x19, #1
	ldrsw	x8, [x24]
	cmp	x19, x8
	b.lt	LBB0_5
	b	LBB0_9
LBB0_6:
Lloh3:
	adrp	x8, _EINVAL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh5:
	ldr	w0, [x8]
	ldr	x8, [sp, #40]
Lloh6:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh7:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh8:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_23
; %bb.7:
	ldp	x29, x30, [sp, #128]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #112]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #96]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #80]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #64]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #144
	b	_AVERROR
LBB0_8:
	mov	w28, #0
LBB0_9:
	add	x21, sp, #24
	add	x0, sp, #24
	mov	x1, x27
	mov	x2, x26
	bl	_av_image_fill_linesizes
	mvn	w8, w0
	lsr	w0, w8, #31
	bl	_av_assert0
	tbnz	w28, #31, LBB0_18
; %bb.10:
	mov	x26, #0
	sub	w8, w25, #1
	str	w8, [sp, #20]                   ; 4-byte Folded Spill
	add	w28, w28, #1
	b	LBB0_12
LBB0_11:                                ;   in Loop: Header=BB0_12 Depth=1
	add	x26, x26, #1
	cmp	x26, x28
	b.eq	LBB0_18
LBB0_12:                                ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_17 Depth 2
	sub	w8, w26, #1
	cmp	w8, #1
	b.hi	LBB0_14
; %bb.13:                               ;   in Loop: Header=BB0_12 Depth=1
	ldr	w8, [x24, #4]
	b	LBB0_15
LBB0_14:                                ;   in Loop: Header=BB0_12 Depth=1
	mov	w8, #0
LBB0_15:                                ;   in Loop: Header=BB0_12 Depth=1
	mov	w9, #1
	lsl	w9, w9, w8
	ldr	w10, [sp, #20]                  ; 4-byte Folded Reload
	add	w9, w10, w9
	asr	w19, w9, w8
	cmp	w19, #1
	b.lt	LBB0_11
; %bb.16:                               ;   in Loop: Header=BB0_12 Depth=1
	ldr	x8, [sp, #8]                    ; 8-byte Folded Reload
	ldr	x25, [x8, x26, lsl #3]
LBB0_17:                                ;   Parent Loop BB0_12 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	lsl	x27, x26, #2
	ldr	w2, [x21, x27]
	mov	x0, x20
	mov	x1, x25
	bl	_memcpy
	ldr	w0, [x21, x27]
	mov	x1, x22
	bl	_FFALIGN
	add	x20, x20, w0, sxtw #2
	ldrsw	x8, [x23, x27]
	add	x25, x25, x8, lsl #2
	subs	w19, w19, #1
	b.ne	LBB0_17
	b	LBB0_11
LBB0_18:
	ldr	w8, [x24, #8]
Lloh9:
	adrp	x9, _AV_PIX_FMT_FLAG_PAL@GOTPAGE
Lloh10:
	ldr	x9, [x9, _AV_PIX_FMT_FLAG_PAL@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
	tst	w9, w8
	ldr	x21, [sp, #8]                   ; 8-byte Folded Reload
	b.eq	LBB0_21
; %bb.19:
	mov	x19, #0
LBB0_20:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x21, #8]
	add	x0, x8, x19
	bl	_AV_RN32
	mov	x1, x0
	mov	x0, x20
	bl	_AV_WL32
	add	x20, x20, #4
	add	x19, x19, #16
	cmp	x19, #1, lsl #12                ; =4096
	b.ne	LBB0_20
LBB0_21:
	ldr	x8, [sp, #40]
Lloh12:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh13:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh14:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_23
; %bb.22:
	ldr	w0, [sp, #4]                    ; 4-byte Folded Reload
	ldp	x29, x30, [sp, #128]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #112]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #96]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #80]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #64]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #144
	ret
LBB0_23:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_AV_PIX_FMT_FLAG_PAL,4,2        ; @AV_PIX_FMT_FLAG_PAL
.subsections_via_symbols
