	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function BufferAlloc
_BufferAlloc:                           ## @BufferAlloc
	.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	$72, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%r9, -80(%rbp)                  ## 8-byte Spill
	movq	%r8, %r12
	movl	%ecx, %r15d
	movl	%edx, %ecx
	movl	%esi, -84(%rbp)                 ## 4-byte Spill
	movq	%rdi, %r14
	movq	(%rdi), %rsi
	movl	8(%rdi), %edx
	movl	%ecx, -52(%rbp)                 ## 4-byte Spill
	movl	%r15d, %r8d
	callq	_INIT_BUFFERTAG
	leaq	-56(%rbp), %rdi
	callq	_BufTableHashCode
	movl	%eax, %ebx
	movl	%eax, %edi
	callq	_BufMappingPartitionLock
	movq	%rax, %r13
	movq	_LW_SHARED@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%r13, %rdi
	callq	_LWLockAcquire
	leaq	-56(%rbp), %rdi
	movl	%ebx, %esi
	callq	_BufTableLookup
	testl	%eax, %eax
	js	LBB0_2
## %bb.1:
	movl	%eax, %edi
	callq	_GetBufferDescriptor
	movq	%rax, %r15
	movq	%rax, %rdi
	movq	%r12, %rsi
	callq	_PinBuffer
	movl	%eax, %ebx
	movq	%r13, %rdi
	jmp	LBB0_31
LBB0_2:
	movl	%ebx, -48(%rbp)                 ## 4-byte Spill
	movq	%r14, -104(%rbp)                ## 8-byte Spill
	movl	%r15d, -88(%rbp)                ## 4-byte Spill
	movq	%r13, %rdi
	callq	_LWLockRelease
	movq	%r13, -64(%rbp)                 ## 8-byte Spill
	movq	%r12, -96(%rbp)                 ## 8-byte Spill
	jmp	LBB0_4
	.p2align	4, 0x90
LBB0_3:                                 ##   in Loop: Header=BB0_4 Depth=1
	movq	%rbx, %rdi
	callq	_LWLockRelease
	movq	%r15, %rdi
	movl	$1, %esi
	callq	_UnpinBuffer
	movq	-96(%rbp), %r12                 ## 8-byte Reload
LBB0_4:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_5 Depth 2
                                        ##       Child Loop BB0_6 Depth 3
	movl	-52(%rbp), %r13d                ## 4-byte Reload
LBB0_5:                                 ##   Parent Loop BB0_4 Depth=1
                                        ## =>  This Loop Header: Depth=2
                                        ##       Child Loop BB0_6 Depth 3
	movq	_LW_SHARED@GOTPCREL(%rip), %r14
LBB0_6:                                 ##   Parent Loop BB0_4 Depth=1
                                        ##     Parent Loop BB0_5 Depth=2
                                        ## =>    This Inner Loop Header: Depth=3
	xorl	%eax, %eax
	callq	_ReservePrivateRefCountEntry
	movq	%r12, %rdi
	leaq	-44(%rbp), %rsi
	callq	_StrategyGetBuffer
	movq	%rax, %r15
	movl	-44(%rbp), %edi
	callq	_BUF_STATE_GET_REFCOUNT
	xorl	%edi, %edi
	testl	%eax, %eax
	sete	%dil
	callq	_Assert
	movq	_BUF_FLAG_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	andl	-44(%rbp), %ebx
	movq	%r15, %rdi
	callq	_PinBuffer_Locked
	movq	_BM_DIRTY@GOTPCREL(%rip), %rax
	testl	%ebx, (%rax)
	je	LBB0_14
## %bb.7:                               ##   in Loop: Header=BB0_6 Depth=3
	movq	%r15, %rdi
	callq	_BufferDescriptorGetContentLock
	movl	(%r14), %esi
	movq	%rax, %rdi
	callq	_LWLockConditionalAcquire
	testq	%rax, %rax
	jne	LBB0_9
