	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_BuildTree_r                    ## -- Begin function BuildTree_r
	.p2align	4, 0x90
_BuildTree_r:                           ## @BuildTree_r
	.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
	subq	$24, %rsp
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movq	%rdi, %rbx
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -32(%rbp)
	movq	_numrecurse@GOTPCREL(%rip), %r15
	movl	(%r15), %esi
	leaq	L_.str(%rip), %rdi
	callq	_qprintf
	incl	(%r15)
	movq	_numthreads@GOTPCREL(%rip), %rax
	cmpl	$1, (%rax)
	jne	LBB0_4
## %bb.1:
	xorl	%eax, %eax
	callq	_WindingMemory
	movq	_c_nodememory@GOTPCREL(%rip), %rcx
	addl	(%rcx), %eax
	movq	_c_brushmemory@GOTPCREL(%rip), %rcx
	addl	(%rcx), %eax
	movq	_c_peak_totalbspmemory@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	jle	LBB0_3
## %bb.2:
	movl	%eax, (%rcx)
LBB0_3:
	movq	_c_nodes@GOTPCREL(%rip), %rax
	incl	(%rax)
LBB0_4:
	movq	_drawflag@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_6
## %bb.5:
	movq	%r14, %rdi
	movq	%rbx, %rsi
	callq	_DrawBrushList
LBB0_6:
	movq	%r14, %rdi
	movq	%rbx, %rsi
	callq	_SelectSplitSide
	testq	%rax, %rax
	je	LBB0_7
## %bb.12:
	movq	%rax, 32(%rbx)
	movl	(%rax), %eax
	andl	$-2, %eax
	movl	%eax, (%rbx)
	leaq	-40(%rbp), %rcx
	leaq	-48(%rbp), %rdx
	movq	%r14, %rdi
	movq	%rbx, %rsi
	callq	_SplitBrushList
	movq	%r14, %rdi
	callq	_FreeBrushList
	xorl	%eax, %eax
	callq	_AllocNode
	movq	%rbx, 24(%rax)
	movq	8(%rbx), %rcx
	movq	%rax, (%rcx)
	xorl	%eax, %eax
	callq	_AllocNode
	movq	%rbx, 24(%rax)
	movq	8(%rbx), %rcx
	movq	%rax, 8(%rcx)
	movq	16(%rbx), %rdi
	movl	(%rbx), %esi
	movq	8(%rbx), %rax
	movq	(%rax), %rdx
	movq	8(%rax), %rcx
	addq	$16, %rdx
	addq	$16, %rcx
	callq	_SplitBrush
	movq	_create_aas@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_15
## %bb.13:
	movq	16(%rbx), %rdi
	testq	%rdi, %rdi
	je	LBB0_15
## %bb.14:
	callq	_FreeBrush
	movq	$0, 16(%rbx)
LBB0_15:
	movq	8(%rbx), %rax
	movq	(%rax), %r14
	movq	-48(%rbp), %rsi
	movq	%r14, %rdi
	callq	_BuildTree_r
	movq	8(%rbx), %rax
	movq	%r14, (%rax)
	movq	8(%rbx), %rax
	movq	8(%rax), %r14
	movq	-40(%rbp), %rsi
	movq	%r14, %rdi
	callq	_BuildTree_r
	movq	8(%rbx), %rax
	movq	%r14, 8(%rax)
LBB0_16:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-32(%rbp), %rax
	jne	LBB0_18
## %bb.17:
	movq	%rbx, %rax
	addq	$24, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	movq	$0, 32(%rbx)
	movl	$-1, (%rbx)
	movq	%rbx, %rdi
	movq	%r14, %rsi
	callq	_LeafNode
	movq	_CONTENTS_SOLID@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, 4(%rbx)
	je	LBB0_9
## %bb.8:
	movq	_c_solidleafnodes@GOTPCREL(%rip), %rax
	incl	(%rax)
LBB0_9:
	movq	_create_aas@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_16
