	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_write_index_as_tree            ## -- Begin function write_index_as_tree
	.p2align	4, 0x90
_write_index_as_tree:                   ## @write_index_as_tree
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%r8, %r14
	movl	%ecx, %r15d
	movq	%rdx, %rbx
	movq	%rsi, %r13
	movq	%rdi, %r12
	movq	_LOCK_INIT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -48(%rbp)
	movq	_LOCK_DIE_ON_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	-48(%rbp), %rdi
	movq	%rbx, %rsi
	callq	_hold_lock_file_for_update
	xorl	%eax, %eax
	callq	_get_git_dir
	movq	%r13, %rdi
	movq	%rbx, %rsi
	movl	%eax, %edx
	callq	_read_index_from
	testl	%eax, %eax
	js	LBB0_3
## %bb.1:
	movq	_WRITE_TREE_IGNORE_CACHE_TREE@GOTPCREL(%rip), %rax
	testl	%r15d, (%rax)
	je	LBB0_4
## %bb.2:
	movq	%r14, %rbx
LBB0_6:
	xorl	%r14d, %r14d
	jmp	LBB0_7
LBB0_3:
	movq	_WRITE_TREE_UNREADABLE_INDEX@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	jmp	LBB0_10
LBB0_4:
	movq	%r14, %rbx
	movq	(%r13), %rdi
	testq	%rdi, %rdi
	je	LBB0_6
## %bb.5:
	callq	_cache_tree_fully_valid
	testq	%rax, %rax
	setne	%r14b
LBB0_7:
	movzbl	%r14b, %edx
	movq	%r12, %rdi
	movq	%r13, %rsi
	movl	%r15d, %ecx
	movq	%rbx, %r8
	callq	_write_index_as_tree_internal
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_10
## %bb.8:
	testb	%r14b, %r14b
	jne	LBB0_10
## %bb.9:
	movq	_COMMIT_LOCK@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	-48(%rbp), %rsi
	movq	%r13, %rdi
	callq	_write_locked_index
	xorl	%ebx, %ebx
LBB0_10:
	leaq	-48(%rbp), %rdi
	callq	_rollback_lock_file
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_LOCK_INIT,4,2                  ## @LOCK_INIT
	.comm	_LOCK_DIE_ON_ERROR,4,2          ## @LOCK_DIE_ON_ERROR
	.comm	_WRITE_TREE_UNREADABLE_INDEX,4,2 ## @WRITE_TREE_UNREADABLE_INDEX
	.comm	_WRITE_TREE_IGNORE_CACHE_TREE,4,2 ## @WRITE_TREE_IGNORE_CACHE_TREE
	.comm	_COMMIT_LOCK,4,2                ## @COMMIT_LOCK
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_write_index_as_tree            ; -- Begin function write_index_as_tree
	.p2align	2
_write_index_as_tree:                   ; @write_index_as_tree
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.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
	mov	x20, x4
	mov	x21, x3
	mov	x23, x2
	mov	x19, x1
	mov	x22, x0
Lloh0:
	adrp	x8, _LOCK_INIT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _LOCK_INIT@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	str	w8, [sp, #8]
Lloh3:
	adrp	x8, _LOCK_DIE_ON_ERROR@GOTPAGE
Lloh4:
	ldr	x8, [x8, _LOCK_DIE_ON_ERROR@GOTPAGEOFF]
Lloh5:
	ldr	w2, [x8]
	add	x0, sp, #8
	mov	x1, x23
	bl	_hold_lock_file_for_update
	bl	_get_git_dir
	mov	x2, x0
	mov	x0, x19
	mov	x1, x23
	bl	_read_index_from
	tbnz	w0, #31, LBB0_3
; %bb.1:
Lloh6:
	adrp	x8, _WRITE_TREE_IGNORE_CACHE_TREE@GOTPAGE
Lloh7:
	ldr	x8, [x8, _WRITE_TREE_IGNORE_CACHE_TREE@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	tst	w8, w21
	b.eq	LBB0_4
LBB0_2:
	mov	w23, #0
	b	LBB0_6
LBB0_3:
Lloh9:
	adrp	x8, _WRITE_TREE_UNREADABLE_INDEX@GOTPAGE
Lloh10:
	ldr	x8, [x8, _WRITE_TREE_UNREADABLE_INDEX@GOTPAGEOFF]
Lloh11:
	ldr	w20, [x8]
	b	LBB0_9
LBB0_4:
	ldr	x0, [x19]
	cbz	x0, LBB0_2
; %bb.5:
	bl	_cache_tree_fully_valid
	cmp	x0, #0
	cset	w23, ne
LBB0_6:
	mov	x0, x22
	mov	x1, x19
	mov	x2, x23
	mov	x3, x21
	mov	x4, x20
	bl	_write_index_as_tree_internal
	mov	x20, x0
	cbnz	w0, LBB0_9
; %bb.7:
	tbnz	w23, #0, LBB0_9
; %bb.8:
Lloh12:
	adrp	x8, _COMMIT_LOCK@GOTPAGE
Lloh13:
	ldr	x8, [x8, _COMMIT_LOCK@GOTPAGEOFF]
Lloh14:
	ldr	w2, [x8]
	add	x1, sp, #8
	mov	x0, x19
	bl	_write_locked_index
	mov	w20, #0
LBB0_9:
	add	x0, sp, #8
	bl	_rollback_lock_file
	mov	x0, x20
	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
	add	sp, sp, #80
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_LOCK_INIT,4,2                  ; @LOCK_INIT
	.comm	_LOCK_DIE_ON_ERROR,4,2          ; @LOCK_DIE_ON_ERROR
	.comm	_WRITE_TREE_UNREADABLE_INDEX,4,2 ; @WRITE_TREE_UNREADABLE_INDEX
	.comm	_WRITE_TREE_IGNORE_CACHE_TREE,4,2 ; @WRITE_TREE_IGNORE_CACHE_TREE
	.comm	_COMMIT_LOCK,4,2                ; @COMMIT_LOCK
.subsections_via_symbols
