	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function validate_worktree_add
_validate_worktree_add:                 ## @validate_worktree_add
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r15
	movq	%rdi, %r12
	callq	_file_exists
	testq	%rax, %rax
	je	LBB0_3
## %bb.1:
	movq	%r12, %rdi
	callq	_is_empty_dir
	testl	%eax, %eax
	jne	LBB0_3
## %bb.2:
	leaq	L_.str(%rip), %rdi
	callq	__
	movl	%eax, %edi
	movq	%r12, %rsi
	callq	_die
LBB0_3:
	xorl	%edi, %edi
	callq	_get_worktrees
	movq	%rax, %r14
	leaq	8(%rax), %rdi
	xorl	%esi, %esi
	movq	%r12, %rdx
	callq	_find_worktree
	testq	%rax, %rax
	je	LBB0_12
## %bb.4:
	movq	%rax, %rbx
	movq	%rax, %rdi
	callq	_worktree_lock_reason
	movl	(%r15), %ecx
	testl	%eax, %eax
	je	LBB0_5
## %bb.7:
	cmpl	$2, %ecx
	jge	LBB0_9
## %bb.8:
	leaq	L_.str.2(%rip), %rdi
	jmp	LBB0_11
LBB0_5:
	testl	%ecx, %ecx
	je	LBB0_6
LBB0_9:
	movl	(%rbx), %edi
	callq	_delete_git_dir
	testq	%rax, %rax
	je	LBB0_12
## %bb.10:
	leaq	L_.str.1(%rip), %rdi
	jmp	LBB0_11
LBB0_6:
	leaq	L_.str.3(%rip), %rdi
LBB0_11:
	callq	__
	movl	%eax, %edi
	movq	%r12, %rsi
	callq	_die
LBB0_12:
	movq	%r14, %rdi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_free_worktrees                 ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"'%s' already exists"

L_.str.1:                               ## @.str.1
	.asciz	"unable to re-add worktree '%s'"

L_.str.2:                               ## @.str.2
	.asciz	"'%s' is a missing but locked worktree;\nuse 'add -f -f' to override, or 'unlock' and 'prune' or 'remove' to clear"

L_.str.3:                               ## @.str.3
	.asciz	"'%s' is a missing but already registered worktree;\nuse 'add -f' to override, or 'prune' or 'remove' to clear"

	.no_dead_strip	_validate_worktree_add
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function validate_worktree_add
_validate_worktree_add:                 ; @validate_worktree_add
	.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	x21, x1
	mov	x19, x0
	bl	_file_exists
	cbz	x0, LBB0_3
; %bb.1:
	mov	x0, x19
	bl	_is_empty_dir
	cbnz	w0, LBB0_3
; %bb.2:
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	__
	mov	x1, x19
	bl	_die
LBB0_3:
	mov	w0, #0
	bl	_get_worktrees
	mov	x20, x0
	add	x0, x0, #8
	mov	x1, #0
	mov	x2, x19
	bl	_find_worktree
	cbz	x0, LBB0_12
; %bb.4:
	mov	x22, x0
	bl	_worktree_lock_reason
	ldr	w8, [x21]
	cbz	w0, LBB0_7
; %bb.5:
	cmp	w8, #2
	b.ge	LBB0_8
; %bb.6:
Lloh2:
	adrp	x0, l_.str.2@PAGE
Lloh3:
	add	x0, x0, l_.str.2@PAGEOFF
	b	LBB0_11
LBB0_7:
	cbz	w8, LBB0_10
LBB0_8:
	ldr	w0, [x22]
	bl	_delete_git_dir
	cbz	x0, LBB0_12
; %bb.9:
Lloh4:
	adrp	x0, l_.str.1@PAGE
Lloh5:
	add	x0, x0, l_.str.1@PAGEOFF
	b	LBB0_11
LBB0_10:
Lloh6:
	adrp	x0, l_.str.3@PAGE
Lloh7:
	add	x0, x0, l_.str.3@PAGEOFF
LBB0_11:
	bl	__
	mov	x1, x19
	bl	_die
LBB0_12:
	mov	x0, x20
	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
	b	_free_worktrees
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"'%s' already exists"

l_.str.1:                               ; @.str.1
	.asciz	"unable to re-add worktree '%s'"

l_.str.2:                               ; @.str.2
	.asciz	"'%s' is a missing but locked worktree;\nuse 'add -f -f' to override, or 'unlock' and 'prune' or 'remove' to clear"

l_.str.3:                               ; @.str.3
	.asciz	"'%s' is a missing but already registered worktree;\nuse 'add -f' to override, or 'prune' or 'remove' to clear"

	.no_dead_strip	_validate_worktree_add
.subsections_via_symbols
