	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function calculate_codes
_calculate_codes:                       ## @calculate_codes
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %r14
	movq	_ff_ut_huff_cmp_len@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movl	$256, %esi                      ## imm = 0x100
	movl	$8, %edx
	callq	_qsort
	movl	$256, %ecx                      ## imm = 0x100
	.p2align	4, 0x90
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	movl	-8(%r14,%rcx,8), %eax
	leaq	-1(%rcx), %rdx
	cmpl	$255, %eax
	jne	LBB0_3
## %bb.2:                               ##   in Loop: Header=BB0_1 Depth=1
	cmpq	$1, %rcx
	movq	%rdx, %rcx
	jne	LBB0_1
LBB0_3:
	testl	$-2147483648, %edx              ## imm = 0x80000000
	jne	LBB0_11
## %bb.4:
	movl	%eax, %ecx
	negb	%cl
	movl	$1, %edi
	shrl	%cl, %edi
	movl	$1, %esi
	movl	%edi, 4(%r14,%rdx,8)
	testq	%rdx, %rdx
	jle	LBB0_11
## %bb.5:
	cmpq	$1, %rdx
	jne	LBB0_7
## %bb.6:
	movq	%rdx, %r8
	jmp	LBB0_9
LBB0_7:
	movq	%rdx, %r9
	andq	$-2, %r9
	movl	$1, %esi
	movq	%rdx, %r10
	.p2align	4, 0x90
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	decb	%al
	movl	$-2147483648, %edi              ## imm = 0x80000000
	movl	%eax, %ecx
	shrl	%cl, %edi
	addl	%esi, %edi
	movzbl	-8(%r14,%r10,8), %eax
	movl	%eax, %ecx
	negb	%cl
	movl	%edi, %ebx
	sarl	%cl, %ebx
	decb	%al
	movl	$-2147483648, %esi              ## imm = 0x80000000
	movl	%eax, %ecx
	shrl	%cl, %esi
	movl	%ebx, -4(%r14,%r10,8)
	addl	%edi, %esi
	movl	-16(%r14,%r10,8), %eax
	movl	%eax, %ecx
	negb	%cl
	movl	%esi, %edi
	sarl	%cl, %edi
	leaq	-2(%r10), %r8
	movl	%edi, -12(%r14,%r10,8)
	movq	%r8, %r10
	addq	$-2, %r9
	jne	LBB0_8
LBB0_9:
	testb	$1, %dl
	je	LBB0_11
## %bb.10:
	decb	%al
	movl	$-2147483648, %edx              ## imm = 0x80000000
	movl	%eax, %ecx
	shrl	%cl, %edx
	addl	%esi, %edx
	xorl	%ecx, %ecx
	subb	-8(%r14,%r8,8), %cl
                                        ## kill: def $cl killed $cl killed $ecx
	sarl	%cl, %edx
	movl	%edx, -4(%r14,%r8,8)
LBB0_11:
	movq	_huff_cmp_sym@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%r14, %rdi
	movl	$256, %esi                      ## imm = 0x100
	movl	$8, %edx
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmp	_qsort                          ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_ff_ut_huff_cmp_len,4,2         ## @ff_ut_huff_cmp_len
	.comm	_huff_cmp_sym,4,2               ## @huff_cmp_sym
	.no_dead_strip	_calculate_codes
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function calculate_codes
_calculate_codes:                       ; @calculate_codes
	.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
Lloh0:
	adrp	x8, _ff_ut_huff_cmp_len@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ff_ut_huff_cmp_len@GOTPAGEOFF]
Lloh2:
	ldr	w3, [x8]
	mov	w1, #256
	mov	w2, #8
	bl	_qsort
	add	x10, x19, #2052
	mov	w8, #257
LBB0_1:                                 ; =>This Inner Loop Header: Depth=1
	ldur	w9, [x10, #-12]
	sub	x10, x10, #8
	cmp	w9, #255
	ccmp	x8, #2, #4, eq
	sub	x8, x8, #1
	b.ne	LBB0_1
; %bb.2:
	sub	x11, x8, #1
	tbnz	w11, #31, LBB0_6
; %bb.3:
	neg	w12, w9
	mov	w13, #1
	lsr	w12, w13, w12
	str	w12, [x10]
	cmp	x11, #1
	b.lt	LBB0_6
; %bb.4:
	sub	x10, x10, #8
	mov	w11, #1
	mov	w12, #-2147483648
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	sub	w9, w9, #1
	lsr	w9, w12, w9
	add	w11, w9, w11
	ldur	w9, [x10, #-4]
	neg	w13, w9
	asr	w13, w11, w13
	str	w13, [x10], #-8
	sub	x8, x8, #1
	cmp	x8, #1
	b.gt	LBB0_5
LBB0_6:
Lloh3:
	adrp	x8, _huff_cmp_sym@GOTPAGE
Lloh4:
	ldr	x8, [x8, _huff_cmp_sym@GOTPAGEOFF]
Lloh5:
	ldr	w3, [x8]
	mov	x0, x19
	mov	w1, #256
	mov	w2, #8
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_qsort
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_ff_ut_huff_cmp_len,4,2         ; @ff_ut_huff_cmp_len
	.comm	_huff_cmp_sym,4,2               ; @huff_cmp_sym
	.no_dead_strip	_calculate_codes
.subsections_via_symbols
