	.file	"extr_rtree.c_splitNodeStartree.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.type	splitNodeStartree, @function
splitNodeStartree:
.LFB0:
	.cfi_startproc
	endbr64
	push	r15
	.cfi_def_cfa_offset 16
	.cfi_offset 15, -16
	mov	r15, rdi
	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
	movsx	rbx, edx
	sub	rsp, 152
	.cfi_def_cfa_offset 208
	mov	rax, QWORD PTR 208[rsp]
	mov	QWORD PTR 8[rsp], rsi
	mov	DWORD PTR 36[rsp], edx
	mov	QWORD PTR 104[rsp], rcx
	mov	QWORD PTR 112[rsp], r8
	mov	QWORD PTR 88[rsp], r9
	mov	QWORD PTR 96[rsp], rax
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR 136[rsp], rax
	xor	eax, eax
	mov	rax, QWORD PTR RTREE_ZERO[rip]
	mov	QWORD PTR 80[rsp], rax
	mov	eax, DWORD PTR [rdi]
	lea	r12d, 1[rax]
	lea	rax, 2[rbx]
	imul	r12d, eax
	sal	r12d, 2
	mov	edi, r12d
	call	sqlite3_malloc64@PLT
	mov	QWORD PTR 72[rsp], rax
	test	rax, rax
	jne	.L2
	mov	eax, DWORD PTR SQLITE_NOMEM[rip]
.L1:
	mov	rsi, QWORD PTR 136[rsp]
	xor	rsi, QWORD PTR fs:40
	jne	.L57
	add	rsp, 152
	.cfi_remember_state
	.cfi_def_cfa_offset 56
	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
.L2:
	.cfi_restore_state
	movsx	rax, DWORD PTR [r15]
	mov	edx, DWORD PTR 36[rsp]
	xor	esi, esi
	mov	r13, QWORD PTR 72[rsp]
	imul	edx, eax
	sal	rax, 3
	mov	rdi, r13
	movsx	rdx, edx
	lea	rbp, [rax+rdx*4]
	mov	edx, r12d
	add	rbp, r13
	mov	QWORD PTR 16[rsp], rbp
	call	memset@PLT
	movsx	rax, DWORD PTR [r15]
	test	eax, eax
	jle	.L29
	lea	rdi, 0[0+rbx*4]
	mov	r14, r15
	xor	r12d, r12d
	xor	ebp, ebp
	mov	esi, DWORD PTR 36[rsp]
	mov	QWORD PTR [rsp], rdi
	mov	QWORD PTR 24[rsp], r13
	lea	ebx, -1[rsi]
	mov	r15d, esi
	.p2align 4,,10
	.p2align 3
.L6:
	lea	rsi, [r12+rax*8]
	add	rsi, QWORD PTR 72[rsp]
	xor	eax, eax
	mov	QWORD PTR 0[r13], rsi
	test	r15d, r15d
	jle	.L9
	.p2align 4,,10
	.p2align 3
.L8:
	mov	rdx, rax
	mov	DWORD PTR [rsi+rax*4], eax
	add	rax, 1
	cmp	rbx, rdx
	jne	.L8
.L9:
	mov	r9, QWORD PTR 16[rsp]
	mov	r8, QWORD PTR 8[rsp]
	mov	ecx, ebp
	mov	edx, r15d
	mov	rdi, r14
	add	ebp, 1
	add	r13, 8
	call	SortByDimension@PLT
	movsx	rax, DWORD PTR [r14]
	add	r12, QWORD PTR [rsp]
	cmp	eax, ebp
	jg	.L6
	mov	r15, r14
	mov	r14, QWORD PTR 24[rsp]
	test	eax, eax
	jle	.L29
	mov	rax, QWORD PTR [rsp]
	mov	DWORD PTR 120[rsp], 0
	lea	r12, 128[rsp]
	lea	r13, 132[rsp]
	mov	DWORD PTR 124[rsp], 0
	sub	rax, 4
	mov	DWORD PTR 68[rsp], 0
	mov	QWORD PTR 56[rsp], rax
	.p2align 4,,10
	.p2align 3
