	.file	"extr_polylib.c_AddWindingToConvexHull.c"
	.intel_syntax noprefix
	.text
	.p2align 4
	.globl	AddWindingToConvexHull
	.type	AddWindingToConvexHull, @function
AddWindingToConvexHull:
.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
	sub	rsp, 104
	.cfi_offset 15, -24
	.cfi_offset 14, -32
	.cfi_offset 13, -40
	.cfi_offset 12, -48
	.cfi_offset 3, -56
	mov	QWORD PTR -104[rbp], rdx
	mov	QWORD PTR -120[rbp], rdi
	mov	rbx, rsp
	mov	QWORD PTR -136[rbp], rsi
	mov	rax, QWORD PTR fs:40
	mov	QWORD PTR -56[rbp], rax
	xor	eax, eax
	movsx	rax, DWORD PTR MAX_HULL_POINTS[rip]
	mov	QWORD PTR -144[rbp], rsp
	lea	rax, 15[0+rax*8]
	mov	rcx, rax
	mov	rdx, rax
	and	rcx, -4096
	and	rdx, -16
	sub	rbx, rcx
	mov	rcx, rbx
	cmp	rsp, rcx
	je	.L3
.L76:
	sub	rsp, 4096
	or	QWORD PTR 4088[rsp], 0
	cmp	rsp, rcx
	jne	.L76
.L3:
	and	edx, 4095
	sub	rsp, rdx
	test	rdx, rdx
	jne	.L77
.L4:
	mov	rcx, rax
	mov	rbx, rsp
	mov	rdx, rax
	mov	r13, rsp
	and	rcx, -4096
	and	rdx, -16
	sub	rbx, rcx
	mov	rcx, rbx
	cmp	rsp, rcx
	je	.L6
.L78:
	sub	rsp, 4096
	or	QWORD PTR 4088[rsp], 0
	cmp	rsp, rcx
	jne	.L78
.L6:
	and	edx, 4095
	sub	rsp, rdx
	test	rdx, rdx
	jne	.L79
.L7:
	mov	rcx, rax
	mov	rbx, rsp
	mov	rdx, rax
	mov	QWORD PTR -128[rbp], rsp
	and	rcx, -4096
	and	rdx, -16
	sub	rbx, rcx
	mov	rcx, rbx
	cmp	rsp, rcx
	je	.L9
.L80:
	sub	rsp, 4096
	or	QWORD PTR 4088[rsp], 0
	cmp	rsp, rcx
	jne	.L80
.L9:
	and	edx, 4095
	sub	rsp, rdx
	test	rdx, rdx
	je	.L10
	or	QWORD PTR -8[rsp+rdx], 0
.L10:
	mov	rdx, rax
	mov	rbx, rsp
	and	rax, -4096
	mov	r12, rsp
	sub	rbx, rax
	and	rdx, -16
	mov	rax, rbx
	cmp	rsp, rax
	je	.L12
.L81:
	sub	rsp, 4096
	or	QWORD PTR 4088[rsp], 0
	cmp	rsp, rax
	jne	.L81
.L12:
	mov	rax, rdx
	and	eax, 4095
	sub	rsp, rax
	test	rax, rax
	je	.L13
	or	QWORD PTR -8[rsp+rax], 0
.L13:
	mov	rax, QWORD PTR -136[rbp]
	mov	QWORD PTR -96[rbp], rsp
	mov	rax, QWORD PTR [rax]
	test	rax, rax
	je	.L82
	mov	ebx, DWORD PTR [rax]
	mov	rsi, QWORD PTR 8[rax]
	mov	rdi, r13
	lea	r14d, 0[0+rbx*8]
	mov	edx, r14d
	call	memcpy@PLT
	mov	rax, QWORD PTR -120[rbp]
	mov	eax, DWORD PTR [rax]
	test	eax, eax
	jle	.L16
	mov	QWORD PTR -112[rbp], 0
	.p2align 4,,10
	.p2align 3
