	.file	"extr_map.c_AdjustBrushesForOrigin.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.globl	AdjustBrushesForOrigin
	.type	AdjustBrushesForOrigin, @function
AdjustBrushesForOrigin:
.LFB0:
	.cfi_startproc
	endbr64
	push	r14
	.cfi_def_cfa_offset 16
	.cfi_offset 14, -16
	push	r13
	.cfi_def_cfa_offset 24
	.cfi_offset 13, -24
	push	r12
	.cfi_def_cfa_offset 32
	.cfi_offset 12, -32
	push	rbp
	.cfi_def_cfa_offset 40
	.cfi_offset 6, -40
	mov	rbp, rdi
	push	rbx
	.cfi_def_cfa_offset 48
	.cfi_offset 3, -48
	mov	r14, QWORD PTR 16[rdi]
	test	r14, r14
	je	.L3
	.p2align 4,,10
	.p2align 3
.L2:
	mov	eax, DWORD PTR [r14]
	xor	ebx, ebx
	test	eax, eax
	jle	.L5
	.p2align 4,,10
	.p2align 3
.L4:
	mov	rax, QWORD PTR 8[r14]
	mov	esi, DWORD PTR 0[rbp]
	lea	r12, [rax+rbx*8]
	add	rbx, 1
	mov	rax, QWORD PTR [r12]
	sal	rax, 4
	add	rax, QWORD PTR mapplanes[rip]
	mov	r13, QWORD PTR 8[rax]
	mov	edi, DWORD PTR [rax]
	call	DotProduct@PLT
	mov	rsi, r13
	sub	rsi, rax
	mov	rax, QWORD PTR [r12]
	sal	rax, 4
	add	rax, QWORD PTR mapplanes[rip]
	mov	edi, DWORD PTR [rax]
	call	FindFloatPlane@PLT
	mov	QWORD PTR [r12], rax
	cmp	DWORD PTR [r14], ebx
	jg	.L4
.L5:
	mov	rdi, r14
	call	CreateBrushWindings@PLT
	mov	r14, QWORD PTR 16[r14]
	test	r14, r14
	jne	.L2
.L3:
	mov	r12, QWORD PTR 8[rbp]
	test	r12, r12
	je	.L1
	.p2align 4,,10
	.p2align 3
.L6:
	mov	eax, DWORD PTR 4[r12]
	imul	eax, DWORD PTR [r12]
	xor	ebx, ebx
	test	eax, eax
	jle	.L9
	.p2align 4,,10
	.p2align 3
.L8:
	mov	rax, QWORD PTR 8[r12]
	mov	esi, DWORD PTR 0[rbp]
	mov	edi, DWORD PTR [rax+rbx*4]
	add	rbx, 1
	mov	edx, edi
	call	VectorSubtract@PLT
	mov	eax, DWORD PTR [r12]
	imul	eax, DWORD PTR 4[r12]
	cmp	eax, ebx
	jg	.L8
.L9:
	mov	r12, QWORD PTR 16[r12]
	test	r12, r12
	jne	.L6
.L1:
	pop	rbx
	.cfi_def_cfa_offset 40
	pop	rbp
	.cfi_def_cfa_offset 32
	pop	r12
	.cfi_def_cfa_offset 24
	pop	r13
	.cfi_def_cfa_offset 16
	pop	r14
	.cfi_def_cfa_offset 8
	ret
	.cfi_endproc
.LFE0:
	.size	AdjustBrushesForOrigin, .-AdjustBrushesForOrigin
	.comm	mapplanes,8,8
	.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_map.c_AdjustBrushesForOrigin.c"
	.text
	.align	2
	.global	AdjustBrushesForOrigin
	.syntax unified
	.arm
	.fpu softvfp
	.type	AdjustBrushesForOrigin, %function
AdjustBrushesForOrigin:
	@ args = 0, pretend = 0, frame = 0
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, lr}
	ldr	r7, [r0, #8]
	mov	r6, r0
	cmp	r7, #0
	beq	.L3
	ldr	r8, .L25
.L2:
	ldr	r3, [r7]
	cmp	r3, #0
	movgt	r4, #0
	ble	.L5
.L4:
	ldr	r5, [r7, #4]
	ldr	r3, [r8]
	ldr	r2, [r5, r4, lsl #2]
	ldr	r1, [r6]
	add	ip, r3, r2, lsl #3
	ldr	r0, [r3, r2, lsl #3]
	ldr	r9, [ip, #4]
	bl	DotProduct
	ldr	r2, [r5, r4, lsl #2]
	ldr	r3, [r8]
	sub	r1, r9, r0
	ldr	r0, [r3, r2, lsl #3]
	bl	FindFloatPlane
	ldr	r3, [r7]
	str	r0, [r5, r4, lsl #2]
	add	r4, r4, #1
	cmp	r3, r4
	bgt	.L4
.L5:
	mov	r0, r7
	bl	CreateBrushWindings
	ldr	r7, [r7, #8]
	cmp	r7, #0
	bne	.L2
.L3:
	ldr	r5, [r6, #4]
	cmp	r5, #0
	popeq	{r4, r5, r6, r7, r8, r9, r10, pc}
.L6:
	ldm	r5, {r2, r3}
	mul	r3, r2, r3
	cmp	r3, #0
	movgt	r4, #0
	ble	.L9
.L8:
	ldr	r3, [r5, #8]
	ldr	r1, [r6]
	ldr	r2, [r3, r4, lsl #2]
	add	r4, r4, #1
	mov	r0, r2
	bl	VectorSubtract
	ldr	r3, [r5]
	ldr	r2, [r5, #4]
	mul	r3, r2, r3
	cmp	r3, r4
	bgt	.L8
.L9:
	ldr	r5, [r5, #12]
	cmp	r5, #0
	bne	.L6
	pop	{r4, r5, r6, r7, r8, r9, r10, pc}
.L26:
	.align	2
.L25:
	.word	mapplanes
	.size	AdjustBrushesForOrigin, .-AdjustBrushesForOrigin
	.comm	mapplanes,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
