	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function lock_ref_for_update
_lock_ref_for_update:                   ## @lock_ref_for_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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%r9, -56(%rbp)                  ## 8-byte Spill
	movq	%r8, %r13
	movq	%rcx, %r14
	movq	%rdx, -72(%rbp)                 ## 8-byte Spill
	movq	%rsi, %r15
	movq	%rdi, %rbx
	movq	_STRBUF_INIT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -48(%rbp)
	movq	_REF_HAVE_OLD@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%rsi)
	je	LBB0_1
## %bb.2:
	leaq	40(%r15), %rdi
	callq	_is_null_oid
	xorl	%r12d, %r12d
	testq	%rax, %rax
	sete	%r12b
	jmp	LBB0_3
LBB0_1:
	xorl	%r12d, %r12d
LBB0_3:
	leaq	L_.str(%rip), %rsi
	movq	%rbx, -80(%rbp)                 ## 8-byte Spill
	movq	%rbx, %rdi
	callq	_files_assert_main_repository
	movq	_REF_HAVE_NEW@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%r15)
	je	LBB0_6
## %bb.4:
	leaq	24(%r15), %rdi
	callq	_is_null_oid
	testq	%rax, %rax
	je	LBB0_6
## %bb.5:
	movq	_REF_DELETING@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	%eax, (%r15)
LBB0_6:
	testq	%r14, %r14
	je	LBB0_8
## %bb.7:
	movq	%r15, %rdi
	movq	-72(%rbp), %rsi                 ## 8-byte Reload
	movq	%r14, %rdx
	movq	%r13, %rcx
	movq	-56(%rbp), %r8                  ## 8-byte Reload
	callq	_split_head_update
	movl	%eax, %r14d
	testl	%eax, %eax
	jne	LBB0_35
LBB0_8:
	movl	8(%r15), %esi
	leaq	4(%r15), %rbx
	subq	$8, %rsp
	leaq	-48(%rbp), %rax
	leaq	-64(%rbp), %r9
	movq	-80(%rbp), %rdi                 ## 8-byte Reload
	movl	%r12d, %edx
	movq	%r13, %rcx
	xorl	%r8d, %r8d
	movq	%r13, %r12
	movq	-56(%rbp), %r13                 ## 8-byte Reload
	pushq	%r13
	pushq	%rbx
	pushq	%rax
	callq	_lock_raw_ref
	addq	$32, %rsp
	testl	%eax, %eax
	je	LBB0_10
## %bb.9:
	movl	%eax, %r14d
	movq	%r13, %rdi
	xorl	%esi, %esi
	callq	_strbuf_detach
	movq	%rax, %r12
	movq	%r15, %rdi
	callq	_original_update_refname
	leaq	L_.str.1(%rip), %rsi
	movq	%r13, %rdi
	movl	%eax, %edx
	movq	%r12, %rcx
	xorl	%eax, %eax
	callq	_strbuf_addf
	movq	%r12, %rdi
	callq	_free
	jmp	LBB0_35
LBB0_10:
	movq	%r12, %r8
	movq	%rbx, -88(%rbp)                 ## 8-byte Spill
	movq	-64(%rbp), %rcx
	movq	%rcx, 16(%r15)
	movq	_REF_ISSYMREF@GOTPCREL(%rip), %r12
	movl	(%r12), %eax
	testl	%eax, 4(%r15)
	je	LBB0_16
## %bb.11:
	movq	_REF_NO_DEREF@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%r15)
	je	LBB0_20
## %bb.12:
	movl	-48(%rbp), %esi
	movq	-80(%rbp), %rdi                 ## 8-byte Reload
	xorl	%edx, %edx
	xorl	%r8d, %r8d
	callq	_refs_read_ref_full
	testq	%rax, %rax
	je	LBB0_15
## %bb.13:
	movq	_REF_HAVE_OLD@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%r15)
	je	LBB0_21
## %bb.14:
	movq	%r15, %rdi
	callq	_original_update_refname
	leaq	L_.str.2(%rip), %rsi
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movl	%eax, %edx
	jmp	LBB0_33
LBB0_16:
	movq	%r15, %rdi
	movq	%rcx, %rsi
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
	callq	_check_old_oid
	testq	%rax, %rax
	jne	LBB0_34
## %bb.17:
	movq	32(%r15), %rbx
	testq	%rbx, %rbx
	je	LBB0_21
	.p2align	4, 0x90
LBB0_19:                                ## =>This Inner Loop Header: Depth=1
	movq	16(%rbx), %rdi
	movq	-64(%rbp), %rsi
	callq	_oidcpy
	movq	32(%rbx), %rbx
	testq	%rbx, %rbx
	jne	LBB0_19
	jmp	LBB0_21
