	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function FlushBuffer
_FlushBuffer:                           ## @FlushBuffer
	.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
	movq	%rsi, %r14
	movq	%rdi, %r13
	xorl	%esi, %esi
	callq	_StartBufferIO
	testl	%eax, %eax
	je	LBB0_10
## %bb.1:
	movq	_shared_buffer_write_error_callback@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, -48(%rbp)
	movq	%r13, -56(%rbp)
	movq	_error_context_stack@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rax
	movq	%rax, -64(%rbp)
	leaq	-64(%rbp), %rax
	movq	%rax, (%rcx)
	testq	%r14, %r14
	jne	LBB0_3
## %bb.2:
	movl	8(%r13), %edi
	movq	_InvalidBackendId@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_smgropen
	movq	%rax, %r14
LBB0_3:
	movl	(%r13), %esi
	movl	4(%r13), %edi
	movl	8(%r14), %edx
	movl	(%r14), %r8d
	movl	4(%r14), %ecx
	callq	_TRACE_POSTGRESQL_BUFFER_FLUSH_START
	movq	%r13, %rdi
	callq	_LockBufHdr
	movl	%eax, %r12d
	movq	%r13, %rdi
	callq	_BufferGetLSN
	movl	%eax, %r15d
	movq	_BM_JUST_DIRTIED@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	notl	%ebx
	andl	%r12d, %ebx
	movq	%r13, %rdi
	movl	%ebx, %esi
	callq	_UnlockBufHdr
	movq	_BM_PERMANENT@GOTPCREL(%rip), %rax
	testl	%ebx, (%rax)
	je	LBB0_5
## %bb.4:
	movl	%r15d, %edi
	callq	_XLogFlush
LBB0_5:
	movq	%r13, %rdi
	callq	_BufHdrGetBlock
	movl	(%r13), %esi
	movl	%eax, %edi
	callq	_PageSetChecksumCopy
	movq	%rax, %r15
	movq	_track_io_timing@GOTPCREL(%rip), %rbx
	cmpq	$0, (%rbx)
	je	LBB0_7
## %bb.6:
	callq	_INSTR_TIME_SET_CURRENT
LBB0_7:
	movl	(%r13), %edx
	movl	4(%r13), %esi
	movq	%r14, %rdi
	movq	%r15, %rcx
	xorl	%r8d, %r8d
	callq	_smgrwrite
	cmpq	$0, (%rbx)
	je	LBB0_9
## %bb.8:
	callq	_INSTR_TIME_SET_CURRENT
	callq	_INSTR_TIME_SUBTRACT
	callq	_INSTR_TIME_GET_MICROSEC
	movl	%eax, %edi
	callq	_pgstat_count_buffer_write_time
	movq	_pgBufferUsage@GOTPCREL(%rip), %rax
	movl	4(%rax), %edi
	callq	_INSTR_TIME_ADD
LBB0_9:
	movq	_pgBufferUsage@GOTPCREL(%rip), %rax
	incl	(%rax)
	movq	%r13, %rdi
	movl	$1, %esi
	xorl	%edx, %edx
	callq	_TerminateBufferIO
	movl	(%r13), %esi
	movl	4(%r13), %edi
	movl	8(%r14), %edx
	movl	(%r14), %r8d
	movl	4(%r14), %ecx
	callq	_TRACE_POSTGRESQL_BUFFER_FLUSH_DONE
	movq	-64(%rbp), %rax
	movq	_error_context_stack@GOTPCREL(%rip), %rcx
	movq	%rax, (%rcx)
LBB0_10:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_shared_buffer_write_error_callback,4,2 ## @shared_buffer_write_error_callback
	.comm	_error_context_stack,8,3        ## @error_context_stack
	.comm	_InvalidBackendId,4,2           ## @InvalidBackendId
	.comm	_BM_JUST_DIRTIED,4,2            ## @BM_JUST_DIRTIED
	.comm	_BM_PERMANENT,4,2               ## @BM_PERMANENT
	.comm	_track_io_timing,8,3            ## @track_io_timing
	.comm	_pgBufferUsage,8,2              ## @pgBufferUsage
	.no_dead_strip	_FlushBuffer
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function FlushBuffer
_FlushBuffer:                           ; @FlushBuffer
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	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
	mov	x20, x1
	mov	x19, x0
	mov	w1, #0
	bl	_StartBufferIO
	cbz	w0, LBB0_10
