	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_Xz_WriteFooter                 ## -- Begin function Xz_WriteFooter
	.p2align	4, 0x90
_Xz_WriteFooter:                        ## @Xz_WriteFooter
	.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	$296, %rsp                      ## imm = 0x128
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movq	%rdi, %r15
	movq	%rdi, -328(%rbp)                ## 8-byte Spill
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	_CRC_INIT_VAL@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -308(%rbp)
	leaq	-296(%rbp), %rdi
	movq	(%r15), %rsi
	callq	_Xz_WriteVarInt
	movl	%eax, %ebx
	incl	%ebx
	movq	$0, -304(%rbp)
	leaq	-304(%rbp), %rsi
	leaq	-308(%rbp), %rcx
	movq	%r14, -320(%rbp)                ## 8-byte Spill
	movq	%r14, %rdi
	movl	%ebx, %edx
	callq	_WriteBytesAndCrc
	movl	%eax, %edi
	callq	_RINOK
	cmpq	$0, (%r15)
	je	LBB0_3
## %bb.1:
	movl	$8, %r13d
	xorl	%r15d, %r15d
	.p2align	4, 0x90
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	-328(%rbp), %rax                ## 8-byte Reload
	movq	16(%rax), %r12
	movq	-8(%r12,%r13), %rsi
	leaq	-304(%rbp), %rdi
	callq	_Xz_WriteVarInt
	movl	%eax, %r14d
	movl	%eax, %eax
	leaq	-304(,%rax,8), %rdi
	addq	%rbp, %rdi
	movq	(%r12,%r13), %rsi
	callq	_Xz_WriteVarInt
	addl	%eax, %r14d
	addl	%r14d, %ebx
	movq	-320(%rbp), %rdi                ## 8-byte Reload
	leaq	-304(%rbp), %rsi
	movl	%r14d, %edx
	leaq	-308(%rbp), %rcx
	callq	_WriteBytesAndCrc
	movl	%eax, %edi
	callq	_RINOK
	incq	%r15
	addq	$16, %r13
	movq	-328(%rbp), %rax                ## 8-byte Reload
	cmpq	(%rax), %r15
	jb	LBB0_2
LBB0_3:
	movl	%ebx, %eax
	andl	$3, %eax
	je	LBB0_4
## %bb.5:
	movl	$4, %r14d
	subl	%eax, %r14d
	xorps	%xmm0, %xmm0
	movaps	%xmm0, -304(%rbp)
	movq	$0, -288(%rbp)
	leaq	-304(%rbp), %rsi
	leaq	-308(%rbp), %rcx
	movq	-320(%rbp), %r15                ## 8-byte Reload
	movq	%r15, %rdi
	movl	%r14d, %edx
	callq	_WriteBytesAndCrc
	movl	%eax, %edi
	callq	_RINOK
	addl	%r14d, %ebx
	jmp	LBB0_6
LBB0_4:
	movq	-320(%rbp), %r15                ## 8-byte Reload
LBB0_6:
	movl	-308(%rbp), %edi
	callq	_CRC_GET_DIGEST
	leaq	-304(%rbp), %r12
	movq	%r12, %rdi
	movl	%eax, %esi
	callq	_SetUi32
	movq	%r15, %rdi
	movq	%r12, %rsi
	movl	$4, %edx
	callq	_WriteBytes
	movl	%eax, %edi
	callq	_RINOK
	addl	$4, %ebx
	shrl	$2, %ebx
	decl	%ebx
	leaq	-272(%rbp), %r14
	movq	%r14, %rdi
	movl	%ebx, %esi
	callq	_SetUi32
	movq	-328(%rbp), %rax                ## 8-byte Reload
	movl	8(%rax), %eax
	movzbl	%al, %ecx
                                        ## kill: def $eax killed $eax killed $rax
	sarl	$8, %eax
	cltq
	movq	%rax, -240(%rbp)
	movq	%rcx, -232(%rbp)
	movq	%r14, %rdi
	movl	$6, %esi
	callq	_CrcCalc
	movq	%r12, %rdi
	movl	%eax, %esi
	callq	_SetUi32
	leaq	-224(%rbp), %rdi
	movq	_XZ_FOOTER_SIG@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_XZ_FOOTER_SIG_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_memcpy
	movq	%r15, %rdi
	movq	%r12, %rsi
	movl	$12, %edx
	callq	_WriteBytes
	movq	___stack_chk_guard@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	-48(%rbp), %rcx
	jne	LBB0_8
## %bb.7:
	addq	$296, %rsp                      ## imm = 0x128
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_CRC_INIT_VAL,4,2               ## @CRC_INIT_VAL
	.comm	_XZ_FOOTER_SIG,4,2              ## @XZ_FOOTER_SIG
	.comm	_XZ_FOOTER_SIG_SIZE,4,2         ## @XZ_FOOTER_SIG_SIZE
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_Xz_WriteFooter                 ; -- Begin function Xz_WriteFooter
	.p2align	2
