	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_write_locked_index             ## -- Begin function write_locked_index
	.p2align	4, 0x90
_write_locked_index:                    ## @write_locked_index
	.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
	movl	%edx, %r15d
	movq	%rsi, %r14
	movq	%rdi, %rbx
	movq	16(%rdi), %r12
	leaq	L_.str(%rip), %rdi
	xorl	%esi, %esi
	callq	_git_env_bool
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movq	_the_repository@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	%rbx, %rsi
	callq	_cache_tree_verify
LBB0_2:
	movq	_SKIP_IF_UNCHANGED@GOTPCREL(%rip), %rax
	testl	%r15d, (%rax)
	je	LBB0_4
## %bb.3:
	cmpl	$0, (%rbx)
	je	LBB0_16
LBB0_4:
	cmpq	$0, 8(%rbx)
	je	LBB0_6
## %bb.5:
	movq	%rbx, %rdi
	callq	_fill_fsmonitor_bitmap
LBB0_6:
	testq	%r12, %r12
	je	LBB0_9
## %bb.7:
	movq	_alternate_index_output@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	jne	LBB0_9
## %bb.8:
	movq	_EXTMASK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	notl	%eax
	testl	%eax, (%rbx)
	je	LBB0_17
LBB0_9:
	testq	%r12, %r12
	je	LBB0_11
LBB0_10:
	movq	%r12, %rdi
	callq	_oidclr
LBB0_11:
	movq	%rbx, %rdi
	movq	%r14, %rsi
	movl	%r15d, %edx
	callq	_do_write_locked_index
LBB0_12:
	movl	%eax, %r13d
LBB0_13:
	movq	_COMMIT_LOCK@GOTPCREL(%rip), %rax
	testl	%r15d, (%rax)
	je	LBB0_15
LBB0_14:
	movq	%r14, %rdi
	callq	_rollback_lock_file
LBB0_15:
	movl	%r13d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_16:
	movq	_COMMIT_LOCK@GOTPCREL(%rip), %rax
	xorl	%r13d, %r13d
	testl	%r15d, (%rax)
	jne	LBB0_14
	jmp	LBB0_15
LBB0_17:
	leaq	L_.str.1(%rip), %rdi
	xorl	%esi, %esi
	callq	_git_env_bool
	testq	%rax, %rax
	je	LBB0_20
## %bb.18:
	movq	(%r12), %rax
	movl	(%rax), %eax
	andl	$14, %eax
	cmpl	$5, %eax
	ja	LBB0_20
## %bb.19:
	movq	_SPLIT_INDEX_ORDERED@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, (%rbx)
LBB0_20:
	movq	%rbx, %rdi
	callq	_too_many_not_shared_entries
	testq	%rax, %rax
	je	LBB0_22
## %bb.21:
	movq	_SPLIT_INDEX_ORDERED@GOTPCREL(%rip), %rcx
	movl	(%rbx), %eax
	orl	(%rcx), %eax
	movl	%eax, (%rbx)
	jmp	LBB0_23
LBB0_22:
	movl	(%rbx), %eax
LBB0_23:
	movq	_SPLIT_INDEX_ORDERED@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_29
## %bb.24:
	leaq	L_.str.2(%rip), %rdi
	xorl	%eax, %eax
	callq	_git_path
	movq	%rax, %rdi
	xorl	%esi, %esi
	movl	$438, %edx                      ## imm = 0x1B6
	callq	_mks_tempfile_sm
	movq	%rax, -48(%rbp)
	testq	%rax, %rax
	je	LBB0_10
## %bb.25:
	leaq	-48(%rbp), %rsi
	movq	%rbx, %rdi
	callq	_write_shared_index
	movl	%eax, %r13d
	movq	_errno@GOTPCREL(%rip), %rax
	movl	(%rax), %r12d
	movq	-48(%rbp), %rdi
	callq	_is_tempfile_active
	testq	%rax, %rax
	je	LBB0_27
## %bb.26:
	leaq	-48(%rbp), %rdi
	callq	_delete_tempfile
LBB0_27:
	movq	_errno@GOTPCREL(%rip), %rax
	movl	%r12d, (%rax)
	testl	%r13d, %r13d
	jne	LBB0_13
## %bb.28:
	movq	%rbx, %rdi
	movq	%r14, %rsi
	movl	%r15d, %edx
	callq	_write_split_index
	jmp	LBB0_12
