	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_XzBlock_WriteHeader            ## -- Begin function XzBlock_WriteHeader
	.p2align	4, 0x90
_XzBlock_WriteHeader:                   ## @XzBlock_WriteHeader
	.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	%rsi, -56(%rbp)                 ## 8-byte Spill
	movq	%rdi, %rbx
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	_XZ_BLOCK_HEADER_SIZE_MAX@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	shlq	$3, %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %r15
	movq	24(%rbx), %rax
	movq	%rax, 8(%r15)
	movq	%rbx, %rdi
	callq	_XzBlock_HasPackSize
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	leaq	16(%r15), %rdi
	movq	16(%rbx), %rsi
	callq	_Xz_WriteVarInt
	movq	%rax, %r13
	addl	$2, %r13d
	jmp	LBB0_3
LBB0_2:
	movl	$2, %r13d
LBB0_3:
	movq	%rbx, %rdi
	callq	_XzBlock_HasUnpackSize
	testq	%rax, %rax
	je	LBB0_5
## %bb.4:
	movl	%r13d, %eax
	leaq	(%r15,%rax,8), %rdi
	movq	8(%rbx), %rsi
	callq	_Xz_WriteVarInt
	addl	%r13d, %eax
	movl	%eax, %r13d
LBB0_5:
	movq	%rbx, %rdi
	callq	_XzBlock_GetNumFilters
	testl	%eax, %eax
	jle	LBB0_8
## %bb.6:
	movl	%eax, %eax
	shlq	$3, %rax
	leaq	(%rax,%rax,2), %rax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	xorl	%r12d, %r12d
	movq	%rbx, -72(%rbp)                 ## 8-byte Spill
	.p2align	4, 0x90
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%rbx), %r14
	movl	%r13d, %eax
	leaq	(%r15,%rax,8), %rdi
	movq	16(%r14,%r12), %rsi
	callq	_Xz_WriteVarInt
	movq	%rax, %rbx
	addl	%r13d, %ebx
	leaq	(%r15,%rbx,8), %rdi
	movq	(%r14,%r12), %rsi
	callq	_Xz_WriteVarInt
	movq	%rax, %r13
	addl	%ebx, %r13d
	movq	-72(%rbp), %rbx                 ## 8-byte Reload
	leaq	(%r15,%r13,8), %rdi
	movl	8(%r14,%r12), %esi
	movq	(%r14,%r12), %rdx
	callq	_memcpy
	addl	(%r14,%r12), %r13d
	addq	$24, %r12
	cmpq	%r12, -64(%rbp)                 ## 8-byte Folded Reload
	jne	LBB0_7
LBB0_8:
	testb	$3, %r13b
	je	LBB0_16
## %bb.9:
	leal	1(%r13), %eax
	movl	%r13d, %ecx
	movq	$0, (%r15,%rcx,8)
	testb	$3, %al
	je	LBB0_15
## %bb.10:
	leal	2(%r13), %ecx
	movl	%eax, %eax
	movq	$0, (%r15,%rax,8)
	testb	$3, %cl
	je	LBB0_14
## %bb.11:
	leal	3(%r13), %eax
	movl	%ecx, %ecx
	movq	$0, (%r15,%rcx,8)
	testb	$3, %al
	je	LBB0_15
## %bb.12:
	addl	$4, %r13d
	movl	%eax, %eax
	movq	$0, (%r15,%rax,8)
	jmp	LBB0_16
LBB0_15:
	movl	%eax, %r13d
	jmp	LBB0_16
LBB0_14:
	movl	%ecx, %r13d
LBB0_16:
	movl	%r13d, %eax
	shrl	$2, %eax
	movq	%rax, (%r15)
	movl	%r13d, %eax
	leaq	(%r15,%rax,8), %rbx
	movq	%r15, %rdi
	movl	%r13d, %esi
	callq	_CrcCalc
	movq	%rbx, %rdi
	movl	%eax, %esi
	callq	_SetUi32
	addl	$4, %r13d
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movq	%r15, %rsi
	movl	%r13d, %edx
	callq	_WriteBytes
	movq	___stack_chk_guard@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	-48(%rbp), %rcx
	jne	LBB0_18
