	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_add_to_alternates_file         ## -- Begin function add_to_alternates_file
	.p2align	4, 0x90
_add_to_alternates_file:                ## @add_to_alternates_file
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, -64(%rbp)                 ## 8-byte Spill
	movq	_LOCK_INIT@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -48(%rbp)
	leaq	L_.str(%rip), %rdi
	callq	_git_pathdup
	movq	%rax, %r14
	movq	_LOCK_DIE_ON_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	-48(%rbp), %rbx
	movq	%rbx, %rdi
	movq	%r14, %rsi
	callq	_hold_lock_file_for_update
	leaq	L_.str.1(%rip), %rsi
	movq	%rbx, %rdi
	callq	_fdopen_lock_file
	movq	%rax, %r12
	testq	%rax, %rax
	jne	LBB0_2
## %bb.1:
	leaq	L_.str.2(%rip), %rdi
	callq	__
	movl	%eax, %edi
	callq	_die_errno
LBB0_2:
	leaq	L_.str.3(%rip), %rsi
	movq	%r14, %rdi
	callq	_fopen
	testq	%rax, %rax
	je	LBB0_12
## %bb.3:
	movq	%rax, %rbx
	movq	%r14, -72(%rbp)                 ## 8-byte Spill
	movq	_STRBUF_INIT@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -56(%rbp)
	leaq	-56(%rbp), %rdi
	movq	%rbx, %rsi
	callq	_strbuf_getline
	movq	_EOF@GOTPCREL(%rip), %r13
	cmpq	(%r13), %rax
	je	LBB0_7
## %bb.4:
	leaq	-56(%rbp), %r14
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movq	-56(%rbp), %r15
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	movq	%r15, %rsi
	callq	_strcmp
	testl	%eax, %eax
	je	LBB0_14
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=1
	movq	%r12, %rdi
	leaq	L_.str.4(%rip), %rsi
	movq	%r15, %rdx
	callq	_fprintf_or_die
	movq	%r14, %rdi
	movq	%rbx, %rsi
	callq	_strbuf_getline
	cmpq	(%r13), %rax
	jne	LBB0_5
LBB0_7:
	leaq	-56(%rbp), %rdi
	callq	_strbuf_release
	movq	%rbx, %rdi
	callq	_fclose
	movq	-72(%rbp), %r14                 ## 8-byte Reload
	jmp	LBB0_8
LBB0_12:
	movq	_errno@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	_ENOENT@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_8
## %bb.13:
	leaq	L_.str.5(%rip), %rdi
	callq	__
	movl	%eax, %edi
	callq	_die_errno
LBB0_8:
	leaq	L_.str.4(%rip), %rsi
	movq	%r12, %rdi
	movq	-64(%rbp), %rdx                 ## 8-byte Reload
	callq	_fprintf_or_die
	leaq	-48(%rbp), %rdi
	callq	_commit_lock_file
	testq	%rax, %rax
	je	LBB0_10
## %bb.9:
	leaq	L_.str.6(%rip), %rdi
	callq	__
	movl	%eax, %edi
	callq	_die_errno
LBB0_10:
	movq	_the_repository@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	movq	(%rdi), %rax
	cmpq	$0, (%rax)
	je	LBB0_15
## %bb.11:
	movq	-64(%rbp), %rsi                 ## 8-byte Reload
	movl	$10, %edx
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	callq	_link_alt_odb_entries
	jmp	LBB0_15
LBB0_14:
	leaq	-56(%rbp), %rdi
	callq	_strbuf_release
	movq	%rbx, %rdi
	callq	_fclose
	leaq	-48(%rbp), %rdi
	callq	_rollback_lock_file
	movq	-72(%rbp), %r14                 ## 8-byte Reload
LBB0_15:
	movq	%r14, %rdi
	callq	_free
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_LOCK_INIT,4,2                  ## @LOCK_INIT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"objects/info/alternates"

	.comm	_LOCK_DIE_ON_ERROR,4,2          ## @LOCK_DIE_ON_ERROR
L_.str.1:                               ## @.str.1
	.asciz	"w"

L_.str.2:                               ## @.str.2
	.asciz	"unable to fdopen alternates lockfile"

L_.str.3:                               ## @.str.3
	.asciz	"r"

	.comm	_STRBUF_INIT,8,3                ## @STRBUF_INIT
	.comm	_EOF,8,3                        ## @EOF
L_.str.4:                               ## @.str.4
	.asciz	"%s\n"

	.comm	_errno,8,3                      ## @errno
	.comm	_ENOENT,8,3                     ## @ENOENT
L_.str.5:                               ## @.str.5
	.asciz	"unable to read alternates file"

L_.str.6:                               ## @.str.6
	.asciz	"unable to move new alternates file into place"

	.comm	_the_repository,8,3             ## @the_repository
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_add_to_alternates_file         ; -- Begin function add_to_alternates_file
	.p2align	2
