	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_WriteBspBrushMap               ## -- Begin function WriteBspBrushMap
	.p2align	4, 0x90
_WriteBspBrushMap:                      ## @WriteBspBrushMap
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movq	%rdi, %r15
	leaq	L_.str(%rip), %rdi
	movq	%r15, %rsi
	callq	__printf
	leaq	L_.str.1(%rip), %rsi
	movq	%r15, %rdi
	callq	_fopen
	movq	%rax, %r13
	testq	%rax, %rax
	jne	LBB0_2
## %bb.1:
	leaq	L_.str.2(%rip), %rdi
	movq	%r15, %rsi
	callq	_Error
LBB0_2:
	leaq	L_.str.3(%rip), %rdi
	movl	$27, %esi
	movl	$1, %edx
	movq	%r13, %rcx
	callq	_fwrite
	testq	%r14, %r14
	je	LBB0_8
## %bb.3:
	movq	%r14, %r12
	movq	_mapplanes@GOTPCREL(%rip), %r15
	jmp	LBB0_4
	.p2align	4, 0x90
LBB0_7:                                 ##   in Loop: Header=BB0_4 Depth=1
	movl	$2, %esi
	movl	$1, %edx
	leaq	L_.str.7(%rip), %rdi
	movq	%r13, %rcx
	callq	_fwrite
	movq	16(%r12), %r12
	testq	%r12, %r12
	je	LBB0_8
LBB0_4:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_6 Depth 2
	movl	$2, %esi
	movl	$1, %edx
	leaq	L_.str.4(%rip), %rdi
	movq	%r13, %rcx
	callq	_fwrite
	cmpl	$0, (%r12)
	leaq	L_.str.6(%rip), %rbx
	jle	LBB0_7
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	8(%r12), %rax
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	xorl	%r14d, %r14d
	movq	%r12, -56(%rbp)                 ## 8-byte Spill
	.p2align	4, 0x90
LBB0_6:                                 ##   Parent Loop BB0_4 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	(%r15), %rax
	movq	-48(%rbp), %rcx                 ## 8-byte Reload
	movq	(%rcx,%r14,8), %rcx
	movl	(%rax,%rcx,8), %esi
	movl	4(%rax,%rcx,8), %edi
	callq	_BaseWindingForPlane
	movq	%rax, %r15
	movq	(%rax), %rax
	movq	(%rax), %rax
	movl	(%rax), %edx
	movl	8(%rax), %ecx
	movl	16(%rax), %r8d
	movq	%r13, %rdi
	movq	%r13, %r12
	leaq	L_.str.5(%rip), %r13
	movq	%r13, %rsi
	xorl	%eax, %eax
	callq	_fprintf
	movq	(%r15), %rax
	movq	8(%rax), %rax
	movl	(%rax), %edx
	movl	8(%rax), %ecx
	movl	16(%rax), %r8d
	movq	%r12, %rdi
	movq	%r13, %rsi
	xorl	%eax, %eax
	callq	_fprintf
	movq	(%r15), %rax
	movq	16(%rax), %rax
	movl	(%rax), %edx
	movl	8(%rax), %ecx
	movl	16(%rax), %r8d
	movq	%r12, %rdi
	movq	%r13, %rsi
	movq	%r12, %r13
	xorl	%eax, %eax
	callq	_fprintf
	movl	$20, %esi
	movl	$1, %edx
	movq	%rbx, %rdi
	movq	%r12, %rcx
	callq	_fwrite
	movq	%r15, %rdi
	movq	_mapplanes@GOTPCREL(%rip), %r15
	movq	-56(%rbp), %r12                 ## 8-byte Reload
	callq	_FreeWinding
	incq	%r14
	cmpl	(%r12), %r14d
	jl	LBB0_6
	jmp	LBB0_7
LBB0_8:
	leaq	L_.str.7(%rip), %rdi
	movl	$2, %esi
	movl	$1, %edx
	movq	%r13, %rcx
	callq	_fwrite
	movq	%r13, %rdi
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_fclose                         ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"writing %s\n"

L_.str.1:                               ## @.str.1
	.asciz	"wb"

L_.str.2:                               ## @.str.2
	.asciz	"Can't write %s\b"

L_.str.3:                               ## @.str.3
	.asciz	"{\n\"classname\" \"worldspawn\"\n"

L_.str.4:                               ## @.str.4
	.asciz	"{\n"

	.comm	_mapplanes,8,3                  ## @mapplanes
L_.str.5:                               ## @.str.5
	.asciz	"( %i %i %i ) "

L_.str.6:                               ## @.str.6
	.asciz	"notexture 0 0 0 1 1\n"

L_.str.7:                               ## @.str.7
	.asciz	"}\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_WriteBspBrushMap               ; -- Begin function WriteBspBrushMap
	.p2align	2
