	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function BuildAndStoreHuffmanTree
_BuildAndStoreHuffmanTree:              ## @BuildAndStoreHuffmanTree
	.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
	movq	%r9, -88(%rbp)                  ## 8-byte Spill
	movq	%rcx, %r9
	movq	%rdx, -112(%rbp)                ## 8-byte Spill
	movq	%rsi, %r13
	movq	%rdi, %r14
	movq	16(%rbp), %rcx
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	xorps	%xmm0, %xmm0
	movaps	%xmm0, -64(%rbp)
	movaps	%xmm0, -80(%rbp)
	testq	%rsi, %rsi
	movq	%r8, -104(%rbp)                 ## 8-byte Spill
	je	LBB0_1
## %bb.4:
	xorl	%eax, %eax
	xorl	%r12d, %r12d
	jmp	LBB0_5
	.p2align	4, 0x90
LBB0_7:                                 ##   in Loop: Header=BB0_5 Depth=1
	movq	%rax, -80(%rbp,%r12,8)
LBB0_9:                                 ##   in Loop: Header=BB0_5 Depth=1
	incq	%r12
LBB0_10:                                ##   in Loop: Header=BB0_5 Depth=1
	incq	%rax
	cmpq	%rax, %r13
	je	LBB0_11
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	cmpq	$0, (%r14,%rax,8)
	je	LBB0_10
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=1
	cmpq	$3, %r12
	jbe	LBB0_7
## %bb.8:                               ##   in Loop: Header=BB0_5 Depth=1
	cmpq	$4, %r12
	je	LBB0_9
LBB0_11:
	movq	%r13, %rax
	decq	%rax
	jne	LBB0_2
## %bb.12:
	xorl	%r15d, %r15d
	jmp	LBB0_13
LBB0_1:
	movq	$-1, %rax
	xorl	%r12d, %r12d
LBB0_2:
	xorl	%r15d, %r15d
	movq	%rax, %rdx
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	shrq	%rdx
	incq	%r15
	cmpq	$1, %rax
	movq	%rdx, %rax
	ja	LBB0_3
LBB0_13:
	cmpq	$1, %r12
	ja	LBB0_15
