	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function memstream_grow
_memstream_grow:                        ## @memstream_grow
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	_SSIZE_MAX@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	leaq	-1(%rax), %rcx
	cmpq	%rsi, %rax
	movq	%rcx, %rbx
	cmovgq	%rsi, %rbx
	testq	%rsi, %rsi
	cmovsq	%rcx, %rbx
	movl	$1, %r14d
	cmpq	(%rdi), %rbx
	jle	LBB0_4
## %bb.1:
	movq	%rdi, %r12
	movq	8(%rdi), %rax
	movq	(%rax), %rdi
	leaq	1(%rbx), %rsi
	callq	_realloc
	testq	%rax, %rax
	je	LBB0_2
## %bb.3:
	movq	%rax, %r15
	movq	(%r12), %rax
	leaq	(%r15,%rax), %rdi
	incq	%rdi
	movq	%rbx, %rdx
	subq	%rax, %rdx
	xorl	%esi, %esi
	callq	_memset
	movq	8(%r12), %rax
	movq	%r15, (%rax)
	movq	%rbx, (%r12)
	jmp	LBB0_4
LBB0_2:
	xorl	%r14d, %r14d
LBB0_4:
	movl	%r14d, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SSIZE_MAX,8,3                  ## @SSIZE_MAX
	.comm	_stderr,4,2                     ## @stderr
	.no_dead_strip	_memstream_grow
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function memstream_grow
_memstream_grow:                        ; @memstream_grow
	.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
Lloh0:
	adrp	x8, _SSIZE_MAX@GOTPAGE
Lloh1:
	ldr	x8, [x8, _SSIZE_MAX@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	sub	x9, x8, #1
	cmp	x8, x1
	mov	x8, #-1
	ccmp	x1, x8, #4, gt
	csel	x21, x1, x9, gt
	ldr	x8, [x0]
	cmp	x21, x8
	b.le	LBB0_3
; %bb.1:
	mov	x19, x0
	ldr	x8, [x0, #8]
	ldr	x0, [x8]
	add	x1, x21, #1
	bl	_realloc
	cbz	x0, LBB0_4
; %bb.2:
	mov	x20, x0
	ldr	x8, [x19]
	add	x9, x0, x8
	add	x0, x9, #1
	sub	x2, x21, x8
	mov	w1, #0
	bl	_memset
	ldr	x8, [x19, #8]
	str	x20, [x8]
	str	x21, [x19]
LBB0_3:
	mov	w0, #1
LBB0_4:
	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	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_SSIZE_MAX,8,3                  ; @SSIZE_MAX
	.comm	_stderr,4,2                     ; @stderr
	.no_dead_strip	_memstream_grow
.subsections_via_symbols
