	.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, %r13d
	testq	%rsi, %rsi
	je	LBB0_11
## %bb.1:
	movq	%rsi, %rbx
	movq	(%rsi), %r14
	testq	%r14, %r14
	je	LBB0_11
## %bb.2:
	movl	%ecx, %r15d
	movq	%rdi, %r12
	movq	%rdx, -48(%rbp)                 ## 8-byte Spill
	movl	(%rdi), %edi
	movq	(%r14), %rsi
	callq	_is_in_base
	movl	(%r12), %edi
	movq	(%r14), %rsi
	testq	%rax, %rax
	je	LBB0_6
## %bb.3:
	subl	(%rsi), %edi
	cmpl	%r15d, %edi
	cmovgl	%edi, %r15d
	movq	40(%rsi), %rax
LBB0_4:
	movl	%r15d, %r13d
LBB0_5:
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	jmp	LBB0_10
LBB0_6:
	callq	_is_in_screen
	movl	(%r12), %edi
	movq	(%r14), %rsi
	testq	%rax, %rax
	je	LBB0_12
## %bb.7:
	subl	4(%rsi), %edi
	cmpl	%r15d, %edi
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	jle	LBB0_9
## %bb.8:
	movl	8(%rsi), %r15d
	subl	%edi, %r15d
LBB0_9:
	movq	32(%rsi), %rax
	movl	%r15d, %r13d
LBB0_10:
	movslq	%edi, %rdi
	addq	%rax, %rdi
	movq	%rcx, %rsi
	movl	%r13d, %edx
	callq	_memcpy
LBB0_11:
	movl	%r13d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_12:
	callq	_is_in_input
	testq	%rax, %rax
	je	LBB0_16
## %bb.13:
	movl	(%r12), %edi
	movq	(%r14), %rax
	subl	12(%rax), %edi
	cmpl	%r15d, %edi
	jle	LBB0_15
## %bb.14:
	movl	16(%rax), %r15d
	subl	%edi, %r15d
LBB0_15:
	movq	24(%rax), %rax
	jmp	LBB0_4
LBB0_16:
	movq	%rbx, %rdi
	callq	_RIOBFDBG_SZ
	movl	(%r12), %ecx
	movl	%eax, %r14d
	subl	%ecx, %r14d
	jle	LBB0_11
## %bb.17:
	addl	%r15d, %ecx
	cmpl	%eax, %ecx
	cmovll	%r15d, %r14d
	movq	%rbx, %rdi
	callq	_RIOBFDBG_BUF
	movl	(%r12), %edi
	movl	%r14d, %r13d
	jmp	LBB0_5
	.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
	cbz	x1, LBB0_15
; %bb.1:
	mov	x22, x1
	ldr	x23, [x1]
	cbz	x23, LBB0_15
; %bb.2:
	mov	x19, x3
	mov	x20, x2
	mov	x21, x0
	ldr	w0, [x0]
	ldr	x1, [x23]
	bl	_is_in_base
	mov	x8, x0
	ldr	w0, [x21]
	ldr	x1, [x23]
	cbz	x8, LBB0_4
; %bb.3:
	ldr	w8, [x1]
	sub	w8, w0, w8
	cmp	w8, w19
	csel	w19, w8, w19, gt
	ldr	x0, [x1, #40]
	b	LBB0_14
LBB0_4:
	bl	_is_in_screen
	mov	x8, x0
	ldr	w0, [x21]
	ldr	x1, [x23]
	cbz	x8, LBB0_8
; %bb.5:
	ldr	w8, [x1, #4]
	sub	w8, w0, w8
	cmp	w8, w19
	b.le	LBB0_7
; %bb.6:
	ldr	w9, [x1, #8]
	sub	w19, w9, w8
LBB0_7:
	ldr	x0, [x1, #32]
	b	LBB0_14
LBB0_8:
	bl	_is_in_input
	cbz	x0, LBB0_12
; %bb.9:
	ldr	w8, [x21]
	ldr	x9, [x23]
	ldr	w10, [x9, #12]
	sub	w8, w8, w10
	cmp	w8, w19
	b.le	LBB0_11
; %bb.10:
	ldr	w10, [x9, #16]
	sub	w19, w10, w8
LBB0_11:
	ldr	x0, [x9, #24]
	b	LBB0_14
LBB0_12:
	mov	x0, x22
	bl	_RIOBFDBG_SZ
	ldr	w9, [x21]
	subs	w8, w0, w9
	b.le	LBB0_15
; %bb.13:
	add	w9, w9, w19
	cmp	w9, w0
	csel	w19, w19, w8, lt
	mov	x0, x22
	bl	_RIOBFDBG_BUF
	ldr	w8, [x21]
LBB0_14:
	add	x0, x0, w8, sxtw
	mov	x1, x20
	mov	x2, x19
	bl	_memcpy
	b	LBB0_16
LBB0_15:
	mov	w19, #-1
LBB0_16:
	mov	x0, x19
	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