.L34:
	mov	rax, QWORD PTR -120[rbp]
	mov	rcx, QWORD PTR -112[rbp]
	mov	rax, QWORD PTR 8[rax]
	mov	rax, QWORD PTR [rax+rcx*8]
	mov	QWORD PTR -72[rbp], rax
	test	ebx, ebx
	jle	.L17
	lea	eax, -1[rbx]
	mov	r14, r13
	mov	r15d, 1
	mov	r13, r12
	mov	QWORD PTR -88[rbp], rax
	add	rax, 2
	mov	QWORD PTR -80[rbp], rax
	.p2align 4,,10
	.p2align 3
.L18:
	mov	eax, r15d
	xor	r12d, r12d
	mov	rsi, QWORD PTR -8[r14+r15*8]
	cdq
	idiv	ebx
	movsx	rdx, edx
	mov	rdi, QWORD PTR [r14+rdx*8]
	mov	rdx, r12
	call	VectorSubtract@PLT
	mov	rsi, r12
	mov	rdi, r12
	call	VectorNormalize@PLT
	mov	rdx, QWORD PTR -8[r13+r15*8]
	mov	rdi, QWORD PTR -104[rbp]
	mov	rsi, r12
	add	r15, 1
	call	CrossProduct@PLT
	cmp	QWORD PTR -80[rbp], r15
	jne	.L18
	mov	r9, QWORD PTR qfalse[rip]
	mov	DWORD PTR -80[rbp], ebx
	mov	r12, r13
	xor	r15d, r15d
	mov	rbx, r14
	mov	r13, r9
	jmp	.L25
	.p2align 4,,10
	.p2align 3
.L40:
	mov	r15, rax
.L25:
	xor	r14d, r14d
	mov	rsi, QWORD PTR [rbx+r15*8]
	mov	rdi, QWORD PTR -72[rbp]
	mov	rdx, r14
	call	VectorSubtract@PLT
	mov	rsi, QWORD PTR [r12+r15*8]
	mov	rdi, r14
	call	DotProduct@PLT
	mov	rax, QWORD PTR qtrue[rip]
	movaps	xmm1, xmm0
	movss	xmm0, DWORD PTR ON_EPSILON[rip]
	comiss	xmm1, xmm0
	xorps	xmm0, XMMWORD PTR .LC0[rip]
	cmovnb	r13, rax
	comiss	xmm1, xmm0
	jnb	.L24
	mov	rax, QWORD PTR qfalse[rip]
.L24:
	mov	rcx, QWORD PTR -96[rbp]
	mov	QWORD PTR [rcx+r15*8], rax
	lea	rax, 1[r15]
	cmp	QWORD PTR -88[rbp], r15
	jne	.L40
	mov	r9, r13
	mov	r13, rbx
	mov	ebx, DWORD PTR -80[rbp]
	test	r9, r9
	jne	.L83
.L30:
	mov	rdi, QWORD PTR -120[rbp]
	add	QWORD PTR -112[rbp], 1
	mov	rax, QWORD PTR -112[rbp]
	cmp	DWORD PTR [rdi], eax
	jg	.L34
	lea	r14d, 0[0+rbx*8]
.L16:
	mov	r15, QWORD PTR -136[rbp]
	mov	rdi, QWORD PTR [r15]
	call	FreeWinding@PLT
	mov	edi, ebx
	call	AllocWinding@PLT
	mov	edx, r14d
	mov	rsi, r13
	mov	DWORD PTR [rax], ebx
	mov	rdi, QWORD PTR 8[rax]
	mov	QWORD PTR [r15], rax
	call	memcpy@PLT
	mov	rsp, QWORD PTR -144[rbp]
.L1:
	mov	rax, QWORD PTR -56[rbp]
	xor	rax, QWORD PTR fs:40
	jne	.L84
	lea	rsp, -40[rbp]
	pop	rbx
	pop	r12
	pop	r13
	pop	r14
	pop	r15
	pop	rbp
	.cfi_remember_state
	.cfi_def_cfa 7, 8
	ret
.L77:
	.cfi_restore_state
	or	QWORD PTR -8[rsp+rdx], 0
	jmp	.L4
.L79:
	or	QWORD PTR -8[rsp+rdx], 0
	jmp	.L7
	.p2align 4,,10
	.p2align 3
.L83:
	mov	rsi, QWORD PTR -96[rbp]
	xor	ecx, ecx
	jmp	.L29
	.p2align 4,,10
	.p2align 3