LBB0_29:
	movq	%rbx, %rdi
	movq	%r14, %rsi
	movl	%r15d, %edx
	callq	_write_split_index
	movl	%eax, %r13d
	testl	%eax, %eax
	jne	LBB0_13
## %bb.30:
	movq	%r12, %rdi
	callq	_is_null_oid
	xorl	%r13d, %r13d
	testl	%eax, %eax
	jne	LBB0_13
## %bb.31:
	movq	%r12, %rdi
	callq	_oid_to_hex
	leaq	L_.str.3(%rip), %rdi
	xorl	%r13d, %r13d
	movl	%eax, %esi
	xorl	%eax, %eax
	callq	_git_path
	movq	%rax, %rdi
	movl	$1, %esi
	callq	_freshen_shared_index
	jmp	LBB0_13
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"GIT_TEST_CHECK_CACHE_TREE"

	.comm	_the_repository,4,2             ## @the_repository
	.comm	_SKIP_IF_UNCHANGED,4,2          ## @SKIP_IF_UNCHANGED
	.comm	_COMMIT_LOCK,4,2                ## @COMMIT_LOCK
	.comm	_alternate_index_output,8,3     ## @alternate_index_output
	.comm	_EXTMASK,4,2                    ## @EXTMASK
L_.str.1:                               ## @.str.1
	.asciz	"GIT_TEST_SPLIT_INDEX"

	.comm	_SPLIT_INDEX_ORDERED,4,2        ## @SPLIT_INDEX_ORDERED
L_.str.2:                               ## @.str.2
	.asciz	"sharedindex_XXXXXX"

	.comm	_errno,4,2                      ## @errno
L_.str.3:                               ## @.str.3
	.asciz	"sharedindex.%s"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_write_locked_index             ; -- Begin function write_locked_index
	.p2align	2
