	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_safe_path                      ## -- Begin function safe_path
	.p2align	4, 0x90
_safe_path:                             ## @safe_path
	.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
	subq	$72, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%r9, -72(%rbp)                  ## 8-byte Spill
	movq	%r8, %r14
	movq	%rcx, -56(%rbp)                 ## 8-byte Spill
	movq	%rdx, %rbx
	movq	%rsi, -88(%rbp)                 ## 8-byte Spill
	movq	%rdi, %r15
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	_PATH_MAX@GOTPCREL(%rip), %rax
	movl	(%rax), %r13d
	movq	%r13, %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %r12
	movq	%r13, -80(%rbp)                 ## 8-byte Spill
	movq	%r13, %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, -64(%rbp)                 ## 8-byte Spill
	movq	%r15, %rdi
	movq	%r12, %rsi
	callq	_realpath
	testq	%rax, %rax
	je	LBB0_3
## %bb.1:
	movq	%r14, %r15
	movq	-72(%rbp), %r13                 ## 8-byte Reload
	testq	%rbx, %rbx
	je	LBB0_4
## %bb.2:
	movq	%rbx, %rdi
	movq	-64(%rbp), %rsi                 ## 8-byte Reload
	callq	_realpath
	testq	%rax, %rax
	sete	%r14b
	jmp	LBB0_5
LBB0_3:
	movq	_errno@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_strerror
	leaq	L_.str(%rip), %rdx
	movq	%r14, %rdi
	movq	-72(%rbp), %rsi                 ## 8-byte Reload
	movq	%r15, %rcx
	movq	%rax, %r8
	xorl	%eax, %eax
	callq	_snprintf
	jmp	LBB0_12
LBB0_4:
	movb	$1, %r14b
LBB0_5:
	movq	-88(%rbp), %rbx                 ## 8-byte Reload
	movl	(%rbx), %edi
	callq	_S_ISREG
	testl	%eax, %eax
	je	LBB0_10
## %bb.6:
	movq	8(%rbx), %rdi
	callq	_platform_sys_dir_uid
	testl	%eax, %eax
	jne	LBB0_8
## %bb.7:
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	cmpq	%rax, 8(%rbx)
	jne	LBB0_9
LBB0_8:
	testb	$18, (%rbx)
	je	LBB0_15
LBB0_9:
	leaq	L_.str.2(%rip), %rdx
	jmp	LBB0_11
LBB0_10:
	leaq	L_.str.1(%rip), %rdx
LBB0_11:
	movq	%r15, %rdi
	movq	%r13, %rsi
	movq	%r12, %rcx
	xorl	%eax, %eax
	callq	_snprintf
LBB0_12:
	movl	$-1, %ebx
LBB0_13:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_28
## %bb.14:
	movl	%ebx, %eax
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_15:
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_16:                                ## =>This Inner Loop Header: Depth=1
	movq	%r12, %rdi
	callq	_dirname
	testq	%rax, %rax
	je	LBB0_26
## %bb.17:                              ##   in Loop: Header=BB0_16 Depth=1
	movq	%r12, %rdi
	movq	%rax, %rsi
	movq	-80(%rbp), %rdx                 ## 8-byte Reload
                                        ## kill: def $edx killed $edx killed $rdx
	callq	_strlcpy
	movq	%r12, %rdi
	leaq	-104(%rbp), %rsi
	callq	_stat
	testq	%rax, %rax
	js	LBB0_25
## %bb.18:                              ##   in Loop: Header=BB0_16 Depth=1
	movq	-96(%rbp), %rdi
	callq	_platform_sys_dir_uid
	testl	%eax, %eax
	jne	LBB0_20
## %bb.19:                              ##   in Loop: Header=BB0_16 Depth=1
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	cmpq	%rax, -96(%rbp)
	jne	LBB0_25
LBB0_20:                                ##   in Loop: Header=BB0_16 Depth=1
	testb	$18, -104(%rbp)
	jne	LBB0_25
## %bb.21:                              ##   in Loop: Header=BB0_16 Depth=1
	testb	%r14b, %r14b
	jne	LBB0_23
