	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_AAS_MakeBrushWindings          ## -- Begin function AAS_MakeBrushWindings
	.p2align	4, 0x90
_AAS_MakeBrushWindings:                 ## @AAS_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, %r13
	movq	8(%rdi), %rsi
	movq	16(%rdi), %rdi
	callq	_ClearBounds
	cmpl	$0, (%r13)
	jle	LBB0_25
## %bb.1:
	xorl	%r12d, %r12d
	xorl	%r14d, %r14d
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_15:                                ##   in Loop: Header=BB0_2 Depth=1
	incq	%r14
	movslq	%ecx, %rax
	addq	$24, %r12
	cmpq	%rax, %r14
	jge	LBB0_16
LBB0_2:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_5 Depth 2
                                        ##     Child Loop BB0_13 Depth 2
	movq	_mapplanes@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	32(%r13), %rcx
	leaq	(%r14,%r14,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	(%r13), %ecx
	testl	%ecx, %ecx
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	jle	LBB0_10
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	testq	%rax, %rax
	je	LBB0_10
## %bb.4:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	$1, %ebx
	xorl	%r15d, %r15d
	.p2align	4, 0x90
LBB0_5:                                 ##   Parent Loop BB0_2 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	cmpq	%r15, %r12
	je	LBB0_8
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=2
	movq	32(%r13), %rdx
	movq	_SFL_BEVEL@GOTPCREL(%rip), %rsi
	movl	(%rsi), %esi
	testl	%esi, 8(%rdx,%r15)
	jne	LBB0_8
## %bb.7:                               ##   in Loop: Header=BB0_5 Depth=2
	movq	_mapplanes@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	(%rdx,%r15), %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	(%r13), %ecx
	movq	-48(%rbp), %rax
	.p2align	4, 0x90
LBB0_8:                                 ##   in Loop: Header=BB0_5 Depth=2
	movslq	%ecx, %rdx
	cmpq	%rdx, %rbx
	jge	LBB0_10
## %bb.9:                               ##   in Loop: Header=BB0_5 Depth=2
	addq	$24, %r15
	incq	%rbx
	testq	%rax, %rax
	jne	LBB0_5
LBB0_10:                                ##   in Loop: Header=BB0_2 Depth=1
	movq	32(%r13), %rdx
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movq	%rax, 16(%rdx,%rdi,8)
	movq	-48(%rbp), %rax
	testq	%rax, %rax
	je	LBB0_15
## %bb.11:                              ##   in Loop: Header=BB0_2 Depth=1
	movq	_SFL_VISIBLE@GOTPCREL(%rip), %rsi
	movl	(%rsi), %esi
	orl	%esi, 8(%rdx,%rdi,8)
	cmpl	$0, (%rax)
	jle	LBB0_15
## %bb.12:                              ##   in Loop: Header=BB0_2 Depth=1
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_13:                                ##   Parent Loop BB0_2 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	8(%rax), %rax
	movl	(%rax,%rbx,4), %edi
	movq	8(%r13), %rdx
	movq	16(%r13), %rsi
	callq	_AddPointToBounds
	incq	%rbx
	movq	-48(%rbp), %rax
	movslq	(%rax), %rcx
	cmpq	%rcx, %rbx
	jl	LBB0_13
## %bb.14:                              ##   in Loop: Header=BB0_2 Depth=1
	movl	(%r13), %ecx
	jmp	LBB0_15
LBB0_16:
	testl	%ecx, %ecx
	jle	LBB0_25
## %bb.17:
	leaq	L_.str(%rip), %r14
	xorl	%r15d, %r15d
	jmp	LBB0_18
	.p2align	4, 0x90
LBB0_24:                                ##   in Loop: Header=BB0_18 Depth=1
	movslq	%ecx, %rax
	incq	%r15
	cmpq	%rax, %r15
	jge	LBB0_25
LBB0_18:                                ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_20 Depth 2
	testl	%ecx, %ecx
	jle	LBB0_24
## %bb.19:                              ##   in Loop: Header=BB0_18 Depth=1
	movl	$16, %r12d
	xorl	%ebx, %ebx
	jmp	LBB0_20
	.p2align	4, 0x90
LBB0_23:                                ##   in Loop: Header=BB0_20 Depth=2
	incq	%rbx
	movslq	(%r13), %rcx
	addq	$24, %r12
	cmpq	%rcx, %rbx
	jge	LBB0_24
LBB0_20:                                ##   Parent Loop BB0_18 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	cmpq	%rbx, %r15
	je	LBB0_23
## %bb.21:                              ##   in Loop: Header=BB0_20 Depth=2
	movq	_mapplanes@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	32(%r13), %rcx
	leaq	(%r15,%r15,2), %rdx
	movq	(%rcx,%rdx,8), %r9
	movq	16(%rcx,%rdx,8), %rdi
	movq	-16(%rcx,%r12), %r10
	movq	(%rcx,%r12), %rsi
	movl	(%rax,%r9,8), %r8d
	movl	4(%rax,%r9,8), %edx
	movl	(%rax,%r10,8), %r9d
	movl	4(%rax,%r10,8), %ecx
	callq	_WindingsNonConvex
	testq	%rax, %rax
	je	LBB0_23
## %bb.22:                              ##   in Loop: Header=BB0_20 Depth=2
	movq	%r14, %rdi
	xorl	%eax, %eax
	callq	_Log_Print
	jmp	LBB0_23
LBB0_25:
	movq	16(%r13), %rdx
	movq	_MAX_MAP_BOUNDS@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movl	%ecx, %eax
	negl	%eax
	movl	(%rdx), %edi
	xorl	%r14d, %r14d
	cmpl	%eax, %edi
	jl	LBB0_27
## %bb.26:
	movq	8(%r13), %rsi
	movl	(%rsi), %ebx
	cmpl	%ecx, %ebx
	jle	LBB0_29
LBB0_27:
	movl	%r14d, %ebx
	movl	24(%r13), %edx
	movl	28(%r13), %esi
	leaq	L_.str.1(%rip), %rdi
LBB0_28:
	xorl	%eax, %eax
	callq	_Log_Print
	movq	8(%r13), %rax
	movq	16(%r13), %rcx
	movl	(%rcx,%rbx,4), %edx
	movl	(%rax,%rbx,4), %r8d
	leaq	L_.str.2(%rip), %rdi
	movl	%r14d, %esi
	movl	%r14d, %ecx
	xorl	%eax, %eax
	callq	_Log_Print
	movl	$0, (%r13)
LBB0_40:
	movl	$1, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_29:
	xorl	%r14d, %r14d
	cmpl	%ecx, %edi
	jg	LBB0_31
## %bb.30:
	cmpl	%eax, %ebx
	jl	LBB0_31
## %bb.32:
	movl	4(%rdx), %edi
	movl	$1, %r14d
	cmpl	%eax, %edi
	jl	LBB0_27
## %bb.33:
	movl	4(%rsi), %ebx
	cmpl	%ecx, %ebx
	jg	LBB0_27
## %bb.34:
	movl	$1, %r14d
	cmpl	%ecx, %edi
	jg	LBB0_31
## %bb.35:
	cmpl	%eax, %ebx
	jl	LBB0_31
## %bb.36:
	movl	8(%rdx), %edx
	movl	$2, %r14d
	cmpl	%eax, %edx
	jl	LBB0_27
## %bb.37:
	movl	8(%rsi), %esi
	cmpl	%ecx, %esi
	jg	LBB0_27
## %bb.38:
	movl	$2, %r14d
	cmpl	%ecx, %edx
	jg	LBB0_31
## %bb.39:
	cmpl	%eax, %esi
	jge	LBB0_40
LBB0_31:
	movl	%r14d, %ebx
	movl	24(%r13), %edx
	movl	28(%r13), %esi
	leaq	L_.str.3(%rip), %rdi
	jmp	LBB0_28
	.cfi_endproc
                                        ## -- End function
	.comm	_mapplanes,8,3                  ## @mapplanes
	.comm	_SFL_BEVEL,4,2                  ## @SFL_BEVEL
	.comm	_SFL_VISIBLE,4,2                ## @SFL_VISIBLE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"non convex brush"

	.comm	_MAX_MAP_BOUNDS,4,2             ## @MAX_MAP_BOUNDS
L_.str.1:                               ## @.str.1
	.asciz	"entity %i, brush %i: bounds out of range\n"

L_.str.2:                               ## @.str.2
	.asciz	"ob->mins[%d] = %f, ob->maxs[%d] = %f\n"

L_.str.3:                               ## @.str.3
	.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	_AAS_MakeBrushWindings          ; -- Begin function AAS_MakeBrushWindings
	.p2align	2
_AAS_MakeBrushWindings:                 ; @AAS_MakeBrushWindings
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	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
	mov	x19, x0
	ldr	x0, [x0, #16]
	ldr	x1, [x19, #8]
	bl	_ClearBounds
	ldr	w8, [x19]
	cmp	w8, #1
	b.lt	LBB0_25
; %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, #40]
	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, #40
	mov	w3, #0
	bl	_ChopWindingInPlace
	ldr	w8, [x19]
	ldr	x0, [sp, #40]
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, #40]
	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, #8]
	bl	_AddPointToBounds
	add	x25, x25, #1
	ldr	x9, [sp, #40]
	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:
	cmp	w8, #1
	b.lt	LBB0_25
; %bb.17:
	mov	x22, #0
	mov	w23, #24
Lloh6:
	adrp	x20, l_.str@PAGE
Lloh7:
	add	x20, x20, l_.str@PAGEOFF
	b	LBB0_19
LBB0_18:                                ;   in Loop: Header=BB0_19 Depth=1
	add	x22, x22, #1
	cmp	x22, w8, sxtw
	b.ge	LBB0_25
LBB0_19:                                ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_22 Depth 2
	cmp	w8, #1
	b.lt	LBB0_18
; %bb.20:                               ;   in Loop: Header=BB0_19 Depth=1
	mov	x24, #0
	mov	x25, #0
	b	LBB0_22
LBB0_21:                                ;   in Loop: Header=BB0_22 Depth=2
	add	x25, x25, #1
	ldrsw	x8, [x19]
	add	x24, x24, #24
	cmp	x25, x8
	b.ge	LBB0_18
LBB0_22:                                ;   Parent Loop BB0_19 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	cmp	x22, x25
	b.eq	LBB0_21
; %bb.23:                               ;   in Loop: Header=BB0_22 Depth=2
	ldr	x8, [x21]
	ldr	x9, [x19, #32]
	madd	x10, x22, x23, x9
	ldr	x11, [x10]
	add	x9, x9, x24
	ldr	x12, [x9]
	ldr	x0, [x10, #16]
	ldr	x1, [x9, #16]
	add	x9, x8, x11, lsl #3
	add	x8, x8, x12, lsl #3
	ldp	w4, w2, [x9]
	ldp	w5, w3, [x8]
	bl	_WindingsNonConvex
	cbz	x0, LBB0_21
; %bb.24:                               ;   in Loop: Header=BB0_22 Depth=2
	mov	x0, x20
	bl	_Log_Print
	b	LBB0_21
LBB0_25:
	mov	w20, #0
	ldr	x10, [x19, #16]
Lloh8:
	adrp	x8, _MAX_MAP_BOUNDS@GOTPAGE
Lloh9:
	ldr	x8, [x8, _MAX_MAP_BOUNDS@GOTPAGEOFF]
Lloh10:
	ldr	w8, [x8]
	ldr	w12, [x10]
	neg	w9, w8
	cmp	w12, w9
	b.lt	LBB0_34
; %bb.26:
	ldr	x11, [x19, #8]
	ldr	w13, [x11]
	cmp	w13, w8
	b.le	LBB0_28
; %bb.27:
	mov	w20, #0
	b	LBB0_34
LBB0_28:
	cmp	w12, w8
	ccmp	w13, w9, #8, le
	b.ge	LBB0_31
; %bb.29:
	mov	w20, #0
LBB0_30:
	mov	w21, w20
	ldp	w9, w8, [x19, #24]
	stp	x8, x9, [sp]
Lloh11:
	adrp	x0, l_.str.3@PAGE
Lloh12:
	add	x0, x0, l_.str.3@PAGEOFF
	b	LBB0_35
LBB0_31:
	ldr	w12, [x10, #4]
	cmp	w12, w9
	b.lt	LBB0_33
; %bb.32:
	ldr	w13, [x11, #4]
	cmp	w13, w8
	b.le	LBB0_37
LBB0_33:
	mov	w20, #1
LBB0_34:
	mov	w21, w20
	ldp	w9, w8, [x19, #24]
	stp	x8, x9, [sp]
Lloh13:
	adrp	x0, l_.str.1@PAGE
Lloh14:
	add	x0, x0, l_.str.1@PAGEOFF
LBB0_35:
	bl	_Log_Print
	lsl	x8, x21, #2
	ldp	x10, x9, [x19, #8]
	ldr	w9, [x9, x8]
	ldr	w8, [x10, x8]
	stp	x20, x8, [sp, #16]
	stp	x20, x9, [sp]
Lloh15:
	adrp	x0, l_.str.2@PAGE
Lloh16:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_Log_Print
	str	wzr, [x19]
LBB0_36:
	mov	w0, #1
	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
	add	sp, sp, #128
	ret
LBB0_37:
	cmp	w12, w8
	ccmp	w13, w9, #8, le
	b.ge	LBB0_39
; %bb.38:
	mov	w20, #1
	b	LBB0_30
LBB0_39:
	ldr	w10, [x10, #8]
	cmp	w10, w9
	b.ge	LBB0_41
; %bb.40:
	mov	w20, #2
	b	LBB0_34
LBB0_41:
	ldr	w11, [x11, #8]
	mov	w20, #2
	cmp	w11, w8
	b.gt	LBB0_34
; %bb.42:
	cmp	w10, w8
	b.gt	LBB0_30
; %bb.43:
	cmp	w11, w9
	b.ge	LBB0_36
	b	LBB0_30
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpAdd	Lloh13, Lloh14
	.loh AdrpAdd	Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.comm	_mapplanes,8,3                  ; @mapplanes
	.comm	_SFL_BEVEL,4,2                  ; @SFL_BEVEL
	.comm	_SFL_VISIBLE,4,2                ; @SFL_VISIBLE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"non convex brush"

	.comm	_MAX_MAP_BOUNDS,4,2             ; @MAX_MAP_BOUNDS
l_.str.1:                               ; @.str.1
	.asciz	"entity %i, brush %i: bounds out of range\n"

l_.str.2:                               ; @.str.2
	.asciz	"ob->mins[%d] = %f, ob->maxs[%d] = %f\n"

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

.subsections_via_symbols
