	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function write_huff_codes
_write_huff_codes:                      ## @write_huff_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	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%r9, %rbx
	movl	%r8d, %r14d
	movl	%ecx, -48(%rbp)                 ## 4-byte Spill
	movq	%rdi, %r12
	leaq	-44(%rbp), %rdi
	callq	_init_put_bits
	movl	%r14d, -52(%rbp)                ## 4-byte Spill
	testl	%r14d, %r14d
	jle	LBB0_6
## %bb.1:
	movslq	-48(%rbp), %rax                 ## 4-byte Folded Reload
	movl	%eax, %r14d
	shlq	$3, %rax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	xorl	%eax, %eax
	leaq	-44(%rbp), %r13
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_5:                                 ##   in Loop: Header=BB0_2 Depth=1
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	incl	%eax
	addq	-64(%rbp), %r12                 ## 8-byte Folded Reload
	cmpl	-52(%rbp), %eax                 ## 4-byte Folded Reload
	je	LBB0_6
LBB0_2:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_4 Depth 2
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	cmpl	$0, -48(%rbp)                   ## 4-byte Folded Reload
	jle	LBB0_5
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	xorl	%r15d, %r15d
	.p2align	4, 0x90
LBB0_4:                                 ##   Parent Loop BB0_2 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	(%r12,%r15,8), %rax
	movl	(%rbx,%rax,8), %esi
	movl	4(%rbx,%rax,8), %edx
	movq	%r13, %rdi
	callq	_put_bits
	incq	%r15
	cmpq	%r15, %r14
	jne	LBB0_4
	jmp	LBB0_5
LBB0_6:
	leaq	-44(%rbp), %rdi
	callq	_put_bits_count
	andl	$31, %eax
	je	LBB0_8
## %bb.7:
	movl	$32, %esi
	subl	%eax, %esi
	leaq	-44(%rbp), %rdi
	xorl	%edx, %edx
	callq	_put_bits
LBB0_8:
	leaq	-44(%rbp), %r14
	movq	%r14, %rdi
	callq	_put_bits_count
	movl	%eax, %ebx
	movq	%r14, %rdi
	callq	_flush_put_bits
	movl	%ebx, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_write_huff_codes
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function write_huff_codes
_write_huff_codes:                      ; @write_huff_codes
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	mov	x19, x5
	mov	x20, x4
	mov	x21, x3
	mov	x22, x0
	add	x0, sp, #12
	bl	_init_put_bits
	cmp	w20, #1
	b.lt	LBB0_6
; %bb.1:
	mov	w23, #0
	mov	w8, w21
	sbfiz	x24, x21, #3, #32
	lsl	x25, x8, #3
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	add	w23, w23, #1
	add	x22, x22, x24
	cmp	w23, w20
	b.eq	LBB0_6
LBB0_3:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_5 Depth 2
	cmp	w21, #1
	b.lt	LBB0_2
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	x26, #0
LBB0_5:                                 ;   Parent Loop BB0_3 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	x8, [x22, x26]
	add	x8, x19, x8, lsl #3
	ldp	w1, w2, [x8]
	add	x0, sp, #12
	bl	_put_bits
	add	x26, x26, #8
	cmp	x25, x26
	b.ne	LBB0_5
	b	LBB0_2
LBB0_6:
	add	x0, sp, #12
	bl	_put_bits_count
	ands	w8, w0, #0x1f
	b.eq	LBB0_8
; %bb.7:
	mov	w9, #32
	sub	w1, w9, w8
	add	x0, sp, #12
	mov	w2, #0
	bl	_put_bits
LBB0_8:
	add	x0, sp, #12
	bl	_put_bits_count
	mov	x19, x0
	add	x0, sp, #12
	bl	_flush_put_bits
	mov	x0, x19
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_write_huff_codes
.subsections_via_symbols
