	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.section	__TEXT,__literal8,8byte_literals
	.p2align	3                               ## -- Begin function FinishBrush
LCPI0_0:
	.quad	0x3fe0000000000000              ## double 0.5
	.section	__TEXT,__text,regular,pure_instructions
	.globl	_FinishBrush
	.p2align	4, 0x90
_FinishBrush:                           ## @FinishBrush
	.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	$40, %rsp
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -32(%rbp)
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_AddBackSides
	movq	_buildBrush@GOTPCREL(%rip), %r14
	movq	(%r14), %rdi
	callq	_CreateBrushWindings
	testl	%eax, %eax
	je	LBB0_12
## %bb.1:
	movq	(%r14), %rax
	movl	(%rax), %ecx
	movq	_CONTENTS_PLAYERCLIP@GOTPCREL(%rip), %rdx
	movq	_CONTENTS_MONSTERCLIP@GOTPCREL(%rip), %rsi
	movl	(%rsi), %esi
	orl	(%rdx), %esi
	testl	%ecx, %esi
	je	LBB0_3
## %bb.2:
	movq	_qtrue@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, 12(%rax)
	movq	_c_detail@GOTPCREL(%rip), %rcx
	incl	(%rcx)
	movl	(%rax), %ecx
LBB0_3:
	movq	_CONTENTS_ORIGIN@GOTPCREL(%rip), %rdx
	testl	%ecx, (%rdx)
	je	LBB0_7
## %bb.4:
	movq	_num_entities@GOTPCREL(%rip), %rbx
	cmpl	$1, (%rbx)
	jne	LBB0_10
## %bb.5:
	movq	_entitySourceBrushes@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	L_.str(%rip), %rdi
	xorl	%esi, %esi
	jmp	LBB0_6
LBB0_7:
	movq	_CONTENTS_AREAPORTAL@GOTPCREL(%rip), %rax
	movq	_num_entities@GOTPCREL(%rip), %r15
	testl	%ecx, (%rax)
	je	LBB0_11
## %bb.8:
	movl	(%r15), %esi
	cmpl	$1, %esi
	je	LBB0_11
## %bb.9:
	decl	%esi
	movq	_entitySourceBrushes@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	leaq	L_.str.3(%rip), %rdi
LBB0_6:
	callq	__printf
	xorl	%ebx, %ebx
	jmp	LBB0_12
LBB0_10:
	movl	4(%rax), %esi
	movl	8(%rax), %edi
	callq	_VectorAdd
	movsd	LCPI0_0(%rip), %xmm0            ## xmm0 = mem[0],zero
	callq	_VectorScale
	leaq	L_.str.1(%rip), %rsi
	leaq	-64(%rbp), %r14
	movq	%r14, %rdi
	callq	_sprintf
	movq	_entities@GOTPCREL(%rip), %r15
	movq	(%r15), %rax
	movslq	(%rbx), %rcx
	leaq	(%rax,%rcx,4), %rdi
	addq	$-4, %rdi
	leaq	L_.str.2(%rip), %rsi
	movq	%r14, %rdx
	callq	_SetKeyValue
	movq	(%r15), %rax
	movslq	(%rbx), %rcx
	movl	-4(%rax,%rcx,4), %esi
	callq	_VectorCopy
	xorl	%ebx, %ebx
	jmp	LBB0_12
LBB0_11:
	xorl	%eax, %eax
	callq	_AddBrushBevels
	movq	(%r14), %rdi
	callq	_CopyBrush
	movq	%rax, %rbx
	movl	(%r15), %eax
	decl	%eax
	movl	%eax, (%rbx)
	movq	_entitySourceBrushes@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 24(%rbx)
	movq	%rbx, 16(%rbx)
	movq	_mapent@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	(%rax), %rcx
	movq	%rcx, 8(%rbx)
	movq	%rbx, (%rax)
LBB0_12:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-32(%rbp), %rax
	jne	LBB0_14
## %bb.13:
	movq	%rbx, %rax
	addq	$40, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_14:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_buildBrush,8,3                 ## @buildBrush
	.comm	_CONTENTS_PLAYERCLIP,4,2        ## @CONTENTS_PLAYERCLIP
	.comm	_CONTENTS_MONSTERCLIP,4,2       ## @CONTENTS_MONSTERCLIP
	.comm	_qtrue,4,2                      ## @qtrue
	.comm	_c_detail,4,2                   ## @c_detail
	.comm	_CONTENTS_ORIGIN,4,2            ## @CONTENTS_ORIGIN
	.comm	_num_entities,4,2               ## @num_entities
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Entity %i, Brush %i: origin brushes not allowed in world\n"

	.comm	_entitySourceBrushes,4,2        ## @entitySourceBrushes
