	.file	"extr_surface.c_DrawSurfaceForMesh.c"
	.intel_syntax noprefix
	.text
	.section	.rodata.str1.8,"aMS",@progbits,1
	.align 8
.LC2:
	.string	"DrawSurfaceForMesh: bogus plane\n"
	.text
	.p2align 4
	.globl	DrawSurfaceForMesh
	.type	DrawSurfaceForMesh, @function
DrawSurfaceForMesh:
.LFB0:
	.cfi_startproc
	endbr64
	push	rbp
	.cfi_def_cfa_offset 16
	.cfi_offset 6, -16
	mov	rbp, rsp
	.cfi_def_cfa_register 6
	push	r15
	push	r14
	push	r13
	push	r12
	push	rbx
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	mov	rbx, rdx
	sub	rsp, 88
	mov	QWORD PTR -128[rbp], rdi
	mov	QWORD PTR -112[rbp], rsi
	mov	rdi, rsp
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -56[rbp], rax
	xor	eax, eax
	mov	eax, DWORD PTR MAX_EXPANDED_AXIS[rip]
	imul	eax, eax
	cdqe
	lea	rdx, 15[0+rax*8]
	mov	rcx, rdx
	and	rdx, -4096
	sub	rdi, rdx
	and	rcx, -16
	mov	rdx, rdi
	cmp	rsp, rdx
	je	.L3
.L74:
	sub	rsp, 4096
	or	QWORD PTR 4088[rsp], 0
	cmp	rsp, rdx
	jne	.L74
.L3:
	and	ecx, 4095
	sub	rsp, rcx
	test	rcx, rcx
	jne	.L75
.L4:
	lea	rax, 15[0+rax*4]
	mov	rcx, rsp
	mov	r13, rsp
	mov	rdx, rax
	and	rax, -4096
	sub	rcx, rax
	and	rdx, -16
	mov	rax, rcx
	cmp	rsp, rax
	je	.L6
.L76:
	sub	rsp, 4096
	or	QWORD PTR 4088[rsp], 0
	cmp	rsp, rax
	jne	.L76
.L6:
	and	edx, 4095
	sub	rsp, rdx
	test	rdx, rdx
	jne	.L77
.L7:
	mov	rcx, QWORD PTR -112[rbp]
	test	rbx, rbx
	mov	QWORD PTR -120[rbp], rsp
	mov	r12, QWORD PTR 48[rcx]
	lea	rax, 56[rcx]
	cmove	rbx, rax
	test	r12, r12
	je	.L1
	mov	eax, DWORD PTR [rbx]
	imul	eax, DWORD PTR 4[rbx]
	mov	rdi, rbx
	mov	r15d, eax
	mov	DWORD PTR -88[rbp], eax
	call	CopyMesh@PLT
	mov	rdi, QWORD PTR [rax]
	mov	rsi, QWORD PTR 8[rax]
	mov	r14, rax
	call	MakeMeshNormals@PLT
	test	r15d, r15d
	jle	.L10
	lea	eax, -1[r15]
	xor	r15d, r15d
	add	rax, 1
	sal	rax, 4
	mov	QWORD PTR -72[rbp], rax
	.p2align 4,,10
	.p2align 3
.L11:
	mov	rax, QWORD PTR 8[rbx]
	mov	rsi, QWORD PTR [rax+r15]
	mov	rax, QWORD PTR 8[r14]
	mov	rdi, QWORD PTR [rax+r15]
	add	r15, 16
	call	VectorCopy@PLT
	cmp	QWORD PTR -72[rbp], r15
	jne	.L11
	mov	rdi, QWORD PTR [r14]
	mov	rsi, QWORD PTR 8[r14]
	call	PutMeshOnCurve@PLT
	mov	rdi, QWORD PTR [r14]
	mov	rsi, QWORD PTR 8[r14]
	call	MakeMeshNormals@PLT
	xor	edx, edx
	jmp	.L15
	.p2align 4,,10
	.p2align 3
.L13:
	add	rdx, 16
	cmp	QWORD PTR -72[rbp], rdx
	je	.L41