## %bb.14:
	movl	$4, %edi
	movl	$1, %esi
	movq	-88(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rdx
	movq	%rcx, %r14
	movq	%r9, %r12
	callq	_BrotliWriteBits
	movq	%rbx, %rdx
	movq	-80(%rbp), %rbx
	movq	%r15, %rdi
	movq	%rbx, %rsi
	movq	%r14, %rcx
	callq	_BrotliWriteBits
	movq	$0, (%r12,%rbx,8)
	movq	-104(%rbp), %rax                ## 8-byte Reload
	movq	$0, (%rax,%rbx,8)
	jmp	LBB0_17
LBB0_15:
	movq	%rcx, -96(%rbp)                 ## 8-byte Spill
	leaq	(,%r13,8), %rdx
	movq	%r9, %rdi
	xorl	%esi, %esi
	movq	%r9, %rbx
	callq	_memset
	movq	%r14, %rdi
	movq	%r13, %rsi
	movl	$15, %edx
	movq	-112(%rbp), %r14                ## 8-byte Reload
	movq	%r14, %rcx
	movq	%rbx, %r8
	callq	_BrotliCreateHuffmanTree
	movq	%rbx, %rdi
	movq	%r13, %rsi
	movq	-104(%rbp), %rdx                ## 8-byte Reload
	callq	_BrotliConvertBitDepthsToSymbols
	cmpq	$4, %r12
	ja	LBB0_19
## %bb.16:
	leaq	-80(%rbp), %rsi
	movq	%rbx, %rdi
	movq	%r12, %rdx
	movq	%r15, %rcx
	movq	-88(%rbp), %r8                  ## 8-byte Reload
	movq	-96(%rbp), %r9                  ## 8-byte Reload
	callq	_StoreSimpleHuffmanTree
LBB0_17:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_21
## %bb.18:
	addq	$72, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_19:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_21
## %bb.20:
	movq	%rbx, %rdi
	movq	%r13, %rsi
	movq	%r14, %rdx
	movq	-88(%rbp), %rcx                 ## 8-byte Reload
	movq	-96(%rbp), %r8                  ## 8-byte Reload
	addq	$72, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_BrotliStoreHuffmanTree         ## TAILCALL
LBB0_21:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_BuildAndStoreHuffmanTree
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function BuildAndStoreHuffmanTree
_BuildAndStoreHuffmanTree:              ; @BuildAndStoreHuffmanTree
	.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
	mov	x19, x6
	mov	x20, x5
	mov	x22, x4
	mov	x21, x3
	mov	x23, x2
	mov	x24, x1
	mov	x26, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [sp, #40]
	movi.2d	v0, #0000000000000000
	stp	q0, q0, [sp]
	cbz	x1, LBB0_10
; %bb.1:
	mov	x8, #0
	mov	x25, #0
	mov	x9, sp
	b	LBB0_5
LBB0_2:                                 ;   in Loop: Header=BB0_5 Depth=1
	str	x8, [x9, x25, lsl #3]
LBB0_3:                                 ;   in Loop: Header=BB0_5 Depth=1
	add	x25, x25, #1
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=1
	add	x8, x8, #1
	cmp	x24, x8
	b.eq	LBB0_8
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x10, [x26, x8, lsl #3]
	cbz	x10, LBB0_4
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	cmp	x25, #3
	b.ls	LBB0_2
; %bb.7:                                ;   in Loop: Header=BB0_5 Depth=1
	cmp	x25, #4
	b.eq	LBB0_3
LBB0_8:
	subs	x8, x24, #1
	b.ne	LBB0_11
; %bb.9:
	mov	x27, #0
	b	LBB0_13
LBB0_10:
	mov	x25, #0
	mov	x8, #-1
LBB0_11:
	mov	x27, #0
LBB0_12:                                ; =>This Inner Loop Header: Depth=1
	lsr	x9, x8, #1
	add	x27, x27, #1
	cmp	x8, #1
	mov	x8, x9
	b.hi	LBB0_12
LBB0_13:
	cmp	x25, #1
	b.hi	LBB0_15
; %bb.14:
	mov	w0, #4
	mov	w1, #1
	mov	x2, x20
	mov	x3, x19
	bl	_BrotliWriteBits
	ldr	x23, [sp]
	mov	x0, x27
	mov	x1, x23
	mov	x2, x20
	mov	x3, x19
	bl	_BrotliWriteBits
	lsl	x8, x23, #3
	str	xzr, [x21, x8]
	str	xzr, [x22, x8]
	b	LBB0_17
LBB0_15:
	lsl	x2, x24, #3
	mov	x0, x21
	mov	w1, #0
	bl	_memset
	mov	x0, x26
	mov	x1, x24
	mov	w2, #15
	mov	x3, x23
	mov	x4, x21
	bl	_BrotliCreateHuffmanTree
	mov	x0, x21
	mov	x1, x24
	mov	x2, x22
	bl	_BrotliConvertBitDepthsToSymbols
	cmp	x25, #4
	b.hi	LBB0_19
; %bb.16:
	mov	x1, sp
	mov	x0, x21
	mov	x2, x25
	mov	x3, x27
	mov	x4, x20
	mov	x5, x19
	bl	_StoreSimpleHuffmanTree
LBB0_17:
	ldr	x8, [sp, #40]
Lloh3:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh4:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_21
; %bb.18:
	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
LBB0_19:
	ldr	x8, [sp, #40]
Lloh6:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh7:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh8:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_21
; %bb.20:
	mov	x0, x21
	mov	x1, x24
	mov	x2, x23
	mov	x3, x20
	mov	x4, x19
	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
	b	_BrotliStoreHuffmanTree
LBB0_21:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_BuildAndStoreHuffmanTree
.subsections_via_symbols
