	.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
	movq	%rdi, %r14
	movq	24(%rdi), %r12
	xorl	%r11d, %r11d
	movq	_mapplanes@GOTPCREL(%rip), %r10
	movq	_brushsides@GOTPCREL(%rip), %r8
	movq	_side_brushtextures@GOTPCREL(%rip), %r9
	xorl	%edi, %edi
	jmp	LBB0_1
	.p2align	4, 0x90
LBB0_15:                                ##   in Loop: Header=BB0_1 Depth=1
	addq	$2, %r11
	incq	%rdi
	cmpq	$3, %rdi
	je	LBB0_16
LBB0_1:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_3 Depth 2
                                        ##     Child Loop BB0_28 Depth 2
	movl	(%r14), %esi
	movl	$0, %ebx
	testl	%esi, %esi
	jle	LBB0_5
## %bb.2:                               ##   in Loop: Header=BB0_1 Depth=1
	movq	(%r10), %rdx
	xorl	%ebx, %ebx
	movq	%r12, %rax
	.p2align	4, 0x90
LBB0_3:                                 ##   Parent Loop BB0_1 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	(%rax), %rcx
	movq	(%rdx,%rcx,8), %rcx
	cmpl	$-1, (%rcx,%rdi,4)
	je	LBB0_5
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=2
	incl	%ebx
	addq	$32, %rax
	cmpl	%ebx, %esi
	jne	LBB0_3
	jmp	LBB0_6
	.p2align	4, 0x90
LBB0_5:                                 ##   in Loop: Header=BB0_1 Depth=1
	cmpl	%esi, %ebx
	je	LBB0_6
## %bb.8:                               ##   in Loop: Header=BB0_1 Depth=1
	movl	%ebx, %edx
	cmpq	%rdx, %r11
	je	LBB0_10
## %bb.9:                               ##   in Loop: Header=BB0_1 Depth=1
	movq	%r11, %rax
	shlq	$5, %rax
	movups	(%r12,%rax), %xmm0
	movups	16(%r12,%rax), %xmm1
	movaps	%xmm1, -48(%rbp)
	movaps	%xmm0, -64(%rbp)
	shlq	$5, %rdx
	movups	(%r12,%rdx), %xmm0
	movups	16(%r12,%rdx), %xmm1
	movups	%xmm0, (%r12,%rax)
	movups	%xmm1, 16(%r12,%rax)
	movq	24(%r14), %rax
	movapd	-64(%rbp), %xmm0
	movapd	-48(%rbp), %xmm1
	movupd	%xmm1, 16(%rax,%rdx)
	movupd	%xmm0, (%rax,%rdx)
	movq	24(%r14), %r12
	movq	%r12, %rax
	subq	(%r8), %rax
	shrq	$5, %rax
	movq	(%r9), %rcx
	cltq
	leaq	(%r11,%rax), %rdx
	movl	(%rcx,%rdx,4), %esi
	addl	%eax, %ebx
	movslq	%ebx, %rax
	movl	(%rcx,%rax,4), %ebx
	movl	%ebx, (%rcx,%rdx,4)
	movl	%esi, (%rcx,%rax,4)
	movl	(%r14), %esi
LBB0_10:                                ##   in Loop: Header=BB0_1 Depth=1
	testl	%esi, %esi
	jle	LBB0_11
## %bb.27:                              ##   in Loop: Header=BB0_1 Depth=1
	movq	(%r10), %rdx
	xorl	%ebx, %ebx
	movq	%r12, %rax
	.p2align	4, 0x90
LBB0_28:                                ##   Parent Loop BB0_1 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	(%rax), %rcx
	movq	(%rdx,%rcx,8), %rcx
	cmpl	$1, (%rcx,%rdi,4)
	je	LBB0_12
## %bb.29:                              ##   in Loop: Header=BB0_28 Depth=2
	incl	%ebx
	addq	$32, %rax
	cmpl	%ebx, %esi
	jne	LBB0_28
	jmp	LBB0_6
	.p2align	4, 0x90
LBB0_11:                                ##   in Loop: Header=BB0_1 Depth=1
	xorl	%ebx, %ebx
LBB0_12:                                ##   in Loop: Header=BB0_1 Depth=1
	cmpl	%esi, %ebx
	je	LBB0_6
## %bb.13:                              ##   in Loop: Header=BB0_1 Depth=1
	movq	%r11, %rsi
	orq	$1, %rsi
	cmpl	%esi, %ebx
	je	LBB0_15
