	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_CheckBSPBrush                  ## -- Begin function CheckBSPBrush
	.p2align	4, 0x90
_CheckBSPBrush:                         ## @CheckBSPBrush
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r12
	movl	(%rdi), %eax
	testl	%eax, %eax
	jle	LBB0_9
## %bb.1:
	movq	_mapplanes@GOTPCREL(%rip), %r15
	xorl	%r13d, %r13d
	jmp	LBB0_2
	.p2align	4, 0x90
LBB0_25:                                ##   in Loop: Header=BB0_2 Depth=1
	leaq	L_.str(%rip), %rdi
	xorl	%eax, %eax
	callq	_Log_Print
	movl	(%r12), %eax
LBB0_8:                                 ##   in Loop: Header=BB0_2 Depth=1
	incq	%r13
	movslq	%eax, %rcx
	cmpq	%rcx, %r13
	jge	LBB0_9
LBB0_2:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_4 Depth 2
	testl	%eax, %eax
	jle	LBB0_8
## %bb.3:                               ##   in Loop: Header=BB0_2 Depth=1
	movl	$8, %ebx
	xorl	%r14d, %r14d
	jmp	LBB0_4
	.p2align	4, 0x90
LBB0_7:                                 ##   in Loop: Header=BB0_4 Depth=2
	incq	%r14
	movslq	%eax, %rcx
	addq	$16, %rbx
	cmpq	%rcx, %r14
	jge	LBB0_8
LBB0_4:                                 ##   Parent Loop BB0_2 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	cmpq	%r14, %r13
	je	LBB0_7
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=2
	movq	(%r15), %rax
	movq	24(%r12), %rcx
	movq	%r13, %rdx
	shlq	$4, %rdx
	movq	(%rcx,%rdx), %r9
	movq	-8(%rcx,%rbx), %r10
	movl	8(%rcx,%rdx), %edi
	movl	(%rcx,%rbx), %esi
	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
	jne	LBB0_25
## %bb.6:                               ##   in Loop: Header=BB0_4 Depth=2
	movl	(%r12), %eax
	jmp	LBB0_7
LBB0_9:
	movq	%r12, %rdi
	callq	_BoundBrush
	movq	16(%r12), %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_11
## %bb.10:
	movq	8(%r12), %rsi
	movl	(%rsi), %ebx
	cmpl	%ecx, %ebx
	jg	LBB0_11
## %bb.13:
	xorl	%r14d, %r14d
	cmpl	%ecx, %edi
	jg	LBB0_15
## %bb.14:
	cmpl	%eax, %ebx
	jl	LBB0_15
## %bb.16:
	movl	4(%rdx), %edi
	movl	$1, %r14d
	cmpl	%eax, %edi
	jl	LBB0_11
## %bb.17:
	movl	4(%rsi), %ebx
	cmpl	%ecx, %ebx
	jg	LBB0_11
## %bb.18:
	movl	$1, %r14d
	cmpl	%ecx, %edi
	jg	LBB0_15
## %bb.19:
	cmpl	%eax, %ebx
	jl	LBB0_15
## %bb.20:
	movl	8(%rdx), %edx
	movl	$2, %r14d
	cmpl	%eax, %edx
	jl	LBB0_11
## %bb.21:
	movl	8(%rsi), %esi
	cmpl	%ecx, %esi
	jle	LBB0_22
LBB0_11:
	movl	%r14d, %ebx
	leaq	L_.str.1(%rip), %rdi
LBB0_12:
	xorl	%eax, %eax
	callq	_Log_Print
	movq	8(%r12), %rax
	movq	16(%r12), %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
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_Log_Print                      ## TAILCALL
LBB0_22:
	movl	$2, %r14d
	cmpl	%ecx, %edx
	jg	LBB0_15
## %bb.23:
	cmpl	%eax, %esi
	jl	LBB0_15
## %bb.24:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_15:
	movl	%r14d, %ebx
	leaq	L_.str.3(%rip), %rdi
	jmp	LBB0_12
	.cfi_endproc
                                        ## -- End function
	.comm	_mapplanes,8,3                  ## @mapplanes
	.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	"brush: 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	"brush: 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	_CheckBSPBrush                  ; -- Begin function CheckBSPBrush
	.p2align	2
_CheckBSPBrush:                         ; @CheckBSPBrush
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	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
	mov	x19, x0
	ldr	w8, [x0]
	cmp	w8, #1
	b.lt	LBB0_10
; %bb.1:
	mov	x21, #0
