	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_tree_ifwrite                   ## -- Begin function tree_ifwrite
	.p2align	4, 0x90
_tree_ifwrite:                          ## @tree_ifwrite
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	_Rt@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rax
	movq	_Rmax@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jae	LBB0_4
## %bb.1:
	movq	%rdi, %rbx
	movq	_RR@GOTPCREL(%rip), %rsi
	movq	(%rsi), %rsi
	movq	(%rsi,%rax,8), %rsi
	movq	_Rpos@GOTPCREL(%rip), %r8
	movq	(%r8), %rdi
	cmpq	%rdi, %rsi
	jne	LBB0_5
## %bb.2:
	incq	%rax
	movq	%rax, (%rdx)
	incq	%rsi
	movq	%rsi, (%r8)
	movl	(%rbx), %edx
	movl	4(%rbx), %esi
	addl	%edx, %esi
	addl	$2, %esi
	movq	_Bsize@GOTPCREL(%rip), %r14
	cmpl	(%r14), %esi
	jge	LBB0_8
## %bb.3:
	movq	_B@GOTPCREL(%rip), %r15
	movq	(%r15), %rdi
	movl	%edx, (%rdi)
	addq	$4, %rdi
	movl	(%rbx), %edx
	movl	12(%rbx), %esi
	shll	$2, %edx
	callq	_memcpy
	movslq	(%rbx), %rax
	movq	(%r15), %rcx
	leaq	(%rcx,%rax,4), %rdx
	addq	$4, %rdx
	movq	%rdx, (%r15)
	movl	4(%rbx), %edx
	movl	%edx, 4(%rcx,%rax,4)
	leaq	(%rcx,%rax,4), %rdi
	addq	$8, %rdi
	movl	4(%rbx), %edx
	movl	8(%rbx), %esi
	shll	$2, %edx
	callq	_memcpy
	movslq	4(%rbx), %rax
	movq	(%r15), %rcx
	leaq	(%rcx,%rax,4), %rcx
	addq	$4, %rcx
	movq	%rcx, (%r15)
	movl	(%r14), %ecx
	movl	(%rbx), %edx
	addl	%eax, %edx
	negl	%edx
	leal	(%rcx,%rdx), %eax
	addl	$-2, %eax
	movl	%eax, (%r14)
	jmp	LBB0_6
LBB0_4:
	movq	_Rpos@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
LBB0_5:
	incq	%rdi
	movq	_Rpos@GOTPCREL(%rip), %rax
	movq	%rdi, (%rax)
LBB0_6:
	xorl	%eax, %eax
LBB0_7:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	movq	%rax, (%rcx)
	movl	$-1, %eax
	jmp	LBB0_7
	.cfi_endproc
                                        ## -- End function
	.comm	_Rt,8,3                         ## @Rt
	.comm	_Rmax,8,3                       ## @Rmax
	.comm	_RR,8,3                         ## @RR
	.comm	_Rpos,8,3                       ## @Rpos
	.comm	_Bsize,4,2                      ## @Bsize
	.comm	_B,8,3                          ## @B
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_tree_ifwrite                   ; -- Begin function tree_ifwrite
	.p2align	2
_tree_ifwrite:                          ; @tree_ifwrite
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
Lloh0:
	adrp	x10, _Rt@GOTPAGE
Lloh1:
	ldr	x10, [x10, _Rt@GOTPAGEOFF]
	ldr	x11, [x10]
Lloh2:
	adrp	x8, _Rmax@GOTPAGE
Lloh3:
	ldr	x8, [x8, _Rmax@GOTPAGEOFF]
	ldr	x12, [x8]
Lloh4:
	adrp	x9, _Rpos@GOTPAGE
Lloh5:
	ldr	x9, [x9, _Rpos@GOTPAGEOFF]
	cmp	x11, x12
	b.hs	LBB0_4
; %bb.1:
Lloh6:
	adrp	x12, _RR@GOTPAGE
Lloh7:
	ldr	x12, [x12, _RR@GOTPAGEOFF]
Lloh8:
	ldr	x12, [x12]
	ldr	x13, [x12, x11, lsl #3]
	ldr	x12, [x9]
	cmp	x13, x12
	b.ne	LBB0_5
; %bb.2:
	mov	x19, x0
	add	x11, x11, #1
	str	x11, [x10]
	add	x10, x13, #1
	str	x10, [x9]
	ldp	w9, w10, [x0]
	add	w10, w9, w10
	add	w10, w10, #2
Lloh9:
	adrp	x20, _Bsize@GOTPAGE
Lloh10:
	ldr	x20, [x20, _Bsize@GOTPAGEOFF]
	ldr	w12, [x20]
	cmp	w10, w12
	b.ge	LBB0_7
; %bb.3:
Lloh11:
	adrp	x21, _B@GOTPAGE
Lloh12:
	ldr	x21, [x21, _B@GOTPAGEOFF]
	ldr	x0, [x21]
	str	w9, [x0], #4
	ldr	w1, [x19, #12]
	ldr	w8, [x19]
	lsl	w2, w8, #2
	bl	_memcpy
	ldr	x8, [x21]
	ldp	w9, w10, [x19]
                                        ; kill: def $w9 killed $w9 def $x9
	sxtw	x9, w9
	add	x8, x8, x9, lsl #2
	str	w10, [x8, #4]!
	str	x8, [x21]
	add	x0, x8, #4
	ldp	w8, w1, [x19, #4]
	lsl	w2, w8, #2
	bl	_memcpy
	mov	w0, #0
	ldp	w9, w8, [x19]
	add	w10, w8, #1
	ldr	x11, [x21]
	add	x10, x11, w10, sxtw #2
	str	x10, [x21]
	ldr	w10, [x20]
	add	w8, w8, w9
	sub	w8, w10, w8
	sub	w8, w8, #2
	str	w8, [x20]
	b	LBB0_6
LBB0_4:
	ldr	x12, [x9]
LBB0_5:
	mov	w0, #0
	add	x8, x12, #1
	str	x8, [x9]
LBB0_6:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
LBB0_7:
	str	x11, [x8]
	mov	w0, #-1
	b	LBB0_6
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_Rt,8,3                         ; @Rt
	.comm	_Rmax,8,3                       ; @Rmax
	.comm	_RR,8,3                         ; @RR
	.comm	_Rpos,8,3                       ; @Rpos
	.comm	_Bsize,4,2                      ; @Bsize
	.comm	_B,8,3                          ; @B
.subsections_via_symbols
