	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function GetLocalBufferStorage
_GetLocalBufferStorage:                 ## @GetLocalBufferStorage
	.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
	movl	_GetLocalBufferStorage.total_bufs_allocated(%rip), %eax
	movq	_NLocBuffer@GOTPCREL(%rip), %rbx
	xorl	%edi, %edi
	cmpl	(%rbx), %eax
	setl	%dil
	callq	_Assert
	movl	_GetLocalBufferStorage.next_buf_in_block(%rip), %ecx
	movl	_GetLocalBufferStorage.num_bufs_in_block(%rip), %edi
	cmpl	%edi, %ecx
	jge	LBB0_2
## %bb.1:
	movq	_GetLocalBufferStorage.cur_block(%rip), %rax
	jmp	LBB0_5
LBB0_2:
	cmpq	$0, _GetLocalBufferStorage.LocalBufferContext(%rip)
	jne	LBB0_4
## %bb.3:
	movq	_TopMemoryContext@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_ALLOCSET_DEFAULT_SIZES@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	L_.str(%rip), %rsi
	callq	_AllocSetContextCreate
	movq	%rax, _GetLocalBufferStorage.LocalBufferContext(%rip)
	movl	_GetLocalBufferStorage.num_bufs_in_block(%rip), %edi
LBB0_4:
	addl	%edi, %edi
	movl	$16, %esi
	callq	_Max
	movl	(%rbx), %esi
	subl	_GetLocalBufferStorage.total_bufs_allocated(%rip), %esi
	movl	%eax, %edi
	callq	_Min
	movl	%eax, %edi
	movq	_MaxAllocSize@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	_BLCKSZ@GOTPCREL(%rip), %r14
	cltd
	idivl	(%r14)
	movl	%eax, %esi
	callq	_Min
	movl	%eax, %ebx
	movq	_GetLocalBufferStorage.LocalBufferContext(%rip), %rdi
	movl	(%r14), %esi
	imull	%eax, %esi
	callq	_MemoryContextAlloc
	movq	%rax, _GetLocalBufferStorage.cur_block(%rip)
	movl	%ebx, _GetLocalBufferStorage.num_bufs_in_block(%rip)
	xorl	%ecx, %ecx
LBB0_5:
	movq	_BLCKSZ@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	imull	%ecx, %edx
	addl	%edx, %eax
	incl	%ecx
	movl	%ecx, _GetLocalBufferStorage.next_buf_in_block(%rip)
	incl	_GetLocalBufferStorage.total_bufs_allocated(%rip)
                                        ## kill: def $eax killed $eax killed $rax
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
.zerofill __DATA,__bss,_GetLocalBufferStorage.cur_block,8,3 ## @GetLocalBufferStorage.cur_block
.zerofill __DATA,__bss,_GetLocalBufferStorage.next_buf_in_block,4,2 ## @GetLocalBufferStorage.next_buf_in_block
.zerofill __DATA,__bss,_GetLocalBufferStorage.num_bufs_in_block,4,2 ## @GetLocalBufferStorage.num_bufs_in_block
.zerofill __DATA,__bss,_GetLocalBufferStorage.total_bufs_allocated,4,2 ## @GetLocalBufferStorage.total_bufs_allocated
.zerofill __DATA,__bss,_GetLocalBufferStorage.LocalBufferContext,8,3 ## @GetLocalBufferStorage.LocalBufferContext
	.comm	_NLocBuffer,4,2                 ## @NLocBuffer
	.comm	_TopMemoryContext,4,2           ## @TopMemoryContext
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"LocalBufferContext"

	.comm	_ALLOCSET_DEFAULT_SIZES,4,2     ## @ALLOCSET_DEFAULT_SIZES
	.comm	_MaxAllocSize,4,2               ## @MaxAllocSize
	.comm	_BLCKSZ,4,2                     ## @BLCKSZ
	.no_dead_strip	_GetLocalBufferStorage
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function GetLocalBufferStorage
_GetLocalBufferStorage:                 ; @GetLocalBufferStorage
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	adrp	x20, _GetLocalBufferStorage.total_bufs_allocated@PAGE
	ldr	w8, [x20, _GetLocalBufferStorage.total_bufs_allocated@PAGEOFF]
Lloh0:
	adrp	x19, _NLocBuffer@GOTPAGE
Lloh1:
	ldr	x19, [x19, _NLocBuffer@GOTPAGEOFF]
	ldr	w9, [x19]
	cmp	w8, w9
	cset	w0, lt
	bl	_Assert
	adrp	x21, _GetLocalBufferStorage.next_buf_in_block@PAGE
	ldr	w8, [x21, _GetLocalBufferStorage.next_buf_in_block@PAGEOFF]
	adrp	x23, _GetLocalBufferStorage.num_bufs_in_block@PAGE
	ldr	w9, [x23, _GetLocalBufferStorage.num_bufs_in_block@PAGEOFF]
