	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_huffman_build                  ## -- Begin function huffman_build
	.p2align	4, 0x90
_huffman_build:                         ## @huffman_build
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
                                        ## kill: def $esi killed $esi def $rsi
	testl	%esi, %esi
	jle	LBB0_35
## %bb.1:
	leal	-1(%rsi), %r11d
	movslq	%r11d, %r10
	leaq	(%rdi,%r10,8), %r13
	movl	$1, %eax
	subl	%esi, %eax
	movslq	%eax, %r12
	xorl	%edx, %edx
	movq	%r12, %r8
	jmp	LBB0_4
	.p2align	4, 0x90
LBB0_2:                                 ##   in Loop: Header=BB0_4 Depth=1
	movslq	%r14d, %rcx
	movq	%r8, (%r13,%rcx,8)
	movl	%eax, %edx
LBB0_3:                                 ##   in Loop: Header=BB0_4 Depth=1
	incq	%r8
	cmpl	$1, %r8d
	je	LBB0_11
LBB0_4:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_8 Depth 2
	movq	(%r13,%r8,8), %rbx
	testq	%rbx, %rbx
	jle	LBB0_10
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	leal	1(%rdx), %eax
	movl	%eax, %r14d
	testl	%edx, %edx
	jle	LBB0_2
## %bb.6:                               ##   in Loop: Header=BB0_4 Depth=1
	movl	%eax, %edx
	shrl	%edx
	movq	(%r13,%rdx,8), %rcx
	movl	%eax, %r14d
	cmpq	%rbx, (%r13,%rcx,8)
	jle	LBB0_2
## %bb.7:                               ##   in Loop: Header=BB0_4 Depth=1
	movl	%eax, %r14d
	.p2align	4, 0x90
LBB0_8:                                 ##   Parent Loop BB0_4 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movl	%r14d, %ebx
	movl	%r14d, %r9d
	movl	%edx, %r14d
	movq	%rcx, (%r13,%r9,8)
	cmpl	$4, %ebx
	jb	LBB0_2
## %bb.9:                               ##   in Loop: Header=BB0_8 Depth=2
	movl	%r14d, %edx
	shrl	%edx
	movq	(%r13,%rdx,8), %rcx
	movq	(%r13,%rcx,8), %rbx
	cmpq	(%r13,%r8,8), %rbx
	jg	LBB0_8
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_10:                                ##   in Loop: Header=BB0_4 Depth=1
	movl	%edx, %eax
	jmp	LBB0_3
LBB0_11:
	cmpl	$2, %eax
	jge	LBB0_15
## %bb.12:
	testl	%eax, %eax
	je	LBB0_35
## %bb.13:
	movq	8(%r13), %rcx
	movq	$1, (%r13,%rcx,8)
	jmp	LBB0_36
LBB0_35:
	xorl	%eax, %eax
LBB0_36:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_15:
	movq	%rsi, -64(%rbp)                 ## 8-byte Spill
	movl	%r11d, -44(%rbp)                ## 4-byte Spill
	movq	%r10, -72(%rbp)                 ## 8-byte Spill
	movq	%rdi, -80(%rbp)                 ## 8-byte Spill
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	movl	%eax, %ebx
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	.p2align	4, 0x90
LBB0_16:                                ## =>This Inner Loop Header: Depth=1
	movq	8(%r13), %r14
	leaq	-1(%rbx), %r15
	movl	(%r13,%rbx,8), %edx
	movq	%r13, %rdi
	movl	%r15d, %esi
	callq	_heap_sift
	movq	8(%r13), %rax
	movq	(%r13,%rax,8), %rcx
	addq	(%r13,%r14,8), %rcx
	movq	%rcx, (%r13,%rbx,8)
	movq	%rbx, (%r13,%rax,8)
	movq	%rbx, (%r13,%r14,8)
	movq	%r13, %rdi
	movl	%r15d, %esi
	movl	%ebx, %edx
	callq	_heap_sift
	cmpq	$2, %rbx
	movq	%r15, %rbx
	ja	LBB0_16
## %bb.17:
	movq	$0, 16(%r13)
	movl	-48(%rbp), %eax                 ## 4-byte Reload
	cmpl	$3, %eax
	movq	-80(%rbp), %r9                  ## 8-byte Reload
	movq	-72(%rbp), %r10                 ## 8-byte Reload
	movl	-44(%rbp), %r11d                ## 4-byte Reload
	movq	-64(%rbp), %r14                 ## 8-byte Reload
	jl	LBB0_24