## %bb.8:                               ##   in Loop: Header=BB0_6 Depth=3
	movq	%r15, %rdi
	movl	$1, %esi
	callq	_UnpinBuffer
	jmp	LBB0_6
	.p2align	4, 0x90
LBB0_9:                                 ##   in Loop: Header=BB0_5 Depth=2
	testq	%r12, %r12
	je	LBB0_13
## %bb.10:                              ##   in Loop: Header=BB0_5 Depth=2
	movq	%r15, %rdi
	callq	_LockBufHdr
	movl	%eax, -44(%rbp)
	movq	%r15, %rdi
	callq	_BufferGetLSN
	movl	%eax, %r14d
	movl	-44(%rbp), %esi
	movq	%r15, %rdi
	callq	_UnlockBufHdr
	movl	%r14d, %edi
	movl	-52(%rbp), %r13d                ## 4-byte Reload
	callq	_XLogNeedsFlush
	testq	%rax, %rax
	je	LBB0_13
## %bb.11:                              ##   in Loop: Header=BB0_5 Depth=2
	movq	%r12, %rdi
	movq	%r15, %rsi
	callq	_StrategyRejectBuffer
	testq	%rax, %rax
	je	LBB0_13
## %bb.12:                              ##   in Loop: Header=BB0_5 Depth=2
	movq	%r15, %rdi
	callq	_BufferDescriptorGetContentLock
	movq	%rax, %rdi
	callq	_LWLockRelease
	movq	%r15, %rdi
	movl	$1, %esi
	callq	_UnpinBuffer
	jmp	LBB0_5
	.p2align	4, 0x90
LBB0_13:                                ##   in Loop: Header=BB0_4 Depth=1
	movq	-104(%rbp), %r14                ## 8-byte Reload
	movl	8(%r14), %edx
	movl	(%r14), %r8d
	movl	4(%r14), %ecx
	movl	%r13d, %edi
	movl	-88(%rbp), %r12d                ## 4-byte Reload
	movl	%r12d, %esi
	callq	_TRACE_POSTGRESQL_BUFFER_WRITE_DIRTY_START
	movq	%r15, %rdi
	xorl	%esi, %esi
	callq	_FlushBuffer
	movq	%r15, %rdi
	callq	_BufferDescriptorGetContentLock
	movq	%rax, %rdi
	callq	_LWLockRelease
	movq	_BackendWritebackContext@GOTPCREL(%rip), %rdi
	movq	%r15, %rsi
	callq	_ScheduleBufferTagForWriteback
	movl	8(%r14), %edx
	movl	(%r14), %r8d
	movl	4(%r14), %ecx
	movl	%r13d, %edi
	movl	%r12d, %esi
	callq	_TRACE_POSTGRESQL_BUFFER_WRITE_DIRTY_DONE
LBB0_14:                                ##   in Loop: Header=BB0_4 Depth=1
	movq	_BM_TAG_VALID@GOTPCREL(%rip), %rax
	testl	%ebx, (%rax)
	je	LBB0_17
## %bb.15:                              ##   in Loop: Header=BB0_4 Depth=1
	movl	(%r15), %eax
	movl	%eax, -68(%rbp)
	leaq	-68(%rbp), %rdi
	callq	_BufTableHashCode
	movl	%eax, %r14d
	movl	%eax, %edi
	callq	_BufMappingPartitionLock
	movq	%rax, %r12
	movq	-64(%rbp), %r13                 ## 8-byte Reload
	movq	_LW_EXCLUSIVE@GOTPCREL(%rip), %rbx
	cmpq	%r13, %rax
	jae	LBB0_18
## %bb.16:                              ##   in Loop: Header=BB0_4 Depth=1
	movl	(%rbx), %esi
	movq	%r12, %rdi
	callq	_LWLockAcquire
	movl	(%rbx), %esi
	movq	%r13, %rdi
	jmp	LBB0_20
	.p2align	4, 0x90
