	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_Sin_BSPBrushToMapBrush         ## -- Begin function Sin_BSPBrushToMapBrush
	.p2align	4, 0x90
_Sin_BSPBrushToMapBrush:                ## @Sin_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	$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	_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), %rbx
	leaq	(%rsi,%rbx,8), %rdi
	movq	_brushsides@GOTPCREL(%rip), %rdx
	movq	_nummapbrushsides@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rcx
	shlq	$5, %rcx
	addq	(%rdx), %rcx
	movq	%rcx, 8(%rsi,%rbx,8)
	movq	_entities@GOTPCREL(%rip), %rcx
	movslq	(%rcx), %rcx
	shlq	$4, %rcx
	movq	%r15, %rdx
	subq	%rcx, %rdx
	movq	%rdx, 24(%rsi,%rbx,8)
	movq	%r15, -56(%rbp)                 ## 8-byte Spill
	subq	8(%r15), %rax
	movq	%rax, 16(%rsi,%rbx,8)
	movq	_dbrushleafnums@GOTPCREL(%rip), %rax
	movq	_sin_dbrushes@GOTPCREL(%rip), %rcx
	movq	%r13, %rdx
	subq	(%rcx), %rdx
	movq	(%rax), %rax
	shrq	$2, %rdx
	movabsq	$-6148914691236517204, %rcx     ## imm = 0xAAAAAAAAAAAAAAAC
	imulq	%rdx, %rcx
	movl	(%rax,%rcx), %eax
	movq	%rsi, -72(%rbp)                 ## 8-byte Spill
	movq	%rbx, -64(%rbp)                 ## 8-byte Spill
	movl	%eax, 32(%rsi,%rbx,8)
	cmpl	$0, (%r13)
	movq	%rdi, -48(%rbp)                 ## 8-byte Spill
	jle	LBB0_34
## %bb.3:
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	leaq	(%rax,%rcx,8), %rax
	addq	$24, %rax
	movq	%rax, -80(%rbp)                 ## 8-byte Spill
	xorl	%r14d, %r14d
	movq	%r13, -88(%rbp)                 ## 8-byte Spill
	jmp	LBB0_4
	.p2align	4, 0x90
LBB0_33:                                ##   in Loop: Header=BB0_4 Depth=1
	incl	%r14d
	movq	-88(%rbp), %r13                 ## 8-byte Reload
	cmpl	(%r13), %r14d
	jge	LBB0_34
LBB0_4:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_23 Depth 2
	movq	_sin_dbrushsides@GOTPCREL(%rip), %rax
	movq	(%rax), %r12
	movslq	4(%r13), %r15
	movslq	%r14d, %rbx
	addq	%rbx, %r15
	movq	_nummapbrushsides@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%r15, %rdx
	movq	_MAX_MAPFILE_BRUSHSIDES@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jb	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	leaq	L_.str.1(%rip), %rdi
	callq	_Error
	movq	_nummapbrushsides@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movslq	4(%r13), %rdx
	addq	%rbx, %rdx
LBB0_6:                                 ##   in Loop: Header=BB0_4 Depth=1
	movq	_brushsides@GOTPCREL(%rip), %rcx
	movq	(%rcx), %r9
	movq	_sin_dbrushsidetextured@GOTPCREL(%rip), %rsi
	movq	(%rsi), %rsi
	cmpq	$0, (%rsi,%rdx,8)
	movq	_SFL_TEXTURED@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	je	LBB0_8
## %bb.7:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	%rax, %rsi
	shlq	$5, %rsi
	orl	%edx, 24(%r9,%rsi)
	jmp	LBB0_9
	.p2align	4, 0x90
LBB0_8:                                 ##   in Loop: Header=BB0_4 Depth=1
	notl	%edx
	movq	%rax, %rsi
	shlq	$5, %rsi
	andl	%edx, 24(%r9,%rsi)
LBB0_9:                                 ##   in Loop: Header=BB0_4 Depth=1
	movl	8(%r13), %edi
	shlq	$5, %rax
	leaq	(%r9,%rax), %r8
	movl	%edi, (%r9,%rax)
	shlq	$4, %r15
	movq	(%r12,%r15), %rsi
	movq	_sin_texinfo@GOTPCREL(%rip), %rbx
	movq	(%rbx), %rbx
	movl	(%rbx,%rsi,4), %esi
	movl	%esi, 4(%r9,%rax)
	movq	_SURF_TRANS66@GOTPCREL(%rip), %rdx
	movl	(%rdx), %ebx
	movq	_SURF_TRANS33@GOTPCREL(%rip), %rdx
	orl	(%rdx), %ebx
	testl	%esi, %ebx
	je	LBB0_10
