	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_packed_refs_lock               ## -- Begin function packed_refs_lock
	.p2align	4, 0x90
_packed_refs_lock:                      ## @packed_refs_lock
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r14
	movl	%esi, %r15d
	movq	_REF_STORE_WRITE@GOTPCREL(%rip), %rax
	movq	_REF_STORE_MAIN@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	orl	(%rax), %esi
	leaq	L_.str(%rip), %rdx
	callq	_packed_downcast
	movq	%rax, %rbx
	cmpb	$0, _packed_refs_lock.timeout_configured(%rip)
	jne	LBB0_2
## %bb.1:
	leaq	L_.str.1(%rip), %rdi
	leaq	_packed_refs_lock.timeout_value(%rip), %rsi
	callq	_git_config_get_int
	movb	$1, _packed_refs_lock.timeout_configured(%rip)
LBB0_2:
	movl	4(%rbx), %esi
	movl	_packed_refs_lock.timeout_value(%rip), %ecx
	movq	%rbx, %rdi
	movl	%r15d, %edx
	callq	_hold_lock_file_for_update_timeout
	testq	%rax, %rax
	js	LBB0_3
## %bb.4:
	movq	%rbx, %rdi
	callq	_close_lock_file_gently
	testq	%rax, %rax
	je	LBB0_6
## %bb.5:
	movl	4(%rbx), %r15d
	movq	_errno@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_strerror
	leaq	L_.str.2(%rip), %rsi
	movq	%r14, %rdi
	movl	%r15d, %edx
	movl	%eax, %ecx
	callq	_strbuf_addf
	movq	%rbx, %rdi
	callq	_rollback_lock_file
	movl	$-1, %eax
	jmp	LBB0_7
LBB0_3:
	movl	4(%rbx), %edi
	movq	_errno@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r14, %rdx
	callq	_unable_to_lock_message
	movl	$-1, %eax
	jmp	LBB0_7
LBB0_6:
	movq	%rbx, %rdi
	callq	_clear_snapshot
	movq	%rbx, %rdi
	callq	_get_snapshot
	xorl	%eax, %eax
LBB0_7:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_REF_STORE_WRITE,4,2            ## @REF_STORE_WRITE
	.comm	_REF_STORE_MAIN,4,2             ## @REF_STORE_MAIN
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"packed_refs_lock"

.zerofill __DATA,__bss,_packed_refs_lock.timeout_configured,1,2 ## @packed_refs_lock.timeout_configured
	.section	__DATA,__data
	.p2align	2                               ## @packed_refs_lock.timeout_value
_packed_refs_lock.timeout_value:
	.long	1000                            ## 0x3e8

	.section	__TEXT,__cstring,cstring_literals
L_.str.1:                               ## @.str.1
	.asciz	"core.packedrefstimeout"

	.comm	_errno,4,2                      ## @errno
L_.str.2:                               ## @.str.2
	.asciz	"unable to close %s: %s"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_packed_refs_lock               ; -- Begin function packed_refs_lock
	.p2align	2
_packed_refs_lock:                      ; @packed_refs_lock
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x19, x2
	mov	x21, x1
Lloh0:
	adrp	x8, _REF_STORE_WRITE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _REF_STORE_WRITE@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
Lloh3:
	adrp	x9, _REF_STORE_MAIN@GOTPAGE
Lloh4:
	ldr	x9, [x9, _REF_STORE_MAIN@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	orr	w1, w9, w8
Lloh6:
	adrp	x2, l_.str@PAGE
Lloh7:
	add	x2, x2, l_.str@PAGEOFF
	bl	_packed_downcast
	mov	x20, x0
	adrp	x22, _packed_refs_lock.timeout_configured@PAGE
	ldrb	w8, [x22, _packed_refs_lock.timeout_configured@PAGEOFF]
	tbnz	w8, #0, LBB0_2
; %bb.1:
Lloh8:
	adrp	x0, l_.str.1@PAGE
Lloh9:
	add	x0, x0, l_.str.1@PAGEOFF
Lloh10:
	adrp	x1, _packed_refs_lock.timeout_value@PAGE
Lloh11:
	add	x1, x1, _packed_refs_lock.timeout_value@PAGEOFF
	bl	_git_config_get_int
	mov	w8, #1
	strb	w8, [x22, _packed_refs_lock.timeout_configured@PAGEOFF]
LBB0_2:
	ldr	w1, [x20, #4]
Lloh12:
	adrp	x8, _packed_refs_lock.timeout_value@PAGE
Lloh13:
	ldr	w3, [x8, _packed_refs_lock.timeout_value@PAGEOFF]
	mov	x0, x20
	mov	x2, x21
	bl	_hold_lock_file_for_update_timeout
	tbnz	x0, #63, LBB0_5
; %bb.3:
	mov	x0, x20
	bl	_close_lock_file_gently
	cbz	x0, LBB0_6
; %bb.4:
	ldr	w21, [x20, #4]
Lloh14:
	adrp	x8, _errno@GOTPAGE
Lloh15:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh16:
	ldr	w0, [x8]
	bl	_strerror
	mov	x3, x0
Lloh17:
	adrp	x1, l_.str.2@PAGE
Lloh18:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	x0, x19
	mov	x2, x21
	bl	_strbuf_addf
	mov	x0, x20
	bl	_rollback_lock_file
	mov	w0, #-1
	b	LBB0_7
LBB0_5:
	ldr	w0, [x20, #4]
Lloh19:
	adrp	x8, _errno@GOTPAGE
Lloh20:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh21:
	ldr	w1, [x8]
	mov	x2, x19
	bl	_unable_to_lock_message
	mov	w0, #-1
	b	LBB0_7
LBB0_6:
	mov	x0, x20
	bl	_clear_snapshot
	mov	x0, x20
	bl	_get_snapshot
	mov	w0, #0
LBB0_7:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdr	Lloh12, Lloh13
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.cfi_endproc
                                        ; -- End function
	.comm	_REF_STORE_WRITE,4,2            ; @REF_STORE_WRITE
	.comm	_REF_STORE_MAIN,4,2             ; @REF_STORE_MAIN
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"packed_refs_lock"

.zerofill __DATA,__bss,_packed_refs_lock.timeout_configured,1,2 ; @packed_refs_lock.timeout_configured
	.section	__DATA,__data
	.p2align	2                               ; @packed_refs_lock.timeout_value
_packed_refs_lock.timeout_value:
	.long	1000                            ; 0x3e8

	.section	__TEXT,__cstring,cstring_literals
l_.str.1:                               ; @.str.1
	.asciz	"core.packedrefstimeout"

	.comm	_errno,4,2                      ; @errno
l_.str.2:                               ; @.str.2
	.asciz	"unable to close %s: %s"

.subsections_via_symbols
