	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function lock_ref_oid_basic
_lock_ref_oid_basic:                    ## @lock_ref_oid_basic
	.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
	movl	%r9d, %ebx
	movq	%rsi, -72(%rbp)                 ## 8-byte Spill
	movq	%rdi, -64(%rbp)                 ## 8-byte Spill
	movq	24(%rbp), %r12
	movq	_STRBUF_INIT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -48(%rbp)
	xorl	%r13d, %r13d
	testq	%rdx, %rdx
	movq	%rdx, -104(%rbp)                ## 8-byte Spill
	movq	%r8, -88(%rbp)                  ## 8-byte Spill
	movq	%rcx, -80(%rbp)                 ## 8-byte Spill
	je	LBB0_2
## %bb.1:
	movq	%rdx, %rdi
	callq	_is_null_oid
	testq	%rax, %rax
	sete	%r15b
	jmp	LBB0_3
LBB0_2:
	xorl	%r15d, %r15d
LBB0_3:
	movq	_RESOLVE_REF_NO_RECURSE@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	leaq	L_.str(%rip), %rsi
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	callq	_files_assert_main_repository
	movq	%r12, %rdi
	callq	_assert
	movl	$1, %edi
	movl	$12, %esi
	callq	_xcalloc
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	testb	%r15b, %r15b
	je	LBB0_5
## %bb.4:
	movq	_RESOLVE_REF_READING@GOTPCREL(%rip), %rax
	movl	(%rax), %r13d
LBB0_5:
	movl	%r15d, -92(%rbp)                ## 4-byte Spill
	orl	%r14d, %r13d
	movq	16(%rbp), %r12
	movq	_REF_DELETING@GOTPCREL(%rip), %rax
	andl	(%rax), %ebx
	je	LBB0_7
## %bb.6:
	movq	_RESOLVE_REF_ALLOW_BAD_NAME@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
