	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_XLogBackgroundFlush            ## -- Begin function XLogBackgroundFlush
	.p2align	4, 0x90
_XLogBackgroundFlush:                   ## @XLogBackgroundFlush
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	xorl	%r15d, %r15d
	xorl	%eax, %eax
	callq	_RecoveryInProgress
	testq	%rax, %rax
	jne	LBB0_16
## %bb.1:
	movq	_XLogCtl@GOTPCREL(%rip), %r13
	movq	(%r13), %rdi
	addq	$12, %rdi
	callq	_SpinLockAcquire
	movq	(%r13), %rdi
	movq	4(%rdi), %rax
	movq	_LogwrtResult@GOTPCREL(%rip), %r14
	movq	%rax, (%r14)
	movl	16(%rdi), %ebx
	addq	$12, %rdi
	callq	_SpinLockRelease
	movq	_XLOG_BLCKSZ@GOTPCREL(%rip), %r12
	movl	%ebx, %eax
	cltd
	idivl	(%r12)
	subl	%edx, %ebx
	movl	(%r14), %eax
	movl	$1, %ecx
	cmpl	%eax, %ebx
	jg	LBB0_3
## %bb.2:
	movq	(%r13), %rdi
	addq	$12, %rdi
	callq	_SpinLockAcquire
	movq	(%r13), %rdi
	movl	(%rdi), %ebx
	addq	$12, %rdi
	callq	_SpinLockRelease
	movl	(%r14), %eax
	xorl	%ecx, %ecx
LBB0_3:
	cmpl	%eax, %ebx
	jle	LBB0_4
## %bb.7:
	movl	%ecx, -48(%rbp)                 ## 4-byte Spill
	xorl	%eax, %eax
	callq	_GetCurrentTimestamp
	movq	%rax, %r15
	movq	_WalWriterFlushAfter@GOTPCREL(%rip), %r13
	cmpl	$0, (%r13)
	je	LBB0_11
## %bb.8:
	movq	_XLogBackgroundFlush.lastflush(%rip), %rdi
	testq	%rdi, %rdi
	je	LBB0_11
## %bb.9:
	movl	(%r12), %ecx
	movl	%ebx, %eax
	cltd
	idivl	%ecx
	movl	%eax, %r12d
	movl	(%r14), %eax
	cltd
	idivl	%ecx
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	movq	_WalWriterDelay@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r15, %rsi
	callq	_TimestampDifferenceExceeds
	testq	%rax, %rax
	jne	LBB0_11
## %bb.10:
	subl	-44(%rbp), %r12d                ## 4-byte Folded Reload
	movq	%r13, %rax
	xorl	%r13d, %r13d
	cmpl	(%rax), %r12d
	jl	LBB0_12
LBB0_11:
	movq	%r15, _XLogBackgroundFlush.lastflush(%rip)
	movl	%ebx, %r13d
LBB0_12:
	xorl	%eax, %eax
	callq	_START_CRIT_SECTION
	movl	%ebx, %edi
	callq	_WaitXLogInsertionsToFinish
	movq	_WALWriteLock@GOTPCREL(%rip), %r15
	movl	(%r15), %edi
	movq	_LW_EXCLUSIVE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_LWLockAcquire
	movq	_XLogCtl@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	4(%rax), %rax
	movq	%rax, (%r14)
	movq	%rax, %rcx
	shrq	$32, %rcx
	cmpl	%ecx, %ebx
	jg	LBB0_14
## %bb.13:
	cmpl	%eax, %r13d
	jle	LBB0_15
LBB0_14:
	shlq	$32, %r13
	movl	%ebx, %edi
	orq	%r13, %rdi
	movl	-48(%rbp), %esi                 ## 4-byte Reload
	callq	_XLogWrite
LBB0_15:
	movl	(%r15), %edi
	callq	_LWLockRelease
	xorl	%eax, %eax
	callq	_END_CRIT_SECTION
	xorl	%eax, %eax
	callq	_WalSndWakeupProcessRequests
	movq	_InvalidXLogRecPtr@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	$1, %r15d
	movl	$1, %esi
	callq	_AdvanceXLInsertBuffer
	jmp	LBB0_16
LBB0_4:
	movq	_openLogFile@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	js	LBB0_16
