	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function huff_reader_build_canonical
_huff_reader_build_canonical:           ## @huff_reader_build_canonical
	.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
	testl	%edx, %edx
	jle	LBB0_12
## %bb.1:
	movq	%rsi, %r15
	movq	%rdi, %r14
	movl	%edx, %ecx
	xorl	%eax, %eax
	xorl	%edi, %edi
	xorl	%esi, %esi
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_4:                                 ##   in Loop: Header=BB0_2 Depth=1
	movl	$1, %edi
	movl	%eax, %esi
LBB0_5:                                 ##   in Loop: Header=BB0_2 Depth=1
	incq	%rax
	cmpq	%rax, %rcx
	je	LBB0_6
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	cmpl	$0, (%r15,%rax,4)
	jle	LBB0_5
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	testl	%edi, %edi
	jle	LBB0_4
	jmp	LBB0_8
LBB0_6:
	cmpl	$1, %edi
	jne	LBB0_8
## %bb.7:
	movl	$1, (%r14)
	movq	8(%r14), %rax
	movl	%esi, (%rax)
	movl	$1, 16(%r14)
	jmp	LBB0_33
LBB0_8:
	movl	%edx, -44(%rbp)                 ## 4-byte Spill
	xorl	%ebx, %ebx
	xorl	%r13d, %r13d
	.p2align	4, 0x90
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r15,%rbx,4), %esi
	movl	%r13d, %edi
	movq	%rcx, %r12
	callq	_FFMAX
	movq	%r12, %rcx
	movl	%eax, %r13d
	incq	%rbx
	cmpq	%rbx, %r12
	jne	LBB0_9
## %bb.10:
	testl	%r13d, %r13d
	movl	-44(%rbp), %edi                 ## 4-byte Reload
	je	LBB0_12
## %bb.11:
	movq	_MAX_HUFFMAN_CODE_LENGTH@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r13d
	jg	LBB0_12
## %bb.14:
	movl	$4, %esi
	callq	_av_malloc_array
	testq	%rax, %rax
	je	LBB0_15
## %bb.16:
	movq	%rax, %rbx
	movl	$0, (%r14)
	testl	%r13d, %r13d
	jle	LBB0_29
## %bb.17:
	movl	%r12d, %eax
	andl	$-2, %eax
	movl	$1, %ecx
	xorl	%esi, %esi
	xorl	%edx, %edx
	jmp	LBB0_18
	.p2align	4, 0x90
LBB0_27:                                ##   in Loop: Header=BB0_18 Depth=1
	addl	%edx, %edx
	leal	1(%rcx), %edi
	cmpl	%r13d, %ecx
	movl	%edi, %ecx
	je	LBB0_28
LBB0_18:                                ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_19 Depth 2
	xorl	%edi, %edi
	cmpl	$1, %r12d
	jne	LBB0_19
LBB0_24:                                ##   in Loop: Header=BB0_18 Depth=1
	testb	$1, %r12b
	je	LBB0_27
## %bb.25:                              ##   in Loop: Header=BB0_18 Depth=1
	cmpl	%ecx, (%r15,%rdi,4)
	jne	LBB0_27
## %bb.26:                              ##   in Loop: Header=BB0_18 Depth=1
	movl	%edx, (%rbx,%rdi,4)
	incl	%edx
	movl	(%r14), %esi
	incl	%esi
	movl	%esi, (%r14)
	jmp	LBB0_27
	.p2align	4, 0x90
LBB0_23:                                ##   in Loop: Header=BB0_19 Depth=2
	addq	$2, %rdi
	cmpq	%rdi, %rax
	je	LBB0_24
LBB0_19:                                ##   Parent Loop BB0_18 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	cmpl	%ecx, (%r15,%rdi,4)
	jne	LBB0_21
## %bb.20:                              ##   in Loop: Header=BB0_19 Depth=2
	movl	%edx, (%rbx,%rdi,4)
	incl	%edx
	movl	(%r14), %esi
	incl	%esi
	movl	%esi, (%r14)
LBB0_21:                                ##   in Loop: Header=BB0_19 Depth=2
	cmpl	%ecx, 4(%r15,%rdi,4)
	jne	LBB0_23
## %bb.22:                              ##   in Loop: Header=BB0_19 Depth=2
	movl	%edx, 4(%rbx,%rdi,4)
	incl	%edx
	movl	(%r14), %esi
	incl	%esi
	movl	%esi, (%r14)
	jmp	LBB0_23
LBB0_12:
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_13:
	movl	(%rax), %edi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_AVERROR                        ## TAILCALL
LBB0_28:
	testl	%esi, %esi
	je	LBB0_29
## %bb.30:
	leaq	20(%r14), %rdi
	movl	$8, %esi
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	movq	%r15, %rcx
	movl	$4, %r8d
	movl	$4, %r9d
	pushq	$0
	pushq	$4
	pushq	$4
	pushq	%rbx
	callq	_init_vlc
	addq	$32, %rsp
	testl	%eax, %eax
	js	LBB0_31
## %bb.32:
	movl	$0, 16(%r14)
	movq	%rbx, %rdi
	callq	_av_free
LBB0_33:
	xorl	%r15d, %r15d
	jmp	LBB0_34