_write_locked_index:                    ; @write_locked_index
	.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, x2
	mov	x19, x1
	mov	x21, x0
	ldr	x22, [x0, #16]
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	mov	w1, #0
	bl	_git_env_bool
	cbz	x0, LBB0_2
; %bb.1:
Lloh2:
	adrp	x8, _the_repository@GOTPAGE
Lloh3:
	ldr	x8, [x8, _the_repository@GOTPAGEOFF]
Lloh4:
	ldr	w0, [x8]
	mov	x1, x21
	bl	_cache_tree_verify
LBB0_2:
Lloh5:
	adrp	x8, _SKIP_IF_UNCHANGED@GOTPAGE
Lloh6:
	ldr	x8, [x8, _SKIP_IF_UNCHANGED@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	tst	w8, w20
	b.eq	LBB0_4
; %bb.3:
	ldr	w8, [x21]
	cbz	w8, LBB0_15
LBB0_4:
	ldr	x8, [x21, #8]
	cbz	x8, LBB0_6
; %bb.5:
	mov	x0, x21
	bl	_fill_fsmonitor_bitmap
LBB0_6:
	cbz	x22, LBB0_9
; %bb.7:
Lloh8:
	adrp	x8, _alternate_index_output@GOTPAGE
Lloh9:
	ldr	x8, [x8, _alternate_index_output@GOTPAGEOFF]
Lloh10:
	ldr	x8, [x8]
	cbnz	x8, LBB0_9
; %bb.8:
	ldr	w8, [x21]
Lloh11:
	adrp	x9, _EXTMASK@GOTPAGE
Lloh12:
	ldr	x9, [x9, _EXTMASK@GOTPAGEOFF]
Lloh13:
	ldr	w9, [x9]
	bics	wzr, w8, w9
	b.eq	LBB0_19
LBB0_9:
	cbz	x22, LBB0_11
LBB0_10:
	mov	x0, x22
	bl	_oidclr
LBB0_11:
	mov	x0, x21
	mov	x1, x19
	mov	x2, x20
	bl	_do_write_locked_index
LBB0_12:
	mov	x23, x0
LBB0_13:
Lloh14:
	adrp	x8, _COMMIT_LOCK@GOTPAGE
Lloh15:
	ldr	x8, [x8, _COMMIT_LOCK@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
	tst	w8, w20
	b.eq	LBB0_18
; %bb.14:
	mov	x0, x19
	bl	_rollback_lock_file
	b	LBB0_18
LBB0_15:
Lloh17:
	adrp	x8, _COMMIT_LOCK@GOTPAGE
Lloh18:
	ldr	x8, [x8, _COMMIT_LOCK@GOTPAGEOFF]
Lloh19:
	ldr	w8, [x8]
	tst	w8, w20
	b.eq	LBB0_17
; %bb.16:
	mov	x0, x19
	bl	_rollback_lock_file
LBB0_17:
	mov	w23, #0
LBB0_18:
	mov	x0, x23
	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
LBB0_19:
Lloh20:
	adrp	x0, l_.str.1@PAGE
Lloh21:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	w1, #0
	bl	_git_env_bool
Lloh22:
	adrp	x23, _SPLIT_INDEX_ORDERED@GOTPAGE
Lloh23:
	ldr	x23, [x23, _SPLIT_INDEX_ORDERED@GOTPAGEOFF]
	cbz	x0, LBB0_22
; %bb.20:
	ldr	x8, [x22]
	ldr	w8, [x8]
	and	w8, w8, #0xe
	cmp	w8, #5
	b.hi	LBB0_22
; %bb.21:
	ldr	w8, [x23]
	ldr	w9, [x21]
	orr	w8, w9, w8
	str	w8, [x21]
LBB0_22:
	mov	x0, x21
	bl	_too_many_not_shared_entries
	cbz	x0, LBB0_24
; %bb.23:
	ldr	w8, [x23]
	ldr	w9, [x21]
	orr	w8, w9, w8
	str	w8, [x21]
	b	LBB0_25
LBB0_24:
	ldr	w8, [x21]
LBB0_25:
	ldr	w9, [x23]
	tst	w9, w8
	b.eq	LBB0_31
; %bb.26:
Lloh24:
	adrp	x0, l_.str.2@PAGE
Lloh25:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_git_path
	mov	w1, #0
	mov	w2, #438
	bl	_mks_tempfile_sm
	str	x0, [sp, #8]
	cbz	x0, LBB0_10
; %bb.27:
	add	x1, sp, #8
	mov	x0, x21
	bl	_write_shared_index
	mov	x23, x0
Lloh26:
	adrp	x22, _errno@GOTPAGE
Lloh27:
	ldr	x22, [x22, _errno@GOTPAGEOFF]
	ldr	w24, [x22]
	ldr	x0, [sp, #8]
	bl	_is_tempfile_active
	cbz	x0, LBB0_29
; %bb.28:
	add	x0, sp, #8
	bl	_delete_tempfile
LBB0_29:
	str	w24, [x22]
	cbnz	w23, LBB0_13
; %bb.30:
	mov	x0, x21
	mov	x1, x19
	mov	x2, x20
	bl	_write_split_index
	b	LBB0_12
LBB0_31:
	mov	x0, x21
	mov	x1, x19
	mov	x2, x20
	bl	_write_split_index
	mov	x23, x0
	cbnz	w0, LBB0_13
; %bb.32:
	mov	x0, x22
	bl	_is_null_oid
	cbnz	w0, LBB0_34
; %bb.33:
	mov	x0, x22
	bl	_oid_to_hex
                                        ; kill: def $w0 killed $w0 def $x0
	str	x0, [sp]
Lloh28:
	adrp	x0, l_.str.3@PAGE
Lloh29:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_git_path
	mov	w1, #1
	bl	_freshen_shared_index
LBB0_34:
	mov	w23, #0
	b	LBB0_13
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGot	Lloh22, Lloh23
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpLdrGot	Lloh26, Lloh27
	.loh AdrpAdd	Lloh28, Lloh29
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"GIT_TEST_CHECK_CACHE_TREE"

	.comm	_the_repository,4,2             ; @the_repository
	.comm	_SKIP_IF_UNCHANGED,4,2          ; @SKIP_IF_UNCHANGED
	.comm	_COMMIT_LOCK,4,2                ; @COMMIT_LOCK
	.comm	_alternate_index_output,8,3     ; @alternate_index_output
	.comm	_EXTMASK,4,2                    ; @EXTMASK
l_.str.1:                               ; @.str.1
	.asciz	"GIT_TEST_SPLIT_INDEX"

	.comm	_SPLIT_INDEX_ORDERED,4,2        ; @SPLIT_INDEX_ORDERED
l_.str.2:                               ; @.str.2
	.asciz	"sharedindex_XXXXXX"

	.comm	_errno,4,2                      ; @errno
l_.str.3:                               ; @.str.3
	.asciz	"sharedindex.%s"

.subsections_via_symbols
