	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function wmemstream_grow
_wmemstream_grow:                       ## @wmemstream_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	%rdi, %r14
	testl	%esi, %esi
	js	LBB0_1
## %bb.2:
	movl	%esi, %ebx
	movl	%esi, %ecx
	movq	_SSIZE_MAX@GOTPCREL(%rip), %rax
	movslq	(%rax), %rax
	movq	%rax, %rdx
	shrq	$2, %rdx
	cmpq	%rcx, %rdx
	jbe	LBB0_3
	jmp	LBB0_4
LBB0_1:
	movq	_SSIZE_MAX@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
LBB0_3:
	sarl	$2, %eax
	decl	%eax
	movl	%eax, %ebx
LBB0_4:
	movl	$1, %r15d
	cmpl	(%r14), %ebx
	jle	LBB0_8
## %bb.5:
	movq	8(%r14), %rax
	movq	(%rax), %rdi
	leal	1(%rbx), %esi
	movl	$4, %edx
	callq	_reallocarray
	testq	%rax, %rax
	je	LBB0_6
## %bb.7:
	movq	%rax, %r12
	movslq	(%r14), %rax
	leaq	(%r12,%rax,4), %rdi
	addq	$4, %rdi
	movl	%ebx, %edx
	subl	%eax, %edx
	xorl	%esi, %esi
	callq	_wmemset
	movq	8(%r14), %rax
	movq	%r12, (%rax)
	movl	%ebx, (%r14)
	jmp	LBB0_8
LBB0_6:
	xorl	%r15d, %r15d
LBB0_8:
	movl	%r15d, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SSIZE_MAX,4,2                  ## @SSIZE_MAX
	.comm	_stderr,4,2                     ## @stderr
	.no_dead_strip	_wmemstream_grow
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function wmemstream_grow
_wmemstream_grow:                       ; @wmemstream_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
	mov	x19, x0
	tbnz	w1, #31, LBB0_2
; %bb.1:
	mov	x20, x1
	mov	w9, w1
Lloh0:
	adrp	x8, _SSIZE_MAX@GOTPAGE
Lloh1:
	ldr	x8, [x8, _SSIZE_MAX@GOTPAGEOFF]
Lloh2:
	ldrsw	x8, [x8]
	cmp	x9, x8, lsr #2
	b.hs	LBB0_3
	b	LBB0_4
LBB0_2:
Lloh3:
	adrp	x8, _SSIZE_MAX@GOTPAGE
Lloh4:
	ldr	x8, [x8, _SSIZE_MAX@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
LBB0_3:
	asr	w8, w8, #2
	sub	w20, w8, #1
LBB0_4:
	ldr	w8, [x19]
	cmp	w20, w8
	b.le	LBB0_7
; %bb.5:
	ldr	x8, [x19, #8]
	ldr	x0, [x8]
	add	w1, w20, #1
	mov	w2, #4
	bl	_reallocarray
	cbz	x0, LBB0_8
; %bb.6:
	mov	x21, x0
	ldrsw	x8, [x19]
	add	x9, x0, x8, lsl #2
	add	x0, x9, #4
	sub	w2, w20, w8
	mov	w1, #0
	bl	_wmemset
	ldr	x8, [x19, #8]
	str	x21, [x8]
	str	w20, [x19]
LBB0_7:
	mov	w0, #1
LBB0_8:
	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
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_SSIZE_MAX,4,2                  ; @SSIZE_MAX
	.comm	_stderr,4,2                     ; @stderr
	.no_dead_strip	_wmemstream_grow
.subsections_via_symbols
