	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function handle_write
_handle_write:                          ## @handle_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, %rbx
	movl	24(%rdi), %edi
	movq	(%rbx), %rdx
	movq	16(%rbx), %rsi
	callq	_write
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %r14
	movq	(%rbx), %rdx
	subq	%rax, %rdx
	jne	LBB0_3
## %bb.4:
	movq	$0, (%rbx)
	movq	16(%rbx), %rdi
	callq	_free
	movq	$0, 16(%rbx)
	movq	_WAITING_WRITE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	notl	%eax
	andl	%eax, 8(%rbx)
	jmp	LBB0_5
LBB0_1:
	movq	_WAITING_CLOSE@GOTPCREL(%rip), %rax
	movl	8(%rbx), %ecx
	orl	(%rax), %ecx
	movq	_WAITING_WRITE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	notl	%eax
	andl	%ecx, %eax
	movl	%eax, 8(%rbx)
	jmp	LBB0_5
LBB0_3:
	movq	16(%rbx), %rdi
	leaq	(%rdi,%r14,4), %rsi
	callq	_memmove
	subq	%r14, (%rbx)
LBB0_5:
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_WAITING_CLOSE,4,2              ## @WAITING_CLOSE
	.comm	_WAITING_WRITE,4,2              ## @WAITING_WRITE
	.no_dead_strip	_handle_write
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function handle_write
_handle_write:                          ; @handle_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
	mov	x19, x0
	ldr	w0, [x0, #24]
	ldr	x1, [x19, #16]
	ldr	x2, [x19]
	bl	_write
	cbz	x0, LBB0_3
; %bb.1:
	mov	x20, x0
	ldr	x8, [x19]
	subs	x2, x8, x0
	b.ne	LBB0_5
; %bb.2:
	str	xzr, [x19]
	ldr	x0, [x19, #16]
	bl	_free
	str	xzr, [x19, #16]
Lloh0:
	adrp	x8, _WAITING_WRITE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _WAITING_WRITE@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	ldr	w9, [x19, #8]
	bic	w8, w9, w8
	b	LBB0_4
LBB0_3:
Lloh3:
	adrp	x8, _WAITING_CLOSE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _WAITING_CLOSE@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	ldr	w9, [x19, #8]
	orr	w8, w9, w8
Lloh6:
	adrp	x9, _WAITING_WRITE@GOTPAGE
Lloh7:
	ldr	x9, [x9, _WAITING_WRITE@GOTPAGEOFF]
Lloh8:
	ldr	w9, [x9]
	bic	w8, w8, w9
LBB0_4:
	str	w8, [x19, #8]
	b	LBB0_6
LBB0_5:
	ldr	x0, [x19, #16]
	add	x1, x0, x20, lsl #2
	bl	_memmove
	ldr	x8, [x19]
	sub	x8, x8, x20
	str	x8, [x19]
LBB0_6:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_WAITING_CLOSE,4,2              ; @WAITING_CLOSE
	.comm	_WAITING_WRITE,4,2              ; @WAITING_WRITE
	.no_dead_strip	_handle_write
.subsections_via_symbols