LBB0_7:
	orl	%ebx, %r13d
	leaq	-48(%rbp), %rsi
	movq	-64(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rdi
	movq	-72(%rbp), %r14                 ## 8-byte Reload
	movq	%r14, %rdx
	callq	_files_ref_path
	movq	-56(%rbp), %r15                 ## 8-byte Reload
	addq	$8, %r15
	movq	%rbx, %rdi
	movq	%r14, %rsi
	movl	%r13d, %edx
	movq	%r15, %rcx
	movq	%r12, %r8
	callq	_refs_resolve_ref_unsafe
	testl	%eax, %eax
	je	LBB0_13
LBB0_8:
	movq	%r15, %rdi
	callq	_is_null_oid
	testq	%rax, %rax
	je	LBB0_11
## %bb.9:
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movq	8(%rax), %rdi
	movq	%r14, %rsi
	movq	-80(%rbp), %rdx                 ## 8-byte Reload
	movq	-88(%rbp), %rcx                 ## 8-byte Reload
	movq	24(%rbp), %r8
	callq	_refs_verify_refname_available
	testq	%rax, %rax
	je	LBB0_11
## %bb.10:
	movq	_ENOTDIR@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	jmp	LBB0_27
LBB0_11:
	movq	%r14, %rdi
	callq	_xstrdup
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	movl	%eax, 4(%rbx)
	movl	-48(%rbp), %edi
	movq	_create_reflock@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdx
	callq	_raceproof_create_file
	testq	%rax, %rax
	je	LBB0_17
## %bb.12:
	movq	_errno@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	movl	-48(%rbp), %edi
	movl	%r14d, %esi
	movq	24(%rbp), %rdx
	callq	_unable_to_lock_message
	jmp	LBB0_28
LBB0_13:
	movq	_errno@GOTPCREL(%rip), %rbx
	movl	(%rbx), %r14d
	movq	_EISDIR@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r14d
	jne	LBB0_21
## %bb.14:
	leaq	-48(%rbp), %rdi
	callq	_remove_empty_directories
	testq	%rax, %rax
	je	LBB0_19
## %bb.15:
	movl	(%rbx), %r14d
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	movq	-72(%rbp), %r15                 ## 8-byte Reload
	movq	%r15, %rsi
	movq	-80(%rbp), %rdx                 ## 8-byte Reload
	movq	-88(%rbp), %rcx                 ## 8-byte Reload
	movq	24(%rbp), %rbx
	movq	%rbx, %r8
	callq	_refs_verify_refname_available
	testq	%rax, %rax
	jne	LBB0_27
## %bb.26:
	leaq	L_.str.1(%rip), %rsi
	movq	%rbx, %rdi
	movq	%r15, %rdx
	xorl	%eax, %eax
	callq	_strbuf_addf
	jmp	LBB0_27
LBB0_17:
	movzbl	-92(%rbp), %ecx                 ## 1-byte Folded Reload
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	movq	%rbx, %rsi
	movq	-104(%rbp), %rdx                ## 8-byte Reload
	movq	24(%rbp), %r8
	callq	_verify_lock
	testq	%rax, %rax
	je	LBB0_25
## %bb.18:
	movq	_errno@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	jmp	LBB0_28
LBB0_19:
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	movq	-72(%rbp), %r14                 ## 8-byte Reload
	movq	%r14, %rsi
	movl	%r13d, %edx
	movq	%r15, %rcx
	movq	%r12, %r8
	callq	_refs_resolve_ref_unsafe
	testl	%eax, %eax
	jne	LBB0_8
## %bb.20:
	movl	(%rbx), %r14d
LBB0_21:
	movq	_ENOTDIR@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r14d
	jne	LBB0_24
## %bb.22:
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	movq	-72(%rbp), %rsi                 ## 8-byte Reload
	movq	-80(%rbp), %rdx                 ## 8-byte Reload
	movq	-88(%rbp), %rcx                 ## 8-byte Reload
	movq	24(%rbp), %r8
	callq	_refs_verify_refname_available
	testq	%rax, %rax
	jne	LBB0_27
LBB0_24:
	movl	%r14d, %edi
	callq	_strerror
	leaq	L_.str.2(%rip), %rsi
	movq	24(%rbp), %rdi
	movq	-72(%rbp), %rdx                 ## 8-byte Reload
	movl	%eax, %ecx
	xorl	%eax, %eax
	callq	_strbuf_addf
LBB0_27:
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
LBB0_28:
	movq	%rbx, %rdi
	callq	_unlock_ref
	xorl	%ebx, %ebx
LBB0_29:
	leaq	-48(%rbp), %rdi
	callq	_strbuf_release
	movq	_errno@GOTPCREL(%rip), %rax
	movl	%r14d, (%rax)
	movq	%rbx, %rax
	addq	$72, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_25:
	xorl	%r14d, %r14d
	jmp	LBB0_29
	.cfi_endproc
                                        ## -- End function
	.comm	_STRBUF_INIT,4,2                ## @STRBUF_INIT
	.comm	_RESOLVE_REF_NO_RECURSE,4,2     ## @RESOLVE_REF_NO_RECURSE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"lock_ref_oid_basic"

	.comm	_RESOLVE_REF_READING,4,2        ## @RESOLVE_REF_READING
	.comm	_REF_DELETING,4,2               ## @REF_DELETING
	.comm	_RESOLVE_REF_ALLOW_BAD_NAME,4,2 ## @RESOLVE_REF_ALLOW_BAD_NAME
	.comm	_errno,4,2                      ## @errno
	.comm	_EISDIR,4,2                     ## @EISDIR
L_.str.1:                               ## @.str.1
	.asciz	"there are still refs under '%s'"

	.comm	_ENOTDIR,4,2                    ## @ENOTDIR
L_.str.2:                               ## @.str.2
	.asciz	"unable to resolve reference '%s': %s"

	.comm	_create_reflock,4,2             ## @create_reflock
	.no_dead_strip	_lock_ref_oid_basic
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function lock_ref_oid_basic
_lock_ref_oid_basic:                    ; @lock_ref_oid_basic
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #144
	.cfi_def_cfa_offset 144
	stp	x28, x27, [sp, #48]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #64]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #80]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #96]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #112]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #128]            ; 16-byte Folded Spill
	add	x29, sp, #128
	.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	x20, x7
	mov	x28, x6
	mov	x27, x5
	mov	x23, x2
	mov	x21, x1
	mov	x22, x0
Lloh0:
	adrp	x8, _STRBUF_INIT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _STRBUF_INIT@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	str	w8, [sp, #40]
	stp	x3, x4, [sp, #24]               ; 16-byte Folded Spill
	cbz	x2, LBB0_2
; %bb.1:
	mov	x0, x23
	bl	_is_null_oid
	cmp	x0, #0
	cset	w25, eq
	b	LBB0_3
LBB0_2:
	mov	w25, #0
LBB0_3:
Lloh3:
	adrp	x8, _RESOLVE_REF_NO_RECURSE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _RESOLVE_REF_NO_RECURSE@GOTPAGEOFF]
Lloh5:
	ldr	w24, [x8]
Lloh6:
	adrp	x1, l_.str@PAGE
Lloh7:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x22
	bl	_files_assert_main_repository
	mov	x0, x20
	bl	_assert
	mov	w0, #1
	mov	w1, #12
	bl	_xcalloc
	mov	x19, x0
Lloh8:
	adrp	x8, _RESOLVE_REF_READING@GOTPAGE
Lloh9:
	ldr	x8, [x8, _RESOLVE_REF_READING@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	str	w25, [sp, #20]                  ; 4-byte Folded Spill
	cmp	w25, #0
	csel	w8, w8, wzr, ne
	orr	w8, w8, w24
Lloh11:
	adrp	x9, _REF_DELETING@GOTPAGE
Lloh12:
	ldr	x9, [x9, _REF_DELETING@GOTPAGEOFF]
Lloh13:
	ldr	w9, [x9]
Lloh14:
	adrp	x10, _RESOLVE_REF_ALLOW_BAD_NAME@GOTPAGE
Lloh15:
	ldr	x10, [x10, _RESOLVE_REF_ALLOW_BAD_NAME@GOTPAGEOFF]
Lloh16:
	ldr	w10, [x10]
	tst	w9, w27
	csel	w9, wzr, w10, eq
	orr	w25, w8, w9
	add	x1, sp, #40
	mov	x0, x22
	mov	x2, x21
	bl	_files_ref_path
	add	x24, x19, #8
	mov	x0, x22
	mov	x1, x21
	mov	x2, x25
	mov	x3, x24
	mov	x4, x28
	bl	_refs_resolve_ref_unsafe
Lloh17:
	adrp	x27, _errno@GOTPAGE
Lloh18:
	ldr	x27, [x27, _errno@GOTPAGEOFF]
	cbz	w0, LBB0_9
LBB0_4:
	mov	x0, x24
	bl	_is_null_oid
	cbz	x0, LBB0_7
; %bb.5:
	ldr	x0, [x22, #8]
	mov	x1, x21
	ldp	x2, x3, [sp, #24]               ; 16-byte Folded Reload
	mov	x4, x20
	bl	_refs_verify_refname_available
	cbz	x0, LBB0_7
; %bb.6:
	mov	x26, x27
Lloh19:
	adrp	x8, _ENOTDIR@GOTPAGE
Lloh20:
	ldr	x8, [x8, _ENOTDIR@GOTPAGEOFF]
Lloh21:
	ldr	w27, [x8]
	b	LBB0_21
LBB0_7:
	mov	x0, x21
	bl	_xstrdup
	str	w0, [x19, #4]
	ldr	w0, [sp, #40]
Lloh22:
	adrp	x8, _create_reflock@GOTPAGE
Lloh23:
	ldr	x8, [x8, _create_reflock@GOTPAGEOFF]
Lloh24:
	ldr	w1, [x8]
	mov	x2, x19
	bl	_raceproof_create_file
	cbz	x0, LBB0_13
; %bb.8:
	mov	x26, x27
	ldr	w27, [x27]
	ldr	w0, [sp, #40]
	mov	x1, x27
	mov	x2, x20
	bl	_unable_to_lock_message
	b	LBB0_21
LBB0_9:
	mov	x26, x27
	ldr	w27, [x27]
Lloh25:
	adrp	x8, _EISDIR@GOTPAGE
Lloh26:
	ldr	x8, [x8, _EISDIR@GOTPAGEOFF]
Lloh27:
	ldr	w8, [x8]
	cmp	w27, w8
	b.ne	LBB0_17
; %bb.10:
	add	x0, sp, #40
	bl	_remove_empty_directories
	cbz	x0, LBB0_15
; %bb.11:
	ldr	w27, [x26]
	mov	x0, x22
	mov	x1, x21
	ldp	x2, x3, [sp, #24]               ; 16-byte Folded Reload
	mov	x4, x20
	bl	_refs_verify_refname_available
	cbnz	x0, LBB0_21
; %bb.12:
Lloh28:
	adrp	x1, l_.str.1@PAGE
Lloh29:
	add	x1, x1, l_.str.1@PAGEOFF
	b	LBB0_20
LBB0_13:
	mov	x0, x22
	mov	x1, x19
	mov	x2, x23
	ldr	w3, [sp, #20]                   ; 4-byte Folded Reload
	mov	x4, x20
	bl	_verify_lock
	cbz	x0, LBB0_23
; %bb.14:
	mov	x26, x27
	ldr	w27, [x27]
	b	LBB0_21
LBB0_15:
	mov	x0, x22
	mov	x1, x21
	mov	x2, x25
	mov	x3, x24
	mov	x4, x28
	bl	_refs_resolve_ref_unsafe
	mov	x27, x26
	cbnz	w0, LBB0_4
; %bb.16:
	ldr	w27, [x27]
LBB0_17:
Lloh30:
	adrp	x8, _ENOTDIR@GOTPAGE
Lloh31:
	ldr	x8, [x8, _ENOTDIR@GOTPAGEOFF]
Lloh32:
	ldr	w8, [x8]
	cmp	w27, w8
	b.ne	LBB0_19
; %bb.18:
	mov	x0, x22
	mov	x1, x21
	ldp	x2, x3, [sp, #24]               ; 16-byte Folded Reload
	mov	x4, x20
	bl	_refs_verify_refname_available
	cbnz	x0, LBB0_21
LBB0_19:
	mov	x0, x27
	bl	_strerror
                                        ; kill: def $w0 killed $w0 def $x0
	str	x0, [sp]
Lloh33:
	adrp	x1, l_.str.2@PAGE
Lloh34:
	add	x1, x1, l_.str.2@PAGEOFF
LBB0_20:
	mov	x0, x20
	mov	x2, x21
	bl	_strbuf_addf
LBB0_21:
	mov	x0, x19
	bl	_unlock_ref
	mov	x19, #0
LBB0_22:
	add	x0, sp, #40
	bl	_strbuf_release
	str	w27, [x26]
	mov	x0, x19
	ldp	x29, x30, [sp, #128]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #112]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #96]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #80]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #64]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #144
	ret
LBB0_23:
	mov	x26, x27
	mov	w27, #0
	b	LBB0_22
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpAdd	Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpAdd	Lloh33, Lloh34
	.cfi_endproc
                                        ; -- End function
	.comm	_STRBUF_INIT,4,2                ; @STRBUF_INIT
	.comm	_RESOLVE_REF_NO_RECURSE,4,2     ; @RESOLVE_REF_NO_RECURSE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"lock_ref_oid_basic"

	.comm	_RESOLVE_REF_READING,4,2        ; @RESOLVE_REF_READING
	.comm	_REF_DELETING,4,2               ; @REF_DELETING
	.comm	_RESOLVE_REF_ALLOW_BAD_NAME,4,2 ; @RESOLVE_REF_ALLOW_BAD_NAME
	.comm	_errno,4,2                      ; @errno
	.comm	_EISDIR,4,2                     ; @EISDIR
l_.str.1:                               ; @.str.1
	.asciz	"there are still refs under '%s'"

	.comm	_ENOTDIR,4,2                    ; @ENOTDIR
l_.str.2:                               ; @.str.2
	.asciz	"unable to resolve reference '%s': %s"

	.comm	_create_reflock,4,2             ; @create_reflock
	.no_dead_strip	_lock_ref_oid_basic
.subsections_via_symbols