## %bb.14:                              ##   in Loop: Header=BB0_1 Depth=1
	movq	%rsi, %rax
	shlq	$5, %rax
	movups	(%r12,%rax), %xmm0
	movups	16(%r12,%rax), %xmm1
	movaps	%xmm1, -48(%rbp)
	movaps	%xmm0, -64(%rbp)
	movl	%ebx, %ecx
	shlq	$5, %rcx
	movups	(%r12,%rcx), %xmm0
	movups	16(%r12,%rcx), %xmm1
	movups	%xmm0, (%r12,%rax)
	movups	%xmm1, 16(%r12,%rax)
	movq	24(%r14), %rax
	movapd	-64(%rbp), %xmm0
	movapd	-48(%rbp), %xmm1
	movupd	%xmm1, 16(%rax,%rcx)
	movupd	%xmm0, (%rax,%rcx)
	movq	24(%r14), %r12
	movq	%r12, %rax
	subq	(%r8), %rax
	shrq	$5, %rax
	movq	(%r9), %rcx
	cltq
	addq	%rax, %rsi
	movl	(%rcx,%rsi,4), %edx
	addl	%ebx, %eax
	cltq
	movl	(%rcx,%rax,4), %ebx
	movl	%ebx, (%rcx,%rsi,4)
	movl	%edx, (%rcx,%rax,4)
	jmp	LBB0_15
LBB0_6:
	movq	%r14, %rdi
	callq	_AddBrushBevels.cold.1
LBB0_7:
	addq	$32, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_16:
	movl	(%r14), %eax
	cmpl	$7, %eax
	jl	LBB0_7
## %bb.17:
	movl	$6, %r15d
	.p2align	4, 0x90
LBB0_18:                                ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_21 Depth 2
	movq	%r15, %rcx
	shlq	$5, %rcx
	movq	24(%r12,%rcx), %r12
	testq	%r12, %r12
	je	LBB0_25
## %bb.19:                              ##   in Loop: Header=BB0_18 Depth=1
	movl	(%r12), %esi
	testl	%esi, %esi
	jle	LBB0_25
## %bb.20:                              ##   in Loop: Header=BB0_18 Depth=1
	xorl	%ebx, %ebx
	jmp	LBB0_21
	.p2align	4, 0x90
LBB0_23:                                ##   in Loop: Header=BB0_21 Depth=2
	movslq	(%r12), %rsi
	cmpq	%rsi, %rbx
	jge	LBB0_24
