	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_EmitLeaf                       ## -- Begin function EmitLeaf
	.p2align	4, 0x90
_EmitLeaf:                              ## @EmitLeaf
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r13
	movq	_numleafs@GOTPCREL(%rip), %r14
	movq	(%r14), %rax
	movq	_MAX_MAP_LEAFS@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jb	LBB0_2
## %bb.1:
	leaq	L_.str(%rip), %rdi
	callq	_Error
	movq	(%r14), %rax
LBB0_2:
	movq	_dleafs@GOTPCREL(%rip), %rcx
	movq	(%rcx), %r15
	leaq	(%rax,%rax,2), %rbx
	shlq	$4, %rbx
	leaq	(%r15,%rbx), %rcx
	movq	%rcx, -56(%rbp)                 ## 8-byte Spill
	incq	%rax
	movq	%rax, (%r14)
	movl	(%r13), %eax
	movl	%eax, (%r15,%rbx)
	movl	36(%r13), %eax
	movl	%eax, 44(%r15,%rbx)
	movl	32(%r13), %eax
	movl	%eax, 40(%r15,%rbx)
	movl	28(%r13), %edi
	movl	36(%r15,%rbx), %esi
	callq	_VectorCopy
	movl	24(%r13), %edi
	movl	32(%r15,%rbx), %esi
	callq	_VectorCopy
	movq	%rbx, %rdx
	movq	_numleafbrushes@GOTPCREL(%rip), %r14
	movl	(%r14), %ecx
	movl	%ecx, 4(%r15,%rbx)
	movq	16(%r13), %r12
	movl	(%r14), %eax
	testq	%r12, %r12
	je	LBB0_15
## %bb.3:
	movq	%r13, -72(%rbp)                 ## 8-byte Spill
	movq	%r15, -48(%rbp)                 ## 8-byte Spill
	movq	%rdx, -64(%rbp)                 ## 8-byte Spill
	addq	%rdx, %r15
	addq	$4, %r15
	movq	_MAX_MAP_LEAFBRUSHES@GOTPCREL(%rip), %r9
	movq	_mapbrushes@GOTPCREL(%rip), %r13
	movq	_dleafbrushes@GOTPCREL(%rip), %r11
	movq	%r15, -80(%rbp)                 ## 8-byte Spill
	jmp	LBB0_4
	.p2align	4, 0x90
LBB0_12:                                ##   in Loop: Header=BB0_4 Depth=1
	movq	(%r11), %rax
	movl	%ecx, (%rax,%r8,4)
	movl	(%r14), %eax
	incl	%eax
	movl	%eax, (%r14)
LBB0_13:                                ##   in Loop: Header=BB0_4 Depth=1
	movq	8(%r12), %r12
	testq	%r12, %r12
	je	LBB0_14
LBB0_4:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_8 Depth 2
	cmpl	(%r9), %eax
	jl	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	leaq	L_.str.1(%rip), %rdi
	movq	%r9, %rbx
	movq	%r14, %r15
	movq	%r11, %r14
	callq	_Error
	movq	%r14, %r11
	movq	%r15, %r14
	movq	-80(%rbp), %r15                 ## 8-byte Reload
	movq	%rbx, %r9
	movl	(%r14), %eax
LBB0_6:                                 ##   in Loop: Header=BB0_4 Depth=1
	movl	(%r12), %ecx
	subl	(%r13), %ecx
	movl	(%r15), %ebx
	movslq	%eax, %r8
	cmpl	%eax, %ebx
	jge	LBB0_11
## %bb.7:                               ##   in Loop: Header=BB0_4 Depth=1
	movslq	%ebx, %rsi
	leaq	(,%rsi,4), %rdi
	addq	(%r11), %rdi
	movq	%r8, %rdx
	subq	%rsi, %rdx
	xorl	%esi, %esi
	.p2align	4, 0x90
LBB0_8:                                 ##   Parent Loop BB0_4 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	cmpl	%ecx, (%rdi,%rsi,4)
	je	LBB0_10
## %bb.9:                               ##   in Loop: Header=BB0_8 Depth=2
	incq	%rsi
	cmpq	%rsi, %rdx
	jne	LBB0_8
	jmp	LBB0_12
	.p2align	4, 0x90
LBB0_10:                                ##   in Loop: Header=BB0_4 Depth=1
	addl	%ebx, %esi
	movl	%esi, %ebx
LBB0_11:                                ##   in Loop: Header=BB0_4 Depth=1
	cmpl	%eax, %ebx
	je	LBB0_12
	jmp	LBB0_13
LBB0_14:
	movl	(%r15), %ecx
	movq	-72(%rbp), %r13                 ## 8-byte Reload
	movq	-48(%rbp), %r15                 ## 8-byte Reload
	movq	-64(%rbp), %rdx                 ## 8-byte Reload
LBB0_15:
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	subl	%ecx, %eax
	movl	%eax, 8(%r15,%rdx)
	movq	_CONTENTS_SOLID@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%rsi)
	jne	LBB0_23