## %bb.11:                              ##   in Loop: Header=BB0_4 Depth=1
	movq	_CONTENTS_DETAIL@GOTPCREL(%rip), %r10
	orl	(%r10), %edi
	movl	%edi, (%r8)
	movq	_CONTENTS_PLAYERCLIP@GOTPCREL(%rip), %rdx
	movq	_CONTENTS_MONSTERCLIP@GOTPCREL(%rip), %rcx
	jmp	LBB0_12
	.p2align	4, 0x90
LBB0_10:                                ##   in Loop: Header=BB0_4 Depth=1
	movq	_CONTENTS_PLAYERCLIP@GOTPCREL(%rip), %rdx
	movq	_CONTENTS_MONSTERCLIP@GOTPCREL(%rip), %rcx
	movq	_CONTENTS_DETAIL@GOTPCREL(%rip), %r10
LBB0_12:                                ##   in Loop: Header=BB0_4 Depth=1
	movl	(%rcx), %ebx
	orl	(%rdx), %ebx
	testl	%edi, %ebx
	je	LBB0_14
## %bb.13:                              ##   in Loop: Header=BB0_4 Depth=1
	orl	(%r10), %edi
	movl	%edi, (%r8)
LBB0_14:                                ##   in Loop: Header=BB0_4 Depth=1
	movq	_fulldetail@GOTPCREL(%rip), %rbx
	cmpq	$0, (%rbx)
	je	LBB0_16
## %bb.15:                              ##   in Loop: Header=BB0_4 Depth=1
	movl	(%r10), %ebx
	notl	%ebx
	andl	%ebx, %edi
	movl	%edi, (%r8)
LBB0_16:                                ##   in Loop: Header=BB0_4 Depth=1
	movq	_LAST_VISIBLE_CONTENTS@GOTPCREL(%rip), %rbx
	movl	(%rbx), %ebx
	decl	%ebx
	orl	(%rdx), %ebx
	orl	(%rcx), %ebx
	movq	_CONTENTS_MIST@GOTPCREL(%rip), %rcx
	orl	(%rcx), %ebx
	testl	%edi, %ebx
	jne	LBB0_18
## %bb.17:                              ##   in Loop: Header=BB0_4 Depth=1
	movq	_CONTENTS_SOLID@GOTPCREL(%rip), %rcx
	orl	(%rcx), %edi
	movl	%edi, (%r8)
LBB0_18:                                ##   in Loop: Header=BB0_4 Depth=1
	movq	_SURF_SKIP@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edi
	movq	_SURF_HINT@GOTPCREL(%rip), %rcx
	orl	(%rcx), %edi
	testl	%esi, %edi
	je	LBB0_20
## %bb.19:                              ##   in Loop: Header=BB0_4 Depth=1
	addq	%r9, %rax
	addq	$4, %rax
	movl	$0, (%r8)
	movl	(%r10), %ecx
	notl	%ecx
	andl	%ecx, %esi
	movl	%esi, (%rax)
LBB0_20:                                ##   in Loop: Header=BB0_4 Depth=1
	movq	_sin_dplanes@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	8(%r12,%r15), %rcx
	movl	(%rax,%rcx,8), %esi
	movl	4(%rax,%rcx,8), %edi
	callq	_FindFloatPlane
	movl	%eax, %ebx
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movl	(%rdi), %eax
	testl	%eax, %eax
	jle	LBB0_21
## %bb.22:                              ##   in Loop: Header=BB0_4 Depth=1
	movq	8(%rdi), %rcx
	movl	%ebx, %edx
	xorl	$1, %edx
	addq	$8, %rcx
	xorl	%r13d, %r13d
	.p2align	4, 0x90
LBB0_23:                                ##   Parent Loop BB0_4 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movl	(%rcx), %esi
	cmpl	%ebx, %esi
	je	LBB0_24
## %bb.25:                              ##   in Loop: Header=BB0_23 Depth=2
	cmpl	%edx, %esi
	je	LBB0_26
## %bb.28:                              ##   in Loop: Header=BB0_23 Depth=2
	incq	%r13
	addq	$32, %rcx
	cmpq	%r13, %rax
	jne	LBB0_23
## %bb.29:                              ##   in Loop: Header=BB0_4 Depth=1
	movl	%eax, %r13d
	jmp	LBB0_30
	.p2align	4, 0x90
LBB0_21:                                ##   in Loop: Header=BB0_4 Depth=1
	xorl	%r13d, %r13d
	cmpl	(%rdi), %r13d
	jne	LBB0_33
	jmp	LBB0_32
	.p2align	4, 0x90
LBB0_24:                                ##   in Loop: Header=BB0_4 Depth=1
	leaq	L_.str.2(%rip), %rdi
	jmp	LBB0_27
	.p2align	4, 0x90
LBB0_26:                                ##   in Loop: Header=BB0_4 Depth=1
	leaq	L_.str.3(%rip), %rdi
