	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_canonical_huffman              ## -- Begin function canonical_huffman
	.p2align	4, 0x90
_canonical_huffman:                     ## @canonical_huffman
	.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
	movq	%r9, -80(%rbp)                  ## 8-byte Spill
	movq	%r8, -96(%rbp)                  ## 8-byte Spill
	movq	%rcx, %r15
	movl	%edx, %r12d
	movl	%esi, -52(%rbp)                 ## 4-byte Spill
	movq	%rdi, %rbx
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	_HUFFMAN_MAX_CODE_LENGTH@GOTPCREL(%rip), %rax
	movl	(%rax), %r13d
	incl	%r13d
	shlq	$2, %r13
	movq	%r13, %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %r14
	movq	%r13, %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %r13
	leaq	4(%r14), %rdi
	movq	%r12, -88(%rbp)                 ## 8-byte Spill
	movslq	%r12d, %rax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	leal	(,%rax,4), %edx
	xorl	%esi, %esi
	movl	%edx, -68(%rbp)                 ## 4-byte Spill
	callq	_memset
	movl	-52(%rbp), %eax                 ## 4-byte Reload
	movl	%eax, %r12d
	testl	%eax, %eax
	jle	LBB0_8
## %bb.1:
	leaq	-1(%r12), %rcx
	movl	%r12d, %eax
	andl	$3, %eax
	cmpq	$3, %rcx
	jae	LBB0_3
## %bb.2:
	xorl	%ecx, %ecx
	jmp	LBB0_5
LBB0_3:
	movl	%r12d, %edx
	andl	$-4, %edx
	xorl	%ecx, %ecx
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movslq	(%rbx,%rcx,4), %rsi
	incl	(%r14,%rsi,4)
	movslq	4(%rbx,%rcx,4), %rsi
	incl	(%r14,%rsi,4)
	movslq	8(%rbx,%rcx,4), %rsi
	incl	(%r14,%rsi,4)
	movslq	12(%rbx,%rcx,4), %rsi
	incl	(%r14,%rsi,4)
	addq	$4, %rcx
	cmpq	%rcx, %rdx
	jne	LBB0_4
LBB0_5:
	testq	%rax, %rax
	je	LBB0_8
## %bb.6:
	leaq	(%rbx,%rcx,4), %rcx
	xorl	%edx, %edx
	.p2align	4, 0x90
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movslq	(%rcx,%rdx,4), %rsi
	incl	(%r14,%rsi,4)
	incq	%rdx
	cmpq	%rdx, %rax
	jne	LBB0_7
LBB0_8:
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movl	$0, (%r15,%rax,4)
	cmpl	$2, %eax
	jl	LBB0_24
## %bb.9:
	movq	-88(%rbp), %rsi                 ## 8-byte Reload
	movl	%esi, %r9d
	xorl	%r10d, %r10d
	movq	%r9, %rax
	subq	$2, %rax
	cmovaeq	%rax, %r10
	incq	%r10
	cmpq	$8, %r10
	jb	LBB0_21
## %bb.11:
	xorl	%eax, %eax
	movq	%r9, %rcx
	subq	$2, %rcx
	cmovaeq	%rcx, %rax
	decl	%esi
	cmpl	%eax, %esi
	jb	LBB0_21
## %bb.12:
	leaq	(%r15,%rsi,4), %rcx
	shlq	$2, %rax
	movq	%rcx, %rdx
	subq	%rax, %rdx
	cmpq	%rcx, %rdx
	ja	LBB0_21
## %bb.13:
	leaq	(%r15,%r9,4), %rcx
	movq	%rcx, %rdx
	subq	%rax, %rdx
	cmpq	%rcx, %rdx
	ja	LBB0_21
## %bb.14:
	leaq	(%r15,%rsi,4), %rax
	subq	%rax, %rcx
	cmpq	$32, %rcx
	jae	LBB0_17
LBB0_21:
	movq	%r9, %rcx
LBB0_22:
	incq	%rcx
	.p2align	4, 0x90
LBB0_23:                                ## =>This Inner Loop Header: Depth=1
	leal	-2(%rcx), %eax
	movl	-4(%r14,%rcx,4), %edx
	addl	-4(%r15,%rcx,4), %edx
	sarl	%edx
	movl	%edx, (%r15,%rax,4)
	decq	%rcx
	cmpq	$2, %rcx
	ja	LBB0_23
