	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_CM_GeneratePatchCollide        ## -- Begin function CM_GeneratePatchCollide
	.p2align	4, 0x90
_CM_GeneratePatchCollide:               ## @CM_GeneratePatchCollide
	.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	%rbx
	subq	$40, %rsp
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, %r8
	movl	%esi, %r14d
	movl	%edi, %ebx
	cmpl	$3, %edi
	jl	LBB0_3
## %bb.1:
	cmpl	$3, %r14d
	jl	LBB0_3
## %bb.2:
	testq	%r8, %r8
	jne	LBB0_4
LBB0_3:
	movq	_ERR_DROP@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	movl	%ebx, %edx
	movl	%r14d, %ecx
	xorl	%eax, %eax
	callq	_Com_Error
LBB0_4:
	movl	%ebx, %eax
	andl	%r14d, %eax
	testb	$1, %al
	jne	LBB0_6
## %bb.5:
	movq	_ERR_DROP@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.1(%rip), %rsi
	xorl	%eax, %eax
	callq	_Com_Error
LBB0_6:
	movq	_MAX_GRID_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	cmpl	%ebx, %eax
	jl	LBB0_8
## %bb.7:
	cmpl	%r14d, %eax
	jge	LBB0_9
LBB0_8:
	movq	_ERR_DROP@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str.2(%rip), %rsi
	xorl	%eax, %eax
	callq	_Com_Error
LBB0_9:
	movl	%ebx, -56(%rbp)
	movl	%r14d, -52(%rbp)
	movq	_qfalse@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -32(%rbp)
	movq	%rax, -40(%rbp)
	leaq	-56(%rbp), %rbx
	movq	%rbx, %rdi
	callq	_CM_SetGridWrapWidth
	movq	%rbx, %rdi
	callq	_CM_SubdivideGridColumns
	movq	%rbx, %rdi
	callq	_CM_RemoveDegenerateColumns
	movq	%rbx, %rdi
	callq	_CM_TransposeGrid
	movq	%rbx, %rdi
	callq	_CM_SetGridWrapWidth
	movq	%rbx, %rdi
	callq	_CM_SubdivideGridColumns
	movq	%rbx, %rdi
	callq	_CM_RemoveDegenerateColumns
	movq	_h_high@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$8, %edi
	callq	_Hunk_Alloc
	movq	%rax, %r14
	movq	(%rax), %rax
	movq	(%rax), %rdi
	movq	8(%rax), %rsi
	callq	_ClearBounds
	movl	-56(%rbp), %ecx
	testl	%ecx, %ecx
	jle	LBB0_10
## %bb.11:
	movl	-52(%rbp), %eax
	xorl	%r15d, %r15d
	jmp	LBB0_12
	.p2align	4, 0x90
LBB0_16:                                ##   in Loop: Header=BB0_12 Depth=1
	incq	%r15
	movslq	%ecx, %rdx
	cmpq	%rdx, %r15
	jge	LBB0_17
LBB0_12:                                ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_14 Depth 2
	testl	%eax, %eax
	jle	LBB0_16
## %bb.13:                              ##   in Loop: Header=BB0_12 Depth=1
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_14:                                ##   Parent Loop BB0_12 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	-48(%rbp), %rax
	movq	(%rax,%r15,8), %rax
	movl	(%rax,%rbx,4), %edi
	movq	(%r14), %rax
	movq	(%rax), %rsi
	movq	8(%rax), %rdx
	callq	_AddPointToBounds
	incq	%rbx
	movslq	-52(%rbp), %rax
	cmpq	%rax, %rbx
	jl	LBB0_14
## %bb.15:                              ##   in Loop: Header=BB0_12 Depth=1
	movl	-56(%rbp), %ecx
	jmp	LBB0_16
LBB0_10:
	movl	-52(%rbp), %eax
