	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal8,8byte_literals
	.p2align	3                               ## -- Begin function AddBrushBevels
LCPI0_0:
	.quad	0x3fe0000000000000              ## double 0.5
	.section	__TEXT,__text,regular,pure_instructions
	.globl	_AddBrushBevels
	.p2align	4, 0x90
_AddBrushBevels:                        ## @AddBrushBevels
	.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	%r12
	pushq	%rbx
	subq	$32, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	xorl	%r9d, %r9d
	movq	_buildBrush@GOTPCREL(%rip), %r14
	movq	_mapplanes@GOTPCREL(%rip), %r8
	xorl	%edx, %edx
	jmp	LBB0_1
	.p2align	4, 0x90
LBB0_16:                                ##   in Loop: Header=BB0_1 Depth=1
	addq	$2, %r9
	incq	%rdx
	cmpq	$3, %rdx
	je	LBB0_17
LBB0_1:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_3 Depth 2
                                        ##     Child Loop BB0_29 Depth 2
	movq	(%r14), %rax
	movq	24(%rax), %r10
	movl	(%rax), %edi
	movq	%r10, %rbx
	movl	$0, %ecx
	testl	%edi, %edi
	jle	LBB0_5
## %bb.2:                               ##   in Loop: Header=BB0_1 Depth=1
	movq	(%r8), %rax
	xorl	%ecx, %ecx
	movq	%r10, %rbx
	.p2align	4, 0x90
LBB0_3:                                 ##   Parent Loop BB0_1 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	(%rbx), %rsi
	movq	(%rax,%rsi,8), %rsi
	cmpl	$-1, (%rsi,%rdx,4)
	je	LBB0_5
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=2
	incl	%ecx
	addq	$32, %rbx
	cmpl	%ecx, %edi
	jne	LBB0_3
	jmp	LBB0_6
	.p2align	4, 0x90
LBB0_5:                                 ##   in Loop: Header=BB0_1 Depth=1
	cmpl	%edi, %ecx
	je	LBB0_6
## %bb.9:                               ##   in Loop: Header=BB0_1 Depth=1
	movl	%ecx, %ecx
	cmpq	%rcx, %r9
	je	LBB0_11
## %bb.10:                              ##   in Loop: Header=BB0_1 Depth=1
	movq	%r9, %rax
	shlq	$5, %rax
	movups	(%r10,%rax), %xmm0
	movups	16(%r10,%rax), %xmm1
	movaps	%xmm1, -48(%rbp)
	movaps	%xmm0, -64(%rbp)
	shlq	$5, %rcx
	movups	(%r10,%rcx), %xmm0
	movups	16(%r10,%rcx), %xmm1
	movups	%xmm0, (%r10,%rax)
	movups	%xmm1, 16(%r10,%rax)
	movq	(%r14), %rax
	movq	24(%rax), %rax
	movapd	-64(%rbp), %xmm0
	movapd	-48(%rbp), %xmm1
	movupd	%xmm1, 16(%rax,%rcx)
	movupd	%xmm0, (%rax,%rcx)
	movq	(%r14), %rax
	movq	24(%rax), %r10
	movl	(%rax), %edi
LBB0_11:                                ##   in Loop: Header=BB0_1 Depth=1
	testl	%edi, %edi
	jle	LBB0_12
## %bb.28:                              ##   in Loop: Header=BB0_1 Depth=1
	movq	(%r8), %rax
	xorl	%ecx, %ecx
	movq	%r10, %rbx
	.p2align	4, 0x90
LBB0_29:                                ##   Parent Loop BB0_1 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	(%rbx), %rsi
	movq	(%rax,%rsi,8), %rsi
	cmpl	$1, (%rsi,%rdx,4)
	je	LBB0_13
## %bb.30:                              ##   in Loop: Header=BB0_29 Depth=2
	incl	%ecx
	addq	$32, %rbx
	cmpl	%ecx, %edi
	jne	LBB0_29
	jmp	LBB0_6
	.p2align	4, 0x90
LBB0_12:                                ##   in Loop: Header=BB0_1 Depth=1
	xorl	%ecx, %ecx
	movq	%r10, %rbx
