	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function reconfigure_at_keyframe
_reconfigure_at_keyframe:               ## @reconfigure_at_keyframe
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %r14d
	movq	%rsi, %r15
	movq	%rdi, %rbx
	callq	_optimum_block_width
	movl	%eax, %r12d
	movq	%rbx, %rdi
	callq	_optimum_block_height
	movl	%eax, %r13d
	movl	4(%rbx), %eax
	movl	12(%rbx), %esi
	addl	%r13d, %eax
	decl	%eax
	cltd
	idivl	%r13d
	movl	%eax, %ecx
	movl	%eax, (%rbx)
	leal	(%r12,%rsi), %eax
	decl	%eax
	cltd
	idivl	%r12d
	movl	%eax, 8(%rbx)
	cmpl	16(%rbx), %r12d
	jne	LBB0_2
## %bb.1:
	cmpl	20(%rbx), %r13d
	je	LBB0_8
LBB0_2:
	movl	%r12d, 16(%rbx)
	movl	%r13d, 20(%rbx)
	movl	%eax, %edx
	imull	%ecx, %edx
	movslq	%edx, %rdx
	movslq	24(%rbx), %rdi
	shrq	$2, %rdi
	movq	88(%rbx), %rsi
	cmpq	%rdx, %rdi
	jae	LBB0_7
## %bb.3:
	shll	$2, %eax
	movq	%rsi, %rdi
	movl	%ecx, %esi
	movl	%eax, %edx
	callq	_av_realloc_array
	movq	%rax, 88(%rbx)
	movq	72(%rbx), %rdi
	movl	(%rbx), %edx
	movl	8(%rbx), %esi
	shll	$2, %edx
	callq	_av_realloc_array
	movq	%rax, 72(%rbx)
	movq	88(%rbx), %rsi
	testq	%rsi, %rsi
	je	LBB0_5
## %bb.4:
	testq	%rax, %rax
	je	LBB0_5
## %bb.6:
	movl	(%rbx), %eax
	imull	8(%rbx), %eax
	shll	$2, %eax
	movl	%eax, 24(%rbx)
LBB0_7:
	movl	80(%rbx), %ecx
	movl	84(%rbx), %edx
	movq	%rbx, %rdi
	callq	_init_blocks
	movq	72(%rbx), %rsi
	movl	64(%rbx), %edx
	movq	%rbx, %rdi
	xorl	%ecx, %ecx
	callq	_init_blocks
	leaq	56(%rbx), %rdi
	leaq	60(%rbx), %rsi
	imull	%r13d, %r12d
	addl	%r12d, %r12d
	leal	(%r12,%r12,2), %edx
	callq	_av_fast_malloc
	cmpl	$0, 56(%rbx)
	je	LBB0_19
LBB0_8:
	movq	%rbx, %rdi
	callq	_optimum_use15_7
	movq	%rax, 48(%rbx)
	testq	%rax, %rax
	je	LBB0_17
## %bb.9:
	cmpq	$0, 40(%rbx)
	movl	28(%rbx), %eax
	je	LBB0_13
## %bb.10:
	cmpl	$1, %eax
	je	LBB0_17
## %bb.11:
	leaq	36(%rbx), %rdi
	movl	4(%rbx), %ecx
	movl	12(%rbx), %edx
	movq	%r15, %rsi
	movl	%r14d, %r8d
	callq	_generate_optimum_palette
	testl	%eax, %eax
	jne	LBB0_18
## %bb.12:
	leaq	L_.str.2(%rip), %rdx
	movl	$1, %eax
	jmp	LBB0_16
LBB0_19:
	movl	32(%rbx), %edi
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.1(%rip), %rdx
	callq	_av_log
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_AVERROR                        ## TAILCALL
LBB0_5:
	movl	32(%rbx), %edi
	movq	_AV_LOG_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdx
	callq	_av_log
	movl	$-1, %eax
	jmp	LBB0_18
LBB0_13:
	testl	%eax, %eax
	je	LBB0_17
## %bb.14:
	leaq	36(%rbx), %rdi
	callq	_generate_default_palette
	testl	%eax, %eax
	jne	LBB0_18
## %bb.15:
	leaq	L_.str.3(%rip), %rdx
	xorl	%eax, %eax
LBB0_16:
	movl	%eax, 28(%rbx)
	movl	32(%rbx), %edi
	movq	_AV_LOG_DEBUG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_av_log
LBB0_17:
	movq	%rbx, %rdi
	callq	_reset_stats
	xorl	%eax, %eax
LBB0_18:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_AV_LOG_ERROR,4,2               ## @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Memory allocation failed.\n"

L_.str.1:                               ## @.str.1
	.asciz	"Could not allocate block buffer.\n"

	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_AV_LOG_DEBUG,4,2               ## @AV_LOG_DEBUG
L_.str.2:                               ## @.str.2
	.asciz	"Generated optimum palette\n"