.L22:
	mov	rbx, QWORD PTR RTREE_ZERO[rip]
	mov	rdi, r15
	mov	QWORD PTR 24[rsp], rbx
	call	RTREE_MINCELLS@PLT
	mov	QWORD PTR 48[rsp], rbx
	mov	DWORD PTR [rsp], eax
	mov	QWORD PTR 40[rsp], rbx
	mov	DWORD PTR 64[rsp], 0
	.p2align 4,,10
	.p2align 3
.L10:
	mov	rdi, r15
	call	RTREE_MINCELLS@PLT
	mov	edi, DWORD PTR 36[rsp]
	sub	edi, eax
	cmp	edi, DWORD PTR [rsp]
	jl	.L58
	mov	rax, QWORD PTR [r14]
	mov	rbx, QWORD PTR 8[rsp]
	mov	edx, 4
	mov	rdi, r12
	xor	ebp, ebp
	movsx	rax, DWORD PTR [rax]
	lea	rsi, [rbx+rax*4]
	call	memcpy@PLT
	mov	rsi, QWORD PTR 56[rsp]
	mov	rax, QWORD PTR [r14]
	mov	rdi, r13
	mov	edx, 4
	movsx	rax, DWORD PTR [rax+rsi]
	lea	rsi, [rbx+rax*4]
	call	memcpy@PLT
	mov	eax, DWORD PTR 36[rsp]
	lea	edi, -3[rax]
	mov	QWORD PTR 16[rsp], rdi
	cmp	eax, 2
	jle	.L17
	mov	rax, r13
	mov	r13, r12
	mov	r12, rbp
	mov	rbp, r14
	mov	r14, rax
	jmp	.L16
	.p2align 4,,10
	.p2align 3
.L60:
	mov	rsi, r13
	mov	rdi, r15
	call	cellUnion@PLT
	cmp	QWORD PTR 16[rsp], r12
	je	.L59
.L31:
	mov	r12, rbx
.L16:
	mov	rax, QWORD PTR 0[rbp]
	mov	rcx, QWORD PTR 8[rsp]
	lea	rbx, 1[r12]
	movsx	rax, DWORD PTR 4[rax+r12*4]
	lea	rdx, [rcx+rax*4]
	lea	eax, 1[r12]
	cmp	DWORD PTR [rsp], eax
	jg	.L60
	mov	rsi, r14
	mov	rdi, r15
	call	cellUnion@PLT
	cmp	QWORD PTR 16[rsp], r12
	jne	.L31
.L59:
	mov	r12, r13
	mov	r13, r14
	mov	r14, rbp
.L17:
	mov	rsi, r12
	mov	rdi, r15
	call	cellMargin@PLT
	mov	rbx, QWORD PTR 24[rsp]
	mov	rsi, r13
	mov	rdi, r15
	add	rbx, rax
	call	cellMargin@PLT
	mov	ecx, 1
	mov	rdx, r13
	mov	rsi, r12
	add	rax, rbx
	mov	rdi, r15
	mov	QWORD PTR 24[rsp], rax
	call	cellOverlap@PLT
	mov	rsi, r12
	mov	rdi, r15
	mov	rbp, rax
	call	cellArea@PLT
	mov	rdi, r15
	mov	rsi, r13
	mov	rbx, rax
	call	cellArea@PLT
	mov	rdi, r15
	add	rbx, rax
	call	RTREE_MINCELLS@PLT
	cmp	QWORD PTR 40[rsp], rbp
	jg	.L30
	cmp	eax, DWORD PTR [rsp]
	je	.L30
	cmp	QWORD PTR 40[rsp], rbp
	jne	.L35
	cmp	QWORD PTR 48[rsp], rbx
	jle	.L35
	mov	eax, DWORD PTR [rsp]
	mov	DWORD PTR 64[rsp], eax
	.p2align 4,,10
	.p2align 3
.L12:
	add	DWORD PTR [rsp], 1
	mov	QWORD PTR 48[rsp], rbx
	jmp	.L10
	.p2align 4,,10
	.p2align 3