## %bb.16:
	movq	_numleaffaces@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rax
	movq	%rax, 16(%r15,%rdx)
	movq	8(%r13), %rbx
	testq	%rbx, %rbx
	je	LBB0_22
## %bb.17:
	movq	%r15, -48(%rbp)                 ## 8-byte Spill
	movq	%rdx, %r14
	addq	%rdx, %r15
	addq	$16, %r15
	jmp	LBB0_18
	.p2align	4, 0x90
LBB0_20:                                ##   in Loop: Header=BB0_18 Depth=1
	movq	16(%rbx), %rax
	movq	(%rax,%r12,8), %rbx
	testq	%rbx, %rbx
	je	LBB0_21
LBB0_18:                                ## =>This Inner Loop Header: Depth=1
	movq	8(%rbx), %rax
	xorl	%r12d, %r12d
	cmpq	%r13, 8(%rax)
	movq	(%rbx), %rax
	sete	%r12b
	movq	(%rax,%r12,8), %rsi
	testq	%rsi, %rsi
	je	LBB0_20
## %bb.19:                              ##   in Loop: Header=BB0_18 Depth=1
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_EmitMarkFace
	jmp	LBB0_20
LBB0_21:
	movq	(%r15), %rax
	movq	-48(%rbp), %r15                 ## 8-byte Reload
	movq	%r14, %rdx
	movq	_numleaffaces@GOTPCREL(%rip), %rcx
LBB0_22:
	movq	(%rcx), %rcx
	subq	%rax, %rcx
	movq	%rcx, 24(%r15,%rdx)
LBB0_23:
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_numleafs,8,3                   ## @numleafs
	.comm	_MAX_MAP_LEAFS,8,3              ## @MAX_MAP_LEAFS
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"MAX_MAP_LEAFS"

	.comm	_dleafs,8,3                     ## @dleafs
	.comm	_numleafbrushes,4,2             ## @numleafbrushes
	.comm	_MAX_MAP_LEAFBRUSHES,4,2        ## @MAX_MAP_LEAFBRUSHES
L_.str.1:                               ## @.str.1
	.asciz	"MAX_MAP_LEAFBRUSHES"

	.comm	_mapbrushes,4,2                 ## @mapbrushes
	.comm	_dleafbrushes,8,3               ## @dleafbrushes
	.comm	_CONTENTS_SOLID,4,2             ## @CONTENTS_SOLID
	.comm	_numleaffaces,8,3               ## @numleaffaces
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_EmitLeaf                       ; -- Begin function EmitLeaf
	.p2align	2
_EmitLeaf:                              ; @EmitLeaf
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	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
	.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, x0
Lloh0:
	adrp	x21, _numleafs@GOTPAGE
Lloh1:
	ldr	x21, [x21, _numleafs@GOTPAGEOFF]
	ldr	x22, [x21]
Lloh2:
	adrp	x8, _MAX_MAP_LEAFS@GOTPAGE
Lloh3:
	ldr	x8, [x8, _MAX_MAP_LEAFS@GOTPAGEOFF]
Lloh4:
	ldr	x8, [x8]
	cmp	x22, x8
	b.lo	LBB0_2
; %bb.1:
Lloh5:
	adrp	x0, l_.str@PAGE
Lloh6:
	add	x0, x0, l_.str@PAGEOFF
	bl	_Error
	ldr	x22, [x21]
LBB0_2:
Lloh7:
	adrp	x8, _dleafs@GOTPAGE
Lloh8:
	ldr	x8, [x8, _dleafs@GOTPAGEOFF]
