	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_StrategyGetBuffer              ## -- Begin function StrategyGetBuffer
	.p2align	4, 0x90
_StrategyGetBuffer:                     ## @StrategyGetBuffer
	.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, %r15
	movq	%rdi, %rbx
	testq	%rdi, %rdi
	je	LBB0_2
## %bb.1:
	movq	%rbx, %rdi
	movq	%r15, %rsi
	callq	_GetBufferFromRing
	movq	%rax, %r12
	testq	%rax, %rax
	jne	LBB0_12
LBB0_2:
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	movq	_StrategyControl@GOTPCREL(%rip), %r13
	movq	(%r13), %rax
	movl	(%rax), %edi
	callq	_INT_ACCESS_ONCE
	cmpl	$-1, %eax
	je	LBB0_4
## %bb.3:
	movq	(%r13), %rcx
	movl	$-1, (%rcx)
	movq	_ProcGlobal@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movslq	%eax, %rdi
	shlq	$2, %rdi
	addq	(%rcx), %rdi
	callq	_SetLatch
LBB0_4:
	movq	(%r13), %rdi
	addq	$20, %rdi
	movl	$1, %esi
	callq	_pg_atomic_fetch_add_u32
	movq	(%r13), %rdi
	cmpq	$0, 8(%rdi)
	js	LBB0_15
## %bb.5:
	addq	$16, %rdi
	callq	_SpinLockAcquire
	movq	(%r13), %rdi
	movq	8(%rdi), %rax
	testq	%rax, %rax
	js	LBB0_14
## %bb.6:
	movq	_FREENEXT_NOT_IN_LIST@GOTPCREL(%rip), %r14
	jmp	LBB0_7
	.p2align	4, 0x90
LBB0_13:                                ##   in Loop: Header=BB0_7 Depth=1
	movq	%r12, %rdi
	movl	%ebx, %esi
	callq	_UnlockBufHdr
	movq	(%r13), %rdi
	addq	$16, %rdi
	callq	_SpinLockAcquire
	movq	(%r13), %rdi
	movq	8(%rdi), %rax
	testq	%rax, %rax
	js	LBB0_14
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movq	%rax, %rdi
	callq	_GetBufferDescriptor
	movq	%rax, %r12
	movq	(%rax), %rax
	xorl	%edi, %edi
	cmpq	(%r14), %rax
	setne	%dil
	callq	_Assert
	movq	(%r12), %rax
	movq	(%r13), %rdi
	movq	%rax, 8(%rdi)
	movq	(%r14), %rax
	movq	%rax, (%r12)
	addq	$16, %rdi
	callq	_SpinLockRelease
	movq	%r12, %rdi
	callq	_LockBufHdr
	movl	%eax, %ebx
	movl	%eax, %edi
	callq	_BUF_STATE_GET_REFCOUNT
	testq	%rax, %rax
	jne	LBB0_13
## %bb.8:                               ##   in Loop: Header=BB0_7 Depth=1
	movl	%ebx, %edi
	callq	_BUF_STATE_GET_USAGECOUNT
	testq	%rax, %rax
	jne	LBB0_13
## %bb.9:
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	testq	%rdi, %rdi
	je	LBB0_11
## %bb.10:
	movq	%r12, %rsi
	callq	_AddBufferToRing
	jmp	LBB0_11
LBB0_14:
	addq	$16, %rdi
	callq	_SpinLockRelease
LBB0_15:
	movq	%r15, -48(%rbp)                 ## 8-byte Spill
	movq	_NBuffers@GOTPCREL(%rip), %r14
	movl	(%r14), %r13d
	movq	_BUF_USAGECOUNT_ONE@GOTPCREL(%rip), %r15
	jmp	LBB0_16
	.p2align	4, 0x90
LBB0_17:                                ##   in Loop: Header=BB0_16 Depth=1
	movl	%ebx, %edi
	callq	_BUF_STATE_GET_USAGECOUNT
	testq	%rax, %rax
	je	LBB0_19
## %bb.18:                              ##   in Loop: Header=BB0_16 Depth=1
	movl	(%r15), %eax
	subl	%eax, %ebx
	movl	(%r14), %r13d
