	.file	"extr_brushbsp.c_BrushBSP.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.1,"aMS",@progbits,1
.LC0:
	.string	"-------- Brush BSP ---------\n"
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC1:
	.string	"WARNING: entity %i, brush %i: microbrush\n"
	.section	.rodata.str1.1
.LC2:
	.string	"%6i brushes\n"
.LC3:
	.string	"%6i visible faces\n"
.LC4:
	.string	"%6i nonvisible faces\n"
.LC5:
	.string	"%6i total sides\n"
.LC6:
	.string	"\n"
.LC7:
	.string	"%6d splits\r\n"
	.section	.rodata.str1.8
	.align 8
.LC8:
	.string	"%6i KB of peak total bsp memory\n"
	.text
	.p2align 4
	.globl	BrushBSP
	.type	BrushBSP, @function
BrushBSP:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	xor	eax, eax
	push	r14
	.cfi_def_cfa_offset 24
	.cfi_offset 14, -24
	push	r13
	.cfi_def_cfa_offset 32
	.cfi_offset 13, -32
	push	r12
	.cfi_def_cfa_offset 40
	.cfi_offset 12, -40
	push	rbp
	.cfi_def_cfa_offset 48
	.cfi_offset 6, -48
	push	rbx
	.cfi_def_cfa_offset 56
	.cfi_offset 3, -56
	mov	rbx, rdi
	sub	rsp, 24
	.cfi_def_cfa_offset 80
	mov	QWORD PTR [rsp], rdi
	lea	rdi, .LC0[rip]
	mov	DWORD PTR 8[rsp], esi
	mov	DWORD PTR 12[rsp], edx
	call	Log_Print@PLT
	xor	eax, eax
	call	Tree_Alloc@PLT
	mov	DWORD PTR c_totalsides[rip], 0
	mov	r13, rax
	test	rbx, rbx
	je	.L12
	mov	r15, rbx
	xor	ebp, ebp
	xor	ebx, ebx
	xor	r12d, r12d
	lea	r14, .LC1[rip]
	.p2align 4,,10
	.p2align 3
.L8:
	mov	rdi, r15
	add	ebx, 1
	call	BrushVolume@PLT
	cmp	QWORD PTR microvolume[rip], rax
	jg	.L18
.L3:
	mov	r9d, DWORD PTR [r15]
	test	r9d, r9d
	jle	.L4
	mov	rdx, QWORD PTR 16[r15]
	lea	eax, -1[r9]
	mov	edi, DWORD PTR SFL_BEVEL[rip]
	lea	rcx, [rax+rax*2]
	mov	r8, QWORD PTR TEXINFO_NODE[rip]
	mov	r10d, DWORD PTR SFL_VISIBLE[rip]
	lea	rax, 24[rdx]
	lea	rsi, [rax+rcx*8]
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L19:
	add	r12d, 1
.L5:
	mov	rdx, rax
	cmp	rax, rsi
	je	.L4
.L20:
	add	rax, 24
.L7:
	mov	ecx, DWORD PTR [rdx]
	test	ecx, edi
	jne	.L5
	mov	r11d, DWORD PTR 16[rdx]
	test	r11d, r11d
	je	.L5
	cmp	QWORD PTR 8[rdx], r8
	je	.L5
	test	ecx, r10d
	jne	.L19
	add	ebp, 1
	mov	rdx, rax
	cmp	rax, rsi
	jne	.L20
	.p2align 4,,10
	.p2align 3
.L4:
	mov	edi, DWORD PTR 8[r15]
	mov	edx, DWORD PTR 8[r13]
	mov	esi, DWORD PTR 12[r13]
	add	DWORD PTR c_totalsides[rip], r9d
	call	AddPointToBounds@PLT
	mov	edi, DWORD PTR 4[r15]
	mov	edx, DWORD PTR 8[r13]
	mov	esi, DWORD PTR 12[r13]
	call	AddPointToBounds@PLT
	mov	r15, QWORD PTR 32[r15]
	test	r15, r15
	jne	.L8
.L2:
	mov	esi, ebx
	lea	rdi, .LC2[rip]
	xor	eax, eax
	call	Log_Print@PLT
	mov	esi, r12d
	lea	rdi, .LC3[rip]
	xor	eax, eax
	call	Log_Print@PLT
	mov	esi, ebp
	lea	rdi, .LC4[rip]
	xor	eax, eax
	call	Log_Print@PLT
	mov	esi, DWORD PTR c_totalsides[rip]
	lea	rdi, .LC5[rip]
	xor	eax, eax
	call	Log_Print@PLT
	xor	eax, eax
	mov	DWORD PTR c_active_brushes[rip], ebx
	mov	QWORD PTR c_nodememory[rip], 0
	mov	QWORD PTR c_brushmemory[rip], 0
	mov	QWORD PTR c_peak_brushmemory[rip], 0
	mov	QWORD PTR c_nodes[rip], 0
	mov	QWORD PTR c_nonvis[rip], 0
	call	AllocNode@PLT
	mov	esi, DWORD PTR 12[rsp]
	mov	edi, DWORD PTR 8[rsp]
	mov	rbx, rax
	call	BrushFromBounds@PLT
	mov	rdi, r13
	mov	DWORD PTR 8[rbx], eax
	mov	rax, QWORD PTR [rsp]
	mov	QWORD PTR 0[r13], rbx
	mov	QWORD PTR numrecurse[rip], 0
	mov	QWORD PTR [rbx], rax
	call	BuildTree@PLT
	cmp	QWORD PTR cancelconversion[rip], 0
	je	.L21