LBB0_27:                                ##   in Loop: Header=BB0_4 Depth=1
	movq	-80(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rsi
	movq	-8(%rax), %rdx
	callq	_Log_Print
LBB0_30:                                ##   in Loop: Header=BB0_4 Depth=1
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	cmpl	(%rdi), %r13d
	jne	LBB0_33
LBB0_32:                                ##   in Loop: Header=BB0_4 Depth=1
	addq	%r15, %r12
	movq	8(%rdi), %rax
	movslq	%r13d, %rcx
	shlq	$5, %rcx
	movl	%ebx, 8(%rax,%rcx)
	movq	(%r12), %rdx
	movq	%rdx, 16(%rax,%rcx)
	movq	_nummapbrushsides@GOTPCREL(%rip), %rax
	incq	(%rax)
	incl	%r13d
	movl	%r13d, (%rdi)
	jmp	LBB0_33
LBB0_34:
	movl	8(%r13), %eax
	movq	-72(%rbp), %r14                 ## 8-byte Reload
	movq	-64(%rbp), %r15                 ## 8-byte Reload
	movl	%eax, 4(%r14,%r15,8)
	movq	%rdi, %rbx
	callq	_Sin_BrushContents
	movq	%rbx, %rdi
	callq	_BrushExists
	testq	%rax, %rax
	je	LBB0_36
## %bb.35:
	movq	_c_squattbrushes@GOTPCREL(%rip), %rax
	incl	(%rax)
	movl	$0, (%rbx)
LBB0_53:
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_36:
	movq	_create_aas@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	je	LBB0_37
## %bb.54:
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	movq	-56(%rbp), %rsi                 ## 8-byte Reload
	xorl	%edx, %edx
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_AAS_CreateMapBrushes           ## TAILCALL
LBB0_37:
	leaq	(%r14,%r15,8), %rbx
	addq	$4, %rbx
	movq	_nodetail@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	movq	_nummapbrushes@GOTPCREL(%rip), %r14
	je	LBB0_40
## %bb.38:
	movq	_CONTENTS_DETAIL@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%rbx)
	je	LBB0_40
## %bb.39:
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movl	$0, (%rax)
	jmp	LBB0_53
LBB0_40:
	movq	_nowater@GOTPCREL(%rip), %rax
	cmpq	$0, (%rax)
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	je	LBB0_43
## %bb.41:
	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)
	je	LBB0_43
## %bb.42:
	movl	$0, (%rdi)
	jmp	LBB0_53
LBB0_43:
	callq	_MakeBrushWindings
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_MarkBrushBevels
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	movq	_CONTENTS_PLAYERCLIP@GOTPCREL(%rip), %rax
	movq	_CONTENTS_MONSTERCLIP@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	orl	(%rax), %ecx
	testl	%ecx, (%rbx)
	je	LBB0_52
## %bb.44:
	movq	_c_clipbrushes@GOTPCREL(%rip), %rax
	incl	(%rax)
	movl	(%rsi), %edx
	testl	%edx, %edx
	jle	LBB0_52
## %bb.45:
	movq	8(%rsi), %r8
	leaq	-1(%rdx), %rsi
	movl	%edx, %eax
	andl	$3, %eax
	cmpq	$3, %rsi
	jae	LBB0_47
## %bb.46:
	xorl	%esi, %esi
	jmp	LBB0_49
LBB0_47:
	andl	$-4, %edx
	leaq	112(%r8), %rdi
	xorl	%esi, %esi
	movq	_TEXINFO_NODE@GOTPCREL(%rip), %rbx
	.p2align	4, 0x90
LBB0_48:                                ## =>This Inner Loop Header: Depth=1
	movq	(%rbx), %rcx
	movq	%rcx, -96(%rdi)
	movq	(%rbx), %rcx
	movq	%rcx, -64(%rdi)
	movq	(%rbx), %rcx
	movq	%rcx, -32(%rdi)
	movq	(%rbx), %rcx
	movq	%rcx, (%rdi)
	addq	$4, %rsi
	subq	$-128, %rdi
	cmpq	%rsi, %rdx
	jne	LBB0_48
LBB0_49:
	testq	%rax, %rax
	je	LBB0_52
## %bb.50:
	shlq	$5, %rsi
	leaq	(%r8,%rsi), %rcx
	addq	$16, %rcx
	shlq	$5, %rax
	xorl	%edx, %edx
	movq	_TEXINFO_NODE@GOTPCREL(%rip), %rsi
	.p2align	4, 0x90
LBB0_51:                                ## =>This Inner Loop Header: Depth=1
	movq	(%rsi), %rdi
	movq	%rdi, (%rcx,%rdx)
	addq	$32, %rdx
	cmpq	%rdx, %rax
	jne	LBB0_51
LBB0_52:
	incq	(%r14)
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	incl	(%rax)
	jmp	LBB0_53
	.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	_sin_dbrushes,8,3               ## @sin_dbrushes
	.comm	_sin_dbrushsides,8,3            ## @sin_dbrushsides
	.comm	_MAX_MAPFILE_BRUSHSIDES,8,3     ## @MAX_MAPFILE_BRUSHSIDES
