	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function BufferSync
_BufferSync:                            ## @BufferSync
	.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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edi, %ebx
	movq	_BM_DIRTY@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	movq	_CurrentResourceOwner@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_ResourceOwnerEnlargeBuffers
	movq	_CHECKPOINT_IS_SHUTDOWN@GOTPCREL(%rip), %rax
	movq	_CHECKPOINT_END_OF_RECOVERY@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	movq	_CHECKPOINT_FLUSH_ALL@GOTPCREL(%rip), %rax
	orl	(%rax), %ecx
	xorl	%r15d, %r15d
	movl	%ebx, -84(%rbp)                 ## 4-byte Spill
	testl	%ebx, %ecx
	jne	LBB0_2
## %bb.1:
	movq	_BM_PERMANENT@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
LBB0_2:
	movq	_NBuffers@GOTPCREL(%rip), %r12
	cmpl	$0, (%r12)
	jle	LBB0_33
## %bb.3:
	orl	%r14d, %r15d
	xorl	%ebx, %ebx
	movq	_BM_CHECKPOINT_NEEDED@GOTPCREL(%rip), %r13
	movl	$0, -44(%rbp)                   ## 4-byte Folded Spill
	jmp	LBB0_4
	.p2align	4, 0x90
LBB0_6:                                 ##   in Loop: Header=BB0_4 Depth=1
	movq	%r14, %rdi
	movl	%eax, %esi
	callq	_UnlockBufHdr
	incl	%ebx
	cmpl	(%r12), %ebx
	jge	LBB0_7
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movl	%ebx, %edi
	callq	_GetBufferDescriptor
	movq	%rax, %r14
	movq	%rax, %rdi
	callq	_LockBufHdr
	movl	%eax, %ecx
	notl	%ecx
	testl	%ecx, %r15d
	jne	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	movl	(%r13), %ecx
	orl	%ecx, %eax
	movq	_CkptBufferIds@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	movslq	%esi, %rdx
	incl	%esi
	movl	%esi, -44(%rbp)                 ## 4-byte Spill
	shlq	$5, %rdx
	movl	%ebx, (%rcx,%rdx)
	movq	16(%r14), %rsi
	movq	%rsi, 8(%rcx,%rdx)
	movl	24(%r14), %esi
	movl	%esi, 24(%rcx,%rdx)
	movl	12(%r14), %esi
	movl	%esi, 20(%rcx,%rdx)
	movl	8(%r14), %esi
	movl	%esi, 16(%rcx,%rdx)
	jmp	LBB0_6
LBB0_7:
	movl	-44(%rbp), %ebx                 ## 4-byte Reload
	testl	%ebx, %ebx
	je	LBB0_33
## %bb.8:
	movq	_checkpoint_flush_after@GOTPCREL(%rip), %rsi
	leaq	-68(%rbp), %rdi
	callq	_WritebackContextInit
	movl	(%r12), %edi
	movl	%ebx, %esi
	callq	_TRACE_POSTGRESQL_BUFFER_SYNC_START
	movq	_CkptBufferIds@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	movq	_ckpt_buforder_comparator@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movl	%ebx, %esi
	movl	$32, %edx
	callq	_qsort
	testl	%ebx, %ebx
	jle	LBB0_9
## %bb.10:
	movq	_InvalidOid@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movl	%ebx, %r8d
	decq	%r8
	xorl	%r15d, %r15d
	movl	$8, %esi
	xorl	%r14d, %r14d
	xorl	%r12d, %r12d
	movq	%rax, %rcx
	movq	%r8, -64(%rbp)                  ## 8-byte Spill
	.p2align	4, 0x90
LBB0_11:                                ## =>This Inner Loop Header: Depth=1
	movq	_CkptBufferIds@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rdx
	movq	(%rdx,%rsi), %r13
	cmpq	%rax, %rcx
	je	LBB0_13
## %bb.12:                              ##   in Loop: Header=BB0_11 Depth=1
	cmpq	%r13, %rcx
	jne	LBB0_13