.L15:
	mov	rax, QWORD PTR 8[rbx]
	mov	QWORD PTR -80[rbp], rdx
	mov	rsi, QWORD PTR [rax+rdx]
	mov	rax, QWORD PTR 8[r14]
	mov	rdi, QWORD PTR [rax+rdx]
	call	DotProduct@PLT
	movss	xmm2, DWORD PTR .LC0[rip]
	mov	rdx, QWORD PTR -80[rbp]
	comiss	xmm2, xmm0
	jbe	.L13
	mov	rax, QWORD PTR 8[rbx]
	mov	rsi, QWORD PTR [rax+rdx]
	mov	rax, QWORD PTR 8[r14]
	mov	rdi, QWORD PTR [rax+rdx]
	call	VectorCopy@PLT
	mov	rdx, QWORD PTR -80[rbp]
	add	rdx, 16
	cmp	QWORD PTR -72[rbp], rdx
	jne	.L15
.L41:
	mov	rdi, r14
	call	FreeMesh@PLT
	cmp	QWORD PTR 24[r12], 0
	je	.L16
	mov	rax, QWORD PTR -112[rbp]
	mov	rdi, QWORD PTR 32[rax]
	test	rdi, rdi
	je	.L16
	mov	eax, DWORD PTR -88[rbp]
	mov	r15, QWORD PTR qtrue[rip]
	test	eax, eax
	jle	.L17
	sub	eax, 1
	xor	r14d, r14d
	mov	QWORD PTR -72[rbp], rax
	.p2align 4,,10
	.p2align 3
.L18:
	mov	rax, r14
	sal	rax, 4
	add	rax, QWORD PTR 8[rbx]
	mov	rcx, QWORD PTR 8[rax]
	mov	rax, QWORD PTR -112[rbp]
	mov	edx, DWORD PTR 40[rax]
	mov	esi, DWORD PTR 44[rax]
	call	GetShaderIndexForPoint@PLT
	mov	rcx, QWORD PTR -112[rbp]
	mov	QWORD PTR 0[r13+r14*8], rax
	mov	rdi, QWORD PTR 32[rcx]
	mov	rdx, QWORD PTR [rdi]
	movss	xmm0, DWORD PTR [rdx+rax*4]
	mov	rax, QWORD PTR -120[rbp]
	movss	DWORD PTR [rax+r14*4], xmm0
	mov	rax, r14
	add	r14, 1
	cmp	QWORD PTR -72[rbp], rax
	jne	.L18
.L17:
	mov	edx, DWORD PTR -88[rbp]
	mov	rsi, rdi
	mov	rcx, r13
	mov	rdi, r12
	call	GetIndexedShader@PLT
	mov	QWORD PTR -104[rbp], rax
.L19:
	mov	edi, DWORD PTR SURFACE_PATCH[rip]
	call	AllocDrawSurface@PLT
	mov	r14, QWORD PTR -112[rbp]
	mov	edi, DWORD PTR [rbx]
	mov	r12, rax
	mov	eax, DWORD PTR 24[r14]
	mov	DWORD PTR 88[r12], eax
	mov	eax, DWORD PTR 20[r14]
	mov	DWORD PTR 84[r12], eax
	mov	eax, DWORD PTR 16[r14]
	mov	QWORD PTR 64[r12], r14
	mov	DWORD PTR 80[r12], eax
	mov	rax, QWORD PTR -104[rbp]
	mov	QWORD PTR 72[r12], rax
	mov	eax, DWORD PTR 12[r14]
	mov	DWORD PTR [r12], edi
	mov	DWORD PTR 56[r12], eax
	mov	eax, DWORD PTR 4[rbx]
	imul	edi, eax
	mov	DWORD PTR 4[r12], eax
	mov	DWORD PTR 8[r12], edi
	sal	edi, 5
	call	safe_malloc@PLT
	mov	edx, DWORD PTR 8[r12]
	mov	rsi, QWORD PTR 8[rbx]
	mov	QWORD PTR 40[r12], rax
	mov	rdi, rax
	sal	edx, 5
	call	memcpy@PLT
	xor	r9d, r9d
	mov	QWORD PTR 12[r12], -1
	mov	eax, DWORD PTR 8[r14]
	mov	rsi, r9
	mov	QWORD PTR -72[rbp], r9
	mov	DWORD PTR 52[r12], eax
	mov	eax, DWORD PTR 4[r14]
	mov	DWORD PTR 48[r12], eax
	mov	rax, QWORD PTR 8[rbx]
	mov	rdi, QWORD PTR [rax]
	call	VectorCopy@PLT
	mov	rax, QWORD PTR 8[rbx]
	mov	r9, QWORD PTR -72[rbp]
	mov	rdi, QWORD PTR 8[rax]
	mov	rsi, r9
	call	DotProduct@PLT
	mov	r9, QWORD PTR -72[rbp]
	movss	DWORD PTR ds:12, xmm0
	mov	r14, QWORD PTR qtrue[rip]
	mov	rdi, r9
	call	VectorLength@PLT
	movss	xmm1, DWORD PTR .LC1[rip]
	comiss	xmm1, xmm0
	ja	.L78