Lloh9:
	ldr	x27, [x8]
	mov	w8, #48
	madd	x20, x22, x8, x27
	add	x8, x22, #1
	str	x8, [x21]
	ldr	w8, [x19]
	str	w8, [x20]
	ldr	d0, [x19, #32]
	str	d0, [x20, #40]
	ldr	w0, [x19, #28]
	ldr	w1, [x20, #36]
	bl	_VectorCopy
	ldr	w0, [x19, #24]
	ldr	w1, [x20, #32]
	bl	_VectorCopy
Lloh10:
	adrp	x24, _numleafbrushes@GOTPAGE
Lloh11:
	ldr	x24, [x24, _numleafbrushes@GOTPAGEOFF]
	ldr	w9, [x24]
	mov	x25, x20
	str	w9, [x25, #4]!
	ldr	x26, [x19, #16]
	ldr	w8, [x24]
	cbz	x26, LBB0_14
; %bb.3:
	str	x27, [sp, #8]                   ; 8-byte Folded Spill
Lloh12:
	adrp	x27, _MAX_MAP_LEAFBRUSHES@GOTPAGE
Lloh13:
	ldr	x27, [x27, _MAX_MAP_LEAFBRUSHES@GOTPAGEOFF]
Lloh14:
	adrp	x28, _mapbrushes@GOTPAGE
Lloh15:
	ldr	x28, [x28, _mapbrushes@GOTPAGEOFF]
Lloh16:
	adrp	x21, l_.str.1@PAGE
Lloh17:
	add	x21, x21, l_.str.1@PAGEOFF
Lloh18:
	adrp	x23, _dleafbrushes@GOTPAGE
Lloh19:
	ldr	x23, [x23, _dleafbrushes@GOTPAGEOFF]
	b	LBB0_6
LBB0_4:                                 ;   in Loop: Header=BB0_6 Depth=1
	ldr	x10, [x23]
	str	w9, [x10, w8, sxtw #2]
	ldr	w8, [x24]
	add	w8, w8, #1
	str	w8, [x24]
LBB0_5:                                 ;   in Loop: Header=BB0_6 Depth=1
	ldr	x26, [x26, #8]
	cbz	x26, LBB0_13
LBB0_6:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_10 Depth 2
	ldr	w9, [x27]
	cmp	w8, w9
	b.lt	LBB0_8
; %bb.7:                                ;   in Loop: Header=BB0_6 Depth=1
	mov	x0, x21
	bl	_Error
	ldr	w8, [x24]
LBB0_8:                                 ;   in Loop: Header=BB0_6 Depth=1
	ldr	w9, [x26]
	ldr	w10, [x28]
	sub	w9, w9, w10
	ldr	w10, [x25]
	cmp	w10, w8
	b.ge	LBB0_12
; %bb.9:                                ;   in Loop: Header=BB0_6 Depth=1
	sxtw	x12, w10
	ldr	x11, [x23]
	sxtw	x13, w8
	add	x11, x11, x12, lsl #2
	sub	x12, x13, x12
LBB0_10:                                ;   Parent Loop BB0_6 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	w13, [x11]
	cmp	w13, w9
	b.eq	LBB0_12
; %bb.11:                               ;   in Loop: Header=BB0_10 Depth=2
	add	w10, w10, #1
	add	x11, x11, #4
	subs	x12, x12, #1
	b.ne	LBB0_10
	b	LBB0_4
LBB0_12:                                ;   in Loop: Header=BB0_6 Depth=1
	cmp	w10, w8
	b.eq	LBB0_4
	b	LBB0_5
LBB0_13:
	ldr	w9, [x25]
	ldr	x27, [sp, #8]                   ; 8-byte Folded Reload
LBB0_14:
	sub	w8, w8, w9
	mov	w9, #48
	madd	x9, x22, x9, x27
	str	w8, [x9, #8]
	ldr	w8, [x20]
Lloh20:
	adrp	x9, _CONTENTS_SOLID@GOTPAGE
Lloh21:
	ldr	x9, [x9, _CONTENTS_SOLID@GOTPAGEOFF]
Lloh22:
	ldr	w9, [x9]
	tst	w9, w8
	b.ne	LBB0_21
; %bb.15:
Lloh23:
	adrp	x21, _numleaffaces@GOTPAGE
Lloh24:
	ldr	x21, [x21, _numleaffaces@GOTPAGEOFF]
	ldr	x8, [x21]
	mov	w9, #48
	madd	x23, x22, x9, x27
	str	x8, [x23, #16]!
	ldr	x24, [x19, #8]
	cbnz	x24, LBB0_17
	b	LBB0_20
LBB0_16:                                ;   in Loop: Header=BB0_17 Depth=1
	ldr	x8, [x24, #16]
	ldr	x24, [x8, x25, lsl #3]
	cbz	x24, LBB0_19
LBB0_17:                                ; =>This Inner Loop Header: Depth=1
	ldp	x9, x8, [x24]
	ldr	x8, [x8, #8]
	cmp	x8, x19
	cset	w25, eq
	ldr	x1, [x9, w25, uxtw #3]
	cbz	x1, LBB0_16
; %bb.18:                               ;   in Loop: Header=BB0_17 Depth=1
	mov	x0, x20
	bl	_EmitMarkFace
	b	LBB0_16
LBB0_19:
	ldr	x8, [x23]
LBB0_20:
	ldr	x9, [x21]
	sub	x8, x9, x8
	mov	w9, #48
	madd	x9, x22, x9, x27
	str	x8, [x9, #24]
LBB0_21:
	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
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh14, Lloh15
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.loh AdrpLdrGot	Lloh23, Lloh24
	.cfi_endproc
                                        ; -- End function
	.comm	_numleafs,8,3                   ; @numleafs
	.comm	_MAX_MAP_LEAFS,8,3              ; @MAX_MAP_LEAFS
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"MAX_MAP_LEAFS"

	.comm	_dleafs,8,3                     ; @dleafs
	.comm	_numleafbrushes,4,2             ; @numleafbrushes
	.comm	_MAX_MAP_LEAFBRUSHES,4,2        ; @MAX_MAP_LEAFBRUSHES
l_.str.1:                               ; @.str.1
	.asciz	"MAX_MAP_LEAFBRUSHES"

	.comm	_mapbrushes,4,2                 ; @mapbrushes
	.comm	_dleafbrushes,8,3               ; @dleafbrushes
	.comm	_CONTENTS_SOLID,4,2             ; @CONTENTS_SOLID
	.comm	_numleaffaces,8,3               ; @numleaffaces
.subsections_via_symbols
