	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_FilterPatchSurfIntoTree        ## -- Begin function FilterPatchSurfIntoTree
	.p2align	4, 0x90
_FilterPatchSurfIntoTree:               ## @FilterPatchSurfIntoTree
	.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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r15
	movq	%rdi, %r13
	movq	(%rdi), %rdi
	movq	8(%r13), %rsi
	movq	_SUBDIVISION_LIMIT@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	$32, %ecx
	callq	_SubdivideMesh
	movq	%rax, %r12
	movl	(%rax), %ecx
	cmpl	$1, %ecx
	jle	LBB0_1
## %bb.6:
	movl	4(%r12), %eax
	xorl	%edi, %edi
	xorl	%r14d, %r14d
	movq	%r13, -64(%rbp)                 ## 8-byte Spill
	movq	%r15, -56(%rbp)                 ## 8-byte Spill
	jmp	LBB0_7
	.p2align	4, 0x90
LBB0_11:                                ##   in Loop: Header=BB0_7 Depth=1
	leal	-1(%rcx), %edx
	movl	%esi, %edi
	cmpl	%edx, %esi
	jge	LBB0_2
LBB0_7:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_9 Depth 2
	leal	1(%rdi), %esi
	cmpl	$2, %eax
	jl	LBB0_11
## %bb.8:                               ##   in Loop: Header=BB0_7 Depth=1
	xorl	%r13d, %r13d
	movl	%esi, -44(%rbp)                 ## 4-byte Spill
	movq	%rdi, -80(%rbp)                 ## 8-byte Spill
	.p2align	4, 0x90
LBB0_9:                                 ##   Parent Loop BB0_7 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movl	$3, %edi
	callq	_AllocWinding
	movq	%rax, %rbx
	movq	8(%r12), %rax
	movl	(%r12), %ecx
	imull	%r13d, %ecx
	movq	-80(%rbp), %r15                 ## 8-byte Reload
	addl	%r15d, %ecx
	movslq	%ecx, %rcx
	movl	(%rax,%rcx,4), %edi
	movq	8(%rbx), %rax
	movl	(%rax), %esi
	callq	_VectorCopy
	movq	8(%r12), %rax
	movl	(%r12), %ecx
	imull	%r13d, %ecx
	addl	-44(%rbp), %ecx                 ## 4-byte Folded Reload
	movslq	%ecx, %rcx
	movl	(%rax,%rcx,4), %edi
	movq	8(%rbx), %rax
	movl	4(%rax), %esi
	callq	_VectorCopy
	movq	8(%r12), %rax
	leal	1(%r13), %edx
	movl	%edx, -68(%rbp)                 ## 4-byte Spill
	movl	(%r12), %ecx
	imull	%edx, %ecx
	addl	%r15d, %ecx
	movslq	%ecx, %rcx
	movl	(%rax,%rcx,4), %edi
	movq	8(%rbx), %rax
	movl	8(%rax), %esi
	callq	_VectorCopy
	movl	$3, (%rbx)
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %edx
	movq	%rbx, %rdi
	movq	-64(%rbp), %rsi                 ## 8-byte Reload
	callq	_FilterMapDrawSurfIntoTree_r
	addl	%r14d, %eax
	movq	%rax, -88(%rbp)                 ## 8-byte Spill
	movl	$3, %edi
	callq	_AllocWinding
	movq	%rax, %rbx
	movq	8(%r12), %rax
	imull	(%r12), %r13d
	movl	-44(%rbp), %r14d                ## 4-byte Reload
	addl	%r14d, %r13d
	movslq	%r13d, %rcx
	movl	(%rax,%rcx,4), %edi
	movq	8(%rbx), %rax
	movl	(%rax), %esi
	callq	_VectorCopy
	movq	8(%r12), %rax
	movl	(%r12), %ecx
	movl	-68(%rbp), %r13d                ## 4-byte Reload
	imull	%r13d, %ecx
	addl	%r14d, %ecx
	movslq	%ecx, %rcx
	movl	(%rax,%rcx,4), %edi
	movq	8(%rbx), %rax
	movl	4(%rax), %esi
	callq	_VectorCopy
	movq	8(%r12), %rax
	movl	(%r12), %ecx
	imull	%r13d, %ecx
	addl	%r15d, %ecx
	movslq	%ecx, %rcx
	movl	(%rax,%rcx,4), %edi
	movq	8(%rbx), %rax
	movl	8(%rax), %esi
	callq	_VectorCopy
	movl	$3, (%rbx)
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %edx
	movq	%rbx, %rdi
	movq	-64(%rbp), %rsi                 ## 8-byte Reload
	callq	_FilterMapDrawSurfIntoTree_r
	movq	%rax, %r14
	addl	-88(%rbp), %r14d                ## 4-byte Folded Reload
	movl	4(%r12), %eax
	leal	-1(%rax), %ecx
	movl	%r13d, %edx
	cmpl	%ecx, %r13d
	jl	LBB0_9
## %bb.10:                              ##   in Loop: Header=BB0_7 Depth=1
	movl	(%r12), %ecx
	movq	-56(%rbp), %r15                 ## 8-byte Reload
	movq	-64(%rbp), %r13                 ## 8-byte Reload
	movl	-44(%rbp), %esi                 ## 4-byte Reload
	jmp	LBB0_11
LBB0_1:
	movl	4(%r12), %eax
	xorl	%r14d, %r14d
