	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function generate_codebook
_generate_codebook:                     ## @generate_codebook
	.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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%r9d, %r14d
	movq	%r8, %rbx
                                        ## kill: def $ecx killed $ecx def $rcx
	movq	%rcx, -56(%rbp)                 ## 8-byte Spill
	movq	%rdx, -88(%rbp)                 ## 8-byte Spill
	movq	%rsi, -80(%rbp)                 ## 8-byte Spill
	movq	%rdi, -96(%rbp)                 ## 8-byte Spill
	movl	16(%rbp), %r12d
	movl	%r9d, %r13d
	imull	%r9d, %r13d
	movl	%r13d, %r15d
	shrl	$2, %r15d
	leal	(%r15,%r15), %eax
	leal	(%rax,%rax,2), %edi
	leal	(,%r12,4), %esi
	movl	%edi, -60(%rbp)                 ## 4-byte Spill
	callq	_av_malloc_array
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	testq	%rax, %rax
	je	LBB0_17
## %bb.1:
	cmpl	$4, %r14d
	movl	%r14d, -44(%rbp)                ## 4-byte Spill
	jne	LBB0_4
## %bb.2:
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	leal	(,%rax,4), %esi
	movl	-60(%rbp), %edi                 ## 4-byte Reload
	callq	_av_malloc_array
	movq	%rax, %r14
	testq	%rax, %rax
	movq	-96(%rbp), %rax                 ## 8-byte Reload
	movq	-88(%rbp), %rdi                 ## 8-byte Reload
	jne	LBB0_5
## %bb.3:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_AVERROR
	movl	%eax, -56(%rbp)                 ## 4-byte Spill
	xorl	%eax, %eax
	movq	%rax, -80(%rbp)                 ## 8-byte Spill
	movq	-72(%rbp), %r14                 ## 8-byte Reload
	jmp	LBB0_15
