	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_lodepng_huffman_code_lengths   ## -- Begin function lodepng_huffman_code_lengths
	.p2align	4, 0x90
_lodepng_huffman_code_lengths:          ## @lodepng_huffman_code_lengths
	.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	$72, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%ecx, -52(%rbp)                 ## 4-byte Spill
	testq	%rdx, %rdx
	je	LBB0_1
## %bb.2:
	xorl	%eax, %eax
	xorl	%ebx, %ebx
	xorl	%r12d, %r12d
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%rsi,%rax,4), %ecx
	cmpq	$1, %rcx
	sbbq	$-1, %r12
	addq	%rcx, %rbx
	incl	%eax
	cmpq	%rdx, %rax
	jb	LBB0_3
## %bb.4:
	xorl	%eax, %eax
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movl	$0, (%rdi,%rax,4)
	incl	%eax
	cmpq	%rdx, %rax
	jb	LBB0_5
## %bb.6:
	testq	%r12, %r12
	je	LBB0_40
## %bb.7:
	cmpq	$1, %r12
	jne	LBB0_13
## %bb.8:
	xorl	%eax, %eax
	.p2align	4, 0x90
LBB0_9:                                 ## =>This Inner Loop Header: Depth=1
	cmpl	$0, (%rsi,%rax,4)
	jne	LBB0_10
## %bb.11:                              ##   in Loop: Header=BB0_9 Depth=1
	incl	%eax
	cmpq	%rdx, %rax
	jb	LBB0_9
## %bb.12:
	xorl	%eax, %eax
	jmp	LBB0_39
LBB0_1:
	movl	$80, %eax
	jmp	LBB0_39
LBB0_40:
	movabsq	$4294967297, %rax               ## imm = 0x100000001
	movq	%rax, (%rdi)
	xorl	%eax, %eax
	jmp	LBB0_39
LBB0_13:
	movq	%rsi, -88(%rbp)                 ## 8-byte Spill
	movq	%rdx, -96(%rbp)                 ## 8-byte Spill
	movq	%rdi, -104(%rbp)                ## 8-byte Spill
	movl	%r12d, %r15d
	shll	$5, %r15d
	movl	%r15d, %edi
	callq	_lodepng_malloc
	movq	%rax, %r13
	movl	%r15d, %edi
	callq	_lodepng_malloc
	testq	%r13, %r13
	je	LBB0_15
## %bb.14:
	testq	%rax, %rax
	je	LBB0_15
## %bb.16:
	leal	(%r12,%r12), %r15d
	movq	%rax, %r14
	movq	%r13, %rdi
	movl	%r15d, %esi
	callq	_init_coins
	movq	%r14, -64(%rbp)                 ## 8-byte Spill
	movq	%r14, %rdi
	movl	%r15d, %esi
	callq	_init_coins
	movq	%r13, %rdi
	movq	-88(%rbp), %rsi                 ## 8-byte Reload
	movq	-96(%rbp), %rdx                 ## 8-byte Reload
	movq	%rbx, %rcx
	callq	_append_symbol_coins
	movl	%eax, %r14d
	movq	%r13, %rdi
	movl	%r12d, %esi
	callq	_sort_coins
	testl	%r14d, %r14d
	je	LBB0_18
## %bb.17:
	movl	%r14d, -44(%rbp)                ## 4-byte Spill
	jmp	LBB0_38
LBB0_10:
	movl	$1, (%rdi,%rax,4)
	xorl	%ecx, %ecx
	testq	%rax, %rax
	sete	%cl
	movl	$1, (%rdi,%rcx,4)
	xorl	%eax, %eax
	jmp	LBB0_39
LBB0_15:
	movq	%rax, %rbx
	movq	%r13, %rdi
	callq	_lodepng_free
	movq	%rbx, %rdi
	callq	_lodepng_free
	movl	$83, %eax
	jmp	LBB0_39
LBB0_18:
	movq	%rbx, -112(%rbp)                ## 8-byte Spill
	movq	%r12, -80(%rbp)                 ## 8-byte Spill
	cmpl	$0, -52(%rbp)                   ## 4-byte Folded Reload
	je	LBB0_31
## %bb.19:
	movl	%r15d, -68(%rbp)                ## 4-byte Spill
	xorl	%r12d, %r12d
	movl	$1, -48(%rbp)                   ## 4-byte Folded Spill
	movq	-80(%rbp), %rax                 ## 8-byte Reload
	movl	%eax, %r14d
	movq	-64(%rbp), %rbx                 ## 8-byte Reload
	.p2align	4, 0x90