LBB0_21:                                ##   Parent Loop BB0_18 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	%rbx, %rcx
	incq	%rbx
	movl	%ebx, %eax
	cltd
	idivl	%esi
                                        ## kill: def $edx killed $edx def $rdx
	movq	8(%r12), %rax
	movl	(%rax,%rcx,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_23
## %bb.22:                              ##   in Loop: Header=BB0_21 Depth=2
	callq	_SnapVector
	jmp	LBB0_23
	.p2align	4, 0x90
LBB0_24:                                ##   in Loop: Header=BB0_18 Depth=1
	movl	(%r14), %eax
LBB0_25:                                ##   in Loop: Header=BB0_18 Depth=1
	incq	%r15
	movslq	%eax, %rcx
	cmpq	%rcx, %r15
	jge	LBB0_7
## %bb.26:                              ##   in Loop: Header=BB0_18 Depth=1
	movq	24(%r14), %r12
	jmp	LBB0_18
	.cfi_endproc
                                        ## -- End function
	.p2align	4, 0x90                         ## -- Begin function AddBrushBevels.cold.1
_AddBrushBevels.cold.1:                 ## @AddBrushBevels.cold.1
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %rbx
	movq	_nummapbrushsides@GOTPCREL(%rip), %r14
	movq	(%r14), %rax
	movq	_MAX_MAP_BRUSHSIDES@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB1_2
## %bb.1:
	leaq	L_.str(%rip), %rdi
	callq	_Error
	movq	(%r14), %rax
	movl	(%rbx), %esi
LBB1_2:
	incq	%rax
	movq	%rax, (%r14)
	incl	%esi
	movl	%esi, (%rbx)
	callq	_VectorClear
	ud2
	.cfi_endproc
                                        ## -- End function
	.comm	_mapplanes,8,3                  ## @mapplanes
	.comm	_nummapbrushsides,8,3           ## @nummapbrushsides
	.comm	_MAX_MAP_BRUSHSIDES,8,3         ## @MAX_MAP_BRUSHSIDES
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"MAX_MAP_BRUSHSIDES"

	.comm	_SFL_BEVEL,4,2                  ## @SFL_BEVEL
	.comm	_c_boxbevels,4,2                ## @c_boxbevels
	.comm	_brushsides,8,3                 ## @brushsides
	.comm	_side_brushtextures,8,3         ## @side_brushtextures
	.comm	_c_edgebevels,4,2               ## @c_edgebevels
	.comm	_side_newrefs,8,3               ## @side_newrefs
.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, #96
	.cfi_def_cfa_offset 96
	stp	d9, d8, [sp, #32]               ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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	x19, x0
	mov	x9, #0
	mov	x10, #0
	ldr	x8, [x0, #24]
Lloh0:
	adrp	x11, _mapplanes@GOTPAGE
Lloh1:
	ldr	x11, [x11, _mapplanes@GOTPAGEOFF]
Lloh2:
	adrp	x12, _brushsides@GOTPAGE
Lloh3:
	ldr	x12, [x12, _brushsides@GOTPAGEOFF]
Lloh4:
	adrp	x13, _side_brushtextures@GOTPAGE
Lloh5:
	ldr	x13, [x13, _side_brushtextures@GOTPAGEOFF]
	b	LBB0_2
LBB0_1:                                 ;   in Loop: Header=BB0_2 Depth=1
	add	x9, x9, #2
	add	x10, x10, #1
	cmp	x10, #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	w1, [x19]
	cmp	w1, #1
	b.lt	LBB0_6
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	mov	w14, #0
	ldr	x15, [x11]
	mov	x16, x8
LBB0_4:                                 ;   Parent Loop BB0_2 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	x17, [x16]
	ldr	x17, [x15, x17, lsl #3]
	ldr	w17, [x17, x10, lsl #2]
	cmn	w17, #1
	b.eq	LBB0_7
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=2
	add	w14, w14, #1
	add	x16, x16, #32
	cmp	w1, w14
	b.ne	LBB0_4
	b	LBB0_30
LBB0_6:                                 ;   in Loop: Header=BB0_2 Depth=1
	mov	w14, #0
LBB0_7:                                 ;   in Loop: Header=BB0_2 Depth=1
	cmp	w14, w1
	b.eq	LBB0_30
; %bb.8:                                ;   in Loop: Header=BB0_2 Depth=1
	mov	w15, w14
	cmp	x9, x15
	b.eq	LBB0_10
; %bb.9:                                ;   in Loop: Header=BB0_2 Depth=1
	add	x16, x8, x9, lsl #5
	ldp	q0, q1, [x16]
	stp	q0, q1, [sp]
	lsl	x15, x15, #5
	add	x8, x8, x15
	ldp	q0, q1, [x8]
	stp	q0, q1, [x16]
	ldr	x8, [x19, #24]
	add	x8, x8, x15
	ldp	q0, q1, [sp]
	stp	q0, q1, [x8]
	ldr	x8, [x19, #24]
	ldr	x15, [x12]
	sub	x15, x8, x15
	lsr	x15, x15, #5
	ldr	x16, [x13]
	add	x17, x9, w15, sxtw
	lsl	x17, x17, #2
	ldr	w0, [x16, x17]
	add	w14, w14, w15
	sbfiz	x14, x14, #2, #32
	ldr	w15, [x16, x14]
	str	w15, [x16, x17]
	str	w0, [x16, x14]
	ldr	w1, [x19]
LBB0_10:                                ;   in Loop: Header=BB0_2 Depth=1
	cmp	w1, #1
	b.lt	LBB0_14
; %bb.11:                               ;   in Loop: Header=BB0_2 Depth=1
	mov	w14, #0
	ldr	x15, [x11]
	mov	x16, x8
LBB0_12:                                ;   Parent Loop BB0_2 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	x17, [x16]
	ldr	x17, [x15, x17, lsl #3]
	ldr	w17, [x17, x10, lsl #2]
	cmp	w17, #1
	b.eq	LBB0_15
; %bb.13:                               ;   in Loop: Header=BB0_12 Depth=2
	add	w14, w14, #1
	add	x16, x16, #32
	cmp	w1, w14
	b.ne	LBB0_12
	b	LBB0_30
LBB0_14:                                ;   in Loop: Header=BB0_2 Depth=1
	mov	w14, #0
LBB0_15:                                ;   in Loop: Header=BB0_2 Depth=1
	cmp	w14, w1
	b.eq	LBB0_30
; %bb.16:                               ;   in Loop: Header=BB0_2 Depth=1
	orr	x15, x9, #0x1
	cmp	w14, w15
	b.eq	LBB0_1
; %bb.17:                               ;   in Loop: Header=BB0_2 Depth=1
	add	x16, x8, x15, lsl #5
	ldp	q0, q1, [x16]
	stp	q0, q1, [sp]
	mov	w17, w14
	lsl	x17, x17, #5
	add	x8, x8, x17
	ldp	q0, q1, [x8]
	stp	q0, q1, [x16]
	ldr	x8, [x19, #24]
	add	x8, x8, x17
	ldp	q0, q1, [sp]
	stp	q0, q1, [x8]
	ldr	x8, [x19, #24]
	ldr	x16, [x12]
	sub	x16, x8, x16
	lsr	x16, x16, #5
	ldr	x17, [x13]
	add	x15, x15, w16, sxtw
	lsl	x15, x15, #2
	ldr	w0, [x17, x15]
	add	w14, w14, w16
	sbfiz	x14, x14, #2, #32
	ldr	w16, [x17, x14]
	str	w16, [x17, x15]
	str	w0, [x17, x14]
	b	LBB0_1
LBB0_18:
	ldr	w9, [x19]
	cmp	w9, #7
	b.lt	LBB0_29
; %bb.19:
	mov	w20, #6
	fmov	d8, #0.50000000
LBB0_20:                                ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_24 Depth 2
	add	x8, x8, x20, lsl #5
	ldr	x21, [x8, #24]
	cbz	x21, LBB0_27
; %bb.21:                               ;   in Loop: Header=BB0_20 Depth=1
	ldr	w8, [x21]
	cmp	w8, #1
	b.lt	LBB0_27
; %bb.22:                               ;   in Loop: Header=BB0_20 Depth=1
	mov	x9, #0
	b	LBB0_24
LBB0_23:                                ;   in Loop: Header=BB0_24 Depth=2
	ldrsw	x8, [x21]
	mov	x9, x22
	cmp	x22, x8
	b.ge	LBB0_26
LBB0_24:                                ;   Parent Loop BB0_20 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	add	x22, x9, #1
	sdiv	w10, w22, w8
	msub	w8, w10, w8, w22
	ldr	x10, [x21, #8]
	ldr	w0, [x10, x9, lsl #2]
	ldr	w1, [x10, w8, uxtw #2]
	bl	_VectorSubtract
	bl	_VectorNormalize
	fcmp	d0, d8
	b.mi	LBB0_23
; %bb.25:                               ;   in Loop: Header=BB0_24 Depth=2
	bl	_SnapVector
	b	LBB0_23
LBB0_26:                                ;   in Loop: Header=BB0_20 Depth=1
	ldr	w9, [x19]
LBB0_27:                                ;   in Loop: Header=BB0_20 Depth=1
	add	x20, x20, #1
	cmp	x20, w9, sxtw
	b.ge	LBB0_29
; %bb.28:                               ;   in Loop: Header=BB0_20 Depth=1
	ldr	x8, [x19, #24]
	b	LBB0_20
LBB0_29:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	d9, d8, [sp, #32]               ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
LBB0_30:
	mov	x0, x19
	bl	_AddBrushBevels.cold.1
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.p2align	2                               ; -- Begin function AddBrushBevels.cold.1
_AddBrushBevels.cold.1:                 ; @AddBrushBevels.cold.1
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x0
Lloh6:
	adrp	x20, _nummapbrushsides@GOTPAGE
Lloh7:
	ldr	x20, [x20, _nummapbrushsides@GOTPAGEOFF]
	ldr	x8, [x20]
Lloh8:
	adrp	x9, _MAX_MAP_BRUSHSIDES@GOTPAGE
Lloh9:
	ldr	x9, [x9, _MAX_MAP_BRUSHSIDES@GOTPAGEOFF]
Lloh10:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB1_2
; %bb.1:
Lloh11:
	adrp	x0, l_.str@PAGE
Lloh12:
	add	x0, x0, l_.str@PAGEOFF
	bl	_Error
	ldr	x8, [x20]
	ldr	w1, [x19]
LBB1_2:
	add	x8, x8, #1
	str	x8, [x20]
	add	w8, w1, #1
	str	w8, [x19]
	bl	_VectorClear
	brk	#0x1
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpAdd	Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_mapplanes,8,3                  ; @mapplanes
	.comm	_nummapbrushsides,8,3           ; @nummapbrushsides
	.comm	_MAX_MAP_BRUSHSIDES,8,3         ; @MAX_MAP_BRUSHSIDES
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"MAX_MAP_BRUSHSIDES"

	.comm	_SFL_BEVEL,4,2                  ; @SFL_BEVEL
	.comm	_c_boxbevels,4,2                ; @c_boxbevels
	.comm	_brushsides,8,3                 ; @brushsides
	.comm	_side_brushtextures,8,3         ; @side_brushtextures
	.comm	_c_edgebevels,4,2               ; @c_edgebevels
	.comm	_side_newrefs,8,3               ; @side_newrefs
.subsections_via_symbols