.L20:
	cmp	DWORD PTR 8[r12], 1
	jle	.L22
	test	r14, r14
	je	.L30
	xor	edx, edx
	jmp	.L26
	.p2align 4,,10
	.p2align 3
.L79:
	mov	rdx, r10
	test	r14, r14
	je	.L30
.L26:
	lea	r10, 1[rdx]
	mov	rax, QWORD PTR 8[rbx]
	xor	r9d, r9d
	mov	QWORD PTR -96[rbp], rdx
	mov	rcx, r10
	mov	rdi, r9
	mov	QWORD PTR -88[rbp], r10
	sal	rcx, 4
	mov	QWORD PTR -72[rbp], r9
	mov	rsi, QWORD PTR [rax+rcx]
	mov	QWORD PTR -80[rbp], rcx
	call	VectorCompare@PLT
	cmp	rax, QWORD PTR qfalse[rip]
	mov	rcx, QWORD PTR -80[rbp]
	cmove	r14, rax
	mov	rax, QWORD PTR 8[rbx]
	mov	r9, QWORD PTR -72[rbp]
	mov	rdi, QWORD PTR 8[rax+rcx]
	mov	rsi, r9
	call	DotProduct@PLT
	subss	xmm0, DWORD PTR ds:12
	call	fabs@PLT
	cmp	rax, QWORD PTR EQUAL_EPSILON[rip]
	mov	r10, QWORD PTR -88[rbp]
	mov	rdx, QWORD PTR -96[rbp]
	jle	.L25
	mov	r14, QWORD PTR qfalse[rip]
.L25:
	add	edx, 2
	cmp	DWORD PTR 8[r12], edx
	jg	.L79
.L22:
	test	r14, r14
	je	.L27
	xor	r9d, r9d
	mov	rdx, QWORD PTR 8[rbx]
	mov	esi, 1
	xor	ebx, ebx
	movss	xmm0, DWORD PTR 12[r9]
	mov	rdi, r9
	mov	QWORD PTR -72[rbp], r9
	add	rdx, 8
	call	FindFloatPlane@PLT
	mov	r9, QWORD PTR -72[rbp]
	mov	DWORD PTR 16[r12], eax
	mov	rax, QWORD PTR 24[r12]
	mov	rdi, r9
	mov	rsi, QWORD PTR 16[rax]
	call	VectorCopy@PLT
	mov	edx, DWORD PTR 8[r12]
	test	edx, edx
	jle	.L31
	.p2align 4,,10
	.p2align 3
.L28:
	mov	rax, rbx
	xor	r9d, r9d
	add	rbx, 1
	sal	rax, 5
	add	rax, QWORD PTR 40[r12]
	mov	rdi, r9
	mov	rsi, QWORD PTR [rax]
	call	VectorCopy@PLT
	mov	eax, DWORD PTR 8[r12]
	cmp	eax, ebx
	jg	.L28
.L29:
	test	eax, eax
	jle	.L31
.L30:
	movabs	r14, 1095216660735
	xor	ebx, ebx
	.p2align 4,,10
	.p2align 3
.L40:
	mov	rcx, rbx
	mov	rax, QWORD PTR -104[rbp]
	sal	rcx, 5
	add	rcx, QWORD PTR 40[r12]
	cmp	QWORD PTR flat[rip], 0
	je	.L32
	mov	rdx, QWORD PTR [rax]
	mov	rax, QWORD PTR 8[rcx]
	movss	xmm0, DWORD PTR [rdx]
	movss	DWORD PTR [rax], xmm0
	movss	xmm0, DWORD PTR 4[rdx]
	movss	DWORD PTR 4[rax], xmm0
.L33:
	mov	eax, DWORD PTR MAX_LIGHTMAPS[rip]
	test	eax, eax
	jle	.L39
	mov	rdi, QWORD PTR 24[rcx]
	xor	eax, eax
	.p2align 4,,10
	.p2align 3
