	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_main                           ## -- Begin function main
	.p2align	4, 0x90
_main:                                  ## @main
	.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
	movq	%rsi, %rbx
	cmpl	$4, %edi
	je	LBB0_2
## %bb.1:
	leaq	L_.str(%rip), %rsi
	movl	$1, %edi
	callq	_errx
LBB0_2:
	movq	8(%rbx), %rdi
	movq	_prefix@GOTPCREL(%rip), %rax
	movq	%rdi, (%rax)
	callq	_strlen
	movq	_prefixlen@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
	movq	24(%rbx), %rdi
	leaq	L_.str.1(%rip), %rsi
	callq	_strcmp
	testq	%rax, %rax
	je	LBB0_3
## %bb.5:
	movq	24(%rbx), %rdi
	leaq	L_.str.2(%rip), %rsi
	callq	_strcmp
	testq	%rax, %rax
	je	LBB0_6
## %bb.7:
	movq	_EXIT_FAILURE@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.3(%rip), %rsi
	callq	_errx
	jmp	LBB0_8
LBB0_3:
	movq	_dochdir@GOTPCREL(%rip), %rax
	jmp	LBB0_4
LBB0_6:
	movq	_dofchdir@GOTPCREL(%rip), %rax
LBB0_4:
	movl	(%rax), %eax
	movq	_thechdir@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
LBB0_8:
	movq	16(%rbx), %rdi
	leaq	L_.str.4(%rip), %rsi
	callq	_strcmp
	testq	%rax, %rax
	jne	LBB0_10
## %bb.9:
	xorl	%eax, %eax
	callq	_simple
LBB0_10:
	movq	16(%rbx), %rdi
	leaq	L_.str.5(%rip), %rsi
	callq	_strcmp
	testq	%rax, %rax
	jne	LBB0_12
## %bb.11:
	xorl	%eax, %eax
	callq	_symlinktest
LBB0_12:
	movq	_EXIT_SUCCESS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"usage"

	.comm	_prefix,8,3                     ## @prefix
	.comm	_prefixlen,4,2                  ## @prefixlen
L_.str.1:                               ## @.str.1
	.asciz	"chdir"

	.comm	_dochdir,4,2                    ## @dochdir
	.comm	_thechdir,4,2                   ## @thechdir
L_.str.2:                               ## @.str.2
	.asciz	"fchdir"

	.comm	_dofchdir,4,2                   ## @dofchdir
	.comm	_EXIT_FAILURE,4,2               ## @EXIT_FAILURE
L_.str.3:                               ## @.str.3
	.asciz	"invalid chdir type"

L_.str.4:                               ## @.str.4
	.asciz	"simple"

L_.str.5:                               ## @.str.5
	.asciz	"symlink"

	.comm	_EXIT_SUCCESS,4,2               ## @EXIT_SUCCESS
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_main                           ; -- Begin function main
	.p2align	2
_main:                                  ; @main
	.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
	mov	x19, x1
	cmp	w0, #4
	b.eq	LBB0_2
; %bb.1:
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	w0, #1
	bl	_errx
LBB0_2:
	ldr	x0, [x19, #8]
Lloh2:
	adrp	x8, _prefix@GOTPAGE
Lloh3:
	ldr	x8, [x8, _prefix@GOTPAGEOFF]
Lloh4:
	str	x0, [x8]
	bl	_strlen
Lloh5:
	adrp	x8, _prefixlen@GOTPAGE
Lloh6:
	ldr	x8, [x8, _prefixlen@GOTPAGEOFF]
Lloh7:
	str	w0, [x8]
	ldr	x0, [x19, #24]
Lloh8:
	adrp	x1, l_.str.1@PAGE
Lloh9:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_strcmp
	cbz	x0, LBB0_5
; %bb.3:
	ldr	x0, [x19, #24]
Lloh10:
	adrp	x1, l_.str.2@PAGE
Lloh11:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_strcmp
	cbz	x0, LBB0_6
; %bb.4:
Lloh12:
	adrp	x8, _EXIT_FAILURE@GOTPAGE
Lloh13:
	ldr	x8, [x8, _EXIT_FAILURE@GOTPAGEOFF]
Lloh14:
	ldr	w0, [x8]
Lloh15:
	adrp	x1, l_.str.3@PAGE
Lloh16:
	add	x1, x1, l_.str.3@PAGEOFF
	bl	_errx
	b	LBB0_8
LBB0_5:
Lloh17:
	adrp	x8, _dochdir@GOTPAGE
Lloh18:
	ldr	x8, [x8, _dochdir@GOTPAGEOFF]
	b	LBB0_7
LBB0_6:
Lloh19:
	adrp	x8, _dofchdir@GOTPAGE
Lloh20:
	ldr	x8, [x8, _dofchdir@GOTPAGEOFF]
LBB0_7:
	ldr	w8, [x8]
Lloh21:
	adrp	x9, _thechdir@GOTPAGE
Lloh22:
	ldr	x9, [x9, _thechdir@GOTPAGEOFF]
Lloh23:
	str	w8, [x9]
LBB0_8:
	ldr	x0, [x19, #16]
Lloh24:
	adrp	x1, l_.str.4@PAGE
Lloh25:
	add	x1, x1, l_.str.4@PAGEOFF
	bl	_strcmp
	cbnz	x0, LBB0_10
; %bb.9:
	bl	_simple
LBB0_10:
	ldr	x0, [x19, #16]
Lloh26:
	adrp	x1, l_.str.5@PAGE
Lloh27:
	add	x1, x1, l_.str.5@PAGEOFF
	bl	_strcmp
	cbnz	x0, LBB0_12
; %bb.11:
	bl	_symlinktest
LBB0_12:
Lloh28:
	adrp	x8, _EXIT_SUCCESS@GOTPAGE
Lloh29:
	ldr	x8, [x8, _EXIT_SUCCESS@GOTPAGEOFF]
Lloh30:
	ldr	w0, [x8]
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotStr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotStr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh10, Lloh11
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGotStr	Lloh21, Lloh22, Lloh23
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpAdd	Lloh26, Lloh27
	.loh AdrpLdrGotLdr	Lloh28, Lloh29, Lloh30
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"usage"

	.comm	_prefix,8,3                     ; @prefix
	.comm	_prefixlen,4,2                  ; @prefixlen
l_.str.1:                               ; @.str.1
	.asciz	"chdir"

	.comm	_dochdir,4,2                    ; @dochdir
	.comm	_thechdir,4,2                   ; @thechdir
l_.str.2:                               ; @.str.2
	.asciz	"fchdir"

	.comm	_dofchdir,4,2                   ; @dofchdir
	.comm	_EXIT_FAILURE,4,2               ; @EXIT_FAILURE
l_.str.3:                               ; @.str.3
	.asciz	"invalid chdir type"

l_.str.4:                               ; @.str.4
	.asciz	"simple"

l_.str.5:                               ; @.str.5
	.asciz	"symlink"

	.comm	_EXIT_SUCCESS,4,2               ; @EXIT_SUCCESS
.subsections_via_symbols