LBB0_2:
	imull	%ecx, %eax
	testl	%eax, %eax
	jle	LBB0_5
## %bb.3:
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movq	8(%r12), %rax
	movl	(%rax,%rbx,4), %edi
	movl	(%r15), %edx
	movq	%r13, %rsi
	callq	_FilterMapDrawSurfIntoTree
	addl	%eax, %r14d
	incq	%rbx
	movslq	(%r12), %rax
	movslq	4(%r12), %rcx
	imulq	%rax, %rcx
	cmpq	%rcx, %rbx
	jl	LBB0_4
LBB0_5:
	movq	%r12, %rdi
	callq	_free
	movl	%r14d, %eax
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_SUBDIVISION_LIMIT,4,2          ## @SUBDIVISION_LIMIT
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_FilterPatchSurfIntoTree        ; -- Begin function FilterPatchSurfIntoTree
	.p2align	2
_FilterPatchSurfIntoTree:               ; @FilterPatchSurfIntoTree
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x19, x1
	mov	x20, x0
Lloh0:
	adrp	x8, _SUBDIVISION_LIMIT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _SUBDIVISION_LIMIT@GOTPAGEOFF]
Lloh2:
	ldr	w2, [x8]
	ldp	x0, x1, [x0]
	mov	w3, #32
	bl	_SubdivideMesh
	mov	x21, x0
	ldr	w9, [x0]
	cmp	w9, #1
	b.le	LBB0_7
; %bb.1:
	mov	w26, #0
	mov	w22, #0
	ldr	w8, [x21, #4]
	mov	w24, #3
	b	LBB0_3
LBB0_2:                                 ;   in Loop: Header=BB0_3 Depth=1
	sub	w10, w9, #1
	mov	x26, x25
	cmp	w25, w10
	b.ge	LBB0_8
LBB0_3:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_5 Depth 2
	add	w25, w26, #1
	cmp	w8, #2
	b.lt	LBB0_2
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	mov	w28, #0
LBB0_5:                                 ;   Parent Loop BB0_3 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	mov	w0, #3
	bl	_AllocWinding
	mov	x23, x0
	ldr	x8, [x21, #8]
	ldr	w9, [x21]
	madd	w9, w9, w28, w26
	ldr	w0, [x8, w9, sxtw #2]
	ldr	x8, [x23, #8]
	ldr	w1, [x8]
	bl	_VectorCopy
	ldr	x8, [x21, #8]
	ldr	w9, [x21]
	madd	w9, w9, w28, w25
	ldr	w0, [x8, w9, sxtw #2]
	ldr	x8, [x23, #8]
	ldr	w1, [x8, #4]
	bl	_VectorCopy
	ldr	x8, [x21, #8]
	add	w27, w28, #1
	ldr	w9, [x21]
	madd	w9, w9, w27, w26
	ldr	w0, [x8, w9, sxtw #2]
	ldr	x8, [x23, #8]
	ldr	w1, [x8, #8]
	bl	_VectorCopy
	str	w24, [x23]
	ldr	w2, [x19]
	mov	x0, x23
	mov	x1, x20
	bl	_FilterMapDrawSurfIntoTree_r
	add	w23, w22, w0
	mov	w0, #3
	bl	_AllocWinding
	mov	x22, x0
	ldr	x8, [x21, #8]
	ldr	w9, [x21]
	madd	w9, w9, w28, w25
	ldr	w0, [x8, w9, sxtw #2]
	ldr	x8, [x22, #8]
	ldr	w1, [x8]
	bl	_VectorCopy
	ldr	x8, [x21, #8]
	ldr	w9, [x21]
	madd	w9, w9, w27, w25
	ldr	w0, [x8, w9, sxtw #2]
	ldr	x8, [x22, #8]
	ldr	w1, [x8, #4]
	bl	_VectorCopy
	ldr	x8, [x21, #8]
	ldr	w9, [x21]
	madd	w9, w9, w27, w26
	ldr	w0, [x8, w9, sxtw #2]
	ldr	x8, [x22, #8]
	ldr	w1, [x8, #8]
	bl	_VectorCopy
	str	w24, [x22]
	ldr	w2, [x19]
	mov	x0, x22
	mov	x1, x20
	bl	_FilterMapDrawSurfIntoTree_r
	add	w22, w23, w0
	ldr	w8, [x21, #4]
	sub	w9, w8, #1
	mov	x28, x27
	cmp	w27, w9
	b.lt	LBB0_5
; %bb.6:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	w9, [x21]
	b	LBB0_2
LBB0_7:
	mov	w22, #0
	ldr	w8, [x21, #4]
LBB0_8:
	mul	w8, w8, w9
	cmp	w8, #1
	b.lt	LBB0_11
; %bb.9:
	mov	x23, #0
LBB0_10:                                ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x21, #8]
	ldr	w0, [x8, x23, lsl #2]
	ldr	w2, [x19]
	mov	x1, x20
	bl	_FilterMapDrawSurfIntoTree
	add	w22, w22, w0
	add	x23, x23, #1
	ldpsw	x8, x9, [x21]
	mul	x8, x9, x8
	cmp	x23, x8
	b.lt	LBB0_10
LBB0_11:
	mov	x0, x21
	bl	_free
	mov	x0, x22
	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
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_SUBDIVISION_LIMIT,4,2          ; @SUBDIVISION_LIMIT
.subsections_via_symbols