.L38:
	mov	rdx, QWORD PTR [rdi+rax*8]
	mov	esi, 255
	mov	QWORD PTR [rdx], r14
	mov	DWORD PTR 8[rdx], 255
	test	r15, r15
	je	.L37
	mov	esi, DWORD PTR 0[r13+rbx*8]
.L37:
	add	rax, 1
	cmp	DWORD PTR MAX_LIGHTMAPS[rip], eax
	mov	DWORD PTR 12[rdx], esi
	jg	.L38
.L39:
	test	r15, r15
	je	.L36
	mov	rax, QWORD PTR 16[rcx]
	mov	rcx, QWORD PTR -120[rbp]
	movss	xmm0, DWORD PTR 8[rax]
	addss	xmm0, DWORD PTR [rcx+rbx*4]
	movss	DWORD PTR 8[rax], xmm0
.L36:
	add	rbx, 1
	cmp	DWORD PTR 8[r12], ebx
	jg	.L40
.L31:
	mov	rax, QWORD PTR -112[rbp]
	mov	eax, DWORD PTR [rax]
	mov	DWORD PTR 32[r12], eax
.L1:
	mov	rax, QWORD PTR -56[rbp]
	xor	rax, QWORD PTR fs:40
	jne	.L80
	lea	rsp, -40[rbp]
	mov	rax, r12
	pop	rbx
	pop	r12
	pop	r13
	pop	r14
	pop	r15
	pop	rbp
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
.L75:
	.cfi_restore_state
	or	QWORD PTR -8[rsp+rcx], 0
	jmp	.L4
	.p2align 4,,10
	.p2align 3
.L32:
	cmp	QWORD PTR 16[rax], 0
	je	.L33
	mov	rax, QWORD PTR -128[rbp]
	mov	rdi, QWORD PTR 16[rcx]
	xor	r9d, r9d
	mov	QWORD PTR -72[rbp], rcx
	mov	rdx, r9
	mov	esi, DWORD PTR [rax]
	call	VectorAdd@PLT
	mov	rcx, QWORD PTR -72[rbp]
	xor	r9d, r9d
	mov	rsi, r9
	mov	rax, QWORD PTR 8[rcx]
	mov	QWORD PTR -80[rbp], rcx
	mov	QWORD PTR -72[rbp], rax
	mov	rax, QWORD PTR -104[rbp]
	mov	rdx, QWORD PTR 8[rax]
	mov	rdi, QWORD PTR [rdx]
	call	DotProduct@PLT
	mov	rax, QWORD PTR -72[rbp]
	mov	rcx, QWORD PTR -80[rbp]
	xor	r9d, r9d
	mov	rsi, r9
	movss	DWORD PTR [rax], xmm0
	mov	rax, QWORD PTR 8[rcx]
	mov	QWORD PTR -72[rbp], rax
	mov	rax, QWORD PTR -104[rbp]
	mov	rdx, QWORD PTR 8[rax]
	mov	rdi, QWORD PTR 8[rdx]
	call	DotProduct@PLT
	mov	rax, QWORD PTR -72[rbp]
	mov	rcx, QWORD PTR -80[rbp]
	movss	DWORD PTR 4[rax], xmm0
	jmp	.L33
.L16:
	mov	QWORD PTR -104[rbp], r12
	mov	r15, QWORD PTR qfalse[rip]
	jmp	.L19
.L78:
	lea	rdi, .LC2[rip]
	call	Sys_Printf@PLT
	jmp	.L20
.L27:
	mov	eax, DWORD PTR 8[r12]
	jmp	.L29
.L10:
	mov	rdi, QWORD PTR [r14]
	mov	rsi, QWORD PTR 8[r14]
	call	PutMeshOnCurve@PLT
	mov	rdi, QWORD PTR [r14]
	mov	rsi, QWORD PTR 8[r14]
	call	MakeMeshNormals@PLT
	jmp	.L41
.L77:
	or	QWORD PTR -8[rsp+rdx], 0
	jmp	.L7
.L80:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	DrawSurfaceForMesh, .-DrawSurfaceForMesh
	.comm	qtrue,8,8
	.comm	qfalse,8,8
	.comm	flat,8,8
	.comm	SURFACE_PATCH,4,4
	.comm	MAX_LIGHTMAPS,4,4
	.comm	MAX_EXPANDED_AXIS,4,4
	.comm	EQUAL_EPSILON,8,8
	.section	.rodata.cst4,"aM",@progbits,4
	.align 4