.L30:
	mov	eax, DWORD PTR [rsp]
	mov	QWORD PTR 40[rsp], rbp
	mov	DWORD PTR 64[rsp], eax
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L35:
	mov	rbx, QWORD PTR 48[rsp]
	jmp	.L12
	.p2align 4,,10
	.p2align 3
.L58:
	mov	eax, DWORD PTR 68[rsp]
	test	eax, eax
	je	.L36
	mov	rsi, QWORD PTR 80[rsp]
	cmp	QWORD PTR 24[rsp], rsi
	jl	.L36
.L20:
	add	DWORD PTR 68[rsp], 1
	add	r14, 8
	mov	eax, DWORD PTR 68[rsp]
	cmp	DWORD PTR [r15], eax
	jg	.L22
	movsx	rax, DWORD PTR 124[rsp]
	mov	rsi, QWORD PTR 72[rsp]
	lea	rbx, [rsi+rax*8]
	movsx	rax, DWORD PTR 120[rsp]
	lea	rbp, 0[0+rax*4]
.L4:
	mov	rax, QWORD PTR [rbx]
	mov	r14, QWORD PTR 8[rsp]
	mov	edx, 4
	mov	rdi, QWORD PTR 88[rsp]
	movsx	rax, DWORD PTR [rax]
	lea	rsi, [r14+rax*4]
	call	memcpy@PLT
	mov	rax, QWORD PTR [rbx]
	mov	rdi, QWORD PTR 96[rsp]
	mov	edx, 4
	movsx	rax, DWORD PTR [rax+rbp]
	xor	ebp, ebp
	lea	rsi, [r14+rax*4]
	call	memcpy@PLT
	mov	eax, DWORD PTR 36[rsp]
	lea	r14d, -1[rax]
	test	eax, eax
	jle	.L26
	mov	rax, rbx
	mov	rbx, rbp
	mov	rbp, rax
	jmp	.L25
.L61:
	mov	rsi, QWORD PTR 112[rsp]
	mov	r12, QWORD PTR 96[rsp]
.L24:
	mov	rax, QWORD PTR 0[rbp]
	mov	rdi, QWORD PTR 8[rsp]
	movsx	rax, DWORD PTR [rax+rbx*4]
	lea	r13, [rdi+rax*4]
	mov	rdi, r15
	mov	rdx, r13
	call	nodeInsertCell@PLT
	mov	rdx, r13
	mov	rsi, r12
	mov	rdi, r15
	call	cellUnion@PLT
	lea	rax, 1[rbx]
	cmp	r14, rbx
	je	.L26
	mov	rbx, rax
.L25:
	cmp	DWORD PTR 120[rsp], ebx
	jle	.L61
	mov	rsi, QWORD PTR 104[rsp]
	mov	r12, QWORD PTR 88[rsp]
	jmp	.L24
.L36:
	mov	rax, QWORD PTR 24[rsp]
	mov	QWORD PTR 80[rsp], rax
	mov	eax, DWORD PTR 64[rsp]
	mov	DWORD PTR 120[rsp], eax
	mov	eax, DWORD PTR 68[rsp]
	mov	DWORD PTR 124[rsp], eax
	jmp	.L20
.L26:
	mov	rdi, QWORD PTR 72[rsp]
	call	sqlite3_free@PLT
	mov	eax, DWORD PTR SQLITE_OK[rip]
	jmp	.L1
.L29:
	mov	DWORD PTR 120[rsp], 0
	mov	rbx, QWORD PTR 72[rsp]
	xor	ebp, ebp
	jmp	.L4
.L57:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	splitNodeStartree, .-splitNodeStartree
	.comm	SQLITE_OK,4,4
	.comm	SQLITE_NOMEM,4,4
	.comm	RTREE_ZERO,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_rtree.c_splitNodeStartree.c"
	.text
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.syntax unified
	.arm
	.fpu softvfp
	.type	splitNodeStartree, %function