## %bb.17:                              ##   in Loop: Header=BB0_11 Depth=1
	leal	-1(%r14), %eax
	cltq
	leaq	(%rax,%rax,4), %rax
	leaq	(%r12,%rax,8), %rbx
	movq	%rcx, %r13
	jmp	LBB0_18
	.p2align	4, 0x90
LBB0_13:                                ##   in Loop: Header=BB0_11 Depth=1
	movq	%rsi, -56(%rbp)                 ## 8-byte Spill
	leal	8(,%r14,8), %eax
	leal	(%rax,%rax,4), %esi
	testq	%r12, %r12
	je	LBB0_14
## %bb.15:                              ##   in Loop: Header=BB0_11 Depth=1
	movq	%r12, %rdi
	callq	_repalloc
	jmp	LBB0_16
LBB0_14:                                ##   in Loop: Header=BB0_11 Depth=1
	movl	%esi, %edi
	callq	_palloc
LBB0_16:                                ##   in Loop: Header=BB0_11 Depth=1
	movq	%rax, %r12
	movslq	%r14d, %rcx
	incl	%r14d
	movq	%r14, -80(%rbp)                 ## 8-byte Spill
	leaq	(%rcx,%rcx,4), %r14
	leaq	(%rax,%r14,8), %rbx
	movq	%rbx, %rdi
	xorl	%esi, %esi
	movl	$40, %edx
	callq	_memset
	movq	%r13, 32(%r12,%r14,8)
	movl	%r15d, (%r12,%r14,8)
	movq	-80(%rbp), %r14                 ## 8-byte Reload
	movq	-64(%rbp), %r8                  ## 8-byte Reload
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
LBB0_18:                                ##   in Loop: Header=BB0_11 Depth=1
	incl	4(%rbx)
	cmpq	%r15, %r8
	je	LBB0_19
## %bb.34:                              ##   in Loop: Header=BB0_11 Depth=1
	movq	_InvalidOid@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	addq	$32, %rsi
	incq	%r15
	movq	%r13, %rcx
	jmp	LBB0_11
LBB0_19:
	movq	%r12, -64(%rbp)                 ## 8-byte Spill
	movq	_NBuffers@GOTPCREL(%rip), %r12
	jmp	LBB0_20
LBB0_9:
	xorl	%eax, %eax
	movq	%rax, -64(%rbp)                 ## 8-byte Spill
	xorl	%r14d, %r14d
LBB0_20:
	xorl	%edi, %edi
	testl	%r14d, %r14d
	setg	%dil
	callq	_Assert
	movq	_ts_ckpt_progress_comparator@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	xorl	%eax, %eax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movl	%r14d, %edi
	xorl	%edx, %edx
	callq	_binaryheap_allocate
	movq	%rax, %r15
	testl	%r14d, %r14d
	movl	-44(%rbp), %r13d                ## 4-byte Reload
	jle	LBB0_23
## %bb.21:
	movl	%r14d, %r14d
	movq	-64(%rbp), %rbx                 ## 8-byte Reload
	.p2align	4, 0x90
LBB0_22:                                ## =>This Inner Loop Header: Depth=1
	movl	%r13d, %eax
	cltd
	idivl	4(%rbx)
	movl	%eax, 8(%rbx)
	movq	%rbx, %rdi
	callq	_PointerGetDatum
	movq	%r15, %rdi
	movl	%eax, %esi
	callq	_binaryheap_add_unordered
	addq	$40, %rbx
	decq	%r14
	jne	LBB0_22
LBB0_23:
	movq	%r15, %rdi
	callq	_binaryheap_build
	movq	%r15, %rdi
	callq	_binaryheap_empty
	testl	%eax, %eax
	movq	_BM_CHECKPOINT_NEEDED@GOTPCREL(%rip), %r13
	je	LBB0_24
