	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function php_stream_memory_write
_php_stream_memory_write:               ## @php_stream_memory_write
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r15
	movq	%rsi, %r14
	movq	(%rdi), %rbx
	xorl	%edi, %edi
	testq	%rbx, %rbx
	setne	%dil
	callq	_assert
	movl	(%rbx), %eax
	movq	_TEMP_STREAM_READONLY@GOTPCREL(%rip), %rdx
	movq	$-1, %rcx
	testl	%eax, (%rdx)
	jne	LBB0_12
## %bb.1:
	movq	_TEMP_STREAM_APPEND@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_2
## %bb.3:
	movq	16(%rbx), %rcx
	movq	%rcx, 8(%rbx)
	movq	%rcx, %rsi
	jmp	LBB0_4
LBB0_2:
	movq	8(%rbx), %rsi
	movq	16(%rbx), %rcx
LBB0_4:
	addq	%r15, %rsi
	movq	24(%rbx), %rax
	cmpq	%rcx, %rsi
	jbe	LBB0_9
## %bb.5:
	testq	%rax, %rax
	je	LBB0_6
## %bb.7:
	movq	%rax, %rdi
	callq	_erealloc
	jmp	LBB0_8
LBB0_6:
	movq	%rsi, %rdi
	callq	_emalloc
LBB0_8:
	movq	%rax, 24(%rbx)
	movq	8(%rbx), %rcx
	addq	%r15, %rcx
	movq	%rcx, 16(%rbx)
LBB0_9:
	xorl	%ecx, %ecx
	testq	%r15, %r15
	je	LBB0_12
## %bb.10:
	testq	%rax, %rax
	je	LBB0_12
## %bb.11:
	xorl	%edi, %edi
	testq	%r14, %r14
	setne	%dil
	callq	_assert
	movq	24(%rbx), %rdi
	addq	8(%rbx), %rdi
	movq	%r14, %rsi
	movq	%r15, %rdx
	callq	_memcpy
	addq	%r15, 8(%rbx)
	movq	%r15, %rcx
LBB0_12:
	movq	%rcx, %rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_TEMP_STREAM_READONLY,4,2       ## @TEMP_STREAM_READONLY
	.comm	_TEMP_STREAM_APPEND,4,2         ## @TEMP_STREAM_APPEND
	.no_dead_strip	_php_stream_memory_write
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function php_stream_memory_write
_php_stream_memory_write:               ; @php_stream_memory_write
	.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, x2
	mov	x20, x1
	ldr	x21, [x0]
	cmp	x21, #0
	cset	w0, ne
	bl	_assert
	ldr	w8, [x21]
Lloh0:
	adrp	x9, _TEMP_STREAM_READONLY@GOTPAGE
Lloh1:
	ldr	x9, [x9, _TEMP_STREAM_READONLY@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_2
; %bb.1:
	mov	x8, #-1
	b	LBB0_13
LBB0_2:
Lloh3:
	adrp	x9, _TEMP_STREAM_APPEND@GOTPAGE
Lloh4:
	ldr	x9, [x9, _TEMP_STREAM_APPEND@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_4
; %bb.3:
	ldr	x8, [x21, #16]
	str	x8, [x21, #8]
	mov	x9, x8
	b	LBB0_5
LBB0_4:
	ldp	x9, x8, [x21, #8]
LBB0_5:
	ldr	x0, [x21, #24]
	add	x1, x9, x19
	cmp	x1, x8
	b.ls	LBB0_10
; %bb.6:
	cbz	x0, LBB0_8
; %bb.7:
	bl	_erealloc
	b	LBB0_9
LBB0_8:
	mov	x0, x1
	bl	_emalloc
LBB0_9:
	ldr	x8, [x21, #8]
	add	x8, x8, x19
	stp	x8, x0, [x21, #16]
LBB0_10:
	mov	x8, #0
	cbz	x19, LBB0_13
; %bb.11:
	cbz	x0, LBB0_13
; %bb.12:
	cmp	x20, #0
	cset	w0, ne
	bl	_assert
	ldr	x8, [x21, #24]
	ldr	x9, [x21, #8]
	add	x0, x8, x9
	mov	x1, x20
	mov	x2, x19
	bl	_memcpy
	ldr	x8, [x21, #8]
	add	x8, x8, x19
	str	x8, [x21, #8]
	mov	x8, x19
LBB0_13:
	mov	x0, x8
	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	_TEMP_STREAM_READONLY,4,2       ; @TEMP_STREAM_READONLY
	.comm	_TEMP_STREAM_APPEND,4,2         ; @TEMP_STREAM_APPEND
	.no_dead_strip	_php_stream_memory_write
.subsections_via_symbols