.L1:
	add	rsp, 24
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	mov	rax, r13
	pop	rbx
	.cfi_def_cfa_offset 48
	pop	rbp
	.cfi_def_cfa_offset 40
	pop	r12
	.cfi_def_cfa_offset 32
	pop	r13
	.cfi_def_cfa_offset 24
	pop	r14
	.cfi_def_cfa_offset 16
	pop	r15
	.cfi_def_cfa_offset 8
	ret
	.p2align 4,,10
	.p2align 3
.L18:
	.cfi_restore_state
	mov	rax, QWORD PTR 24[r15]
	mov	rdi, r14
	mov	esi, DWORD PTR 4[rax]
	mov	edx, DWORD PTR [rax]
	xor	eax, eax
	call	Log_Print@PLT
	jmp	.L3
.L21:
	lea	rdi, .LC6[rip]
	call	qprintf@PLT
	mov	rsi, QWORD PTR numrecurse[rip]
	lea	rdi, .LC7[rip]
	call	Log_Write@PLT
	cmp	DWORD PTR numthreads[rip], 1
	jne	.L1
	mov	esi, DWORD PTR c_peak_totalbspmemory[rip]
	lea	rdi, .LC8[rip]
	xor	eax, eax
	sar	esi, 10
	call	Log_Print@PLT
	jmp	.L1
.L12:
	xor	ebx, ebx
	xor	ebp, ebp
	xor	r12d, r12d
	jmp	.L2
	.cfi_endproc
.LFE0:
	.size	BrushBSP, .-BrushBSP
	.comm	numthreads,4,4
	.comm	numrecurse,8,8
	.comm	microvolume,8,8
	.comm	cancelconversion,8,8
	.comm	c_totalsides,4,4
	.comm	c_peak_totalbspmemory,4,4
	.comm	c_peak_brushmemory,8,8
	.comm	c_nonvis,8,8
	.comm	c_nodes,8,8
	.comm	c_nodememory,8,8
	.comm	c_brushmemory,8,8
	.comm	c_active_brushes,4,4
	.comm	TEXINFO_NODE,8,8
	.comm	SFL_VISIBLE,4,4
	.comm	SFL_BEVEL,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",@progbits
	.section	.note.gnu.property,"a"
	.align 8
	.long	 1f - 0f
	.long	 4f - 1f
	.long	 5
0:
	.string	 "GNU"
1:
	.align 8
	.long	 0xc0000002
	.long	 3f - 2f
2:
	.long	 0x3
3:
	.align 8
4:

	.arch armv5t
	.eabi_attribute 20, 1
	.eabi_attribute 21, 1
	.eabi_attribute 23, 3
	.eabi_attribute 24, 1
	.eabi_attribute 25, 1
	.eabi_attribute 26, 2
	.eabi_attribute 30, 2
	.eabi_attribute 34, 0
	.eabi_attribute 18, 4
	.file	"extr_brushbsp.c_BrushBSP.c"
	.text
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"-------- Brush BSP ---------\012\000"
	.align	2
.LC1:
	.ascii	"WARNING: entity %i, brush %i: microbrush\012\000"
	.align	2
.LC2:
	.ascii	"%6i brushes\012\000"
	.align	2
.LC3:
	.ascii	"%6i visible faces\012\000"
	.align	2
.LC4:
	.ascii	"%6i nonvisible faces\012\000"
	.align	2
.LC5:
	.ascii	"%6i total sides\012\000"
	.align	2
.LC6:
	.ascii	"\012\000"
	.align	2
.LC7:
	.ascii	"%6d splits\015\012\000"
	.align	2
.LC8:
	.ascii	"%6i KB of peak total bsp memory\012\000"
	.text
	.align	2
	.global	BrushBSP
	.syntax unified
	.arm
	.fpu softvfp
	.type	BrushBSP, %function