## %bb.5:
	movl	4(%r14), %edi
	movq	_openLogSegNo@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_wal_segment_size@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	callq	_XLByteInPrevSeg
	testl	%eax, %eax
	jne	LBB0_16
## %bb.6:
	xorl	%r15d, %r15d
	xorl	%eax, %eax
	callq	_XLogFileClose
LBB0_16:
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
.zerofill __DATA,__bss,_XLogBackgroundFlush.lastflush,8,3 ## @XLogBackgroundFlush.lastflush
	.comm	_XLogCtl,8,3                    ## @XLogCtl
	.comm	_LogwrtResult,8,2               ## @LogwrtResult
	.comm	_XLOG_BLCKSZ,4,2                ## @XLOG_BLCKSZ
	.comm	_openLogFile,8,3                ## @openLogFile
	.comm	_openLogSegNo,4,2               ## @openLogSegNo
	.comm	_wal_segment_size,4,2           ## @wal_segment_size
	.comm	_WalWriterFlushAfter,4,2        ## @WalWriterFlushAfter
	.comm	_WalWriterDelay,4,2             ## @WalWriterDelay
	.comm	_WALWriteLock,4,2               ## @WALWriteLock
	.comm	_LW_EXCLUSIVE,4,2               ## @LW_EXCLUSIVE
	.comm	_InvalidXLogRecPtr,4,2          ## @InvalidXLogRecPtr
	.comm	_LOG,4,2                        ## @LOG
	.comm	_XLOG_DEBUG,8,3                 ## @XLOG_DEBUG
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_XLogBackgroundFlush            ; -- Begin function XLogBackgroundFlush
	.p2align	2
_XLogBackgroundFlush:                   ; @XLogBackgroundFlush
	.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
	bl	_RecoveryInProgress
	cbz	x0, LBB0_3
LBB0_1:
	mov	w19, #0
LBB0_2:
	mov	x0, x19
	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_3:
Lloh0:
	adrp	x22, _XLogCtl@GOTPAGE
