	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ProcessSubModel                ## -- Begin function ProcessSubModel
	.p2align	4, 0x90
_ProcessSubModel:                       ## @ProcessSubModel
	.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
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	xorl	%eax, %eax
	callq	_BeginModel
	movq	_entities@GOTPCREL(%rip), %rax
	movq	(%rax), %r15
	movq	_entity_num@GOTPCREL(%rip), %rax
	movq	(%rax), %rbx
	shlq	$4, %rbx
	leaq	(%r15,%rbx), %r14
	movq	_numMapDrawSurfs@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 8(%r15,%rbx)
	movq	%r14, %rdi
	callq	_PatchMapDrawSurfs
	xorl	%eax, %eax
	callq	_AllocNode
	movq	%rax, %r12
	movq	_PLANENUM_LEAF@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 8(%r12)
	movq	(%r15,%rbx), %rbx
	testq	%rbx, %rbx
	je	LBB0_3
	.p2align	4, 0x90
LBB0_1:                                 ## =>This Inner Loop Header: Depth=1
	movq	%rbx, %rdi
	callq	_CopyBrush
	movq	(%r12), %rcx
	movq	%rcx, (%rax)
	movq	%rax, (%r12)
	movq	(%rbx), %rbx
	testq	%rbx, %rbx
	jne	LBB0_1
LBB0_3:
	xorl	%eax, %eax
	callq	_AllocTree
	movq	%rax, %r15
	movq	%r12, (%rax)
	movq	%r14, %rdi
	movq	%rax, %rsi
	callq	_ClipSidesIntoTree
	movq	_nosubdivide@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	jne	LBB0_5
## %bb.4:
	movq	%r14, %rdi
	movq	%r15, %rsi
	callq	_SubdivideDrawSurfs
LBB0_5:
	movq	_nomerge@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	jne	LBB0_7
## %bb.6:
	movq	%r14, %rdi
	movq	%r15, %rsi
	callq	_MergeSides
LBB0_7:
	movq	_notjunc@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	jne	LBB0_9
## %bb.8:
	movq	%r14, %rdi
	callq	_FixTJunctions
LBB0_9:
	movq	%r14, %rdi
	callq	_AllocateLightmaps
	movq	%r14, %rdi
	movq	%r15, %rsi
	callq	_FilterDrawsurfsIntoTree
	movq	%r12, %rdi
	callq	_EndModel
	movq	%r15, %rdi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_FreeTree                       ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_entities,8,3                   ## @entities
	.comm	_entity_num,8,3                 ## @entity_num
	.comm	_numMapDrawSurfs,4,2            ## @numMapDrawSurfs
	.comm	_PLANENUM_LEAF,4,2              ## @PLANENUM_LEAF
	.comm	_nosubdivide,4,2                ## @nosubdivide
	.comm	_nomerge,4,2                    ## @nomerge
	.comm	_notjunc,4,2                    ## @notjunc
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ProcessSubModel                ; -- Begin function ProcessSubModel
	.p2align	2
_ProcessSubModel:                       ; @ProcessSubModel
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	bl	_BeginModel
Lloh0:
	adrp	x8, _entities@GOTPAGE
Lloh1:
	ldr	x8, [x8, _entities@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
Lloh3:
	adrp	x9, _entity_num@GOTPAGE
Lloh4:
	ldr	x9, [x9, _entity_num@GOTPAGEOFF]
Lloh5:
	ldr	x9, [x9]
	add	x19, x8, x9, lsl #4
Lloh6:
	adrp	x8, _numMapDrawSurfs@GOTPAGE
Lloh7:
	ldr	x8, [x8, _numMapDrawSurfs@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	str	w8, [x19, #8]
	mov	x0, x19
	bl	_PatchMapDrawSurfs
	bl	_AllocNode
	mov	x20, x0
Lloh9:
	adrp	x8, _PLANENUM_LEAF@GOTPAGE
Lloh10:
	ldr	x8, [x8, _PLANENUM_LEAF@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	str	w8, [x0, #8]
	ldr	x21, [x19]
	cbz	x21, LBB0_2
LBB0_1:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x21
	bl	_CopyBrush
	ldr	x8, [x20]
	str	x8, [x0]
	str	x0, [x20]
	ldr	x21, [x21]
	cbnz	x21, LBB0_1
LBB0_2:
	bl	_AllocTree
	mov	x21, x0
	str	x20, [x0]
	mov	x0, x19
	mov	x1, x21
	bl	_ClipSidesIntoTree
Lloh12:
	adrp	x8, _nosubdivide@GOTPAGE
Lloh13:
	ldr	x8, [x8, _nosubdivide@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	cbnz	w8, LBB0_4
; %bb.3:
	mov	x0, x19
	mov	x1, x21
	bl	_SubdivideDrawSurfs
LBB0_4:
Lloh15:
	adrp	x8, _nomerge@GOTPAGE
Lloh16:
	ldr	x8, [x8, _nomerge@GOTPAGEOFF]
Lloh17:
	ldr	w8, [x8]
	cbnz	w8, LBB0_6
; %bb.5:
	mov	x0, x19
	mov	x1, x21
	bl	_MergeSides
LBB0_6:
Lloh18:
	adrp	x8, _notjunc@GOTPAGE
Lloh19:
	ldr	x8, [x8, _notjunc@GOTPAGEOFF]
Lloh20:
	ldr	w8, [x8]
	cbnz	w8, LBB0_8
; %bb.7:
	mov	x0, x19
	bl	_FixTJunctions
LBB0_8:
	mov	x0, x19
	bl	_AllocateLightmaps
	mov	x0, x19
	mov	x1, x21
	bl	_FilterDrawsurfsIntoTree
	mov	x0, x20
	bl	_EndModel
	mov	x0, x21
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	_FreeTree
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
	.comm	_entities,8,3                   ; @entities
	.comm	_entity_num,8,3                 ; @entity_num
	.comm	_numMapDrawSurfs,4,2            ; @numMapDrawSurfs
	.comm	_PLANENUM_LEAF,4,2              ; @PLANENUM_LEAF
	.comm	_nosubdivide,4,2                ; @nosubdivide
	.comm	_nomerge,4,2                    ; @nomerge
	.comm	_notjunc,4,2                    ; @notjunc
.subsections_via_symbols
