	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_FilterMapDrawSurfIntoTree_r    ## -- Begin function FilterMapDrawSurfIntoTree_r
	.p2align	4, 0x90
_FilterMapDrawSurfIntoTree_r:           ## @FilterMapDrawSurfIntoTree_r
	.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	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %rbx
	movq	(%rdx), %rax
	movq	_PLANENUM_LEAF@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_1
## %bb.7:
	xorl	%r14d, %r14d
	cmpq	$0, 16(%rbx)
	jne	LBB0_13
## %bb.8:
	movq	8(%rbx), %rax
	testq	%rax, %rax
	je	LBB0_12
## %bb.9:
	movq	_numDrawSurfaces@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	.p2align	4, 0x90
LBB0_11:                                ## =>This Inner Loop Header: Depth=1
	cmpq	%rcx, (%rax)
	je	LBB0_13
## %bb.10:                              ##   in Loop: Header=BB0_11 Depth=1
	movq	8(%rax), %rax
	testq	%rax, %rax
	jne	LBB0_11
LBB0_12:
	movl	$16, %edi
	callq	_malloc
	movq	_numDrawSurfaces@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movq	%rcx, (%rax)
	movq	8(%rbx), %rcx
	movq	%rcx, 8(%rax)
	movq	%rax, 8(%rbx)
	movl	$1, %r14d
	jmp	LBB0_13
LBB0_1:
	movq	%rsi, %r12
	movq	%rdi, %r15
	movq	_mapplanes@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	movl	(%rcx,%rax,8), %edx
	movl	4(%rcx,%rax,8), %esi
	movq	_ON_EPSILON@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	leaq	-48(%rbp), %r8
	leaq	-40(%rbp), %r9
	callq	_ClipWindingEpsilon
	movq	-48(%rbp), %rdi
	testq	%rdi, %rdi
	je	LBB0_2
## %bb.3:
	movq	24(%rbx), %rax
	movq	(%rax), %rdx
	movq	%r12, %rsi
	callq	_FilterMapDrawSurfIntoTree_r
	movl	%eax, %r14d
	jmp	LBB0_4
LBB0_2:
	xorl	%r14d, %r14d
LBB0_4:
	movq	-40(%rbp), %rdi
	testq	%rdi, %rdi
	je	LBB0_6
## %bb.5:
	movq	24(%rbx), %rax
	movq	8(%rax), %rdx
	movq	%r12, %rsi
	callq	_FilterMapDrawSurfIntoTree_r
	addl	%eax, %r14d
LBB0_6:
	movq	%r15, %rdi
	callq	_FreeWinding
LBB0_13:
	movl	%r14d, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PLANENUM_LEAF,8,3              ## @PLANENUM_LEAF
	.comm	_mapplanes,8,3                  ## @mapplanes
	.comm	_ON_EPSILON,4,2                 ## @ON_EPSILON
	.comm	_numDrawSurfaces,8,3            ## @numDrawSurfaces
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_FilterMapDrawSurfIntoTree_r    ; -- Begin function FilterMapDrawSurfIntoTree_r
	.p2align	2
_FilterMapDrawSurfIntoTree_r:           ; @FilterMapDrawSurfIntoTree_r
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x19, x2
	ldr	x8, [x2]
Lloh0:
	adrp	x9, _PLANENUM_LEAF@GOTPAGE
Lloh1:
	ldr	x9, [x9, _PLANENUM_LEAF@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_3
; %bb.1:
	ldr	x8, [x19, #16]
	cbz	x8, LBB0_7
LBB0_2:
	mov	w22, #0
	b	LBB0_12
LBB0_3:
	mov	x21, x1
	mov	x20, x0
Lloh3:
	adrp	x9, _mapplanes@GOTPAGE
Lloh4:
	ldr	x9, [x9, _mapplanes@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	add	x8, x9, x8, lsl #3
	ldp	w2, w1, [x8]
Lloh6:
	adrp	x8, _ON_EPSILON@GOTPAGE
Lloh7:
	ldr	x8, [x8, _ON_EPSILON@GOTPAGEOFF]
Lloh8:
	ldr	w3, [x8]
	add	x4, sp, #8
	mov	x5, sp
	bl	_ClipWindingEpsilon
	ldr	x0, [sp, #8]
	cbz	x0, LBB0_13
; %bb.4:
	ldr	x8, [x19, #24]
	ldr	x2, [x8]
	mov	x1, x21
	bl	_FilterMapDrawSurfIntoTree_r
	mov	x22, x0
	ldr	x0, [sp]
	cbz	x0, LBB0_6
LBB0_5:
	ldr	x8, [x19, #24]
	ldr	x2, [x8, #8]
	mov	x1, x21
	bl	_FilterMapDrawSurfIntoTree_r
	add	w22, w0, w22
LBB0_6:
	mov	x0, x20
	bl	_FreeWinding
	b	LBB0_12
LBB0_7:
	ldr	x8, [x19, #8]
Lloh9:
	adrp	x20, _numDrawSurfaces@GOTPAGE
Lloh10:
	ldr	x20, [x20, _numDrawSurfaces@GOTPAGEOFF]
	cbz	x8, LBB0_11
; %bb.8:
	ldr	x9, [x20]
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x10, [x8]
	cmp	x10, x9
	b.eq	LBB0_2
; %bb.10:                               ;   in Loop: Header=BB0_9 Depth=1
	ldr	x8, [x8, #8]
	cbnz	x8, LBB0_9
LBB0_11:
	mov	w0, #16
	bl	_malloc
	ldr	x8, [x20]
	str	x8, [x0]
	ldr	x8, [x19, #8]
	str	x8, [x0, #8]
	str	x0, [x19, #8]
	mov	w22, #1
LBB0_12:
	mov	x0, x22
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
LBB0_13:
	mov	w22, #0
	ldr	x0, [sp]
	cbnz	x0, LBB0_5
	b	LBB0_6
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_PLANENUM_LEAF,8,3              ; @PLANENUM_LEAF
	.comm	_mapplanes,8,3                  ; @mapplanes
	.comm	_ON_EPSILON,4,2                 ; @ON_EPSILON
	.comm	_numDrawSurfaces,8,3            ; @numDrawSurfaces
.subsections_via_symbols