L_.str.3:                               ## @.str.3
	.asciz	"Generated default palette\n"

	.no_dead_strip	_reconfigure_at_keyframe
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function reconfigure_at_keyframe
_reconfigure_at_keyframe:               ; @reconfigure_at_keyframe
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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	x20, x2
	mov	x21, x1
	mov	x19, x0
	bl	_optimum_block_width
	mov	x22, x0
	mov	x0, x19
	bl	_optimum_block_height
	mov	x23, x0
	ldr	w8, [x19, #4]
	add	w8, w0, w8
	sub	w8, w8, #1
	sdiv	w1, w8, w0
	str	w1, [x19]
	ldp	w8, w10, [x19, #12]
	add	w8, w22, w8
	sub	w8, w8, #1
	sdiv	w9, w8, w22
	str	w9, [x19, #8]
	cmp	w22, w10
	b.ne	LBB0_2
; %bb.1:
	ldr	w8, [x19, #20]
	cmp	w23, w8
	b.eq	LBB0_7
LBB0_2:
	stp	w22, w23, [x19, #16]
	mul	w8, w9, w1
	sxtw	x10, w8
	ldrsw	x11, [x19, #24]
	ldr	x8, [x19, #88]
	cmp	x10, x11, lsr #2
	b.ls	LBB0_6
; %bb.3:
	lsl	w2, w9, #2
	mov	x0, x8
	bl	_av_realloc_array
	str	x0, [x19, #88]
	ldr	x0, [x19, #72]
	ldr	w1, [x19, #8]
	ldr	w8, [x19]
	lsl	w2, w8, #2
	bl	_av_realloc_array
	str	x0, [x19, #72]
	ldr	x8, [x19, #88]
	cbz	x8, LBB0_13
; %bb.4:
	cbz	x0, LBB0_13
; %bb.5:
	ldr	w9, [x19]
	ldr	w10, [x19, #8]
	mul	w9, w9, w10
	lsl	w9, w9, #2
	str	w9, [x19, #24]
LBB0_6:
	ldp	w3, w2, [x19, #80]
	mov	x0, x19
	mov	x1, x8
	bl	_init_blocks
	ldr	x1, [x19, #72]
	ldr	w2, [x19, #64]
	mov	x0, x19
	mov	w3, #0
	bl	_init_blocks
	add	x0, x19, #56
	add	x1, x19, #60
	mul	w8, w22, w23
	add	w8, w8, w8, lsl #1
	lsl	w2, w8, #1
	bl	_av_fast_malloc
	ldr	w8, [x19, #56]
	cbz	w8, LBB0_12
LBB0_7:
	mov	x0, x19
	bl	_optimum_use15_7
	str	x0, [x19, #48]
	cbz	x0, LBB0_18
; %bb.8:
	ldr	x9, [x19, #40]
	ldr	w8, [x19, #28]
	cbz	x9, LBB0_14
; %bb.9:
	cmp	w8, #1
	b.eq	LBB0_18
; %bb.10:
	add	x0, x19, #36
	ldr	w2, [x19, #12]
	ldr	w3, [x19, #4]
	mov	x1, x21
	mov	x4, x20
	bl	_generate_optimum_palette
	cbnz	w0, LBB0_19
; %bb.11:
Lloh0:
	adrp	x2, l_.str.2@PAGE
Lloh1:
	add	x2, x2, l_.str.2@PAGEOFF
	mov	w8, #1
	b	LBB0_17
LBB0_12:
	ldr	w0, [x19, #32]
Lloh2:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh3:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh4:
	ldr	w1, [x8]
Lloh5:
	adrp	x2, l_.str.1@PAGE
Lloh6:
	add	x2, x2, l_.str.1@PAGEOFF
	bl	_av_log
Lloh7:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh8:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh9:
	ldr	w0, [x8]
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	b	_AVERROR
LBB0_13:
	ldr	w0, [x19, #32]
Lloh10:
	adrp	x8, _AV_LOG_ERROR@GOTPAGE
Lloh11:
	ldr	x8, [x8, _AV_LOG_ERROR@GOTPAGEOFF]
Lloh12:
	ldr	w1, [x8]
Lloh13:
	adrp	x2, l_.str@PAGE
Lloh14:
	add	x2, x2, l_.str@PAGEOFF
	bl	_av_log
	mov	w0, #-1
	b	LBB0_19
LBB0_14:
	cbz	w8, LBB0_18
; %bb.15:
	add	x0, x19, #36
	bl	_generate_default_palette
	cbnz	w0, LBB0_19
; %bb.16:
	mov	w8, #0
Lloh15:
	adrp	x2, l_.str.3@PAGE
Lloh16:
	add	x2, x2, l_.str.3@PAGEOFF
LBB0_17:
	str	w8, [x19, #28]
	ldr	w0, [x19, #32]
Lloh17:
	adrp	x8, _AV_LOG_DEBUG@GOTPAGE
Lloh18:
	ldr	x8, [x8, _AV_LOG_DEBUG@GOTPAGEOFF]
Lloh19:
	ldr	w1, [x8]
	bl	_av_log
LBB0_18:
	mov	x0, x19
	bl	_reset_stats
	mov	w0, #0
LBB0_19:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.comm	_AV_LOG_ERROR,4,2               ; @AV_LOG_ERROR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Memory allocation failed.\n"

l_.str.1:                               ; @.str.1
	.asciz	"Could not allocate block buffer.\n"

	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_AV_LOG_DEBUG,4,2               ; @AV_LOG_DEBUG
l_.str.2:                               ; @.str.2
	.asciz	"Generated optimum palette\n"

l_.str.3:                               ; @.str.3
	.asciz	"Generated default palette\n"

	.no_dead_strip	_reconfigure_at_keyframe
.subsections_via_symbols