## %bb.10:
	movq	40(%rbx), %rdi
	callq	_FreeBrushList
	movq	$0, 40(%rbx)
	movq	16(%rbx), %rdi
	testq	%rdi, %rdi
	je	LBB0_16
## %bb.11:
	callq	_FreeBrush
	movq	$0, 16(%rbx)
	jmp	LBB0_16
LBB0_18:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"\r%6d"

	.comm	_numrecurse,4,2                 ## @numrecurse
	.comm	_numthreads,4,2                 ## @numthreads
	.comm	_c_nodememory,4,2               ## @c_nodememory
	.comm	_c_brushmemory,4,2              ## @c_brushmemory
	.comm	_c_peak_totalbspmemory,4,2      ## @c_peak_totalbspmemory
	.comm	_c_nodes,4,2                    ## @c_nodes
	.comm	_drawflag,8,3                   ## @drawflag
	.comm	_CONTENTS_SOLID,4,2             ## @CONTENTS_SOLID
	.comm	_c_solidleafnodes,4,2           ## @c_solidleafnodes
	.comm	_create_aas,8,3                 ## @create_aas
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_BuildTree_r                    ; -- Begin function BuildTree_r
	.p2align	2
_BuildTree_r:                           ; @BuildTree_r
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x20, x1
	mov	x19, x0
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [sp, #24]
Lloh3:
	adrp	x21, _numrecurse@GOTPAGE
Lloh4:
	ldr	x21, [x21, _numrecurse@GOTPAGEOFF]
	ldr	w1, [x21]
Lloh5:
	adrp	x0, l_.str@PAGE
Lloh6:
	add	x0, x0, l_.str@PAGEOFF
	bl	_qprintf
	ldr	w8, [x21]
	add	w8, w8, #1
	str	w8, [x21]
Lloh7:
	adrp	x8, _numthreads@GOTPAGE
Lloh8:
	ldr	x8, [x8, _numthreads@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
	cmp	w8, #1
	b.ne	LBB0_4
; %bb.1:
	bl	_WindingMemory
Lloh10:
	adrp	x8, _c_nodememory@GOTPAGE
Lloh11:
	ldr	x8, [x8, _c_nodememory@GOTPAGEOFF]
Lloh12:
	ldr	w8, [x8]
Lloh13:
	adrp	x9, _c_brushmemory@GOTPAGE
Lloh14:
	ldr	x9, [x9, _c_brushmemory@GOTPAGEOFF]
Lloh15:
	ldr	w9, [x9]
	add	w8, w8, w0
	add	w8, w8, w9
Lloh16:
	adrp	x9, _c_peak_totalbspmemory@GOTPAGE
Lloh17:
	ldr	x9, [x9, _c_peak_totalbspmemory@GOTPAGEOFF]
	ldr	w10, [x9]
	cmp	w8, w10
	b.le	LBB0_3
; %bb.2:
	str	w8, [x9]
LBB0_3:
Lloh18:
	adrp	x8, _c_nodes@GOTPAGE
Lloh19:
	ldr	x8, [x8, _c_nodes@GOTPAGEOFF]
	ldr	w9, [x8]
	add	w9, w9, #1
	str	w9, [x8]
LBB0_4:
Lloh20:
	adrp	x8, _drawflag@GOTPAGE
Lloh21:
	ldr	x8, [x8, _drawflag@GOTPAGEOFF]
Lloh22:
	ldr	x8, [x8]
	cbz	x8, LBB0_6
; %bb.5:
	mov	x0, x20
	mov	x1, x19
	bl	_DrawBrushList
LBB0_6:
	mov	x0, x20
	mov	x1, x19
	bl	_SelectSplitSide
	cbz	x0, LBB0_13
; %bb.7:
	str	x0, [x19, #32]
	ldr	w8, [x0]
	and	w8, w8, #0xfffffffe
	str	w8, [x19]
	add	x8, sp, #8
	add	x3, x8, #8
	add	x2, sp, #8
	mov	x0, x20
	mov	x1, x19
	bl	_SplitBrushList
	mov	x0, x20
	bl	_FreeBrushList
	bl	_AllocNode
	str	x19, [x0, #24]
	ldr	x8, [x19, #8]
	str	x0, [x8]
	bl	_AllocNode
	str	x19, [x0, #24]
	ldr	x8, [x19, #8]
	str	x0, [x8, #8]
	ldr	w1, [x19]
	ldp	x8, x0, [x19, #8]
	ldp	x9, x8, [x8]
	add	x2, x9, #16
	add	x3, x8, #16
	bl	_SplitBrush
Lloh23:
	adrp	x8, _create_aas@GOTPAGE
Lloh24:
	ldr	x8, [x8, _create_aas@GOTPAGEOFF]
Lloh25:
	ldr	x8, [x8]
	cbz	x8, LBB0_10
; %bb.8:
	ldr	x0, [x19, #16]
	cbz	x0, LBB0_10
; %bb.9:
	bl	_FreeBrush
	str	xzr, [x19, #16]
LBB0_10:
	ldr	x8, [x19, #8]
	ldr	x0, [x8]
	ldr	x1, [sp, #8]
	bl	_BuildTree_r
	ldr	x8, [x19, #8]
	str	x0, [x8]
	ldr	x8, [x19, #8]
	ldr	x0, [x8, #8]
	ldr	x1, [sp, #16]
	bl	_BuildTree_r
	ldr	x8, [x19, #8]
	str	x0, [x8, #8]
LBB0_11:
	ldr	x8, [sp, #24]
Lloh26:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh27:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh28:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_18
; %bb.12:
	mov	x0, x19
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
LBB0_13:
	str	xzr, [x19, #32]
	mov	w8, #-1
	str	w8, [x19]
	mov	x0, x19
	mov	x1, x20
	bl	_LeafNode
	ldr	w8, [x19, #4]
Lloh29:
	adrp	x9, _CONTENTS_SOLID@GOTPAGE
Lloh30:
	ldr	x9, [x9, _CONTENTS_SOLID@GOTPAGEOFF]
Lloh31:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_15
; %bb.14:
Lloh32:
	adrp	x8, _c_solidleafnodes@GOTPAGE
Lloh33:
	ldr	x8, [x8, _c_solidleafnodes@GOTPAGEOFF]
	ldr	w9, [x8]
	add	w9, w9, #1
	str	w9, [x8]
LBB0_15:
Lloh34:
	adrp	x8, _create_aas@GOTPAGE
Lloh35:
	ldr	x8, [x8, _create_aas@GOTPAGEOFF]
Lloh36:
	ldr	x8, [x8]
	cbz	x8, LBB0_11
; %bb.16:
	ldr	x0, [x19, #40]
	bl	_FreeBrushList
	str	xzr, [x19, #40]
	ldr	x0, [x19, #16]
	cbz	x0, LBB0_11
; %bb.17:
	bl	_FreeBrush
	str	xzr, [x19, #16]
	b	LBB0_11
LBB0_18:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGotLdr	Lloh23, Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh29, Lloh30, Lloh31
	.loh AdrpLdrGot	Lloh32, Lloh33
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"\r%6d"

	.comm	_numrecurse,4,2                 ; @numrecurse
	.comm	_numthreads,4,2                 ; @numthreads
	.comm	_c_nodememory,4,2               ; @c_nodememory
	.comm	_c_brushmemory,4,2              ; @c_brushmemory
	.comm	_c_peak_totalbspmemory,4,2      ; @c_peak_totalbspmemory
	.comm	_c_nodes,4,2                    ; @c_nodes
	.comm	_drawflag,8,3                   ; @drawflag
	.comm	_CONTENTS_SOLID,4,2             ; @CONTENTS_SOLID
	.comm	_c_solidleafnodes,4,2           ; @c_solidleafnodes
	.comm	_create_aas,8,3                 ; @create_aas
.subsections_via_symbols