Lloh2:
	adrp	x22, _BLCKSZ@GOTPAGE
Lloh3:
	ldr	x22, [x22, _BLCKSZ@GOTPAGEOFF]
	cmp	w8, w9
	b.ge	LBB0_2
; %bb.1:
Lloh4:
	adrp	x9, _GetLocalBufferStorage.cur_block@PAGE
Lloh5:
	ldr	x0, [x9, _GetLocalBufferStorage.cur_block@PAGEOFF]
	b	LBB0_5
LBB0_2:
	adrp	x24, _GetLocalBufferStorage.LocalBufferContext@PAGE
	ldr	x8, [x24, _GetLocalBufferStorage.LocalBufferContext@PAGEOFF]
	cbnz	x8, LBB0_4
; %bb.3:
Lloh6:
	adrp	x8, _TopMemoryContext@GOTPAGE
Lloh7:
	ldr	x8, [x8, _TopMemoryContext@GOTPAGEOFF]
Lloh8:
	ldr	w0, [x8]
Lloh9:
	adrp	x8, _ALLOCSET_DEFAULT_SIZES@GOTPAGE
Lloh10:
	ldr	x8, [x8, _ALLOCSET_DEFAULT_SIZES@GOTPAGEOFF]
Lloh11:
	ldr	w2, [x8]
Lloh12:
	adrp	x1, l_.str@PAGE
Lloh13:
	add	x1, x1, l_.str@PAGEOFF
	bl	_AllocSetContextCreate
	str	x0, [x24, _GetLocalBufferStorage.LocalBufferContext@PAGEOFF]
	ldr	w9, [x23, _GetLocalBufferStorage.num_bufs_in_block@PAGEOFF]
LBB0_4:
	lsl	w0, w9, #1
	mov	w1, #16
	bl	_Max
	ldr	w8, [x19]
	ldr	w9, [x20, _GetLocalBufferStorage.total_bufs_allocated@PAGEOFF]
	sub	w1, w8, w9
	bl	_Min
Lloh14:
	adrp	x8, _MaxAllocSize@GOTPAGE
Lloh15:
	ldr	x8, [x8, _MaxAllocSize@GOTPAGEOFF]
Lloh16:
	ldr	w8, [x8]
	ldr	w9, [x22]
	sdiv	w1, w8, w9
	bl	_Min
	mov	x19, x0
	ldr	x0, [x24, _GetLocalBufferStorage.LocalBufferContext@PAGEOFF]
	ldr	w8, [x22]
	mul	w1, w8, w19
	bl	_MemoryContextAlloc
	mov	w8, #0
	adrp	x9, _GetLocalBufferStorage.cur_block@PAGE
	str	x0, [x9, _GetLocalBufferStorage.cur_block@PAGEOFF]
	str	w19, [x23, _GetLocalBufferStorage.num_bufs_in_block@PAGEOFF]
LBB0_5:
	ldr	w9, [x22]
	madd	w0, w9, w8, w0
	add	w8, w8, #1
	str	w8, [x21, _GetLocalBufferStorage.next_buf_in_block@PAGEOFF]
	ldr	w8, [x20, _GetLocalBufferStorage.total_bufs_allocated@PAGEOFF]
	add	w8, w8, #1
	str	w8, [x20, _GetLocalBufferStorage.total_bufs_allocated@PAGEOFF]
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdr	Lloh4, Lloh5
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
.zerofill __DATA,__bss,_GetLocalBufferStorage.cur_block,8,3 ; @GetLocalBufferStorage.cur_block
.zerofill __DATA,__bss,_GetLocalBufferStorage.next_buf_in_block,4,2 ; @GetLocalBufferStorage.next_buf_in_block
.zerofill __DATA,__bss,_GetLocalBufferStorage.num_bufs_in_block,4,2 ; @GetLocalBufferStorage.num_bufs_in_block
.zerofill __DATA,__bss,_GetLocalBufferStorage.total_bufs_allocated,4,2 ; @GetLocalBufferStorage.total_bufs_allocated
.zerofill __DATA,__bss,_GetLocalBufferStorage.LocalBufferContext,8,3 ; @GetLocalBufferStorage.LocalBufferContext
	.comm	_NLocBuffer,4,2                 ; @NLocBuffer
	.comm	_TopMemoryContext,4,2           ; @TopMemoryContext
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"LocalBufferContext"

	.comm	_ALLOCSET_DEFAULT_SIZES,4,2     ; @ALLOCSET_DEFAULT_SIZES
	.comm	_MaxAllocSize,4,2               ; @MaxAllocSize
	.comm	_BLCKSZ,4,2                     ; @BLCKSZ
	.no_dead_strip	_GetLocalBufferStorage
.subsections_via_symbols
