	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_Q3_BSPBrushToMapBrush          ## -- Begin function Q3_BSPBrushToMapBrush
	.p2align	4, 0x90
_Q3_BSPBrushToMapBrush:                 ## @Q3_BSPBrushToMapBrush
	.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	$72, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %rbx
	movq	%rdi, %r13
	movq	_nummapbrushes@GOTPCREL(%rip), %r14
	movq	(%r14), %rax
	movq	_MAX_MAPFILE_BRUSHES@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jb	LBB0_2
## %bb.1:
	leaq	L_.str(%rip), %rdi
	callq	_Error
	movq	(%r14), %rax
LBB0_2:
	movq	_mapbrushes@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rsi
	leaq	(%rax,%rax,4), %rdi
	movq	_brushsides@GOTPCREL(%rip), %rdx
	movq	_nummapbrushsides@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	leaq	(%rcx,%rcx,4), %rcx
	shlq	$2, %rcx
	addq	(%rdx), %rcx
	movq	%rcx, 8(%rsi,%rdi,8)
	movq	_entities@GOTPCREL(%rip), %rcx
	movslq	(%rcx), %rcx
	shlq	$4, %rcx
	movq	%rbx, %rdx
	subq	%rcx, %rdx
	movq	%rdx, 24(%rsi,%rdi,8)
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	subq	8(%rbx), %rax
	leaq	(%rsi,%rdi,8), %r15
	movq	%rax, 16(%rsi,%rdi,8)
	movq	_dbrushleafnums@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	_q3_dbrushes@GOTPCREL(%rip), %rcx
	movq	%r13, %rdx
	subq	(%rcx), %rdx
	sarq	$2, %rdx
	movl	(%rax,%rdx), %eax
	movq	%rsi, -64(%rbp)                 ## 8-byte Spill
	movq	%rdi, -56(%rbp)                 ## 8-byte Spill
	movl	%eax, 32(%rsi,%rdi,8)
	cmpl	$0, (%r13)
	jle	LBB0_28
## %bb.3:
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movq	-56(%rbp), %rcx                 ## 8-byte Reload
	leaq	(%rax,%rcx,8), %rax
	addq	$24, %rax
	movq	%rax, -88(%rbp)                 ## 8-byte Spill
	xorl	%r12d, %r12d
	movq	%r15, -96(%rbp)                 ## 8-byte Spill
	movq	%r13, -72(%rbp)                 ## 8-byte Spill
	jmp	LBB0_5
	.p2align	4, 0x90
LBB0_27:                                ##   in Loop: Header=BB0_5 Depth=1
	movq	8(%r15), %rax
	movslq	%ebx, %rcx
	leaq	(%rcx,%rcx,4), %rcx
	movl	%r14d, 12(%rax,%rcx,4)
	movq	_nummapbrushsides@GOTPCREL(%rip), %rax
	incq	(%rax)
	incl	%ebx
	movl	%ebx, (%r15)
LBB0_4:                                 ##   in Loop: Header=BB0_5 Depth=1
	incl	%r12d
	cmpl	(%r13), %r12d
	jge	LBB0_28
LBB0_5:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_19 Depth 2
	movq	_q3_dbrushsides@GOTPCREL(%rip), %rax
	movq	(%rax), %rsi
	movslq	4(%r13), %rbx
	movslq	%r12d, %r14
	addq	%r14, %rbx
	movq	_nummapbrushsides@GOTPCREL(%rip), %rax
	movq	(%rax), %rcx
	movq	%rbx, %rax
	movq	_MAX_MAPFILE_BRUSHSIDES@GOTPCREL(%rip), %rdx
	cmpq	(%rdx), %rcx
	jb	LBB0_7
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=1
	leaq	L_.str.1(%rip), %rdi
	movq	%rsi, %r15
	callq	_Error
	movq	%r15, %rsi
	movq	_nummapbrushsides@GOTPCREL(%rip), %rax
	movq	(%rax), %rcx
	movslq	4(%r13), %rax
	addq	%r14, %rax
LBB0_7:                                 ##   in Loop: Header=BB0_5 Depth=1
	movq	_brushsides@GOTPCREL(%rip), %rdx
	movq	(%rdx), %r15
	leaq	(%rcx,%rcx,4), %r13
	leaq	(%r15,%r13,4), %rdx
	movq	_q3_dbrushsidetextured@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	cmpq	$0, (%rcx,%rax,8)
	movq	_SFL_TEXTURED@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movq	%r12, -80(%rbp)                 ## 8-byte Spill
	movq	%rdx, -104(%rbp)                ## 8-byte Spill
	je	LBB0_9
## %bb.8:                               ##   in Loop: Header=BB0_5 Depth=1
	movq	_SFL_VISIBLE@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	orl	%eax, (%rdx)
	jmp	LBB0_10
	.p2align	4, 0x90
LBB0_9:                                 ##   in Loop: Header=BB0_5 Depth=1
	notl	%eax
	andl	%eax, (%rdx)
LBB0_10:                                ##   in Loop: Header=BB0_5 Depth=1
	shlq	$4, %rbx
	movq	%rsi, %r12
	movq	(%rsi,%rbx), %rax
	movq	_q3_dshaders@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	leaq	(%rax,%rax,2), %rax
	movl	(%rcx,%rax,4), %edx
	movl	%edx, 4(%r15,%r13,4)
	movl	4(%rcx,%rax,4), %edx
	leaq	8(%r15,%r13,4), %r14
	movl	%edx, 8(%r15,%r13,4)
	movl	8(%rcx,%rax,4), %edi
	leaq	L_.str.2(%rip), %rsi
	callq	_strstr
	testq	%rax, %rax
	je	LBB0_12
