	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_trail_start                    ## -- Begin function trail_start
	.p2align	4, 0x90
_trail_start:                           ## @trail_start
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %rbx
	movq	%rsi, %r14
	movq	%rdi, %r13
	movq	(%rdi), %rax
	movq	_TRAIL_MAGIC@GOTPCREL(%rip), %rcx
	xorl	%edi, %edi
	cmpq	(%rcx), %rax
	sete	%dil
	callq	_PJDLOG_ASSERT
	movq	8(%r13), %rdi
	movq	%r14, %rsi
	movl	$8, %edx
	callq	_strlcpy
	xorl	%edi, %edi
	cmpl	$8, %eax
	setb	%dil
	callq	_PJDLOG_VERIFY
	movl	$-1, 16(%r13)
	movq	8(%r13), %rax
	cmpb	$0, (%rax)
	je	LBB0_1
## %bb.2:
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	movl	24(%r13), %edi
	callq	_dirfd
	movl	%eax, %r15d
	movl	%eax, %edi
	notl	%edi
	shrl	$31, %edi
	callq	_PJDLOG_ASSERT
	movq	8(%r13), %rsi
	movq	_O_RDONLY@GOTPCREL(%rip), %r12
	movl	(%r12), %edx
	movl	%r15d, %edi
	callq	_openat
	movl	%eax, %ebx
	cmpl	$-1, %eax
	je	LBB0_3
LBB0_9:
	leaq	-72(%rbp), %rsi
	movl	%ebx, %edi
	callq	_fstat
	cmpl	$-1, %eax
	je	LBB0_10
## %bb.16:
	movl	-64(%rbp), %edi
	callq	_S_ISREG
	testl	%eax, %eax
	je	LBB0_17
## %bb.19:
	movq	%r14, -48(%rbp)                 ## 8-byte Spill
	movq	-72(%rbp), %r14
	movq	-56(%rbp), %r12                 ## 8-byte Reload
	cmpq	%r12, %r14
	jg	LBB0_23
## %bb.20:
	movq	8(%r13), %rdi
	callq	_trail_is_not_terminated
	testq	%rax, %rax
	je	LBB0_21
LBB0_23:
	movq	_SEEK_SET@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	%ebx, %edi
	movq	%r12, %rsi
	callq	_lseek
	cmpl	$-1, %eax
	je	LBB0_24
## %bb.25:
	movq	8(%r13), %rdi
	callq	_trail_is_crash_recovery
	testl	%eax, %eax
	jne	LBB0_27
## %bb.26:
	movl	20(%r13), %edx
	movq	8(%r13), %rcx
	leaq	L_.str.6(%rip), %rsi
	movl	$1, %edi
	movl	%r12d, %r8d
	xorl	%eax, %eax
	callq	_pjdlog_debug
LBB0_27:
	movl	%ebx, 16(%r13)
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_1:
	xorl	%edi, %edi
	testq	%rbx, %rbx
	sete	%dil
	callq	_PJDLOG_ASSERT
	jmp	LBB0_15
LBB0_3:
	movq	%r14, -48(%rbp)                 ## 8-byte Spill
	movq	_errno@GOTPCREL(%rip), %r14
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r14), %rax
	movq	_ENOENT@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_11
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	8(%r13), %rdi
	callq	_trail_is_not_terminated
	testq	%rax, %rax
	je	LBB0_11
## %bb.6:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	%r13, %rdi
	callq	_trail_find
	testq	%rax, %rax
	je	LBB0_11
## %bb.7:                               ##   in Loop: Header=BB0_4 Depth=1
	movl	20(%r13), %edx
	movq	8(%r13), %rcx
	movl	$1, %edi
	leaq	L_.str(%rip), %rsi
	xorl	%eax, %eax
	callq	_pjdlog_debug
	movq	8(%r13), %rsi
	movl	(%r12), %edx
	movl	%r15d, %edi
	callq	_openat
	cmpl	$-1, %eax
	je	LBB0_4
## %bb.8:
	movl	%eax, %ebx
	movq	-48(%rbp), %r14                 ## 8-byte Reload
	jmp	LBB0_9
LBB0_11:
	movq	(%r14), %rax
	movq	_ENOENT@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_13
