	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function lazy_space_alloc
_lazy_space_alloc:                      ## @lazy_space_alloc
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rsi, %r14
	movq	%rdi, %rbx
	xorl	%eax, %eax
	callq	_IsAutoVacuumWorkerProcess
	cmpq	$0, 24(%rbx)
	je	LBB0_5
## %bb.1:
	movq	_autovacuum_work_mem@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	cmpl	$-1, %ecx
	movq	_maintenance_work_mem@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	cmovel	%edx, %ecx
	testq	%rax, %rax
	cmovel	%edx, %ecx
	movslq	%ecx, %rax
	shlq	$8, %rax
	movabsq	$4611686018427387648, %rdi      ## imm = 0x3FFFFFFFFFFFFF00
	andq	%rax, %rdi
	movq	_INT_MAX@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_Min
	movq	_MaxAllocSize@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	sarl	$2, %esi
	movq	%rax, %rdi
	callq	_Min
	movq	%rax, %rdi
	movq	_LAZY_ALLOC_TUPLES@GOTPCREL(%rip), %rax
	movq	(%rax), %rcx
	movq	%rdi, %rax
	orq	%rcx, %rax
	shrq	$32, %rax
	je	LBB0_2
## %bb.3:
	movq	%rdi, %rax
	cqto
	idivq	%rcx
	jmp	LBB0_4
LBB0_5:
	movq	_MaxHeapTuplesPerPage@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	jmp	LBB0_6
LBB0_2:
	movl	%edi, %eax
	xorl	%edx, %edx
	divl	%ecx
                                        ## kill: def $eax killed $eax def $rax
LBB0_4:
	imulq	%r14, %rcx
	cmpq	%r14, %rax
	cmovgq	%rcx, %rdi
	movq	_MaxHeapTuplesPerPage@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	callq	_Max
	movq	%rax, %rdi
LBB0_6:
	movq	$0, 16(%rbx)
	movl	%edi, (%rbx)
	shlq	$2, %rdi
	callq	_palloc
	movq	%rax, 8(%rbx)
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_autovacuum_work_mem,4,2        ## @autovacuum_work_mem
	.comm	_maintenance_work_mem,4,2       ## @maintenance_work_mem
	.comm	_INT_MAX,4,2                    ## @INT_MAX
	.comm	_MaxAllocSize,4,2               ## @MaxAllocSize
	.comm	_LAZY_ALLOC_TUPLES,8,3          ## @LAZY_ALLOC_TUPLES
	.comm	_MaxHeapTuplesPerPage,8,3       ## @MaxHeapTuplesPerPage
	.no_dead_strip	_lazy_space_alloc
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function lazy_space_alloc
_lazy_space_alloc:                      ; @lazy_space_alloc
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x20, x1
	mov	x19, x0
	bl	_IsAutoVacuumWorkerProcess
	ldr	x8, [x19, #24]
	cbz	x8, LBB0_2
; %bb.1:
Lloh0:
	adrp	x8, _autovacuum_work_mem@GOTPAGE
Lloh1:
	ldr	x8, [x8, _autovacuum_work_mem@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmn	w8, #1
	ccmp	x0, #0, #4, ne
Lloh3:
	adrp	x9, _maintenance_work_mem@GOTPAGE
Lloh4:
	ldr	x9, [x9, _maintenance_work_mem@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	csel	w8, w8, w9, ne
	sxtw	x8, w8
	ubfiz	x0, x8, #8, #54
Lloh6:
	adrp	x8, _INT_MAX@GOTPAGE
Lloh7:
	ldr	x8, [x8, _INT_MAX@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	bl	_Min
Lloh9:
	adrp	x8, _MaxAllocSize@GOTPAGE
Lloh10:
	ldr	x8, [x8, _MaxAllocSize@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	asr	w1, w8, #2
	bl	_Min
Lloh12:
	adrp	x8, _LAZY_ALLOC_TUPLES@GOTPAGE
Lloh13:
	ldr	x8, [x8, _LAZY_ALLOC_TUPLES@GOTPAGEOFF]
Lloh14:
	ldr	x8, [x8]
	sdiv	x9, x0, x8
	mul	x8, x8, x20
	cmp	x9, x20
	csel	x0, x8, x0, gt
Lloh15:
	adrp	x8, _MaxHeapTuplesPerPage@GOTPAGE
Lloh16:
	ldr	x8, [x8, _MaxHeapTuplesPerPage@GOTPAGEOFF]
Lloh17:
	ldr	x1, [x8]
	bl	_Max
	b	LBB0_3
LBB0_2:
Lloh18:
	adrp	x8, _MaxHeapTuplesPerPage@GOTPAGE
Lloh19:
	ldr	x8, [x8, _MaxHeapTuplesPerPage@GOTPAGEOFF]
Lloh20:
	ldr	x0, [x8]
LBB0_3:
	str	xzr, [x19, #16]
	str	w0, [x19]
	lsl	x0, x0, #2
	bl	_palloc
	str	x0, [x19, #8]
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.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 AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
	.comm	_autovacuum_work_mem,4,2        ; @autovacuum_work_mem
	.comm	_maintenance_work_mem,4,2       ; @maintenance_work_mem
	.comm	_INT_MAX,4,2                    ; @INT_MAX
	.comm	_MaxAllocSize,4,2               ; @MaxAllocSize
	.comm	_LAZY_ALLOC_TUPLES,8,3          ; @LAZY_ALLOC_TUPLES
	.comm	_MaxHeapTuplesPerPage,8,3       ; @MaxHeapTuplesPerPage
	.no_dead_strip	_lazy_space_alloc
.subsections_via_symbols
