	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function HuffmanTree_makeFromLengths2
_HuffmanTree_makeFromLengths2:          ## @HuffmanTree_makeFromLengths2
	.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	%r12
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	leaq	-48(%rbp), %r15
	movq	%r15, %rdi
	callq	_uivector_init
	leaq	-40(%rbp), %rdi
	callq	_uivector_init
	movl	8(%rbx), %edi
	shll	$2, %edi
	callq	_lodepng_malloc
	movq	%rax, %r14
	movq	%rax, (%rbx)
	movl	12(%rbx), %esi
	incl	%esi
	xorl	%r12d, %r12d
	movq	%r15, %rdi
	xorl	%edx, %edx
	callq	_uivector_resizev
	testl	%eax, %eax
	je	LBB0_1
## %bb.3:
	testq	%r14, %r14
	sete	%r14b
	movl	12(%rbx), %esi
	incl	%esi
	leaq	-40(%rbp), %rdi
	xorl	%edx, %edx
	callq	_uivector_resizev
	testl	%eax, %eax
	sete	%al
	orb	%r14b, %al
	movl	$83, %r14d
	cmovel	%r12d, %r14d
	jne	LBB0_2
## %bb.4:
	cmpl	$0, 8(%rbx)
	je	LBB0_5
## %bb.17:
	movq	-48(%rbp), %rcx
	movq	16(%rbx), %rdx
	xorl	%esi, %esi
	.p2align	4, 0x90
LBB0_18:                                ## =>This Inner Loop Header: Depth=1
	movq	(%rdx,%rsi,8), %rax
	incl	(%rcx,%rax,4)
	incq	%rsi
	movl	8(%rbx), %eax
	cmpq	%rax, %rsi
	jb	LBB0_18
## %bb.6:
	cmpl	$0, 12(%rbx)
	jne	LBB0_7
LBB0_10:
	testl	%eax, %eax
	jne	LBB0_11
	jmp	LBB0_15
LBB0_1:
	movl	$83, %r14d
LBB0_2:
	leaq	-48(%rbp), %rdi
	callq	_uivector_cleanup
	leaq	-40(%rbp), %rdi
	callq	_uivector_cleanup
	jmp	LBB0_16
LBB0_5:
	xorl	%eax, %eax
	cmpl	$0, 12(%rbx)
	je	LBB0_10
LBB0_7:
	movq	-40(%rbp), %rax
	movq	-48(%rbp), %rcx
	movl	(%rax), %edx
	xorl	%esi, %esi
	.p2align	4, 0x90
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	addl	(%rcx,%rsi,4), %edx
	addl	%edx, %edx
	movl	%edx, 4(%rax,%rsi,4)
	movl	12(%rbx), %edi
	incq	%rsi
	cmpq	%rdi, %rsi
	jb	LBB0_8
## %bb.9:
	movl	8(%rbx), %eax
	testl	%eax, %eax
	je	LBB0_15
LBB0_11:
	movq	16(%rbx), %r8
	movq	-40(%rbp), %rdx
	xorl	%esi, %esi
	jmp	LBB0_12
	.p2align	4, 0x90
LBB0_14:                                ##   in Loop: Header=BB0_12 Depth=1
	incq	%rsi
	movl	%eax, %ecx
	cmpq	%rcx, %rsi
	jae	LBB0_15
LBB0_12:                                ## =>This Inner Loop Header: Depth=1
	movq	(%r8,%rsi,8), %rdi
	testq	%rdi, %rdi
	je	LBB0_14
## %bb.13:                              ##   in Loop: Header=BB0_12 Depth=1
	movl	(%rdx,%rdi,4), %eax
	leal	1(%rax), %ecx
	movl	%ecx, (%rdx,%rdi,4)
	movq	(%rbx), %rcx
	movl	%eax, (%rcx,%rsi,4)
	movl	8(%rbx), %eax
	jmp	LBB0_14