_WriteBspBrushMap:                      ; @WriteBspBrushMap
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #128
	.cfi_def_cfa_offset 128
	stp	x28, x27, [sp, #32]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #48]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #64]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #80]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #96]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #112]            ; 16-byte Folded Spill
	add	x29, sp, #112
	.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	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	mov	x1, x21
	bl	__printf
Lloh2:
	adrp	x1, l_.str.1@PAGE
Lloh3:
	add	x1, x1, l_.str.1@PAGEOFF
	mov	x0, x21
	bl	_fopen
	mov	x20, x0
	cbnz	x0, LBB0_2
; %bb.1:
Lloh4:
	adrp	x0, l_.str.2@PAGE
Lloh5:
	add	x0, x0, l_.str.2@PAGEOFF
	mov	x1, x21
	bl	_Error
LBB0_2:
Lloh6:
	adrp	x0, l_.str.3@PAGE
Lloh7:
	add	x0, x0, l_.str.3@PAGEOFF
	mov	w1, #27
	mov	w2, #1
	mov	x3, x20
	bl	_fwrite
	cbz	x19, LBB0_8
; %bb.3:
Lloh8:
	adrp	x21, l_.str.4@PAGE
Lloh9:
	add	x21, x21, l_.str.4@PAGEOFF
Lloh10:
	adrp	x26, _mapplanes@GOTPAGE
Lloh11:
	ldr	x26, [x26, _mapplanes@GOTPAGEOFF]
Lloh12:
	adrp	x22, l_.str.5@PAGE
Lloh13:
	add	x22, x22, l_.str.5@PAGEOFF
Lloh14:
	adrp	x23, l_.str.6@PAGE
Lloh15:
	add	x23, x23, l_.str.6@PAGEOFF
Lloh16:
	adrp	x24, l_.str.7@PAGE
Lloh17:
	add	x24, x24, l_.str.7@PAGEOFF
	b	LBB0_5
LBB0_4:                                 ;   in Loop: Header=BB0_5 Depth=1
	mov	x0, x24
	mov	w1, #2
	mov	w2, #1
	mov	x3, x20
	bl	_fwrite
	ldr	x19, [x19, #16]
	cbz	x19, LBB0_8
LBB0_5:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_7 Depth 2
	mov	x0, x21
	mov	w1, #2
	mov	w2, #1
	mov	x3, x20
	bl	_fwrite
	ldr	w8, [x19]
	cmp	w8, #1
	b.lt	LBB0_4
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=1
	mov	x27, #0
	ldr	x28, [x19, #8]
LBB0_7:                                 ;   Parent Loop BB0_5 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	x8, [x26]
	ldr	x9, [x28, x27, lsl #3]
	add	x8, x8, x9, lsl #3
	ldp	w1, w0, [x8]
	bl	_BaseWindingForPlane
	mov	x25, x0
	ldr	x8, [x0]
	ldr	x8, [x8]
	ldr	q0, [x8]
	ldr	x8, [x8, #16]
	str	x8, [sp, #16]
	str	q0, [sp]
	mov	x0, x20
	mov	x1, x22
	bl	_fprintf
	ldr	x8, [x25]
	ldr	x8, [x8, #8]
	ldr	q0, [x8]
	ldr	x8, [x8, #16]
	str	x8, [sp, #16]
	str	q0, [sp]
	mov	x0, x20
	mov	x1, x22
	bl	_fprintf
	ldr	x8, [x25]
	ldr	x8, [x8, #16]
	ldr	q0, [x8]
	ldr	x8, [x8, #16]
	str	x8, [sp, #16]
	str	q0, [sp]
	mov	x0, x20
	mov	x1, x22
	bl	_fprintf
	mov	x0, x23
	mov	w1, #20
	mov	w2, #1
	mov	x3, x20
	bl	_fwrite
	mov	x0, x25
	bl	_FreeWinding
	ldr	w8, [x19]
	add	x27, x27, #1
	cmp	w27, w8
	b.lt	LBB0_7
	b	LBB0_4
LBB0_8:
Lloh18:
	adrp	x0, l_.str.7@PAGE
Lloh19:
	add	x0, x0, l_.str.7@PAGEOFF
	mov	w1, #2
	mov	w2, #1
	mov	x3, x20
	bl	_fwrite
	mov	x0, x20
	ldp	x29, x30, [sp, #112]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #96]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #80]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #64]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #48]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #128
	b	_fclose
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh16, Lloh17
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpAdd	Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"writing %s\n"

l_.str.1:                               ; @.str.1
	.asciz	"wb"

l_.str.2:                               ; @.str.2
	.asciz	"Can't write %s\b"

l_.str.3:                               ; @.str.3
	.asciz	"{\n\"classname\" \"worldspawn\"\n"

l_.str.4:                               ; @.str.4
	.asciz	"{\n"

	.comm	_mapplanes,8,3                  ; @mapplanes
l_.str.5:                               ; @.str.5
	.asciz	"( %i %i %i ) "

l_.str.6:                               ; @.str.6
	.asciz	"notexture 0 0 0 1 1\n"

l_.str.7:                               ; @.str.7
	.asciz	"}\n"

.subsections_via_symbols