## %bb.12:
	movl	20(%r13), %edx
	movq	8(%r13), %rcx
	leaq	L_.str.1(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	callq	_pjdlog_debug
	jmp	LBB0_15
LBB0_10:
	movq	_LOG_ERR@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	20(%r13), %edx
	movq	8(%r13), %rcx
	leaq	L_.str.3(%rip), %rsi
	xorl	%eax, %eax
	callq	_pjdlog_errno
	jmp	LBB0_18
LBB0_17:
	movl	20(%r13), %esi
	movq	8(%r13), %rdx
	leaq	L_.str.4(%rip), %rdi
	callq	_pjdlog_warning
	jmp	LBB0_18
LBB0_13:
	movq	_LOG_ERR@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	20(%r13), %edx
	movq	8(%r13), %rcx
	leaq	L_.str.2(%rip), %rsi
LBB0_14:
	xorl	%eax, %eax
	callq	_pjdlog_errno
	jmp	LBB0_15
LBB0_24:
	movq	_LOG_ERR@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movslq	20(%r13), %rcx
	movq	8(%r13), %r8
	leaq	L_.str.5(%rip), %rsi
	movl	%r12d, %edx
	xorl	%eax, %eax
	callq	_pjdlog_errno
LBB0_18:
	movl	%ebx, %edi
	callq	_close
LBB0_15:
	movq	%r13, %rdi
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_trail_next                     ## TAILCALL
LBB0_21:
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_trail_is_not_terminated
	testq	%rax, %rax
	je	LBB0_28
## %bb.22:
	movq	8(%r13), %rdi
	callq	_trail_is_not_terminated
	testq	%rax, %rax
	je	LBB0_23
LBB0_28:
	movl	%ebx, %edi
	callq	_close
	movl	20(%r13), %edx
	movq	8(%r13), %rcx
	cmpq	%r12, %r14
	jge	LBB0_30
## %bb.29:
	leaq	L_.str.7(%rip), %rdi
	movl	%edx, %esi
	movq	%rcx, %rdx
	callq	_pjdlog_warning
	jmp	LBB0_31
LBB0_30:
	leaq	L_.str.8(%rip), %rsi
	movl	$1, %edi
	xorl	%eax, %eax
	callq	_pjdlog_debug
LBB0_31:
	movq	8(%r13), %rsi
	movl	%r15d, %edi
	xorl	%edx, %edx
	callq	_unlinkat
	cmpl	$-1, %eax
	jne	LBB0_15
## %bb.32:
	movq	_LOG_WARNING@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	20(%r13), %edx
	movq	8(%r13), %rcx
	leaq	L_.str.9(%rip), %rsi
	jmp	LBB0_14
	.cfi_endproc
                                        ## -- End function
	.comm	_TRAIL_MAGIC,8,3                ## @TRAIL_MAGIC
	.comm	_O_RDONLY,4,2                   ## @O_RDONLY
	.comm	_errno,8,3                      ## @errno
	.comm	_ENOENT,8,3                     ## @ENOENT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Trail file was renamed since last connection to \"%s/%s\"."

L_.str.1:                               ## @.str.1
	.asciz	"File \"%s/%s\" doesn't exist."

	.comm	_LOG_ERR,4,2                    ## @LOG_ERR
L_.str.2:                               ## @.str.2
	.asciz	"Unable to open file \"%s/%s\", skipping"

L_.str.3:                               ## @.str.3
	.asciz	"Unable to stat file \"%s/%s\", skipping"

L_.str.4:                               ## @.str.4
	.asciz	"File \"%s/%s\" is not a regular file, skipping."

	.comm	_SEEK_SET,4,2                   ## @SEEK_SET
L_.str.5:                               ## @.str.5
	.asciz	"Unable to move to offset %jd within file \"%s/%s\", skipping"

L_.str.6:                               ## @.str.6
	.asciz	"Restarting file \"%s/%s\" at offset %jd."

L_.str.7:                               ## @.str.7
	.asciz	"File \"%s/%s\" shrinked, removing it."

L_.str.8:                               ## @.str.8
	.asciz	"File \"%s/%s\" is already sent, removing it."

	.comm	_LOG_WARNING,4,2                ## @LOG_WARNING
L_.str.9:                               ## @.str.9
	.asciz	"Unable to remove file \"%s/%s\""

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_trail_start                    ; -- Begin function trail_start
	.p2align	2
_trail_start:                           ; @trail_start
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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
	mov	x20, x2
	mov	x22, x1
	mov	x19, 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
	ldr	x0, [x19, #8]
	mov	x1, x22
	mov	w2, #8
	bl	_strlcpy
	cmp	w0, #8
	cset	w0, lo
	bl	_PJDLOG_VERIFY
	mov	w8, #-1
	str	w8, [x19, #16]
	ldr	x8, [x19, #8]
	ldrb	w8, [x8]
	cbz	w8, LBB0_10
; %bb.1:
	ldr	w0, [x19, #24]
	bl	_dirfd
	mov	x21, x0
	mvn	w8, w0
	lsr	w0, w8, #31
	bl	_PJDLOG_ASSERT
	ldr	x1, [x19, #8]
Lloh3:
	adrp	x25, _O_RDONLY@GOTPAGE
Lloh4:
	ldr	x25, [x25, _O_RDONLY@GOTPAGEOFF]
	ldr	w2, [x25]
	mov	x0, x21
	bl	_openat
	mov	x23, x0
	cmn	w0, #1
	b.eq	LBB0_11
LBB0_2:
	add	x1, sp, #16
	mov	x0, x23
	bl	_fstat
	cmn	w0, #1
	b.eq	LBB0_19
; %bb.3:
	ldr	w0, [sp, #24]
	bl	_S_ISREG
	cbz	w0, LBB0_20
; %bb.4:
	ldr	x24, [sp, #16]
	cmp	x24, x20
	b.gt	LBB0_6
; %bb.5:
	ldr	x0, [x19, #8]
	bl	_trail_is_not_terminated
	cbz	x0, LBB0_27
LBB0_6:
Lloh5:
	adrp	x8, _SEEK_SET@GOTPAGE
Lloh6:
	ldr	x8, [x8, _SEEK_SET@GOTPAGEOFF]
Lloh7:
	ldr	w2, [x8]
	mov	x0, x23
	mov	x1, x20
	bl	_lseek
	cmn	w0, #1
	b.eq	LBB0_23
; %bb.7:
	ldr	x0, [x19, #8]
	bl	_trail_is_crash_recovery
	cbnz	w0, LBB0_9
; %bb.8:
	ldr	w2, [x19, #20]
	ldr	x3, [x19, #8]
	str	x20, [sp]
Lloh8:
	adrp	x1, l_.str.6@PAGE
Lloh9:
	add	x1, x1, l_.str.6@PAGEOFF
	mov	w0, #1
	bl	_pjdlog_debug
LBB0_9:
	str	w23, [x19, #16]
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
LBB0_10:
	cmp	x20, #0
	cset	w0, eq
	bl	_PJDLOG_ASSERT
	b	LBB0_26
LBB0_11:
Lloh10:
	adrp	x26, _errno@GOTPAGE
Lloh11:
	ldr	x26, [x26, _errno@GOTPAGEOFF]
Lloh12:
	adrp	x27, _ENOENT@GOTPAGE
Lloh13:
	ldr	x27, [x27, _ENOENT@GOTPAGEOFF]
Lloh14:
	adrp	x24, l_.str@PAGE
Lloh15:
	add	x24, x24, l_.str@PAGEOFF
LBB0_12:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x26]
	ldr	x9, [x27]
	cmp	x8, x9
	b.ne	LBB0_17
; %bb.13:                               ;   in Loop: Header=BB0_12 Depth=1
	ldr	x0, [x19, #8]
	bl	_trail_is_not_terminated
	cbz	x0, LBB0_17
; %bb.14:                               ;   in Loop: Header=BB0_12 Depth=1
	mov	x0, x19
	bl	_trail_find
	cbz	x0, LBB0_17
; %bb.15:                               ;   in Loop: Header=BB0_12 Depth=1
	ldr	w2, [x19, #20]
	ldr	x3, [x19, #8]
	mov	w0, #1
	mov	x1, x24
	bl	_pjdlog_debug
	ldr	x1, [x19, #8]
	ldr	w2, [x25]
	mov	x0, x21
	bl	_openat
	cmn	w0, #1
	b.eq	LBB0_12
; %bb.16:
	mov	x23, x0
	b	LBB0_2
LBB0_17:
	ldr	x8, [x26]
	ldr	x9, [x27]
	cmp	x8, x9
	b.ne	LBB0_21
; %bb.18:
	ldr	w2, [x19, #20]
	ldr	x3, [x19, #8]
Lloh16:
	adrp	x1, l_.str.1@PAGE
Lloh17:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	w0, #1
	bl	_pjdlog_debug
	b	LBB0_26
LBB0_19:
Lloh18:
	adrp	x8, _LOG_ERR@GOTPAGE
Lloh19:
	ldr	x8, [x8, _LOG_ERR@GOTPAGEOFF]
Lloh20:
	ldr	w0, [x8]
	ldr	w2, [x19, #20]
	ldr	x3, [x19, #8]
Lloh21:
	adrp	x1, l_.str.3@PAGE
Lloh22:
	add	x1, x1, l_.str.3@PAGEOFF
	b	LBB0_24
LBB0_20:
	ldr	w1, [x19, #20]
	ldr	x2, [x19, #8]
Lloh23:
	adrp	x0, l_.str.4@PAGE
Lloh24:
	add	x0, x0, l_.str.4@PAGEOFF
	bl	_pjdlog_warning
	b	LBB0_25
LBB0_21:
Lloh25:
	adrp	x8, _LOG_ERR@GOTPAGE
Lloh26:
	ldr	x8, [x8, _LOG_ERR@GOTPAGEOFF]
Lloh27:
	ldr	w0, [x8]
	ldr	w2, [x19, #20]
	ldr	x3, [x19, #8]
Lloh28:
	adrp	x1, l_.str.2@PAGE
Lloh29:
	add	x1, x1, l_.str.2@PAGEOFF
LBB0_22:
	bl	_pjdlog_errno
	b	LBB0_26
LBB0_23:
Lloh30:
	adrp	x8, _LOG_ERR@GOTPAGE
Lloh31:
	ldr	x8, [x8, _LOG_ERR@GOTPAGEOFF]
Lloh32:
	ldr	w0, [x8]
	ldrsw	x3, [x19, #20]
	ldr	x8, [x19, #8]
	str	x8, [sp]
Lloh33:
	adrp	x1, l_.str.5@PAGE
Lloh34:
	add	x1, x1, l_.str.5@PAGEOFF
	mov	x2, x20
LBB0_24:
	bl	_pjdlog_errno
LBB0_25:
	mov	x0, x23
	bl	_close
LBB0_26:
	mov	x0, x19
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	b	_trail_next
LBB0_27:
	mov	x0, x22
	bl	_trail_is_not_terminated
	cbz	x0, LBB0_29
; %bb.28:
	ldr	x0, [x19, #8]
	bl	_trail_is_not_terminated
	cbz	x0, LBB0_6
LBB0_29:
	mov	x0, x23
	bl	_close
	ldr	w2, [x19, #20]
	ldr	x3, [x19, #8]
	cmp	x24, x20
	b.ge	LBB0_31
; %bb.30:
Lloh35:
	adrp	x0, l_.str.7@PAGE
Lloh36:
	add	x0, x0, l_.str.7@PAGEOFF
	mov	x1, x2
	mov	x2, x3
	bl	_pjdlog_warning
	b	LBB0_32
LBB0_31:
Lloh37:
	adrp	x1, l_.str.8@PAGE
Lloh38:
	add	x1, x1, l_.str.8@PAGEOFF
	mov	w0, #1
	bl	_pjdlog_debug
LBB0_32:
	ldr	x1, [x19, #8]
	mov	x0, x21
	mov	w2, #0
	bl	_unlinkat
	cmn	w0, #1
	b.ne	LBB0_26
; %bb.33:
Lloh39:
	adrp	x8, _LOG_WARNING@GOTPAGE
Lloh40:
	ldr	x8, [x8, _LOG_WARNING@GOTPAGEOFF]
Lloh41:
	ldr	w0, [x8]
	ldr	w2, [x19, #20]
	ldr	x3, [x19, #8]
Lloh42:
	adrp	x1, l_.str.9@PAGE
Lloh43:
	add	x1, x1, l_.str.9@PAGEOFF
	b	LBB0_22
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpAdd	Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpAdd	Lloh23, Lloh24
	.loh AdrpAdd	Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.loh AdrpAdd	Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpAdd	Lloh35, Lloh36
	.loh AdrpAdd	Lloh37, Lloh38
	.loh AdrpAdd	Lloh42, Lloh43
	.loh AdrpLdrGotLdr	Lloh39, Lloh40, Lloh41
	.cfi_endproc
                                        ; -- End function
	.comm	_TRAIL_MAGIC,8,3                ; @TRAIL_MAGIC
	.comm	_O_RDONLY,4,2                   ; @O_RDONLY
	.comm	_errno,8,3                      ; @errno
	.comm	_ENOENT,8,3                     ; @ENOENT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Trail file was renamed since last connection to \"%s/%s\"."

l_.str.1:                               ; @.str.1
	.asciz	"File \"%s/%s\" doesn't exist."

	.comm	_LOG_ERR,4,2                    ; @LOG_ERR
l_.str.2:                               ; @.str.2
	.asciz	"Unable to open file \"%s/%s\", skipping"

l_.str.3:                               ; @.str.3
	.asciz	"Unable to stat file \"%s/%s\", skipping"

l_.str.4:                               ; @.str.4
	.asciz	"File \"%s/%s\" is not a regular file, skipping."

	.comm	_SEEK_SET,4,2                   ; @SEEK_SET
l_.str.5:                               ; @.str.5
	.asciz	"Unable to move to offset %jd within file \"%s/%s\", skipping"

l_.str.6:                               ; @.str.6
	.asciz	"Restarting file \"%s/%s\" at offset %jd."

l_.str.7:                               ; @.str.7
	.asciz	"File \"%s/%s\" shrinked, removing it."

l_.str.8:                               ; @.str.8
	.asciz	"File \"%s/%s\" is already sent, removing it."

	.comm	_LOG_WARNING,4,2                ; @LOG_WARNING
l_.str.9:                               ; @.str.9
	.asciz	"Unable to remove file \"%s/%s\""

.subsections_via_symbols