LBB0_32:
	leaq	-68(%rbp), %rdi
	callq	_IssuePendingWritebacks
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	callq	_pfree
	movq	%r15, %rdi
	callq	_binaryheap_free
	movq	_CheckpointStats@GOTPCREL(%rip), %rax
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	addl	%esi, (%rax)
	movl	(%r12), %edi
                                        ## kill: def $esi killed $esi killed $rsi
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	callq	_TRACE_POSTGRESQL_BUFFER_SYNC_DONE
LBB0_33:
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_24:
	cvtsi2sdl	-44(%rbp), %xmm0        ## 4-byte Folded Reload
	movsd	%xmm0, -80(%rbp)                ## 8-byte Spill
	xorl	%eax, %eax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movl	$1, %ebx
	jmp	LBB0_25
	.p2align	4, 0x90
LBB0_30:                                ##   in Loop: Header=BB0_25 Depth=1
	movq	%r14, %rdi
	callq	_PointerGetDatum
	movq	%r15, %rdi
	movl	%eax, %esi
	callq	_binaryheap_replace_first
LBB0_31:                                ##   in Loop: Header=BB0_25 Depth=1
	xorps	%xmm0, %xmm0
	cvtsi2sd	%ebx, %xmm0
	divsd	-80(%rbp), %xmm0                ## 8-byte Folded Reload
	movl	-84(%rbp), %edi                 ## 4-byte Reload
	callq	_CheckpointWriteDelay
	movq	%r15, %rdi
	callq	_binaryheap_empty
	incl	%ebx
	testl	%eax, %eax
	jne	LBB0_32
LBB0_25:                                ## =>This Inner Loop Header: Depth=1
	movq	%r15, %rdi
	callq	_binaryheap_first
	movl	%eax, %edi
	callq	_DatumGetPointer
	movq	%rax, %r14
	movq	_CkptBufferIds@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movslq	(%r14), %rcx
	shlq	$5, %rcx
	movl	(%rax,%rcx), %r12d
	xorl	%edi, %edi
	cmpl	$-1, %r12d
	setne	%dil
	callq	_Assert
	movl	%r12d, %edi
	callq	_GetBufferDescriptor
	movq	%rax, %rdi
	callq	_pg_atomic_read_u32
	testl	%eax, (%r13)
	je	LBB0_28
## %bb.26:                              ##   in Loop: Header=BB0_25 Depth=1
	movl	%r12d, %edi
	xorl	%esi, %esi
	leaq	-68(%rbp), %rdx
	callq	_SyncOneBuffer
	movq	_BUF_WRITTEN@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_28
## %bb.27:                              ##   in Loop: Header=BB0_25 Depth=1
	movl	%r12d, %edi
	callq	_TRACE_POSTGRESQL_BUFFER_SYNC_WRITTEN
	movq	_BgWriterStats@GOTPCREL(%rip), %rax
	incl	(%rax)
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	incl	%eax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
LBB0_28:                                ##   in Loop: Header=BB0_25 Depth=1
	movq	_NBuffers@GOTPCREL(%rip), %r12
	movl	8(%r14), %eax
	addl	%eax, 24(%r14)
	movq	16(%r14), %rax
	incq	%rax
	movq	%rax, 16(%r14)
	incl	(%r14)
	movslq	4(%r14), %rcx
	cmpq	%rcx, %rax
	jne	LBB0_30
