	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function HuffmanTree_make2DTree
_HuffmanTree_make2DTree:                ## @HuffmanTree_make2DTree
	.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
	movq	%rdi, %r14
	movl	8(%rdi), %edi
	shll	$3, %edi
	callq	_lodepng_malloc
	movq	%rax, (%r14)
	testq	%rax, %rax
	je	LBB0_17
## %bb.1:
	cmpl	$0, 8(%r14)
	je	LBB0_19
## %bb.2:
	xorl	%ecx, %ecx
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movl	$32767, (%rax,%rcx,4)           ## imm = 0x7FFF
	incq	%rcx
	movl	8(%r14), %edx
	leal	(%rdx,%rdx), %esi
	cmpq	%rsi, %rcx
	jb	LBB0_3
## %bb.4:
	testl	%edx, %edx
	je	LBB0_19
## %bb.5:
	movq	16(%r14), %r10
	xorl	%r15d, %r15d
	xorl	%r13d, %r13d
	xorl	%r9d, %r9d
	movl	$55, %r8d
	jmp	LBB0_7
	.p2align	4, 0x90
LBB0_6:                                 ##   in Loop: Header=BB0_7 Depth=1
	incq	%r15
	movl	%edx, %ecx
	cmpq	%rcx, %r15
	jae	LBB0_21
LBB0_7:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_10 Depth 2
	movl	(%r10,%r15,4), %ebx
	testl	%ebx, %ebx
	je	LBB0_6
## %bb.8:                               ##   in Loop: Header=BB0_7 Depth=1
	leal	-2(%rdx), %esi
	cmpl	%esi, %r13d
	ja	LBB0_20
## %bb.9:                               ##   in Loop: Header=BB0_7 Depth=1
	movq	24(%r14), %r11
	xorl	%r12d, %r12d
	.p2align	4, 0x90
LBB0_10:                                ##   Parent Loop BB0_7 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movl	(%r11,%r15,4), %edi
	movl	%r12d, %esi
	notl	%esi
	addl	%ebx, %esi
	xorl	%ecx, %ecx
	btq	%rsi, %rdi
	setb	%cl
	addl	%r13d, %r13d
	orq	%rcx, %r13
	movl	(%rax,%r13,4), %edi
	cmpl	$32767, %edi                    ## imm = 0x7FFF
	jne	LBB0_13
## %bb.11:                              ##   in Loop: Header=BB0_10 Depth=2
	incl	%r12d
	cmpl	%ebx, %r12d
	jne	LBB0_14
## %bb.12:                              ##   in Loop: Header=BB0_10 Depth=2
	movl	%r15d, (%rax,%r13,4)
	xorl	%r13d, %r13d
	jmp	LBB0_15
	.p2align	4, 0x90
LBB0_13:                                ##   in Loop: Header=BB0_10 Depth=2
	subl	%edx, %edi
	incl	%r12d
	movl	%edi, %r13d
	jmp	LBB0_15
	.p2align	4, 0x90
LBB0_14:                                ##   in Loop: Header=BB0_10 Depth=2
	leal	(%rdx,%r9), %ecx
	incl	%ecx
	movl	%r9d, %edx
	incl	%edx
	movl	%ecx, (%rax,%r13,4)
	movl	%edx, %r13d
	movl	%edx, %r9d
LBB0_15:                                ##   in Loop: Header=BB0_10 Depth=2
	movl	(%r10,%r15,4), %ebx
	movl	8(%r14), %edx
	cmpl	%r12d, %ebx
	jbe	LBB0_6
## %bb.16:                              ##   in Loop: Header=BB0_10 Depth=2
	leal	-2(%rdx), %ecx
	cmpl	%ecx, %r13d
	jbe	LBB0_10
	jmp	LBB0_20
LBB0_17:
	movl	$83, %r8d
	jmp	LBB0_20
LBB0_21:
	testl	%edx, %edx
	je	LBB0_19
## %bb.22:
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	jmp	LBB0_24
LBB0_19:
	xorl	%r8d, %r8d
LBB0_20:
	movl	%r8d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.p2align	4, 0x90
LBB0_23:                                ##   in Loop: Header=BB0_24 Depth=1
	incq	%rcx
	leal	(%rdx,%rdx), %esi
	cmpq	%rsi, %rcx
	jae	LBB0_20
LBB0_24:                                ## =>This Inner Loop Header: Depth=1
	cmpl	$32767, (%rax,%rcx,4)           ## imm = 0x7FFF
	jne	LBB0_23
