	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ce_write
_ce_write:                              ## @ce_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	%r13
	pushq	%r12
	pushq	%rbx
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, -44(%rbp)                 ## 4-byte Spill
	movq	%rdi, -56(%rbp)                 ## 8-byte Spill
	xorl	%eax, %eax
	testl	%ecx, %ecx
	je	LBB0_7
## %bb.1:
	movl	%ecx, %ebx
	movq	%rdx, %r15
	movq	_write_buffer_len@GOTPCREL(%rip), %r13
	movl	(%r13), %r12d
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_5:                                 ##   in Loop: Header=BB0_2 Depth=1
	movl	%r12d, (%r13)
	movl	%r14d, %eax
	addq	%rax, %r15
	subl	%r14d, %ebx
	je	LBB0_6
LBB0_2:                                 ## =>This Inner Loop Header: Depth=1
	movq	_WRITE_BUFFER_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	subl	%r12d, %r14d
	cmpl	%ebx, %r14d
	cmovael	%ebx, %r14d
	movl	%r12d, %edi
	movq	_write_buffer@GOTPCREL(%rip), %rax
	addq	(%rax), %rdi
	movq	%r15, %rsi
	movl	%r14d, %edx
	callq	_memcpy
	addl	%r14d, %r12d
	movq	_WRITE_BUFFER_SIZE@GOTPCREL(%rip), %rax
	cmpl	(%rax), %r12d
	jne	LBB0_5
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	%r12d, (%r13)
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	callq	_ce_write_flush
	xorl	%r12d, %r12d
	testq	%rax, %rax
	je	LBB0_5
## %bb.4:
	movl	$-1, %eax
	jmp	LBB0_7
LBB0_6:
	xorl	%eax, %eax
LBB0_7:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_write_buffer_len,4,2           ## @write_buffer_len
	.comm	_WRITE_BUFFER_SIZE,4,2          ## @WRITE_BUFFER_SIZE
	.comm	_write_buffer,8,3               ## @write_buffer
	.no_dead_strip	_ce_write
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ce_write
_ce_write:                              ; @ce_write
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	cbz	w3, LBB0_6
; %bb.1:
	mov	x19, x3
	mov	x20, x2
	mov	x21, x1
	mov	x22, x0
Lloh0:
	adrp	x24, _write_buffer_len@GOTPAGE
Lloh1:
	ldr	x24, [x24, _write_buffer_len@GOTPAGEOFF]
	ldr	w27, [x24]
Lloh2:
	adrp	x25, _WRITE_BUFFER_SIZE@GOTPAGE
Lloh3:
	ldr	x25, [x25, _WRITE_BUFFER_SIZE@GOTPAGEOFF]
Lloh4:
	adrp	x26, _write_buffer@GOTPAGE
Lloh5:
	ldr	x26, [x26, _write_buffer@GOTPAGEOFF]
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	str	w27, [x24]
	add	x20, x20, w23, uxtw
	subs	w19, w19, w23
	b.eq	LBB0_6
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w8, [x25]
	sub	w8, w8, w27
	cmp	w8, w19
	csel	w23, w8, w19, lo
	ldr	x8, [x26]
	add	x0, x8, w27, uxtw
	mov	x1, x20
	mov	x2, x23
	bl	_memcpy
	ldr	w8, [x25]
	add	w27, w23, w27
	cmp	w27, w8
	b.ne	LBB0_2
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	str	w27, [x24]
	mov	x0, x22
	mov	x1, x21
	bl	_ce_write_flush
	cbnz	x0, LBB0_7
; %bb.5:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	w27, #0
	b	LBB0_2
LBB0_6:
	mov	w0, #0
	b	LBB0_8
LBB0_7:
	mov	w0, #-1
LBB0_8:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.comm	_write_buffer_len,4,2           ; @write_buffer_len
	.comm	_WRITE_BUFFER_SIZE,4,2          ; @WRITE_BUFFER_SIZE
	.comm	_write_buffer,8,3               ; @write_buffer
	.no_dead_strip	_ce_write
.subsections_via_symbols