LBB0_17:                                ##   in Loop: Header=BB0_4 Depth=1
	movq	_LW_EXCLUSIVE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	callq	_LWLockAcquire
	xorl	%r12d, %r12d
	xorl	%r14d, %r14d
	jmp	LBB0_21
	.p2align	4, 0x90
LBB0_18:                                ##   in Loop: Header=BB0_4 Depth=1
	movl	(%rbx), %esi
	movq	%r13, %rdi
	callq	_LWLockAcquire
	cmpq	%r13, %r12
	jbe	LBB0_21
## %bb.19:                              ##   in Loop: Header=BB0_4 Depth=1
	movl	(%rbx), %esi
	movq	%r12, %rdi
LBB0_20:                                ##   in Loop: Header=BB0_4 Depth=1
	callq	_LWLockAcquire
LBB0_21:                                ##   in Loop: Header=BB0_4 Depth=1
	movl	-48(%rbp), %esi                 ## 4-byte Reload
	movl	4(%r15), %edx
	leaq	-56(%rbp), %rdi
	callq	_BufTableInsert
	testl	%eax, %eax
	jns	LBB0_27
## %bb.22:                              ##   in Loop: Header=BB0_4 Depth=1
	movq	%r15, %rdi
	callq	_LockBufHdr
	movl	%eax, %ebx
	movl	%eax, -44(%rbp)
	movq	_BUF_FLAG_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %r13d
	movl	%ebx, %edi
	callq	_BUF_STATE_GET_REFCOUNT
	cmpl	$1, %eax
	jne	LBB0_24
## %bb.23:                              ##   in Loop: Header=BB0_4 Depth=1
	andl	%ebx, %r13d
	movq	_BM_DIRTY@GOTPCREL(%rip), %rax
	testl	%r13d, (%rax)
	je	LBB0_33
LBB0_24:                                ##   in Loop: Header=BB0_4 Depth=1
	movl	-44(%rbp), %esi
	movq	%r15, %rdi
	callq	_UnlockBufHdr
	leaq	-56(%rbp), %rdi
	movl	-48(%rbp), %esi                 ## 4-byte Reload
	callq	_BufTableDelete
	testq	%r12, %r12
	movq	-64(%rbp), %rbx                 ## 8-byte Reload
	je	LBB0_3
## %bb.25:                              ##   in Loop: Header=BB0_4 Depth=1
	cmpq	%rbx, %r12
	je	LBB0_3
## %bb.26:                              ##   in Loop: Header=BB0_4 Depth=1
	movq	%r12, %rdi
	callq	_LWLockRelease
	jmp	LBB0_3
LBB0_27:
	movl	%eax, %r13d
	movq	%r15, %rdi
	movl	$1, %esi
	callq	_UnpinBuffer
	testq	%r12, %r12
	je	LBB0_30
## %bb.28:
	cmpq	-64(%rbp), %r12                 ## 8-byte Folded Reload
	je	LBB0_30
## %bb.29:
	movq	%r12, %rdi
	callq	_LWLockRelease
LBB0_30:
	movl	%r13d, %edi
	callq	_GetBufferDescriptor
	movq	%rax, %r15
	movq	%rax, %rdi
	movq	-96(%rbp), %rsi                 ## 8-byte Reload
	callq	_PinBuffer
	movl	%eax, %ebx
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
LBB0_31:
	callq	_LWLockRelease
	movq	-80(%rbp), %rax                 ## 8-byte Reload
	movl	$1, (%rax)
	testl	%ebx, %ebx
	jne	LBB0_38
## %bb.32:
	movq	%r15, %rdi
	movl	$1, %esi
	callq	_StartBufferIO
	xorl	%ecx, %ecx
	testq	%rax, %rax
	jne	LBB0_37
	jmp	LBB0_38