LBB0_24:                                ##   in Loop: Header=BB0_16 Depth=1
	movq	%r12, %rdi
	movl	%ebx, %esi
	callq	_UnlockBufHdr
LBB0_16:                                ## =>This Inner Loop Header: Depth=1
	xorl	%eax, %eax
	callq	_ClockSweepTick
	movq	%rax, %rdi
	callq	_GetBufferDescriptor
	movq	%rax, %r12
	movq	%rax, %rdi
	callq	_LockBufHdr
	movl	%eax, %ebx
	movl	%eax, %edi
	callq	_BUF_STATE_GET_REFCOUNT
	testq	%rax, %rax
	je	LBB0_17
## %bb.22:                              ##   in Loop: Header=BB0_16 Depth=1
	decl	%r13d
	jne	LBB0_24
## %bb.23:                              ##   in Loop: Header=BB0_16 Depth=1
	movq	%r12, %rdi
	movl	%ebx, %esi
	callq	_UnlockBufHdr
	movq	_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	callq	_elog
	xorl	%r13d, %r13d
	jmp	LBB0_24
LBB0_19:
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	testq	%rdi, %rdi
	je	LBB0_21
## %bb.20:
	movq	%r12, %rsi
	callq	_AddBufferToRing
LBB0_21:
	movq	-48(%rbp), %r15                 ## 8-byte Reload
LBB0_11:
	movl	%ebx, (%r15)
LBB0_12:
	movq	%r12, %rax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_StrategyControl,8,3            ## @StrategyControl
	.comm	_ProcGlobal,8,3                 ## @ProcGlobal
	.comm	_FREENEXT_NOT_IN_LIST,8,3       ## @FREENEXT_NOT_IN_LIST
	.comm	_NBuffers,4,2                   ## @NBuffers
	.comm	_BUF_USAGECOUNT_ONE,8,3         ## @BUF_USAGECOUNT_ONE
	.comm	_ERROR,4,2                      ## @ERROR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"no unpinned buffers available"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_StrategyGetBuffer              ; -- Begin function StrategyGetBuffer
	.p2align	2
_StrategyGetBuffer:                     ; @StrategyGetBuffer
	.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
	mov	x19, x1
	mov	x20, x0
	cbz	x0, LBB0_2
; %bb.1:
	mov	x0, x20
	mov	x1, x19
	bl	_GetBufferFromRing
	mov	x21, x0
	cbnz	x0, LBB0_13
LBB0_2:
Lloh0:
	adrp	x23, _StrategyControl@GOTPAGE
Lloh1:
	ldr	x23, [x23, _StrategyControl@GOTPAGEOFF]
	ldr	x8, [x23]
	ldr	w0, [x8]
	bl	_INT_ACCESS_ONCE
	cmn	w0, #1
	b.eq	LBB0_4
; %bb.3:
	ldr	x8, [x23]
	mov	w9, #-1
	str	w9, [x8]
Lloh2:
	adrp	x8, _ProcGlobal@GOTPAGE
Lloh3:
	ldr	x8, [x8, _ProcGlobal@GOTPAGEOFF]
Lloh4:
	ldr	x8, [x8]
	ldr	x8, [x8]
	add	x0, x8, w0, sxtw #2
	bl	_SetLatch