LBB0_20:                                ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_22 Depth 2
	movl	%r14d, -72(%rbp)                ## 4-byte Spill
	movq	%r13, -64(%rbp)                 ## 8-byte Spill
	movq	%rbx, %rdi
	movl	%r12d, %esi
	callq	_cleanup_coins
	movq	%rbx, %rdi
	movl	%r12d, %esi
	callq	_init_coins
	movl	$0, %r15d
	cmpl	$2, %r14d
	jb	LBB0_23
## %bb.21:                              ##   in Loop: Header=BB0_20 Depth=1
	xorl	%r15d, %r15d
	movl	$1, %r13d
	.p2align	4, 0x90
LBB0_22:                                ##   Parent Loop BB0_20 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	leal	-1(%r13), %esi
	movl	%r15d, %r14d
	incl	%r15d
	shlq	$4, %r14
	addq	%rbx, %r14
	shlq	$4, %rsi
	movq	%rbx, %r12
	movq	-64(%rbp), %rbx                 ## 8-byte Reload
	addq	%rbx, %rsi
	movq	%r14, %rdi
	callq	_coin_copy
	movl	%r13d, %esi
	shlq	$4, %rsi
	addq	%rbx, %rsi
	movq	%r12, %rbx
	movq	%r14, %rdi
	callq	_add_coins
	addl	$2, %r13d
	cmpl	-72(%rbp), %r13d                ## 4-byte Folded Reload
	jb	LBB0_22
LBB0_23:                                ##   in Loop: Header=BB0_20 Depth=1
	movl	-48(%rbp), %eax                 ## 4-byte Reload
	cmpl	-52(%rbp), %eax                 ## 4-byte Folded Reload
	jae	LBB0_24
## %bb.25:                              ##   in Loop: Header=BB0_20 Depth=1
	movl	%r15d, %edi
	shlq	$4, %rdi
	movq	%rbx, %r13
	addq	%rbx, %rdi
	movq	-88(%rbp), %rsi                 ## 8-byte Reload
	movq	-96(%rbp), %rdx                 ## 8-byte Reload
	movq	-112(%rbp), %rcx                ## 8-byte Reload
	callq	_append_symbol_coins
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	addl	-80(%rbp), %r15d                ## 4-byte Folded Reload
	jmp	LBB0_26
	.p2align	4, 0x90
LBB0_24:                                ##   in Loop: Header=BB0_20 Depth=1
	movl	$0, -44(%rbp)                   ## 4-byte Folded Spill
	movq	%rbx, %r13
LBB0_26:                                ##   in Loop: Header=BB0_20 Depth=1
	movq	%r13, %rdi
	movl	%r15d, %esi
	callq	_sort_coins
	movl	-48(%rbp), %eax                 ## 4-byte Reload
	incl	%eax
	movl	%eax, -48(%rbp)                 ## 4-byte Spill
	cmpl	-52(%rbp), %eax                 ## 4-byte Folded Reload
	movl	-72(%rbp), %r12d                ## 4-byte Reload
	movq	-64(%rbp), %rbx                 ## 8-byte Reload
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	ja	LBB0_28
## %bb.27:                              ##   in Loop: Header=BB0_20 Depth=1
	movl	%r15d, %r14d
	testl	%edx, %edx
	je	LBB0_20
LBB0_28:
	testl	%edx, %edx
	je	LBB0_30
## %bb.29:
	movl	-68(%rbp), %r15d                ## 4-byte Reload
	jmp	LBB0_38
LBB0_31:
	movq	-80(%rbp), %rbx                 ## 8-byte Reload
	decq	%rbx
	jmp	LBB0_32
LBB0_30:
	movq	-80(%rbp), %rbx                 ## 8-byte Reload
	decq	%rbx
	movl	-68(%rbp), %r15d                ## 4-byte Reload
	je	LBB0_37
LBB0_32:
	xorl	%r8d, %r8d
	movq	-104(%rbp), %rax                ## 8-byte Reload
	jmp	LBB0_33
	.p2align	4, 0x90
LBB0_36:                                ##   in Loop: Header=BB0_33 Depth=1
	incq	%r8
	movl	%r8d, %ecx
	cmpq	%rcx, %rbx
	jbe	LBB0_37
LBB0_33:                                ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_35 Depth 2
	movq	%r8, %rdx
	shlq	$4, %rdx
	cmpl	$0, (%r13,%rdx)
	je	LBB0_36
## %bb.34:                              ##   in Loop: Header=BB0_33 Depth=1
	leaq	(%rdx,%r13), %rcx
	movq	8(%r13,%rdx), %rdx
	xorl	%esi, %esi
	.p2align	4, 0x90