LBB0_17:
	decl	%ecx
	decl	%eax
	imull	%ecx, %eax
	movq	_c_totalPatchBlocks@GOTPCREL(%rip), %rcx
	addl	%eax, (%rcx)
	leaq	-56(%rbp), %rdi
	movq	%r14, %rsi
	callq	_CM_PatchCollideFromGrid
	movq	(%r14), %rax
	movq	(%rax), %rcx
	decl	(%rcx)
	decl	4(%rcx)
	decl	8(%rcx)
	movq	8(%rax), %rax
	incl	(%rax)
	incl	4(%rax)
	incl	8(%rax)
	movq	%r14, %rax
	addq	$40, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ERR_DROP,4,2                   ## @ERR_DROP
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"CM_GeneratePatchFacets: bad parameters: (%i, %i, %p)"

L_.str.1:                               ## @.str.1
	.asciz	"CM_GeneratePatchFacets: even sizes are invalid for quadratic meshes"

	.comm	_MAX_GRID_SIZE,4,2              ## @MAX_GRID_SIZE
L_.str.2:                               ## @.str.2
	.asciz	"CM_GeneratePatchFacets: source is > MAX_GRID_SIZE"

	.comm	_qfalse,8,3                     ## @qfalse
	.comm	_h_high,4,2                     ## @h_high
	.comm	_c_totalPatchBlocks,4,2         ## @c_totalPatchBlocks
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_CM_GeneratePatchCollide        ; -- Begin function CM_GeneratePatchCollide
	.p2align	2
_CM_GeneratePatchCollide:               ; @CM_GeneratePatchCollide
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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, x1
	mov	x20, x0
	cmp	w0, #3
	b.lt	LBB0_13
; %bb.1:
	cmp	w19, #3
	b.lt	LBB0_13
; %bb.2:
	cbz	x2, LBB0_13
; %bb.3:
	and	w8, w20, w19
	tbz	w8, #0, LBB0_14
LBB0_4:
Lloh0:
	adrp	x8, _MAX_GRID_SIZE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _MAX_GRID_SIZE@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w8, w20
	ccmp	w8, w19, #8, ge
	b.ge	LBB0_6
; %bb.5:
Lloh3:
	adrp	x8, _ERR_DROP@GOTPAGE
Lloh4:
	ldr	x8, [x8, _ERR_DROP@GOTPAGEOFF]
Lloh5:
	ldr	w0, [x8]
Lloh6:
	adrp	x1, l_.str.2@PAGE