L_.str.1:                               ## @.str.1
	.asciz	"MAX_MAPFILE_BRUSHSIDES"

	.comm	_sin_dbrushsidetextured,8,3     ## @sin_dbrushsidetextured
	.comm	_SFL_TEXTURED,4,2               ## @SFL_TEXTURED
	.comm	_sin_texinfo,8,3                ## @sin_texinfo
	.comm	_SURF_TRANS33,4,2               ## @SURF_TRANS33
	.comm	_SURF_TRANS66,4,2               ## @SURF_TRANS66
	.comm	_CONTENTS_DETAIL,4,2            ## @CONTENTS_DETAIL
	.comm	_CONTENTS_PLAYERCLIP,4,2        ## @CONTENTS_PLAYERCLIP
	.comm	_CONTENTS_MONSTERCLIP,4,2       ## @CONTENTS_MONSTERCLIP
	.comm	_fulldetail,8,3                 ## @fulldetail
	.comm	_LAST_VISIBLE_CONTENTS,4,2      ## @LAST_VISIBLE_CONTENTS
	.comm	_CONTENTS_MIST,4,2              ## @CONTENTS_MIST
	.comm	_CONTENTS_SOLID,4,2             ## @CONTENTS_SOLID
	.comm	_SURF_HINT,4,2                  ## @SURF_HINT
	.comm	_SURF_SKIP,4,2                  ## @SURF_SKIP
	.comm	_sin_dplanes,8,3                ## @sin_dplanes
L_.str.2:                               ## @.str.2
	.asciz	"Entity %i, Brush %i: duplicate plane\n"

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

	.comm	_c_squattbrushes,4,2            ## @c_squattbrushes
	.comm	_create_aas,8,3                 ## @create_aas
	.comm	_nodetail,8,3                   ## @nodetail
	.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	_c_clipbrushes,4,2              ## @c_clipbrushes
	.comm	_TEXINFO_NODE,8,3               ## @TEXINFO_NODE
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_Sin_BSPBrushToMapBrush         ; -- Begin function Sin_BSPBrushToMapBrush
	.p2align	2
_Sin_BSPBrushToMapBrush:                ; @Sin_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	x19, x1
	mov	x21, x0
Lloh0:
	adrp	x20, _nummapbrushes@GOTPAGE
Lloh1:
	ldr	x20, [x20, _nummapbrushes@GOTPAGEOFF]
	ldr	x10, [x20]
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, [x20]
LBB0_2:
Lloh7:
	adrp	x8, _mapbrushes@GOTPAGE
Lloh8:
	ldr	x8, [x8, _mapbrushes@GOTPAGEOFF]
Lloh9:
	ldr	x9, [x8]
	mov	w8, #40
Lloh10:
	adrp	x11, _brushsides@GOTPAGE