## %bb.11:                              ##   in Loop: Header=BB0_5 Depth=1
	movl	(%r14), %eax
	movq	_SURF_HINT@GOTPCREL(%rip), %rcx
	orl	(%rcx), %eax
	movl	%eax, (%r14)
	jmp	LBB0_13
	.p2align	4, 0x90
LBB0_12:                                ##   in Loop: Header=BB0_5 Depth=1
	movl	(%r14), %eax
LBB0_13:                                ##   in Loop: Header=BB0_5 Depth=1
	movq	_SURF_NODRAW@GOTPCREL(%rip), %rcx
	testl	%eax, (%rcx)
	je	LBB0_15
## %bb.14:                              ##   in Loop: Header=BB0_5 Depth=1
	movq	_SFL_VISIBLE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movq	_SFL_TEXTURED@GOTPCREL(%rip), %rdx
	orl	(%rdx), %ecx
	movq	-104(%rbp), %rdx                ## 8-byte Reload
	orl	%ecx, (%rdx)
LBB0_15:                                ##   in Loop: Header=BB0_5 Depth=1
	movq	_SURF_SKIP@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movq	_SURF_HINT@GOTPCREL(%rip), %rdx
	orl	(%rdx), %ecx
	testl	%eax, %ecx
	je	LBB0_17
## %bb.16:                              ##   in Loop: Header=BB0_5 Depth=1
	leaq	(%r15,%r13,4), %rax
	addq	$4, %rax
	movl	$0, (%rax)
LBB0_17:                                ##   in Loop: Header=BB0_5 Depth=1
	movq	_q3_dplanes@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	8(%r12,%rbx), %rcx
	movl	(%rax,%rcx,8), %esi
	movl	4(%rax,%rcx,8), %edi
	callq	_FindFloatPlane
	movl	%eax, %r14d
	movq	-96(%rbp), %r15                 ## 8-byte Reload
	movl	(%r15), %eax
	testl	%eax, %eax
	jle	LBB0_23
## %bb.18:                              ##   in Loop: Header=BB0_5 Depth=1
	movq	8(%r15), %rcx
	movl	%r14d, %edx
	xorl	$1, %edx
	addq	$12, %rcx
	xorl	%ebx, %ebx
	movq	-72(%rbp), %r13                 ## 8-byte Reload
	movq	-80(%rbp), %r12                 ## 8-byte Reload
	.p2align	4, 0x90
LBB0_19:                                ##   Parent Loop BB0_5 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movl	(%rcx), %esi
	cmpl	%r14d, %esi
	je	LBB0_24
## %bb.20:                              ##   in Loop: Header=BB0_19 Depth=2
	cmpl	%edx, %esi
	je	LBB0_25
## %bb.21:                              ##   in Loop: Header=BB0_19 Depth=2
	incq	%rbx
	addq	$20, %rcx
	cmpq	%rbx, %rax
	jne	LBB0_19
## %bb.22:                              ##   in Loop: Header=BB0_5 Depth=1
	movl	%eax, %ebx
	cmpl	(%r15), %ebx
	jne	LBB0_4
	jmp	LBB0_27
	.p2align	4, 0x90
LBB0_23:                                ##   in Loop: Header=BB0_5 Depth=1
	xorl	%ebx, %ebx
	movq	-72(%rbp), %r13                 ## 8-byte Reload
	movq	-80(%rbp), %r12                 ## 8-byte Reload
	cmpl	(%r15), %ebx
	je	LBB0_27
	jmp	LBB0_4
	.p2align	4, 0x90
LBB0_24:                                ##   in Loop: Header=BB0_5 Depth=1
	leaq	L_.str.3(%rip), %rdi
	jmp	LBB0_26
	.p2align	4, 0x90
LBB0_25:                                ##   in Loop: Header=BB0_5 Depth=1
	leaq	L_.str.4(%rip), %rdi
LBB0_26:                                ##   in Loop: Header=BB0_5 Depth=1
	movq	-88(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rsi
	movq	-8(%rax), %rdx
	callq	_Log_Print
	cmpl	(%r15), %ebx
	jne	LBB0_4
	jmp	LBB0_27
LBB0_28:
	movq	_q3_dshaders@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	8(%r13), %rcx
	leaq	(%rcx,%rcx,2), %rcx
	movl	(%rax,%rcx,4), %eax
	movq	-64(%rbp), %r14                 ## 8-byte Reload
	movq	-56(%rbp), %rbx                 ## 8-byte Reload
	movl	%eax, 4(%r14,%rbx,8)
	movq	_CONTENTS_LADDER@GOTPCREL(%rip), %rcx
	movq	_CONTENTS_FOG@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	orl	(%rcx), %edx
	movq	_CONTENTS_STRUCTURAL@GOTPCREL(%rip), %rcx
	orl	(%rcx), %edx
	notl	%edx
	andl	%eax, %edx
	movl	%edx, 4(%r14,%rbx,8)
	movq	%r15, %rdi
	callq	_BrushExists
	testq	%rax, %rax
	je	LBB0_32
## %bb.29:
	movq	_c_squattbrushes@GOTPCREL(%rip), %rax
	incl	(%rax)
LBB0_30:
	movl	$0, (%r15)
LBB0_31:
	addq	$72, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_32:
	movq	_create_aas@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_34
## %bb.33:
	movq	%r15, %rdi
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	xorl	%edx, %edx
	addq	$72, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_AAS_CreateMapBrushes           ## TAILCALL
LBB0_34:
	leaq	(%r14,%rbx,8), %rbx
	addq	$4, %rbx
	movq	_nodetail@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	movq	_nummapbrushes@GOTPCREL(%rip), %r14
	je	LBB0_37
## %bb.35:
	movq	_CONTENTS_DETAIL@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%rbx)
	jne	LBB0_30