LBB0_4:
	ldr	x8, [x23]
	add	x0, x8, #20
	mov	w1, #1
	bl	_pg_atomic_fetch_add_u32
	ldr	x8, [x23]
	ldr	x9, [x8, #8]
	tbnz	x9, #63, LBB0_15
; %bb.5:
	add	x0, x8, #16
	bl	_SpinLockAcquire
	ldr	x8, [x23]
	ldr	x0, [x8, #8]
	tbnz	x0, #63, LBB0_14
; %bb.6:
Lloh5:
	adrp	x24, _FREENEXT_NOT_IN_LIST@GOTPAGE
Lloh6:
	ldr	x24, [x24, _FREENEXT_NOT_IN_LIST@GOTPAGEOFF]
	b	LBB0_8
LBB0_7:                                 ;   in Loop: Header=BB0_8 Depth=1
	mov	x0, x21
	mov	x1, x22
	bl	_UnlockBufHdr
	ldr	x8, [x23]
	add	x0, x8, #16
	bl	_SpinLockAcquire
	ldr	x8, [x23]
	ldr	x0, [x8, #8]
	tbnz	x0, #63, LBB0_14
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	bl	_GetBufferDescriptor
	mov	x21, x0
	ldr	x8, [x0]
	ldr	x9, [x24]
	cmp	x8, x9
	cset	w0, ne
	bl	_Assert
	ldr	x8, [x21]
	ldr	x9, [x23]
	str	x8, [x9, #8]
	ldr	x8, [x24]
	str	x8, [x21]
	add	x0, x9, #16
	bl	_SpinLockRelease
	mov	x0, x21
	bl	_LockBufHdr
	mov	x22, x0
	bl	_BUF_STATE_GET_REFCOUNT
	cbnz	x0, LBB0_7
; %bb.9:                                ;   in Loop: Header=BB0_8 Depth=1
	mov	x0, x22
	bl	_BUF_STATE_GET_USAGECOUNT
	cbnz	x0, LBB0_7
LBB0_10:
	cbz	x20, LBB0_12
; %bb.11:
	mov	x0, x20
	mov	x1, x21
	bl	_AddBufferToRing
LBB0_12:
	str	w22, [x19]
LBB0_13:
	mov	x0, x21
	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_14:
	add	x0, x8, #16
	bl	_SpinLockRelease
LBB0_15:
Lloh7:
	adrp	x24, _NBuffers@GOTPAGE
Lloh8:
	ldr	x24, [x24, _NBuffers@GOTPAGEOFF]
	ldr	w27, [x24]
Lloh9:
	adrp	x25, _BUF_USAGECOUNT_ONE@GOTPAGE
Lloh10:
	ldr	x25, [x25, _BUF_USAGECOUNT_ONE@GOTPAGEOFF]
Lloh11:
	adrp	x26, _ERROR@GOTPAGE
Lloh12:
	ldr	x26, [x26, _ERROR@GOTPAGEOFF]
Lloh13:
	adrp	x23, l_.str@PAGE
Lloh14:
	add	x23, x23, l_.str@PAGEOFF
	b	LBB0_19
LBB0_16:                                ;   in Loop: Header=BB0_19 Depth=1
	mov	x0, x22
	bl	_BUF_STATE_GET_USAGECOUNT
	cbz	x0, LBB0_10
; %bb.17:                               ;   in Loop: Header=BB0_19 Depth=1
	ldr	w8, [x25]
	sub	w22, w22, w8
	ldr	w27, [x24]
LBB0_18:                                ;   in Loop: Header=BB0_19 Depth=1
	mov	x0, x21
	mov	x1, x22
	bl	_UnlockBufHdr
LBB0_19:                                ; =>This Inner Loop Header: Depth=1
	bl	_ClockSweepTick
	bl	_GetBufferDescriptor
	mov	x21, x0
	bl	_LockBufHdr
	mov	x22, x0
	bl	_BUF_STATE_GET_REFCOUNT
	cbz	x0, LBB0_16
; %bb.20:                               ;   in Loop: Header=BB0_19 Depth=1
	subs	w27, w27, #1
	b.ne	LBB0_18
; %bb.21:                               ;   in Loop: Header=BB0_19 Depth=1
	mov	x0, x21
	mov	x1, x22
	bl	_UnlockBufHdr
	ldr	w0, [x26]
	mov	x1, x23
	bl	_elog
	b	LBB0_18
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_StrategyControl,8,3            ; @StrategyControl
	.comm	_ProcGlobal,8,3                 ; @ProcGlobal
	.comm	_FREENEXT_NOT_IN_LIST,8,3       ; @FREENEXT_NOT_IN_LIST
	.comm	_NBuffers,4,2                   ; @NBuffers
	.comm	_BUF_USAGECOUNT_ONE,8,3         ; @BUF_USAGECOUNT_ONE
	.comm	_ERROR,4,2                      ; @ERROR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"no unpinned buffers available"

.subsections_via_symbols