_add_to_alternates_file:                ; @add_to_alternates_file
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	mov	x20, x0
Lloh0:
	adrp	x8, _LOCK_INIT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _LOCK_INIT@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	str	w8, [sp, #8]
Lloh3:
	adrp	x0, l_.str@PAGE
Lloh4:
	add	x0, x0, l_.str@PAGEOFF
	bl	_git_pathdup
	mov	x19, x0
Lloh5:
	adrp	x8, _LOCK_DIE_ON_ERROR@GOTPAGE
Lloh6:
	ldr	x8, [x8, _LOCK_DIE_ON_ERROR@GOTPAGEOFF]
Lloh7:
	ldr	w2, [x8]
	add	x0, sp, #8
	mov	x1, x19
	bl	_hold_lock_file_for_update
Lloh8:
	adrp	x1, l_.str.1@PAGE
Lloh9:
	add	x1, x1, l_.str.1@PAGEOFF
	add	x0, sp, #8
	bl	_fdopen_lock_file
	mov	x21, x0
	cbnz	x0, LBB0_2
; %bb.1:
Lloh10:
	adrp	x0, l_.str.2@PAGE
Lloh11:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	__
	bl	_die_errno
LBB0_2:
Lloh12:
	adrp	x1, l_.str.3@PAGE
Lloh13:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x0, x19
	bl	_fopen
	cbz	x0, LBB0_8
; %bb.3:
	mov	x22, x0
Lloh14:
	adrp	x8, _STRBUF_INIT@GOTPAGE
Lloh15:
	ldr	x8, [x8, _STRBUF_INIT@GOTPAGEOFF]
Lloh16:
	ldr	x8, [x8]
	str	x8, [sp]
	mov	x0, sp
	mov	x1, x22
	bl	_strbuf_getline
Lloh17:
	adrp	x25, _EOF@GOTPAGE
Lloh18:
	ldr	x25, [x25, _EOF@GOTPAGEOFF]
	ldr	x8, [x25]
	cmp	x0, x8
	b.eq	LBB0_7
; %bb.4:
Lloh19:
	adrp	x23, l_.str.4@PAGE
Lloh20:
	add	x23, x23, l_.str.4@PAGEOFF
LBB0_5:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x24, [sp]
	mov	x0, x20
	mov	x1, x24
	bl	_strcmp
	cbz	w0, LBB0_14
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	x0, x21
	mov	x1, x23
	mov	x2, x24
	bl	_fprintf_or_die
	mov	x0, sp
	mov	x1, x22
	bl	_strbuf_getline
	ldr	x8, [x25]
	cmp	x0, x8
	b.ne	LBB0_5
LBB0_7:
	mov	x0, sp
	bl	_strbuf_release
	mov	x0, x22
	bl	_fclose
	b	LBB0_10
LBB0_8:
Lloh21:
	adrp	x8, _errno@GOTPAGE
Lloh22:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh23:
	ldr	x8, [x8]
Lloh24:
	adrp	x9, _ENOENT@GOTPAGE
Lloh25:
	ldr	x9, [x9, _ENOENT@GOTPAGEOFF]
Lloh26:
	ldr	x9, [x9]
	cmp	x8, x9
	b.eq	LBB0_10
; %bb.9:
Lloh27:
	adrp	x0, l_.str.5@PAGE
Lloh28:
	add	x0, x0, l_.str.5@PAGEOFF
	bl	__
	bl	_die_errno
LBB0_10:
Lloh29:
	adrp	x1, l_.str.4@PAGE
Lloh30:
	add	x1, x1, l_.str.4@PAGEOFF
	mov	x0, x21
	mov	x2, x20
	bl	_fprintf_or_die
	add	x0, sp, #8
	bl	_commit_lock_file
	cbz	x0, LBB0_12
; %bb.11:
Lloh31:
	adrp	x0, l_.str.6@PAGE
Lloh32:
	add	x0, x0, l_.str.6@PAGEOFF
	bl	__
	bl	_die_errno
LBB0_12:
Lloh33:
	adrp	x8, _the_repository@GOTPAGE
Lloh34:
	ldr	x8, [x8, _the_repository@GOTPAGEOFF]
Lloh35:
	ldr	x0, [x8]
	ldr	x8, [x0]
	ldr	x8, [x8]
	cbz	x8, LBB0_15
; %bb.13:
	mov	x1, x20
	mov	w2, #10
	mov	x3, #0
	mov	w4, #0
	bl	_link_alt_odb_entries
	b	LBB0_15
LBB0_14:
	mov	x0, sp
	bl	_strbuf_release
	mov	x0, x22
	bl	_fclose
	add	x0, sp, #8
	bl	_rollback_lock_file
LBB0_15:
	mov	x0, x19
	bl	_free
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpAdd	Lloh27, Lloh28
	.loh AdrpAdd	Lloh29, Lloh30
	.loh AdrpAdd	Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.cfi_endproc
                                        ; -- End function
	.comm	_LOCK_INIT,4,2                  ; @LOCK_INIT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"objects/info/alternates"

	.comm	_LOCK_DIE_ON_ERROR,4,2          ; @LOCK_DIE_ON_ERROR
l_.str.1:                               ; @.str.1
	.asciz	"w"

l_.str.2:                               ; @.str.2
	.asciz	"unable to fdopen alternates lockfile"

l_.str.3:                               ; @.str.3
	.asciz	"r"

	.comm	_STRBUF_INIT,8,3                ; @STRBUF_INIT
	.comm	_EOF,8,3                        ; @EOF
l_.str.4:                               ; @.str.4
	.asciz	"%s\n"

	.comm	_errno,8,3                      ; @errno
	.comm	_ENOENT,8,3                     ; @ENOENT
l_.str.5:                               ; @.str.5
	.asciz	"unable to read alternates file"

l_.str.6:                               ; @.str.6
	.asciz	"unable to move new alternates file into place"

	.comm	_the_repository,8,3             ; @the_repository
.subsections_via_symbols
