	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function gif_encode_frame
_gif_encode_frame:                      ## @gif_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	%rdx, %r12
	movq	%rsi, %r15
	movq	%rdi, %rbx
	movl	(%rdi), %eax
	imull	4(%rdi), %eax
	movq	24(%rdi), %r13
	leal	(,%rax,8), %ecx
	subl	%eax, %ecx
	movslq	%ecx, %rax
	imulq	$1717986919, %rax, %rax         ## imm = 0x66666667
	movq	%rax, %rcx
	shrq	$63, %rcx
	sarq	$33, %rax
	addl	%ecx, %eax
	movslq	%eax, %rdx
	movq	_AV_INPUT_BUFFER_MIN_SIZE@GOTPCREL(%rip), %rax
	addq	(%rax), %rdx
	xorl	%ecx, %ecx
	callq	_ff_alloc_packet2
	testl	%eax, %eax
	js	LBB0_19
## %bb.1:
	movq	8(%r15), %rax
	movq	%rax, -48(%rbp)
	movslq	(%r15), %rcx
	leaq	(%rax,%rcx,4), %rdx
	movq	8(%rbx), %rax
	movq	_AV_PIX_FMT_PAL8@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	movq	%r14, -64(%rbp)                 ## 8-byte Spill
	jne	LBB0_2
## %bb.3:
	movq	%rdx, -56(%rbp)                 ## 8-byte Spill
	movq	8(%r12), %rax
	cmpl	$0, (%r13)
	movq	8(%rax), %r14
	movl	24(%r13), %edi
	movq	_AVPALETTE_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r14, %rsi
	je	LBB0_4
## %bb.5:
	callq	_memcmp
	xorl	%ecx, %ecx
	testl	%eax, %eax
	cmoveq	%rcx, %r14
	jmp	LBB0_6
LBB0_2:
	xorl	%r14d, %r14d
	jmp	LBB0_7
LBB0_4:
	callq	_memcpy
	movq	%r14, %rdi
	callq	_get_palette_transparency_index
	movl	%eax, 28(%r13)
	movl	$1, (%r13)
LBB0_6:
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
LBB0_7:
	movq	(%r12), %rax
	movq	8(%r12), %rcx
	movq	(%rcx), %r8
	movl	(%rax), %r9d
	movq	%r15, (%rsp)
	leaq	-48(%rbp), %rsi
	movq	%rbx, %rdi
	movq	%r14, %rcx
	callq	_gif_image_write_image
	movq	16(%r13), %rdi
	testq	%rdi, %rdi
	movq	-64(%rbp), %r14                 ## 8-byte Reload
	jne	LBB0_10
## %bb.8:
	cmpq	$0, 8(%r13)
	je	LBB0_12
## %bb.9:
	xorl	%edi, %edi
	jmp	LBB0_10
LBB0_12:
	xorl	%eax, %eax
	callq	_av_frame_alloc
	movq	%rax, %rdi
	movq	%rax, 16(%r13)
	testq	%rax, %rax
	je	LBB0_13
LBB0_10:
	cmpq	$0, 8(%r13)
	je	LBB0_14
## %bb.11:
	movq	-48(%rbp), %rax
	subq	8(%r15), %rax
	shrq	$2, %rax
	movl	%eax, (%r15)
LBB0_17:
	movq	_AV_PKT_FLAG_KEY@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, 4(%r15)
LBB0_18:
	movl	$1, (%r14)
	xorl	%eax, %eax
LBB0_19:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_14:
	callq	_av_frame_unref
	movq	16(%r13), %rdi
	movq	%r12, %rsi
	callq	_av_frame_ref
	testl	%eax, %eax
	js	LBB0_19
## %bb.15:
	movq	-48(%rbp), %rax
	subq	8(%r15), %rax
	shrq	$2, %rax
	cmpq	$0, 8(%r13)
	movl	%eax, (%r15)
	jne	LBB0_17
## %bb.16:
	cmpl	$0, 16(%rbx)
	jne	LBB0_18
	jmp	LBB0_17