LBB0_33:
	movl	-56(%rbp), %eax
	movl	%eax, (%r15)
	movq	_BM_VALID@GOTPCREL(%rip), %rcx
	movq	_BM_DIRTY@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	(%rcx), %eax
	movq	_BM_JUST_DIRTIED@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movq	_BM_CHECKPOINT_NEEDED@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movq	_BM_IO_ERROR@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movq	_BM_PERMANENT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	%ecx, %eax
	movq	_BUF_USAGECOUNT_MASK@GOTPCREL(%rip), %rdx
	orl	(%rdx), %eax
	notl	%eax
	andl	-44(%rbp), %eax
	movq	_INIT_FORKNUM@GOTPCREL(%rip), %rdx
	xorl	%esi, %esi
	movl	-52(%rbp), %edi                 ## 4-byte Reload
	cmpl	%edi, (%rdx)
	cmovel	%ecx, %esi
	movq	_RELPERSISTENCE_PERMANENT@GOTPCREL(%rip), %rdx
	movl	-84(%rbp), %edi                 ## 4-byte Reload
	cmpb	%dil, (%rdx)
	movq	_BUF_USAGECOUNT_ONE@GOTPCREL(%rip), %rdx
	cmovel	%ecx, %esi
	movq	_BM_TAG_VALID@GOTPCREL(%rip), %rcx
	orl	(%rcx), %esi
	orl	(%rdx), %esi
	orl	%eax, %esi
	movl	%esi, -44(%rbp)
	movq	%r15, %rdi
	callq	_UnlockBufHdr
	testq	%r12, %r12
	movq	-64(%rbp), %rbx                 ## 8-byte Reload
	je	LBB0_36
## %bb.34:
	leaq	-68(%rbp), %rdi
	movl	%r14d, %esi
	callq	_BufTableDelete
	cmpq	%rbx, %r12
	je	LBB0_36
## %bb.35:
	movq	%r12, %rdi
	callq	_LWLockRelease
LBB0_36:
	movq	%rbx, %rdi
	callq	_LWLockRelease
	movq	%r15, %rdi
	movl	$1, %esi
	callq	_StartBufferIO
	xorl	%ecx, %ecx
	testq	%rax, %rax
	sete	%cl
LBB0_37:
	movq	-80(%rbp), %rax                 ## 8-byte Reload
	movl	%ecx, (%rax)
