	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function HuffmanTree_makeFromFrequencies
_HuffmanTree_makeFromFrequencies:       ## @HuffmanTree_makeFromFrequencies
	.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
	movl	%r8d, %r14d
	movq	%rcx, %r13
	movq	%rsi, %r12
	movq	%rdi, %r15
	leaq	4(,%rcx,4), %rbx
	movl	$1, %eax
	xorl	%ecx, %ecx
	.p2align	4, 0x90
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	decq	%rax
	cmpl	$0, -8(%r12,%rbx)
	leaq	-4(%rbx), %rbx
	jne	LBB0_3
## %bb.2:                               ##   in Loop: Header=BB0_1 Depth=1
	leaq	(%rcx,%r13), %rsi
	decq	%rcx
	cmpq	%rdx, %rsi
	ja	LBB0_1
LBB0_3:
	movl	%r14d, (%r15)
	addq	%rax, %r13
	movl	%r13d, 4(%r15)
	movq	8(%r15), %rdi
	movq	%rbx, %rsi
	callq	_lodepng_realloc
	movq	%rax, 8(%r15)
	testq	%rax, %rax
	je	LBB0_4
## %bb.5:
	movq	%rax, %rdi
	xorl	%esi, %esi
	movq	%rbx, %rdx
	callq	_memset
	movq	8(%r15), %rdi
	movq	%r12, %rsi
	movq	%r13, %rdx
	movl	%r14d, %ecx
	callq	_lodepng_huffman_code_lengths
	testl	%eax, %eax
	jne	LBB0_6
## %bb.7:
	movq	%r15, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_HuffmanTree_makeFromLengths2   ## TAILCALL
LBB0_4:
	movl	$83, %eax
LBB0_6:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_HuffmanTree_makeFromFrequencies
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function HuffmanTree_makeFromFrequencies
_HuffmanTree_makeFromFrequencies:       ; @HuffmanTree_makeFromFrequencies
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x20, x4
	mov	x21, x1
	mov	x19, x0
	lsl	x8, x3, #2
	sub	x8, x8, #4
	add	x22, x3, #1
LBB0_1:                                 ; =>This Inner Loop Header: Depth=1
	sub	x22, x22, #1
	ldr	w9, [x21, x8]
	sub	x8, x8, #4
	cmp	w9, #0
	ccmp	x22, x2, #0, eq
	b.hi	LBB0_1
; %bb.2:
	stp	w20, w22, [x19]
	add	x23, x8, #8
	ldr	x0, [x19, #8]
	mov	x1, x23
	bl	_lodepng_realloc
	str	x0, [x19, #8]
	cbz	x0, LBB0_5
; %bb.3:
	mov	w1, #0
	mov	x2, x23
	bl	_memset
	ldr	x0, [x19, #8]
	mov	x1, x21
	mov	x2, x22
	mov	x3, x20
	bl	_lodepng_huffman_code_lengths
	cbnz	w0, LBB0_6
; %bb.4:
	mov	x0, x19
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	b	_HuffmanTree_makeFromLengths2
LBB0_5:
	mov	w0, #83
LBB0_6:
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_HuffmanTree_makeFromFrequencies
.subsections_via_symbols