## %bb.22:                              ##   in Loop: Header=BB0_16 Depth=1
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	movq	%r12, %rsi
	callq	_strcmp
	testq	%rax, %rax
	je	LBB0_27
LBB0_23:                                ##   in Loop: Header=BB0_16 Depth=1
	leaq	L_.str.5(%rip), %rdi
	movq	%r12, %rsi
	callq	_strcmp
	testq	%rax, %rax
	je	LBB0_13
## %bb.24:                              ##   in Loop: Header=BB0_16 Depth=1
	leaq	L_.str.6(%rip), %rdi
	movq	%r12, %rsi
	callq	_strcmp
	testq	%rax, %rax
	jne	LBB0_16
	jmp	LBB0_13
LBB0_25:
	leaq	L_.str.4(%rip), %rdx
	jmp	LBB0_11
LBB0_26:
	leaq	L_.str.3(%rip), %rdx
	movq	%r15, %rdi
	movq	%r13, %rsi
	xorl	%eax, %eax
	callq	_snprintf
	jmp	LBB0_12
LBB0_27:
	xorl	%ebx, %ebx
	jmp	LBB0_13
LBB0_28:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_PATH_MAX,4,2                   ## @PATH_MAX
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"realpath %s failed: %s"

	.comm	_errno,4,2                      ## @errno
L_.str.1:                               ## @.str.1
	.asciz	"%s is not a regular file"

L_.str.2:                               ## @.str.2
	.asciz	"bad ownership or modes for file %s"

L_.str.3:                               ## @.str.3
	.asciz	"dirname() failed"

L_.str.4:                               ## @.str.4
	.asciz	"bad ownership or modes for directory %s"

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

L_.str.6:                               ## @.str.6
	.asciz	"."

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_safe_path                      ; -- Begin function safe_path
	.p2align	2
_safe_path:                             ; @safe_path
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	sub	sp, sp, #32
	mov	x19, x5
	mov	x20, x4
	mov	x21, x3
	mov	x27, x2
	mov	x25, x1
	mov	x26, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-88]
Lloh3:
	adrp	x8, _PATH_MAX@GOTPAGE
Lloh4:
	ldr	x8, [x8, _PATH_MAX@GOTPAGEOFF]
Lloh5:
	ldr	w23, [x8]
	mov	x9, x23
Lloh6:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh7:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x8, sp
	add	x9, x23, #15
	and	x12, x9, #0x1fffffff0
	sub	x22, x8, x12
	mov	sp, x22
	mov	x9, x23
Lloh8:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh9:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x8, sp
	sub	x24, x8, x12
	mov	sp, x24
	mov	x1, x22
	bl	_realpath
	cbz	x0, LBB0_3
; %bb.1:
	cbz	x27, LBB0_4
; %bb.2:
	mov	x0, x27
	mov	x1, x24
	bl	_realpath
	cmp	x0, #0
	cset	w27, eq
	b	LBB0_5
LBB0_3:
Lloh10:
	adrp	x8, _errno@GOTPAGE