LBB0_24:
	movq	%r13, %rdi
	addq	$4, %rdi
	leaq	4(%r15), %rsi
	movl	-68(%rbp), %edx                 ## 4-byte Reload
	callq	_memcpy
	xorl	%edi, %edi
	movq	-96(%rbp), %r14                 ## 8-byte Reload
	testq	%r14, %r14
	setne	%dil
	callq	_unlikely
	testq	%rax, %rax
	je	LBB0_30
## %bb.25:
	cmpl	$0, -52(%rbp)                   ## 4-byte Folded Reload
	movq	-80(%rbp), %r8                  ## 8-byte Reload
	movq	_HUFFMAN_MAX_CODE_LENGTH@GOTPCREL(%rip), %r9
	jle	LBB0_35
## %bb.26:
	xorl	%eax, %eax
	jmp	LBB0_28
	.p2align	4, 0x90
LBB0_27:                                ##   in Loop: Header=BB0_28 Depth=1
	incq	%rax
	cmpq	%rax, %r12
	je	LBB0_35
LBB0_28:                                ## =>This Inner Loop Header: Depth=1
	movslq	(%rbx,%rax,4), %rcx
	testq	%rcx, %rcx
	je	LBB0_27
## %bb.29:                              ##   in Loop: Header=BB0_28 Depth=1
	movl	(%r13,%rcx,4), %edx
	movl	%edx, (%r14,%rax,4)
	movl	(%r9), %esi
	incl	%esi
	leal	1(%rdx), %edi
	movl	%edi, (%r13,%rcx,4)
	subl	(%r15,%rcx,4), %edx
	imull	%esi, %edx
	addl	%ecx, %edx
	movslq	%edx, %rcx
	movl	%eax, (%r8,%rcx,4)
	jmp	LBB0_27
LBB0_30:
	cmpl	$0, -52(%rbp)                   ## 4-byte Folded Reload
	movq	-80(%rbp), %r8                  ## 8-byte Reload
	movq	_HUFFMAN_MAX_CODE_LENGTH@GOTPCREL(%rip), %r9
	jle	LBB0_35
## %bb.31:
	xorl	%eax, %eax
	jmp	LBB0_33
	.p2align	4, 0x90
LBB0_32:                                ##   in Loop: Header=BB0_33 Depth=1
	incq	%rax
	cmpq	%rax, %r12
	je	LBB0_35
LBB0_33:                                ## =>This Inner Loop Header: Depth=1
	movslq	(%rbx,%rax,4), %rcx
	testq	%rcx, %rcx
	je	LBB0_32
## %bb.34:                              ##   in Loop: Header=BB0_33 Depth=1
	movl	(%r9), %edx
	incl	%edx
	movl	(%r13,%rcx,4), %esi
	leal	1(%rsi), %edi
	movl	%edi, (%r13,%rcx,4)
	subl	(%r15,%rcx,4), %esi
	imull	%edx, %esi
	addl	%ecx, %esi
	movslq	%esi, %rcx
	movl	%eax, (%r8,%rcx,4)
	jmp	LBB0_32
LBB0_35:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_37
## %bb.36:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_17:
	movq	%r10, %r11
	andq	$-8, %r11
	movq	%r9, %rcx
	subq	%r11, %rcx
	movq	%r11, -64(%rbp)                 ## 8-byte Spill
	negq	%r11
	movl	$4294967295, %r8d               ## imm = 0xFFFFFFFF
	addq	%r9, %r8
	leaq	(%r15,%r9,4), %rdx
	addq	$-12, %rdx
	leaq	(%r14,%r9,4), %rax
	addq	$-12, %rax
	xorl	%edi, %edi
	.p2align	4, 0x90
LBB0_18:                                ## =>This Inner Loop Header: Depth=1
	leal	(%r8,%rdi), %esi
	movdqu	-16(%rdx,%rdi,4), %xmm0
	movdqu	(%rdx,%rdi,4), %xmm1
	movdqu	-16(%rax,%rdi,4), %xmm2
	paddd	%xmm0, %xmm2
	movdqu	(%rax,%rdi,4), %xmm0
	paddd	%xmm1, %xmm0
	psrad	$1, %xmm0
	psrad	$1, %xmm2
	movdqu	%xmm0, -12(%r15,%rsi,4)
	movdqu	%xmm2, -28(%r15,%rsi,4)
	addq	$-8, %rdi
	cmpq	%rdi, %r11
	jne	LBB0_18