LBB0_38:
	movq	%r15, %rax
	addq	$72, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_LW_SHARED,4,2                  ## @LW_SHARED
	.comm	_BUF_FLAG_MASK,4,2              ## @BUF_FLAG_MASK
	.comm	_BM_DIRTY,4,2                   ## @BM_DIRTY
	.comm	_BackendWritebackContext,4,2    ## @BackendWritebackContext
	.comm	_BM_TAG_VALID,4,2               ## @BM_TAG_VALID
	.comm	_LW_EXCLUSIVE,4,2               ## @LW_EXCLUSIVE
	.comm	_BM_VALID,4,2                   ## @BM_VALID
	.comm	_BM_JUST_DIRTIED,4,2            ## @BM_JUST_DIRTIED
	.comm	_BM_CHECKPOINT_NEEDED,4,2       ## @BM_CHECKPOINT_NEEDED
	.comm	_BM_IO_ERROR,4,2                ## @BM_IO_ERROR
	.comm	_BM_PERMANENT,4,2               ## @BM_PERMANENT
	.comm	_BUF_USAGECOUNT_MASK,4,2        ## @BUF_USAGECOUNT_MASK
	.comm	_RELPERSISTENCE_PERMANENT,1,0   ## @RELPERSISTENCE_PERMANENT
	.comm	_INIT_FORKNUM,4,2               ## @INIT_FORKNUM
	.comm	_BUF_USAGECOUNT_ONE,4,2         ## @BUF_USAGECOUNT_ONE
	.no_dead_strip	_BufferAlloc
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function BufferAlloc
_BufferAlloc:                           ; @BufferAlloc
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #144
	.cfi_def_cfa_offset 144
	stp	x28, x27, [sp, #48]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #64]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #80]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #96]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #112]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #128]            ; 16-byte Folded Spill
	add	x29, sp, #128
	.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	x24, x5
	mov	x22, x4
	mov	x23, x3
	mov	x19, x2
	mov	x21, x1
	mov	x26, x0
	ldr	x1, [x0]
	ldr	w2, [x0, #8]
	mov	x3, x19
	mov	x4, x23
	bl	_INIT_BUFFERTAG
	add	x0, sp, #44
	bl	_BufTableHashCode
	mov	x27, x0
	bl	_BufMappingPartitionLock
	mov	x20, x0
Lloh0:
	adrp	x8, _LW_SHARED@GOTPAGE
Lloh1:
	ldr	x8, [x8, _LW_SHARED@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	bl	_LWLockAcquire
	add	x0, sp, #44
	mov	x1, x27
	bl	_BufTableLookup
	tbnz	w0, #31, LBB0_2
; %bb.1:
	bl	_GetBufferDescriptor
	mov	x21, x0
	mov	x1, x22
	bl	_PinBuffer
	mov	x19, x0
	mov	x0, x20
	bl	_LWLockRelease
	mov	w8, #1
	str	w8, [x24]
	cbnz	w19, LBB0_37
	b	LBB0_30
LBB0_2:
	stp	w23, w19, [sp, #28]             ; 8-byte Folded Spill
	str	w21, [sp, #12]                  ; 4-byte Folded Spill
	str	x24, [sp, #16]                  ; 8-byte Folded Spill
	mov	x0, x20
	bl	_LWLockRelease
Lloh3:
	adrp	x25, _BUF_FLAG_MASK@GOTPAGE
Lloh4:
	ldr	x25, [x25, _BUF_FLAG_MASK@GOTPAGEOFF]
	b	LBB0_4
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	mov	x0, x20
	bl	_LWLockRelease
	mov	x0, x21
	mov	w1, #1
	bl	_UnpinBuffer
LBB0_4:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_5 Depth 2
Lloh5:
	adrp	x28, _LW_EXCLUSIVE@GOTPAGE
Lloh6:
	ldr	x28, [x28, _LW_EXCLUSIVE@GOTPAGEOFF]
LBB0_5:                                 ;   Parent Loop BB0_4 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	bl	_ReservePrivateRefCountEntry
	add	x1, sp, #36
	mov	x0, x22
	bl	_StrategyGetBuffer
	mov	x21, x0
	ldr	w0, [sp, #36]
	bl	_BUF_STATE_GET_REFCOUNT
	cmp	w0, #0
	cset	w0, eq
	bl	_Assert
	ldr	w8, [sp, #36]
	ldr	w9, [x25]
	and	w24, w9, w8
	mov	x0, x21
	bl	_PinBuffer_Locked
Lloh7:
	adrp	x8, _BM_DIRTY@GOTPAGE
Lloh8:
	ldr	x8, [x8, _BM_DIRTY@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
	tst	w8, w24
	b.eq	LBB0_13
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=2
	mov	x0, x21
	bl	_BufferDescriptorGetContentLock
Lloh10:
	adrp	x8, _LW_SHARED@GOTPAGE
Lloh11:
	ldr	x8, [x8, _LW_SHARED@GOTPAGEOFF]
Lloh12:
	ldr	w1, [x8]
	bl	_LWLockConditionalAcquire
	cbz	x0, LBB0_11
; %bb.7:                                ;   in Loop: Header=BB0_5 Depth=2
	cbz	x22, LBB0_12
; %bb.8:                                ;   in Loop: Header=BB0_5 Depth=2
	mov	x0, x21
	bl	_LockBufHdr
	str	w0, [sp, #36]
	mov	x0, x21
	bl	_BufferGetLSN
	mov	x19, x0
	ldr	w1, [sp, #36]
	mov	x0, x21
	bl	_UnlockBufHdr
	mov	x0, x19
	bl	_XLogNeedsFlush
	cbz	x0, LBB0_12
; %bb.9:                                ;   in Loop: Header=BB0_5 Depth=2
	mov	x0, x22
	mov	x1, x21
	bl	_StrategyRejectBuffer
	cbz	x0, LBB0_12
; %bb.10:                               ;   in Loop: Header=BB0_5 Depth=2
	mov	x0, x21
	bl	_BufferDescriptorGetContentLock
	bl	_LWLockRelease
LBB0_11:                                ;   in Loop: Header=BB0_5 Depth=2
	mov	x0, x21
	mov	w1, #1
	bl	_UnpinBuffer
	b	LBB0_5
LBB0_12:                                ;   in Loop: Header=BB0_4 Depth=1
	ldp	w3, w2, [x26, #4]
	ldr	w4, [x26]
	ldp	w23, w19, [sp, #28]             ; 8-byte Folded Reload
	mov	x0, x19
	mov	x1, x23
	bl	_TRACE_POSTGRESQL_BUFFER_WRITE_DIRTY_START
	mov	x0, x21
	mov	x1, #0
	bl	_FlushBuffer
	mov	x0, x21
	bl	_BufferDescriptorGetContentLock
	bl	_LWLockRelease
Lloh13:
	adrp	x0, _BackendWritebackContext@GOTPAGE
Lloh14:
	ldr	x0, [x0, _BackendWritebackContext@GOTPAGEOFF]
	mov	x1, x21
	bl	_ScheduleBufferTagForWriteback
	ldp	w3, w2, [x26, #4]
	ldr	w4, [x26]
	mov	x0, x19
	mov	x1, x23
	bl	_TRACE_POSTGRESQL_BUFFER_WRITE_DIRTY_DONE
LBB0_13:                                ;   in Loop: Header=BB0_4 Depth=1
Lloh15:
	adrp	x8, _BM_TAG_VALID@GOTPAGE
Lloh16:
	ldr	x8, [x8, _BM_TAG_VALID@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	tst	w8, w24
	b.eq	LBB0_16
; %bb.14:                               ;   in Loop: Header=BB0_4 Depth=1
	ldr	w8, [x21]
	str	w8, [sp, #40]
	add	x0, sp, #40
	bl	_BufTableHashCode
	mov	x19, x0
	bl	_BufMappingPartitionLock
	mov	x24, x0
	cmp	x0, x20
	b.hs	LBB0_17
; %bb.15:                               ;   in Loop: Header=BB0_4 Depth=1
	ldr	w1, [x28]
	mov	x0, x24
	bl	_LWLockAcquire
	ldr	w1, [x28]
	mov	x0, x20
	b	LBB0_19
LBB0_16:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	w1, [x28]
	mov	x0, x20
	bl	_LWLockAcquire
	mov	x24, #0
	mov	w19, #0
	b	LBB0_20
LBB0_17:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	w1, [x28]
	mov	x0, x20
	bl	_LWLockAcquire
	cmp	x24, x20
	b.ls	LBB0_20
; %bb.18:                               ;   in Loop: Header=BB0_4 Depth=1
	ldr	w1, [x28]
	mov	x0, x24
LBB0_19:                                ;   in Loop: Header=BB0_4 Depth=1
	bl	_LWLockAcquire
LBB0_20:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	w2, [x21, #4]
	add	x0, sp, #44
	mov	x1, x27
	bl	_BufTableInsert
	tbz	w0, #31, LBB0_26
; %bb.21:                               ;   in Loop: Header=BB0_4 Depth=1
	mov	x0, x21
	bl	_LockBufHdr
	mov	x28, x0
	str	w0, [sp, #36]
	ldr	w23, [x25]
	bl	_BUF_STATE_GET_REFCOUNT
	cmp	w0, #1
	b.ne	LBB0_23
; %bb.22:                               ;   in Loop: Header=BB0_4 Depth=1
	and	w8, w23, w28
Lloh18:
	adrp	x9, _BM_DIRTY@GOTPAGE
Lloh19:
	ldr	x9, [x9, _BM_DIRTY@GOTPAGEOFF]
Lloh20:
	ldr	w9, [x9]
	tst	w8, w9
	b.eq	LBB0_32
LBB0_23:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	w1, [sp, #36]
	mov	x0, x21
	bl	_UnlockBufHdr
	add	x0, sp, #44
	mov	x1, x27
	bl	_BufTableDelete
	cbz	x24, LBB0_3
; %bb.24:                               ;   in Loop: Header=BB0_4 Depth=1
	cmp	x24, x20
	b.eq	LBB0_3
; %bb.25:                               ;   in Loop: Header=BB0_4 Depth=1
	mov	x0, x24
	bl	_LWLockRelease
	b	LBB0_3
LBB0_26:
	mov	x28, x0
	mov	w23, #1
	mov	x0, x21
	mov	w1, #1
	bl	_UnpinBuffer
	cbz	x24, LBB0_29
; %bb.27:
	cmp	x24, x20
	b.eq	LBB0_29
; %bb.28:
	mov	x0, x24
	bl	_LWLockRelease
LBB0_29:
	mov	x0, x28
	bl	_GetBufferDescriptor
	mov	x21, x0
	mov	x1, x22
	bl	_PinBuffer
	mov	x19, x0
	mov	x0, x20
	bl	_LWLockRelease
	ldr	x24, [sp, #16]                  ; 8-byte Folded Reload
	str	w23, [x24]
	cbnz	w19, LBB0_37
LBB0_30:
	mov	x0, x21
	mov	w1, #1
	bl	_StartBufferIO
	cbz	x0, LBB0_37
; %bb.31:
	mov	w8, #0
	b	LBB0_36
LBB0_32:
	ldr	w8, [sp, #44]
	str	w8, [x21]
Lloh21:
	adrp	x8, _BM_VALID@GOTPAGE
Lloh22:
	ldr	x8, [x8, _BM_VALID@GOTPAGEOFF]
Lloh23:
	ldr	w8, [x8]
Lloh24:
	adrp	x9, _BM_DIRTY@GOTPAGE
Lloh25:
	ldr	x9, [x9, _BM_DIRTY@GOTPAGEOFF]
Lloh26:
	ldr	w9, [x9]
	orr	w8, w9, w8
Lloh27:
	adrp	x9, _BM_JUST_DIRTIED@GOTPAGE
Lloh28:
	ldr	x9, [x9, _BM_JUST_DIRTIED@GOTPAGEOFF]
Lloh29:
	ldr	w9, [x9]
	orr	w8, w8, w9
Lloh30:
	adrp	x9, _BM_CHECKPOINT_NEEDED@GOTPAGE
Lloh31:
	ldr	x9, [x9, _BM_CHECKPOINT_NEEDED@GOTPAGEOFF]
Lloh32:
	ldr	w9, [x9]
	orr	w8, w8, w9
Lloh33:
	adrp	x9, _BM_IO_ERROR@GOTPAGE
Lloh34:
	ldr	x9, [x9, _BM_IO_ERROR@GOTPAGEOFF]
Lloh35:
	ldr	w9, [x9]
	orr	w8, w8, w9
Lloh36:
	adrp	x9, _BM_PERMANENT@GOTPAGE
Lloh37:
	ldr	x9, [x9, _BM_PERMANENT@GOTPAGEOFF]
Lloh38:
	ldr	w9, [x9]
	orr	w8, w8, w9
Lloh39:
	adrp	x10, _BUF_USAGECOUNT_MASK@GOTPAGE
Lloh40:
	ldr	x10, [x10, _BUF_USAGECOUNT_MASK@GOTPAGEOFF]
Lloh41:
	ldr	w10, [x10]
	orr	w8, w8, w10
	ldp	w13, w10, [sp, #32]             ; 4-byte Folded Reload
	bic	w8, w10, w8
Lloh42:
	adrp	x10, _RELPERSISTENCE_PERMANENT@GOTPAGE
Lloh43:
	ldr	x10, [x10, _RELPERSISTENCE_PERMANENT@GOTPAGEOFF]
	ldrb	w10, [x10]
	ldr	w11, [sp, #12]                  ; 4-byte Folded Reload
	and	w11, w11, #0xff
Lloh44:
	adrp	x12, _INIT_FORKNUM@GOTPAGE
Lloh45:
	ldr	x12, [x12, _INIT_FORKNUM@GOTPAGEOFF]
Lloh46:
	ldr	w12, [x12]
	cmp	w12, w13
	ccmp	w10, w11, #4, ne
Lloh47:
	adrp	x10, _BM_TAG_VALID@GOTPAGE
Lloh48:
	ldr	x10, [x10, _BM_TAG_VALID@GOTPAGEOFF]
Lloh49:
	ldr	w10, [x10]
Lloh50:
	adrp	x11, _BUF_USAGECOUNT_ONE@GOTPAGE
Lloh51:
	ldr	x11, [x11, _BUF_USAGECOUNT_ONE@GOTPAGEOFF]
Lloh52:
	ldr	w11, [x11]
	csel	w9, w9, wzr, eq
	orr	w9, w10, w9
	orr	w9, w11, w9
	orr	w1, w9, w8
	str	w1, [sp, #36]
	mov	x0, x21
	bl	_UnlockBufHdr
	cbz	x24, LBB0_35
; %bb.33:
	add	x0, sp, #40
	mov	x1, x19
	bl	_BufTableDelete
	cmp	x24, x20
	b.eq	LBB0_35
; %bb.34:
	mov	x0, x24
	bl	_LWLockRelease
LBB0_35:
	mov	x0, x20
	bl	_LWLockRelease
	mov	x0, x21
	mov	w1, #1
	bl	_StartBufferIO
	cmp	x0, #0
	cset	w8, eq
	ldr	x24, [sp, #16]                  ; 8-byte Folded Reload
LBB0_36:
	str	w8, [x24]
LBB0_37:
	mov	x0, x21
	ldp	x29, x30, [sp, #128]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #112]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #96]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #80]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #64]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #144
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh50, Lloh51, Lloh52
	.loh AdrpLdrGotLdr	Lloh47, Lloh48, Lloh49
	.loh AdrpLdrGotLdr	Lloh44, Lloh45, Lloh46
	.loh AdrpLdrGot	Lloh42, Lloh43
	.loh AdrpLdrGotLdr	Lloh39, Lloh40, Lloh41
	.loh AdrpLdrGotLdr	Lloh36, Lloh37, Lloh38
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.cfi_endproc
                                        ; -- End function
	.comm	_LW_SHARED,4,2                  ; @LW_SHARED
	.comm	_BUF_FLAG_MASK,4,2              ; @BUF_FLAG_MASK
	.comm	_BM_DIRTY,4,2                   ; @BM_DIRTY
	.comm	_BackendWritebackContext,4,2    ; @BackendWritebackContext
	.comm	_BM_TAG_VALID,4,2               ; @BM_TAG_VALID
	.comm	_LW_EXCLUSIVE,4,2               ; @LW_EXCLUSIVE
	.comm	_BM_VALID,4,2                   ; @BM_VALID
	.comm	_BM_JUST_DIRTIED,4,2            ; @BM_JUST_DIRTIED
	.comm	_BM_CHECKPOINT_NEEDED,4,2       ; @BM_CHECKPOINT_NEEDED
	.comm	_BM_IO_ERROR,4,2                ; @BM_IO_ERROR
	.comm	_BM_PERMANENT,4,2               ; @BM_PERMANENT
	.comm	_BUF_USAGECOUNT_MASK,4,2        ; @BUF_USAGECOUNT_MASK
	.comm	_RELPERSISTENCE_PERMANENT,1,0   ; @RELPERSISTENCE_PERMANENT
	.comm	_INIT_FORKNUM,4,2               ; @INIT_FORKNUM
	.comm	_BUF_USAGECOUNT_ONE,4,2         ; @BUF_USAGECOUNT_ONE
	.no_dead_strip	_BufferAlloc
.subsections_via_symbols
