	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function FindEndOfXLOG
_FindEndOfXLOG:                         ## @FindEndOfXLOG
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	xorl	%edi, %edi
	callq	_UINT64CONST
	movq	_ControlFile@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movl	4(%rcx), %ecx
	xorl	%edx, %edx
	divl	%esi
	movl	%eax, %r14d
	movl	%ecx, %eax
	xorl	%edx, %edx
	divl	%esi
	movq	_newXlogSegNo@GOTPCREL(%rip), %rcx
	movq	%rcx, %r15
	movl	%eax, (%rcx)
	movq	_XLOGDIR@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_opendir
	testq	%rax, %rax
	je	LBB0_10
## %bb.1:
	movq	%rax, %rbx
	movq	_errno@GOTPCREL(%rip), %r13
	movl	$0, (%r13)
	movq	%rax, %rdi
	callq	_readdir
	testq	%rax, %rax
	je	LBB0_8
## %bb.2:
	movq	%rax, %r12
	jmp	LBB0_3
	.p2align	4, 0x90
LBB0_7:                                 ##   in Loop: Header=BB0_3 Depth=1
	movl	$0, (%r13)
	movq	%rbx, %rdi
	callq	_readdir
	movq	%rax, %r12
	testq	%rax, %rax
	je	LBB0_8
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%r12), %edi
	callq	_IsXLogFileName
	testq	%rax, %rax
	jne	LBB0_5
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	movl	(%r12), %edi
	callq	_IsPartialXLogFileName
	testq	%rax, %rax
	je	LBB0_7
LBB0_5:                                 ##   in Loop: Header=BB0_3 Depth=1
	movl	(%r12), %edi
	leaq	L_.str.1(%rip), %rsi
	leaq	-52(%rbp), %rdx
	leaq	-48(%rbp), %rcx
	leaq	-44(%rbp), %r8
	callq	_sscanf
	movl	-48(%rbp), %eax
	imull	%r14d, %eax
	addl	-44(%rbp), %eax
	cmpl	(%r15), %eax
	jbe	LBB0_7
## %bb.6:                               ##   in Loop: Header=BB0_3 Depth=1
	movl	%eax, (%r15)
	jmp	LBB0_7
LBB0_8:
	cmpl	$0, (%r13)
	jne	LBB0_9
## %bb.12:
	movq	%rbx, %rdi
	callq	_closedir
	testq	%rax, %rax
	jne	LBB0_13
## %bb.14:
	movq	_ControlFile@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	(%r15), %ecx
	imull	%eax, %ecx
	addl	%ecx, %eax
	decl	%eax
	movq	_WalSegSz@GOTPCREL(%rip), %rcx
	xorl	%edx, %edx
	divl	(%rcx)
	incl	%eax
	movl	%eax, (%r15)
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_10:
	movq	_XLOGDIR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdi
	jmp	LBB0_11
LBB0_9:
	movq	_XLOGDIR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.2(%rip), %rdi
	jmp	LBB0_11
LBB0_13:
	movq	_XLOGDIR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.3(%rip), %rdi
LBB0_11:
	callq	_pg_log_error
	movl	$1, %edi
	callq	_exit
	.cfi_endproc
                                        ## -- End function
	.comm	_ControlFile,8,2                ## @ControlFile
	.comm	_newXlogSegNo,4,2               ## @newXlogSegNo
	.comm	_XLOGDIR,4,2                    ## @XLOGDIR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"could not open directory \"%s\": %m"

	.comm	_errno,4,2                      ## @errno
L_.str.1:                               ## @.str.1
	.asciz	"%08X%08X%08X"

L_.str.2:                               ## @.str.2
	.asciz	"could not read directory \"%s\": %m"

L_.str.3:                               ## @.str.3
	.asciz	"could not close directory \"%s\": %m"

	.comm	_WalSegSz,4,2                   ## @WalSegSz
	.no_dead_strip	_FindEndOfXLOG
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function FindEndOfXLOG
_FindEndOfXLOG:                         ; @FindEndOfXLOG
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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	w0, #0
	bl	_UINT64CONST
	mov	x22, x0
Lloh0:
	adrp	x24, _ControlFile@GOTPAGE