_Xz_WriteFooter:                        ; @Xz_WriteFooter
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #368
	.cfi_def_cfa_offset 368
	stp	x28, x27, [sp, #272]            ; 16-byte Folded Spill
	stp	x26, x25, [sp, #288]            ; 16-byte Folded Spill
	stp	x24, x23, [sp, #304]            ; 16-byte Folded Spill
	stp	x22, x21, [sp, #320]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #336]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #352]            ; 16-byte Folded Spill
	add	x29, sp, #352
	.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, x1
	mov	x20, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
Lloh3:
	adrp	x9, _CRC_INIT_VAL@GOTPAGE
Lloh4:
	ldr	x9, [x9, _CRC_INIT_VAL@GOTPAGEOFF]
	stur	x8, [x29, #-88]
Lloh5:
	ldr	w8, [x9]
	str	w8, [sp, #4]
	add	x23, sp, #8
	add	x0, x23, #8
	ldr	x1, [x20]
	bl	_Xz_WriteVarInt
	add	w21, w0, #1
	str	xzr, [sp, #8]
	add	x1, sp, #8
	add	x3, sp, #4
	mov	x0, x19
	mov	x2, x21
	bl	_WriteBytesAndCrc
	bl	_RINOK
	ldr	x8, [x20]
	cbz	x8, LBB0_3
; %bb.1:
	mov	x24, #0
	mov	x25, #0
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x20, #16]
	add	x26, x8, x24
	ldr	x1, [x26]
	add	x0, sp, #8
	bl	_Xz_WriteVarInt
	mov	x22, x0
	add	x0, x23, w0, uxtw #3
	ldr	x1, [x26, #8]
	bl	_Xz_WriteVarInt
	add	w2, w0, w22
	add	w21, w2, w21
	add	x1, sp, #8
	add	x3, sp, #4
	mov	x0, x19
	bl	_WriteBytesAndCrc
	bl	_RINOK
	add	x25, x25, #1
	ldr	x8, [x20]
	add	x24, x24, #16
	cmp	x25, x8
	b.lo	LBB0_2
LBB0_3:
	ands	w8, w21, #0x3
	b.eq	LBB0_5
; %bb.4:
	mov	w9, #4
	sub	w22, w9, w8
	stp	xzr, xzr, [sp, #8]
	str	xzr, [sp, #24]
	add	x1, sp, #8
	add	x3, sp, #4
	mov	x0, x19
	mov	x2, x22
	bl	_WriteBytesAndCrc
	bl	_RINOK
	add	w21, w22, w21
LBB0_5:
	ldr	w0, [sp, #4]
	bl	_CRC_GET_DIGEST
	mov	x1, x0
	add	x22, sp, #8
	add	x0, sp, #8
	bl	_SetUi32
	add	x1, sp, #8
	mov	x0, x19
	mov	w2, #4
	bl	_WriteBytes
	bl	_RINOK
	add	w8, w21, #4
	lsr	w8, w8, #2
	sub	w1, w8, #1
	add	x21, x22, #32
	mov	x0, x21
	bl	_SetUi32
	ldr	w8, [x20, #8]
	and	x9, x8, #0xff
                                        ; kill: def $w8 killed $w8 killed $x8 def $x8
	sbfx	x8, x8, #8, #24
	stp	x8, x9, [sp, #72]
	mov	x0, x21
	mov	w1, #6
	bl	_CrcCalc
	mov	x1, x0
	add	x0, sp, #8
	bl	_SetUi32
	add	x0, x22, #80
Lloh6:
	adrp	x8, _XZ_FOOTER_SIG@GOTPAGE
Lloh7:
	ldr	x8, [x8, _XZ_FOOTER_SIG@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
Lloh9:
	adrp	x8, _XZ_FOOTER_SIG_SIZE@GOTPAGE
Lloh10:
	ldr	x8, [x8, _XZ_FOOTER_SIG_SIZE@GOTPAGEOFF]
Lloh11:
	ldr	w2, [x8]
	bl	_memcpy
	add	x1, sp, #8
	mov	x0, x19
	mov	w2, #12
	bl	_WriteBytes
	ldur	x8, [x29, #-88]
Lloh12:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh13:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh14:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_7
; %bb.6:
	ldp	x29, x30, [sp, #352]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #336]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #320]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #304]            ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #288]            ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #272]            ; 16-byte Folded Reload
	add	sp, sp, #368
	ret
LBB0_7:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_CRC_INIT_VAL,4,2               ; @CRC_INIT_VAL
	.comm	_XZ_FOOTER_SIG,4,2              ; @XZ_FOOTER_SIG
	.comm	_XZ_FOOTER_SIG_SIZE,4,2         ; @XZ_FOOTER_SIG_SIZE
.subsections_via_symbols