Lloh11:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh12:
	ldr	w0, [x8]
	bl	_strerror
	stp	x26, x0, [sp, #-16]!
Lloh13:
	adrp	x2, l_.str@PAGE
Lloh14:
	add	x2, x2, l_.str@PAGEOFF
	b	LBB0_11
LBB0_4:
	mov	w27, #1
LBB0_5:
	ldr	w0, [x25]
	bl	_S_ISREG
	cbz	w0, LBB0_10
; %bb.6:
	ldr	x0, [x25, #8]
	bl	_platform_sys_dir_uid
	cbnz	w0, LBB0_8
; %bb.7:
	ldr	x8, [x25, #8]
	cmp	x8, x21
	b.ne	LBB0_9
LBB0_8:
	ldrb	w8, [x25]
	mov	w28, #18
	tst	w8, w28
	b.eq	LBB0_15
LBB0_9:
	str	x22, [sp, #-16]!
Lloh15:
	adrp	x2, l_.str.2@PAGE
Lloh16:
	add	x2, x2, l_.str.2@PAGEOFF
	b	LBB0_11
LBB0_10:
	str	x22, [sp, #-16]!
Lloh17:
	adrp	x2, l_.str.1@PAGE
Lloh18:
	add	x2, x2, l_.str.1@PAGEOFF
LBB0_11:
	mov	x0, x20
	mov	x1, x19
	bl	_snprintf
	add	sp, sp, #16
LBB0_12:
	mov	w0, #-1
LBB0_13:
	ldur	x8, [x29, #-88]
Lloh19:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh20:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh21:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_27
; %bb.14:
	sub	sp, x29, #80
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
LBB0_15:
Lloh22:
	adrp	x25, l_.str.5@PAGE
Lloh23:
	add	x25, x25, l_.str.5@PAGEOFF
Lloh24:
	adrp	x26, l_.str.6@PAGE
Lloh25:
	add	x26, x26, l_.str.6@PAGEOFF
LBB0_16:                                ; =>This Inner Loop Header: Depth=1
	mov	x0, x22
	bl	_dirname
	cbz	x0, LBB0_26
; %bb.17:                               ;   in Loop: Header=BB0_16 Depth=1
	mov	x1, x0
	mov	x0, x22
	mov	x2, x23
	bl	_strlcpy
	sub	x1, x29, #104
	mov	x0, x22
	bl	_stat
	tbnz	x0, #63, LBB0_25
; %bb.18:                               ;   in Loop: Header=BB0_16 Depth=1
	ldur	x0, [x29, #-96]
	bl	_platform_sys_dir_uid
	cbnz	w0, LBB0_20
; %bb.19:                               ;   in Loop: Header=BB0_16 Depth=1
	ldur	x8, [x29, #-96]
	cmp	x8, x21
	b.ne	LBB0_25
LBB0_20:                                ;   in Loop: Header=BB0_16 Depth=1
	ldurb	w8, [x29, #-104]
	tst	w8, w28
	b.ne	LBB0_25
; %bb.21:                               ;   in Loop: Header=BB0_16 Depth=1
	tbnz	w27, #0, LBB0_23
; %bb.22:                               ;   in Loop: Header=BB0_16 Depth=1
	mov	x0, x24
	mov	x1, x22
	bl	_strcmp
	cbz	x0, LBB0_13
LBB0_23:                                ;   in Loop: Header=BB0_16 Depth=1
	mov	x0, x25
	mov	x1, x22
	bl	_strcmp
	cbz	x0, LBB0_13
; %bb.24:                               ;   in Loop: Header=BB0_16 Depth=1
	mov	x0, x26
	mov	x1, x22
	bl	_strcmp
	mov	x8, x0
	mov	w0, #0
	cbnz	x8, LBB0_16
	b	LBB0_13
LBB0_25:
	str	x22, [sp, #-16]!
Lloh26:
	adrp	x2, l_.str.4@PAGE
Lloh27:
	add	x2, x2, l_.str.4@PAGEOFF
	b	LBB0_11
LBB0_26:
Lloh28:
	adrp	x2, l_.str.3@PAGE
Lloh29:
	add	x2, x2, l_.str.3@PAGEOFF
	mov	x0, x20
	mov	x1, x19
	bl	_snprintf
	b	LBB0_12
LBB0_27:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpAdd	Lloh26, Lloh27
	.loh AdrpAdd	Lloh28, Lloh29
	.cfi_endproc
                                        ; -- End function
	.comm	_PATH_MAX,4,2                   ; @PATH_MAX
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"realpath %s failed: %s"

	.comm	_errno,4,2                      ; @errno
l_.str.1:                               ; @.str.1
	.asciz	"%s is not a regular file"

l_.str.2:                               ; @.str.2
	.asciz	"bad ownership or modes for file %s"

l_.str.3:                               ; @.str.3
	.asciz	"dirname() failed"

l_.str.4:                               ; @.str.4
	.asciz	"bad ownership or modes for directory %s"

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

l_.str.6:                               ; @.str.6
	.asciz	"."

.subsections_via_symbols
