	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_MakeBrushWindings              ## -- Begin function MakeBrushWindings
	.p2align	4, 0x90
_MakeBrushWindings:                     ## @MakeBrushWindings
	.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
	movq	%rdi, %r14
	movq	16(%rdi), %rsi
	movq	24(%rdi), %rdi
	callq	_ClearBounds
	cmpl	$0, (%r14)
	jle	LBB0_18
## %bb.1:
	xorl	%r15d, %r15d
	movq	_mapplanes@GOTPCREL(%rip), %rbx
	xorl	%edx, %edx
	jmp	LBB0_3
	.p2align	4, 0x90
LBB0_2:                                 ##   in Loop: Header=BB0_3 Depth=1
	movq	-64(%rbp), %rdx                 ## 8-byte Reload
	incq	%rdx
	movslq	%ecx, %rax
	addq	$24, %r15
	cmpq	%rax, %rdx
	jge	LBB0_18
LBB0_3:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_6 Depth 2
                                        ##     Child Loop BB0_16 Depth 2
	movq	(%rbx), %rax
	movq	32(%r14), %rcx
	movq	%rdx, -64(%rbp)                 ## 8-byte Spill
	leaq	(%rdx,%rdx,2), %rbx
	movq	(%rcx,%rbx,8), %rcx
	movl	(%rax,%rcx,8), %esi
	movl	4(%rax,%rcx,8), %edi
	callq	_BaseWindingForPlane
	movq	%rax, -48(%rbp)
	movl	(%r14), %ecx
	testl	%ecx, %ecx
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	jle	LBB0_12
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	testq	%rax, %rax
	je	LBB0_12
## %bb.5:                               ##   in Loop: Header=BB0_3 Depth=1
	movl	$1, %r13d
	xorl	%r12d, %r12d
	movq	_mapplanes@GOTPCREL(%rip), %rbx
	.p2align	4, 0x90
LBB0_6:                                 ##   Parent Loop BB0_3 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	cmpq	%r12, %r15
	je	LBB0_9
## %bb.7:                               ##   in Loop: Header=BB0_6 Depth=2
	movq	32(%r14), %rdx
	movq	_SFL_BEVEL@GOTPCREL(%rip), %rsi
	movl	(%rsi), %esi
	testl	%esi, 8(%rdx,%r12)
	jne	LBB0_9
## %bb.8:                               ##   in Loop: Header=BB0_6 Depth=2
	movq	(%rbx), %rax
	movq	(%rdx,%r12), %rcx
	xorq	$1, %rcx
	movl	(%rax,%rcx,8), %edx
	movl	4(%rax,%rcx,8), %esi
	leaq	-48(%rbp), %rdi
	xorl	%ecx, %ecx
	callq	_ChopWindingInPlace
	movl	(%r14), %ecx
	movq	-48(%rbp), %rax
	.p2align	4, 0x90
LBB0_9:                                 ##   in Loop: Header=BB0_6 Depth=2
	movslq	%ecx, %rdx
	cmpq	%rdx, %r13
	jge	LBB0_13
## %bb.10:                              ##   in Loop: Header=BB0_6 Depth=2
	addq	$24, %r12
	incq	%r13
	testq	%rax, %rax
	jne	LBB0_6
	jmp	LBB0_13
	.p2align	4, 0x90
LBB0_12:                                ##   in Loop: Header=BB0_3 Depth=1
	movq	_mapplanes@GOTPCREL(%rip), %rbx
LBB0_13:                                ##   in Loop: Header=BB0_3 Depth=1
	movq	32(%r14), %rdx
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movq	%rax, 16(%rdx,%rdi,8)
	movq	-48(%rbp), %rax
	testq	%rax, %rax
	je	LBB0_2
## %bb.14:                              ##   in Loop: Header=BB0_3 Depth=1
	movq	_SFL_VISIBLE@GOTPCREL(%rip), %rsi
	movl	(%rsi), %esi
	orl	%esi, 8(%rdx,%rdi,8)
	cmpl	$0, (%rax)
	jle	LBB0_2
## %bb.15:                              ##   in Loop: Header=BB0_3 Depth=1
	movq	%rbx, %r12
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_16:                                ##   Parent Loop BB0_3 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	8(%rax), %rax
	movl	(%rax,%rbx,4), %edi
	movq	16(%r14), %rdx
	movq	24(%r14), %rsi
	callq	_AddPointToBounds
	incq	%rbx
	movq	-48(%rbp), %rax
	movslq	(%rax), %rcx
	cmpq	%rcx, %rbx
	jl	LBB0_16