LBB0_20:
	movl	-48(%rbp), %esi
	movq	%r15, %rdi
	movq	-72(%rbp), %rdx                 ## 8-byte Reload
	movq	%r8, %rcx
	movq	-56(%rbp), %r8                  ## 8-byte Reload
	callq	_split_symref_update
	movl	%eax, %r14d
	testl	%eax, %eax
	jne	LBB0_35
	jmp	LBB0_21
LBB0_15:
	movq	-64(%rbp), %rsi
	movq	%r15, %rdi
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
	callq	_check_old_oid
	testq	%rax, %rax
	jne	LBB0_34
LBB0_21:
	movl	(%r15), %eax
	movq	_REF_HAVE_NEW@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_30
## %bb.22:
	movq	_REF_DELETING@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	jne	LBB0_30
## %bb.23:
	movq	_REF_LOG_ONLY@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_24
LBB0_30:
	movq	_REF_NEEDS_COMMIT@GOTPCREL(%rip), %rcx
	xorl	%r14d, %r14d
	testl	%eax, (%rcx)
	jne	LBB0_35
## %bb.31:
	movq	-64(%rbp), %rdi
	callq	_close_ref_gently
	testq	%rax, %rax
	je	LBB0_35
## %bb.32:
	movl	8(%r15), %edx
	leaq	L_.str.4(%rip), %rsi
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
LBB0_33:
	xorl	%eax, %eax
	callq	_strbuf_addf
LBB0_34:
	movq	_TRANSACTION_GENERIC_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
LBB0_35:
	leaq	-48(%rbp), %rdi
	callq	_strbuf_release
	movl	%r14d, %eax
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_24:
	movl	(%r12), %eax
	movq	-88(%rbp), %rcx                 ## 8-byte Reload
	testl	%eax, (%rcx)
	je	LBB0_25
LBB0_27:
	movq	-64(%rbp), %rdi
	leaq	24(%r15), %rsi
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rdx
	callq	_write_ref_to_lockfile
	testq	%rax, %rax
	je	LBB0_29
## %bb.28:
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_strbuf_detach
	movq	%rax, %r14
	movq	$0, 16(%r15)
	movl	8(%r15), %edx
	leaq	L_.str.3(%rip), %rsi
	movq	%rbx, %rdi
	movq	%rax, %rcx
	xorl	%eax, %eax
	callq	_strbuf_addf
	movq	%r14, %rdi
	callq	_free
	jmp	LBB0_34
LBB0_25:
	movq	-64(%rbp), %rdi
	leaq	24(%r15), %rsi
	callq	_oideq
	testq	%rax, %rax
	je	LBB0_27
## %bb.26:
	movl	(%r15), %eax
	jmp	LBB0_30
LBB0_29:
	movq	_REF_NEEDS_COMMIT@GOTPCREL(%rip), %rcx
	movl	(%r15), %eax
	orl	(%rcx), %eax
	movl	%eax, (%r15)
	jmp	LBB0_30
	.cfi_endproc
                                        ## -- End function
	.comm	_STRBUF_INIT,4,2                ## @STRBUF_INIT
	.comm	_REF_HAVE_OLD,4,2               ## @REF_HAVE_OLD
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"lock_ref_for_update"

	.comm	_REF_HAVE_NEW,4,2               ## @REF_HAVE_NEW
	.comm	_REF_DELETING,4,2               ## @REF_DELETING
L_.str.1:                               ## @.str.1
	.asciz	"cannot lock ref '%s': %s"

	.comm	_REF_ISSYMREF,4,2               ## @REF_ISSYMREF
	.comm	_REF_NO_DEREF,4,2               ## @REF_NO_DEREF
L_.str.2:                               ## @.str.2
	.asciz	"cannot lock ref '%s': error reading reference"

	.comm	_TRANSACTION_GENERIC_ERROR,4,2  ## @TRANSACTION_GENERIC_ERROR
	.comm	_REF_LOG_ONLY,4,2               ## @REF_LOG_ONLY
L_.str.3:                               ## @.str.3
	.asciz	"cannot update ref '%s': %s"

	.comm	_REF_NEEDS_COMMIT,4,2           ## @REF_NEEDS_COMMIT
L_.str.4:                               ## @.str.4
	.asciz	"couldn't close '%s.lock'"

	.no_dead_strip	_lock_ref_for_update
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function lock_ref_for_update
_lock_ref_for_update:                   ; @lock_ref_for_update
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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, x5
	mov	x22, x4
	mov	x21, x3
	mov	x23, x2
	mov	x20, x1
	mov	x24, x0
