	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function commit_ref_update
_commit_ref_update:                     ## @commit_ref_update
	.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	%r8, %r15
	movq	%rcx, %r14
	movq	%rdx, %r13
	movq	%rsi, %rbx
	movq	%rdi, %r12
	leaq	L_.str(%rip), %rsi
	callq	_files_assert_main_repository
	movq	%r12, %rdi
	callq	_clear_loose_ref_cache
	movq	(%rbx), %rsi
	movq	%rbx, -64(%rbp)                 ## 8-byte Spill
	addq	$8, %rbx
	movq	%r15, -72(%rbp)                 ## 8-byte Spill
	movq	%r15, (%rsp)
	movq	%r12, %rdi
	movq	%rbx, %rdx
	movq	%r13, -88(%rbp)                 ## 8-byte Spill
	movq	%r13, %rcx
	movq	%r14, -96(%rbp)                 ## 8-byte Spill
	movq	%r14, %r8
	xorl	%r9d, %r9d
	callq	_files_log_ref_write
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movq	-72(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_strbuf_detach
	movq	%rax, %r14
	movq	-64(%rbp), %r15                 ## 8-byte Reload
	movq	(%r15), %rdx
	leaq	L_.str.1(%rip), %rsi
	movq	%rbx, %rdi
	movq	%rax, %rcx
	xorl	%eax, %eax
	callq	_strbuf_addf
	movq	%r14, %rdi
	callq	_free
	jmp	LBB0_10
LBB0_2:
	movq	%rbx, -80(%rbp)                 ## 8-byte Spill
	movq	-64(%rbp), %r15                 ## 8-byte Reload
	movq	(%r15), %rdi
	leaq	L_.str.2(%rip), %rsi
	callq	_strcmp
	testq	%rax, %rax
	movq	-72(%rbp), %r14                 ## 8-byte Reload
	je	LBB0_8
## %bb.3:
	movq	_RESOLVE_REF_READING@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	L_.str.2(%rip), %rsi
	leaq	-52(%rbp), %r8
	movq	%r12, %rdi
	xorl	%ecx, %ecx
	callq	_refs_resolve_ref_unsafe
	testq	%rax, %rax
	je	LBB0_8
## %bb.4:
	movq	_REF_ISSYMREF@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	testl	%ecx, -52(%rbp)
	je	LBB0_8
## %bb.5:
	movq	(%r15), %rsi
	movq	%rax, %rdi
	callq	_strcmp
	testq	%rax, %rax
	jne	LBB0_8
## %bb.6:
	movq	_STRBUF_INIT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -48(%rbp)
	leaq	-48(%rbp), %rax
	movq	%rax, (%rsp)
	leaq	L_.str.2(%rip), %rsi
	movq	%r12, %rdi
	movq	-80(%rbp), %rdx                 ## 8-byte Reload
	movq	-88(%rbp), %rcx                 ## 8-byte Reload
	movq	-96(%rbp), %r8                  ## 8-byte Reload
	xorl	%r9d, %r9d
	callq	_files_log_ref_write
	testq	%rax, %rax
	je	LBB0_8
## %bb.7:
	movl	-48(%rbp), %esi
	leaq	L_.str.3(%rip), %rdi
	callq	_error
	leaq	-48(%rbp), %rdi
	callq	_strbuf_release
LBB0_8:
	movq	%r15, %rdi
	callq	_commit_ref
	testq	%rax, %rax
	je	LBB0_11
## %bb.9:
	movq	(%r15), %rdx
	leaq	L_.str.4(%rip), %rsi
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	_strbuf_addf
LBB0_10:
	movq	%r15, %rdi
	callq	_unlock_ref
	movl	$-1, %eax
LBB0_12:
	addq	$72, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_11:
	movq	%r15, %rdi
	callq	_unlock_ref
	xorl	%eax, %eax
	jmp	LBB0_12
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"commit_ref_update"

L_.str.1:                               ## @.str.1
	.asciz	"cannot update the ref '%s': %s"

L_.str.2:                               ## @.str.2
	.asciz	"HEAD"

	.comm	_RESOLVE_REF_READING,4,2        ## @RESOLVE_REF_READING
	.comm	_REF_ISSYMREF,4,2               ## @REF_ISSYMREF
	.comm	_STRBUF_INIT,4,2                ## @STRBUF_INIT
L_.str.3:                               ## @.str.3
	.asciz	"%s"

L_.str.4:                               ## @.str.4
	.asciz	"couldn't set '%s'"

	.no_dead_strip	_commit_ref_update
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function commit_ref_update
_commit_ref_update:                     ; @commit_ref_update
	.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	x22, x2
	mov	x19, x1
	mov	x23, x0
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	bl	_files_assert_main_repository
	mov	x0, x23
	bl	_clear_loose_ref_cache
	mov	x24, x19
	ldr	x1, [x24], #8
	mov	x0, x23
	mov	x2, x24
	mov	x3, x22
	mov	x4, x21
	mov	w5, #0
	mov	x6, x20
	bl	_files_log_ref_write
	cbz	x0, LBB0_2
; %bb.1:
	mov	x0, x20
	mov	x1, #0
	bl	_strbuf_detach
	mov	x21, x0
	ldr	x2, [x19]
	str	x0, [sp]
Lloh2:
	adrp	x1, l_.str.1@PAGE
Lloh3:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x20
	bl	_strbuf_addf
	mov	x0, x21
	bl	_free
	b	LBB0_10
LBB0_2:
	ldr	x0, [x19]
Lloh4:
	adrp	x1, l_.str.2@PAGE
Lloh5:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_strcmp
	cbz	x0, LBB0_8
; %bb.3:
Lloh6:
	adrp	x8, _RESOLVE_REF_READING@GOTPAGE
Lloh7:
	ldr	x8, [x8, _RESOLVE_REF_READING@GOTPAGEOFF]
Lloh8:
	ldr	w2, [x8]
Lloh9:
	adrp	x1, l_.str.2@PAGE
Lloh10:
	add	x1, x1, l_.str.2@PAGEOFF
	add	x4, sp, #12
	mov	x0, x23
	mov	x3, #0
	bl	_refs_resolve_ref_unsafe
	cbz	x0, LBB0_8
; %bb.4:
	ldr	w8, [sp, #12]
Lloh11:
	adrp	x9, _REF_ISSYMREF@GOTPAGE
Lloh12:
	ldr	x9, [x9, _REF_ISSYMREF@GOTPAGEOFF]
Lloh13:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_8
; %bb.5:
	ldr	x1, [x19]
	bl	_strcmp
	cbnz	x0, LBB0_8
; %bb.6:
Lloh14:
	adrp	x8, _STRBUF_INIT@GOTPAGE
Lloh15:
	ldr	x8, [x8, _STRBUF_INIT@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
	str	w8, [sp, #8]
Lloh17:
	adrp	x1, l_.str.2@PAGE
Lloh18:
	add	x1, x1, l_.str.2@PAGEOFF
	add	x6, sp, #8
	mov	x0, x23
	mov	x2, x24
	mov	x3, x22
	mov	x4, x21
	mov	w5, #0
	bl	_files_log_ref_write
	cbz	x0, LBB0_8
; %bb.7:
	ldr	w1, [sp, #8]
Lloh19:
	adrp	x0, l_.str.3@PAGE
Lloh20:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_error
	add	x0, sp, #8
	bl	_strbuf_release
LBB0_8:
	mov	x0, x19
	bl	_commit_ref
	cbz	x0, LBB0_12
; %bb.9:
	ldr	x2, [x19]
Lloh21:
	adrp	x1, l_.str.4@PAGE
Lloh22:
	add	x1, x1, l_.str.4@PAGEOFF
	mov	x0, x20
	bl	_strbuf_addf
LBB0_10:
	mov	x0, x19
	bl	_unlock_ref
	mov	w0, #-1
LBB0_11:
	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_12:
	mov	x0, x19
	bl	_unlock_ref
	mov	w0, #0
	b	LBB0_11
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpAdd	Lloh21, Lloh22
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"commit_ref_update"

l_.str.1:                               ; @.str.1
	.asciz	"cannot update the ref '%s': %s"

l_.str.2:                               ; @.str.2
	.asciz	"HEAD"

	.comm	_RESOLVE_REF_READING,4,2        ; @RESOLVE_REF_READING
	.comm	_REF_ISSYMREF,4,2               ; @REF_ISSYMREF
	.comm	_STRBUF_INIT,4,2                ; @STRBUF_INIT
l_.str.3:                               ; @.str.3
	.asciz	"%s"

l_.str.4:                               ; @.str.4
	.asciz	"couldn't set '%s'"

	.no_dead_strip	_commit_ref_update
.subsections_via_symbols