## %bb.25:                              ##   in Loop: Header=BB0_24 Depth=1
	movl	$0, (%rax,%rcx,4)
	movl	8(%r14), %edx
	jmp	LBB0_23
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_HuffmanTree_make2DTree
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function HuffmanTree_make2DTree
_HuffmanTree_make2DTree:                ; @HuffmanTree_make2DTree
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x0
	ldr	w8, [x0, #8]
	lsl	w0, w8, #3
	bl	_lodepng_malloc
	str	x0, [x19]
	cbz	x0, LBB0_18
; %bb.1:
	ldr	w8, [x19, #8]
	cbz	w8, LBB0_25
; %bb.2:
	mov	x8, #0
	mov	w10, #32767
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	str	w10, [x0, x8, lsl #2]
	add	x8, x8, #1
	ldr	w9, [x19, #8]
	lsl	w11, w9, #1
	cmp	x8, x11
	b.lo	LBB0_3
; %bb.4:
	cbz	w9, LBB0_24
; %bb.5:
	mov	x8, #0
	mov	w13, #0
	mov	w10, #0
	ldr	x11, [x19, #16]
	mov	w12, #32767
	b	LBB0_7
LBB0_6:                                 ;   in Loop: Header=BB0_7 Depth=1
	add	x8, x8, #1
	cmp	x8, w9, uxtw
	b.hs	LBB0_19
LBB0_7:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_10 Depth 2
	ldr	w16, [x11, x8, lsl #2]
	cbz	w16, LBB0_6
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=1
	sub	w14, w9, #2
	cmp	w13, w14
	b.hi	LBB0_17
; %bb.9:                                ;   in Loop: Header=BB0_7 Depth=1
	mov	w14, #0
	ldr	x15, [x19, #24]
LBB0_10:                                ;   Parent Loop BB0_7 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	w17, [x15, x8, lsl #2]
	mvn	w1, w14
	add	w1, w16, w1
	lsr	x1, x17, x1
	lsl	w17, w13, #1
	bfxil	x17, x1, #0, #1
	ldr	w13, [x0, x17, lsl #2]
	cmp	w13, w12
	b.ne	LBB0_13
; %bb.11:                               ;   in Loop: Header=BB0_10 Depth=2
	add	w14, w14, #1
	cmp	w14, w16
	b.ne	LBB0_14
; %bb.12:                               ;   in Loop: Header=BB0_10 Depth=2
	mov	w13, #0
	str	w8, [x0, x17, lsl #2]
	b	LBB0_15
LBB0_13:                                ;   in Loop: Header=BB0_10 Depth=2
	sub	w13, w13, w9
	add	w14, w14, #1
	b	LBB0_15
LBB0_14:                                ;   in Loop: Header=BB0_10 Depth=2
	add	w10, w10, #1
	add	w9, w9, w10
	str	w9, [x0, x17, lsl #2]
	mov	x13, x10
LBB0_15:                                ;   in Loop: Header=BB0_10 Depth=2
	ldr	w16, [x11, x8, lsl #2]
	ldr	w9, [x19, #8]
	cmp	w16, w14
	b.ls	LBB0_6
; %bb.16:                               ;   in Loop: Header=BB0_10 Depth=2
	sub	w17, w9, #2
	cmp	w13, w17
	b.ls	LBB0_10
LBB0_17:
	mov	w8, #55
	b	LBB0_25
LBB0_18:
	mov	w8, #83
	b	LBB0_25
LBB0_19:
	cbz	w9, LBB0_24
; %bb.20:
	mov	x10, #0
	mov	w11, #32767
	b	LBB0_22
LBB0_21:                                ;   in Loop: Header=BB0_22 Depth=1
	mov	w8, #0
	add	x10, x10, #1
	lsl	w12, w9, #1
	cmp	x10, x12
	b.hs	LBB0_25
LBB0_22:                                ; =>This Inner Loop Header: Depth=1
	ldr	w8, [x0, x10, lsl #2]
	cmp	w8, w11
	b.ne	LBB0_21
; %bb.23:                               ;   in Loop: Header=BB0_22 Depth=1
	str	wzr, [x0, x10, lsl #2]
	ldr	w9, [x19, #8]
	b	LBB0_21
LBB0_24:
	mov	w8, #0
LBB0_25:
	mov	x0, x8
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_HuffmanTree_make2DTree
.subsections_via_symbols