Lloh1:
	ldr	x24, [x24, _ControlFile@GOTPAGEOFF]
	ldp	w27, w8, [x24]
	udiv	w8, w8, w27
Lloh2:
	adrp	x23, _newXlogSegNo@GOTPAGE
Lloh3:
	ldr	x23, [x23, _newXlogSegNo@GOTPAGEOFF]
	str	w8, [x23]
Lloh4:
	adrp	x25, _XLOGDIR@GOTPAGE
Lloh5:
	ldr	x25, [x25, _XLOGDIR@GOTPAGEOFF]
	ldr	w0, [x25]
	bl	_opendir
	cbz	x0, LBB0_11
; %bb.1:
	mov	x19, x0
Lloh6:
	adrp	x26, _errno@GOTPAGE
Lloh7:
	ldr	x26, [x26, _errno@GOTPAGEOFF]
	str	wzr, [x26]
	bl	_readdir
	cbz	x0, LBB0_8
; %bb.2:
	mov	x21, x0
Lloh8:
	adrp	x20, l_.str.1@PAGE
Lloh9:
	add	x20, x20, l_.str.1@PAGEOFF
	udiv	w22, w22, w27
	b	LBB0_4
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	str	wzr, [x26]
	mov	x0, x19
	bl	_readdir
	mov	x21, x0
	cbz	x0, LBB0_8
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w0, [x21]
	bl	_IsXLogFileName
	cbnz	x0, LBB0_6
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	w0, [x21]
	bl	_IsPartialXLogFileName
	cbz	x0, LBB0_3
LBB0_6:                                 ;   in Loop: Header=BB0_4 Depth=1
	ldr	w0, [x21]
	add	x2, sp, #12
	add	x3, sp, #8
	add	x4, sp, #4
	mov	x1, x20
	bl	_sscanf
	ldp	w9, w8, [sp, #4]
	madd	w8, w8, w22, w9
	ldr	w9, [x23]
	cmp	w8, w9
	b.ls	LBB0_3
; %bb.7:                                ;   in Loop: Header=BB0_4 Depth=1
	str	w8, [x23]
	b	LBB0_3
LBB0_8:
	ldr	w8, [x26]
	cbnz	w8, LBB0_12
; %bb.9:
	mov	x0, x19
	bl	_closedir
	cbnz	x0, LBB0_13
; %bb.10:
	ldr	w8, [x23]
	ldr	w9, [x24]
	madd	w8, w9, w8, w9
	sub	w8, w8, #1
Lloh10:
	adrp	x9, _WalSegSz@GOTPAGE
Lloh11:
	ldr	x9, [x9, _WalSegSz@GOTPAGEOFF]
Lloh12:
	ldr	w9, [x9]
	udiv	w8, w8, w9
	add	w8, w8, #1
	str	w8, [x23]
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_11:
	ldr	w1, [x25]
Lloh13:
	adrp	x0, l_.str@PAGE
Lloh14:
	add	x0, x0, l_.str@PAGEOFF
	b	LBB0_14
LBB0_12:
	ldr	w1, [x25]
Lloh15:
	adrp	x0, l_.str.2@PAGE
Lloh16:
	add	x0, x0, l_.str.2@PAGEOFF
	b	LBB0_14
LBB0_13:
	ldr	w1, [x25]
Lloh17:
	adrp	x0, l_.str.3@PAGE
Lloh18:
	add	x0, x0, l_.str.3@PAGEOFF
LBB0_14:
	bl	_pg_log_error
	mov	w0, #1
	bl	_exit
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpAdd	Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.comm	_ControlFile,8,2                ; @ControlFile
	.comm	_newXlogSegNo,4,2               ; @newXlogSegNo
	.comm	_XLOGDIR,4,2                    ; @XLOGDIR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"could not open directory \"%s\": %m"

	.comm	_errno,4,2                      ; @errno
l_.str.1:                               ; @.str.1
	.asciz	"%08X%08X%08X"

l_.str.2:                               ; @.str.2
	.asciz	"could not read directory \"%s\": %m"

l_.str.3:                               ; @.str.3
	.asciz	"could not close directory \"%s\": %m"

	.comm	_WalSegSz,4,2                   ; @WalSegSz
	.no_dead_strip	_FindEndOfXLOG
.subsections_via_symbols