Lloh11:
	ldr	x11, [x11, _brushsides@GOTPAGEOFF]
	str	x9, [sp, #8]                    ; 8-byte Folded Spill
	madd	x20, x10, x8, x9
Lloh12:
	ldr	x8, [x11]
Lloh13:
	adrp	x24, _nummapbrushsides@GOTPAGE
Lloh14:
	ldr	x24, [x24, _nummapbrushsides@GOTPAGEOFF]
	ldr	x9, [x24]
	add	x8, x8, x9, lsl #5
	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, x19, x8, lsl #4
	mov	x9, x20
	str	x8, [x9, #24]!
	str	x9, [sp, #32]                   ; 8-byte Folded Spill
	str	x19, [sp]                       ; 8-byte Folded Spill
	ldr	x8, [x19, #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:
	ldr	x8, [x8]
Lloh21:
	adrp	x9, _sin_dbrushes@GOTPAGE
Lloh22:
	ldr	x9, [x9, _sin_dbrushes@GOTPAGEOFF]
Lloh23:
	ldr	x9, [x9]
	sub	x9, x21, x9
	lsr	x9, x9, #2
	mov	x10, #-6148914691236517206
	movk	x10, #43692
	mul	x9, x9, x10
	ldr	w8, [x8, x9]
	str	w8, [x20, #32]
	ldr	w8, [x21]
	cmp	w8, #1
	b.lt	LBB0_33
; %bb.3:
	mov	w26, #0
Lloh24:
	adrp	x28, _CONTENTS_PLAYERCLIP@GOTPAGE
Lloh25:
	ldr	x28, [x28, _CONTENTS_PLAYERCLIP@GOTPAGEOFF]
Lloh26:
	adrp	x22, _CONTENTS_MONSTERCLIP@GOTPAGE
Lloh27:
	ldr	x22, [x22, _CONTENTS_MONSTERCLIP@GOTPAGEOFF]
Lloh28:
	adrp	x27, _CONTENTS_DETAIL@GOTPAGE
Lloh29:
	ldr	x27, [x27, _CONTENTS_DETAIL@GOTPAGEOFF]
	b	LBB0_5
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=1
	add	w26, w26, #1
	ldr	w8, [x21]
	cmp	w26, w8
	b.ge	LBB0_33
LBB0_5:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_23 Depth 2
Lloh30:
	adrp	x8, _sin_dbrushsides@GOTPAGE
Lloh31:
	ldr	x8, [x8, _sin_dbrushsides@GOTPAGEOFF]
Lloh32:
	ldr	x23, [x8]
	ldrsw	x8, [x21, #4]
	add	x25, x8, w26, sxtw
	ldr	x8, [x24]
Lloh33:
	adrp	x9, _MAX_MAPFILE_BRUSHSIDES@GOTPAGE
Lloh34:
	ldr	x9, [x9, _MAX_MAPFILE_BRUSHSIDES@GOTPAGEOFF]
Lloh35:
	ldr	x9, [x9]
	cmp	x8, x9
	b.hs	LBB0_7
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	x10, x25
	b	LBB0_8
LBB0_7:                                 ;   in Loop: Header=BB0_5 Depth=1
Lloh36:
	adrp	x0, l_.str.1@PAGE
Lloh37:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_Error
	ldr	x8, [x24]
	ldrsw	x9, [x21, #4]
	add	x10, x9, w26, sxtw
LBB0_8:                                 ;   in Loop: Header=BB0_5 Depth=1
Lloh38:
	adrp	x9, _brushsides@GOTPAGE
Lloh39:
	ldr	x9, [x9, _brushsides@GOTPAGEOFF]
Lloh40:
	ldr	x9, [x9]
Lloh41:
	adrp	x11, _sin_dbrushsidetextured@GOTPAGE
Lloh42:
	ldr	x11, [x11, _sin_dbrushsidetextured@GOTPAGEOFF]
Lloh43:
	ldr	x11, [x11]
	ldr	x11, [x11, x10, lsl #3]
Lloh44:
	adrp	x10, _SFL_TEXTURED@GOTPAGE
Lloh45:
	ldr	x10, [x10, _SFL_TEXTURED@GOTPAGEOFF]
Lloh46:
	ldr	w10, [x10]
	cbz	x11, LBB0_10
; %bb.9:                                ;   in Loop: Header=BB0_5 Depth=1
	add	x11, x9, x8, lsl #5
	ldr	w12, [x11, #24]
	orr	w10, w12, w10
	b	LBB0_11
LBB0_10:                                ;   in Loop: Header=BB0_5 Depth=1
	add	x11, x9, x8, lsl #5
	ldr	w12, [x11, #24]
	bic	w10, w12, w10
LBB0_11:                                ;   in Loop: Header=BB0_5 Depth=1
	str	w10, [x11, #24]
	ldr	w11, [x21, #8]
	add	x8, x9, x8, lsl #5
	str	w11, [x8]
	add	x19, x23, x25, lsl #4
	ldr	x9, [x19]
Lloh47:
	adrp	x10, _sin_texinfo@GOTPAGE
Lloh48:
	ldr	x10, [x10, _sin_texinfo@GOTPAGEOFF]
Lloh49:
	ldr	x10, [x10]
	ldr	w9, [x10, x9, lsl #2]
	mov	x10, x8
	str	w9, [x10, #4]!
Lloh50:
	adrp	x12, _SURF_TRANS33@GOTPAGE
Lloh51:
	ldr	x12, [x12, _SURF_TRANS33@GOTPAGEOFF]
Lloh52:
	ldr	w12, [x12]
Lloh53:
	adrp	x13, _SURF_TRANS66@GOTPAGE
Lloh54:
	ldr	x13, [x13, _SURF_TRANS66@GOTPAGEOFF]
Lloh55:
	ldr	w13, [x13]
	orr	w12, w13, w12
	tst	w12, w9
	b.eq	LBB0_13
; %bb.12:                               ;   in Loop: Header=BB0_5 Depth=1
	ldr	w12, [x27]
	orr	w11, w12, w11
	str	w11, [x8]
LBB0_13:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	w12, [x28]
	ldr	w13, [x22]
	orr	w12, w13, w12
	tst	w12, w11
	b.eq	LBB0_15
; %bb.14:                               ;   in Loop: Header=BB0_5 Depth=1
	ldr	w12, [x27]
	orr	w11, w12, w11
	str	w11, [x8]
LBB0_15:                                ;   in Loop: Header=BB0_5 Depth=1
Lloh56:
	adrp	x12, _fulldetail@GOTPAGE
Lloh57:
	ldr	x12, [x12, _fulldetail@GOTPAGEOFF]
Lloh58:
	ldr	x12, [x12]
	cbz	x12, LBB0_17
; %bb.16:                               ;   in Loop: Header=BB0_5 Depth=1
	ldr	w12, [x27]
	bic	w11, w11, w12
	str	w11, [x8]
LBB0_17:                                ;   in Loop: Header=BB0_5 Depth=1
Lloh59:
	adrp	x12, _LAST_VISIBLE_CONTENTS@GOTPAGE
Lloh60:
	ldr	x12, [x12, _LAST_VISIBLE_CONTENTS@GOTPAGEOFF]
Lloh61:
	ldr	w12, [x12]
	sub	w12, w12, #1
	ldr	w13, [x28]
	orr	w12, w12, w13
	ldr	w13, [x22]
	orr	w12, w12, w13
Lloh62:
	adrp	x13, _CONTENTS_MIST@GOTPAGE
Lloh63:
	ldr	x13, [x13, _CONTENTS_MIST@GOTPAGEOFF]
Lloh64:
	ldr	w13, [x13]
	orr	w12, w12, w13
	tst	w12, w11
	b.ne	LBB0_19
; %bb.18:                               ;   in Loop: Header=BB0_5 Depth=1
Lloh65:
	adrp	x12, _CONTENTS_SOLID@GOTPAGE
Lloh66:
	ldr	x12, [x12, _CONTENTS_SOLID@GOTPAGEOFF]
Lloh67:
	ldr	w12, [x12]
	orr	w11, w12, w11
	str	w11, [x8]
LBB0_19:                                ;   in Loop: Header=BB0_5 Depth=1
Lloh68:
	adrp	x11, _SURF_HINT@GOTPAGE
Lloh69:
	ldr	x11, [x11, _SURF_HINT@GOTPAGEOFF]
Lloh70:
	ldr	w11, [x11]
Lloh71:
	adrp	x12, _SURF_SKIP@GOTPAGE
Lloh72:
	ldr	x12, [x12, _SURF_SKIP@GOTPAGEOFF]
Lloh73:
	ldr	w12, [x12]
	orr	w11, w12, w11
	tst	w11, w9
	b.eq	LBB0_21
; %bb.20:                               ;   in Loop: Header=BB0_5 Depth=1
	str	wzr, [x8]
	ldr	w8, [x27]
	bic	w8, w9, w8
	str	w8, [x10]
LBB0_21:                                ;   in Loop: Header=BB0_5 Depth=1
Lloh74:
	adrp	x8, _sin_dplanes@GOTPAGE
Lloh75:
	ldr	x8, [x8, _sin_dplanes@GOTPAGEOFF]
Lloh76:
	ldr	x8, [x8]
	add	x9, x23, x25, lsl #4
	ldr	x9, [x9, #8]
	add	x8, x8, x9, lsl #3
	ldp	w1, w0, [x8]
	bl	_FindFloatPlane
	mov	x23, x0
	ldr	w8, [x20]
	cmp	w8, #1
	b.lt	LBB0_27
; %bb.22:                               ;   in Loop: Header=BB0_5 Depth=1
	mov	x25, #0
	ldr	x9, [sp, #40]                   ; 8-byte Folded Reload
	ldr	x10, [x9]
	eor	w9, w23, #0x1
	add	x10, x10, #8
LBB0_23:                                ;   Parent Loop BB0_5 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	w11, [x10]
	cmp	w11, w23
	b.eq	LBB0_28
; %bb.24:                               ;   in Loop: Header=BB0_23 Depth=2
	cmp	w11, w9
	b.eq	LBB0_29
; %bb.25:                               ;   in Loop: Header=BB0_23 Depth=2
	add	x25, x25, #1
	add	x10, x10, #32
	cmp	x8, x25
	b.ne	LBB0_23
; %bb.26:                               ;   in Loop: Header=BB0_5 Depth=1
	mov	x25, x8
	b	LBB0_31
LBB0_27:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	w25, #0
	b	LBB0_31
LBB0_28:                                ;   in Loop: Header=BB0_5 Depth=1
Lloh77:
	adrp	x0, l_.str.2@PAGE
Lloh78:
	add	x0, x0, l_.str.2@PAGEOFF
	b	LBB0_30
LBB0_29:                                ;   in Loop: Header=BB0_5 Depth=1
Lloh79:
	adrp	x0, l_.str.3@PAGE
Lloh80:
	add	x0, x0, l_.str.3@PAGEOFF
LBB0_30:                                ;   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_31:                                ;   in Loop: Header=BB0_5 Depth=1
	ldr	w8, [x20]
	cmp	w25, w8
	b.ne	LBB0_4
; %bb.32:                               ;   in Loop: Header=BB0_5 Depth=1
	ldr	x8, [sp, #40]                   ; 8-byte Folded Reload
	ldr	x8, [x8]
	mov	x9, x25
	sxtw	x9, w9
	add	x8, x8, x9, lsl #5
	str	w23, [x8, #8]
	ldr	x9, [x19]
	str	x9, [x8, #16]
	ldr	x8, [x24]
	add	x8, x8, #1
	str	x8, [x24]
	add	w8, w25, #1
	str	w8, [x20]
	b	LBB0_4
LBB0_33:
	ldr	w8, [x21, #8]
	mov	w9, #40
	ldp	x11, x10, [sp, #8]              ; 16-byte Folded Reload
	madd	x19, x10, x9, x11
	str	w8, [x19, #4]!
	mov	x0, x20
	bl	_Sin_BrushContents
	mov	x0, x20
	bl	_BrushExists
	cbz	x0, LBB0_37
; %bb.34:
Lloh81:
	adrp	x8, _c_squattbrushes@GOTPAGE
Lloh82:
	ldr	x8, [x8, _c_squattbrushes@GOTPAGEOFF]
	ldr	w9, [x8]
	add	w9, w9, #1
	str	w9, [x8]
LBB0_35:
	str	wzr, [x20]
LBB0_36:
	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_37:
Lloh83:
	adrp	x8, _create_aas@GOTPAGE
Lloh84:
	ldr	x8, [x8, _create_aas@GOTPAGEOFF]
Lloh85:
	ldr	x8, [x8]
	cbz	x8, LBB0_39
; %bb.38:
	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_39:
Lloh86:
	adrp	x8, _nodetail@GOTPAGE
Lloh87:
	ldr	x8, [x8, _nodetail@GOTPAGEOFF]
Lloh88:
	ldr	x8, [x8]
	cbz	x8, LBB0_41
; %bb.40:
	ldr	w8, [x19]
Lloh89:
	adrp	x9, _CONTENTS_DETAIL@GOTPAGE
Lloh90:
	ldr	x9, [x9, _CONTENTS_DETAIL@GOTPAGEOFF]
Lloh91:
	ldr	w9, [x9]
	tst	w9, w8
	b.ne	LBB0_35
LBB0_41:
Lloh92:
	adrp	x8, _nowater@GOTPAGE
Lloh93:
	ldr	x8, [x8, _nowater@GOTPAGEOFF]
Lloh94:
	ldr	x8, [x8]
	cbz	x8, LBB0_43
; %bb.42:
	ldr	w8, [x19]
Lloh95:
	adrp	x9, _CONTENTS_LAVA@GOTPAGE
Lloh96:
	ldr	x9, [x9, _CONTENTS_LAVA@GOTPAGEOFF]
Lloh97:
	ldr	w9, [x9]
Lloh98:
	adrp	x10, _CONTENTS_SLIME@GOTPAGE
Lloh99:
	ldr	x10, [x10, _CONTENTS_SLIME@GOTPAGEOFF]
Lloh100:
	ldr	w10, [x10]
	orr	w9, w10, w9
Lloh101:
	adrp	x10, _CONTENTS_WATER@GOTPAGE
Lloh102:
	ldr	x10, [x10, _CONTENTS_WATER@GOTPAGEOFF]
Lloh103:
	ldr	w10, [x10]
	orr	w9, w9, w10
	tst	w9, w8
	b.ne	LBB0_35
LBB0_43:
	mov	x0, x20
	bl	_MakeBrushWindings
	mov	x0, x20
	bl	_MarkBrushBevels
	ldr	w8, [x19]
Lloh104:
	adrp	x9, _CONTENTS_PLAYERCLIP@GOTPAGE
Lloh105:
	ldr	x9, [x9, _CONTENTS_PLAYERCLIP@GOTPAGEOFF]
Lloh106:
	ldr	w9, [x9]
Lloh107:
	adrp	x10, _CONTENTS_MONSTERCLIP@GOTPAGE
Lloh108:
	ldr	x10, [x10, _CONTENTS_MONSTERCLIP@GOTPAGEOFF]
Lloh109:
	ldr	w10, [x10]
	orr	w9, w10, w9
	tst	w9, w8
	b.eq	LBB0_47
; %bb.44:
Lloh110:
	adrp	x8, _c_clipbrushes@GOTPAGE
Lloh111:
	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_47
; %bb.45:
	ldr	x9, [sp, #40]                   ; 8-byte Folded Reload
	ldr	x9, [x9]
	add	x9, x9, #16
Lloh112:
	adrp	x10, _TEXINFO_NODE@GOTPAGE
Lloh113:
	ldr	x10, [x10, _TEXINFO_NODE@GOTPAGEOFF]
LBB0_46:                                ; =>This Inner Loop Header: Depth=1
	ldr	x11, [x10]
	str	x11, [x9], #32
	subs	x8, x8, #1
	b.ne	LBB0_46
LBB0_47:
Lloh114:
	adrp	x9, _nummapbrushes@GOTPAGE
Lloh115:
	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_36
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpAdd	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpLdrGotLdr	Lloh18, Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh28, Lloh29
	.loh AdrpLdrGot	Lloh26, Lloh27
	.loh AdrpLdrGot	Lloh24, Lloh25
	.loh AdrpLdrGotLdr	Lloh33, Lloh34, Lloh35
	.loh AdrpLdrGotLdr	Lloh30, Lloh31, Lloh32
	.loh AdrpAdd	Lloh36, Lloh37
	.loh AdrpLdrGotLdr	Lloh44, Lloh45, Lloh46
	.loh AdrpLdrGotLdr	Lloh41, Lloh42, Lloh43
	.loh AdrpLdrGotLdr	Lloh38, Lloh39, Lloh40
	.loh AdrpLdrGotLdr	Lloh53, Lloh54, Lloh55
	.loh AdrpLdrGotLdr	Lloh50, Lloh51, Lloh52
	.loh AdrpLdrGotLdr	Lloh47, Lloh48, Lloh49
	.loh AdrpLdrGotLdr	Lloh56, Lloh57, Lloh58
	.loh AdrpLdrGotLdr	Lloh62, Lloh63, Lloh64
	.loh AdrpLdrGotLdr	Lloh59, Lloh60, Lloh61
	.loh AdrpLdrGotLdr	Lloh65, Lloh66, Lloh67
	.loh AdrpLdrGotLdr	Lloh71, Lloh72, Lloh73
	.loh AdrpLdrGotLdr	Lloh68, Lloh69, Lloh70
	.loh AdrpLdrGotLdr	Lloh74, Lloh75, Lloh76
	.loh AdrpAdd	Lloh77, Lloh78
	.loh AdrpAdd	Lloh79, Lloh80
	.loh AdrpLdrGot	Lloh81, Lloh82
	.loh AdrpLdrGotLdr	Lloh83, Lloh84, Lloh85
	.loh AdrpLdrGotLdr	Lloh86, Lloh87, Lloh88
	.loh AdrpLdrGotLdr	Lloh89, Lloh90, Lloh91
	.loh AdrpLdrGotLdr	Lloh92, Lloh93, Lloh94
	.loh AdrpLdrGotLdr	Lloh101, Lloh102, Lloh103
	.loh AdrpLdrGotLdr	Lloh98, Lloh99, Lloh100
	.loh AdrpLdrGotLdr	Lloh95, Lloh96, Lloh97
	.loh AdrpLdrGotLdr	Lloh107, Lloh108, Lloh109
	.loh AdrpLdrGotLdr	Lloh104, Lloh105, Lloh106
	.loh AdrpLdrGot	Lloh110, Lloh111
	.loh AdrpLdrGot	Lloh112, Lloh113
	.loh AdrpLdrGot	Lloh114, Lloh115
	.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	_sin_dbrushes,8,3               ; @sin_dbrushes
	.comm	_sin_dbrushsides,8,3            ; @sin_dbrushsides
	.comm	_MAX_MAPFILE_BRUSHSIDES,8,3     ; @MAX_MAPFILE_BRUSHSIDES
l_.str.1:                               ; @.str.1
	.asciz	"MAX_MAPFILE_BRUSHSIDES"

	.comm	_sin_dbrushsidetextured,8,3     ; @sin_dbrushsidetextured
	.comm	_SFL_TEXTURED,4,2               ; @SFL_TEXTURED
	.comm	_sin_texinfo,8,3                ; @sin_texinfo
	.comm	_SURF_TRANS33,4,2               ; @SURF_TRANS33
	.comm	_SURF_TRANS66,4,2               ; @SURF_TRANS66
	.comm	_CONTENTS_DETAIL,4,2            ; @CONTENTS_DETAIL
	.comm	_CONTENTS_PLAYERCLIP,4,2        ; @CONTENTS_PLAYERCLIP
	.comm	_CONTENTS_MONSTERCLIP,4,2       ; @CONTENTS_MONSTERCLIP
	.comm	_fulldetail,8,3                 ; @fulldetail
	.comm	_LAST_VISIBLE_CONTENTS,4,2      ; @LAST_VISIBLE_CONTENTS
	.comm	_CONTENTS_MIST,4,2              ; @CONTENTS_MIST
	.comm	_CONTENTS_SOLID,4,2             ; @CONTENTS_SOLID
	.comm	_SURF_HINT,4,2                  ; @SURF_HINT
	.comm	_SURF_SKIP,4,2                  ; @SURF_SKIP
	.comm	_sin_dplanes,8,3                ; @sin_dplanes
l_.str.2:                               ; @.str.2
	.asciz	"Entity %i, Brush %i: duplicate plane\n"

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

	.comm	_c_squattbrushes,4,2            ; @c_squattbrushes
	.comm	_create_aas,8,3                 ; @create_aas
	.comm	_nodetail,8,3                   ; @nodetail
	.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	_c_clipbrushes,4,2              ; @c_clipbrushes
	.comm	_TEXINFO_NODE,8,3               ; @TEXINFO_NODE
.subsections_via_symbols