## %bb.17:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_18:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_XZ_BLOCK_HEADER_SIZE_MAX,4,2   ## @XZ_BLOCK_HEADER_SIZE_MAX
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_XzBlock_WriteHeader            ; -- Begin function XzBlock_WriteHeader
	.p2align	2
_XzBlock_WriteHeader:                   ; @XzBlock_WriteHeader
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	sub	sp, sp, #16
	mov	x19, x1
	mov	x22, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-72]
Lloh3:
	adrp	x8, _XZ_BLOCK_HEADER_SIZE_MAX@GOTPAGE
Lloh4:
	ldr	x8, [x8, _XZ_BLOCK_HEADER_SIZE_MAX@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	lsl	x8, x8, #3
	mov	x9, x8
Lloh6:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh7:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x9, sp
	add	x8, x8, #15
	and	x8, x8, #0xffffffff0
	sub	x20, x9, x8
	mov	sp, x20
	ldr	x8, [x0, #24]
	str	x8, [x20, #8]
	bl	_XzBlock_HasPackSize
	cbz	x0, LBB0_2
; %bb.1:
	add	x0, x20, #16
	ldr	x1, [x22, #16]
	bl	_Xz_WriteVarInt
	add	w21, w0, #2
	b	LBB0_3
LBB0_2:
	mov	w21, #2
LBB0_3:
	mov	x0, x22
	bl	_XzBlock_HasUnpackSize
	cbz	x0, LBB0_5
; %bb.4:
	add	x0, x20, w21, uxtw #3
	ldr	x1, [x22, #8]
	bl	_Xz_WriteVarInt
	add	w21, w21, w0
LBB0_5:
	mov	x0, x22
	bl	_XzBlock_GetNumFilters
	cmp	w0, #1
	b.lt	LBB0_8
; %bb.6:
	mov	x23, #0
	mov	w8, #24
	umull	x24, w0, w8
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x22]
	add	x0, x20, w21, uxtw #3
	add	x25, x8, x23
	ldr	x1, [x25, #16]
	bl	_Xz_WriteVarInt
	add	w21, w21, w0
	add	x0, x20, w21, uxtw #3
	ldr	x1, [x25]
	bl	_Xz_WriteVarInt
	add	w21, w21, w0
	add	x0, x20, w21, uxtw #3
	ldr	w1, [x25, #8]
	ldr	x2, [x25]
	bl	_memcpy
	ldr	w8, [x25]
	add	w21, w21, w8
	add	x23, x23, #24
	cmp	x24, x23
	b.ne	LBB0_7
LBB0_8:
	tst	w21, #0x3
	b.eq	LBB0_15
; %bb.9:
	add	w8, w21, #1
	str	xzr, [x20, w21, uxtw #3]
	tst	w8, #0x3
	b.eq	LBB0_13
; %bb.10:
	add	w9, w21, #2
	str	xzr, [x20, w8, uxtw #3]
	tst	w9, #0x3
	b.eq	LBB0_14
; %bb.11:
	add	w8, w21, #3
	str	xzr, [x20, w9, uxtw #3]
	tst	w8, #0x3
	b.eq	LBB0_13
; %bb.12:
	add	w21, w21, #4
	str	xzr, [x20, w8, uxtw #3]
	b	LBB0_15
LBB0_13:
	mov	x21, x8
	b	LBB0_15
LBB0_14:
	mov	x21, x9
LBB0_15:
	lsr	w8, w21, #2
	str	x8, [x20]
	add	x22, x20, w21, uxtw #3
	mov	x0, x20
	mov	x1, x21
	bl	_CrcCalc
	mov	x1, x0
	mov	x0, x22
	bl	_SetUi32
	add	w2, w21, #4
	mov	x0, x19
	mov	x1, x20
	bl	_WriteBytes
	ldur	x8, [x29, #-72]
Lloh8:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh9:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh10:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_17
; %bb.16:
	sub	sp, x29, #64
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
LBB0_17:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_XZ_BLOCK_HEADER_SIZE_MAX,4,2   ; @XZ_BLOCK_HEADER_SIZE_MAX
.subsections_via_symbols
