	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function CleanupPriorWALFiles
_CleanupPriorWALFiles:                  ## @CleanupPriorWALFiles
	.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	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	_MAXPGPATH@GOTPCREL(%rip), %r12
	movl	(%r12), %eax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %rbx
	movq	_archiveLocation@GOTPCREL(%rip), %r14
	movq	(%r14), %rdi
	callq	_opendir
	testq	%rax, %rax
	je	LBB0_18
## %bb.1:
	movq	%rax, %r15
	movq	_errno@GOTPCREL(%rip), %r14
	movl	$0, (%r14)
	movq	%rax, %rdi
	callq	_readdir
	testq	%rax, %rax
	je	LBB0_12
## %bb.2:
	movq	%rax, %r13
	movq	%rbx, %rax
	addq	$8, %rax
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	movq	%r15, -56(%rbp)                 ## 8-byte Spill
	jmp	LBB0_3
	.p2align	4, 0x90
LBB0_9:                                 ##   in Loop: Header=BB0_3 Depth=1
	leaq	L_.str.1(%rip), %rdi
	movq	%r12, %rsi
	callq	_printf
	leaq	L_.str.2(%rip), %rdi
	movq	%r12, %rsi
	callq	_pg_log_debug
LBB0_10:                                ##   in Loop: Header=BB0_3 Depth=1
	movq	-64(%rbp), %rsp                 ## 8-byte Reload
	movq	-56(%rbp), %r15                 ## 8-byte Reload
	movq	%r14, %r12
	movq	_errno@GOTPCREL(%rip), %r14
LBB0_11:                                ##   in Loop: Header=BB0_3 Depth=1
	movl	$0, (%r14)
	movq	%r15, %rdi
	callq	_readdir
	movq	%rax, %r13
	testq	%rax, %rax
	je	LBB0_12
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r13), %rsi
	movl	(%r12), %edx
	movq	%rbx, %rdi
	callq	_strlcpy
	movq	_additional_ext@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_TrimExtension
	movq	%rbx, %rdi
	callq	_IsXLogFileName
	testq	%rax, %rax
	jne	LBB0_5
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	%rbx, %rdi
	callq	_IsPartialXLogFileName
	testq	%rax, %rax
	je	LBB0_11
LBB0_5:                                 ##   in Loop: Header=BB0_3 Depth=1
	movq	_exclusiveCleanupFileName@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	addq	$8, %rsi
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	callq	_strcmp
	testq	%rax, %rax
	jns	LBB0_11
## %bb.6:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	%rsp, -64(%rbp)                 ## 8-byte Spill
	movq	%r12, %r14
	movl	(%r12), %r15d
	addl	%r15d, %r15d
	movq	%r15, %rax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %r12
	movq	_archiveLocation@GOTPCREL(%rip), %rax
	movq	(%rax), %rcx
	movq	(%r13), %r8
	movq	%r12, %rdi
	movl	%r15d, %esi
	leaq	L_.str(%rip), %rdx
	callq	_snprintf
	movq	_dryrun@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	jne	LBB0_9
## %bb.7:                               ##   in Loop: Header=BB0_3 Depth=1
	leaq	L_.str.3(%rip), %rdi
	movq	%r12, %rsi
	callq	_pg_log_debug
	movq	%r12, %rdi
	callq	_unlink
	testl	%eax, %eax
	je	LBB0_10
## %bb.8:
	leaq	L_.str.4(%rip), %rdi
	movq	%r12, %rsi
	callq	_pg_log_error
	movq	-64(%rbp), %rsp                 ## 8-byte Reload
	movq	-56(%rbp), %r15                 ## 8-byte Reload
	movq	_errno@GOTPCREL(%rip), %r14
LBB0_12:
	cmpl	$0, (%r14)
	movq	_archiveLocation@GOTPCREL(%rip), %rbx
	je	LBB0_14
## %bb.13:
	movq	(%rbx), %rsi
	leaq	L_.str.5(%rip), %rdi
	callq	_pg_log_error
LBB0_14:
	movq	%r15, %rdi
	callq	_closedir
	testq	%rax, %rax
	je	LBB0_16
## %bb.15:
	movq	(%rbx), %rsi
	leaq	L_.str.6(%rip), %rdi
	callq	_pg_log_error