Lloh7:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_Com_Error
LBB0_6:
	stp	w20, w19, [sp, #32]
Lloh8:
	adrp	x8, _qfalse@GOTPAGE
Lloh9:
	ldr	x8, [x8, _qfalse@GOTPAGEOFF]
Lloh10:
	ldr	x8, [x8]
	stp	x8, x8, [sp, #48]
	add	x0, sp, #32
	bl	_CM_SetGridWrapWidth
	add	x0, sp, #32
	bl	_CM_SubdivideGridColumns
	add	x0, sp, #32
	bl	_CM_RemoveDegenerateColumns
	add	x0, sp, #32
	bl	_CM_TransposeGrid
	add	x0, sp, #32
	bl	_CM_SetGridWrapWidth
	add	x0, sp, #32
	bl	_CM_SubdivideGridColumns
	add	x0, sp, #32
	bl	_CM_RemoveDegenerateColumns
Lloh11:
	adrp	x8, _h_high@GOTPAGE
Lloh12:
	ldr	x8, [x8, _h_high@GOTPAGEOFF]
Lloh13:
	ldr	w1, [x8]
	mov	w0, #8
	bl	_Hunk_Alloc
	mov	x19, x0
	ldr	x8, [x0]
	ldp	x0, x1, [x8]
	bl	_ClearBounds
	ldr	w8, [sp, #32]
	cmp	w8, #0
	b.le	LBB0_15
; %bb.7:
	mov	x20, #0
	ldr	w9, [sp, #36]
	b	LBB0_9
LBB0_8:                                 ;   in Loop: Header=BB0_9 Depth=1
	add	x20, x20, #1
	cmp	x20, w8, sxtw
	b.ge	LBB0_16
LBB0_9:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_11 Depth 2
	cmp	w9, #1
	b.lt	LBB0_8
; %bb.10:                               ;   in Loop: Header=BB0_9 Depth=1
	mov	x21, #0
LBB0_11:                                ;   Parent Loop BB0_9 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	x8, [sp, #40]
	ldr	x8, [x8, x20, lsl #3]
	ldr	w0, [x8, x21, lsl #2]
	ldr	x8, [x19]
	ldp	x1, x2, [x8]
	bl	_AddPointToBounds
	add	x21, x21, #1
	ldrsw	x9, [sp, #36]
	cmp	x21, x9
	b.lt	LBB0_11
; %bb.12:                               ;   in Loop: Header=BB0_9 Depth=1
	ldr	w8, [sp, #32]
	b	LBB0_8
LBB0_13:
Lloh14:
	adrp	x8, _ERR_DROP@GOTPAGE
Lloh15:
	ldr	x8, [x8, _ERR_DROP@GOTPAGEOFF]
Lloh16:
	ldr	w0, [x8]
	stp	x19, x2, [sp, #8]
	str	x20, [sp]
Lloh17:
	adrp	x1, l_.str@PAGE
Lloh18:
	add	x1, x1, l_.str@PAGEOFF
	bl	_Com_Error
	and	w8, w20, w19
	tbnz	w8, #0, LBB0_4
LBB0_14:
Lloh19:
	adrp	x8, _ERR_DROP@GOTPAGE
Lloh20:
	ldr	x8, [x8, _ERR_DROP@GOTPAGEOFF]
Lloh21:
	ldr	w0, [x8]
Lloh22:
	adrp	x1, l_.str.1@PAGE
Lloh23:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_Com_Error
	b	LBB0_4
LBB0_15:
	ldr	w9, [sp, #36]
LBB0_16:
	sub	w8, w8, #1
	sub	w9, w9, #1
Lloh24:
	adrp	x10, _c_totalPatchBlocks@GOTPAGE
Lloh25:
	ldr	x10, [x10, _c_totalPatchBlocks@GOTPAGEOFF]
	ldr	w11, [x10]
	madd	w8, w9, w8, w11
	str	w8, [x10]
	add	x0, sp, #32
	mov	x1, x19
	bl	_CM_PatchCollideFromGrid
	ldr	x8, [x19]
	ldr	x9, [x8]
	ldr	d0, [x9]
	movi.2d	v1, #0xffffffffffffffff
	add.2s	v0, v0, v1
	str	d0, [x9]
	ldr	w10, [x9, #8]
	sub	w10, w10, #1
	str	w10, [x9, #8]
	ldr	x8, [x8, #8]
	ldr	d0, [x8]
	movi.2s	v1, #1
	add.2s	v0, v0, v1
	str	d0, [x8]
	ldr	w9, [x8, #8]
	add	w9, w9, #1
	str	w9, [x8, #8]
	mov	x0, x19
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpAdd	Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.loh AdrpLdrGot	Lloh24, Lloh25
	.cfi_endproc
                                        ; -- End function
	.comm	_ERR_DROP,4,2                   ; @ERR_DROP
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"CM_GeneratePatchFacets: bad parameters: (%i, %i, %p)"

l_.str.1:                               ; @.str.1
	.asciz	"CM_GeneratePatchFacets: even sizes are invalid for quadratic meshes"

	.comm	_MAX_GRID_SIZE,4,2              ; @MAX_GRID_SIZE
l_.str.2:                               ; @.str.2
	.asciz	"CM_GeneratePatchFacets: source is > MAX_GRID_SIZE"

	.comm	_qfalse,8,3                     ; @qfalse
	.comm	_h_high,4,2                     ; @h_high
	.comm	_c_totalPatchBlocks,4,2         ; @c_totalPatchBlocks
.subsections_via_symbols