## %bb.19:
	cmpq	-64(%rbp), %r10                 ## 8-byte Folded Reload
	jne	LBB0_22
	jmp	LBB0_24
LBB0_37:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_HUFFMAN_MAX_CODE_LENGTH,4,2    ## @HUFFMAN_MAX_CODE_LENGTH
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_canonical_huffman              ; -- Begin function canonical_huffman
	.p2align	2
_canonical_huffman:                     ; @canonical_huffman
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	sub	sp, sp, #16
	mov	x19, x5
	mov	x22, x4
	mov	x20, x3
	mov	x25, x2
	mov	x26, x1
	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, #-88]
Lloh3:
	adrp	x8, _HUFFMAN_MAX_CODE_LENGTH@GOTPAGE
Lloh4:
	ldr	x8, [x8, _HUFFMAN_MAX_CODE_LENGTH@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	add	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	x10, x8, #15
	and	x12, x10, #0x7fffffff0
	sub	x24, x9, x12
	mov	sp, x24
	mov	x9, x8
Lloh8:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh9:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x8, sp
	sub	x27, x8, x12
	mov	sp, x27
	add	x0, x24, #4
	sxtw	x23, w25
	lsl	w2, w2, #2
	mov	w1, #0
	stur	w2, [x29, #-96]                 ; 4-byte Folded Spill
	bl	_memset
	mov	w28, w26
	stur	w26, [x29, #-92]                ; 4-byte Folded Spill
	cmp	w26, #1
	b.lt	LBB0_3
; %bb.1:
	mov	x8, x28
	mov	x9, x21
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldrsw	x10, [x9], #4
	lsl	x10, x10, #2
	ldr	w11, [x24, x10]
	add	w11, w11, #1
	str	w11, [x24, x10]
	subs	x8, x8, #1
	b.ne	LBB0_2
LBB0_3:
	str	wzr, [x20, x23, lsl #2]
	subs	w8, w25, #1
	b.le	LBB0_18
; %bb.4:
	mov	w12, w25
	subs	x9, x12, #2
	csel	x9, xzr, x9, lo
	add	x9, x9, #1
	cmp	x9, #16
	b.hs	LBB0_6
; %bb.5:
	mov	x8, x12
	b	LBB0_17
LBB0_6:
	subs	x10, x12, #2
	csel	x10, xzr, x10, lo
	cmp	w8, w10
	b.lo	LBB0_15
; %bb.7:
	add	x8, x20, w8, uxtw #2
	lsl	x10, x10, #2
	sub	x11, x8, x10
	cmp	x11, x8
	b.hi	LBB0_16
; %bb.8:
	add	x11, x20, x12, lsl #2
	sub	x10, x11, x10
	cmp	x10, x11
	b.hi	LBB0_11
; %bb.9:
	add	x10, x20, x12, lsl #2
	sub	x8, x10, x8
	cmp	x8, #64
	b.hs	LBB0_12
; %bb.10:
	mov	x8, x12
	b	LBB0_17
LBB0_11:
	mov	x8, x12
	b	LBB0_17
LBB0_12:
	and	x10, x9, #0xfffffffffffffff0
	sub	x8, x12, x10
	mov	w11, #-1
	add	x11, x12, x11
	lsl	x12, x12, #2
	sub	x13, x12, #28
	add	x12, x24, x13
	add	x13, x20, x13
	mov	x14, x10
LBB0_13:                                ; =>This Inner Loop Header: Depth=1
	ldp	q1, q0, [x13]
	ldp	q3, q2, [x13, #-32]
	ldp	q5, q4, [x12]
	ldp	q7, q6, [x12, #-32]
	add.4s	v0, v4, v0
	add.4s	v1, v5, v1
	add.4s	v2, v6, v2
	add.4s	v3, v7, v3
	sshr.4s	v0, v0, #1
	sshr.4s	v1, v1, #1
	sshr.4s	v2, v2, #1
	sshr.4s	v3, v3, #1
	add	x15, x20, w11, uxtw #2
	stur	q0, [x15, #-12]
	stur	q1, [x15, #-28]
	stur	q2, [x15, #-44]
	stur	q3, [x15, #-60]
	sub	x11, x11, #16
	sub	x12, x12, #64
	sub	x13, x13, #64
	sub	x14, x14, #16
	cbnz	x14, LBB0_13
; %bb.14:
	cmp	x9, x10
	b.ne	LBB0_17
	b	LBB0_18
LBB0_15:
	mov	x8, x12
	b	LBB0_17
LBB0_16:
	mov	x8, x12
LBB0_17:                                ; =>This Inner Loop Header: Depth=1
	lsl	x9, x8, #2
	sub	x10, x8, #1
	ldr	w11, [x20, x9]
	ldr	w9, [x24, x9]
	add	w9, w9, w11
	asr	w9, w9, #1
	str	w9, [x20, w10, uxtw #2]
	cmp	x8, #2
	mov	x8, x10
	b.hi	LBB0_17
LBB0_18:
	add	x0, x27, #4
	add	x1, x20, #4
	ldur	w2, [x29, #-96]                 ; 4-byte Folded Reload
	bl	_memcpy
	cmp	x22, #0
	cset	w0, ne
	bl	_unlikely
	cbz	x0, LBB0_24
; %bb.19:
	ldur	w8, [x29, #-92]                 ; 4-byte Folded Reload
	cmp	w8, #1
Lloh10:
	adrp	x13, _HUFFMAN_MAX_CODE_LENGTH@GOTPAGE
Lloh11:
	ldr	x13, [x13, _HUFFMAN_MAX_CODE_LENGTH@GOTPAGEOFF]
	b.lt	LBB0_29
; %bb.20:
	mov	x8, #0
	b	LBB0_22
LBB0_21:                                ;   in Loop: Header=BB0_22 Depth=1
	add	x8, x8, #1
	cmp	x28, x8
	b.eq	LBB0_29
LBB0_22:                                ; =>This Inner Loop Header: Depth=1
	ldrsw	x9, [x21, x8, lsl #2]
	cbz	w9, LBB0_21
; %bb.23:                               ;   in Loop: Header=BB0_22 Depth=1
	lsl	x10, x9, #2
	ldr	w11, [x27, x10]
	str	w11, [x22, x8, lsl #2]
	add	w12, w11, #1
	str	w12, [x27, x10]
	ldr	w10, [x20, x10]
	ldr	w12, [x13]
	sub	w10, w11, w10
	madd	w10, w10, w12, w10
	add	w9, w10, w9
	str	w8, [x19, w9, sxtw #2]
	b	LBB0_21
LBB0_24:
	ldur	w8, [x29, #-92]                 ; 4-byte Folded Reload
	cmp	w8, #1
Lloh12:
	adrp	x13, _HUFFMAN_MAX_CODE_LENGTH@GOTPAGE
Lloh13:
	ldr	x13, [x13, _HUFFMAN_MAX_CODE_LENGTH@GOTPAGEOFF]
	b.lt	LBB0_29
; %bb.25:
	mov	x8, #0
	b	LBB0_27
LBB0_26:                                ;   in Loop: Header=BB0_27 Depth=1
	add	x8, x8, #1
	cmp	x28, x8
	b.eq	LBB0_29
LBB0_27:                                ; =>This Inner Loop Header: Depth=1
	ldrsw	x9, [x21, x8, lsl #2]
	cbz	w9, LBB0_26
; %bb.28:                               ;   in Loop: Header=BB0_27 Depth=1
	lsl	x10, x9, #2
	ldr	w11, [x27, x10]
	add	w12, w11, #1
	str	w12, [x27, x10]
	ldr	w10, [x20, x10]
	ldr	w12, [x13]
	sub	w10, w11, w10
	madd	w10, w10, w12, w10
	add	w9, w10, w9
	str	w8, [x19, w9, sxtw #2]
	b	LBB0_26
LBB0_29:
	ldur	x8, [x29, #-88]
Lloh14:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh15:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh16:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_31
; %bb.30:
	sub	sp, x29, #80
	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
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
LBB0_31:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_HUFFMAN_MAX_CODE_LENGTH,4,2    ; @HUFFMAN_MAX_CODE_LENGTH
.subsections_via_symbols
