	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_XLogEnsureRecordSpace          ## -- Begin function XLogEnsureRecordSpace
	.p2align	4, 0x90
_XLogEnsureRecordSpace:                 ## @XLogEnsureRecordSpace
	.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
	movl	%esi, %r14d
	movl	%edi, %ebx
	movq	_CritSectionCount@GOTPCREL(%rip), %rax
	xorl	%edi, %edi
	cmpq	$0, (%rax)
	sete	%dil
	callq	_Assert
	movq	_XLR_NORMAL_MAX_BLOCK_ID@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	cmpl	%ebx, %eax
	cmovgl	%eax, %ebx
	movq	_XLR_NORMAL_RDATAS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	cmpl	%r14d, %eax
	cmovgl	%eax, %r14d
	movq	_XLR_MAX_BLOCK_ID@GOTPCREL(%rip), %rax
	cmpl	(%rax), %ebx
	jle	LBB0_2
## %bb.1:
	movq	_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	callq	_elog
LBB0_2:
	movq	_max_registered_buffers@GOTPCREL(%rip), %r15
	cmpl	(%r15), %ebx
	jl	LBB0_4
## %bb.3:
	movq	_registered_buffers@GOTPCREL(%rip), %r12
	movq	(%r12), %rdi
	movl	%ebx, %r13d
	incl	%r13d
	leal	4(,%rbx,4), %esi
	callq	_repalloc
	movq	%rax, (%r12)
	movslq	(%r15), %rcx
	leaq	(%rax,%rcx,4), %rdi
	movl	%r13d, %edx
	subl	%ecx, %edx
	shll	$2, %edx
	xorl	%esi, %esi
	callq	_MemSet
	movl	%r13d, (%r15)
LBB0_4:
	movq	_max_rdatas@GOTPCREL(%rip), %rbx
	cmpl	(%rbx), %r14d
	jle	LBB0_6
## %bb.5:
	movq	_rdatas@GOTPCREL(%rip), %r15
	movq	(%r15), %rdi
	leal	(,%r14,4), %esi
	callq	_repalloc
	movq	%rax, (%r15)
	movl	%r14d, (%rbx)
LBB0_6:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_CritSectionCount,8,3           ## @CritSectionCount
	.comm	_XLR_NORMAL_MAX_BLOCK_ID,4,2    ## @XLR_NORMAL_MAX_BLOCK_ID
	.comm	_XLR_NORMAL_RDATAS,4,2          ## @XLR_NORMAL_RDATAS
	.comm	_XLR_MAX_BLOCK_ID,4,2           ## @XLR_MAX_BLOCK_ID
	.comm	_ERROR,4,2                      ## @ERROR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"maximum number of WAL record block references exceeded"

	.comm	_max_registered_buffers,4,2     ## @max_registered_buffers
	.comm	_registered_buffers,8,3         ## @registered_buffers
	.comm	_max_rdatas,4,2                 ## @max_rdatas
	.comm	_rdatas,8,3                     ## @rdatas
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_XLogEnsureRecordSpace          ; -- Begin function XLogEnsureRecordSpace
	.p2align	2
_XLogEnsureRecordSpace:                 ; @XLogEnsureRecordSpace
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x19, x1
	mov	x20, x0
Lloh0:
	adrp	x8, _CritSectionCount@GOTPAGE
Lloh1:
	ldr	x8, [x8, _CritSectionCount@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cmp	x8, #0
	cset	w0, eq
	bl	_Assert
Lloh3:
	adrp	x8, _XLR_NORMAL_MAX_BLOCK_ID@GOTPAGE
Lloh4:
	ldr	x8, [x8, _XLR_NORMAL_MAX_BLOCK_ID@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	cmp	w8, w20
	csel	w21, w8, w20, gt
Lloh6:
	adrp	x8, _XLR_NORMAL_RDATAS@GOTPAGE
Lloh7:
	ldr	x8, [x8, _XLR_NORMAL_RDATAS@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	cmp	w8, w19
	csel	w19, w8, w19, gt
Lloh9:
	adrp	x8, _XLR_MAX_BLOCK_ID@GOTPAGE
Lloh10:
	ldr	x8, [x8, _XLR_MAX_BLOCK_ID@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	cmp	w21, w8
	b.le	LBB0_2
; %bb.1:
Lloh12:
	adrp	x8, _ERROR@GOTPAGE
Lloh13:
	ldr	x8, [x8, _ERROR@GOTPAGEOFF]
Lloh14:
	ldr	w0, [x8]
Lloh15:
	adrp	x1, l_.str@PAGE
Lloh16:
	add	x1, x1, l_.str@PAGEOFF
	bl	_elog
LBB0_2:
Lloh17:
	adrp	x20, _max_registered_buffers@GOTPAGE
Lloh18:
	ldr	x20, [x20, _max_registered_buffers@GOTPAGEOFF]
	ldr	w8, [x20]
	cmp	w21, w8
	b.lt	LBB0_4
; %bb.3:
	add	w21, w21, #1
Lloh19:
	adrp	x22, _registered_buffers@GOTPAGE
Lloh20:
	ldr	x22, [x22, _registered_buffers@GOTPAGEOFF]
	ldr	x0, [x22]
	lsl	w1, w21, #2
	bl	_repalloc
	str	x0, [x22]
	ldrsw	x8, [x20]
	add	x0, x0, x8, lsl #2
	sub	w8, w21, w8
	lsl	w2, w8, #2
	mov	w1, #0
	bl	_MemSet
	str	w21, [x20]
LBB0_4:
Lloh21:
	adrp	x20, _max_rdatas@GOTPAGE
Lloh22:
	ldr	x20, [x20, _max_rdatas@GOTPAGEOFF]
	ldr	w8, [x20]
	cmp	w19, w8
	b.le	LBB0_6
; %bb.5:
Lloh23:
	adrp	x21, _rdatas@GOTPAGE
Lloh24:
	ldr	x21, [x21, _rdatas@GOTPAGEOFF]
	ldr	x0, [x21]
	lsl	w1, w19, #2
	bl	_repalloc
	str	x0, [x21]
	str	w19, [x20]
LBB0_6:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh21, Lloh22
	.loh AdrpLdrGot	Lloh23, Lloh24
	.cfi_endproc
                                        ; -- End function
	.comm	_CritSectionCount,8,3           ; @CritSectionCount
	.comm	_XLR_NORMAL_MAX_BLOCK_ID,4,2    ; @XLR_NORMAL_MAX_BLOCK_ID
	.comm	_XLR_NORMAL_RDATAS,4,2          ; @XLR_NORMAL_RDATAS
	.comm	_XLR_MAX_BLOCK_ID,4,2           ; @XLR_MAX_BLOCK_ID
	.comm	_ERROR,4,2                      ; @ERROR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"maximum number of WAL record block references exceeded"

	.comm	_max_registered_buffers,4,2     ; @max_registered_buffers
	.comm	_registered_buffers,8,3         ; @registered_buffers
	.comm	_max_rdatas,4,2                 ; @max_rdatas
	.comm	_rdatas,8,3                     ; @rdatas
.subsections_via_symbols
