	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function libwebp_encode_frame
_libwebp_encode_frame:                  ## @libwebp_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, %r14
	movq	%rsi, %r15
	movq	%rdi, %r12
	movq	(%rdi), %r13
	movq	$0, -48(%rbp)
	movq	$0, -72(%rbp)
	movl	$0, -56(%rbp)
	movq	$0, -64(%rbp)
	leaq	-72(%rbp), %rcx
	leaq	-48(%rbp), %r8
	movq	%r13, %rsi
	callq	_ff_libwebp_get_frame
	testl	%eax, %eax
	js	LBB0_6
## %bb.1:
	leaq	-64(%rbp), %rbx
	movq	%rbx, %rdi
	callq	_WebPMemoryWriterInit
	movq	-48(%rbp), %rsi
	movq	%rbx, 8(%rsi)
	movq	_WebPMemoryWrite@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 4(%rsi)
	movq	%r13, %rdi
	callq	_WebPEncode
	testl	%eax, %eax
	je	LBB0_5
## %bb.2:
	movl	-60(%rbp), %ecx
	movq	%r12, %rdi
	movq	%r15, %rsi
	movl	%ecx, %edx
	callq	_ff_alloc_packet2
	movl	%eax, %ebx
	testl	%eax, %eax
	js	LBB0_7
## %bb.3:
	movl	4(%r15), %edi
	movl	-64(%rbp), %esi
	movl	-60(%rbp), %edx
	callq	_memcpy
	movq	_AV_PKT_FLAG_KEY@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, (%r15)
	movl	$1, (%r14)
	jmp	LBB0_7
LBB0_5:
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	-48(%rbp), %rax
	movl	(%rax), %ecx
	leaq	L_.str(%rip), %rdx
	movq	%r12, %rdi
	callq	_av_log
	movq	-48(%rbp), %rax
	movl	(%rax), %edi
	callq	_ff_libwebp_error_to_averror
LBB0_6:
	movl	%eax, %ebx
LBB0_7:
	movl	-64(%rbp), %edi
	callq	_free
	movq	-48(%rbp), %rdi
	callq	_WebPPictureFree
	leaq	-48(%rbp), %rdi
	callq	_av_freep
	leaq	-72(%rbp), %rdi
	callq	_av_frame_free
	movl	%ebx, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_WebPMemoryWrite,4,2            ## @WebPMemoryWrite
	.comm	_AV_LOG_ERROR,4,2               ## @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"WebPEncode() failed with error: %d\n"

	.comm	_AV_PKT_FLAG_KEY,4,2            ## @AV_PKT_FLAG_KEY
	.no_dead_strip	_libwebp_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_encode_frame
_libwebp_encode_frame:                  ; @libwebp_encode_frame
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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, x3
	mov	x20, x1
	mov	x22, x0
	ldr	x23, [x0]
	stp	xzr, xzr, [sp, #16]
	str	wzr, [sp, #8]
	str	xzr, [sp]
	add	x3, sp, #16
	add	x4, sp, #24
	mov	x1, x23
	bl	_ff_libwebp_get_frame
	tbnz	w0, #31, LBB0_5
; %bb.1:
	mov	x21, sp
	mov	x0, sp
	bl	_WebPMemoryWriterInit
	ldr	x1, [sp, #24]
	str	x21, [x1, #8]
Lloh0:
	adrp	x8, _WebPMemoryWrite@GOTPAGE
Lloh1:
	ldr	x8, [x8, _WebPMemoryWrite@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	str	w8, [x1, #4]
	mov	x0, x23
	bl	_WebPEncode
	cbz	w0, LBB0_4
; %bb.2:
	ldr	w2, [sp, #4]
	mov	x0, x22
	mov	x1, x20
	mov	x3, x2
	bl	_ff_alloc_packet2
	mov	x21, x0
	tbnz	w0, #31, LBB0_6
; %bb.3:
	ldr	w0, [x20, #4]
	ldp	w1, w2, [sp]
	bl	_memcpy
Lloh3:
	adrp	x8, _AV_PKT_FLAG_KEY@GOTPAGE
Lloh4:
	ldr	x8, [x8, _AV_PKT_FLAG_KEY@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	ldr	w9, [x20]
	orr	w8, w9, w8
	str	w8, [x20]
	mov	w8, #1
	str	w8, [x19]
	b	LBB0_6
LBB0_4:
Lloh6:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh7:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	ldr	x8, [sp, #24]
	ldr	w3, [x8]
Lloh9:
	adrp	x2, l_.str@PAGE
Lloh10:
	add	x2, x2, l_.str@PAGEOFF
	mov	x0, x22
	bl	_av_log
	ldr	x8, [sp, #24]
	ldr	w0, [x8]
	bl	_ff_libwebp_error_to_averror
LBB0_5:
	mov	x21, x0
LBB0_6:
	ldr	w0, [sp]
	bl	_free
	ldr	x0, [sp, #24]
	bl	_WebPPictureFree
	add	x0, sp, #24
	bl	_av_freep
	add	x0, sp, #16
	bl	_av_frame_free
	mov	x0, x21
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_WebPMemoryWrite,4,2            ; @WebPMemoryWrite
	.comm	_AV_LOG_ERROR,4,2               ; @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"WebPEncode() failed with error: %d\n"

	.comm	_AV_PKT_FLAG_KEY,4,2            ; @AV_PKT_FLAG_KEY
	.no_dead_strip	_libwebp_encode_frame
.subsections_via_symbols