LBB0_16:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_17
## %bb.20:
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_18:
	movq	(%r14), %rsi
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_17
## %bb.19:
	leaq	L_.str.7(%rip), %rdi
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_pg_log_error                   ## TAILCALL
LBB0_17:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_MAXPGPATH,4,2                  ## @MAXPGPATH
	.comm	_archiveLocation,8,3            ## @archiveLocation
	.comm	_errno,4,2                      ## @errno
	.comm	_additional_ext,4,2             ## @additional_ext
	.comm	_exclusiveCleanupFileName,8,3   ## @exclusiveCleanupFileName
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%s/%s"

	.comm	_dryrun,8,3                     ## @dryrun
L_.str.1:                               ## @.str.1
	.asciz	"%s\n"

L_.str.2:                               ## @.str.2
	.asciz	"file \"%s\" would be removed"

L_.str.3:                               ## @.str.3
	.asciz	"removing file \"%s\""

L_.str.4:                               ## @.str.4
	.asciz	"could not remove file \"%s\": %m"

L_.str.5:                               ## @.str.5
	.asciz	"could not read archive location \"%s\": %m"

L_.str.6:                               ## @.str.6
	.asciz	"could not close archive location \"%s\": %m"

L_.str.7:                               ## @.str.7
	.asciz	"could not open archive location \"%s\": %m"

	.no_dead_strip	_CleanupPriorWALFiles
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function CleanupPriorWALFiles
_CleanupPriorWALFiles:                  ; @CleanupPriorWALFiles
	.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, #16
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	x23, _MAXPGPATH@GOTPAGE
Lloh4:
	ldr	x23, [x23, _MAXPGPATH@GOTPAGEOFF]
	ldr	w8, [x23]
	mov	x9, x8
Lloh5:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh6:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x9, sp
	add	x8, x8, #15
	and	x8, x8, #0x1fffffff0
	sub	x20, x9, x8
	mov	sp, x20
Lloh7:
	adrp	x21, _archiveLocation@GOTPAGE
Lloh8:
	ldr	x21, [x21, _archiveLocation@GOTPAGEOFF]
	ldr	x0, [x21]
	bl	_opendir
	cbz	x0, LBB0_18
; %bb.1:
	mov	x19, x0
Lloh9:
	adrp	x24, _errno@GOTPAGE
Lloh10:
	ldr	x24, [x24, _errno@GOTPAGEOFF]
	str	wzr, [x24]
	bl	_readdir
	cbz	x0, LBB0_12
; %bb.2:
	mov	x26, x0
	add	x21, x20, #8
Lloh11:
	adrp	x25, _additional_ext@GOTPAGE
Lloh12:
	ldr	x25, [x25, _additional_ext@GOTPAGEOFF]
Lloh13:
	adrp	x22, _exclusiveCleanupFileName@GOTPAGE
Lloh14:
	ldr	x22, [x22, _exclusiveCleanupFileName@GOTPAGEOFF]
	b	LBB0_6
LBB0_3:                                 ;   in Loop: Header=BB0_6 Depth=1
Lloh15:
	adrp	x0, l_.str.1@PAGE
Lloh16:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	x1, x27
	bl	_printf
Lloh17:
	adrp	x0, l_.str.2@PAGE
Lloh18:
	add	x0, x0, l_.str.2@PAGEOFF
	mov	x1, x27
	bl	_pg_log_debug
LBB0_4:                                 ;   in Loop: Header=BB0_6 Depth=1
	mov	sp, x28
LBB0_5:                                 ;   in Loop: Header=BB0_6 Depth=1
	str	wzr, [x24]
	mov	x0, x19
	bl	_readdir
	mov	x26, x0
	cbz	x0, LBB0_12
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x1, [x26]
	ldr	w2, [x23]
	mov	x0, x20
	bl	_strlcpy
	ldr	w1, [x25]
	mov	x0, x20
	bl	_TrimExtension
	mov	x0, x20
	bl	_IsXLogFileName
	cbnz	x0, LBB0_8
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	mov	x0, x20
	bl	_IsPartialXLogFileName
	cbz	x0, LBB0_5
LBB0_8:                                 ;   in Loop: Header=BB0_6 Depth=1
	ldr	x8, [x22]
	add	x1, x8, #8
	mov	x0, x21
	bl	_strcmp
	tbz	x0, #63, LBB0_5
; %bb.9:                                ;   in Loop: Header=BB0_6 Depth=1
	mov	x28, sp
	ldr	w8, [x23]
	lsl	w1, w8, #1
	mov	x9, x1
Lloh19:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh20:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x8, sp
	add	x9, x1, #15
	and	x9, x9, #0x1fffffff0
	sub	x27, x8, x9
	mov	sp, x27
