	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_trail_unlink                   ## -- Begin function trail_unlink
	.p2align	4, 0x90
_trail_unlink:                          ## @trail_unlink
	.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
	movq	%rsi, %r15
	movq	%rdi, %r14
	movq	(%rdi), %rax
	movq	_TRAIL_MAGIC@GOTPCREL(%rip), %rcx
	xorl	%edi, %edi
	cmpq	(%rcx), %rax
	sete	%dil
	callq	_PJDLOG_ASSERT
	xorl	%edi, %edi
	testq	%r15, %r15
	setne	%dil
	callq	_PJDLOG_ASSERT
	xorl	%edi, %edi
	cmpb	$0, (%r15)
	setne	%dil
	callq	_PJDLOG_ASSERT
	movl	12(%r14), %edi
	callq	_dirfd
	movl	%eax, %ebx
	movl	%eax, %edi
	notl	%edi
	shrl	$31, %edi
	callq	_PJDLOG_ASSERT
	movl	%ebx, %edi
	movq	%r15, %rsi
	xorl	%edx, %edx
	callq	_unlinkat
	cmpl	$-1, %eax
	je	LBB0_1
## %bb.2:
	movl	8(%r14), %edx
	leaq	L_.str.1(%rip), %rsi
	movl	$1, %edi
	movq	%r15, %rcx
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_pjdlog_debug                   ## TAILCALL
LBB0_1:
	movq	_LOG_ERR@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	8(%r14), %edx
	leaq	L_.str(%rip), %rsi
	movq	%r15, %rcx
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_pjdlog_errno                   ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_TRAIL_MAGIC,8,3                ## @TRAIL_MAGIC
	.comm	_LOG_ERR,4,2                    ## @LOG_ERR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Unable to remove \"%s/%s\""

L_.str.1:                               ## @.str.1
	.asciz	"Trail file \"%s/%s\" removed."

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_trail_unlink                   ; -- Begin function trail_unlink
	.p2align	2
_trail_unlink:                          ; @trail_unlink
	.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	x19, x1
	mov	x20, x0
	ldr	x8, [x0]
Lloh0:
	adrp	x9, _TRAIL_MAGIC@GOTPAGE
Lloh1:
	ldr	x9, [x9, _TRAIL_MAGIC@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	cset	w0, eq
	bl	_PJDLOG_ASSERT
	cmp	x19, #0
	cset	w0, ne
	bl	_PJDLOG_ASSERT
	ldrb	w8, [x19]
	cmp	w8, #0
	cset	w0, ne
	bl	_PJDLOG_ASSERT
	ldr	w0, [x20, #12]
	bl	_dirfd
	mov	x21, x0
	mvn	w8, w0
	lsr	w0, w8, #31
	bl	_PJDLOG_ASSERT
	mov	x0, x21
	mov	x1, x19
	mov	w2, #0
	bl	_unlinkat
	cmn	w0, #1
	b.eq	LBB0_2
; %bb.1:
	ldr	w2, [x20, #8]
Lloh3:
	adrp	x1, l_.str.1@PAGE
Lloh4:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	w0, #1
	mov	x3, 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
	b	_pjdlog_debug
LBB0_2:
Lloh5:
	adrp	x8, _LOG_ERR@GOTPAGE
Lloh6:
	ldr	x8, [x8, _LOG_ERR@GOTPAGEOFF]
Lloh7:
	ldr	w0, [x8]
	ldr	w2, [x20, #8]
Lloh8:
	adrp	x1, l_.str@PAGE
Lloh9:
	add	x1, x1, l_.str@PAGEOFF
	mov	x3, 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
	b	_pjdlog_errno
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_TRAIL_MAGIC,8,3                ; @TRAIL_MAGIC
	.comm	_LOG_ERR,4,2                    ; @LOG_ERR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Unable to remove \"%s/%s\""

l_.str.1:                               ; @.str.1
	.asciz	"Trail file \"%s/%s\" removed."

.subsections_via_symbols
