	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_sys_getcwd                     ## -- Begin function sys_getcwd
	.p2align	4, 0x90
_sys_getcwd:                            ## @sys_getcwd
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r15d
	movl	%edi, %r14d
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	leaq	L_.str(%rip), %rdi
	movl	%r14d, %esi
	movl	%r15d, %edx
	xorl	%eax, %eax
	callq	_STRACE
	movq	_current@GOTPCREL(%rip), %r13
	movq	(%r13), %rax
	movq	(%rax), %rdi
	callq	_lock
	movq	(%r13), %rax
	movq	(%rax), %rax
	movq	8(%rax), %rbx
	movq	_MAX_PATH@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	incl	%eax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %r12
	movq	%rbx, %rdi
	movq	%r12, %rsi
	callq	_generic_getpath
	movl	%eax, %ebx
	movq	(%r13), %rax
	movq	(%rax), %rdi
	callq	_unlock
	testl	%ebx, %ebx
	js	LBB0_9
## %bb.1:
	movq	%r12, %rdi
	callq	_strlen
	cmpl	%r15d, %eax
	jge	LBB0_6
## %bb.2:
	movq	%r12, %rdi
	callq	_strlen
	movl	%eax, %ebx
	incl	%ebx
	movl	%ebx, %edi
	callq	_malloc
	testq	%rax, %rax
	je	LBB0_7
## %bb.3:
	movq	%rax, %r15
	movq	%rax, %rdi
	movq	%r12, %rsi
	callq	_strcpy
	leaq	L_.str.1(%rip), %rdi
	movl	%ebx, %esi
	movq	%r15, %rdx
	xorl	%eax, %eax
	callq	_STRACE
	movl	%r14d, %edi
	movq	%r15, %rsi
	movl	%ebx, %edx
	callq	_user_write
	testq	%rax, %rax
	je	LBB0_5
## %bb.4:
	movq	__EFAULT@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
LBB0_5:
	movq	%r15, %rdi
	callq	_free
	jmp	LBB0_9
LBB0_6:
	movq	__ERANGE@GOTPCREL(%rip), %rax
	jmp	LBB0_8
LBB0_7:
	movq	__ENOMEM@GOTPCREL(%rip), %rax
LBB0_8:
	movl	(%rax), %ebx
LBB0_9:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_11
## %bb.10:
	movl	%ebx, %eax
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_11:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"getcwd(%#x, %#x)"

	.comm	_current,8,3                    ## @current
	.comm	_MAX_PATH,4,2                   ## @MAX_PATH
	.comm	__ERANGE,4,2                    ## @_ERANGE
	.comm	__ENOMEM,4,2                    ## @_ENOMEM
L_.str.1:                               ## @.str.1
	.asciz	" \"%.*s\""

	.comm	__EFAULT,4,2                    ## @_EFAULT
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_sys_getcwd                     ; -- Begin function sys_getcwd
	.p2align	2
_sys_getcwd:                            ; @sys_getcwd
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	sub	sp, sp, #16
	mov	x20, x1
	mov	x19, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-56]
	str	x20, [sp, #-16]!
Lloh3:
	adrp	x0, l_.str@PAGE
Lloh4:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x19
	bl	_STRACE
	add	sp, sp, #16
Lloh5:
	adrp	x23, _current@GOTPAGE
Lloh6:
	ldr	x23, [x23, _current@GOTPAGEOFF]
	ldr	x8, [x23]
	ldr	x0, [x8]
	bl	_lock
	ldr	x8, [x23]
	ldr	x8, [x8]
	ldr	x0, [x8, #8]
Lloh7:
	adrp	x8, _MAX_PATH@GOTPAGE
Lloh8:
	ldr	x8, [x8, _MAX_PATH@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
	add	w8, w8, #1
	mov	x9, x8
Lloh10:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh11:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x9, sp
	add	x8, x8, #15
	and	x8, x8, #0x1fffffff0
	sub	x21, x9, x8
	mov	sp, x21
	mov	x1, x21
	bl	_generic_getpath
	mov	x22, x0
	ldr	x8, [x23]
	ldr	x0, [x8]
	bl	_unlock
	tbnz	w22, #31, LBB0_7
; %bb.1:
	mov	x0, x21
	bl	_strlen
	cmp	w0, w20
	b.ge	LBB0_4
; %bb.2:
	mov	x0, x21
	bl	_strlen
	add	w20, w0, #1
	mov	x0, x20
	bl	_malloc
	cbz	x0, LBB0_5
; %bb.3:
	mov	x23, x0
	mov	x1, x21
	bl	_strcpy
	str	x23, [sp, #-16]!
Lloh12:
	adrp	x0, l_.str.1@PAGE
Lloh13:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	x1, x20
	bl	_STRACE
	add	sp, sp, #16
	mov	x0, x19
	mov	x1, x23
	mov	x2, x20
	bl	_user_write
Lloh14:
	adrp	x8, __EFAULT@GOTPAGE
Lloh15:
	ldr	x8, [x8, __EFAULT@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
	cmp	x0, #0
	csel	w22, w20, w8, eq
	mov	x0, x23
	bl	_free
	b	LBB0_7
LBB0_4:
Lloh17:
	adrp	x8, __ERANGE@GOTPAGE
Lloh18:
	ldr	x8, [x8, __ERANGE@GOTPAGEOFF]
	b	LBB0_6
LBB0_5:
Lloh19:
	adrp	x8, __ENOMEM@GOTPAGE
Lloh20:
	ldr	x8, [x8, __ENOMEM@GOTPAGEOFF]
LBB0_6:
	ldr	w22, [x8]
LBB0_7:
	ldur	x8, [x29, #-56]
Lloh21:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh22:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh23:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_9
; %bb.8:
	mov	x0, x22
	sub	sp, x29, #48
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_9:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"getcwd(%#x, %#x)"

	.comm	_current,8,3                    ; @current
	.comm	_MAX_PATH,4,2                   ; @MAX_PATH
	.comm	__ERANGE,4,2                    ; @_ERANGE
	.comm	__ENOMEM,4,2                    ; @_ENOMEM
l_.str.1:                               ; @.str.1
	.asciz	" \"%.*s\""

	.comm	__EFAULT,4,2                    ; @_EFAULT
.subsections_via_symbols
