	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_av_image_alloc                 ## -- Begin function av_image_alloc
	.p2align	4, 0x90
_av_image_alloc:                        ## @av_image_alloc
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%r9d, %r13d
	movl	%ecx, %ebx
	movl	%edx, %r15d
	movq	%rsi, -80(%rbp)                 ## 8-byte Spill
	movq	%rdi, %r12
	movl	%r8d, -60(%rbp)                 ## 4-byte Spill
	movl	%r8d, %edi
	callq	_av_pix_fmt_desc_get
	testq	%rax, %rax
	je	LBB0_12
## %bb.1:
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	movl	%r15d, %edi
	movl	%ebx, -44(%rbp)                 ## 4-byte Spill
	movl	%ebx, %esi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	callq	_av_image_check_size
	testl	%eax, %eax
	js	LBB0_15
## %bb.2:
	cmpl	$8, %r13d
	movq	%r12, -56(%rbp)                 ## 8-byte Spill
	jl	LBB0_4
## %bb.3:
	movl	%r15d, %edi
	movl	$8, %esi
	callq	_FFALIGN
	movl	%eax, %r15d
LBB0_4:
	movq	-80(%rbp), %r12                 ## 8-byte Reload
	movq	%r12, %rdi
	movl	-60(%rbp), %ebx                 ## 4-byte Reload
	movl	%ebx, %esi
	movl	%r15d, %edx
	callq	_av_image_fill_linesizes
	testl	%eax, %eax
	js	LBB0_15
## %bb.5:
	movl	(%r12), %edi
	movl	%r13d, %esi
	callq	_FFALIGN
	movl	%eax, (%r12)
	movl	4(%r12), %edi
	movl	%r13d, %esi
	callq	_FFALIGN
	movl	%eax, 4(%r12)
	movl	8(%r12), %edi
	movl	%r13d, %esi
	callq	_FFALIGN
	movl	%eax, 8(%r12)
	movl	12(%r12), %edi
	movl	%r13d, %esi
	callq	_FFALIGN
	movl	%eax, 12(%r12)
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movl	%ebx, %esi
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	xorl	%ecx, %ecx
	movq	%r12, %r8
	callq	_av_image_fill_pointers
	movl	%eax, %r14d
	testl	%eax, %eax
	js	LBB0_26
## %bb.6:
	addl	%r13d, %r14d
	movl	%r14d, %edi
	callq	_av_malloc
	testq	%rax, %rax
	je	LBB0_16
## %bb.7:
	movq	%rax, %r15
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movl	%ebx, %esi
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	movq	%rax, %rcx
	movq	%r12, %r8
	callq	_av_image_fill_pointers
	movl	%eax, %r14d
	testl	%eax, %eax
	js	LBB0_17
## %bb.8:
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %eax
	movq	_AV_PIX_FMT_FLAG_PAL@GOTPCREL(%rip), %r15
	movl	(%r15), %ecx
	testl	%eax, %ecx
	je	LBB0_18
## %bb.9:
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	8(%rax), %rdi
LBB0_10:
	movl	%ebx, %esi
	callq	_avpriv_set_systematic_pal2
	cmpl	$4, %r13d
	jge	LBB0_20
## %bb.11:
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdx
	xorl	%edi, %edi
	callq	_av_log
LBB0_12:
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_13:
	movl	(%rax), %edi
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_AVERROR                        ## TAILCALL
LBB0_15:
	movl	%eax, %r14d
LBB0_26:
	movl	%r14d, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_16:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	jmp	LBB0_13
LBB0_17:
	movq	%r15, %rdi
	callq	_av_free
	jmp	LBB0_26
LBB0_18:
	movq	_FF_PSEUDOPAL@GOTPCREL(%rip), %rdx
	testl	%eax, (%rdx)
	je	LBB0_21
## %bb.19:
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
	movq	8(%rdx), %rdi
	testq	%rdi, %rdi
	jne	LBB0_10
	jmp	LBB0_21
LBB0_20:
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %eax
	movl	(%r15), %ecx
LBB0_21:
	testl	%eax, %ecx
	jne	LBB0_23
## %bb.22:
	movq	_FF_PSEUDOPAL@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_26
LBB0_23:
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movq	8(%rax), %rdx
	testq	%rdx, %rdx
	je	LBB0_26
## %bb.24:
	movq	(%rax), %rax
	subq	%rax, %rdx
	sarq	$2, %rdx
	movslq	(%r12), %rsi
	movslq	-44(%rbp), %rcx                 ## 4-byte Folded Reload
	imulq	%rsi, %rcx
	cmpq	%rcx, %rdx
	jle	LBB0_26
## %bb.25:
	leaq	(%rax,%rcx,4), %rdi
	subl	%ecx, %edx
	xorl	%esi, %esi
                                        ## kill: def $edx killed $edx killed $rdx
	callq	_memset
	jmp	LBB0_26
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_AV_PIX_FMT_FLAG_PAL,4,2        ## @AV_PIX_FMT_FLAG_PAL
	.comm	_FF_PSEUDOPAL,4,2               ## @FF_PSEUDOPAL
	.comm	_AV_LOG_ERROR,4,2               ## @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Formats with a palette require a minimum alignment of 4\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_av_image_alloc                 ; -- Begin function av_image_alloc
	.p2align	2