LBB0_13:                                ##   in Loop: Header=BB0_1 Depth=1
	cmpl	%edi, %ecx
	je	LBB0_6
## %bb.14:                              ##   in Loop: Header=BB0_1 Depth=1
	movq	%r9, %rdi
	orq	$1, %rdi
	cmpl	%edi, %ecx
	je	LBB0_16
## %bb.15:                              ##   in Loop: Header=BB0_1 Depth=1
	shlq	$5, %rdi
	movups	(%r10,%rdi), %xmm0
	movups	16(%r10,%rdi), %xmm1
	movaps	%xmm1, -48(%rbp)
	movaps	%xmm0, -64(%rbp)
	movl	%ecx, %eax
	shlq	$5, %rax
	movups	(%r10,%rax), %xmm0
	movups	16(%r10,%rax), %xmm1
	movups	%xmm0, (%r10,%rdi)
	movups	%xmm1, 16(%r10,%rdi)
	movq	(%r14), %rcx
	movq	24(%rcx), %rcx
	movapd	-64(%rbp), %xmm0
	movapd	-48(%rbp), %xmm1
	movupd	%xmm1, 16(%rcx,%rax)
	movupd	%xmm0, (%rcx,%rax)
	jmp	LBB0_16
LBB0_17:
	movq	(%r14), %rax
	cmpl	$7, (%rax)
	jl	LBB0_27
## %bb.18:
	movl	$6, %r15d
	jmp	LBB0_19
	.p2align	4, 0x90
LBB0_25:                                ##   in Loop: Header=BB0_19 Depth=1
	movq	(%r14), %rax
LBB0_26:                                ##   in Loop: Header=BB0_19 Depth=1
	incq	%r15
	movslq	(%rax), %rcx
	cmpq	%rcx, %r15
	jge	LBB0_27
LBB0_19:                                ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_22 Depth 2
	movq	24(%rax), %rcx
	movq	%r15, %rdx
	shlq	$5, %rdx
	movq	24(%rcx,%rdx), %r12
	testq	%r12, %r12
	je	LBB0_26
## %bb.20:                              ##   in Loop: Header=BB0_19 Depth=1
	movl	(%r12), %ecx
	testl	%ecx, %ecx
	jle	LBB0_26
## %bb.21:                              ##   in Loop: Header=BB0_19 Depth=1
	xorl	%ebx, %ebx
	jmp	LBB0_22
	.p2align	4, 0x90
LBB0_24:                                ##   in Loop: Header=BB0_22 Depth=2
	movslq	(%r12), %rcx
	cmpq	%rcx, %rbx
	jge	LBB0_25
LBB0_22:                                ##   Parent Loop BB0_19 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	%rbx, %rsi
	incq	%rbx
	movl	%ebx, %eax
	cltd
	idivl	%ecx
                                        ## kill: def $edx killed $edx def $rdx
	movq	8(%r12), %rax
	movl	(%rax,%rsi,4), %edi
	movl	(%rax,%rdx,4), %esi
	callq	_VectorSubtract
	callq	_VectorNormalize
	movsd	LCPI0_0(%rip), %xmm1            ## xmm1 = mem[0],zero
	ucomisd	%xmm0, %xmm1
	ja	LBB0_24
## %bb.23:                              ##   in Loop: Header=BB0_22 Depth=2
	callq	_SnapVector
	jmp	LBB0_24
LBB0_27:
	addq	$32, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_6:
	movq	_MAX_BUILD_SIDES@GOTPCREL(%rip), %rax
	cmpl	(%rax), %edi
	jne	LBB0_8
## %bb.7:
	leaq	L_.str(%rip), %rdi
	callq	_Error
LBB0_8:
	movq	%rbx, %rdi
	xorl	%esi, %esi
	movl	$32, %edx
	callq	_memset
	movq	(%r14), %rax
	incl	(%rax)
	callq	_VectorClear
	ud2
	.cfi_endproc
                                        ## -- End function
	.comm	_buildBrush,8,3                 ## @buildBrush
	.comm	_mapplanes,8,3                  ## @mapplanes
	.comm	_MAX_BUILD_SIDES,4,2            ## @MAX_BUILD_SIDES
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"MAX_BUILD_SIDES"

	.comm	_qtrue,8,3                      ## @qtrue
	.comm	_c_boxbevels,4,2                ## @c_boxbevels
	.comm	_c_edgebevels,4,2               ## @c_edgebevels
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_AddBrushBevels                 ; -- Begin function AddBrushBevels
	.p2align	2