## %bb.29:                              ##   in Loop: Header=BB0_25 Depth=1
	movq	%r15, %rdi
	callq	_binaryheap_remove_first
	jmp	LBB0_31
	.cfi_endproc
                                        ## -- End function
	.comm	_BM_DIRTY,4,2                   ## @BM_DIRTY
	.comm	_CurrentResourceOwner,4,2       ## @CurrentResourceOwner
	.comm	_CHECKPOINT_IS_SHUTDOWN,4,2     ## @CHECKPOINT_IS_SHUTDOWN
	.comm	_CHECKPOINT_END_OF_RECOVERY,4,2 ## @CHECKPOINT_END_OF_RECOVERY
	.comm	_CHECKPOINT_FLUSH_ALL,4,2       ## @CHECKPOINT_FLUSH_ALL
	.comm	_BM_PERMANENT,4,2               ## @BM_PERMANENT
	.comm	_NBuffers,4,2                   ## @NBuffers
	.comm	_BM_CHECKPOINT_NEEDED,4,2       ## @BM_CHECKPOINT_NEEDED
	.comm	_CkptBufferIds,8,3              ## @CkptBufferIds
	.comm	_checkpoint_flush_after,4,2     ## @checkpoint_flush_after
	.comm	_ckpt_buforder_comparator,4,2   ## @ckpt_buforder_comparator
	.comm	_InvalidOid,8,3                 ## @InvalidOid
	.comm	_ts_ckpt_progress_comparator,4,2 ## @ts_ckpt_progress_comparator
	.comm	_BUF_WRITTEN,4,2                ## @BUF_WRITTEN
	.comm	_BgWriterStats,4,2              ## @BgWriterStats
	.comm	_CheckpointStats,4,2            ## @CheckpointStats
	.no_dead_strip	_BufferSync
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function BufferSync
_BufferSync:                            ; @BufferSync
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	d9, d8, [sp, #16]               ; 16-byte Folded Spill
	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
	.cfi_offset b8, -104
	.cfi_offset b9, -112
	mov	x27, x0
Lloh0:
	adrp	x8, _BM_DIRTY@GOTPAGE
Lloh1:
	ldr	x8, [x8, _BM_DIRTY@GOTPAGEOFF]
Lloh2:
	ldr	w19, [x8]
Lloh3:
	adrp	x8, _CurrentResourceOwner@GOTPAGE
Lloh4:
	ldr	x8, [x8, _CurrentResourceOwner@GOTPAGEOFF]
Lloh5:
	ldr	w0, [x8]
	bl	_ResourceOwnerEnlargeBuffers
Lloh6:
	adrp	x8, _CHECKPOINT_IS_SHUTDOWN@GOTPAGE
Lloh7:
	ldr	x8, [x8, _CHECKPOINT_IS_SHUTDOWN@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
Lloh9:
	adrp	x9, _CHECKPOINT_END_OF_RECOVERY@GOTPAGE
Lloh10:
	ldr	x9, [x9, _CHECKPOINT_END_OF_RECOVERY@GOTPAGEOFF]
Lloh11:
	ldr	w9, [x9]
Lloh12:
	adrp	x10, _CHECKPOINT_FLUSH_ALL@GOTPAGE
Lloh13:
	ldr	x10, [x10, _CHECKPOINT_FLUSH_ALL@GOTPAGEOFF]
	orr	w8, w9, w8
Lloh14:
	ldr	w9, [x10]
	orr	w8, w8, w9
Lloh15:
	adrp	x9, _BM_PERMANENT@GOTPAGE
Lloh16:
	ldr	x9, [x9, _BM_PERMANENT@GOTPAGEOFF]
Lloh17:
	ldr	w9, [x9]
	tst	w8, w27
	csel	w8, w9, wzr, eq
Lloh18:
	adrp	x26, _NBuffers@GOTPAGE
Lloh19:
	ldr	x26, [x26, _NBuffers@GOTPAGEOFF]
	ldr	w9, [x26]
	cmp	w9, #1
	b.lt	LBB0_24
; %bb.1:
	mov	w21, #0
	mov	w20, #0
	orr	w19, w8, w19
Lloh20:
	adrp	x23, _BM_CHECKPOINT_NEEDED@GOTPAGE
Lloh21:
	ldr	x23, [x23, _BM_CHECKPOINT_NEEDED@GOTPAGEOFF]
Lloh22:
	adrp	x28, _CkptBufferIds@GOTPAGE
Lloh23:
	ldr	x28, [x28, _CkptBufferIds@GOTPAGEOFF]
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	mov	x0, x22
	bl	_UnlockBufHdr
	add	w21, w21, #1
	ldr	w8, [x26]
	cmp	w21, w8
	b.ge	LBB0_5
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x21
	bl	_GetBufferDescriptor
	mov	x22, x0
	bl	_LockBufHdr
	mov	x1, x0
	bics	wzr, w19, w0
	b.ne	LBB0_2
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	w8, [x23]
	orr	w1, w8, w1
	ldr	x8, [x28]
	sxtw	x9, w20
	add	w10, w20, #1
	add	x8, x8, x9, lsl #5
	str	w21, [x8]
	ldr	x9, [x22, #16]
	str	x9, [x8, #8]
	ldr	w9, [x22, #24]
	str	w9, [x8, #24]
	ldr	d0, [x22, #8]
	str	d0, [x8, #16]
	mov	x20, x10
	b	LBB0_2
LBB0_5:
	cbz	w20, LBB0_24
; %bb.6:
Lloh24:
	adrp	x1, _checkpoint_flush_after@GOTPAGE
Lloh25:
	ldr	x1, [x1, _checkpoint_flush_after@GOTPAGEOFF]
	add	x0, sp, #12
	bl	_WritebackContextInit
	ldr	w0, [x26]
	mov	x1, x20
	bl	_TRACE_POSTGRESQL_BUFFER_SYNC_START
	ldr	x0, [x28]
Lloh26:
	adrp	x8, _ckpt_buforder_comparator@GOTPAGE
Lloh27:
	ldr	x8, [x8, _ckpt_buforder_comparator@GOTPAGEOFF]
Lloh28:
	ldr	w3, [x8]
	mov	x1, x20
	mov	w2, #32
	bl	_qsort
	cmp	w20, #1
	b.lt	LBB0_18
; %bb.7:
	str	w27, [sp, #8]                   ; 4-byte Folded Spill
	mov	x19, #0
	mov	w24, #0
	mov	x21, #0
Lloh29:
	adrp	x8, _InvalidOid@GOTPAGE
Lloh30:
	ldr	x8, [x8, _InvalidOid@GOTPAGEOFF]
Lloh31:
	ldr	x9, [x8]
	mov	w8, w20
	sub	x25, x8, #1
	mov	w27, #8
	mov	x8, x9
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	mov	x26, x28
	ldr	x10, [x28]
	ldr	x28, [x10, x27]
	cmp	x8, x9
	b.eq	LBB0_11
; %bb.9:                                ;   in Loop: Header=BB0_8 Depth=1
	cmp	x8, x28
	b.ne	LBB0_11
; %bb.10:                               ;   in Loop: Header=BB0_8 Depth=1
	mov	w9, #40
	smaddl	x9, w24, w9, x21
	sub	x22, x9, #40
	b	LBB0_15
LBB0_11:                                ;   in Loop: Header=BB0_8 Depth=1
	add	w23, w24, #1
	add	w8, w23, w23, lsl #2
	lsl	w1, w8, #3
	cbz	x21, LBB0_13
; %bb.12:                               ;   in Loop: Header=BB0_8 Depth=1
	mov	x0, x21
	bl	_repalloc
	b	LBB0_14
LBB0_13:                                ;   in Loop: Header=BB0_8 Depth=1
	mov	x0, x1
	bl	_palloc
LBB0_14:                                ;   in Loop: Header=BB0_8 Depth=1
	mov	x21, x0
	mov	w8, #40
	smaddl	x22, w24, w8, x0
	mov	x0, x22
	mov	w1, #0
	mov	w2, #40
	bl	_memset
	str	x28, [x22, #32]
	str	w19, [x22]
	mov	x8, x28
	mov	x24, x23
LBB0_15:                                ;   in Loop: Header=BB0_8 Depth=1
	ldr	w9, [x22, #4]
	add	w9, w9, #1
	str	w9, [x22, #4]
	cmp	x25, x19
	mov	x28, x26
	b.eq	LBB0_17
; %bb.16:                               ;   in Loop: Header=BB0_8 Depth=1
Lloh32:
	adrp	x9, _InvalidOid@GOTPAGE
Lloh33:
	ldr	x9, [x9, _InvalidOid@GOTPAGEOFF]
Lloh34:
	ldr	x9, [x9]
	add	x27, x27, #32
	add	x19, x19, #1
	b	LBB0_8
LBB0_17:
Lloh35:
	adrp	x26, _NBuffers@GOTPAGE
Lloh36:
	ldr	x26, [x26, _NBuffers@GOTPAGEOFF]
	ldr	w27, [sp, #8]                   ; 4-byte Folded Reload
	b	LBB0_19
LBB0_18:
	mov	x21, #0
	mov	w24, #0
LBB0_19:
	cmp	w24, #0
	cset	w0, gt
	bl	_Assert
Lloh37:
	adrp	x8, _ts_ckpt_progress_comparator@GOTPAGE
Lloh38:
	ldr	x8, [x8, _ts_ckpt_progress_comparator@GOTPAGEOFF]
Lloh39:
	ldr	w1, [x8]
	mov	x0, x24
	mov	x2, #0
	bl	_binaryheap_allocate
	mov	x22, x0
	cmp	w24, #1
	b.lt	LBB0_22
; %bb.20:
	mov	w19, w24
	mov	x23, x21
LBB0_21:                                ; =>This Inner Loop Header: Depth=1
	ldr	w8, [x23, #4]
	sdiv	w8, w20, w8
	str	w8, [x23, #8]
	mov	x0, x23
	bl	_PointerGetDatum
	mov	x1, x0
	mov	x0, x22
	bl	_binaryheap_add_unordered
	add	x23, x23, #40
	subs	x19, x19, #1
	b.ne	LBB0_21
LBB0_22:
	mov	x0, x22
	bl	_binaryheap_build
	mov	x0, x22
	bl	_binaryheap_empty
	mov	w23, #0
	cbz	w0, LBB0_25
LBB0_23:
	add	x0, sp, #12
	bl	_IssuePendingWritebacks
	mov	x0, x21
	bl	_pfree
	mov	x0, x22
	bl	_binaryheap_free
Lloh40:
	adrp	x8, _CheckpointStats@GOTPAGE
Lloh41:
	ldr	x8, [x8, _CheckpointStats@GOTPAGEOFF]
	ldr	w9, [x8]
	add	w9, w9, w23
	str	w9, [x8]
	ldr	w0, [x26]
	mov	x1, x23
	mov	x2, x20
	bl	_TRACE_POSTGRESQL_BUFFER_SYNC_DONE
LBB0_24:
	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
	ldp	d9, d8, [sp, #16]               ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
LBB0_25:
	scvtf	d8, w20
	mov	w19, #1
	b	LBB0_28
LBB0_26:                                ;   in Loop: Header=BB0_28 Depth=1
	mov	x0, x24
	bl	_PointerGetDatum
	mov	x1, x0
	mov	x0, x22
	bl	_binaryheap_replace_first
LBB0_27:                                ;   in Loop: Header=BB0_28 Depth=1
	scvtf	d0, w19
	fdiv	d0, d0, d8
	mov	x0, x27
	bl	_CheckpointWriteDelay
	mov	x0, x22
	bl	_binaryheap_empty
	add	w19, w19, #1
	cbnz	w0, LBB0_23
LBB0_28:                                ; =>This Inner Loop Header: Depth=1
	mov	x0, x22
	bl	_binaryheap_first
	bl	_DatumGetPointer
	mov	x24, x0
	ldr	x8, [x28]
	ldrsw	x9, [x0]
	lsl	x9, x9, #5
	ldr	w25, [x8, x9]
	cmn	w25, #1
	cset	w0, ne
	bl	_Assert
	mov	x0, x25
	bl	_GetBufferDescriptor
	bl	_pg_atomic_read_u32
Lloh42:
	adrp	x8, _BM_CHECKPOINT_NEEDED@GOTPAGE
Lloh43:
	ldr	x8, [x8, _BM_CHECKPOINT_NEEDED@GOTPAGEOFF]
Lloh44:
	ldr	w8, [x8]
	tst	w8, w0
	b.eq	LBB0_31
; %bb.29:                               ;   in Loop: Header=BB0_28 Depth=1
	add	x2, sp, #12
	mov	x0, x25
	mov	w1, #0
	bl	_SyncOneBuffer
Lloh45:
	adrp	x8, _BUF_WRITTEN@GOTPAGE
Lloh46:
	ldr	x8, [x8, _BUF_WRITTEN@GOTPAGEOFF]
Lloh47:
	ldr	w8, [x8]
	tst	w8, w0
	b.eq	LBB0_31
; %bb.30:                               ;   in Loop: Header=BB0_28 Depth=1
	mov	x0, x25
	bl	_TRACE_POSTGRESQL_BUFFER_SYNC_WRITTEN
Lloh48:
	adrp	x9, _BgWriterStats@GOTPAGE
Lloh49:
	ldr	x9, [x9, _BgWriterStats@GOTPAGEOFF]
	ldr	w8, [x9]
	add	w8, w8, #1
	str	w8, [x9]
	add	w23, w23, #1
LBB0_31:                                ;   in Loop: Header=BB0_28 Depth=1
	ldp	w10, w8, [x24, #4]
                                        ; kill: def $w10 killed $w10 def $x10
	sxtw	x10, w10
	ldr	w9, [x24, #24]
	add	w8, w9, w8
	str	w8, [x24, #24]
	ldr	x8, [x24, #16]
	add	x8, x8, #1
	str	x8, [x24, #16]
	ldr	w9, [x24]
	add	w9, w9, #1
	str	w9, [x24]
	cmp	x8, x10
	b.ne	LBB0_26
; %bb.32:                               ;   in Loop: Header=BB0_28 Depth=1
	mov	x0, x22
	bl	_binaryheap_remove_first
	b	LBB0_27
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh20, Lloh21
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGot	Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpLdrGot	Lloh35, Lloh36
	.loh AdrpLdrGotLdr	Lloh37, Lloh38, Lloh39
	.loh AdrpLdrGot	Lloh40, Lloh41
	.loh AdrpLdrGotLdr	Lloh42, Lloh43, Lloh44
	.loh AdrpLdrGotLdr	Lloh45, Lloh46, Lloh47
	.loh AdrpLdrGot	Lloh48, Lloh49
	.cfi_endproc
                                        ; -- End function
	.comm	_BM_DIRTY,4,2                   ; @BM_DIRTY
	.comm	_CurrentResourceOwner,4,2       ; @CurrentResourceOwner
	.comm	_CHECKPOINT_IS_SHUTDOWN,4,2     ; @CHECKPOINT_IS_SHUTDOWN
	.comm	_CHECKPOINT_END_OF_RECOVERY,4,2 ; @CHECKPOINT_END_OF_RECOVERY
	.comm	_CHECKPOINT_FLUSH_ALL,4,2       ; @CHECKPOINT_FLUSH_ALL
	.comm	_BM_PERMANENT,4,2               ; @BM_PERMANENT
	.comm	_NBuffers,4,2                   ; @NBuffers
	.comm	_BM_CHECKPOINT_NEEDED,4,2       ; @BM_CHECKPOINT_NEEDED
	.comm	_CkptBufferIds,8,3              ; @CkptBufferIds
	.comm	_checkpoint_flush_after,4,2     ; @checkpoint_flush_after
	.comm	_ckpt_buforder_comparator,4,2   ; @ckpt_buforder_comparator
	.comm	_InvalidOid,8,3                 ; @InvalidOid
	.comm	_ts_ckpt_progress_comparator,4,2 ; @ts_ckpt_progress_comparator
	.comm	_BUF_WRITTEN,4,2                ; @BUF_WRITTEN
	.comm	_BgWriterStats,4,2              ; @BgWriterStats
	.comm	_CheckpointStats,4,2            ; @CheckpointStats
	.no_dead_strip	_BufferSync
.subsections_via_symbols