.LC0:
	.long	1061158912
	.align 4
.LC1:
	.long	981668463
	.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_surface.c_DrawSurfaceForMesh.c"
	.text
	.global	__aeabi_fcmplt
	.section	.rodata.str1.4,"aMS",%progbits,1
	.align	2
.LC0:
	.ascii	"DrawSurfaceForMesh: bogus plane\012\000"
	.global	__aeabi_fsub
	.global	__aeabi_fadd
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC1:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	DrawSurfaceForMesh
	.syntax unified
	.arm
	.fpu softvfp
	.type	DrawSurfaceForMesh, %function
DrawSurfaceForMesh:
	@ args = 0, pretend = 0, frame = 32
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	add	fp, sp, #32
	sub	sp, sp, #36
	ldr	r3, .L71
	subs	r4, r2, #0
	ldr	r3, [r3]
	str	r1, [fp, #-56]
	mov	r2, r3
	mul	r2, r3, r2
	lsl	r3, r2, #2
	add	r3, r3, #7
	bic	r3, r3, #7
	sub	sp, sp, r3
	str	sp, [fp, #-60]
	sub	sp, sp, r3
	ldr	r3, .L71+4
	str	r0, [fp, #-64]
	ldr	r3, [r3]
	str	r3, [fp, #-40]
	mov	r3,#0
	moveq	r3, r1
	addeq	r4, r3, #44
	ldr	r3, [fp, #-56]
	str	sp, [fp, #-52]
	ldr	r7, [r3, #40]
	cmp	r7, #0
	beq	.L1
	ldr	r3, [r4, #4]
	ldr	r5, [r4]
	mov	r0, r4
	mul	r5, r3, r5
	bl	CopyMesh
	mov	r6, r0
	ldm	r0, {r0, r1, r2}
	bl	MakeMeshNormals
	cmp	r5, #0
	ble	.L4
	mov	r8, #0
.L5:
	ldr	r2, [r4, #8]
	ldr	r3, [r6, #8]
	ldr	r1, [r2, r8, lsl #3]
	ldr	r0, [r3, r8, lsl #3]
	add	r8, r8, #1
	bl	VectorCopy
	cmp	r5, r8
	bne	.L5
	ldm	r6, {r0, r1, r2}
	bl	PutMeshOnCurve
	ldm	r6, {r0, r1, r2}
	bl	MakeMeshNormals
	mov	r9, #0
	mov	r8, #1061158912
	b	.L9
.L7:
	add	r9, r9, #1
	cmp	r5, r9
	beq	.L35
.L9:
	ldr	r2, [r4, #8]
	ldr	r3, [r6, #8]
	ldr	r1, [r2, r9, lsl #3]
	ldr	r0, [r3, r9, lsl #3]
	bl	DotProduct
	mov	r1, r8
	bl	__aeabi_fcmplt
	cmp	r0, #0
	beq	.L7
	ldr	r2, [r4, #8]
	ldr	r3, [r6, #8]
	ldr	r1, [r2, r9, lsl #3]
	ldr	r0, [r3, r9, lsl #3]
	add	r9, r9, #1
	bl	VectorCopy
	cmp	r5, r9
	bne	.L9
.L35:
	mov	r0, r6
	bl	FreeMesh
	ldr	r3, [r7, #12]
	cmp	r3, #0
	bne	.L67
.L10:
	ldr	r9, .L71+8
	ldr	r3, .L71+12
	ldr	r6, [r9]
	str	r7, [fp, #-48]
	str	r3, [fp, #-68]
.L13:
	ldr	r3, .L71+16
	mov	r5, #0
	ldr	r0, [r3]
	bl	AllocDrawSurface
	ldm	r4, {r2, r3}
	mov	r7, r0
	ldr	r8, [fp, #-56]
	mul	r0, r3, r2
	ldr	r1, [r8, #24]
	ldr	ip, [r8, #20]
	str	r1, [r7, #60]
	ldr	r1, [r8, #16]
	str	ip, [r7, #56]
	str	r1, [r7, #52]
	ldr	ip, [fp, #-48]
	ldr	r1, [r8, #12]
	str	ip, [r7, #48]
	stm	r7, {r2, r3}
	str	r8, [r7, #44]
	str	r1, [r7, #40]
	str	r0, [r7, #8]
	lsl	r0, r0, #4
	bl	safe_malloc
	ldr	r2, [r7, #8]
	ldr	r1, [r4, #8]
	lsl	r2, r2, #4
	str	r0, [r7, #28]
	bl	memcpy
	ldmib	r8, {r1, r2}
	mvn	r3, #0
	str	r2, [r7, #36]
	ldr	r2, [r4, #8]
	str	r1, [r7, #32]
	ldr	r0, [r2]
	mov	r1, r5
	str	r3, [r7, #12]
	str	r3, [r7, #16]
	bl	VectorCopy
	ldr	r3, [r4, #8]
	mov	r1, r5
	ldr	r0, [r3, #4]
	bl	DotProduct
	mov	r3, r0
	str	r3, [r5, #12]	@ float
	ldr	r3, [fp, #-68]
	mov	r0, r5
	ldr	r8, [r3]
	bl	VectorLength
	ldr	r1, .L71+20
	bl	__aeabi_fcmplt
	cmp	r0, r5
	bne	.L68
.L14:
	ldr	r2, [r7, #8]
	cmp	r2, #1
	ble	.L16
	cmp	r8, #0
	beq	.L24
	mov	r5, #1
	ldr	r9, .L71+8
	b	.L20
.L69:
	cmp	r8, #0
	beq	.L24
.L20:
	mov	r10, #0
	ldr	r2, [r4, #8]
	mov	r0, r10
	ldr	r1, [r2, r5, lsl #3]
	bl	VectorCompare
	mov	ip, r0
	ldr	r1, [r9]
	ldr	r2, [r4, #8]
	lsl	r0, r5, #3
	cmp	ip, r1
	add	r2, r2, r0
	moveq	r8, r1
	ldr	r0, [r2, #4]
	mov	r1, r10
	bl	DotProduct
	ldr	r1, [r10, #12]	@ float
	bl	__aeabi_fsub
	bl	fabs
	ldr	r3, .L71+24
	add	r5, r5, #1
	ldr	r2, [r3]
	cmp	r0, r2
	ldr	r2, [r7, #8]
	ldrgt	r8, [r9]
	cmp	r2, r5
	bgt	.L69
.L16:
	cmp	r8, #0
	beq	.L23
	mov	r5, #0
	ldr	r3, [r4, #8]
	mov	r2, #1
	ldr	r1, [r5, #12]	@ float
	add	r3, r3, #4
	mov	r0, r5
	bl	FindFloatPlane
	ldr	r3, [r7, #20]
	str	r0, [r7, #16]
	ldr	r1, [r3, #8]
	mov	r0, r5
	bl	VectorCopy
	ldr	r3, [r7, #8]
	cmp	r3, r5
	movgt	r4, #0
	ble	.L25
.L22:
	ldr	r3, [r7, #28]
	mov	r0, #0
	ldr	r1, [r3, r4, lsl #4]
	bl	VectorCopy
	ldr	r2, [r7, #8]
	add	r4, r4, #1
	cmp	r2, r4
	bgt	.L22
.L23:
	cmp	r2, #0
	ble	.L25
.L24:
	mov	r10, #0
	mov	r4, #255
	ldr	r8, [fp, #-60]
	ldr	r5, .L71+28
.L34:
	ldr	r3, .L71+32
	ldr	r9, [r7, #28]
	ldr	r3, [r3]
	add	r9, r9, r10, lsl #4
	cmp	r3, #0
	ldr	r3, [fp, #-48]
	beq	.L26
	ldr	r2, [r3]
	ldr	r3, [r9, #4]
	ldr	r1, [r2]	@ float
	str	r1, [r3]	@ float
	ldr	r2, [r2, #4]	@ float
	str	r2, [r3, #4]	@ float
.L27:
	ldr	r3, [r5]
	cmp	r3, #0
	ble	.L33
	mov	r2, #0
	ldr	r1, [r9, #12]
	sub	r1, r1, #4
.L32:
	cmp	r6, #0
	moveq	r0, #255
	ldr	r3, [r1, #4]!
	ldrne	r0, [r8]
	str	r4, [r3]
	ldr	ip, [r5]
	add	r2, r2, #1
	cmp	ip, r2
	str	r4, [r3, #4]
	str	r4, [r3, #8]
	str	r0, [r3, #12]
	bgt	.L32
.L33:
	cmp	r6, #0
	beq	.L30
	ldr	r9, [r9, #8]
	ldr	r3, [fp, #-52]
	ldr	r0, [r9, #8]	@ float
	ldr	r1, [r3, r10, lsl #2]	@ float
	bl	__aeabi_fadd
	str	r0, [r9, #8]	@ float
.L30:
	ldr	r3, [r7, #8]
	add	r10, r10, #1
	cmp	r3, r10
	add	r8, r8, #4
	bgt	.L34
.L25:
	ldr	r3, [fp, #-56]
	ldr	r3, [r3]
	str	r3, [r7, #24]
.L1:
	ldr	r3, .L71+4
	ldr	r2, [r3]
	ldr	r3, [fp, #-40]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L70
	mov	r0, r7
	sub	sp, fp, #32
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L67:
	ldr	r3, [fp, #-56]
	ldr	r0, [r3, #28]
	cmp	r0, #0
	beq	.L10
	ldr	r2, .L71+12
	cmp	r5, #0
	ldr	r6, [r2]
	str	r2, [fp, #-68]
	ble	.L11
	str	r6, [fp, #-48]
	mov	r8, #0
	mov	r6, r3
	ldr	r2, [fp, #-60]
	sub	r10, r2, #4
	ldr	r2, [fp, #-52]
	sub	r9, r2, #4
.L12:
	ldr	r3, [r4, #8]
	ldr	r2, [r6, #32]
	add	r3, r3, r8, lsl #3
	ldr	r3, [r3, #4]
	ldr	r1, [r6, #36]
	bl	GetShaderIndexForPoint
	mov	r3, r0
	ldr	r0, [r6, #28]
	add	r8, r8, #1
	ldr	r2, [r0]
	cmp	r5, r8
	ldr	r2, [r2, r3, lsl #2]	@ float
	str	r3, [r10, #4]!
	str	r2, [r9, #4]!	@ float
	bne	.L12
	ldr	r6, [fp, #-48]
.L11:
	mov	r1, r0
	mov	r2, r5
	mov	r0, r7
	ldr	r3, [fp, #-60]
	bl	GetIndexedShader
	str	r0, [fp, #-48]
	b	.L13
.L26:
	ldr	r3, [r3, #8]
	cmp	r3, #0
	beq	.L27
	ldr	r3, [fp, #-64]
	mov	r2, #0
	ldr	r1, [r3]
	ldr	r0, [r9, #8]
	bl	VectorAdd
	mov	r2, #0
	ldr	r3, [fp, #-48]
	mov	r1, r2
	ldr	r3, [r3, #4]
	ldr	r0, [r3]
	ldr	r3, [r9, #4]
	str	r3, [fp, #-60]
	bl	DotProduct
	mov	r2, #0
	ldr	r3, [fp, #-48]
	mov	r1, r2
	ldr	ip, [r3, #4]
	ldr	r3, [fp, #-60]
	str	r0, [r3]	@ float
	ldr	r3, [r9, #4]
	ldr	r0, [ip, #4]
	str	r3, [fp, #-60]
	bl	DotProduct
	ldr	r3, [fp, #-60]
	str	r0, [r3, #4]	@ float
	b	.L27
.L68:
	ldr	r0, .L71+36
	bl	Sys_Printf
	b	.L14
.L4:
	ldm	r6, {r0, r1, r2}
	bl	PutMeshOnCurve
	ldm	r6, {r0, r1, r2}
	bl	MakeMeshNormals
	b	.L35
.L70:
	bl	__stack_chk_fail
.L72:
	.align	2
.L71:
	.word	MAX_EXPANDED_AXIS
	.word	.LC1
	.word	qfalse
	.word	qtrue
	.word	SURFACE_PATCH
	.word	981668463
	.word	EQUAL_EPSILON
	.word	MAX_LIGHTMAPS
	.word	flat
	.word	.LC0
	.size	DrawSurfaceForMesh, .-DrawSurfaceForMesh
	.comm	qtrue,4,4
	.comm	qfalse,4,4
	.comm	flat,4,4
	.comm	SURFACE_PATCH,4,4
	.comm	MAX_LIGHTMAPS,4,4
	.comm	MAX_EXPANDED_AXIS,4,4
	.comm	EQUAL_EPSILON,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