_AddBrushBevels:                        ; @AddBrushBevels
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	d9, d8, [sp, #48]               ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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 b8, -56
	.cfi_offset b9, -64
	mov	x8, #0
	mov	x9, #0
Lloh0:
	adrp	x19, _buildBrush@GOTPAGE
Lloh1:
	ldr	x19, [x19, _buildBrush@GOTPAGEOFF]
Lloh2:
	adrp	x10, _mapplanes@GOTPAGE
Lloh3:
	ldr	x10, [x10, _mapplanes@GOTPAGEOFF]
	b	LBB0_2
LBB0_1:                                 ;   in Loop: Header=BB0_2 Depth=1
	add	x8, x8, #2
	add	x9, x9, #1
	cmp	x9, #3
	b.eq	LBB0_18
LBB0_2:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_4 Depth 2
                                        ;     Child Loop BB0_12 Depth 2
	ldr	x12, [x19]
	ldr	x11, [x12, #24]
	ldr	w12, [x12]
	mov	w14, #0
	subs	w15, w12, #1
	b.lt	LBB0_6
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	ldr	x16, [x10]
	mov	x13, x11
LBB0_4:                                 ;   Parent Loop BB0_2 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	x17, [x13]
	ldr	x17, [x16, x17, lsl #3]
	ldr	w17, [x17, x9, lsl #2]
	cmn	w17, #1
	b.eq	LBB0_7
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=2
	add	w14, w14, #1
	add	x13, x13, #32
	cmp	w12, w14
	b.ne	LBB0_4
	b	LBB0_29
LBB0_6:                                 ;   in Loop: Header=BB0_2 Depth=1
	mov	x13, x11
LBB0_7:                                 ;   in Loop: Header=BB0_2 Depth=1
	cmp	w14, w12
	b.eq	LBB0_30
; %bb.8:                                ;   in Loop: Header=BB0_2 Depth=1
	mov	w13, w14
	cmp	x8, x13
	b.eq	LBB0_10
; %bb.9:                                ;   in Loop: Header=BB0_2 Depth=1
	add	x12, x11, x8, lsl #5
	ldp	q0, q1, [x12]
	stp	q0, q1, [sp, #16]
	lsl	x13, x13, #5
	add	x11, x11, x13
	ldp	q3, q2, [x11]
	stp	q3, q2, [x12]
	ldr	x11, [x19]
	ldr	x11, [x11, #24]
	add	x11, x11, x13
	stp	q0, q1, [x11]
	ldr	x12, [x19]
	ldr	x11, [x12, #24]
	ldr	w12, [x12]
LBB0_10:                                ;   in Loop: Header=BB0_2 Depth=1
	mov	w14, #0
	subs	w15, w12, #1
	b.lt	LBB0_14
; %bb.11:                               ;   in Loop: Header=BB0_2 Depth=1
	ldr	x16, [x10]
	mov	x13, x11
LBB0_12:                                ;   Parent Loop BB0_2 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	x17, [x13]
	ldr	x17, [x16, x17, lsl #3]
	ldr	w17, [x17, x9, lsl #2]
	cmp	w17, #1
	b.eq	LBB0_15
; %bb.13:                               ;   in Loop: Header=BB0_12 Depth=2
	add	w14, w14, #1
	add	x13, x13, #32
	cmp	w12, w14
	b.ne	LBB0_12
	b	LBB0_29
LBB0_14:                                ;   in Loop: Header=BB0_2 Depth=1
	mov	x13, x11
LBB0_15:                                ;   in Loop: Header=BB0_2 Depth=1
	cmp	w14, w12
	b.eq	LBB0_30
; %bb.16:                               ;   in Loop: Header=BB0_2 Depth=1
	orr	x12, x8, #0x1
	cmp	w14, w12
	b.eq	LBB0_1
; %bb.17:                               ;   in Loop: Header=BB0_2 Depth=1
	add	x12, x11, x12, lsl #5
	ldp	q0, q1, [x12]
	stp	q0, q1, [sp, #16]
	mov	w13, w14
	lsl	x13, x13, #5
	add	x11, x11, x13
	ldp	q3, q2, [x11]
	stp	q3, q2, [x12]
	ldr	x11, [x19]
	ldr	x11, [x11, #24]
	add	x11, x11, x13
	stp	q0, q1, [x11]
	b	LBB0_1
LBB0_18:
	ldr	x8, [x19]
	ldr	w9, [x8]
	cmp	w9, #7
	b.lt	LBB0_28
; %bb.19:
	mov	w20, #6
	fmov	d8, #0.50000000
	b	LBB0_22
LBB0_20:                                ;   in Loop: Header=BB0_22 Depth=1
	ldr	x8, [x19]
LBB0_21:                                ;   in Loop: Header=BB0_22 Depth=1
	add	x20, x20, #1
	ldrsw	x9, [x8]
	cmp	x20, x9
	b.ge	LBB0_28
LBB0_22:                                ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_26 Depth 2
	ldr	x9, [x8, #24]
	add	x9, x9, x20, lsl #5
	ldr	x21, [x9, #24]
	cbz	x21, LBB0_21
; %bb.23:                               ;   in Loop: Header=BB0_22 Depth=1
	ldr	w9, [x21]
	cmp	w9, #1
	b.lt	LBB0_21
; %bb.24:                               ;   in Loop: Header=BB0_22 Depth=1
	mov	x8, #0
	b	LBB0_26
LBB0_25:                                ;   in Loop: Header=BB0_26 Depth=2
	ldrsw	x9, [x21]
	mov	x8, x22
	cmp	x22, x9
	b.ge	LBB0_20
LBB0_26:                                ;   Parent Loop BB0_22 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	add	x22, x8, #1
	sdiv	w10, w22, w9
	msub	w9, w10, w9, w22
	ldr	x10, [x21, #8]
	ldr	w0, [x10, x8, lsl #2]
	ldr	w1, [x10, w9, uxtw #2]
	bl	_VectorSubtract
	bl	_VectorNormalize
	fcmp	d0, d8
	b.mi	LBB0_25
; %bb.27:                               ;   in Loop: Header=BB0_26 Depth=2
	bl	_SnapVector
	b	LBB0_25
LBB0_28:
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	d9, d8, [sp, #48]               ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_29:
	add	x8, x11, x15, lsl #5
	add	x13, x8, #32
LBB0_30:
	str	x13, [sp, #8]                   ; 8-byte Folded Spill
Lloh4:
	adrp	x8, _MAX_BUILD_SIDES@GOTPAGE
Lloh5:
	ldr	x8, [x8, _MAX_BUILD_SIDES@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
	cmp	w12, w8
	b.ne	LBB0_32
; %bb.31:
Lloh7:
	adrp	x0, l_.str@PAGE
Lloh8:
	add	x0, x0, l_.str@PAGEOFF
	bl	_Error
LBB0_32:
	ldr	x0, [sp, #8]                    ; 8-byte Folded Reload
	mov	w1, #0
	mov	w2, #32
	bl	_memset
	ldr	x8, [x19]
	ldr	w9, [x8]
	add	w9, w9, #1
	str	w9, [x8]
	bl	_VectorClear
	brk	#0x1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpAdd	Lloh7, Lloh8
	.cfi_endproc
                                        ; -- End function
	.comm	_buildBrush,8,3                 ; @buildBrush
	.comm	_mapplanes,8,3                  ; @mapplanes
	.comm	_MAX_BUILD_SIDES,4,2            ; @MAX_BUILD_SIDES
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"MAX_BUILD_SIDES"

	.comm	_qtrue,8,3                      ; @qtrue
	.comm	_c_boxbevels,4,2                ; @c_boxbevels
	.comm	_c_edgebevels,4,2               ; @c_edgebevels
.subsections_via_symbols
