	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function __write
___write:                               ## @__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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	$-1, %r12d
	testq	%rsi, %rsi
	je	LBB0_9
## %bb.1:
	movq	%rdx, %r15
	testq	%rdx, %rdx
	je	LBB0_9
## %bb.2:
	movl	%ecx, %r14d
	testl	%ecx, %ecx
	js	LBB0_9
## %bb.3:
	movq	%rsi, %rbx
	cmpl	$0, (%rsi)
	je	LBB0_9
## %bb.4:
	movq	%rbx, %rdi
	callq	__io_malloc_off
	movq	%rax, %r13
	movq	%rbx, %rdi
	callq	__io_malloc_sz
	cmpq	%rax, %r13
	jg	LBB0_9
## %bb.5:
	movq	%rbx, %rdi
	callq	__io_malloc_off
	movq	%rax, %r13
	movl	%r14d, %eax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	addq	%rax, %r13
	movq	%rbx, %rdi
	callq	__io_malloc_sz
	cmpq	%rax, %r13
	jle	LBB0_7
## %bb.6:
	movq	%rbx, %rdi
	callq	__io_malloc_off
	movq	%rax, %r13
	movq	%rbx, %rdi
	callq	__io_malloc_sz
	addl	-48(%rbp), %r13d                ## 4-byte Folded Reload
	subl	%r13d, %eax
	addl	%r14d, %eax
	movl	%eax, %r14d
LBB0_7:
	testl	%r14d, %r14d
	jle	LBB0_9
## %bb.8:
	movq	%rbx, %rdi
	callq	__io_malloc_buf
	movq	%rax, %r12
	movq	%rbx, %rdi
	callq	__io_malloc_off
	addq	%rax, %r12
	movq	%r12, %rdi
	movq	%r15, %rsi
	movl	%r14d, %edx
	callq	_memcpy
	movq	%rbx, %rdi
	callq	__io_malloc_off
	movl	%r14d, %esi
	addq	%rax, %rsi
	movq	%rbx, %rdi
	callq	__io_malloc_set_off
	movl	%r14d, %r12d
LBB0_9:
	movl	%r12d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	___write
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function __write
___write:                               ; @__write
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	w21, #-1
	cbz	x1, LBB0_10
; %bb.1:
	mov	x20, x2
	cbz	x2, LBB0_10
; %bb.2:
	mov	x22, x3
	tbnz	w3, #31, LBB0_10
; %bb.3:
	mov	x19, x1
	ldr	w8, [x1]
	cbz	w8, LBB0_5
; %bb.4:
	mov	x0, x19
	bl	__io_malloc_off
	mov	x21, x0
	mov	x0, x19
	bl	__io_malloc_sz
	cmp	x21, x0
	b.le	LBB0_6
LBB0_5:
	mov	w21, #-1
	b	LBB0_10
LBB0_6:
	mov	x0, x19
	bl	__io_malloc_off
	mov	w23, w22
	add	x21, x0, x23
	mov	x0, x19
	bl	__io_malloc_sz
	cmp	x21, x0
	b.le	LBB0_8
; %bb.7:
	mov	x0, x19
	bl	__io_malloc_off
	mov	x21, x0
	mov	x0, x19
	bl	__io_malloc_sz
	add	w8, w21, w23
	sub	w8, w0, w8
	add	w21, w8, w22
	cmp	w21, #1
	b.ge	LBB0_9
	b	LBB0_5
LBB0_8:
	mov	x21, x22
	cmp	w21, #1
	b.lt	LBB0_5
LBB0_9:
	mov	x0, x19
	bl	__io_malloc_buf
	mov	x22, x0
	mov	x0, x19
	bl	__io_malloc_off
	add	x0, x0, x22
	mov	x1, x20
	mov	x2, x21
	bl	_memcpy
	mov	x0, x19
	bl	__io_malloc_off
	add	x1, x0, w21, uxtw
	mov	x0, x19
	bl	__io_malloc_set_off
LBB0_10:
	mov	x0, x21
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	___write
.subsections_via_symbols