## %bb.17:                              ##   in Loop: Header=BB0_3 Depth=1
	movl	(%r14), %ecx
	movq	%r12, %rbx
	jmp	LBB0_2
LBB0_18:
	movq	24(%r14), %rsi
	movq	_MAX_MAP_BOUNDS@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movl	%ecx, %eax
	negl	%eax
	movl	(%rsi), %ebx
	leaq	L_.str(%rip), %rdi
	cmpl	%eax, %ebx
	jl	LBB0_31
## %bb.19:
	movq	16(%r14), %r9
	movl	(%r9), %edx
	cmpl	%ecx, %edx
	jg	LBB0_31
## %bb.20:
	leaq	L_.str.1(%rip), %r8
	cmpl	%ecx, %ebx
	jg	LBB0_30
## %bb.21:
	cmpl	%eax, %edx
	jl	LBB0_30
## %bb.22:
	movl	4(%rsi), %ebx
	cmpl	%eax, %ebx
	jl	LBB0_31
## %bb.23:
	movl	4(%r9), %edx
	cmpl	%ecx, %edx
	jg	LBB0_31
## %bb.24:
	cmpl	%ecx, %ebx
	jg	LBB0_30
## %bb.25:
	cmpl	%eax, %edx
	jl	LBB0_30
## %bb.26:
	movl	8(%rsi), %esi
	cmpl	%eax, %esi
	jl	LBB0_31
## %bb.27:
	movl	8(%r9), %edx
	cmpl	%ecx, %edx
	jg	LBB0_31
## %bb.28:
	cmpl	%ecx, %esi
	jg	LBB0_30
## %bb.29:
	movq	%r8, %rdi
	cmpl	%eax, %edx
	jge	LBB0_32
	jmp	LBB0_31
LBB0_30:
	movq	%r8, %rdi
LBB0_31:
	movl	4(%r14), %edx
	movl	8(%r14), %esi
	callq	_Log_Print
	movl	$0, (%r14)
LBB0_32:
	movl	$1, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_mapplanes,8,3                  ## @mapplanes
	.comm	_SFL_BEVEL,4,2                  ## @SFL_BEVEL
	.comm	_SFL_VISIBLE,4,2                ## @SFL_VISIBLE
	.comm	_MAX_MAP_BOUNDS,4,2             ## @MAX_MAP_BOUNDS
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"entity %i, brush %i: bounds out of range\n"

L_.str.1:                               ## @.str.1
	.asciz	"entity %i, brush %i: no visible sides on brush\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_MakeBrushWindings              ; -- Begin function MakeBrushWindings
	.p2align	2