LBB0_37:
	movq	_nowater@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_40
## %bb.38:
	movq	_CONTENTS_LAVA@GOTPCREL(%rip), %rax
	movq	_CONTENTS_SLIME@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	movq	_CONTENTS_WATER@GOTPCREL(%rip), %rax
	orl	(%rax), %ecx
	testl	%ecx, (%rbx)
	jne	LBB0_30
LBB0_40:
	movq	%r15, %rdi
	callq	_MakeBrushWindings
	movq	%r15, %rdi
	callq	_MarkBrushBevels
	movq	_CONTENTS_PLAYERCLIP@GOTPCREL(%rip), %rax
	movq	_CONTENTS_MONSTERCLIP@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	testl	%ecx, (%rbx)
	je	LBB0_49
## %bb.41:
	movq	_c_clipbrushes@GOTPCREL(%rip), %rax
	incl	(%rax)
	movl	(%r15), %edx
	testl	%edx, %edx
	jle	LBB0_49
## %bb.42:
	movq	8(%r15), %r8
	leaq	-1(%rdx), %rsi
	movl	%edx, %ecx
	andl	$3, %ecx
	cmpq	$3, %rsi
	jae	LBB0_44
## %bb.43:
	xorl	%esi, %esi
	jmp	LBB0_46
LBB0_44:
	andl	$-4, %edx
	leaq	76(%r8), %rdi
	xorl	%esi, %esi
	movq	_TEXINFO_NODE@GOTPCREL(%rip), %rbx
	.p2align	4, 0x90
LBB0_45:                                ## =>This Inner Loop Header: Depth=1
	movl	(%rbx), %eax
	movl	%eax, -60(%rdi)
	movl	(%rbx), %eax
	movl	%eax, -40(%rdi)
	movl	(%rbx), %eax
	movl	%eax, -20(%rdi)
	movl	(%rbx), %eax
	movl	%eax, (%rdi)
	addq	$4, %rsi
	addq	$80, %rdi
	cmpq	%rsi, %rdx
	jne	LBB0_45
LBB0_46:
	testq	%rcx, %rcx
	je	LBB0_49
## %bb.47:
	leaq	(%rsi,%rsi,4), %rax
	leaq	(%r8,%rax,4), %rax
	addq	$16, %rax
	shlq	$2, %rcx
	leaq	(%rcx,%rcx,4), %rcx
	xorl	%edx, %edx
	movq	_TEXINFO_NODE@GOTPCREL(%rip), %rsi
	.p2align	4, 0x90
LBB0_48:                                ## =>This Inner Loop Header: Depth=1
	movl	(%rsi), %edi
	movl	%edi, (%rax,%rdx)
	addq	$20, %rdx
	cmpq	%rdx, %rcx
	jne	LBB0_48
LBB0_49:
	incq	(%r14)
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	incl	(%rax)
	jmp	LBB0_31
	.cfi_endproc
                                        ## -- End function
	.comm	_nummapbrushes,8,3              ## @nummapbrushes
	.comm	_MAX_MAPFILE_BRUSHES,8,3        ## @MAX_MAPFILE_BRUSHES
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"nummapbrushes >= MAX_MAPFILE_BRUSHES"

	.comm	_mapbrushes,8,3                 ## @mapbrushes
	.comm	_brushsides,8,3                 ## @brushsides
	.comm	_nummapbrushsides,8,3           ## @nummapbrushsides
	.comm	_entities,4,2                   ## @entities
	.comm	_dbrushleafnums,8,3             ## @dbrushleafnums
	.comm	_q3_dbrushes,8,3                ## @q3_dbrushes
	.comm	_q3_dbrushsides,8,3             ## @q3_dbrushsides
	.comm	_MAX_MAPFILE_BRUSHSIDES,8,3     ## @MAX_MAPFILE_BRUSHSIDES
L_.str.1:                               ## @.str.1
	.asciz	"MAX_MAPFILE_BRUSHSIDES"

	.comm	_q3_dbrushsidetextured,8,3      ## @q3_dbrushsidetextured
	.comm	_SFL_TEXTURED,4,2               ## @SFL_TEXTURED
	.comm	_SFL_VISIBLE,4,2                ## @SFL_VISIBLE
	.comm	_q3_dshaders,8,3                ## @q3_dshaders
L_.str.2:                               ## @.str.2
	.asciz	"common/hint"

	.comm	_SURF_HINT,4,2                  ## @SURF_HINT
	.comm	_SURF_NODRAW,4,2                ## @SURF_NODRAW
	.comm	_SURF_SKIP,4,2                  ## @SURF_SKIP
	.comm	_q3_dplanes,8,3                 ## @q3_dplanes
