	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_BrushBSP                       ## -- Begin function BrushBSP
	.p2align	4, 0x90
_BrushBSP:                              ## @BrushBSP
	.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	%edx, -52(%rbp)                 ## 4-byte Spill
	movl	%esi, -48(%rbp)                 ## 4-byte Spill
	movq	%rdi, %rbx
	leaq	L_.str(%rip), %rdi
	movl	$0, -44(%rbp)                   ## 4-byte Folded Spill
	xorl	%eax, %eax
	callq	_Log_Print
	xorl	%eax, %eax
	callq	_Tree_Alloc
	movq	%rax, %r13
	movq	_c_totalsides@GOTPCREL(%rip), %rax
	movl	$0, (%rax)
	movl	$0, %r15d
	movl	$0, %r12d
	movq	%rbx, -64(%rbp)                 ## 8-byte Spill
	testq	%rbx, %rbx
	je	LBB0_14
## %bb.1:
	xorl	%r12d, %r12d
	movq	-64(%rbp), %r14                 ## 8-byte Reload
	xorl	%r15d, %r15d
	movl	$0, -44(%rbp)                   ## 4-byte Folded Spill
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_13:                                ##   in Loop: Header=BB0_2 Depth=1
	movq	_c_totalsides@GOTPCREL(%rip), %rax
	addl	%r8d, (%rax)
	incl	%r15d
	movl	8(%r14), %edi
	movl	8(%r13), %edx
	movl	12(%r13), %esi
	callq	_AddPointToBounds
	movl	4(%r14), %edi
	movl	8(%r13), %edx
	movl	12(%r13), %esi
	callq	_AddPointToBounds
	movq	32(%r14), %r14
	testq	%r14, %r14
	je	LBB0_14
LBB0_2:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_6 Depth 2
	movq	%r14, %rdi
	callq	_BrushVolume
	movq	_microvolume@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jge	LBB0_4
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	24(%r14), %rax
	movl	(%rax), %edx
	movl	4(%rax), %esi
	leaq	L_.str.1(%rip), %rdi
	xorl	%eax, %eax
	callq	_Log_Print
LBB0_4:                                 ##   in Loop: Header=BB0_2 Depth=1
	movl	(%r14), %r8d
	testl	%r8d, %r8d
	jle	LBB0_13
## %bb.5:                               ##   in Loop: Header=BB0_2 Depth=1
	movq	16(%r14), %rcx
	movq	_SFL_BEVEL@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_TEXINFO_NODE@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	movq	_SFL_VISIBLE@GOTPCREL(%rip), %rax
	movl	(%rax), %r9d
	leaq	(,%r8,8), %rax
	leaq	(%rax,%rax,2), %rbx
	xorl	%eax, %eax
	jmp	LBB0_6
LBB0_11:                                ##   in Loop: Header=BB0_6 Depth=2
	incl	-44(%rbp)                       ## 4-byte Folded Spill
	.p2align	4, 0x90
LBB0_12:                                ##   in Loop: Header=BB0_6 Depth=2
	addq	$24, %rax
	cmpq	%rax, %rbx
	je	LBB0_13
LBB0_6:                                 ##   Parent Loop BB0_2 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movl	(%rcx,%rax), %edi
	testl	%edi, %edx
	jne	LBB0_12
## %bb.7:                               ##   in Loop: Header=BB0_6 Depth=2
	cmpl	$0, 16(%rcx,%rax)
	je	LBB0_12
## %bb.8:                               ##   in Loop: Header=BB0_6 Depth=2
	cmpq	%rsi, 8(%rcx,%rax)
	je	LBB0_12
## %bb.9:                               ##   in Loop: Header=BB0_6 Depth=2
	testl	%edi, %r9d
	je	LBB0_11
## %bb.10:                              ##   in Loop: Header=BB0_6 Depth=2
	incl	%r12d
	jmp	LBB0_12