Lloh21:
	adrp	x8, _archiveLocation@GOTPAGE
Lloh22:
	ldr	x8, [x8, _archiveLocation@GOTPAGEOFF]
Lloh23:
	ldr	x3, [x8]
	ldr	x4, [x26]
	mov	x0, x27
                                        ; kill: def $w1 killed $w1 killed $x1
Lloh24:
	adrp	x2, l_.str@PAGE
Lloh25:
	add	x2, x2, l_.str@PAGEOFF
	bl	_snprintf
Lloh26:
	adrp	x8, _dryrun@GOTPAGE
Lloh27:
	ldr	x8, [x8, _dryrun@GOTPAGEOFF]
Lloh28:
	ldr	x8, [x8]
	cbnz	x8, LBB0_3
; %bb.10:                               ;   in Loop: Header=BB0_6 Depth=1
Lloh29:
	adrp	x0, l_.str.3@PAGE
Lloh30:
	add	x0, x0, l_.str.3@PAGEOFF
	mov	x1, x27
	bl	_pg_log_debug
	mov	x0, x27
	bl	_unlink
	cbz	w0, LBB0_4
; %bb.11:
Lloh31:
	adrp	x0, l_.str.4@PAGE
Lloh32:
	add	x0, x0, l_.str.4@PAGEOFF
	mov	x1, x27
	bl	_pg_log_error
	mov	sp, x28
LBB0_12:
	ldr	w8, [x24]
Lloh33:
	adrp	x20, _archiveLocation@GOTPAGE
Lloh34:
	ldr	x20, [x20, _archiveLocation@GOTPAGEOFF]
	cbz	w8, LBB0_14
; %bb.13:
	ldr	x1, [x20]
Lloh35:
	adrp	x0, l_.str.5@PAGE
Lloh36:
	add	x0, x0, l_.str.5@PAGEOFF
	bl	_pg_log_error
LBB0_14:
	mov	x0, x19
	bl	_closedir
	cbz	x0, LBB0_16
; %bb.15:
	ldr	x1, [x20]
Lloh37:
	adrp	x0, l_.str.6@PAGE
Lloh38:
	add	x0, x0, l_.str.6@PAGEOFF
	bl	_pg_log_error
LBB0_16:
	ldur	x8, [x29, #-88]
Lloh39:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh40:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh41:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_20
; %bb.17:
	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_18:
	ldr	x1, [x21]
	ldur	x8, [x29, #-88]
Lloh42:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh43:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh44:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_20
; %bb.19:
Lloh45:
	adrp	x0, l_.str.7@PAGE
Lloh46:
	add	x0, x0, l_.str.7@PAGEOFF
	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
	b	_pg_log_error
LBB0_20:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpAdd	Lloh29, Lloh30
	.loh AdrpAdd	Lloh31, Lloh32
	.loh AdrpLdrGot	Lloh33, Lloh34
	.loh AdrpAdd	Lloh35, Lloh36
	.loh AdrpAdd	Lloh37, Lloh38
	.loh AdrpLdrGotLdr	Lloh39, Lloh40, Lloh41
	.loh AdrpLdrGotLdr	Lloh42, Lloh43, Lloh44
	.loh AdrpAdd	Lloh45, Lloh46
	.cfi_endproc
                                        ; -- End function
	.comm	_MAXPGPATH,4,2                  ; @MAXPGPATH
	.comm	_archiveLocation,8,3            ; @archiveLocation
	.comm	_errno,4,2                      ; @errno
	.comm	_additional_ext,4,2             ; @additional_ext
	.comm	_exclusiveCleanupFileName,8,3   ; @exclusiveCleanupFileName
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%s/%s"

	.comm	_dryrun,8,3                     ; @dryrun
l_.str.1:                               ; @.str.1
	.asciz	"%s\n"

l_.str.2:                               ; @.str.2
	.asciz	"file \"%s\" would be removed"

l_.str.3:                               ; @.str.3
	.asciz	"removing file \"%s\""

l_.str.4:                               ; @.str.4
	.asciz	"could not remove file \"%s\": %m"

l_.str.5:                               ; @.str.5
	.asciz	"could not read archive location \"%s\": %m"

l_.str.6:                               ; @.str.6
	.asciz	"could not close archive location \"%s\": %m"

l_.str.7:                               ; @.str.7
	.asciz	"could not open archive location \"%s\": %m"

	.no_dead_strip	_CleanupPriorWALFiles
.subsections_via_symbols