Lloh0:
	adrp	x8, _STRBUF_INIT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _STRBUF_INIT@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	str	w8, [sp, #24]
	ldr	w8, [x1]
Lloh3:
	adrp	x28, _REF_HAVE_OLD@GOTPAGE
Lloh4:
	ldr	x28, [x28, _REF_HAVE_OLD@GOTPAGEOFF]
	ldr	w9, [x28]
	tst	w9, w8
	b.eq	LBB0_2
; %bb.1:
	add	x0, x20, #40
	bl	_is_null_oid
	cmp	x0, #0
	cset	w26, eq
	b	LBB0_3
LBB0_2:
	mov	w26, #0
LBB0_3:
Lloh5:
	adrp	x1, l_.str@PAGE
Lloh6:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x24
	bl	_files_assert_main_repository
	ldr	w8, [x20]
Lloh7:
	adrp	x27, _REF_HAVE_NEW@GOTPAGE
Lloh8:
	ldr	x27, [x27, _REF_HAVE_NEW@GOTPAGEOFF]
	ldr	w9, [x27]
	tst	w9, w8
	b.eq	LBB0_6
; %bb.4:
	add	x0, x20, #24
	bl	_is_null_oid
	cbz	x0, LBB0_6
; %bb.5:
Lloh9:
	adrp	x8, _REF_DELETING@GOTPAGE
Lloh10:
	ldr	x8, [x8, _REF_DELETING@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	ldr	w9, [x20]
	orr	w8, w9, w8
	str	w8, [x20]
LBB0_6:
	cbz	x21, LBB0_8
; %bb.7:
	mov	x0, x20
	mov	x1, x23
	mov	x2, x21
	mov	x3, x22
	mov	x4, x19
	bl	_split_head_update
	mov	x25, x0
	cbnz	w0, LBB0_29
LBB0_8:
	ldr	w1, [x20, #8]
	add	x21, x20, #4
	str	x19, [sp]
	add	x5, sp, #16
	add	x6, sp, #24
	mov	x0, x24
	mov	x2, x26
	mov	x3, x22
	mov	x4, #0
	mov	x7, x21
	bl	_lock_raw_ref
	cbz	w0, LBB0_10
; %bb.9:
	mov	x25, x0
	mov	x0, x19
	mov	x1, #0
	bl	_strbuf_detach
	mov	x21, x0
	mov	x0, x20
	bl	_original_update_refname
	mov	x2, x0
	str	x21, [sp]
Lloh12:
	adrp	x1, l_.str.1@PAGE
Lloh13:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x19
	bl	_strbuf_addf
	mov	x0, x21
	bl	_free
	b	LBB0_29
LBB0_10:
	ldr	x3, [sp, #16]
	str	x3, [x20, #16]
	ldr	w8, [x20, #4]
Lloh14:
	adrp	x26, _REF_ISSYMREF@GOTPAGE
Lloh15:
	ldr	x26, [x26, _REF_ISSYMREF@GOTPAGEOFF]
	ldr	w9, [x26]
	tst	w9, w8
	b.eq	LBB0_15
; %bb.11:
	ldr	w8, [x20]
Lloh16:
	adrp	x9, _REF_NO_DEREF@GOTPAGE
Lloh17:
	ldr	x9, [x9, _REF_NO_DEREF@GOTPAGEOFF]
Lloh18:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_18
; %bb.12:
	ldr	w1, [sp, #24]
	mov	x0, x24
	mov	w2, #0
	mov	x4, #0
	bl	_refs_read_ref_full
	cbz	x0, LBB0_19
; %bb.13:
	ldr	w8, [x20]
	ldr	w9, [x28]
	tst	w9, w8
	b.eq	LBB0_20
; %bb.14:
	mov	x0, x20
	bl	_original_update_refname
	mov	x2, x0
Lloh19:
	adrp	x1, l_.str.2@PAGE
Lloh20:
	add	x1, x1, l_.str.2@PAGEOFF
	b	LBB0_27
LBB0_15:
	mov	x0, x20
	mov	x1, x3
	mov	x2, x19
	bl	_check_old_oid
	cbnz	x0, LBB0_28
; %bb.16:
	ldr	x22, [x20, #32]
	cbz	x22, LBB0_20
LBB0_17:                                ; =>This Inner Loop Header: Depth=1
	ldr	x0, [x22, #16]
	ldr	x1, [sp, #16]
	bl	_oidcpy
	ldr	x22, [x22, #32]
	cbnz	x22, LBB0_17
	b	LBB0_20
LBB0_18:
	ldr	w1, [sp, #24]
	mov	x0, x20
	mov	x2, x23
	mov	x3, x22
	mov	x4, x19
	bl	_split_symref_update
	mov	x25, x0
	cbnz	w0, LBB0_29
	b	LBB0_20
LBB0_19:
	ldr	x1, [sp, #16]
	mov	x0, x20
	mov	x2, x19
	bl	_check_old_oid
	cbnz	x0, LBB0_28
LBB0_20:
	ldr	w8, [x20]
	ldr	w9, [x27]
	tst	w9, w8
	b.eq	LBB0_23
; %bb.21:
Lloh21:
	adrp	x9, _REF_DELETING@GOTPAGE
Lloh22:
	ldr	x9, [x9, _REF_DELETING@GOTPAGEOFF]
Lloh23:
	ldr	w9, [x9]
	tst	w9, w8
	b.ne	LBB0_23
; %bb.22:
Lloh24:
	adrp	x9, _REF_LOG_ONLY@GOTPAGE
Lloh25:
	ldr	x9, [x9, _REF_LOG_ONLY@GOTPAGEOFF]
Lloh26:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_30
LBB0_23:
Lloh27:
	adrp	x9, _REF_NEEDS_COMMIT@GOTPAGE
Lloh28:
	ldr	x9, [x9, _REF_NEEDS_COMMIT@GOTPAGEOFF]
Lloh29:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_25
LBB0_24:
	mov	w25, #0
	b	LBB0_29
LBB0_25:
	ldr	x0, [sp, #16]
	bl	_close_ref_gently
	cbz	x0, LBB0_24
; %bb.26:
	ldr	w2, [x20, #8]
Lloh30:
	adrp	x1, l_.str.4@PAGE
Lloh31:
	add	x1, x1, l_.str.4@PAGEOFF
LBB0_27:
	mov	x0, x19
	bl	_strbuf_addf
LBB0_28:
Lloh32:
	adrp	x8, _TRANSACTION_GENERIC_ERROR@GOTPAGE
Lloh33:
	ldr	x8, [x8, _TRANSACTION_GENERIC_ERROR@GOTPAGEOFF]
Lloh34:
	ldr	w25, [x8]
LBB0_29:
	add	x0, sp, #24
	bl	_strbuf_release
	mov	x0, x25
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
LBB0_30:
	ldr	w8, [x21]
	ldr	w9, [x26]
	tst	w9, w8
	b.eq	LBB0_33
LBB0_31:
	ldr	x0, [sp, #16]
	add	x1, x20, #24
	mov	x2, x19
	bl	_write_ref_to_lockfile
	cbz	x0, LBB0_35
; %bb.32:
	mov	x0, x19
	mov	x1, #0
	bl	_strbuf_detach
	mov	x21, x0
	str	xzr, [x20, #16]
	ldr	w2, [x20, #8]
	str	x0, [sp]
Lloh35:
	adrp	x1, l_.str.3@PAGE
Lloh36:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x0, x19
	bl	_strbuf_addf
	mov	x0, x21
	bl	_free
	b	LBB0_28
LBB0_33:
	ldr	x0, [sp, #16]
	add	x1, x20, #24
	bl	_oideq
	cbz	x0, LBB0_31
; %bb.34:
	ldr	w8, [x20]
	b	LBB0_23
LBB0_35:
Lloh37:
	adrp	x8, _REF_NEEDS_COMMIT@GOTPAGE
Lloh38:
	ldr	x8, [x8, _REF_NEEDS_COMMIT@GOTPAGEOFF]
Lloh39:
	ldr	w8, [x8]
	ldr	w9, [x20]
	orr	w8, w9, w8
	str	w8, [x20]
	b	LBB0_23
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpAdd	Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpAdd	Lloh35, Lloh36
	.loh AdrpLdrGotLdr	Lloh37, Lloh38, Lloh39
	.cfi_endproc
                                        ; -- End function
	.comm	_STRBUF_INIT,4,2                ; @STRBUF_INIT
	.comm	_REF_HAVE_OLD,4,2               ; @REF_HAVE_OLD
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"lock_ref_for_update"

	.comm	_REF_HAVE_NEW,4,2               ; @REF_HAVE_NEW
	.comm	_REF_DELETING,4,2               ; @REF_DELETING
l_.str.1:                               ; @.str.1
	.asciz	"cannot lock ref '%s': %s"

	.comm	_REF_ISSYMREF,4,2               ; @REF_ISSYMREF
	.comm	_REF_NO_DEREF,4,2               ; @REF_NO_DEREF
l_.str.2:                               ; @.str.2
	.asciz	"cannot lock ref '%s': error reading reference"

	.comm	_TRANSACTION_GENERIC_ERROR,4,2  ; @TRANSACTION_GENERIC_ERROR
	.comm	_REF_LOG_ONLY,4,2               ; @REF_LOG_ONLY
l_.str.3:                               ; @.str.3
	.asciz	"cannot update ref '%s': %s"

	.comm	_REF_NEEDS_COMMIT,4,2           ; @REF_NEEDS_COMMIT
l_.str.4:                               ; @.str.4
	.asciz	"couldn't close '%s.lock'"

	.no_dead_strip	_lock_ref_for_update
.subsections_via_symbols