LBB0_35:                                ##   Parent Loop BB0_33 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	(%rdx,%rsi,8), %rdi
	incl	(%rax,%rdi,4)
	incq	%rsi
	movl	(%rcx), %edi
	cmpq	%rdi, %rsi
	jb	LBB0_35
	jmp	LBB0_36
LBB0_37:
	movl	$0, -44(%rbp)                   ## 4-byte Folded Spill
LBB0_38:
	movq	%r13, %rdi
	movl	%r15d, %esi
	callq	_cleanup_coins
	movq	%r13, %rdi
	callq	_lodepng_free
	movq	-64(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rdi
	movl	%r15d, %esi
	callq	_cleanup_coins
	movq	%rbx, %rdi
	callq	_lodepng_free
	movl	-44(%rbp), %eax                 ## 4-byte Reload
LBB0_39:
	addq	$72, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_lodepng_huffman_code_lengths   ; -- Begin function lodepng_huffman_code_lengths
	.p2align	2
_lodepng_huffman_code_lengths:          ; @lodepng_huffman_code_lengths
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #144
	.cfi_def_cfa_offset 144
	stp	x28, x27, [sp, #48]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #64]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #80]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #96]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #112]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #128]            ; 16-byte Folded Spill
	add	x29, sp, #128
	.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
	cbz	x2, LBB0_11
; %bb.1:
	mov	x24, x3
	mov	x23, x2
	mov	x25, x1
	mov	x19, x0
	mov	x8, #0
	mov	x27, #0
	mov	x26, #0
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w9, [x25, x8, lsl #2]
	cmp	x9, #0
	cinc	x26, x26, ne
	add	x27, x27, x9
	add	w8, w8, #1
	cmp	x8, x23
	b.lo	LBB0_2
; %bb.3:
	mov	x8, #0
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	str	wzr, [x19, x8, lsl #2]
	add	w8, w8, #1
	cmp	x8, x23
	b.lo	LBB0_4
; %bb.5:
	cbz	x26, LBB0_12
; %bb.6:
	subs	x22, x26, #1
	b.ne	LBB0_13
; %bb.7:
	mov	x8, #0
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w9, [x25, x8, lsl #2]
	cbnz	w9, LBB0_17
; %bb.9:                                ;   in Loop: Header=BB0_8 Depth=1
	add	w8, w8, #1
	cmp	x8, x23
	b.lo	LBB0_8
; %bb.10:
	mov	w0, #0
	b	LBB0_39
LBB0_11:
	mov	w0, #80
	b	LBB0_39
LBB0_12:
	mov	w0, #0
	movi.2s	v0, #1
	str	d0, [x19]
	b	LBB0_39
LBB0_13:
	lsl	w20, w26, #5
	mov	x0, x20
	bl	_lodepng_malloc
	mov	x21, x0
	mov	x0, x20
	bl	_lodepng_malloc
	cbz	x21, LBB0_18
; %bb.14:
	cbz	x0, LBB0_18
; %bb.15:
	str	w24, [sp, #24]                  ; 4-byte Folded Spill
	lsl	w24, w26, #1
	mov	x20, x0
	mov	x0, x21
	mov	x1, x24
	bl	_init_coins
	str	x20, [sp, #40]                  ; 8-byte Folded Spill
	mov	x0, x20
	mov	x1, x24
	bl	_init_coins
	mov	x0, x21
	mov	x1, x25
	mov	x2, x23
	mov	x3, x27
	bl	_append_symbol_coins
	mov	x28, x0
	mov	x0, x21
	mov	x1, x26
	bl	_sort_coins
	cbz	w28, LBB0_19
; %bb.16:
	mov	x20, x28
	b	LBB0_38
LBB0_17:
	mov	w0, #0
	mov	w9, #1
	str	w9, [x19, x8, lsl #2]
	cmp	x8, #0
	cset	w8, eq
	str	w9, [x19, w8, uxtw #2]
	b	LBB0_39
LBB0_18:
	mov	x19, x0
	mov	x0, x21
	bl	_lodepng_free
	mov	x0, x19
	bl	_lodepng_free
	mov	w0, #83
	b	LBB0_39
LBB0_19:
	ldr	w8, [sp, #24]                   ; 4-byte Folded Reload
	cbz	w8, LBB0_32
; %bb.20:
	str	x25, [sp, #16]                  ; 8-byte Folded Spill
	str	w24, [sp, #12]                  ; 4-byte Folded Spill
	mov	w25, #0
	mov	w8, #1
	str	w8, [sp, #28]                   ; 4-byte Folded Spill
	mov	x28, x26
	ldr	x8, [sp, #40]                   ; 8-byte Folded Reload
LBB0_21:                                ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_23 Depth 2
	str	x21, [sp, #40]                  ; 8-byte Folded Spill
	mov	x21, x8
	mov	x0, x8
	mov	x1, x25
	bl	_cleanup_coins
	str	x21, [sp, #32]                  ; 8-byte Folded Spill
	mov	x0, x21
	mov	x1, x25
	bl	_init_coins
	cmp	w28, #2
	b.lo	LBB0_24
; %bb.22:                               ;   in Loop: Header=BB0_21 Depth=1
	mov	w8, #0
	mov	w21, #1
	ldp	x20, x24, [sp, #32]             ; 16-byte Folded Reload
LBB0_23:                                ;   Parent Loop BB0_21 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	sub	w9, w21, #1
	add	w22, w8, #1
	add	x25, x20, w8, uxtw #4
	add	x1, x24, w9, uxtw #4
	mov	x0, x25
	bl	_coin_copy
	add	x1, x24, w21, uxtw #4
	mov	x0, x25
	bl	_add_coins
	add	w21, w21, #2
	mov	x8, x22
	cmp	w21, w28
	b.lo	LBB0_23
	b	LBB0_25
LBB0_24:                                ;   in Loop: Header=BB0_21 Depth=1
	mov	w22, #0
LBB0_25:                                ;   in Loop: Header=BB0_21 Depth=1
	ldp	w24, w25, [sp, #24]             ; 8-byte Folded Reload
	cmp	w25, w24
	b.hs	LBB0_27
; %bb.26:                               ;   in Loop: Header=BB0_21 Depth=1
	ldr	x21, [sp, #32]                  ; 8-byte Folded Reload
	add	x0, x21, w22, uxtw #4
	ldr	x1, [sp, #16]                   ; 8-byte Folded Reload
	mov	x2, x23
	mov	x3, x27
	bl	_append_symbol_coins
	mov	x20, x0
	add	w22, w22, w26
	b	LBB0_28
LBB0_27:                                ;   in Loop: Header=BB0_21 Depth=1
	mov	w20, #0
	ldr	x21, [sp, #32]                  ; 8-byte Folded Reload
LBB0_28:                                ;   in Loop: Header=BB0_21 Depth=1
	mov	x0, x21
	mov	x1, x22
	bl	_sort_coins
	add	w25, w25, #1
	str	w25, [sp, #28]                  ; 4-byte Folded Spill
	cmp	w25, w24
	mov	x9, x20
	ldr	x8, [sp, #40]                   ; 8-byte Folded Reload
	b.hi	LBB0_30
; %bb.29:                               ;   in Loop: Header=BB0_21 Depth=1
	mov	x25, x28
	mov	x28, x22
	cbz	w9, LBB0_21
LBB0_30:
	ldr	w24, [sp, #12]                  ; 4-byte Folded Reload
	cbnz	w9, LBB0_38
; %bb.31:
	subs	x22, x26, #1
	b.eq	LBB0_37
LBB0_32:
	mov	x8, #0
	b	LBB0_34
LBB0_33:                                ;   in Loop: Header=BB0_34 Depth=1
	add	x8, x8, #1
	cmp	x22, w8, uxtw
	b.ls	LBB0_37
LBB0_34:                                ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_36 Depth 2
	add	x9, x21, x8, lsl #4
	ldr	w10, [x9]
	cbz	w10, LBB0_33
; %bb.35:                               ;   in Loop: Header=BB0_34 Depth=1
	mov	x10, #0
	ldr	x11, [x9, #8]
LBB0_36:                                ;   Parent Loop BB0_34 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	x12, [x11, x10, lsl #3]
	lsl	x12, x12, #2
	ldr	w13, [x19, x12]
	add	w13, w13, #1
	str	w13, [x19, x12]
	add	x10, x10, #1
	ldr	w12, [x9]
	cmp	x10, x12
	b.lo	LBB0_36
	b	LBB0_33
LBB0_37:
	mov	w20, #0
LBB0_38:
	mov	x0, x21
	mov	x1, x24
	bl	_cleanup_coins
	mov	x0, x21
	bl	_lodepng_free
	ldr	x19, [sp, #40]                  ; 8-byte Folded Reload
	mov	x0, x19
	mov	x1, x24
	bl	_cleanup_coins
	mov	x0, x19
	bl	_lodepng_free
	mov	x0, x20
LBB0_39:
	ldp	x29, x30, [sp, #128]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #112]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #96]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #80]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #64]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #144
	ret
	.cfi_endproc
                                        ; -- End function
.subsections_via_symbols