_av_image_alloc:                        ; @av_image_alloc
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x22, x5
	mov	x23, x4
	mov	x19, x3
	mov	x26, x2
	mov	x20, x1
	mov	x21, x0
	mov	x0, x4
	bl	_av_pix_fmt_desc_get
	cbz	x0, LBB0_12
; %bb.1:
	mov	x24, x0
	mov	x0, x26
	mov	x1, x19
	mov	w2, #0
	mov	x3, #0
	bl	_av_image_check_size
	tbnz	w0, #31, LBB0_14
; %bb.2:
	cmp	w22, #8
	b.lt	LBB0_4
; %bb.3:
	mov	x0, x26
	mov	w1, #8
	bl	_FFALIGN
	mov	x26, x0
LBB0_4:
	mov	x0, x20
	mov	x1, x23
	mov	x2, x26
	bl	_av_image_fill_linesizes
	tbnz	w0, #31, LBB0_14
; %bb.5:
	ldr	w0, [x20]
	mov	x1, x22
	bl	_FFALIGN
	str	w0, [x20]
	ldr	w0, [x20, #4]
	mov	x1, x22
	bl	_FFALIGN
	str	w0, [x20, #4]
	ldr	w0, [x20, #8]
	mov	x1, x22
	bl	_FFALIGN
	str	w0, [x20, #8]
	ldr	w0, [x20, #12]
	mov	x1, x22
	bl	_FFALIGN
	str	w0, [x20, #12]
	mov	x0, x21
	mov	x1, x23
	mov	x2, x19
	mov	x3, #0
	mov	x4, x20
	bl	_av_image_fill_pointers
	mov	x25, x0
	tbnz	w0, #31, LBB0_15
; %bb.6:
	add	w0, w25, w22
	bl	_av_malloc
	cbz	x0, LBB0_16
; %bb.7:
	mov	x26, x0
	mov	x0, x21
	mov	x1, x23
	mov	x2, x19
	mov	x3, x26
	mov	x4, x20
	bl	_av_image_fill_pointers
	mov	x25, x0
	tbnz	w0, #31, LBB0_17
; %bb.8:
	ldr	w8, [x24]
Lloh0:
	adrp	x26, _AV_PIX_FMT_FLAG_PAL@GOTPAGE
Lloh1:
	ldr	x26, [x26, _AV_PIX_FMT_FLAG_PAL@GOTPAGEOFF]
	ldr	w9, [x26]
	tst	w9, w8
	b.eq	LBB0_18
; %bb.9:
	ldr	x0, [x21, #8]
LBB0_10:
	mov	x1, x23
	bl	_avpriv_set_systematic_pal2
	cmp	w22, #4
	b.ge	LBB0_20
; %bb.11:
Lloh2:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh3:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
Lloh5:
	adrp	x2, l_.str@PAGE
Lloh6:
	add	x2, x2, l_.str@PAGEOFF
	mov	x0, #0
	bl	_av_log
LBB0_12:
Lloh7:
	adrp	x8, _EINVAL@GOTPAGE
Lloh8:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_13:
	ldr	w0, [x8]
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	b	_AVERROR
LBB0_14:
	mov	x25, x0
LBB0_15:
	mov	x0, x25
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_16:
Lloh9:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh10:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
	b	LBB0_13
LBB0_17:
	mov	x0, x26
	bl	_av_free
	b	LBB0_15
LBB0_18:
Lloh11:
	adrp	x10, _FF_PSEUDOPAL@GOTPAGE
Lloh12:
	ldr	x10, [x10, _FF_PSEUDOPAL@GOTPAGEOFF]
Lloh13:
	ldr	w10, [x10]
	tst	w10, w8
	b.eq	LBB0_21
; %bb.19:
	ldr	x0, [x21, #8]
	cbnz	x0, LBB0_10
	b	LBB0_21
LBB0_20:
	ldr	w8, [x24]
	ldr	w9, [x26]
LBB0_21:
	tst	w9, w8
	b.ne	LBB0_23
; %bb.22:
Lloh14:
	adrp	x9, _FF_PSEUDOPAL@GOTPAGE
Lloh15:
	ldr	x9, [x9, _FF_PSEUDOPAL@GOTPAGEOFF]
Lloh16:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_15
LBB0_23:
	ldr	x9, [x21, #8]
	cbz	x9, LBB0_15
; %bb.24:
	ldr	x8, [x21]
	sub	x9, x9, x8
	ldrsw	x10, [x20]
	sxtw	x11, w19
	mul	x10, x10, x11
	cmp	x10, x9, asr #2
	b.ge	LBB0_15
; %bb.25:
	lsr	x9, x9, #2
	add	x0, x8, x10, lsl #2
	sub	w2, w9, w10
	mov	w1, #0
	bl	_memset
	b	LBB0_15
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_AV_PIX_FMT_FLAG_PAL,4,2        ; @AV_PIX_FMT_FLAG_PAL
	.comm	_FF_PSEUDOPAL,4,2               ; @FF_PSEUDOPAL
	.comm	_AV_LOG_ERROR,4,2               ; @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Formats with a palette require a minimum alignment of 4\n"

.subsections_via_symbols