.L27:
	cmp	ebx, ecx
	je	.L30
.L29:
	mov	eax, ecx
	mov	r15d, ecx
	add	ecx, 1
	cdq
	idiv	ebx
	movsx	rdx, edx
	cmp	QWORD PTR [rsi+rdx*8], 0
	jne	.L27
	mov	eax, ecx
	cdq
	idiv	ebx
	movsx	rdx, edx
	cmp	QWORD PTR [rsi+rdx*8], 0
	je	.L27
	cmp	ebx, r15d
	je	.L30
	mov	rax, QWORD PTR -128[rbp]
	mov	rdi, QWORD PTR -72[rbp]
	mov	rsi, QWORD PTR [rax]
	call	VectorCopy@PLT
	lea	eax, 1[r15]
	mov	QWORD PTR -80[rbp], r12
	mov	r12d, ebx
	cdq
	mov	r15d, 1
	idiv	ebx
	lea	r14d, [rbx+rdx]
	mov	rbx, QWORD PTR -96[rbp]
	mov	DWORD PTR -72[rbp], r14d
	mov	r14d, edx
	.p2align 4,,10
	.p2align 3
.L33:
	mov	eax, r14d
	add	r14d, 1
	cdq
	idiv	r12d
	mov	eax, r14d
	movsx	rsi, edx
	cdq
	idiv	r12d
	cmp	QWORD PTR [rbx+rsi*8], 0
	movsx	rdx, edx
	je	.L31
	cmp	QWORD PTR [rbx+rdx*8], 0
	jne	.L32
.L31:
	mov	rcx, QWORD PTR -128[rbp]
	movsx	rax, r15d
	mov	rdi, QWORD PTR 0[r13+rdx*8]
	add	r15d, 1
	mov	rsi, QWORD PTR [rcx+rax*8]
	call	VectorCopy@PLT
.L32:
	cmp	DWORD PTR -72[rbp], r14d
	jne	.L33
	mov	r12, QWORD PTR -80[rbp]
	lea	edx, 0[0+r15*8]
	mov	ebx, r15d
.L36:
	mov	rsi, QWORD PTR -128[rbp]
	mov	rdi, r13
	call	memcpy@PLT
	jmp	.L30
	.p2align 4,,10
	.p2align 3
.L17:
	cmp	QWORD PTR qfalse[rip], 0
	je	.L30
	test	ebx, ebx
	je	.L30
	mov	rax, QWORD PTR -128[rbp]
	mov	rdi, QWORD PTR -72[rbp]
	mov	ebx, 1
	mov	rsi, QWORD PTR [rax]
	call	VectorCopy@PLT
	mov	edx, 8
	jmp	.L36
.L82:
	mov	rdi, QWORD PTR -120[rbp]
	call	CopyWinding@PLT
	mov	rbx, QWORD PTR -136[rbp]
	mov	QWORD PTR [rbx], rax
	mov	rsp, QWORD PTR -144[rbp]
	jmp	.L1
.L84:
	call	__stack_chk_fail@PLT
	.cfi_endproc
.LFE0:
	.size	AddWindingToConvexHull, .-AddWindingToConvexHull
	.comm	qtrue,8,8
	.comm	qfalse,8,8
	.comm	ON_EPSILON,4,4
	.comm	MAX_HULL_POINTS,4,4
	.section	.rodata.cst16,"aM",@progbits,16
	.align 16
.LC0:
	.long	2147483648
	.long	0
	.long	0
	.long	0
	.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_polylib.c_AddWindingToConvexHull.c"
	.text
	.global	__aeabi_idivmod
	.global	__aeabi_fcmple
	.section	.rodata.cst4,"aM",%progbits,4
	.align	2
.LC0:
	.word	__stack_chk_guard
	.text
	.align	2
	.global	AddWindingToConvexHull
	.syntax unified
	.arm
	.fpu softvfp
	.type	AddWindingToConvexHull, %function