## %bb.18:
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	leaq	-2(%rsi), %rcx
	addq	$-3, %rsi
	movl	%ecx, %r8d
	andl	$3, %r8d
	movl	$3, %edx
	cmpq	$3, %rsi
	jb	LBB0_21
## %bb.19:
	leaq	(%r9,%r10,8), %rsi
	addq	$24, %rsi
	andq	$-4, %rcx
	negq	%rcx
	movl	$3, %edx
	.p2align	4, 0x90
LBB0_20:                                ## =>This Inner Loop Header: Depth=1
	movq	-24(%rsi,%rdx,8), %rdi
	movq	-16(%rsi,%rdx,8), %rbx
	movq	(%r13,%rdi,8), %rdi
	incq	%rdi
	movq	%rdi, -24(%rsi,%rdx,8)
	movq	(%r13,%rbx,8), %rdi
	incq	%rdi
	movq	%rdi, -16(%rsi,%rdx,8)
	movq	-8(%rsi,%rdx,8), %rdi
	movq	(%r13,%rdi,8), %rdi
	incq	%rdi
	movq	%rdi, -8(%rsi,%rdx,8)
	movq	(%rsi,%rdx,8), %rdi
	movq	(%r13,%rdi,8), %rdi
	incq	%rdi
	movq	%rdi, (%rsi,%rdx,8)
	leaq	(%rcx,%rdx), %rdi
	addq	$4, %rdi
	addq	$4, %rdx
	cmpq	$3, %rdi
	jne	LBB0_20
LBB0_21:
	testq	%r8, %r8
	je	LBB0_24
## %bb.22:
	addq	%r10, %rdx
	leaq	(%r9,%rdx,8), %rcx
	xorl	%edx, %edx
	.p2align	4, 0x90
LBB0_23:                                ## =>This Inner Loop Header: Depth=1
	movq	(%rcx,%rdx,8), %rsi
	movq	(%r13,%rsi,8), %rsi
	incq	%rsi
	movq	%rsi, (%rcx,%rdx,8)
	incq	%rdx
	cmpq	%rdx, %r8
	jne	LBB0_23
LBB0_24:
	testb	$1, %r14b
	je	LBB0_28
## %bb.25:
	movq	(%r13,%r12,8), %rcx
	testq	%rcx, %rcx
	jle	LBB0_27
## %bb.26:
	movq	(%r13,%rcx,8), %rcx
	incq	%rcx
	movq	%rcx, (%r13,%r12,8)
LBB0_27:
	incq	%r12
LBB0_28:
	testl	%r11d, %r11d
	je	LBB0_36
## %bb.29:
	leaq	(%r9,%r10,8), %rdx
	addq	$8, %rdx
	jmp	LBB0_31
	.p2align	4, 0x90
LBB0_30:                                ##   in Loop: Header=BB0_31 Depth=1
	addq	$2, %r12
	cmpl	$1, %r12d
	je	LBB0_36
LBB0_31:                                ## =>This Inner Loop Header: Depth=1
	movq	-8(%rdx,%r12,8), %rcx
	testq	%rcx, %rcx
	jle	LBB0_33
## %bb.32:                              ##   in Loop: Header=BB0_31 Depth=1
	movq	(%r13,%rcx,8), %rcx
	incq	%rcx
	movq	%rcx, -8(%rdx,%r12,8)
LBB0_33:                                ##   in Loop: Header=BB0_31 Depth=1
	movq	(%rdx,%r12,8), %rcx
	testq	%rcx, %rcx
	jle	LBB0_30
## %bb.34:                              ##   in Loop: Header=BB0_31 Depth=1
	movq	(%r13,%rcx,8), %rcx
	incq	%rcx
	movq	%rcx, (%rdx,%r12,8)
	jmp	LBB0_30
	.cfi_endproc
                                        ## -- End function
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_huffman_build                  ; -- Begin function huffman_build
	.p2align	2
_huffman_build:                         ; @huffman_build
	.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
	subs	w8, w1, #1
	b.lt	LBB0_14
