	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_chdirectory                    ## -- Begin function chdirectory
	.p2align	4, 0x90
_chdirectory:                           ## @chdirectory
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -24(%rbp)
	movq	_PATH_MAX@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movq	%rbx, %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %r14
	leaq	L_.str(%rip), %rdi
	movq	%r14, %rsi
	movl	%ebx, %edx
	callq	_prompt
	testq	%rax, %rax
	je	LBB0_3
## %bb.1:
	movq	_stoprompt@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	jne	LBB0_6
## %bb.2:
	movq	_HOME@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_value
	movq	%rax, %r14
LBB0_3:
	movq	%r14, %rdi
	callq	_chdir
	testq	%rax, %rax
	jns	LBB0_5
## %bb.4:
	leaq	L_.str.1(%rip), %rdi
	movq	%r14, %rsi
	xorl	%eax, %eax
	callq	_printf
LBB0_5:
	leaq	L_str(%rip), %rdi
	callq	_puts
LBB0_6:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-24(%rbp), %rax
	jne	LBB0_8
## %bb.7:
	leaq	-16(%rbp), %rsp
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
LBB0_8:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_PATH_MAX,4,2                   ## @PATH_MAX
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"[cd] "

	.comm	_stoprompt,8,3                  ## @stoprompt
	.comm	_HOME,4,2                       ## @HOME
L_.str.1:                               ## @.str.1
	.asciz	"%s: bad directory\r\n"

L_str:                                  ## @str
	.asciz	"!\r"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_chdirectory                    ; -- Begin function chdirectory
	.p2align	2
_chdirectory:                           ; @chdirectory
	.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
	sub	sp, sp, #16
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-24]
Lloh3:
	adrp	x8, _PATH_MAX@GOTPAGE
Lloh4:
	ldr	x8, [x8, _PATH_MAX@GOTPAGEOFF]
Lloh5:
	ldr	w2, [x8]
	mov	x9, x2
Lloh6:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh7:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x8, sp
	add	x9, x2, #15
	and	x9, x9, #0x1fffffff0
	sub	x19, x8, x9
	mov	sp, x19
Lloh8:
	adrp	x0, l_.str@PAGE
Lloh9:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x19
                                        ; kill: def $w2 killed $w2 killed $x2
	bl	_prompt
	cbz	x0, LBB0_3
; %bb.1:
Lloh10:
	adrp	x8, _stoprompt@GOTPAGE
Lloh11:
	ldr	x8, [x8, _stoprompt@GOTPAGEOFF]
Lloh12:
	ldr	x8, [x8]
	cbnz	x8, LBB0_6
; %bb.2:
Lloh13:
	adrp	x8, _HOME@GOTPAGE
Lloh14:
	ldr	x8, [x8, _HOME@GOTPAGEOFF]
Lloh15:
	ldr	w0, [x8]
	bl	_value
	mov	x19, x0
LBB0_3:
	mov	x0, x19
	bl	_chdir
	tbz	x0, #63, LBB0_5
; %bb.4:
	str	x19, [sp, #-16]!
Lloh16:
	adrp	x0, l_.str.1@PAGE
Lloh17:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_printf
	add	sp, sp, #16
LBB0_5:
Lloh18:
	adrp	x0, l_str@PAGE
Lloh19:
	add	x0, x0, l_str@PAGEOFF
	bl	_puts
LBB0_6:
	ldur	x8, [x29, #-24]
Lloh20:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh21:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh22:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_8
; %bb.7:
	sub	sp, x29, #16
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
LBB0_8:
	bl	___stack_chk_fail
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.cfi_endproc
                                        ; -- End function
	.comm	_PATH_MAX,4,2                   ; @PATH_MAX
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"[cd] "

	.comm	_stoprompt,8,3                  ; @stoprompt
	.comm	_HOME,4,2                       ; @HOME
l_.str.1:                               ; @.str.1
	.asciz	"%s: bad directory\r\n"

l_str:                                  ; @str
	.asciz	"!\r"

.subsections_via_symbols
