	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function save_head
_save_head:                             ## @save_head
	.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
	subq	$24, %rsp
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movq	_LOCK_INIT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -32(%rbp)
	movq	_STRBUF_INIT@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -40(%rbp)
	xorl	%eax, %eax
	callq	_git_path_head_file
	leaq	-32(%rbp), %rdi
	movl	%eax, %esi
	xorl	%edx, %edx
	callq	_hold_lock_file_for_update
	testl	%eax, %eax
	js	LBB0_1
## %bb.2:
	movl	%eax, %ebx
	leaq	L_.str.1(%rip), %rsi
	leaq	-40(%rbp), %r15
	movq	%r15, %rdi
	movq	%r14, %rdx
	callq	_strbuf_addf
	movl	-40(%rbp), %edx
	movl	-36(%rbp), %esi
	movl	%ebx, %edi
	callq	_write_in_full
	movq	%rax, %rbx
	movq	%r15, %rdi
	callq	_strbuf_release
	testq	%rbx, %rbx
	js	LBB0_3
## %bb.4:
	leaq	-32(%rbp), %rdi
	callq	_commit_lock_file
	movq	%rax, %rcx
	xorl	%eax, %eax
	testq	%rcx, %rcx
	jns	LBB0_6
## %bb.5:
	leaq	L_.str.3(%rip), %rdi
	callq	__
	movl	%eax, %ebx
	xorl	%eax, %eax
	callq	_git_path_head_file
	movl	%ebx, %edi
	movl	%eax, %esi
	callq	_error
	jmp	LBB0_6
LBB0_1:
	leaq	L_.str(%rip), %rdi
	callq	__
	movl	%eax, %edi
	xorl	%eax, %eax
	callq	_error_errno
	jmp	LBB0_6
LBB0_3:
	leaq	L_.str.2(%rip), %rdi
	callq	__
	movl	%eax, %ebx
	xorl	%eax, %eax
	callq	_git_path_head_file
	movl	%ebx, %edi
	movl	%eax, %esi
	xorl	%eax, %eax
	callq	_error_errno
	leaq	-32(%rbp), %rdi
	callq	_rollback_lock_file
	movl	$-1, %eax
LBB0_6:
	addq	$24, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_LOCK_INIT,4,2                  ## @LOCK_INIT
	.comm	_STRBUF_INIT,8,2                ## @STRBUF_INIT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"could not lock HEAD"

L_.str.1:                               ## @.str.1
	.asciz	"%s\n"

L_.str.2:                               ## @.str.2
	.asciz	"could not write to '%s'"

L_.str.3:                               ## @.str.3
	.asciz	"failed to finalize '%s'"

	.no_dead_strip	_save_head
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function save_head
_save_head:                             ; @save_head
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x0
Lloh0:
	adrp	x8, _LOCK_INIT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _LOCK_INIT@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	str	w8, [sp, #24]
Lloh3:
	adrp	x8, _STRBUF_INIT@GOTPAGE
Lloh4:
	ldr	x8, [x8, _STRBUF_INIT@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
	str	x8, [sp, #16]
	bl	_git_path_head_file
	mov	x1, x0
	add	x0, sp, #24
	mov	w2, #0
	bl	_hold_lock_file_for_update
	tbnz	w0, #31, LBB0_4
; %bb.1:
	mov	x20, x0
Lloh6:
	adrp	x1, l_.str.1@PAGE
Lloh7:
	add	x1, x1, l_.str.1@PAGEOFF
	add	x0, sp, #16
	mov	x2, x19
	bl	_strbuf_addf
	ldp	w2, w1, [sp, #16]
	mov	x0, x20
	bl	_write_in_full
	mov	x19, x0
	add	x0, sp, #16
	bl	_strbuf_release
	tbnz	x19, #63, LBB0_5
; %bb.2:
	add	x0, sp, #24
	bl	_commit_lock_file
	tbnz	x0, #63, LBB0_6
; %bb.3:
	mov	w0, #0
	b	LBB0_7
LBB0_4:
Lloh8:
	adrp	x0, l_.str@PAGE
Lloh9:
	add	x0, x0, l_.str@PAGEOFF
	bl	__
	bl	_error_errno
	b	LBB0_7
LBB0_5:
Lloh10:
	adrp	x0, l_.str.2@PAGE
Lloh11:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	__
	mov	x19, x0
	bl	_git_path_head_file
                                        ; kill: def $w0 killed $w0 def $x0
	str	x0, [sp]
	mov	x0, x19
	bl	_error_errno
	add	x0, sp, #24
	bl	_rollback_lock_file
	mov	w0, #-1
	b	LBB0_7
LBB0_6:
Lloh12:
	adrp	x0, l_.str.3@PAGE
Lloh13:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	__
	mov	x19, x0
	bl	_git_path_head_file
	mov	x1, x0
	mov	x0, x19
	bl	_error
LBB0_7:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_LOCK_INIT,4,2                  ; @LOCK_INIT
	.comm	_STRBUF_INIT,8,2                ; @STRBUF_INIT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"could not lock HEAD"

l_.str.1:                               ; @.str.1
	.asciz	"%s\n"

l_.str.2:                               ; @.str.2
	.asciz	"could not write to '%s'"

l_.str.3:                               ; @.str.3
	.asciz	"failed to finalize '%s'"

	.no_dead_strip	_save_head
.subsections_via_symbols