BrushBSP:
	@ args = 0, pretend = 0, frame = 16
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	sub	sp, sp, #20
	mov	r9, r0
	mov	r7, #0
	str	r0, [sp, #4]
	ldr	r0, .L22
	str	r1, [sp, #8]
	str	r2, [sp, #12]
	bl	Log_Print
	bl	Tree_Alloc
	ldr	r8, .L22+4
	cmp	r9, r7
	mov	r4, r0
	str	r7, [r8]
	beq	.L12
	mov	r5, r7
	mov	r6, r7
.L8:
	mov	r0, r9
	bl	BrushVolume
	ldr	r3, .L22+8
	add	r7, r7, #1
	ldr	r3, [r3]
	cmp	r3, r0
	bgt	.L20
.L3:
	ldr	lr, [r9]
	cmp	lr, #0
	ble	.L4
	ldr	r2, .L22+12
	ldr	r3, [r9, #12]
	ldr	ip, [r2]
	ldr	r2, .L22+16
	add	r1, lr, lr, lsl #1
	ldr	r10, [r2]
	ldr	r2, .L22+20
	add	r1, r3, r1, lsl #2
	ldr	fp, [r2]
.L7:
	ldr	r2, [r3]
	tst	r2, ip
	bne	.L5
	ldr	r0, [r3, #8]
	cmp	r0, #0
	beq	.L5
	ldr	r0, [r3, #4]
	cmp	r0, r10
	beq	.L5
	tst	r2, fp
	addne	r6, r6, #1
	addeq	r5, r5, #1
.L5:
	add	r3, r3, #12
	cmp	r1, r3
	bne	.L7
.L4:
	ldr	r3, [r8]
	ldr	r2, [r4, #4]
	add	lr, r3, lr
	ldr	r1, [r4, #8]
	ldr	r0, [r9, #8]
	str	lr, [r8]
	bl	AddPointToBounds
	ldr	r0, [r9, #4]
	ldr	r2, [r4, #4]
	ldr	r1, [r4, #8]
	bl	AddPointToBounds
	ldr	r9, [r9, #20]
	cmp	r9, #0
	bne	.L8
.L2:
	mov	r9, #0
	mov	r1, r7
	ldr	r0, .L22+24
	bl	Log_Print
	mov	r1, r6
	ldr	r0, .L22+28
	bl	Log_Print
	mov	r1, r5
	ldr	r0, .L22+32
	bl	Log_Print
	ldr	r1, [r8]
	ldr	r0, .L22+36
	bl	Log_Print
	ldr	r3, .L22+40
	ldr	ip, .L22+44
	ldr	r2, .L22+48
	ldr	r1, .L22+52
	str	r9, [r3]
	ldr	r0, .L22+56
	ldr	r3, .L22+60
	str	r9, [ip]
	str	r9, [r2]
	str	r7, [r3]
	str	r9, [r1]
	str	r9, [r0]
	bl	AllocNode
	ldr	r1, [sp, #12]
	mov	r5, r0
	ldr	r0, [sp, #8]
	bl	BrushFromBounds
	ldr	r6, .L22+64
	ldr	r3, [sp, #4]
	str	r0, [r5, #4]
	str	r5, [r4]
	mov	r0, r4
	str	r9, [r6]
	str	r3, [r5]
	bl	BuildTree
	ldr	r3, .L22+68
	ldr	r3, [r3]
	cmp	r3, r9
	beq	.L21
.L1:
	mov	r0, r4
	add	sp, sp, #20
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L20:
	ldr	r3, [r9, #16]
	ldr	r0, .L22+72
	ldr	r2, [r3]
	ldr	r1, [r3, #4]
	bl	Log_Print
	b	.L3
.L21:
	ldr	r0, .L22+76
	bl	qprintf
	ldr	r1, [r6]
	ldr	r0, .L22+80
	bl	Log_Write
	ldr	r3, .L22+84
	ldr	r3, [r3]
	cmp	r3, #1
	bne	.L1
	ldr	r3, .L22+88
	ldr	r0, .L22+92
	ldr	r1, [r3]
	asr	r1, r1, #10
	bl	Log_Print
	b	.L1
.L12:
	ldr	r6, [sp, #4]
	mov	r7, r6
	mov	r5, r6
	b	.L2
.L23:
	.align	2
.L22:
	.word	.LC0
	.word	c_totalsides
	.word	microvolume
	.word	SFL_BEVEL
	.word	TEXINFO_NODE
	.word	SFL_VISIBLE
	.word	.LC2
	.word	.LC3
	.word	.LC4
	.word	.LC5
	.word	c_nodememory
	.word	c_brushmemory
	.word	c_nonvis
	.word	c_nodes
	.word	c_peak_brushmemory
	.word	c_active_brushes
	.word	numrecurse
	.word	cancelconversion
	.word	.LC1
	.word	.LC6
	.word	.LC7
	.word	numthreads
	.word	c_peak_totalbspmemory
	.word	.LC8
	.size	BrushBSP, .-BrushBSP
	.comm	numthreads,4,4
	.comm	numrecurse,4,4
	.comm	microvolume,4,4
	.comm	cancelconversion,4,4
	.comm	c_totalsides,4,4
	.comm	c_peak_totalbspmemory,4,4
	.comm	c_peak_brushmemory,4,4
	.comm	c_nonvis,4,4
	.comm	c_nodes,4,4
	.comm	c_nodememory,4,4
	.comm	c_brushmemory,4,4
	.comm	c_active_brushes,4,4
	.comm	TEXINFO_NODE,4,4
	.comm	SFL_VISIBLE,4,4
	.comm	SFL_BEVEL,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