LBB0_17:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_AVERROR                        ## TAILCALL
LBB0_4:
	movq	-80(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %r14
	movq	-96(%rbp), %rax                 ## 8-byte Reload
	movq	-88(%rbp), %rdi                 ## 8-byte Reload
LBB0_5:
	movl	-60(%rbp), %esi                 ## 4-byte Reload
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
                                        ## kill: def $edx killed $edx killed $rdx
	movq	-72(%rbp), %rcx                 ## 8-byte Reload
	movl	%r12d, %r8d
	movl	$1, %r9d
	pushq	%rax
	pushq	%r14
	callq	_avpriv_init_elbg
	addq	$16, %rsp
	testl	%eax, %eax
	movq	%r14, -80(%rbp)                 ## 8-byte Spill
	js	LBB0_6
## %bb.7:
	movq	-88(%rbp), %rdi                 ## 8-byte Reload
	movl	-60(%rbp), %esi                 ## 4-byte Reload
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
                                        ## kill: def $edx killed $edx killed $rdx
	movq	-72(%rbp), %rcx                 ## 8-byte Reload
	movl	%r12d, %r8d
	movl	$1, %r9d
	pushq	-96(%rbp)                       ## 8-byte Folded Reload
	pushq	%r14
	callq	_avpriv_do_elbg
	addq	$16, %rsp
	testl	%eax, %eax
	movq	-72(%rbp), %r14                 ## 8-byte Reload
	movl	%eax, -56(%rbp)                 ## 4-byte Spill
	js	LBB0_14
## %bb.8:
	testl	%r12d, %r12d
	jle	LBB0_14
## %bb.9:
	cmpl	$2, %r15d
	movl	$1, %r8d
	cmovael	%r15d, %r8d
	xorl	%r9d, %r9d
	movq	_CHROMA_BIAS@GOTPCREL(%rip), %r10
	movq	%r14, %rcx
	jmp	LBB0_10
	.p2align	4, 0x90
LBB0_13:                                ##   in Loop: Header=BB0_10 Depth=1
	incl	%r9d
	cmpl	%r12d, %r9d
	je	LBB0_14
LBB0_10:                                ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_12 Depth 2
	cmpl	$4, %r13d
	jb	LBB0_13
## %bb.11:                              ##   in Loop: Header=BB0_10 Depth=1
	movl	%r8d, %esi
	.p2align	4, 0x90
LBB0_12:                                ##   Parent Loop BB0_10 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	8(%rbx), %rax
	movl	(%rcx), %edx
	movl	%edx, (%rax)
	movl	4(%rcx), %edx
	movl	%edx, 4(%rax)
	movl	8(%rcx), %edx
	movl	%edx, 8(%rax)
	movl	12(%rcx), %edx
	movl	%edx, 12(%rax)
	movl	(%r10), %edi
	movl	%edi, %eax
	shrl	$31, %eax
	addl	%edi, %eax
	sarl	%eax
	addl	16(%rcx), %eax
	cltd
	idivl	%edi
	movl	%eax, (%rbx)
	movl	(%r10), %edi
	movl	%edi, %eax
	shrl	$31, %eax
	addl	%edi, %eax
	sarl	%eax
	addl	20(%rcx), %eax
	addq	$24, %rcx
	cltd
	idivl	%edi
	movl	%eax, 4(%rbx)
	addq	$16, %rbx
	decl	%esi
	jne	LBB0_12
	jmp	LBB0_13
LBB0_6:
	movl	%eax, -56(%rbp)                 ## 4-byte Spill
	movq	-72(%rbp), %r14                 ## 8-byte Reload
LBB0_14:
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	cmpl	$4, %eax
	jne	LBB0_16
LBB0_15:
	movq	-80(%rbp), %rdi                 ## 8-byte Reload
	callq	_av_free
LBB0_16:
	movq	%r14, %rdi
	callq	_av_free
	movl	-56(%rbp), %eax                 ## 4-byte Reload
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_CHROMA_BIAS,4,2                ## @CHROMA_BIAS
	.no_dead_strip	_generate_codebook
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function generate_codebook
_generate_codebook:                     ; @generate_codebook
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x21, x6
	mov	x19, x5
	mov	x22, x4
	mov	x26, x3
	mov	x25, x2
	mov	x23, x1
	mov	x27, x0
	mul	w24, w5, w5
	lsr	w20, w24, #2
	add	w8, w20, w20, lsl #1
	lsl	w28, w8, #1
	lsl	w1, w6, #2
	mov	x0, x28
	bl	_av_malloc_array
	str	x0, [sp, #8]                    ; 8-byte Folded Spill
	cbz	x0, LBB0_4
; %bb.1:
	cmp	w19, #4
	str	w19, [sp, #4]                   ; 4-byte Folded Spill
	b.ne	LBB0_5
; %bb.2:
	lsl	w1, w26, #2
	mov	x0, x28
	bl	_av_malloc_array
	mov	x23, x0
	cbnz	x0, LBB0_6
; %bb.3:
Lloh0:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	bl	_AVERROR
	mov	x23, x0
	mov	x26, #0
	ldr	x25, [sp, #8]                   ; 8-byte Folded Reload
	b	LBB0_17
LBB0_4:
Lloh3:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh4:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh5:
	ldr	w0, [x8]
	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
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	b	_AVERROR
LBB0_5:
	ldr	x23, [x23]
LBB0_6:
	mov	x0, x25
	mov	x1, x28
	mov	x19, x25
	mov	x2, x26
	ldr	x25, [sp, #8]                   ; 8-byte Folded Reload
	mov	x3, x25
	mov	x4, x21
	mov	w5, #1
	mov	x6, x23
	mov	x7, x27
	bl	_avpriv_init_elbg
	mov	x6, x23
	tbnz	w0, #31, LBB0_15
; %bb.7:
	mov	x0, x19
	mov	x1, x28
	mov	x2, x26
	mov	x3, x25
	mov	x4, x21
	mov	w5, #1
	mov	x26, x6
	mov	x7, x27
	bl	_avpriv_do_elbg
	mov	x23, x0
	tbnz	w0, #31, LBB0_16
; %bb.8:
	cmp	w21, #1
	b.lt	LBB0_16
; %bb.9:
	mov	w8, #0
	cmp	w20, #1
	csinc	w9, w20, wzr, hi
Lloh6:
	adrp	x10, _CHROMA_BIAS@GOTPAGE
Lloh7:
	ldr	x10, [x10, _CHROMA_BIAS@GOTPAGEOFF]
	mov	x11, x25
	b	LBB0_11
LBB0_10:                                ;   in Loop: Header=BB0_11 Depth=1
	add	w8, w8, #1
	cmp	w8, w21
	b.eq	LBB0_16
LBB0_11:                                ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_13 Depth 2
	cmp	w24, #4
	b.lo	LBB0_10
; %bb.12:                               ;   in Loop: Header=BB0_11 Depth=1
	mov	x12, x9
LBB0_13:                                ;   Parent Loop BB0_11 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	x13, [x22, #8]
	ldr	w14, [x11]
	str	w14, [x13]
	ldr	w14, [x11, #4]
	str	w14, [x13, #4]
	ldr	w14, [x11, #8]
	str	w14, [x13, #8]
	ldr	w14, [x11, #12]
	str	w14, [x13, #12]
	ldr	w13, [x11, #16]
	ldr	w14, [x10]
	cmp	w14, #0
	cinc	w15, w14, lt
	add	w13, w13, w15, asr #1
	sdiv	w13, w13, w14
	str	w13, [x22]
	add	x13, x11, #24
	ldr	w11, [x11, #20]
	ldr	w14, [x10]
	cmp	w14, #0
	cinc	w15, w14, lt
	add	w11, w11, w15, asr #1
	sdiv	w11, w11, w14
	str	w11, [x22, #4]
	add	x22, x22, #16
	mov	x11, x13
	subs	w12, w12, #1
	b.ne	LBB0_13
; %bb.14:                               ;   in Loop: Header=BB0_11 Depth=1
	mov	x11, x13
	b	LBB0_10
LBB0_15:
	mov	x23, x0
	mov	x26, x6
LBB0_16:
	ldr	w19, [sp, #4]                   ; 4-byte Folded Reload
	cmp	w19, #4
	b.ne	LBB0_18
LBB0_17:
	mov	x0, x26
	bl	_av_free
LBB0_18:
	mov	x0, x25
	bl	_av_free
	mov	x0, x23
	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
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_CHROMA_BIAS,4,2                ; @CHROMA_BIAS
	.no_dead_strip	_generate_codebook
.subsections_via_symbols