L_.str.1:                               ## @.str.1
	.asciz	"%i %i %i"

	.comm	_entities,8,3                   ## @entities
L_.str.2:                               ## @.str.2
	.asciz	"origin"

	.comm	_CONTENTS_AREAPORTAL,4,2        ## @CONTENTS_AREAPORTAL
L_.str.3:                               ## @.str.3
	.asciz	"Entity %i, Brush %i: areaportals only allowed in world\n"

	.comm	_mapent,8,3                     ## @mapent
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_FinishBrush                    ; -- Begin function FinishBrush
	.p2align	2
_FinishBrush:                           ; @FinishBrush
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	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
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	stur	x8, [x29, #-24]
	bl	_AddBackSides
Lloh3:
	adrp	x19, _buildBrush@GOTPAGE
Lloh4:
	ldr	x19, [x19, _buildBrush@GOTPAGEOFF]
	ldr	x0, [x19]
	bl	_CreateBrushWindings
	cbz	w0, LBB0_11
; %bb.1:
	ldr	x8, [x19]
	ldr	w9, [x8]
Lloh5:
	adrp	x10, _CONTENTS_PLAYERCLIP@GOTPAGE
Lloh6:
	ldr	x10, [x10, _CONTENTS_PLAYERCLIP@GOTPAGEOFF]
Lloh7:
	ldr	w10, [x10]
Lloh8:
	adrp	x11, _CONTENTS_MONSTERCLIP@GOTPAGE
Lloh9:
	ldr	x11, [x11, _CONTENTS_MONSTERCLIP@GOTPAGEOFF]
Lloh10:
	ldr	w11, [x11]
	orr	w10, w11, w10
	tst	w10, w9
	b.eq	LBB0_3
; %bb.2:
Lloh11:
	adrp	x9, _qtrue@GOTPAGE
Lloh12:
	ldr	x9, [x9, _qtrue@GOTPAGEOFF]
Lloh13:
	ldr	w9, [x9]
	str	w9, [x8, #12]
Lloh14:
	adrp	x9, _c_detail@GOTPAGE
Lloh15:
	ldr	x9, [x9, _c_detail@GOTPAGEOFF]
	ldr	w10, [x9]
	add	w10, w10, #1
	str	w10, [x9]
	ldr	w9, [x8]
LBB0_3:
Lloh16:
	adrp	x10, _CONTENTS_ORIGIN@GOTPAGE
Lloh17:
	ldr	x10, [x10, _CONTENTS_ORIGIN@GOTPAGEOFF]
Lloh18:
	ldr	w10, [x10]
	tst	w10, w9
	b.eq	LBB0_6
; %bb.4:
Lloh19:
	adrp	x19, _num_entities@GOTPAGE
Lloh20:
	ldr	x19, [x19, _num_entities@GOTPAGEOFF]
	ldr	w9, [x19]
	cmp	w9, #1
	b.ne	LBB0_8
; %bb.5:
Lloh21:
	adrp	x8, _entitySourceBrushes@GOTPAGE
Lloh22:
	ldr	x8, [x8, _entitySourceBrushes@GOTPAGEOFF]
Lloh23:
	ldr	w2, [x8]
Lloh24:
	adrp	x0, l_.str@PAGE
Lloh25:
	add	x0, x0, l_.str@PAGEOFF
	mov	w1, #0
	b	LBB0_10
LBB0_6:
Lloh26:
	adrp	x8, _CONTENTS_AREAPORTAL@GOTPAGE
Lloh27:
	ldr	x8, [x8, _CONTENTS_AREAPORTAL@GOTPAGEOFF]
Lloh28:
	ldr	w8, [x8]
	and	w9, w8, w9
Lloh29:
	adrp	x20, _num_entities@GOTPAGE
Lloh30:
	ldr	x20, [x20, _num_entities@GOTPAGEOFF]
	ldr	w8, [x20]
	cmp	w9, #0
	ccmp	w8, #1, #4, ne
	b.ne	LBB0_9
; %bb.7:
	bl	_AddBrushBevels
	ldr	x0, [x19]
	bl	_CopyBrush
	ldr	w8, [x20]
	sub	w8, w8, #1
	str	w8, [x0]
Lloh31:
	adrp	x8, _entitySourceBrushes@GOTPAGE
Lloh32:
	ldr	x8, [x8, _entitySourceBrushes@GOTPAGEOFF]
Lloh33:
	ldr	w8, [x8]
	str	w8, [x0, #24]
	str	x0, [x0, #16]
Lloh34:
	adrp	x8, _mapent@GOTPAGE
Lloh35:
	ldr	x8, [x8, _mapent@GOTPAGEOFF]
Lloh36:
	ldr	x8, [x8]
	ldr	x9, [x8]
	str	x9, [x0, #8]
	str	x0, [x8]
	b	LBB0_12
LBB0_8:
	ldp	w1, w0, [x8, #4]
	bl	_VectorAdd
	fmov	d0, #0.50000000
	bl	_VectorScale
Lloh37:
	adrp	x1, l_.str.1@PAGE
Lloh38:
	add	x1, x1, l_.str.1@PAGEOFF
	add	x0, sp, #8
	bl	_sprintf
Lloh39:
	adrp	x20, _entities@GOTPAGE
Lloh40:
	ldr	x20, [x20, _entities@GOTPAGEOFF]
	ldr	x8, [x20]
	ldrsw	x9, [x19]
	add	x8, x8, x9, lsl #2
	sub	x0, x8, #4
Lloh41:
	adrp	x1, l_.str.2@PAGE
Lloh42:
	add	x1, x1, l_.str.2@PAGEOFF
	add	x2, sp, #8
	bl	_SetKeyValue
	ldr	x8, [x20]
	ldrsw	x9, [x19]
	add	x8, x8, x9, lsl #2
	ldur	w1, [x8, #-4]
	bl	_VectorCopy
	b	LBB0_11
LBB0_9:
	sub	w1, w8, #1
Lloh43:
	adrp	x8, _entitySourceBrushes@GOTPAGE
Lloh44:
	ldr	x8, [x8, _entitySourceBrushes@GOTPAGEOFF]
Lloh45:
	ldr	w2, [x8]
Lloh46:
	adrp	x0, l_.str.3@PAGE
Lloh47:
	add	x0, x0, l_.str.3@PAGEOFF
LBB0_10:
	bl	__printf
LBB0_11:
	mov	x0, #0
LBB0_12:
	ldur	x8, [x29, #-24]
Lloh48:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh49:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh50:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_14
; %bb.13:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
LBB0_14:
	bl	___stack_chk_fail
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpAdd	Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGot	Lloh29, Lloh30
	.loh AdrpLdrGotLdr	Lloh26, Lloh27, Lloh28
	.loh AdrpLdrGotLdr	Lloh34, Lloh35, Lloh36
	.loh AdrpLdrGotLdr	Lloh31, Lloh32, Lloh33
	.loh AdrpAdd	Lloh41, Lloh42
	.loh AdrpLdrGot	Lloh39, Lloh40
	.loh AdrpAdd	Lloh37, Lloh38
	.loh AdrpAdd	Lloh46, Lloh47
	.loh AdrpLdrGotLdr	Lloh43, Lloh44, Lloh45
	.loh AdrpLdrGotLdr	Lloh48, Lloh49, Lloh50
	.cfi_endproc
                                        ; -- End function
	.comm	_buildBrush,8,3                 ; @buildBrush
	.comm	_CONTENTS_PLAYERCLIP,4,2        ; @CONTENTS_PLAYERCLIP
	.comm	_CONTENTS_MONSTERCLIP,4,2       ; @CONTENTS_MONSTERCLIP
	.comm	_qtrue,4,2                      ; @qtrue
	.comm	_c_detail,4,2                   ; @c_detail
	.comm	_CONTENTS_ORIGIN,4,2            ; @CONTENTS_ORIGIN
	.comm	_num_entities,4,2               ; @num_entities
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Entity %i, Brush %i: origin brushes not allowed in world\n"

	.comm	_entitySourceBrushes,4,2        ; @entitySourceBrushes
l_.str.1:                               ; @.str.1
	.asciz	"%i %i %i"

	.comm	_entities,8,3                   ; @entities
l_.str.2:                               ; @.str.2
	.asciz	"origin"

	.comm	_CONTENTS_AREAPORTAL,4,2        ; @CONTENTS_AREAPORTAL
l_.str.3:                               ; @.str.3
	.asciz	"Entity %i, Brush %i: areaportals only allowed in world\n"

	.comm	_mapent,8,3                     ; @mapent
.subsections_via_symbols