LBB0_15:
	leaq	-48(%rbp), %rdi
	callq	_uivector_cleanup
	leaq	-40(%rbp), %rdi
	callq	_uivector_cleanup
	movq	%rbx, %rdi
	callq	_HuffmanTree_make2DTree
	movl	%eax, %r14d
LBB0_16:
	movl	%r14d, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_HuffmanTree_makeFromLengths2
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function HuffmanTree_makeFromLengths2
_HuffmanTree_makeFromLengths2:          ; @HuffmanTree_makeFromLengths2
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x19, x0
	add	x0, sp, #8
	bl	_uivector_init
	mov	x0, sp
	bl	_uivector_init
	ldr	w8, [x19, #8]
	lsl	w0, w8, #2
	bl	_lodepng_malloc
	mov	x21, x0
	str	x0, [x19]
	ldr	w8, [x19, #12]
	add	w1, w8, #1
	add	x0, sp, #8
	mov	w2, #0
	bl	_uivector_resizev
	mov	w20, #83
	cbz	w0, LBB0_2
; %bb.1:
	ldr	w8, [x19, #12]
	add	w1, w8, #1
	mov	x0, sp
	mov	w2, #0
	bl	_uivector_resizev
	cmp	w0, #0
	ccmp	x21, #0, #4, ne
	csel	w20, w20, wzr, eq
	b.ne	LBB0_3
LBB0_2:
	add	x0, sp, #8
	bl	_uivector_cleanup
	mov	x0, sp
	bl	_uivector_cleanup
	b	LBB0_16
LBB0_3:
	ldr	w8, [x19, #8]
	cbz	w8, LBB0_6
; %bb.4:
	mov	x9, #0
	ldr	x10, [sp, #8]
	ldr	x11, [x19, #16]
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x11, x9, lsl #3]
	lsl	x8, x8, #2
	ldr	w12, [x10, x8]
	add	w12, w12, #1
	str	w12, [x10, x8]
	add	x9, x9, #1
	ldr	w8, [x19, #8]
	cmp	x9, x8
	b.lo	LBB0_5
LBB0_6:
	ldr	w9, [x19, #12]
	cbz	w9, LBB0_10
; %bb.7:
	mov	x8, #0
	ldp	x9, x10, [sp]
	ldr	w11, [x9], #4
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	lsl	x12, x8, #2
	ldr	w13, [x10, x12]
	add	w11, w13, w11
	lsl	w11, w11, #1
	str	w11, [x9, x12]
	ldr	w12, [x19, #12]
	add	x8, x8, #1
	cmp	x8, x12
	b.lo	LBB0_8
; %bb.9:
	ldr	w8, [x19, #8]
LBB0_10:
	cbz	w8, LBB0_15
; %bb.11:
	mov	x9, #0
	ldr	x10, [x19, #16]
	ldr	x11, [sp]
	b	LBB0_13
LBB0_12:                                ;   in Loop: Header=BB0_13 Depth=1
	add	x9, x9, #1
	cmp	x9, w8, uxtw
	b.hs	LBB0_15
LBB0_13:                                ; =>This Inner Loop Header: Depth=1
	ldr	x12, [x10, x9, lsl #3]
	cbz	x12, LBB0_12
; %bb.14:                               ;   in Loop: Header=BB0_13 Depth=1
	lsl	x8, x12, #2
	ldr	w12, [x11, x8]
	add	w13, w12, #1
	str	w13, [x11, x8]
	ldr	x8, [x19]
	str	w12, [x8, x9, lsl #2]
	ldr	w8, [x19, #8]
	b	LBB0_12
LBB0_15:
	add	x0, sp, #8
	bl	_uivector_cleanup
	mov	x0, sp
	bl	_uivector_cleanup
	mov	x0, x19
	bl	_HuffmanTree_make2DTree
	mov	x20, x0
LBB0_16:
	mov	x0, x20
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_HuffmanTree_makeFromLengths2
.subsections_via_symbols