LBB0_29:
	movq	%rbx, %rdi
	callq	_av_free
	movq	_AVERROR_INVALIDDATA@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
LBB0_34:
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_15:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	jmp	LBB0_13
LBB0_31:
	movl	%eax, %r15d
	movq	%rbx, %rdi
	callq	_av_free
	jmp	LBB0_34
	.cfi_endproc
                                        ## -- End function
	.comm	_MAX_HUFFMAN_CODE_LENGTH,4,2    ## @MAX_HUFFMAN_CODE_LENGTH
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_AVERROR_INVALIDDATA,4,2        ## @AVERROR_INVALIDDATA
	.no_dead_strip	_huff_reader_build_canonical
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function huff_reader_build_canonical
_huff_reader_build_canonical:           ; @huff_reader_build_canonical
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	cmp	w2, #1
	b.lt	LBB0_11
; %bb.1:
	mov	x21, x2
	mov	x20, x1
	mov	x19, x0
	mov	x8, #0
	mov	w10, #0
	mov	w9, #0
	mov	w22, w2
	b	LBB0_4
LBB0_2:                                 ;   in Loop: Header=BB0_4 Depth=1
	mov	w10, #1
	mov	x9, x8
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	add	x8, x8, #1
	cmp	x22, x8
	b.eq	LBB0_6
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w11, [x20, x8, lsl #2]
	cmp	w11, #1
	b.lt	LBB0_3
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	cmp	w10, #0
	b.le	LBB0_2
	b	LBB0_8
LBB0_6:
	cmp	w10, #1
	b.ne	LBB0_8
; %bb.7:
	mov	w20, #0
	mov	w8, #1
	str	w8, [x19]
	ldr	x10, [x19, #8]
	str	w9, [x10]
	str	w8, [x19, #16]
	b	LBB0_27
LBB0_8:
	mov	x23, #0
	mov	w24, #0
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w1, [x20, x23, lsl #2]
	mov	x0, x24
	bl	_FFMAX
	mov	x24, x0
	add	x23, x23, #1
	cmp	x22, x23
	b.ne	LBB0_9
; %bb.10:
Lloh0:
	adrp	x8, _MAX_HUFFMAN_CODE_LENGTH@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MAX_HUFFMAN_CODE_LENGTH@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w24, #0
	ccmp	w24, w8, #0, ne
	b.le	LBB0_13
LBB0_11:
Lloh3:
	adrp	x8, _EINVAL@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_12:
	ldr	w0, [x8]
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	b	_AVERROR
LBB0_13:
	mov	x0, x22
	mov	w1, #4
	bl	_av_malloc_array
	cbz	x0, LBB0_25
; %bb.14:
	mov	x23, x0
	str	wzr, [x19]
	cmp	w24, #1
	b.lt	LBB0_24
; %bb.15:
	mov	w9, #0
	mov	w10, #0
	mov	w8, #1
	b	LBB0_17
LBB0_16:                                ;   in Loop: Header=BB0_17 Depth=1
	lsl	w10, w10, #1
	add	w11, w8, #1
	cmp	w8, w24
	mov	x8, x11
	b.eq	LBB0_21
LBB0_17:                                ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_19 Depth 2
	mov	x11, #0
	b	LBB0_19
LBB0_18:                                ;   in Loop: Header=BB0_19 Depth=2
	add	x11, x11, #1
	cmp	x22, x11
	b.eq	LBB0_16
LBB0_19:                                ;   Parent Loop BB0_17 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	w12, [x20, x11, lsl #2]
	cmp	w12, w8
	b.ne	LBB0_18
; %bb.20:                               ;   in Loop: Header=BB0_19 Depth=2
	str	w10, [x23, x11, lsl #2]
	add	w10, w10, #1
	ldr	w9, [x19]
	add	w9, w9, #1
	str	w9, [x19]
	b	LBB0_18
LBB0_21:
	cbz	w9, LBB0_24
; %bb.22:
	add	x0, x19, #20
	mov	w8, #4
	str	x8, [sp]
	mov	w1, #8
	mov	x2, x21
	mov	x3, x20
	mov	w4, #4
	mov	w5, #4
	mov	x6, x23
	mov	w7, #4
	bl	_init_vlc
	tbnz	w0, #31, LBB0_26
; %bb.23:
	str	wzr, [x19, #16]
	mov	x0, x23
	bl	_av_free
	mov	w20, #0
	b	LBB0_27
LBB0_24:
	mov	x0, x23
	bl	_av_free
Lloh5:
	adrp	x8, _AVERROR_INVALIDDATA@GOTPAGE
Lloh6:
	ldr	x8, [x8, _AVERROR_INVALIDDATA@GOTPAGEOFF]
Lloh7:
	ldr	w20, [x8]
	b	LBB0_27
LBB0_25:
Lloh8:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh9:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
	b	LBB0_12
LBB0_26:
	mov	x20, x0
	mov	x0, x23
	bl	_av_free
LBB0_27:
	mov	x0, x20
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_MAX_HUFFMAN_CODE_LENGTH,4,2    ; @MAX_HUFFMAN_CODE_LENGTH
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_AVERROR_INVALIDDATA,4,2        ; @AVERROR_INVALIDDATA
	.no_dead_strip	_huff_reader_build_canonical
.subsections_via_symbols