_MakeBrushWindings:                     ; @MakeBrushWindings
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [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 w23, -56
	.cfi_offset w24, -64
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x19, x0
	ldr	x0, [x0, #24]
	ldr	x1, [x19, #16]
	bl	_ClearBounds
	ldr	w8, [x19]
	cmp	w8, #1
	b.lt	LBB0_16
; %bb.1:
	mov	x20, #0
Lloh0:
	adrp	x21, _mapplanes@GOTPAGE
Lloh1:
	ldr	x21, [x21, _mapplanes@GOTPAGEOFF]
	mov	w22, #24
Lloh2:
	adrp	x23, _SFL_BEVEL@GOTPAGE
Lloh3:
	ldr	x23, [x23, _SFL_BEVEL@GOTPAGEOFF]
Lloh4:
	adrp	x24, _SFL_VISIBLE@GOTPAGE
Lloh5:
	ldr	x24, [x24, _SFL_VISIBLE@GOTPAGEOFF]
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	add	x20, x20, #1
	cmp	x20, w8, sxtw
	b.ge	LBB0_16
LBB0_3:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_6 Depth 2
                                        ;     Child Loop BB0_14 Depth 2
	ldr	x8, [x21]
	ldr	x9, [x19, #32]
	mul	x10, x20, x22
	ldr	x9, [x9, x10]
	add	x8, x8, x9, lsl #3
	ldp	w1, w0, [x8]
	bl	_BaseWindingForPlane
	str	x0, [sp, #8]
	ldr	w8, [x19]
	cmp	w8, #1
	b.lt	LBB0_11
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	cbz	x0, LBB0_11
; %bb.5:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	x25, #0
	mov	x26, #0
LBB0_6:                                 ;   Parent Loop BB0_3 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	cmp	x20, x26
	b.eq	LBB0_9
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=2
	ldr	x9, [x19, #32]
	add	x10, x9, x25
	ldr	w10, [x10, #8]
	ldr	w11, [x23]
	tst	w11, w10
	b.ne	LBB0_9
; %bb.8:                                ;   in Loop: Header=BB0_6 Depth=2
	ldr	x8, [x21]
	ldr	x9, [x9, x25]
	eor	x9, x9, #0x1
	add	x8, x8, x9, lsl #3
	ldp	w2, w1, [x8]
	add	x0, sp, #8
	mov	w3, #0
	bl	_ChopWindingInPlace
	ldr	w8, [x19]
	ldr	x0, [sp, #8]
LBB0_9:                                 ;   in Loop: Header=BB0_6 Depth=2
	add	x26, x26, #1
	cmp	x26, w8, sxtw
	b.ge	LBB0_11
; %bb.10:                               ;   in Loop: Header=BB0_6 Depth=2
	add	x25, x25, #24
	cbnz	x0, LBB0_6
LBB0_11:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	x10, [x19, #32]
	madd	x9, x20, x22, x10
	str	x0, [x9, #16]
	ldr	x9, [sp, #8]
	cbz	x9, LBB0_2
; %bb.12:                               ;   in Loop: Header=BB0_3 Depth=1
	ldr	w11, [x24]
	madd	x10, x20, x22, x10
	ldr	w12, [x10, #8]
	orr	w11, w12, w11
	str	w11, [x10, #8]
	ldr	w10, [x9]
	cmp	w10, #1
	b.lt	LBB0_2
; %bb.13:                               ;   in Loop: Header=BB0_3 Depth=1
	mov	x25, #0
LBB0_14:                                ;   Parent Loop BB0_3 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	x8, [x9, #8]
	ldr	w0, [x8, x25, lsl #2]
	ldp	x2, x1, [x19, #16]
	bl	_AddPointToBounds
	add	x25, x25, #1
	ldr	x9, [sp, #8]
	ldrsw	x8, [x9]
	cmp	x25, x8
	b.lt	LBB0_14
; %bb.15:                               ;   in Loop: Header=BB0_3 Depth=1
	ldr	w8, [x19]
	b	LBB0_2
LBB0_16:
	ldr	x10, [x19, #24]
Lloh6:
	adrp	x8, _MAX_MAP_BOUNDS@GOTPAGE
Lloh7:
	ldr	x8, [x8, _MAX_MAP_BOUNDS@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	ldr	w12, [x10]
	neg	w9, w8
	cmp	w12, w9
	b.lt	LBB0_18
; %bb.17:
	ldr	x11, [x19, #16]
	ldr	w13, [x11]
	cmp	w13, w8
	b.le	LBB0_21
LBB0_18:
Lloh9:
	adrp	x0, l_.str@PAGE
Lloh10:
	add	x0, x0, l_.str@PAGEOFF
LBB0_19:
	ldp	w2, w1, [x19, #4]
	bl	_Log_Print
	str	wzr, [x19]
LBB0_20:
	mov	w0, #1
	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	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
LBB0_21:
	cmp	w12, w8
	ccmp	w13, w9, #8, le
	b.ge	LBB0_23
LBB0_22:
Lloh11:
	adrp	x0, l_.str.1@PAGE
Lloh12:
	add	x0, x0, l_.str.1@PAGEOFF
	b	LBB0_19
LBB0_23:
	ldr	w12, [x10, #4]
	cmp	w12, w9
	b.lt	LBB0_18
; %bb.24:
	ldr	w13, [x11, #4]
	cmp	w13, w8
	b.gt	LBB0_18
; %bb.25:
	cmp	w12, w8
	ccmp	w13, w9, #8, le
	b.lt	LBB0_22
; %bb.26:
	ldr	w10, [x10, #8]
	cmp	w10, w9
	b.lt	LBB0_18
; %bb.27:
	ldr	w11, [x11, #8]
	cmp	w11, w8
	b.gt	LBB0_18
; %bb.28:
Lloh13:
	adrp	x0, l_.str.1@PAGE
Lloh14:
	add	x0, x0, l_.str.1@PAGEOFF
	cmp	w10, w8
	b.gt	LBB0_19
; %bb.29:
	cmp	w11, w9
	b.ge	LBB0_20
	b	LBB0_19
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpAdd	Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_mapplanes,8,3                  ; @mapplanes
	.comm	_SFL_BEVEL,4,2                  ; @SFL_BEVEL
	.comm	_SFL_VISIBLE,4,2                ; @SFL_VISIBLE
	.comm	_MAX_MAP_BOUNDS,4,2             ; @MAX_MAP_BOUNDS
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"entity %i, brush %i: bounds out of range\n"

l_.str.1:                               ; @.str.1
	.asciz	"entity %i, brush %i: no visible sides on brush\n"

.subsections_via_symbols
