	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function vp6_build_huff_tree
_vp6_build_huff_tree:                   ## @vp6_build_huff_tree
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%r8, %r14
	movl	%ecx, %r12d
	movq	%rdx, %r13
	movq	%rsi, %r15
	movq	%rdi, -56(%rbp)                 ## 8-byte Spill
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	_VP6_MAX_HUFF_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	addl	%eax, %eax
	shlq	$2, %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %rbx
	movl	%r12d, %ecx
	movl	$256, (%rbx,%rcx,4)             ## imm = 0x100
	movl	%r12d, %eax
	decl	%eax
	je	LBB0_4
## %bb.1:
	movl	%eax, %r9d
	leaq	(%rbx,%rcx,4), %r8
	addq	$4, %r8
	decq	%r9
	movl	$256, %esi                      ## imm = 0x100
	xorl	%edx, %edx
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r15,%rdx,4), %edi
	movl	$255, %ecx
	subl	%edi, %ecx
	imull	%esi, %edi
	movl	%edi, %eax
	sarl	$8, %eax
	imull	%esi, %ecx
	movl	%ecx, %esi
	sarl	$8, %esi
	cmpl	$256, %edi                      ## imm = 0x100
	adcl	$0, %eax
	movslq	(%r13,%rdx,8), %rdi
	cmpl	$256, %ecx                      ## imm = 0x100
	adcl	$0, %esi
	movl	%eax, (%rbx,%rdi,4)
	movslq	4(%r13,%rdx,8), %rax
	movl	%esi, (%rbx,%rax,4)
	cmpq	%rdx, %r9
	je	LBB0_4
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	(%r8,%rdx,4), %esi
	incq	%rdx
	jmp	LBB0_2
LBB0_4:
	movq	%r14, %rdi
	callq	_ff_free_vlc
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %edi
	movq	_FF_HUFFMAN_BITS@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	_vp6_huff_cmp@GOTPCREL(%rip), %rax
	movl	(%rax), %r9d
	movq	_FF_HUFFMAN_FLAG_HNODE_FIRST@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	subq	$8, %rsp
	movq	%r14, %rsi
	movl	%r12d, %edx
	movq	%rbx, %r8
	pushq	%rax
	callq	_ff_huff_build_tree
	addq	$16, %rsp
	movq	___stack_chk_guard@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	-48(%rbp), %rcx
	jne	LBB0_6
## %bb.5:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_6:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_VP6_MAX_HUFF_SIZE,4,2          ## @VP6_MAX_HUFF_SIZE
	.comm	_FF_HUFFMAN_BITS,4,2            ## @FF_HUFFMAN_BITS
	.comm	_vp6_huff_cmp,4,2               ## @vp6_huff_cmp
	.comm	_FF_HUFFMAN_FLAG_HNODE_FIRST,4,2 ## @FF_HUFFMAN_FLAG_HNODE_FIRST
	.no_dead_strip	_vp6_build_huff_tree
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function vp6_build_huff_tree
_vp6_build_huff_tree:                   ; @vp6_build_huff_tree
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	sub	sp, sp, #16
	mov	x20, x4
	mov	x19, x3
	mov	x21, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-40]
Lloh3:
	adrp	x8, _VP6_MAX_HUFF_SIZE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _VP6_MAX_HUFF_SIZE@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	lsl	w8, w8, #1
	lsl	x8, x8, #2
	mov	x9, x8
Lloh6:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh7:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x9, sp
	add	x8, x8, #15
	and	x8, x8, #0x7fffffff0
	sub	x22, x9, x8
	mov	sp, x22
	mov	w8, #256
	str	w8, [x22, w3, uxtw #2]
	subs	w10, w3, #1
	b.eq	LBB0_4
; %bb.1:
	mov	w8, w19
	add	x9, x22, x8, lsl #2
	add	x8, x2, #4
	add	x9, x9, #4
	sub	x10, x10, #1
	mov	w12, #256
	mov	w11, #255
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w13, [x1]
	mul	w14, w13, w12
	asr	w15, w14, #8
	sub	w13, w11, w13
	mul	w12, w13, w12
	cmp	w14, #256
	cinc	w13, w15, lo
	ldursw	x14, [x8, #-4]
	str	w13, [x22, x14, lsl #2]
	asr	w13, w12, #8
	cmp	w12, #256
	cinc	w12, w13, lo
	ldrsw	x13, [x8]
	str	w12, [x22, x13, lsl #2]
	cbz	x10, LBB0_4
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	ldr	w12, [x9], #4
	add	x1, x1, #4
	add	x8, x8, #8
	sub	x10, x10, #1
	b	LBB0_2
LBB0_4:
	mov	x0, x20
	bl	_ff_free_vlc
	ldr	w0, [x21]
Lloh8:
	adrp	x8, _FF_HUFFMAN_BITS@GOTPAGE
Lloh9:
	ldr	x8, [x8, _FF_HUFFMAN_BITS@GOTPAGEOFF]
Lloh10:
	ldr	w3, [x8]
Lloh11:
	adrp	x8, _vp6_huff_cmp@GOTPAGE
Lloh12:
	ldr	x8, [x8, _vp6_huff_cmp@GOTPAGEOFF]
Lloh13:
	ldr	w5, [x8]
Lloh14:
	adrp	x8, _FF_HUFFMAN_FLAG_HNODE_FIRST@GOTPAGE
Lloh15:
	ldr	x8, [x8, _FF_HUFFMAN_FLAG_HNODE_FIRST@GOTPAGEOFF]
Lloh16:
	ldr	w6, [x8]
	mov	x1, x20
	mov	x2, x19
	mov	x4, x22
	bl	_ff_huff_build_tree
	ldur	x8, [x29, #-40]
Lloh17:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh18:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh19:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_6
; %bb.5:
	sub	sp, x29, #32
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
LBB0_6:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_VP6_MAX_HUFF_SIZE,4,2          ; @VP6_MAX_HUFF_SIZE
	.comm	_FF_HUFFMAN_BITS,4,2            ; @FF_HUFFMAN_BITS
	.comm	_vp6_huff_cmp,4,2               ; @vp6_huff_cmp
	.comm	_FF_HUFFMAN_FLAG_HNODE_FIRST,4,2 ; @FF_HUFFMAN_FLAG_HNODE_FIRST
	.no_dead_strip	_vp6_build_huff_tree
.subsections_via_symbols