; %bb.1:
Lloh0:
	adrp	x8, _shared_buffer_write_error_callback@GOTPAGE
Lloh1:
	ldr	x8, [x8, _shared_buffer_write_error_callback@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
Lloh3:
	adrp	x23, _error_context_stack@GOTPAGE
Lloh4:
	ldr	x23, [x23, _error_context_stack@GOTPAGEOFF]
	str	w8, [sp, #24]
	ldr	x8, [x23]
	stp	x8, x19, [sp, #8]
	add	x8, sp, #8
	str	x8, [x23]
	cbnz	x20, LBB0_3
; %bb.2:
	ldr	w0, [x19, #8]
Lloh5:
	adrp	x8, _InvalidBackendId@GOTPAGE
Lloh6:
	ldr	x8, [x8, _InvalidBackendId@GOTPAGEOFF]
Lloh7:
	ldr	w1, [x8]
	bl	_smgropen
	mov	x20, x0
LBB0_3:
	ldp	w1, w0, [x19]
	ldp	w3, w2, [x20, #4]
	ldr	w4, [x20]
	bl	_TRACE_POSTGRESQL_BUFFER_FLUSH_START
	mov	x0, x19
	bl	_LockBufHdr
	mov	x22, x0
	mov	x0, x19
	bl	_BufferGetLSN
	mov	x21, x0
Lloh8:
	adrp	x8, _BM_JUST_DIRTIED@GOTPAGE
Lloh9:
	ldr	x8, [x8, _BM_JUST_DIRTIED@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	bic	w22, w22, w8
	mov	x0, x19
	mov	x1, x22
	bl	_UnlockBufHdr
Lloh11:
	adrp	x8, _BM_PERMANENT@GOTPAGE
Lloh12:
	ldr	x8, [x8, _BM_PERMANENT@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	tst	w8, w22
	b.eq	LBB0_5
; %bb.4:
	mov	x0, x21
	bl	_XLogFlush
LBB0_5:
	mov	x0, x19
	bl	_BufHdrGetBlock
	ldr	w1, [x19]
                                        ; kill: def $w0 killed $w0 killed $x0
	bl	_PageSetChecksumCopy
	mov	x21, x0
Lloh14:
	adrp	x22, _track_io_timing@GOTPAGE
Lloh15:
	ldr	x22, [x22, _track_io_timing@GOTPAGEOFF]
	ldr	x8, [x22]
	cbz	x8, LBB0_7
; %bb.6:
	bl	_INSTR_TIME_SET_CURRENT
LBB0_7:
	ldp	w2, w1, [x19]
	mov	x0, x20
	mov	x3, x21
	mov	w4, #0
	bl	_smgrwrite
	ldr	x8, [x22]
Lloh16:
	adrp	x21, _pgBufferUsage@GOTPAGE
Lloh17:
	ldr	x21, [x21, _pgBufferUsage@GOTPAGEOFF]
	cbz	x8, LBB0_9
; %bb.8:
	bl	_INSTR_TIME_SET_CURRENT
	bl	_INSTR_TIME_SUBTRACT
	bl	_INSTR_TIME_GET_MICROSEC
	bl	_pgstat_count_buffer_write_time
	ldr	w0, [x21, #4]
	bl	_INSTR_TIME_ADD
LBB0_9:
	ldr	w8, [x21]
	add	w8, w8, #1
	str	w8, [x21]
	mov	x0, x19
	mov	w1, #1
	mov	w2, #0
	bl	_TerminateBufferIO
	ldp	w1, w0, [x19]
	ldp	w3, w2, [x20, #4]
	ldr	w4, [x20]
	bl	_TRACE_POSTGRESQL_BUFFER_FLUSH_DONE
	ldr	x8, [sp, #8]
	str	x8, [x23]
LBB0_10:
	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
	add	sp, sp, #96
	ret
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_shared_buffer_write_error_callback,4,2 ; @shared_buffer_write_error_callback
	.comm	_error_context_stack,8,3        ; @error_context_stack
	.comm	_InvalidBackendId,4,2           ; @InvalidBackendId
	.comm	_BM_JUST_DIRTIED,4,2            ; @BM_JUST_DIRTIED
	.comm	_BM_PERMANENT,4,2               ; @BM_PERMANENT
	.comm	_track_io_timing,8,3            ; @track_io_timing
	.comm	_pgBufferUsage,8,2              ; @pgBufferUsage
	.no_dead_strip	_FlushBuffer
.subsections_via_symbols