LBB0_13:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_AVERROR
	jmp	LBB0_19
	.cfi_endproc
                                        ## -- End function
	.comm	_AV_INPUT_BUFFER_MIN_SIZE,8,3   ## @AV_INPUT_BUFFER_MIN_SIZE
	.comm	_AV_PIX_FMT_PAL8,8,3            ## @AV_PIX_FMT_PAL8
	.comm	_AVPALETTE_SIZE,4,2             ## @AVPALETTE_SIZE
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_AV_PKT_FLAG_KEY,4,2            ## @AV_PKT_FLAG_KEY
	.no_dead_strip	_gif_encode_frame
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function gif_encode_frame
_gif_encode_frame:                      ; @gif_encode_frame
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x19, x3
	mov	x22, x2
	mov	x20, x1
	mov	x21, x0
	ldr	x25, [x0, #24]
	ldp	w8, w9, [x0]
	mul	w8, w8, w9
	lsl	w9, w8, #3
	sub	w8, w9, w8
	mov	w9, #26215
	movk	w9, #26214, lsl #16
	smull	x8, w8, w9
	lsr	x9, x8, #63
	asr	x8, x8, #33
	add	w8, w8, w9
Lloh0:
	adrp	x9, _AV_INPUT_BUFFER_MIN_SIZE@GOTPAGE
Lloh1:
	ldr	x9, [x9, _AV_INPUT_BUFFER_MIN_SIZE@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	add	x2, x9, w8, sxtw
	mov	w3, #0
	bl	_ff_alloc_packet2
	tbnz	w0, #31, LBB0_14
; %bb.1:
	ldr	x8, [x20, #8]
	str	x8, [sp, #8]
	ldrsw	x9, [x20]
	add	x23, x8, x9, lsl #2
	ldr	x8, [x21, #8]
Lloh3:
	adrp	x9, _AV_PIX_FMT_PAL8@GOTPAGE
Lloh4:
	ldr	x9, [x9, _AV_PIX_FMT_PAL8@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_4
; %bb.2:
	ldr	x8, [x22, #8]
	ldr	x24, [x8, #8]
	ldr	w8, [x25]
	ldr	w0, [x25, #24]
Lloh6:
	adrp	x9, _AVPALETTE_SIZE@GOTPAGE
Lloh7:
	ldr	x9, [x9, _AVPALETTE_SIZE@GOTPAGEOFF]
Lloh8:
	ldr	w2, [x9]
	mov	x1, x24
	cbz	w8, LBB0_5
; %bb.3:
	bl	_memcmp
	cmp	w0, #0
	csel	x24, xzr, x24, eq
	b	LBB0_6
LBB0_4:
	mov	x24, #0
	b	LBB0_6
LBB0_5:
	bl	_memcpy
	mov	x0, x24
	bl	_get_palette_transparency_index
	str	w0, [x25, #28]
	mov	w8, #1
	str	w8, [x25]
LBB0_6:
	ldp	x9, x8, [x22]
	ldr	x4, [x8]
	ldr	w5, [x9]
	add	x1, sp, #8
	mov	x0, x21
	mov	x2, x23
	mov	x3, x24
	mov	x6, x20
	bl	_gif_image_write_image
	ldr	x0, [x25, #16]
	cbnz	x0, LBB0_10
; %bb.7:
	ldr	x8, [x25, #8]
	cbz	x8, LBB0_9
; %bb.8:
	mov	x0, #0
	b	LBB0_10
LBB0_9:
	bl	_av_frame_alloc
	str	x0, [x25, #16]
	cbz	x0, LBB0_18
LBB0_10:
	ldr	x8, [x25, #8]
	cbz	x8, LBB0_15
; %bb.11:
	ldr	x8, [sp, #8]
	ldr	x9, [x20, #8]
	sub	x8, x8, x9
	lsr	x8, x8, #2
	str	w8, [x20]
LBB0_12:
Lloh9:
	adrp	x8, _AV_PKT_FLAG_KEY@GOTPAGE
Lloh10:
	ldr	x8, [x8, _AV_PKT_FLAG_KEY@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	ldr	w9, [x20, #4]
	orr	w8, w9, w8
	str	w8, [x20, #4]
LBB0_13:
	mov	w0, #0
	mov	w8, #1
	str	w8, [x19]
LBB0_14:
	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
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
LBB0_15:
	bl	_av_frame_unref
	ldr	x0, [x25, #16]
	mov	x1, x22
	bl	_av_frame_ref
	tbnz	w0, #31, LBB0_14
; %bb.16:
	ldr	x8, [x25, #8]
	ldr	x9, [sp, #8]
	ldr	x10, [x20, #8]
	sub	x9, x9, x10
	lsr	x9, x9, #2
	str	w9, [x20]
	cbnz	x8, LBB0_12
; %bb.17:
	ldr	w8, [x21, #16]
	cbnz	w8, LBB0_13
	b	LBB0_12
LBB0_18:
Lloh12:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh13:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh14:
	ldr	w0, [x8]
	bl	_AVERROR
	b	LBB0_14
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_AV_INPUT_BUFFER_MIN_SIZE,8,3   ; @AV_INPUT_BUFFER_MIN_SIZE
	.comm	_AV_PIX_FMT_PAL8,8,3            ; @AV_PIX_FMT_PAL8
	.comm	_AVPALETTE_SIZE,4,2             ; @AVPALETTE_SIZE
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_AV_PKT_FLAG_KEY,4,2            ; @AV_PKT_FLAG_KEY
	.no_dead_strip	_gif_encode_frame
.subsections_via_symbols