LBB0_14:
	leaq	L_.str.2(%rip), %rdi
	movl	%r15d, %esi
	xorl	%eax, %eax
	callq	_Log_Print
	leaq	L_.str.3(%rip), %rdi
	movl	%r12d, %esi
	xorl	%eax, %eax
	callq	_Log_Print
	leaq	L_.str.4(%rip), %rdi
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	xorl	%eax, %eax
	callq	_Log_Print
	movq	_c_totalsides@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str.5(%rip), %rdi
	xorl	%eax, %eax
	callq	_Log_Print
	movq	_c_active_brushes@GOTPCREL(%rip), %rax
	movl	%r15d, (%rax)
	movq	_c_nodememory@GOTPCREL(%rip), %rax
	movq	$0, (%rax)
	movq	_c_brushmemory@GOTPCREL(%rip), %rax
	movq	$0, (%rax)
	movq	_c_peak_brushmemory@GOTPCREL(%rip), %rax
	movq	$0, (%rax)
	movq	_c_nodes@GOTPCREL(%rip), %rax
	movq	$0, (%rax)
	movq	_c_nonvis@GOTPCREL(%rip), %rax
	movq	$0, (%rax)
	xorl	%eax, %eax
	callq	_AllocNode
	movq	%rax, %r14
	movl	-48(%rbp), %edi                 ## 4-byte Reload
	movl	-52(%rbp), %esi                 ## 4-byte Reload
	callq	_BrushFromBounds
	movl	%eax, 8(%r14)
	movq	%r14, (%r13)
	movq	_numrecurse@GOTPCREL(%rip), %rbx
	movq	$0, (%rbx)
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movq	%rax, (%r14)
	movq	%r13, %rdi
	callq	_BuildTree
	movq	_cancelconversion@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	jne	LBB0_17
## %bb.15:
	leaq	L_.str.6(%rip), %rdi
	callq	_qprintf
	movq	(%rbx), %rsi
	leaq	L_.str.7(%rip), %rdi
	callq	_Log_Write
	movq	_numthreads@GOTPCREL(%rip), %rax
	cmpl	$1, (%rax)
	jne	LBB0_17
## %bb.16:
	movq	_c_peak_totalbspmemory@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	sarl	$10, %esi
	leaq	L_.str.8(%rip), %rdi
	xorl	%eax, %eax
	callq	_Log_Print
LBB0_17:
	movq	%r13, %rax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"-------- Brush BSP ---------\n"

	.comm	_c_totalsides,4,2               ## @c_totalsides
	.comm	_microvolume,8,3                ## @microvolume
L_.str.1:                               ## @.str.1
	.asciz	"WARNING: entity %i, brush %i: microbrush\n"

	.comm	_SFL_BEVEL,4,2                  ## @SFL_BEVEL
	.comm	_TEXINFO_NODE,8,3               ## @TEXINFO_NODE
	.comm	_SFL_VISIBLE,4,2                ## @SFL_VISIBLE
L_.str.2:                               ## @.str.2
	.asciz	"%6i brushes\n"

L_.str.3:                               ## @.str.3
	.asciz	"%6i visible faces\n"

L_.str.4:                               ## @.str.4
	.asciz	"%6i nonvisible faces\n"

L_.str.5:                               ## @.str.5
	.asciz	"%6i total sides\n"

	.comm	_c_active_brushes,4,2           ## @c_active_brushes
	.comm	_c_nodememory,8,3               ## @c_nodememory
	.comm	_c_brushmemory,8,3              ## @c_brushmemory
	.comm	_c_peak_brushmemory,8,3         ## @c_peak_brushmemory
	.comm	_c_nodes,8,3                    ## @c_nodes
	.comm	_c_nonvis,8,3                   ## @c_nonvis
	.comm	_numrecurse,8,3                 ## @numrecurse
	.comm	_cancelconversion,8,3           ## @cancelconversion
L_.str.6:                               ## @.str.6
	.asciz	"\n"

L_.str.7:                               ## @.str.7
	.asciz	"%6d splits\r\n"

	.comm	_numthreads,4,2                 ## @numthreads
L_.str.8:                               ## @.str.8
	.asciz	"%6i KB of peak total bsp memory\n"

	.comm	_c_peak_totalbspmemory,4,2      ## @c_peak_totalbspmemory
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_BrushBSP                       ; -- Begin function BrushBSP
	.p2align	2