; %bb.1:
	mov	x19, x1
	mov	x22, x0
	mov	w9, #0
	sxtw	x25, w8
	add	x20, x0, w8, sxtw #3
	mov	w8, #1
	sub	w8, w8, w1
	sxtw	x26, w8
	mov	x8, x26
	b	LBB0_4
LBB0_2:                                 ;   in Loop: Header=BB0_4 Depth=1
	str	x8, [x20, w10, sxtw #3]
	mov	x9, x21
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	add	x8, x8, #1
	cmp	w8, #1
	b.eq	LBB0_11
LBB0_4:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_8 Depth 2
	ldr	x12, [x20, x8, lsl #3]
	cmp	x12, #1
	b.lt	LBB0_10
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	add	w21, w9, #1
	mov	x10, x21
	cmp	w9, #1
	b.lt	LBB0_2
; %bb.6:                                ;   in Loop: Header=BB0_4 Depth=1
	lsr	w9, w21, #1
	ldr	x11, [x20, w9, uxtw #3]
	ldr	x13, [x20, x11, lsl #3]
	mov	x10, x21
	cmp	x13, x12
	b.le	LBB0_2
; %bb.7:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	x10, x21
LBB0_8:                                 ;   Parent Loop BB0_4 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	mov	x12, x10
	str	x11, [x20, w10, uxtw #3]
	mov	x10, x9
	cmp	w12, #4
	b.lo	LBB0_2
; %bb.9:                                ;   in Loop: Header=BB0_8 Depth=2
	ldr	x12, [x20, x8, lsl #3]
	lsr	w9, w10, #1
	ldr	x11, [x20, w9, uxtw #3]
	ldr	x13, [x20, x11, lsl #3]
	cmp	x13, x12
	b.gt	LBB0_8
	b	LBB0_2
LBB0_10:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	x21, x9
	b	LBB0_3
LBB0_11:
	cmp	w21, #2
	b.ge	LBB0_16
; %bb.12:
	cbz	w21, LBB0_15
; %bb.13:
	ldr	x8, [x20, #8]
	mov	w9, #1
	str	x9, [x20, x8, lsl #3]
	b	LBB0_15
LBB0_14:
	mov	w21, #0
LBB0_15:
	mov	x0, x21
	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_16:
	mov	w23, w21
LBB0_17:                                ; =>This Inner Loop Header: Depth=1
	ldr	x27, [x20, #8]
	sub	x24, x23, #1
	lsl	x28, x23, #3
	ldr	x2, [x20, x28]
	mov	x0, x20
	mov	x1, x24
                                        ; kill: def $w2 killed $w2 killed $x2
	bl	_heap_sift
	ldr	x8, [x20, #8]
	lsl	x9, x27, #3
	ldr	x10, [x20, x9]
	lsl	x8, x8, #3
	ldr	x11, [x20, x8]
	add	x10, x11, x10
	str	x10, [x20, x28]
	str	x23, [x20, x8]
	str	x23, [x20, x9]
	mov	x0, x20
	mov	x1, x24
	mov	x2, x23
	bl	_heap_sift
	cmp	x23, #2
	mov	x23, x24
	b.hi	LBB0_17
; %bb.18:
	str	xzr, [x20, #16]
	cmp	w21, #3
	b.lt	LBB0_21
; %bb.19:
	add	w9, w21, #1
	add	x8, x22, x25, lsl #3
	add	x8, x8, #24
	sub	x9, x9, #3
LBB0_20:                                ; =>This Inner Loop Header: Depth=1
	ldr	x10, [x8]
	ldr	x10, [x20, x10, lsl #3]
	add	x10, x10, #1
	str	x10, [x8], #8
	subs	x9, x9, #1
	b.ne	LBB0_20
LBB0_21:
	add	x8, x25, x26
	add	x8, x22, x8, lsl #3
	b	LBB0_23
LBB0_22:                                ;   in Loop: Header=BB0_23 Depth=1
	add	x8, x8, #8
	subs	w19, w19, #1
	b.eq	LBB0_15
LBB0_23:                                ; =>This Inner Loop Header: Depth=1
	ldr	x9, [x8]
	cmp	x9, #1
	b.lt	LBB0_22
; %bb.24:                               ;   in Loop: Header=BB0_23 Depth=1
	ldr	x9, [x20, x9, lsl #3]
	add	x9, x9, #1
	str	x9, [x8]
	b	LBB0_22
	.cfi_endproc
                                        ; -- End function
.subsections_via_symbols