AddWindingToConvexHull:
	@ args = 0, pretend = 0, frame = 56
	@ frame_needed = 1, uses_anonymous_args = 0
	push	{r4, r5, r6, r7, r8, r9, r10, fp, lr}
	add	fp, sp, #32
	sub	sp, sp, #60
	ldr	r3, .L60
	str	sp, [fp, #-92]
	ldr	r3, [r3]
	ldr	r5, [r1]
	lsl	r3, r3, #2
	add	r3, r3, #7
	bic	r3, r3, #7
	sub	sp, sp, r3
	str	sp, [fp, #-60]
	sub	sp, sp, r3
	str	sp, [fp, #-84]
	sub	sp, sp, r3
	str	sp, [fp, #-76]
	sub	sp, sp, r3
	ldr	r3, .L60+4
	str	r1, [fp, #-88]
	str	r2, [fp, #-80]
	cmp	r5, #0
	ldr	r3, [r3]
	str	r3, [fp, #-40]
	mov	r3,#0
	str	sp, [fp, #-72]
	str	r0, [fp, #-64]
	beq	.L58
	ldr	r4, [r5]
	ldr	r1, [r5, #4]
	lsl	r6, r4, #2
	mov	r2, r6
	ldr	r0, [fp, #-60]
	bl	memcpy
	ldr	r3, [fp, #-64]
	ldr	r3, [r3]
	cmp	r3, #0
	ble	.L4
	mov	r2, #0
	str	r2, [fp, #-56]
.L22:
	ldr	r2, [fp, #-64]
	ldr	r1, [fp, #-56]
	ldr	r2, [r2, #4]
	cmp	r4, #0
	ldr	r2, [r2, r1, lsl #2]
	str	r2, [fp, #-68]
	ble	.L5
	ldr	r9, [fp, #-60]
	mov	r10, #0
	sub	r7, r9, #4
	mov	r8, r7
	ldr	r3, [fp, #-76]
	str	r7, [fp, #-52]
	sub	r6, r3, #4
	mov	r5, r6
	str	r6, [fp, #-48]
	mov	r6, r4
	ldr	r4, [fp, #-80]
.L6:
	add	r10, r10, #1
	mov	r0, r10
	mov	r1, r6
	bl	__aeabi_idivmod
	mov	r7, #0
	mov	r0, r1
	mov	r2, r7
	ldr	r1, [r8, #4]!
	ldr	r0, [r9, r0, lsl #2]
	bl	VectorSubtract
	mov	r1, r7
	mov	r0, r7
	bl	VectorNormalize
	mov	r1, r7
	mov	r0, r4
	ldr	r2, [r5, #4]!
	bl	CrossProduct
	cmp	r10, r6
	bne	.L6
	mov	r4, r6
	mov	r5, #0
	ldr	r3, .L60+8
	ldr	r7, [fp, #-52]
	ldr	r3, [r3]
	ldr	r9, [fp, #-68]
	str	r3, [fp, #-52]
	ldr	r3, [fp, #-72]
	ldr	r6, [fp, #-48]
	sub	r8, r3, #4
	str	r4, [fp, #-48]
.L13:
	mov	r4, #0
	ldr	r1, [r7, #4]!
	mov	r2, r4
	mov	r0, r9
	bl	VectorSubtract
	mov	r0, r4
	ldr	r1, [r6, #4]!
	bl	DotProduct
	ldr	r3, .L60+12
	mov	r1, r0
	ldr	r4, [r3]	@ float
	mov	r10, r0
	mov	r0, r4
	bl	__aeabi_fcmple
	cmp	r0, #0
	ldrne	r3, .L60+16
	mov	r1, r10
	ldrne	r3, [r3]
	add	r0, r4, #-2147483648
	strne	r3, [fp, #-52]
	bl	__aeabi_fcmple
	cmp	r0, #0
	ldrne	r3, .L60+16
	ldreq	r3, .L60+8
	ldr	r2, [fp, #-48]
	ldr	r3, [r3]
	add	r5, r5, #1
	cmp	r5, r2
	str	r3, [r8, #4]!
	bne	.L13
	ldr	r3, [fp, #-52]
	ldr	r4, [fp, #-48]
	cmp	r3, #0
	bne	.L52
.L56:
	ldr	r3, [fp, #-64]
	ldr	r3, [r3]
.L18:
	ldr	r2, [fp, #-56]
	add	r2, r2, #1
	cmp	r3, r2
	str	r2, [fp, #-56]
	bgt	.L22
	ldr	r3, [fp, #-88]
	lsl	r6, r4, #2
	ldr	r5, [r3]
.L4:
	mov	r0, r5
	bl	FreeWinding
	mov	r0, r4
	bl	AllocWinding
	mov	r3, r0
	ldr	r1, [fp, #-88]
	str	r4, [r0]
	mov	r2, r6
	ldr	r0, [r0, #4]
	str	r3, [r1]
	ldr	r1, [fp, #-60]
	bl	memcpy
	ldr	sp, [fp, #-92]
.L1:
	ldr	r3, .L60+4
	ldr	r2, [r3]
	ldr	r3, [fp, #-40]
	eors	r2, r3, r2
	mov	r3, #0
	bne	.L59
	sub	sp, fp, #32
	@ sp needed
	pop	{r4, r5, r6, r7, r8, r9, r10, fp, pc}
.L52:
	mov	r5, #0
	ldr	r7, [fp, #-72]
	b	.L17
.L15:
	cmp	r4, r5
	beq	.L56
.L17:
	mov	r0, r5
	mov	r1, r4
	bl	__aeabi_idivmod
	ldr	r3, [r7, r1, lsl #2]
	mov	r6, r5
	cmp	r3, #0
	add	r5, r5, #1
	bne	.L15
	mov	r1, r4
	mov	r0, r5
	bl	__aeabi_idivmod
	ldr	r3, [r7, r1, lsl #2]
	cmp	r3, #0
	beq	.L15
	cmp	r4, r6
	beq	.L56
	ldr	r10, [fp, #-84]
	ldr	r0, [fp, #-68]
	ldr	r1, [r10]
	bl	VectorCopy
	add	r0, r6, #1
	mov	r1, r4
	bl	__aeabi_idivmod
	mov	r5, #1
	mov	r7, r1
	ldr	r8, [fp, #-72]
	add	r6, r4, r1
.L21:
	mov	r0, r7
	mov	r1, r4
	bl	__aeabi_idivmod
	mov	r3, r1
	add	r7, r7, #1
	ldr	r9, [r8, r3, lsl #2]
	mov	r0, r7
	mov	r1, r4
	bl	__aeabi_idivmod
	cmp	r9, #0
	beq	.L19
	ldr	r3, [r8, r1, lsl #2]
	cmp	r3, #0
	bne	.L20
.L19:
	ldr	r3, [fp, #-60]
	ldr	r0, [r3, r1, lsl #2]
	ldr	r1, [r10, r5, lsl #2]
	bl	VectorCopy
	add	r5, r5, #1
.L20:
	cmp	r6, r7
	bne	.L21
	mov	r4, r5
	lsl	r2, r5, #2
.L24:
	ldr	r1, [fp, #-84]
	ldr	r0, [fp, #-60]
	bl	memcpy
	b	.L56
.L5:
	ldr	r2, .L60+8
	ldr	r2, [r2]
	cmp	r2, #0
	beq	.L18
	cmp	r4, #0
	beq	.L18
	ldr	r3, [fp, #-84]
	ldr	r0, [fp, #-68]
	ldr	r1, [r3]
	bl	VectorCopy
	mov	r4, #1
	mov	r2, #4
	b	.L24
.L58:
	bl	CopyWinding
	ldr	r3, [fp, #-88]
	str	r0, [r3]
	ldr	sp, [fp, #-92]
	b	.L1
.L59:
	bl	__stack_chk_fail
.L61:
	.align	2
.L60:
	.word	MAX_HULL_POINTS
	.word	.LC0
	.word	qfalse
	.word	ON_EPSILON
	.word	qtrue
	.size	AddWindingToConvexHull, .-AddWindingToConvexHull
	.comm	qtrue,4,4
	.comm	qfalse,4,4
	.comm	ON_EPSILON,4,4
	.comm	MAX_HULL_POINTS,4,4
	.ident	"GCC: (Ubuntu 9.4.0-1ubuntu1~20.04.2) 9.4.0"
	.section	.note.GNU-stack,"",%progbits