Lloh1:
	ldr	x22, [x22, _XLogCtl@GOTPAGEOFF]
	ldr	x8, [x22]
	add	x0, x8, #12
	bl	_SpinLockAcquire
	ldr	x8, [x22]
	ldur	x9, [x8, #4]
Lloh2:
	adrp	x23, _LogwrtResult@GOTPAGE
Lloh3:
	ldr	x23, [x23, _LogwrtResult@GOTPAGEOFF]
	str	x9, [x23]
	ldr	w19, [x8, #16]
	add	x0, x8, #12
	bl	_SpinLockRelease
Lloh4:
	adrp	x24, _XLOG_BLCKSZ@GOTPAGE
Lloh5:
	ldr	x24, [x24, _XLOG_BLCKSZ@GOTPAGEOFF]
	ldr	w8, [x24]
	sdiv	w9, w19, w8
	mul	w19, w9, w8
	ldr	w8, [x23]
	cmp	w19, w8
	b.le	LBB0_8
; %bb.4:
	mov	w20, #1
	cmp	w19, w8
	b.gt	LBB0_9
LBB0_5:
Lloh6:
	adrp	x8, _openLogFile@GOTPAGE
Lloh7:
	ldr	x8, [x8, _openLogFile@GOTPAGEOFF]
Lloh8:
	ldr	x8, [x8]
	tbnz	x8, #63, LBB0_1
; %bb.6:
	ldr	w0, [x23, #4]
Lloh9:
	adrp	x8, _openLogSegNo@GOTPAGE
Lloh10:
	ldr	x8, [x8, _openLogSegNo@GOTPAGEOFF]
Lloh11:
	ldr	w1, [x8]
Lloh12:
	adrp	x8, _wal_segment_size@GOTPAGE
Lloh13:
	ldr	x8, [x8, _wal_segment_size@GOTPAGEOFF]
Lloh14:
	ldr	w2, [x8]
	bl	_XLByteInPrevSeg
	cbnz	w0, LBB0_1
; %bb.7:
	bl	_XLogFileClose
	b	LBB0_1
LBB0_8:
	ldr	x8, [x22]
	add	x0, x8, #12
	bl	_SpinLockAcquire
	ldr	x0, [x22]
	ldr	w19, [x0], #12
	bl	_SpinLockRelease
	mov	w20, #0
	ldr	w8, [x23]
	cmp	w19, w8
	b.le	LBB0_5
LBB0_9:
	bl	_GetCurrentTimestamp
	mov	x21, x0
Lloh15:
	adrp	x26, _WalWriterFlushAfter@GOTPAGE
Lloh16:
	ldr	x26, [x26, _WalWriterFlushAfter@GOTPAGEOFF]
	ldr	w8, [x26]
	adrp	x25, _XLogBackgroundFlush.lastflush@PAGE
	cbz	w8, LBB0_14
; %bb.10:
	ldr	x0, [x25, _XLogBackgroundFlush.lastflush@PAGEOFF]
	cbz	x0, LBB0_14
; %bb.11:
	ldr	w24, [x24]
	ldr	w27, [x23]
Lloh17:
	adrp	x8, _WalWriterDelay@GOTPAGE
Lloh18:
	ldr	x8, [x8, _WalWriterDelay@GOTPAGEOFF]
Lloh19:
	ldr	w2, [x8]
	mov	x1, x21
	bl	_TimestampDifferenceExceeds
	cbnz	x0, LBB0_14
; %bb.12:
	sdiv	w8, w19, w24
	ldr	w9, [x26]
	sdiv	w10, w27, w24
	sub	w8, w8, w10
	cmp	w8, w9
	b.ge	LBB0_14
; %bb.13:
	mov	w21, #0
	b	LBB0_15
LBB0_14:
	str	x21, [x25, _XLogBackgroundFlush.lastflush@PAGEOFF]
	mov	x21, x19
LBB0_15:
	bl	_START_CRIT_SECTION
	mov	x0, x19
	bl	_WaitXLogInsertionsToFinish
Lloh20:
	adrp	x24, _WALWriteLock@GOTPAGE
Lloh21:
	ldr	x24, [x24, _WALWriteLock@GOTPAGEOFF]
	ldr	w0, [x24]
Lloh22:
	adrp	x8, _LW_EXCLUSIVE@GOTPAGE
Lloh23:
	ldr	x8, [x8, _LW_EXCLUSIVE@GOTPAGEOFF]
Lloh24:
	ldr	w1, [x8]
	bl	_LWLockAcquire
	ldr	x8, [x22]
	ldur	x8, [x8, #4]
	str	x8, [x23]
	lsr	x9, x8, #32
	cmp	w19, w9
	ccmp	w21, w8, #0, le
	b.le	LBB0_17
; %bb.16:
	mov	w0, w19
	bfi	x0, x21, #32, #32
	mov	x1, x20
	bl	_XLogWrite
LBB0_17:
	ldr	w0, [x24]
	bl	_LWLockRelease
	bl	_END_CRIT_SECTION
	bl	_WalSndWakeupProcessRequests
Lloh25:
	adrp	x8, _InvalidXLogRecPtr@GOTPAGE
Lloh26:
	ldr	x8, [x8, _InvalidXLogRecPtr@GOTPAGEOFF]
Lloh27:
	ldr	w0, [x8]
	mov	w19, #1
	mov	w1, #1
	bl	_AdvanceXLInsertBuffer
	b	LBB0_2
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh22, Lloh23, Lloh24
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh25, Lloh26, Lloh27
	.cfi_endproc
                                        ; -- End function
.zerofill __DATA,__bss,_XLogBackgroundFlush.lastflush,8,3 ; @XLogBackgroundFlush.lastflush
	.comm	_XLogCtl,8,3                    ; @XLogCtl
	.comm	_LogwrtResult,8,2               ; @LogwrtResult
	.comm	_XLOG_BLCKSZ,4,2                ; @XLOG_BLCKSZ
	.comm	_openLogFile,8,3                ; @openLogFile
	.comm	_openLogSegNo,4,2               ; @openLogSegNo
	.comm	_wal_segment_size,4,2           ; @wal_segment_size
	.comm	_WalWriterFlushAfter,4,2        ; @WalWriterFlushAfter
	.comm	_WalWriterDelay,4,2             ; @WalWriterDelay
	.comm	_WALWriteLock,4,2               ; @WALWriteLock
	.comm	_LW_EXCLUSIVE,4,2               ; @LW_EXCLUSIVE
	.comm	_InvalidXLogRecPtr,4,2          ; @InvalidXLogRecPtr
	.comm	_LOG,4,2                        ; @LOG
	.comm	_XLOG_DEBUG,8,3                 ; @XLOG_DEBUG
.subsections_via_symbols