L_.str.3:                               ## @.str.3
	.asciz	"Entity %i, Brush %i: duplicate plane\n"

L_.str.4:                               ## @.str.4
	.asciz	"Entity %i, Brush %i: mirrored plane\n"

	.comm	_CONTENTS_LADDER,4,2            ## @CONTENTS_LADDER
	.comm	_CONTENTS_FOG,4,2               ## @CONTENTS_FOG
	.comm	_CONTENTS_STRUCTURAL,4,2        ## @CONTENTS_STRUCTURAL
	.comm	_c_squattbrushes,4,2            ## @c_squattbrushes
	.comm	_create_aas,8,3                 ## @create_aas
	.comm	_nodetail,8,3                   ## @nodetail
	.comm	_CONTENTS_DETAIL,4,2            ## @CONTENTS_DETAIL
	.comm	_nowater,8,3                    ## @nowater
	.comm	_CONTENTS_LAVA,4,2              ## @CONTENTS_LAVA
	.comm	_CONTENTS_SLIME,4,2             ## @CONTENTS_SLIME
	.comm	_CONTENTS_WATER,4,2             ## @CONTENTS_WATER
	.comm	_CONTENTS_PLAYERCLIP,4,2        ## @CONTENTS_PLAYERCLIP
	.comm	_CONTENTS_MONSTERCLIP,4,2       ## @CONTENTS_MONSTERCLIP
	.comm	_c_clipbrushes,4,2              ## @c_clipbrushes
	.comm	_TEXINFO_NODE,4,2               ## @TEXINFO_NODE
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_Q3_BSPBrushToMapBrush          ; -- Begin function Q3_BSPBrushToMapBrush
	.p2align	2