_BrushBSP:                              ; @BrushBSP
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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
	stp	w1, w2, [sp, #16]               ; 8-byte Folded Spill
	mov	x23, x0
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_Log_Print
	bl	_Tree_Alloc
	mov	x19, x0
Lloh2:
	adrp	x26, _c_totalsides@GOTPAGE
Lloh3:
	ldr	x26, [x26, _c_totalsides@GOTPAGEOFF]
	str	wzr, [x26]
	str	x23, [sp, #24]                  ; 8-byte Folded Spill
	cbz	x23, LBB0_11
; %bb.1:
	mov	w28, #0
	mov	w25, #0
	mov	w27, #0
Lloh4:
	adrp	x21, _microvolume@GOTPAGE
Lloh5:
	ldr	x21, [x21, _microvolume@GOTPAGEOFF]
Lloh6:
	adrp	x22, _SFL_BEVEL@GOTPAGE
Lloh7:
	ldr	x22, [x22, _SFL_BEVEL@GOTPAGEOFF]
Lloh8:
	adrp	x20, _TEXINFO_NODE@GOTPAGE
Lloh9:
	ldr	x20, [x20, _TEXINFO_NODE@GOTPAGEOFF]
Lloh10:
	adrp	x24, _SFL_VISIBLE@GOTPAGE
Lloh11:
	ldr	x24, [x24, _SFL_VISIBLE@GOTPAGEOFF]
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	add	w25, w25, #1
	ldr	w9, [x26]
	add	w8, w9, w8
	str	w8, [x26]
	ldr	w0, [x23, #8]
	ldp	w2, w1, [x19, #8]
	bl	_AddPointToBounds
	ldr	w0, [x23, #4]
	ldp	w2, w1, [x19, #8]
	bl	_AddPointToBounds
	ldr	x23, [x23, #32]
	cbz	x23, LBB0_12
LBB0_3:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_8 Depth 2
	mov	x0, x23
	bl	_BrushVolume
	ldr	x8, [x21]
	cmp	x0, x8
	b.ge	LBB0_5
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	x8, [x23, #24]
	ldp	w8, w9, [x8]
	stp	x9, x8, [sp]
Lloh12:
	adrp	x0, l_.str.1@PAGE
Lloh13:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_Log_Print
LBB0_5:                                 ;   in Loop: Header=BB0_3 Depth=1
	ldr	w8, [x23]
	cmp	w8, #1
	b.lt	LBB0_2
; %bb.6:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	x12, [x23, #16]
	ldr	w9, [x22]
	ldr	x10, [x20]
	ldr	w11, [x24]
	add	x12, x12, #16
	mov	x13, x8
	b	LBB0_8
LBB0_7:                                 ;   in Loop: Header=BB0_8 Depth=2
	add	x12, x12, #24
	subs	x13, x13, #1
	b.eq	LBB0_2
LBB0_8:                                 ;   Parent Loop BB0_3 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldur	w14, [x12, #-16]
	tst	w9, w14
	b.ne	LBB0_7
; %bb.9:                                ;   in Loop: Header=BB0_8 Depth=2
	ldr	w15, [x12]
	cbz	w15, LBB0_7
; %bb.10:                               ;   in Loop: Header=BB0_8 Depth=2
	ldur	x15, [x12, #-8]
	tst	w11, w14
	cinc	w14, w27, eq
	cinc	w16, w28, ne
	cmp	x15, x10
	csel	w27, w27, w14, eq
	csel	w28, w28, w16, eq
	b	LBB0_7
LBB0_11:
	mov	w27, #0
	mov	w25, #0
	mov	w28, #0
LBB0_12:
	str	x25, [sp]
Lloh14:
	adrp	x0, l_.str.2@PAGE
Lloh15:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_Log_Print
	str	x28, [sp]
Lloh16:
	adrp	x0, l_.str.3@PAGE
Lloh17:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_Log_Print
	str	x27, [sp]
Lloh18:
	adrp	x0, l_.str.4@PAGE
Lloh19:
	add	x0, x0, l_.str.4@PAGEOFF
	bl	_Log_Print
	ldr	w8, [x26]
	str	x8, [sp]
Lloh20:
	adrp	x0, l_.str.5@PAGE
Lloh21:
	add	x0, x0, l_.str.5@PAGEOFF
	bl	_Log_Print
Lloh22:
	adrp	x8, _c_active_brushes@GOTPAGE
Lloh23:
	ldr	x8, [x8, _c_active_brushes@GOTPAGEOFF]
Lloh24:
	str	w25, [x8]
Lloh25:
	adrp	x8, _c_nodememory@GOTPAGE
Lloh26:
	ldr	x8, [x8, _c_nodememory@GOTPAGEOFF]
Lloh27:
	str	xzr, [x8]
Lloh28:
	adrp	x8, _c_brushmemory@GOTPAGE
Lloh29:
	ldr	x8, [x8, _c_brushmemory@GOTPAGEOFF]
Lloh30:
	str	xzr, [x8]
Lloh31:
	adrp	x8, _c_peak_brushmemory@GOTPAGE
Lloh32:
	ldr	x8, [x8, _c_peak_brushmemory@GOTPAGEOFF]
Lloh33:
	str	xzr, [x8]
Lloh34:
	adrp	x8, _c_nodes@GOTPAGE
Lloh35:
	ldr	x8, [x8, _c_nodes@GOTPAGEOFF]
Lloh36:
	str	xzr, [x8]
Lloh37:
	adrp	x8, _c_nonvis@GOTPAGE
Lloh38:
	ldr	x8, [x8, _c_nonvis@GOTPAGEOFF]
Lloh39:
	str	xzr, [x8]
	bl	_AllocNode
	mov	x23, x0
	ldp	w0, w1, [sp, #16]               ; 8-byte Folded Reload
	bl	_BrushFromBounds
	str	w0, [x23, #8]
	str	x23, [x19]
Lloh40:
	adrp	x20, _numrecurse@GOTPAGE
Lloh41:
	ldr	x20, [x20, _numrecurse@GOTPAGEOFF]
	str	xzr, [x20]
	ldr	x8, [sp, #24]                   ; 8-byte Folded Reload
	str	x8, [x23]
	mov	x0, x19
	bl	_BuildTree
Lloh42:
	adrp	x8, _cancelconversion@GOTPAGE
Lloh43:
	ldr	x8, [x8, _cancelconversion@GOTPAGEOFF]
Lloh44:
	ldr	x8, [x8]
	cbnz	x8, LBB0_15
; %bb.13:
Lloh45:
	adrp	x0, l_.str.6@PAGE
Lloh46:
	add	x0, x0, l_.str.6@PAGEOFF
	bl	_qprintf
	ldr	x1, [x20]
Lloh47:
	adrp	x0, l_.str.7@PAGE
Lloh48:
	add	x0, x0, l_.str.7@PAGEOFF
	bl	_Log_Write
Lloh49:
	adrp	x8, _numthreads@GOTPAGE
Lloh50:
	ldr	x8, [x8, _numthreads@GOTPAGEOFF]
Lloh51:
	ldr	w8, [x8]
	cmp	w8, #1
	b.ne	LBB0_15
; %bb.14:
Lloh52:
	adrp	x8, _c_peak_totalbspmemory@GOTPAGE
Lloh53:
	ldr	x8, [x8, _c_peak_totalbspmemory@GOTPAGEOFF]
Lloh54:
	ldr	w8, [x8]
	asr	w8, w8, #10
	str	x8, [sp]
Lloh55:
	adrp	x0, l_.str.8@PAGE
Lloh56:
	add	x0, x0, l_.str.8@PAGEOFF
	bl	_Log_Print
LBB0_15:
	mov	x0, x19
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	ret
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh42, Lloh43, Lloh44
	.loh AdrpLdrGot	Lloh40, Lloh41
	.loh AdrpLdrGotStr	Lloh37, Lloh38, Lloh39
	.loh AdrpLdrGotStr	Lloh34, Lloh35, Lloh36
	.loh AdrpLdrGotStr	Lloh31, Lloh32, Lloh33
	.loh AdrpLdrGotStr	Lloh28, Lloh29, Lloh30
	.loh AdrpLdrGotStr	Lloh25, Lloh26, Lloh27
	.loh AdrpLdrGotStr	Lloh22, Lloh23, Lloh24
	.loh AdrpAdd	Lloh20, Lloh21
	.loh AdrpAdd	Lloh18, Lloh19
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh49, Lloh50, Lloh51
	.loh AdrpAdd	Lloh47, Lloh48
	.loh AdrpAdd	Lloh45, Lloh46
	.loh AdrpAdd	Lloh55, Lloh56
	.loh AdrpLdrGotLdr	Lloh52, Lloh53, Lloh54
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"-------- Brush BSP ---------\n"

	.comm	_c_totalsides,4,2               ; @c_totalsides
	.comm	_microvolume,8,3                ; @microvolume
l_.str.1:                               ; @.str.1
	.asciz	"WARNING: entity %i, brush %i: microbrush\n"

	.comm	_SFL_BEVEL,4,2                  ; @SFL_BEVEL
	.comm	_TEXINFO_NODE,8,3               ; @TEXINFO_NODE
	.comm	_SFL_VISIBLE,4,2                ; @SFL_VISIBLE
l_.str.2:                               ; @.str.2
	.asciz	"%6i brushes\n"

l_.str.3:                               ; @.str.3
	.asciz	"%6i visible faces\n"

l_.str.4:                               ; @.str.4
	.asciz	"%6i nonvisible faces\n"

l_.str.5:                               ; @.str.5
	.asciz	"%6i total sides\n"

	.comm	_c_active_brushes,4,2           ; @c_active_brushes
	.comm	_c_nodememory,8,3               ; @c_nodememory
	.comm	_c_brushmemory,8,3              ; @c_brushmemory
	.comm	_c_peak_brushmemory,8,3         ; @c_peak_brushmemory
	.comm	_c_nodes,8,3                    ; @c_nodes
	.comm	_c_nonvis,8,3                   ; @c_nonvis
	.comm	_numrecurse,8,3                 ; @numrecurse
	.comm	_cancelconversion,8,3           ; @cancelconversion
l_.str.6:                               ; @.str.6
	.asciz	"\n"

l_.str.7:                               ; @.str.7
	.asciz	"%6d splits\r\n"

	.comm	_numthreads,4,2                 ; @numthreads
l_.str.8:                               ; @.str.8
	.asciz	"%6i KB of peak total bsp memory\n"

	.comm	_c_peak_totalbspmemory,4,2      ; @c_peak_totalbspmemory
.subsections_via_symbols
