	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function InstallXLogFileSegment
_InstallXLogFileSegment:                ## @InstallXLogFileSegment
	.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
	movl	%r8d, %r14d
	movq	%rcx, %r12
	movl	%edx, -60(%rbp)                 ## 4-byte Spill
	movq	%rsi, -72(%rbp)                 ## 8-byte Spill
	movq	%rdi, %r13
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	_MAXPGPATH@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	callq	____chkstk_darwin
	addq	$15, %rax
	andq	$-16, %rax
	subq	%rax, %rsp
	movq	%rsp, %rbx
	movq	_ThisTimeLineID@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	(%r13), %rdx
	movq	_wal_segment_size@GOTPCREL(%rip), %r15
	movl	(%r15), %ecx
	movq	%rbx, %rdi
	callq	_XLogFilePath
	movl	%r14d, -52(%rbp)                ## 4-byte Spill
	testl	%r14d, %r14d
	je	LBB0_2
## %bb.1:
	movq	_ControlFileLock@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_LW_EXCLUSIVE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_LWLockAcquire
LBB0_2:
	cmpl	$0, -60(%rbp)                   ## 4-byte Folded Reload
	je	LBB0_13
## %bb.3:
	leaq	-56(%rbp), %rsi
	movq	%rbx, %rdi
	callq	_stat
	testq	%rax, %rax
	jne	LBB0_8
## %bb.4:
	leaq	-56(%rbp), %r14
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movq	(%r13), %rdx
	cmpq	%r12, %rdx
	jge	LBB0_6
## %bb.7:                               ##   in Loop: Header=BB0_5 Depth=1
	incq	%rdx
	movq	%rdx, (%r13)
	movq	_ThisTimeLineID@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	(%r15), %ecx
	movq	%rbx, %rdi
	callq	_XLogFilePath
	movq	%rbx, %rdi
	movq	%r14, %rsi
	callq	_stat
	testq	%rax, %rax
	je	LBB0_5
	jmp	LBB0_8
LBB0_13:
	movq	_DEBUG1@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_durable_unlink
LBB0_8:
	movq	_LOG@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	movq	%rbx, %rsi
	callq	_durable_link_or_rename
	xorl	%ebx, %ebx
	testq	%rax, %rax
	sete	%bl
	cmpl	$0, -52(%rbp)                   ## 4-byte Folded Reload
	je	LBB0_11
LBB0_10:
	movq	_ControlFileLock@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_LWLockRelease
LBB0_11:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_14
## %bb.12:
	movl	%ebx, %eax
	leaq	-40(%rbp), %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_6:
	xorl	%ebx, %ebx
	cmpl	$0, -52(%rbp)                   ## 4-byte Folded Reload
	jne	LBB0_10
	jmp	LBB0_11
LBB0_14:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_MAXPGPATH,4,2                  ## @MAXPGPATH
	.comm	_ThisTimeLineID,4,2             ## @ThisTimeLineID
	.comm	_wal_segment_size,4,2           ## @wal_segment_size
	.comm	_ControlFileLock,4,2            ## @ControlFileLock
	.comm	_LW_EXCLUSIVE,4,2               ## @LW_EXCLUSIVE
	.comm	_DEBUG1,4,2                     ## @DEBUG1
	.comm	_LOG,4,2                        ## @LOG
	.no_dead_strip	_InstallXLogFileSegment
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function InstallXLogFileSegment
_InstallXLogFileSegment:                ; @InstallXLogFileSegment
	.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
	mov	x19, x4
	mov	x21, x3
	mov	x24, x2
	mov	x20, x1
	mov	x23, x0
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	x8, _MAXPGPATH@GOTPAGE
Lloh4:
	ldr	x8, [x8, _MAXPGPATH@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	mov	x9, x8
Lloh6:
	adrp	x16, ___chkstk_darwin@GOTPAGE
Lloh7:
	ldr	x16, [x16, ___chkstk_darwin@GOTPAGEOFF]
	blr	x16
	mov	x9, sp
	add	x8, x8, #15
	and	x8, x8, #0x1fffffff0
	sub	x22, x9, x8
	mov	sp, x22
Lloh8:
	adrp	x26, _ThisTimeLineID@GOTPAGE
Lloh9:
	ldr	x26, [x26, _ThisTimeLineID@GOTPAGEOFF]
	ldr	w1, [x26]
	ldr	x2, [x0]
Lloh10:
	adrp	x27, _wal_segment_size@GOTPAGE
Lloh11:
	ldr	x27, [x27, _wal_segment_size@GOTPAGEOFF]
	ldr	w3, [x27]
	mov	x0, x22
	bl	_XLogFilePath
Lloh12:
	adrp	x25, _ControlFileLock@GOTPAGE
Lloh13:
	ldr	x25, [x25, _ControlFileLock@GOTPAGEOFF]
	cbz	w19, LBB0_2
; %bb.1:
	ldr	w0, [x25]
Lloh14:
	adrp	x8, _LW_EXCLUSIVE@GOTPAGE
Lloh15:
	ldr	x8, [x8, _LW_EXCLUSIVE@GOTPAGEOFF]
Lloh16:
	ldr	w1, [x8]
	bl	_LWLockAcquire
LBB0_2:
	cbz	w24, LBB0_6
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	sub	x1, x29, #96
	mov	x0, x22
	bl	_stat
	cbnz	x0, LBB0_7
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	x8, [x23]
	cmp	x8, x21
	b.ge	LBB0_11
; %bb.5:                                ;   in Loop: Header=BB0_3 Depth=1
	add	x2, x8, #1
	str	x2, [x23]
	ldr	w1, [x26]
	ldr	w3, [x27]
	mov	x0, x22
	bl	_XLogFilePath
	b	LBB0_3
LBB0_6:
Lloh17:
	adrp	x8, _DEBUG1@GOTPAGE
Lloh18:
	ldr	x8, [x8, _DEBUG1@GOTPAGEOFF]
Lloh19:
	ldr	w1, [x8]
	mov	x0, x22
	bl	_durable_unlink
LBB0_7:
Lloh20:
	adrp	x8, _LOG@GOTPAGE
Lloh21:
	ldr	x8, [x8, _LOG@GOTPAGEOFF]
Lloh22:
	ldr	w2, [x8]
	mov	x0, x20
	mov	x1, x22
	bl	_durable_link_or_rename
	cmp	x0, #0
	cset	w20, eq
	cbz	w19, LBB0_9
LBB0_8:
	ldr	w0, [x25]
	bl	_LWLockRelease
LBB0_9:
	ldur	x8, [x29, #-88]
Lloh23:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh24:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh25:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_12
; %bb.10:
	mov	x0, x20
	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_11:
	mov	w20, #0
	cbnz	w19, LBB0_8
	b	LBB0_9
LBB0_12:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.cfi_endproc
                                        ; -- End function
	.comm	_MAXPGPATH,4,2                  ; @MAXPGPATH
	.comm	_ThisTimeLineID,4,2             ; @ThisTimeLineID
	.comm	_wal_segment_size,4,2           ; @wal_segment_size
	.comm	_ControlFileLock,4,2            ; @ControlFileLock
	.comm	_LW_EXCLUSIVE,4,2               ; @LW_EXCLUSIVE
	.comm	_DEBUG1,4,2                     ; @DEBUG1
	.comm	_LOG,4,2                        ; @LOG
	.no_dead_strip	_InstallXLogFileSegment
.subsections_via_symbols
