	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function fmemopen_write
_fmemopen_write:                        ## @fmemopen_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	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %r14
	movl	(%rdi), %ebx
	movslq	4(%rdi), %rdi
	subl	%edi, %ebx
	cmpl	%edx, %ebx
	cmovgel	%edx, %ebx
	testl	%ebx, %ebx
	je	LBB0_7
## %bb.1:
	addq	8(%r14), %rdi
	movl	%ebx, %edx
	callq	_memcpy
	movslq	4(%r14), %rcx
	movslq	%ebx, %rax
	addq	%rcx, %rax
	movl	%eax, 4(%r14)
	cmpl	16(%r14), %eax
	jle	LBB0_3
## %bb.2:
	movl	%eax, 16(%r14)
LBB0_3:
	cmpl	$0, 20(%r14)
	jne	LBB0_7
## %bb.4:
	cmpl	(%r14), %eax
	jge	LBB0_7
## %bb.5:
	movq	8(%r14), %rcx
	cmpb	$0, -1(%rax,%rcx)
	je	LBB0_7
## %bb.6:
	movb	$0, (%rcx,%rax)
LBB0_7:
	movl	%ebx, %eax
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_fmemopen_write
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function fmemopen_write
_fmemopen_write:                        ; @fmemopen_write
	.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
	ldp	w9, w8, [x0]
                                        ; kill: def $w8 killed $w8 def $x8
	sxtw	x8, w8
	sub	w9, w9, w8
	cmp	w9, w2
	csel	w19, w9, w2, lt
	cbz	w19, LBB0_7
; %bb.1:
	mov	x20, x0
	ldr	x9, [x0, #8]
	add	x0, x9, x8
	mov	x2, x19
	bl	_memcpy
	ldrsw	x8, [x20, #4]
	add	x8, x8, w19, sxtw
	str	w8, [x20, #4]
	ldr	w9, [x20, #16]
	cmp	w8, w9
	b.le	LBB0_3
; %bb.2:
	str	w8, [x20, #16]
LBB0_3:
	ldr	w9, [x20, #20]
	cbnz	w9, LBB0_7
; %bb.4:
	ldr	w9, [x20]
	cmp	w8, w9
	b.ge	LBB0_7
; %bb.5:
	ldr	x9, [x20, #8]
	add	x10, x8, x9
	ldurb	w10, [x10, #-1]
	cbz	w10, LBB0_7
; %bb.6:
	strb	wzr, [x9, x8]
LBB0_7:
	mov	x0, x19
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_fmemopen_write
.subsections_via_symbols