_Q3_BSPBrushToMapBrush:                 ; @Q3_BSPBrushToMapBrush
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #144
	.cfi_def_cfa_offset 144
	stp	x28, x27, [sp, #48]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #64]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #80]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #96]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #112]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #128]            ; 16-byte Folded Spill
	add	x29, sp, #128
	.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	x22, x1
	mov	x21, x0
Lloh0:
	adrp	x19, _nummapbrushes@GOTPAGE
Lloh1:
	ldr	x19, [x19, _nummapbrushes@GOTPAGEOFF]
	ldr	x10, [x19]
Lloh2:
	adrp	x8, _MAX_MAPFILE_BRUSHES@GOTPAGE
Lloh3:
	ldr	x8, [x8, _MAX_MAPFILE_BRUSHES@GOTPAGEOFF]
Lloh4:
	ldr	x8, [x8]
	cmp	x10, x8
	b.lo	LBB0_2
; %bb.1:
Lloh5:
	adrp	x0, l_.str@PAGE
Lloh6:
	add	x0, x0, l_.str@PAGEOFF
	bl	_Error
	ldr	x10, [x19]
LBB0_2:
Lloh7:
	adrp	x8, _mapbrushes@GOTPAGE
Lloh8:
	ldr	x8, [x8, _mapbrushes@GOTPAGEOFF]
Lloh9:
	ldr	x9, [x8]
	mov	w8, #40
	str	x9, [sp, #8]                    ; 8-byte Folded Spill
	madd	x20, x10, x8, x9
Lloh10:
	adrp	x8, _brushsides@GOTPAGE
Lloh11:
	ldr	x8, [x8, _brushsides@GOTPAGEOFF]
Lloh12:
	ldr	x8, [x8]
Lloh13:
	adrp	x19, _nummapbrushsides@GOTPAGE
Lloh14:
	ldr	x19, [x19, _nummapbrushsides@GOTPAGEOFF]
	ldr	x9, [x19]
	mov	w28, #20
	madd	x8, x9, x28, x8
	mov	x9, x20
	str	x8, [x9, #8]!
	str	x9, [sp, #40]                   ; 8-byte Folded Spill
Lloh15:
	adrp	x8, _entities@GOTPAGE
Lloh16:
	ldr	x8, [x8, _entities@GOTPAGEOFF]
Lloh17:
	ldrsw	x8, [x8]
	sub	x8, x22, x8, lsl #4
	mov	x9, x20
	str	x8, [x9, #24]!
	str	x9, [sp, #32]                   ; 8-byte Folded Spill
	str	x22, [sp]                       ; 8-byte Folded Spill
	ldr	x8, [x22, #8]
	sub	x8, x10, x8
	mov	x9, x20
	str	x8, [x9, #16]!
	stp	x10, x9, [sp, #16]              ; 16-byte Folded Spill
Lloh18:
	adrp	x8, _dbrushleafnums@GOTPAGE
Lloh19:
	ldr	x8, [x8, _dbrushleafnums@GOTPAGEOFF]
Lloh20:
	adrp	x9, _q3_dbrushes@GOTPAGE
Lloh21:
	ldr	x9, [x9, _q3_dbrushes@GOTPAGEOFF]
Lloh22:
	ldr	x8, [x8]
Lloh23:
	ldr	x9, [x9]
	sub	x9, x21, x9
	asr	x9, x9, #2
	ldr	w8, [x8, x9]
	str	w8, [x20, #32]
	ldr	w8, [x21]
	cmp	w8, #1
	b.lt	LBB0_30
; %bb.3:
	mov	w27, #0
	b	LBB0_5
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=1
	add	w27, w27, #1
	ldr	w8, [x21]
	cmp	w27, w8
	b.ge	LBB0_30
LBB0_5:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_20 Depth 2
Lloh24:
	adrp	x8, _q3_dbrushsides@GOTPAGE
Lloh25:
	ldr	x8, [x8, _q3_dbrushsides@GOTPAGEOFF]
Lloh26:
	ldr	x24, [x8]
	ldrsw	x8, [x21, #4]
	add	x23, x8, w27, sxtw
	ldr	x8, [x19]
Lloh27:
	adrp	x9, _MAX_MAPFILE_BRUSHSIDES@GOTPAGE
Lloh28:
	ldr	x9, [x9, _MAX_MAPFILE_BRUSHSIDES@GOTPAGEOFF]
Lloh29:
	ldr	x9, [x9]
	cmp	x8, x9
	b.hs	LBB0_7
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	x10, x23
	b	LBB0_8
LBB0_7:                                 ;   in Loop: Header=BB0_5 Depth=1
Lloh30:
	adrp	x0, l_.str.1@PAGE
Lloh31:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_Error
	ldr	x8, [x19]
	ldrsw	x9, [x21, #4]
	add	x10, x9, w27, sxtw
LBB0_8:                                 ;   in Loop: Header=BB0_5 Depth=1
Lloh32:
	adrp	x9, _brushsides@GOTPAGE
Lloh33:
	ldr	x9, [x9, _brushsides@GOTPAGEOFF]
Lloh34:
	ldr	x9, [x9]
	madd	x25, x8, x28, x9
Lloh35:
	adrp	x11, _q3_dbrushsidetextured@GOTPAGE
Lloh36:
	ldr	x11, [x11, _q3_dbrushsidetextured@GOTPAGEOFF]
Lloh37:
	ldr	x11, [x11]
	ldr	x11, [x11, x10, lsl #3]
Lloh38:
	adrp	x10, _SFL_TEXTURED@GOTPAGE
Lloh39:
	ldr	x10, [x10, _SFL_TEXTURED@GOTPAGEOFF]
Lloh40:
	ldr	w10, [x10]
	cbz	x11, LBB0_10
; %bb.9:                                ;   in Loop: Header=BB0_5 Depth=1
Lloh41:
	adrp	x11, _SFL_VISIBLE@GOTPAGE
Lloh42:
	ldr	x11, [x11, _SFL_VISIBLE@GOTPAGEOFF]
Lloh43:
	ldr	w11, [x11]
	orr	w10, w11, w10
	ldr	w11, [x25]
	orr	w10, w10, w11
	b	LBB0_11
LBB0_10:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	w11, [x25]
	bic	w10, w11, w10
LBB0_11:                                ;   in Loop: Header=BB0_5 Depth=1
	str	w10, [x25]
	lsl	x10, x23, #4
	ldr	x10, [x24, x10]
Lloh44:
	adrp	x11, _q3_dshaders@GOTPAGE
Lloh45:
	ldr	x11, [x11, _q3_dshaders@GOTPAGEOFF]
Lloh46:
	ldr	x11, [x11]
	mov	w12, #12
	madd	x10, x10, x12, x11
	madd	x22, x8, x28, x9
	ldr	d0, [x10]
	str	d0, [x22, #4]!
	add	x26, x22, #4
	ldr	w0, [x10, #8]
Lloh47:
	adrp	x1, l_.str.2@PAGE
Lloh48:
	add	x1, x1, l_.str.2@PAGEOFF
	bl	_strstr
	cbz	x0, LBB0_13
; %bb.12:                               ;   in Loop: Header=BB0_5 Depth=1
Lloh49:
	adrp	x8, _SURF_HINT@GOTPAGE
Lloh50:
	ldr	x8, [x8, _SURF_HINT@GOTPAGEOFF]
Lloh51:
	ldr	w8, [x8]
	ldr	w9, [x26]
	orr	w8, w9, w8
	str	w8, [x26]
	b	LBB0_14
LBB0_13:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	w8, [x26]
LBB0_14:                                ;   in Loop: Header=BB0_5 Depth=1
Lloh52:
	adrp	x9, _SURF_NODRAW@GOTPAGE
Lloh53:
	ldr	x9, [x9, _SURF_NODRAW@GOTPAGEOFF]
Lloh54:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_16
; %bb.15:                               ;   in Loop: Header=BB0_5 Depth=1
Lloh55:
	adrp	x9, _SFL_TEXTURED@GOTPAGE
Lloh56:
	ldr	x9, [x9, _SFL_TEXTURED@GOTPAGEOFF]
Lloh57:
	ldr	w9, [x9]
Lloh58:
	adrp	x10, _SFL_VISIBLE@GOTPAGE
Lloh59:
	ldr	x10, [x10, _SFL_VISIBLE@GOTPAGEOFF]
Lloh60:
	ldr	w10, [x10]
	orr	w9, w10, w9
	ldr	w10, [x25]
	orr	w9, w9, w10
	str	w9, [x25]
LBB0_16:                                ;   in Loop: Header=BB0_5 Depth=1
Lloh61:
	adrp	x9, _SURF_HINT@GOTPAGE
Lloh62:
	ldr	x9, [x9, _SURF_HINT@GOTPAGEOFF]
Lloh63:
	ldr	w9, [x9]
Lloh64:
	adrp	x10, _SURF_SKIP@GOTPAGE
Lloh65:
	ldr	x10, [x10, _SURF_SKIP@GOTPAGEOFF]
Lloh66:
	ldr	w10, [x10]
	orr	w9, w10, w9
	tst	w9, w8
	b.eq	LBB0_18
; %bb.17:                               ;   in Loop: Header=BB0_5 Depth=1
	str	wzr, [x22]
LBB0_18:                                ;   in Loop: Header=BB0_5 Depth=1
Lloh67:
	adrp	x8, _q3_dplanes@GOTPAGE
Lloh68:
	ldr	x8, [x8, _q3_dplanes@GOTPAGEOFF]
Lloh69:
	ldr	x8, [x8]
	add	x9, x24, x23, lsl #4
	ldr	x9, [x9, #8]
	add	x8, x8, x9, lsl #3
	ldp	w1, w0, [x8]
	bl	_FindFloatPlane
	mov	x24, x0
	ldr	w8, [x20]
	cmp	w8, #1
	b.lt	LBB0_24
; %bb.19:                               ;   in Loop: Header=BB0_5 Depth=1
	mov	x23, #0
	ldr	x9, [sp, #40]                   ; 8-byte Folded Reload
	ldr	x10, [x9]
	eor	w9, w24, #0x1
	add	x10, x10, #12
LBB0_20:                                ;   Parent Loop BB0_5 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	w11, [x10]
	cmp	w11, w24
	b.eq	LBB0_25
; %bb.21:                               ;   in Loop: Header=BB0_20 Depth=2
	cmp	w11, w9
	b.eq	LBB0_26
; %bb.22:                               ;   in Loop: Header=BB0_20 Depth=2
	add	x23, x23, #1
	add	x10, x10, #20
	cmp	x8, x23
	b.ne	LBB0_20
; %bb.23:                               ;   in Loop: Header=BB0_5 Depth=1
	mov	x23, x8
	b	LBB0_28
LBB0_24:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	w23, #0
	b	LBB0_28
LBB0_25:                                ;   in Loop: Header=BB0_5 Depth=1
Lloh70:
	adrp	x0, l_.str.3@PAGE
Lloh71:
	add	x0, x0, l_.str.3@PAGEOFF
	b	LBB0_27
LBB0_26:                                ;   in Loop: Header=BB0_5 Depth=1
Lloh72:
	adrp	x0, l_.str.4@PAGE
Lloh73:
	add	x0, x0, l_.str.4@PAGEOFF
LBB0_27:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	x8, [sp, #32]                   ; 8-byte Folded Reload
	ldr	x1, [x8]
	ldr	x8, [sp, #24]                   ; 8-byte Folded Reload
	ldr	x2, [x8]
	bl	_Log_Print
LBB0_28:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	w8, [x20]
	cmp	w23, w8
	b.ne	LBB0_4
; %bb.29:                               ;   in Loop: Header=BB0_5 Depth=1
	ldr	x8, [sp, #40]                   ; 8-byte Folded Reload
	ldr	x8, [x8]
	smaddl	x8, w23, w28, x8
	str	w24, [x8, #12]
	ldr	x8, [x19]
	add	x8, x8, #1
	str	x8, [x19]
	add	w8, w23, #1
	str	w8, [x20]
	b	LBB0_4
LBB0_30:
Lloh74:
	adrp	x8, _q3_dshaders@GOTPAGE
Lloh75:
	ldr	x8, [x8, _q3_dshaders@GOTPAGEOFF]
Lloh76:
	ldr	x8, [x8]
	ldr	x9, [x21, #8]
	mov	w10, #12
	mul	x9, x9, x10
	ldr	w8, [x8, x9]
	mov	w9, #40
	ldp	x11, x10, [sp, #8]              ; 16-byte Folded Reload
	madd	x19, x10, x9, x11
	str	w8, [x19, #4]!
Lloh77:
	adrp	x9, _CONTENTS_LADDER@GOTPAGE
Lloh78:
	ldr	x9, [x9, _CONTENTS_LADDER@GOTPAGEOFF]
Lloh79:
	ldr	w9, [x9]
Lloh80:
	adrp	x10, _CONTENTS_FOG@GOTPAGE
Lloh81:
	ldr	x10, [x10, _CONTENTS_FOG@GOTPAGEOFF]
Lloh82:
	ldr	w10, [x10]
	orr	w9, w10, w9
Lloh83:
	adrp	x10, _CONTENTS_STRUCTURAL@GOTPAGE
Lloh84:
	ldr	x10, [x10, _CONTENTS_STRUCTURAL@GOTPAGEOFF]
Lloh85:
	ldr	w10, [x10]
	orr	w9, w9, w10
	bic	w8, w8, w9
	str	w8, [x19]
	mov	x0, x20
	bl	_BrushExists
	cbz	x0, LBB0_34
; %bb.31:
Lloh86:
	adrp	x8, _c_squattbrushes@GOTPAGE
Lloh87:
	ldr	x8, [x8, _c_squattbrushes@GOTPAGEOFF]
	ldr	w9, [x8]
	add	w9, w9, #1
	str	w9, [x8]
LBB0_32:
	str	wzr, [x20]
LBB0_33:
	ldp	x29, x30, [sp, #128]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #112]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #96]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #80]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #64]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #144
	ret
LBB0_34:
Lloh88:
	adrp	x8, _create_aas@GOTPAGE
Lloh89:
	ldr	x8, [x8, _create_aas@GOTPAGEOFF]
Lloh90:
	ldr	x8, [x8]
	cbz	x8, LBB0_36
; %bb.35:
	mov	x0, x20
	ldr	x1, [sp]                        ; 8-byte Folded Reload
	mov	w2, #0
	ldp	x29, x30, [sp, #128]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #112]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #96]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #80]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #64]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #144
	b	_AAS_CreateMapBrushes
LBB0_36:
Lloh91:
	adrp	x8, _nodetail@GOTPAGE
Lloh92:
	ldr	x8, [x8, _nodetail@GOTPAGEOFF]
Lloh93:
	ldr	x8, [x8]
	cbz	x8, LBB0_38
; %bb.37:
	ldr	w8, [x19]
Lloh94:
	adrp	x9, _CONTENTS_DETAIL@GOTPAGE
Lloh95:
	ldr	x9, [x9, _CONTENTS_DETAIL@GOTPAGEOFF]
Lloh96:
	ldr	w9, [x9]
	tst	w9, w8
	b.ne	LBB0_32
LBB0_38:
Lloh97:
	adrp	x8, _nowater@GOTPAGE
Lloh98:
	ldr	x8, [x8, _nowater@GOTPAGEOFF]
Lloh99:
	ldr	x8, [x8]
	cbz	x8, LBB0_40
; %bb.39:
	ldr	w8, [x19]
Lloh100:
	adrp	x9, _CONTENTS_LAVA@GOTPAGE
Lloh101:
	ldr	x9, [x9, _CONTENTS_LAVA@GOTPAGEOFF]
Lloh102:
	ldr	w9, [x9]
Lloh103:
	adrp	x10, _CONTENTS_SLIME@GOTPAGE
Lloh104:
	ldr	x10, [x10, _CONTENTS_SLIME@GOTPAGEOFF]
Lloh105:
	ldr	w10, [x10]
	orr	w9, w10, w9
Lloh106:
	adrp	x10, _CONTENTS_WATER@GOTPAGE
Lloh107:
	ldr	x10, [x10, _CONTENTS_WATER@GOTPAGEOFF]
Lloh108:
	ldr	w10, [x10]
	orr	w9, w9, w10
	tst	w9, w8
	b.ne	LBB0_32
LBB0_40:
	mov	x0, x20
	bl	_MakeBrushWindings
	mov	x0, x20
	bl	_MarkBrushBevels
	ldr	w8, [x19]
Lloh109:
	adrp	x9, _CONTENTS_PLAYERCLIP@GOTPAGE
Lloh110:
	ldr	x9, [x9, _CONTENTS_PLAYERCLIP@GOTPAGEOFF]
Lloh111:
	ldr	w9, [x9]
Lloh112:
	adrp	x10, _CONTENTS_MONSTERCLIP@GOTPAGE
Lloh113:
	ldr	x10, [x10, _CONTENTS_MONSTERCLIP@GOTPAGEOFF]
Lloh114:
	ldr	w10, [x10]
	orr	w9, w10, w9
	tst	w9, w8
	b.eq	LBB0_44
; %bb.41:
Lloh115:
	adrp	x8, _c_clipbrushes@GOTPAGE
Lloh116:
	ldr	x8, [x8, _c_clipbrushes@GOTPAGEOFF]
	ldr	w9, [x8]
	add	w9, w9, #1
	str	w9, [x8]
	ldr	w8, [x20]
	cmp	w8, #1
	b.lt	LBB0_44
; %bb.42:
	ldr	x9, [sp, #40]                   ; 8-byte Folded Reload
	ldr	x9, [x9]
	add	x9, x9, #16
Lloh117:
	adrp	x10, _TEXINFO_NODE@GOTPAGE
Lloh118:
	ldr	x10, [x10, _TEXINFO_NODE@GOTPAGEOFF]
LBB0_43:                                ; =>This Inner Loop Header: Depth=1
	ldr	w11, [x10]
	str	w11, [x9], #20
	subs	x8, x8, #1
	b.ne	LBB0_43
LBB0_44:
Lloh119:
	adrp	x9, _nummapbrushes@GOTPAGE
Lloh120:
	ldr	x9, [x9, _nummapbrushes@GOTPAGEOFF]
	ldr	x8, [x9]
	add	x8, x8, #1
	str	x8, [x9]
	ldr	x9, [sp]                        ; 8-byte Folded Reload
	ldr	w8, [x9]
	add	w8, w8, #1
	str	w8, [x9]
	b	LBB0_33
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh22
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh27, Lloh28, Lloh29
	.loh AdrpLdrGotLdr	Lloh24, Lloh25, Lloh26
	.loh AdrpAdd	Lloh30, Lloh31
	.loh AdrpLdrGotLdr	Lloh38, Lloh39, Lloh40
	.loh AdrpLdrGotLdr	Lloh35, Lloh36, Lloh37
	.loh AdrpLdrGotLdr	Lloh32, Lloh33, Lloh34
	.loh AdrpLdrGotLdr	Lloh41, Lloh42, Lloh43
	.loh AdrpAdd	Lloh47, Lloh48
	.loh AdrpLdrGotLdr	Lloh44, Lloh45, Lloh46
	.loh AdrpLdrGotLdr	Lloh49, Lloh50, Lloh51
	.loh AdrpLdrGotLdr	Lloh52, Lloh53, Lloh54
	.loh AdrpLdrGotLdr	Lloh58, Lloh59, Lloh60
	.loh AdrpLdrGotLdr	Lloh55, Lloh56, Lloh57
	.loh AdrpLdrGotLdr	Lloh64, Lloh65, Lloh66
	.loh AdrpLdrGotLdr	Lloh61, Lloh62, Lloh63
	.loh AdrpLdrGotLdr	Lloh67, Lloh68, Lloh69
	.loh AdrpAdd	Lloh70, Lloh71
	.loh AdrpAdd	Lloh72, Lloh73
	.loh AdrpLdrGotLdr	Lloh83, Lloh84, Lloh85
	.loh AdrpLdrGotLdr	Lloh80, Lloh81, Lloh82
	.loh AdrpLdrGotLdr	Lloh77, Lloh78, Lloh79
	.loh AdrpLdrGotLdr	Lloh74, Lloh75, Lloh76
	.loh AdrpLdrGot	Lloh86, Lloh87
	.loh AdrpLdrGotLdr	Lloh88, Lloh89, Lloh90
	.loh AdrpLdrGotLdr	Lloh91, Lloh92, Lloh93
	.loh AdrpLdrGotLdr	Lloh94, Lloh95, Lloh96
	.loh AdrpLdrGotLdr	Lloh97, Lloh98, Lloh99
	.loh AdrpLdrGotLdr	Lloh106, Lloh107, Lloh108
	.loh AdrpLdrGotLdr	Lloh103, Lloh104, Lloh105
	.loh AdrpLdrGotLdr	Lloh100, Lloh101, Lloh102
	.loh AdrpLdrGotLdr	Lloh112, Lloh113, Lloh114
	.loh AdrpLdrGotLdr	Lloh109, Lloh110, Lloh111
	.loh AdrpLdrGot	Lloh115, Lloh116
	.loh AdrpLdrGot	Lloh117, Lloh118
	.loh AdrpLdrGot	Lloh119, Lloh120
	.cfi_endproc
                                        ; -- End function
	.comm	_nummapbrushes,8,3              ; @nummapbrushes
	.comm	_MAX_MAPFILE_BRUSHES,8,3        ; @MAX_MAPFILE_BRUSHES
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"nummapbrushes >= MAX_MAPFILE_BRUSHES"

	.comm	_mapbrushes,8,3                 ; @mapbrushes
	.comm	_brushsides,8,3                 ; @brushsides
	.comm	_nummapbrushsides,8,3           ; @nummapbrushsides
	.comm	_entities,4,2                   ; @entities
	.comm	_dbrushleafnums,8,3             ; @dbrushleafnums
	.comm	_q3_dbrushes,8,3                ; @q3_dbrushes
	.comm	_q3_dbrushsides,8,3             ; @q3_dbrushsides
	.comm	_MAX_MAPFILE_BRUSHSIDES,8,3     ; @MAX_MAPFILE_BRUSHSIDES
l_.str.1:                               ; @.str.1
	.asciz	"MAX_MAPFILE_BRUSHSIDES"

	.comm	_q3_dbrushsidetextured,8,3      ; @q3_dbrushsidetextured
	.comm	_SFL_TEXTURED,4,2               ; @SFL_TEXTURED
	.comm	_SFL_VISIBLE,4,2                ; @SFL_VISIBLE
	.comm	_q3_dshaders,8,3                ; @q3_dshaders
l_.str.2:                               ; @.str.2
	.asciz	"common/hint"

	.comm	_SURF_HINT,4,2                  ; @SURF_HINT
	.comm	_SURF_NODRAW,4,2                ; @SURF_NODRAW
	.comm	_SURF_SKIP,4,2                  ; @SURF_SKIP
	.comm	_q3_dplanes,8,3                 ; @q3_dplanes
l_.str.3:                               ; @.str.3
	.asciz	"Entity %i, Brush %i: duplicate plane\n"

l_.str.4:                               ; @.str.4
	.asciz	"Entity %i, Brush %i: mirrored plane\n"

	.comm	_CONTENTS_LADDER,4,2            ; @CONTENTS_LADDER
	.comm	_CONTENTS_FOG,4,2               ; @CONTENTS_FOG
	.comm	_CONTENTS_STRUCTURAL,4,2        ; @CONTENTS_STRUCTURAL
	.comm	_c_squattbrushes,4,2            ; @c_squattbrushes
	.comm	_create_aas,8,3                 ; @create_aas
	.comm	_nodetail,8,3                   ; @nodetail
	.comm	_CONTENTS_DETAIL,4,2            ; @CONTENTS_DETAIL
	.comm	_nowater,8,3                    ; @nowater
	.comm	_CONTENTS_LAVA,4,2              ; @CONTENTS_LAVA
	.comm	_CONTENTS_SLIME,4,2             ; @CONTENTS_SLIME
	.comm	_CONTENTS_WATER,4,2             ; @CONTENTS_WATER
	.comm	_CONTENTS_PLAYERCLIP,4,2        ; @CONTENTS_PLAYERCLIP
	.comm	_CONTENTS_MONSTERCLIP,4,2       ; @CONTENTS_MONSTERCLIP
	.comm	_c_clipbrushes,4,2              ; @c_clipbrushes
	.comm	_TEXINFO_NODE,4,2               ; @TEXINFO_NODE
.subsections_via_symbols