splitNodeStartree:
	@ args = 12, pretend = 0, frame = 72
	@ frame_needed = 0, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	sub	sp, sp, #84
	str	r3, [sp, #52]
	ldr	r3, .L47
	ldr	r5, [r0]
	ldr	r3, [r3]
	str	r3, [sp, #76]
	mov	r3,#0
	ldr	r3, .L47+4
	mov	r10, r2
	ldr	r3, [r3]
	add	r2, r2, #1
	add	r5, r5, #1
	mul	r5, r2, r5
	str	r3, [sp, #32]
	ldr	r3, [sp, #120]
	lsl	r5, r5, #2
	str	r3, [sp, #56]
	ldr	r3, [sp, #124]
	mov	r4, r0
	str	r3, [sp, #44]
	ldr	r3, [sp, #128]
	mov	r0, r5
	str	r3, [sp, #48]
	mov	fp, r1
	bl	sqlite3_malloc64
	subs	r3, r0, #0
	str	r3, [sp, #60]
	bne	.L2
	ldr	r3, .L47+8
	ldr	r0, [r3]
.L1:
	ldr	r3, .L47
	ldr	r2, [r3]
	ldr	r3, [sp, #76]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L44
	add	sp, sp, #84
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L2:
	ldr	r8, [r4]
	mov	r2, r5
	mov	r1, #0
	mla	r8, r10, r8, r8
	ldr	r6, [sp, #60]
	bl	memset
	ldr	r3, [r4]
	mov	r5, #0
	cmp	r3, #0
	add	r8, r6, r8, lsl #2
	ble	.L42
	mov	r9, r5
	mov	r7, r6
	mov	r2, r3
	str	r6, [sp, #8]
.L6:
	add	r2, r2, r5
	add	r1, r6, r2, lsl #2
	cmp	r10, #0
	movgt	r2, #0
	str	r1, [r7]
	subgt	r0, r1, #4
	ble	.L9
.L8:
	str	r2, [r0, #4]!
	add	r2, r2, #1
	cmp	r10, r2
	bne	.L8
.L9:
	mov	r3, r9
	mov	r2, r10
	mov	r0, r4
	str	r8, [sp, #4]
	str	fp, [sp]
	bl	SortByDimension
	ldr	r2, [r4]
	add	r9, r9, #1
	cmp	r2, r9
	add	r5, r5, r10
	add	r7, r7, #4
	bgt	.L6
	cmp	r2, #0
	ldr	r6, [sp, #8]
	ble	.L26
	mov	r3, #0
	str	r3, [sp, #28]
	str	r3, [sp, #36]
	str	r3, [sp, #40]
	sub	r3, r10, #-1073741823
	lsl	r3, r3, #2
	str	r3, [sp, #24]
.L20:
	ldr	r3, .L47+4
	mov	r0, r4
	ldr	r8, [r3]
	bl	RTREE_MINCELLS
	mov	r3, #0
	mov	r5, r0
	str	r8, [sp, #20]
	str	r8, [sp, #8]
	str	r3, [sp, #16]
.L10:
	mov	r0, r4
	bl	RTREE_MINCELLS
	sub	r0, r10, r0
	cmp	r0, r5
	blt	.L45
	ldr	r3, [r6]
	mov	r2, #4
	ldr	r1, [r3]
	add	r0, sp, #68
	add	r1, fp, r1, lsl #2
	bl	memcpy
	ldr	r3, [r6]
	ldr	r1, [sp, #24]
	mov	r2, #4
	ldr	r1, [r3, r1]
	add	r0, sp, #72
	add	r1, fp, r1, lsl #2
	bl	memcpy
	cmp	r10, #2
	movgt	r9, #1
	subgt	r7, r10, #1
	ble	.L17
.L16:
	ldr	r3, [r6]
	cmp	r5, r9
	ldr	r2, [r3, r9, lsl #2]
	addgt	r1, sp, #68
	addle	r1, sp, #72
	mov	r0, r4
	add	r2, fp, r2, lsl #2
	add	r9, r9, #1
	bl	cellUnion
	cmp	r9, r7
	bne	.L16
.L17:
	add	r1, sp, #68
	mov	r0, r4
	bl	cellMargin
	mov	r3, r0
	add	r1, sp, #72
	mov	r0, r4
	add	r8, r8, r3
	bl	cellMargin
	mov	ip, r0
	add	r2, sp, #72
	mov	r3, #1
	add	r1, sp, #68
	mov	r0, r4
	add	r8, r8, ip
	bl	cellOverlap
	mov	r3, r0
	add	r1, sp, #68
	mov	r0, r4
	str	r3, [sp, #12]
	bl	cellArea
	add	r1, sp, #72
	mov	r7, r0
	mov	r0, r4
	bl	cellArea
	mov	r2, r0
	mov	r0, r4
	add	r7, r7, r2
	bl	RTREE_MINCELLS
	sub	r0, r0, r5
	clz	r0, r0
	ldr	r2, [sp, #8]
	ldr	r3, [sp, #12]
	lsr	r0, r0, #5
	cmp	r2, r3
	orrgt	r0, r0, #1
	cmp	r0, #0
	strne	r3, [sp, #8]
	strne	r5, [sp, #16]
	beq	.L46
.L12:
	str	r7, [sp, #20]
	add	r5, r5, #1
	b	.L10
.L46:
	ldr	r2, [sp, #8]
	ldr	r1, [sp, #20]
	sub	r2, r2, r3
	clz	r2, r2
	cmp	r1, r7
	lsr	r2, r2, #5
	movle	r2, #0
	cmp	r2, #0
	ldr	r3, [sp, #16]
	movne	r3, r5
	moveq	r7, r1
	str	r3, [sp, #16]
	b	.L12
.L45:
	ldr	r1, [sp, #32]
	ldr	r2, [sp, #40]
	cmp	r8, r1
	movge	r3, #0
	movlt	r3, #1
	cmp	r2, #0
	moveq	r3, #1
	cmp	r3, #0
	ldr	r0, [sp, #36]
	movne	r0, r2
	movne	r1, r8
	str	r0, [sp, #36]
	ldr	r0, [sp, #16]
	str	r1, [sp, #32]
	ldr	r1, [sp, #28]
	movne	r1, r0
	ldr	r3, [r4]
	add	r2, r2, #1
	cmp	r3, r2
	str	r2, [sp, #40]
	str	r1, [sp, #28]
	add	r6, r6, #4
	bgt	.L20
	ldr	r3, [sp, #60]
	ldr	r2, [sp, #36]
	lsl	r5, r1, #2
	add	r6, r3, r2, lsl #2
.L4:
	ldr	r3, [r6]
	mov	r2, #4
	ldr	r1, [r3]
	ldr	r0, [sp, #44]
	add	r1, fp, r1, lsl #2
	bl	memcpy
	ldr	r3, [r6]
	mov	r2, #4
	ldr	r1, [r3, r5]
	ldr	r0, [sp, #48]
	add	r1, fp, r1, lsl #2
	bl	memcpy
	cmp	r10, #0
	movgt	r5, #0
	ldrgt	r8, [sp, #28]
	ble	.L23
.L21:
	ldr	r2, [r6]
	cmp	r5, r8
	ldr	r2, [r2, r5, lsl #2]
	ldrlt	r7, [sp, #44]
	ldrge	r7, [sp, #48]
	add	r9, fp, r2, lsl #2
	ldrlt	r1, [sp, #52]
	ldrge	r1, [sp, #56]
	mov	r2, r9
	mov	r0, r4
	bl	nodeInsertCell
	add	r5, r5, #1
	mov	r2, r9
	mov	r1, r7
	mov	r0, r4
	bl	cellUnion
	cmp	r10, r5
	bne	.L21
.L23:
	ldr	r0, [sp, #60]
	bl	sqlite3_free
	ldr	r3, .L47+12
	ldr	r0, [r3]
	b	.L1
.L26:
	mov	r5, #0
.L42:
	ldr	r6, [sp, #60]
	str	r5, [sp, #28]
	b	.L4
.L44:
	bl	__stack_chk_fail
.L48:
	.align	2
.L47:
	.word	.LC0
	.word	RTREE_ZERO
	.word	SQLITE_NOMEM
	.word	SQLITE_OK
	.size	splitNodeStartree, .-splitNodeStartree
	.comm	SQLITE_OK,4,4
	.comm	SQLITE_NOMEM,4,4
	.comm	RTREE_ZERO,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
