	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_setup_work_tree                ## -- Begin function setup_work_tree
	.p2align	4, 0x90
_setup_work_tree:                       ## @setup_work_tree
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -24
	cmpb	$0, _setup_work_tree.initialized(%rip)
	jne	LBB0_9
## %bb.1:
	movq	_work_tree_config_is_bogus@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_3
## %bb.2:
	leaq	L_.str(%rip), %rdi
	callq	__
	movl	%eax, %edi
	callq	_die
LBB0_3:
	xorl	%eax, %eax
	callq	_get_git_work_tree
	testq	%rax, %rax
	je	LBB0_5
## %bb.4:
	movq	%rax, %rdi
	callq	_chdir_notify
	testq	%rax, %rax
	je	LBB0_6
LBB0_5:
	leaq	L_.str.1(%rip), %rdi
	callq	__
	movl	%eax, %edi
	callq	_die
LBB0_6:
	movq	_GIT_WORK_TREE_ENVIRONMENT@GOTPCREL(%rip), %rbx
	movl	(%rbx), %edi
	callq	_getenv
	testq	%rax, %rax
	je	LBB0_8
## %bb.7:
	movl	(%rbx), %edi
	leaq	L_.str.2(%rip), %rsi
	movl	$1, %edx
	callq	_setenv
LBB0_8:
	movb	$1, _setup_work_tree.initialized(%rip)
LBB0_9:
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
.zerofill __DATA,__bss,_setup_work_tree.initialized,1,2 ## @setup_work_tree.initialized
	.comm	_work_tree_config_is_bogus,8,3  ## @work_tree_config_is_bogus
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"unable to set up work tree using invalid config"

L_.str.1:                               ## @.str.1
	.asciz	"this operation must be run in a work tree"

	.comm	_GIT_WORK_TREE_ENVIRONMENT,4,2  ## @GIT_WORK_TREE_ENVIRONMENT
L_.str.2:                               ## @.str.2
	.asciz	"."

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_setup_work_tree                ; -- Begin function setup_work_tree
	.p2align	2
_setup_work_tree:                       ; @setup_work_tree
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	adrp	x19, _setup_work_tree.initialized@PAGE
	ldrb	w8, [x19, _setup_work_tree.initialized@PAGEOFF]
	tbnz	w8, #0, LBB0_9
; %bb.1:
Lloh0:
	adrp	x8, _work_tree_config_is_bogus@GOTPAGE
Lloh1:
	ldr	x8, [x8, _work_tree_config_is_bogus@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cbz	x8, LBB0_3
; %bb.2:
Lloh3:
	adrp	x0, l_.str@PAGE
Lloh4:
	add	x0, x0, l_.str@PAGEOFF
	bl	__
	bl	_die
LBB0_3:
	bl	_get_git_work_tree
	cbz	x0, LBB0_5
; %bb.4:
	bl	_chdir_notify
	cbz	x0, LBB0_6
LBB0_5:
Lloh5:
	adrp	x0, l_.str.1@PAGE
Lloh6:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	__
	bl	_die
LBB0_6:
Lloh7:
	adrp	x20, _GIT_WORK_TREE_ENVIRONMENT@GOTPAGE
Lloh8:
	ldr	x20, [x20, _GIT_WORK_TREE_ENVIRONMENT@GOTPAGEOFF]
	ldr	w0, [x20]
	bl	_getenv
	cbz	x0, LBB0_8
; %bb.7:
	ldr	w0, [x20]
Lloh9:
	adrp	x1, l_.str.2@PAGE
Lloh10:
	add	x1, x1, l_.str.2@PAGEOFF
	mov	w2, #1
	bl	_setenv
LBB0_8:
	mov	w8, #1
	strb	w8, [x19, _setup_work_tree.initialized@PAGEOFF]
LBB0_9:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpAdd	Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
.zerofill __DATA,__bss,_setup_work_tree.initialized,1,2 ; @setup_work_tree.initialized
	.comm	_work_tree_config_is_bogus,8,3  ; @work_tree_config_is_bogus
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"unable to set up work tree using invalid config"

l_.str.1:                               ; @.str.1
	.asciz	"this operation must be run in a work tree"

	.comm	_GIT_WORK_TREE_ENVIRONMENT,4,2  ; @GIT_WORK_TREE_ENVIRONMENT
l_.str.2:                               ; @.str.2
	.asciz	"."

.subsections_via_symbols
