	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_prepare_write                  ## -- Begin function prepare_write
	.p2align	4, 0x90
_prepare_write:                         ## @prepare_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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -24
	movl	%edi, %ebx
	testl	%edi, %edi
	movq	_WRITE_THRESHOLD@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	cmovsl	%eax, %ebx
	testl	%ebx, %ebx
	setg	%cl
	cmpl	%eax, %ebx
	setle	%al
	andb	%cl, %al
	movzbl	%al, %edi
	callq	_assert
	movq	_wptr@GOTPCREL(%rip), %rdx
	movl	(%rdx), %ecx
	movq	_WB@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%ecx, %ecx
	jne	LBB0_2
## %bb.1:
	movq	_wst@GOTPCREL(%rip), %rcx
	movl	%eax, (%rcx)
	movl	%eax, (%rdx)
	movl	%eax, %ecx
LBB0_2:
	movq	_WRITE_BUFFER_SIZE@GOTPCREL(%rip), %rdx
	addl	(%rdx), %eax
	subl	%ecx, %eax
	cmpl	%ebx, %eax
	jge	LBB0_3
## %bb.4:
	xorl	%eax, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	jmp	_flush_out                      ## TAILCALL
LBB0_3:
	addq	$8, %rsp
	popq	%rbx
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_WRITE_THRESHOLD,4,2            ## @WRITE_THRESHOLD
	.comm	_wptr,4,2                       ## @wptr
	.comm	_WB,4,2                         ## @WB
	.comm	_wst,4,2                        ## @wst
	.comm	_WRITE_BUFFER_SIZE,4,2          ## @WRITE_BUFFER_SIZE
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_prepare_write                  ; -- Begin function prepare_write
	.p2align	2
_prepare_write:                         ; @prepare_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
Lloh0:
	adrp	x8, _WRITE_THRESHOLD@GOTPAGE
Lloh1:
	ldr	x8, [x8, _WRITE_THRESHOLD@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w0, #0
	csel	w19, w8, w0, lt
	cmp	w19, #0
	ccmp	w19, w8, #0, gt
	cset	w0, le
	bl	_assert
Lloh3:
	adrp	x10, _wptr@GOTPAGE
Lloh4:
	ldr	x10, [x10, _wptr@GOTPAGEOFF]
	ldr	w9, [x10]
Lloh5:
	adrp	x8, _WB@GOTPAGE
Lloh6:
	ldr	x8, [x8, _WB@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
	cbnz	w9, LBB0_2
; %bb.1:
Lloh8:
	adrp	x9, _wst@GOTPAGE
Lloh9:
	ldr	x9, [x9, _wst@GOTPAGEOFF]
Lloh10:
	str	w8, [x9]
	str	w8, [x10]
	mov	x9, x8
LBB0_2:
Lloh11:
	adrp	x10, _WRITE_BUFFER_SIZE@GOTPAGE
Lloh12:
	ldr	x10, [x10, _WRITE_BUFFER_SIZE@GOTPAGEOFF]
Lloh13:
	ldr	w10, [x10]
	add	w8, w10, w8
	sub	w8, w8, w9
	cmp	w8, w19
	b.ge	LBB0_4
; %bb.3:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_flush_out
LBB0_4:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotStr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.cfi_endproc
                                        ; -- End function
	.comm	_WRITE_THRESHOLD,4,2            ; @WRITE_THRESHOLD
	.comm	_wptr,4,2                       ; @wptr
	.comm	_WB,4,2                         ; @WB
	.comm	_wst,4,2                        ; @wst
	.comm	_WRITE_BUFFER_SIZE,4,2          ; @WRITE_BUFFER_SIZE
.subsections_via_symbols