Lloh0:
	adrp	x22, _mapplanes@GOTPAGE
Lloh1:
	ldr	x22, [x22, _mapplanes@GOTPAGEOFF]
Lloh2:
	adrp	x20, l_.str@PAGE
Lloh3:
	add	x20, x20, l_.str@PAGEOFF
	b	LBB0_4
LBB0_2:                                 ;   in Loop: Header=BB0_4 Depth=1
	mov	x0, x20
	bl	_Log_Print
	ldr	w8, [x19]
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	add	x21, x21, #1
	cmp	x21, w8, sxtw
	b.ge	LBB0_10
LBB0_4:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_7 Depth 2
	cmp	w8, #1
	b.lt	LBB0_3
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	x23, #0
	mov	x24, #0
	b	LBB0_7
LBB0_6:                                 ;   in Loop: Header=BB0_7 Depth=2
	add	x24, x24, #1
	add	x23, x23, #16
	cmp	x24, w8, sxtw
	b.ge	LBB0_3
LBB0_7:                                 ;   Parent Loop BB0_4 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	cmp	x21, x24
	b.eq	LBB0_6
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=2
	ldr	x8, [x22]
	ldr	x9, [x19, #24]
	add	x10, x9, x21, lsl #4
	ldr	x11, [x10]
	add	x9, x9, x23
	ldr	x12, [x9]
	ldr	w0, [x10, #8]
	ldr	w1, [x9, #8]
	add	x9, x8, x11, lsl #3
	add	x8, x8, x12, lsl #3
	ldp	w4, w2, [x9]
	ldp	w5, w3, [x8]
	bl	_WindingsNonConvex
	cbnz	x0, LBB0_2
; %bb.9:                                ;   in Loop: Header=BB0_7 Depth=2
	ldr	w8, [x19]
	b	LBB0_6
LBB0_10:
	mov	x0, x19
	bl	_BoundBrush
	mov	w20, #0
	ldr	x10, [x19, #16]
Lloh4:
	adrp	x8, _MAX_MAP_BOUNDS@GOTPAGE
Lloh5:
	ldr	x8, [x8, _MAX_MAP_BOUNDS@GOTPAGEOFF]
Lloh6:
	ldr	w8, [x8]
	ldr	w12, [x10]
	neg	w9, w8
	cmp	w12, w9
	b.lt	LBB0_19
; %bb.11:
	ldr	x11, [x19, #8]
	ldr	w13, [x11]
	cmp	w13, w8
	b.le	LBB0_13
; %bb.12:
	mov	w20, #0
	b	LBB0_19
LBB0_13:
	cmp	w12, w8
	ccmp	w13, w9, #8, le
	b.ge	LBB0_16
; %bb.14:
	mov	w20, #0
LBB0_15:
	mov	w21, w20
Lloh7:
	adrp	x0, l_.str.3@PAGE
Lloh8:
	add	x0, x0, l_.str.3@PAGEOFF
	b	LBB0_20
LBB0_16:
	ldr	w12, [x10, #4]
	cmp	w12, w9
	b.lt	LBB0_18
; %bb.17:
	ldr	w13, [x11, #4]
	cmp	w13, w8
	b.le	LBB0_22
LBB0_18:
	mov	w20, #1
LBB0_19:
	mov	w21, w20
Lloh9:
	adrp	x0, l_.str.1@PAGE
Lloh10:
	add	x0, x0, l_.str.1@PAGEOFF
LBB0_20:
	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]
Lloh11:
	adrp	x0, l_.str.2@PAGE
Lloh12:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_Log_Print
LBB0_21:
	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
	add	sp, sp, #96
	ret
LBB0_22:
	cmp	w12, w8
	ccmp	w13, w9, #8, le
	b.ge	LBB0_24
; %bb.23:
	mov	w20, #1
	b	LBB0_15
LBB0_24:
	ldr	w10, [x10, #8]
	cmp	w10, w9
	b.ge	LBB0_26
; %bb.25:
	mov	w20, #2
	b	LBB0_19
LBB0_26:
	ldr	w11, [x11, #8]
	mov	w20, #2
	cmp	w11, w8
	b.gt	LBB0_19
; %bb.27:
	cmp	w10, w8
	b.gt	LBB0_15
; %bb.28:
	cmp	w11, w9
	b.ge	LBB0_21
	b	LBB0_15
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_mapplanes,8,3                  ; @mapplanes
	.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	"brush: 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	"brush: no visible sides on brush\n"

.subsections_via_symbols
