// File: /workspace/github_cpp_makefile_star2_O1/thierry7100[P]CutOptim/src/SvgDoc.cpp
// Function: SvgDoc::BreakLongerEdges(double, double)
void SvgDoc::BreakLongerEdges(double max_length, double Diff)
{
    int nShape, nPath;

    if ( debug_level > 0 )
    {
        OutDebug << "---------------- Entering BreakLongerEdges, elapsed time: " <<  1000.0*(clock() - StartClock)/CLOCKS_PER_SEC << "ms\n";
    }
    nShape = 0;
    if ( SvgData == NULL ) return;
	for (NSVGshape *shape = SvgData->shapes; shape != NULL; shape = shape->next, nShape++)
	{
        nPath = 0;
        //  Transform each large polygon to add vertices when edges are too long
		for (NSVGpath *path = shape->paths; path != NULL; path = path->next, nPath++)
		{
            if ( path->LargePolygon == NULL )
            {
                OutDebug << " Shape " << shape->id << " Index " << nShape << " Path " << nPath << " has no large polygon\n";
                continue;
            }
            path->LargePolygon->BreakLongerEdges(max_length, Diff);
            if ( debug_level > 1 )
            {
                OutDebug << " Shape " << shape->id << " Index " << nShape << " Path " << nPath << " Large polygon with " << path->LargePolygon->nVertices << " vertices and area " << path->LargePolygon->area() << "mm²\n";
            }
		}
	}
    if ( debug_level > 0 )
    {
        OutDebug << "---------------- Exit BreakLongerEdges, elapsed time: " <<  1000.0*(clock() - StartClock)/CLOCKS_PER_SEC << "ms\n\n\n" << std::flush;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movsd %xmm1, 0x10(%rsp)
movsd %xmm0, 0x8(%rsp)
movq %rdi, %rbx
cmpl $0x0, 0x60(%rdi)
jle 0x2ed85
leaq 0x68(%rbx), %r14
leaq 0x10b3a(%rip), %rsi     # 0x3f872
movl $0x3a, %edx
movq %r14, %rdi
callq 0x74d0
callq 0x72e0
subq 0x268(%rbx), %rax
xorps %xmm0, %xmm0
cvtsi2sd %rax, %xmm0
mulsd 0xe2af(%rip), %xmm0     # 0x3d010
divsd 0x1043f(%rip), %xmm0    # 0x3f1a8
movq %r14, %rdi
callq 0x7680
leaq 0x10a06(%rip), %rsi     # 0x3f77e
movl $0x3, %edx
movq %rax, %rdi
callq 0x74d0
movq 0x8(%rbx), %rax
testq %rax, %rax
je 0x2efd0
movq %rbx, (%rsp)
movq 0x10(%rax), %r14
testq %r14, %r14
je 0x2ef55
movq (%rsp), %rax
leaq 0x68(%rax), %r15
xorl %ebp, %ebp
movq 0xf0(%r14), %rbx
testq %rbx, %rbx
je 0x2ef43
xorl %r13d, %r13d
movq 0x68(%rbx), %rdi
testq %rdi, %rdi
je 0x2eeb5
movsd 0x8(%rsp), %xmm0
movsd 0x10(%rsp), %xmm1
callq 0x29918
movq (%rsp), %rax
cmpl $0x2, 0x60(%rax)
jl 0x2ef33
movl $0x7, %edx
movq %r15, %rdi
leaq 0x106c4(%rip), %rsi     # 0x3f4bf
callq 0x74d0
movq %r14, %rdi
callq 0x71d0
movq %r15, %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0x74d0
movl $0x7, %edx
movq %r15, %rdi
leaq 0x10a88(%rip), %rsi     # 0x3f8ad
callq 0x74d0
movq %r15, %rdi
movl %ebp, %esi
callq 0x7710
movq %rax, %r12
movl $0x6, %edx
movq %rax, %rdi
leaq 0x1138e(%rip), %rsi     # 0x401d4
callq 0x74d0
movq %r12, %rdi
movl %r13d, %esi
callq 0x7710
movq %rax, %r12
movl $0x14, %edx
movq %rax, %rdi
leaq 0x10a64(%rip), %rsi     # 0x3f8cc
callq 0x74d0
movq 0x68(%rbx), %rax
movl 0x8(%rax), %esi
movq %r12, %rdi
callq 0x7710
movq %rax, %r12
movl $0x13, %edx
movq %rax, %rdi
leaq 0x1094e(%rip), %rsi     # 0x3f7dc
callq 0x74d0
movq 0x68(%rbx), %rdi
callq 0x26926
movq %r12, %rdi
callq 0x7680
movl $0x5, %edx
movq %rax, %rdi
leaq 0x10755(%rip), %rsi     # 0x3f608
jmp 0x2ef2e
movl $0x7, %edx
movq %r15, %rdi
leaq 0x105fb(%rip), %rsi     # 0x3f4bf
callq 0x74d0
movq %r14, %rdi
callq 0x71d0
movq %r15, %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0x74d0
movl $0x7, %edx
movq %r15, %rdi
leaq 0x109bf(%rip), %rsi     # 0x3f8ad
callq 0x74d0
movq %r15, %rdi
movl %ebp, %esi
callq 0x7710
movq %rax, %r12
movl $0x6, %edx
movq %rax, %rdi
leaq 0x112c5(%rip), %rsi     # 0x401d4
callq 0x74d0
movq %r12, %rdi
movl %r13d, %esi
callq 0x7710
movl $0x16, %edx
movq %rax, %rdi
leaq 0x10987(%rip), %rsi     # 0x3f8b5
callq 0x74d0
incl %r13d
movq 0x48(%rbx), %rbx
testq %rbx, %rbx
jne 0x2edc0
incl %ebp
movq 0xf8(%r14), %r14
testq %r14, %r14
jne 0x2edad
movq (%rsp), %rbx
cmpl $0x0, 0x60(%rbx)
jle 0x2efd0
leaq 0x68(%rbx), %r14
leaq 0x10977(%rip), %rsi     # 0x3f8e1
movl $0x36, %edx
movq %r14, %rdi
callq 0x74d0
callq 0x72e0
subq 0x268(%rbx), %rax
xorps %xmm0, %xmm0
cvtsi2sd %rax, %xmm0
mulsd 0xe07d(%rip), %xmm0     # 0x3d010
divsd 0x1020d(%rip), %xmm0    # 0x3f1a8
movq %r14, %rdi
callq 0x7680
movq %rax, %rbx
leaq 0x108bf(%rip), %rsi     # 0x3f86c
movl $0x5, %edx
movq %rax, %rdi
callq 0x74d0
movq %rbx, %rdi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x7300
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop