	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function libwebp_anim_encode_frame
_libwebp_anim_encode_frame:             ## @libwebp_anim_encode_frame
	.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
	movq	%rcx, %r15
	movq	%rsi, %rbx
	movq	%rdi, %r13
	movq	24(%rdi), %r12
	testq	%rdx, %rdx
	je	LBB0_4
## %bb.1:
	movq	%rdx, %r14
	movq	%rbx, -72(%rbp)                 ## 8-byte Spill
	movq	%r15, -80(%rbp)                 ## 8-byte Spill
	movq	$0, -56(%rbp)
	movq	$0, -64(%rbp)
	leaq	8(%r12), %r15
	leaq	-64(%rbp), %rcx
	leaq	-56(%rbp), %r8
	movq	%r13, %rdi
	movq	%r15, %rsi
	callq	_ff_libwebp_get_frame
	testl	%eax, %eax
	js	LBB0_8
## %bb.2:
	movl	16(%r13), %eax
	imull	(%r14), %eax
	imull	$1000, %eax, %eax               ## imm = 0x3E8
	cltd
	idivl	20(%r13)
	movl	12(%r12), %edi
	movq	-56(%rbp), %rsi
	movl	%eax, %edx
	movq	%r15, %rcx
	callq	_WebPAnimEncoderAdd
	testl	%eax, %eax
	je	LBB0_7
## %bb.3:
	movl	(%r14), %eax
	movq	-72(%rbp), %rcx                 ## 8-byte Reload
	movl	%eax, 4(%rcx)
	movl	%eax, (%rcx)
	movl	%eax, 4(%r12)
	movq	-80(%rbp), %rax                 ## 8-byte Reload
	movl	$1, (%rax)
	xorl	%ebx, %ebx
	jmp	LBB0_9
LBB0_4:
	cmpl	$0, (%r12)
	je	LBB0_11
## %bb.5:
	movl	$0, (%r15)
	xorl	%ebx, %ebx
	jmp	LBB0_10
LBB0_7:
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	-56(%rbp), %rax
	movl	(%rax), %ecx
	leaq	L_.str.1(%rip), %rdx
	movq	%r13, %rdi
	callq	_av_log
	movq	-56(%rbp), %rax
	movl	(%rax), %edi
	callq	_ff_libwebp_error_to_averror
LBB0_8:
	movl	%eax, %ebx
LBB0_9:
	movq	-56(%rbp), %rdi
	callq	_WebPPictureFree
	leaq	-56(%rbp), %rdi
	callq	_av_freep
	leaq	-64(%rbp), %rdi
	callq	_av_frame_free
LBB0_10:
	movl	%ebx, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_11:
	movl	$0, -48(%rbp)
	movq	$0, -56(%rbp)
	movl	12(%r12), %edi
	leaq	-56(%rbp), %rsi
	callq	_WebPAnimEncoderAssemble
	testl	%eax, %eax
	je	LBB0_14
## %bb.12:
	movl	-56(%rbp), %ecx
	movq	%r13, %rdi
	movq	%rbx, %rsi
	movl	%ecx, %edx
	callq	_ff_alloc_packet2
	testl	%eax, %eax
	js	LBB0_15
## %bb.13:
	movq	%rbx, %r14
	movl	12(%rbx), %edi
	movl	-56(%rbp), %edx
	movl	-52(%rbp), %esi
	callq	_memcpy
	movl	$1, (%r12)
	movq	_AV_PKT_FLAG_KEY@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, 8(%rbx)
	movl	4(%r12), %eax
	incl	%eax
	movl	%eax, 4(%rbx)
	movl	%eax, (%rbx)
	movl	$1, (%r15)
	xorl	%ebx, %ebx
	jmp	LBB0_10
LBB0_14:
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_VP8_ENC_ERROR_OUT_OF_MEMORY@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	leaq	L_.str(%rip), %rdx
	movq	%r12, %rdi
	callq	_av_log
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_AVERROR
LBB0_15:
	movl	%eax, %ebx
	jmp	LBB0_10
	.cfi_endproc
                                        ## -- End function
	.comm	_AV_PKT_FLAG_KEY,4,2            ## @AV_PKT_FLAG_KEY
	.comm	_AV_LOG_ERROR,4,2               ## @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"WebPAnimEncoderAssemble() failed with error: %d\n"

	.comm	_VP8_ENC_ERROR_OUT_OF_MEMORY,4,2 ## @VP8_ENC_ERROR_OUT_OF_MEMORY
	.comm	_ENOMEM,4,2                     ## @ENOMEM
L_.str.1:                               ## @.str.1
	.asciz	"Encoding WebP frame failed with error: %d\n"

	.no_dead_strip	_libwebp_anim_encode_frame
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function libwebp_anim_encode_frame
_libwebp_anim_encode_frame:             ; @libwebp_anim_encode_frame
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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	x19, x3
	mov	x21, x1
	mov	x23, x0
	ldr	x20, [x0, #24]
	cbz	x2, LBB0_4
; %bb.1:
	mov	x24, x2
	stp	xzr, xzr, [sp, #8]
	add	x25, x20, #8
	add	x3, sp, #8
	add	x4, sp, #16
	mov	x0, x23
	mov	x1, x25
	bl	_ff_libwebp_get_frame
	tbnz	w0, #31, LBB0_7
; %bb.2:
	ldr	w8, [x24]
	ldp	w9, w10, [x23, #16]
	mul	w8, w9, w8
	mov	w9, #1000
	mul	w8, w8, w9
	sdiv	w2, w8, w10
	ldr	w0, [x20, #12]
	ldr	x1, [sp, #16]
	mov	x3, x25
	bl	_WebPAnimEncoderAdd
	cbz	w0, LBB0_6
; %bb.3:
	mov	w22, #0
	ldr	w8, [x24]
	stp	w8, w8, [x21]
	str	w8, [x20, #4]
	mov	w8, #1
	str	w8, [x19]
	b	LBB0_8
LBB0_4:
	ldr	w8, [x20]
	cbz	w8, LBB0_10
; %bb.5:
	mov	w22, #0
	str	wzr, [x19]
	b	LBB0_9
LBB0_6:
Lloh0:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh1:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	ldr	x8, [sp, #16]
	ldr	w3, [x8]
Lloh3:
	adrp	x2, l_.str.1@PAGE
Lloh4:
	add	x2, x2, l_.str.1@PAGEOFF
	mov	x0, x23
	bl	_av_log
	ldr	x8, [sp, #16]
	ldr	w0, [x8]
	bl	_ff_libwebp_error_to_averror
LBB0_7:
	mov	x22, x0
LBB0_8:
	ldr	x0, [sp, #16]
	bl	_WebPPictureFree
	add	x0, sp, #16
	bl	_av_freep
	add	x0, sp, #8
	bl	_av_frame_free
LBB0_9:
	mov	x0, x22
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_10:
	str	wzr, [sp, #24]
	str	xzr, [sp, #16]
	ldr	w0, [x20, #12]
	add	x1, sp, #16
	bl	_WebPAnimEncoderAssemble
	cbz	w0, LBB0_13
; %bb.11:
	ldr	w2, [sp, #16]
	mov	x0, x23
	mov	x1, x21
	mov	x3, x2
	bl	_ff_alloc_packet2
	tbnz	w0, #31, LBB0_14
; %bb.12:
	ldr	w0, [x21, #12]
	ldp	w2, w1, [sp, #16]
	bl	_memcpy
	mov	w22, #0
	mov	w8, #1
	str	w8, [x20]
Lloh5:
	adrp	x9, _AV_PKT_FLAG_KEY@GOTPAGE
Lloh6:
	ldr	x9, [x9, _AV_PKT_FLAG_KEY@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
	ldr	w10, [x21, #8]
	orr	w9, w10, w9
	str	w9, [x21, #8]
	ldr	w9, [x20, #4]
	add	w9, w9, #1
	stp	w9, w9, [x21]
	str	w8, [x19]
	b	LBB0_9
LBB0_13:
Lloh8:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh9:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh10:
	ldr	w1, [x8]
Lloh11:
	adrp	x8, _VP8_ENC_ERROR_OUT_OF_MEMORY@GOTPAGE
Lloh12:
	ldr	x8, [x8, _VP8_ENC_ERROR_OUT_OF_MEMORY@GOTPAGEOFF]
Lloh13:
	ldr	w3, [x8]
Lloh14:
	adrp	x2, l_.str@PAGE
Lloh15:
	add	x2, x2, l_.str@PAGEOFF
	mov	x0, x20
	bl	_av_log
Lloh16:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh17:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh18:
	ldr	w0, [x8]
	bl	_AVERROR
LBB0_14:
	mov	x22, x0
	b	LBB0_9
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_AV_PKT_FLAG_KEY,4,2            ; @AV_PKT_FLAG_KEY
	.comm	_AV_LOG_ERROR,4,2               ; @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"WebPAnimEncoderAssemble() failed with error: %d\n"

	.comm	_VP8_ENC_ERROR_OUT_OF_MEMORY,4,2 ; @VP8_ENC_ERROR_OUT_OF_MEMORY
	.comm	_ENOMEM,4,2                     ; @ENOMEM
l_.str.1:                               ; @.str.1
	.asciz	"Encoding WebP frame failed with error: %d\n"

	.no_dead_strip	_libwebp_anim_encode_frame
.subsections_via_symbols
