	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_trail_new                      ## -- Begin function trail_new
	.p2align	4, 0x90
_trail_new:                             ## @trail_new
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r15d
	movq	%rdi, %r14
	movl	$1, %edi
	movl	$24, %esi
	callq	_calloc
	movq	%rax, %rbx
	movl	16(%rax), %edi
	movq	%r14, %rsi
	movl	$4, %edx
	callq	_strlcpy
	cmpl	$4, %eax
	jb	LBB0_2
## %bb.1:
	movq	%rbx, %rdi
	callq	_free
	leaq	L_.str(%rip), %rdi
	movq	%r14, %rsi
	callq	_pjdlog_error
	movq	_ENAMETOOLONG@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	_errno@GOTPCREL(%rip), %rcx
	movq	%rax, (%rcx)
	jmp	LBB0_10
LBB0_2:
	movq	%r14, %rdi
	callq	_opendir
	movq	%rax, 8(%rbx)
	testq	%rax, %rax
	je	LBB0_4
LBB0_3:
	movl	$-1, (%rbx)
	movq	_TRAIL_MAGIC@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 4(%rbx)
	jmp	LBB0_11
LBB0_4:
	testl	%r15d, %r15d
	je	LBB0_8
## %bb.5:
	movq	_errno@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	_ENOENT@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_8
## %bb.6:
	movq	%r14, %rdi
	movl	$448, %esi                      ## imm = 0x1C0
	callq	_mkdir
	cmpl	$-1, %eax
	je	LBB0_12
## %bb.7:
	movq	%r14, %rdi
	callq	_opendir
	movq	%rax, 8(%rbx)
	testq	%rax, %rax
	jne	LBB0_3
LBB0_8:
	movq	_LOG_ERR@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.2(%rip), %rsi
LBB0_9:
	movq	%r14, %rdx
	callq	_pjdlog_errno
	movq	%rbx, %rdi
	callq	_free
LBB0_10:
	xorl	%ebx, %ebx
LBB0_11:
	movq	%rbx, %rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_12:
	movq	_LOG_ERR@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.1(%rip), %rsi
	jmp	LBB0_9
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Directory name too long (\"%s\")."

	.comm	_ENAMETOOLONG,8,3               ## @ENAMETOOLONG
	.comm	_errno,8,3                      ## @errno
	.comm	_ENOENT,8,3                     ## @ENOENT
	.comm	_LOG_ERR,4,2                    ## @LOG_ERR
L_.str.1:                               ## @.str.1
	.asciz	"Unable to create directory \"%s\""

L_.str.2:                               ## @.str.2
	.asciz	"Unable to open directory \"%s\""

	.comm	_TRAIL_MAGIC,4,2                ## @TRAIL_MAGIC
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_trail_new                      ; -- Begin function trail_new
	.p2align	2
_trail_new:                             ; @trail_new
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x21, x1
	mov	x20, x0
	mov	w0, #1
	mov	w1, #24
	bl	_calloc
	mov	x19, x0
	ldr	w0, [x0, #16]
	mov	x1, x20
	mov	w2, #4
	bl	_strlcpy
	cmp	w0, #4
	b.lo	LBB0_2
; %bb.1:
	mov	x0, x19
	bl	_free
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x20
	bl	_pjdlog_error
	mov	x19, #0
Lloh2:
	adrp	x8, _ENAMETOOLONG@GOTPAGE
Lloh3:
	ldr	x8, [x8, _ENAMETOOLONG@GOTPAGEOFF]
Lloh4:
	ldr	x8, [x8]
Lloh5:
	adrp	x9, _errno@GOTPAGE
Lloh6:
	ldr	x9, [x9, _errno@GOTPAGEOFF]
Lloh7:
	str	x8, [x9]
	b	LBB0_10
LBB0_2:
	mov	x0, x20
	bl	_opendir
	str	x0, [x19, #8]
	cbz	x0, LBB0_4
LBB0_3:
	mov	w8, #-1
Lloh8:
	adrp	x9, _TRAIL_MAGIC@GOTPAGE
Lloh9:
	ldr	x9, [x9, _TRAIL_MAGIC@GOTPAGEOFF]
Lloh10:
	ldr	w9, [x9]
	stp	w8, w9, [x19]
	b	LBB0_10
LBB0_4:
	cbz	w21, LBB0_8
; %bb.5:
Lloh11:
	adrp	x8, _errno@GOTPAGE
Lloh12:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
Lloh13:
	ldr	x8, [x8]
Lloh14:
	adrp	x9, _ENOENT@GOTPAGE
Lloh15:
	ldr	x9, [x9, _ENOENT@GOTPAGEOFF]
Lloh16:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_8
; %bb.6:
	mov	x0, x20
	mov	w1, #448
	bl	_mkdir
	cmn	w0, #1
	b.eq	LBB0_11
; %bb.7:
	mov	x0, x20
	bl	_opendir
	str	x0, [x19, #8]
	cbnz	x0, LBB0_3
LBB0_8:
Lloh17:
	adrp	x8, _LOG_ERR@GOTPAGE
Lloh18:
	ldr	x8, [x8, _LOG_ERR@GOTPAGEOFF]
Lloh19:
	ldr	w0, [x8]
Lloh20:
	adrp	x1, l_.str.2@PAGE
Lloh21:
	add	x1, x1, l_.str.2@PAGEOFF
LBB0_9:
	mov	x2, x20
	bl	_pjdlog_errno
	mov	x0, x19
	bl	_free
	mov	x19, #0
LBB0_10:
	mov	x0, x19
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
LBB0_11:
Lloh22:
	adrp	x8, _LOG_ERR@GOTPAGE
Lloh23:
	ldr	x8, [x8, _LOG_ERR@GOTPAGEOFF]
Lloh24:
	ldr	w0, [x8]
Lloh25:
	adrp	x1, l_.str.1@PAGE
Lloh26:
	add	x1, x1, l_.str.1@PAGEOFF
	b	LBB0_9
	.loh AdrpLdrGotStr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpAdd	Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Directory name too long (\"%s\")."

	.comm	_ENAMETOOLONG,8,3               ; @ENAMETOOLONG
	.comm	_errno,8,3                      ; @errno
	.comm	_ENOENT,8,3                     ; @ENOENT
	.comm	_LOG_ERR,4,2                    ; @LOG_ERR
l_.str.1:                               ; @.str.1
	.asciz	"Unable to create directory \"%s\""

l_.str.2:                               ; @.str.2
	.asciz	"Unable to open directory \"%s\""

	.comm	_TRAIL_MAGIC,4,2                ; @TRAIL_MAGIC
.subsections_via_symbols
