// File: /workspace/github_cpp_makefile_star2_O2/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 $0x28, %rsp
movsd %xmm1, 0x20(%rsp)
movsd %xmm0, 0x18(%rsp)
movq %rdi, 0x8(%rsp)
cmpl $0x0, 0x60(%rdi)
jle 0x28c55
movq 0x8(%rsp), %rbx
leaq 0x68(%rbx), %rdi
leaq 0xdcb9(%rip), %rsi      # 0x368ce
callq 0x8420
movq %rax, %r14
callq 0x8300
subq 0x268(%rbx), %rax
cvtsi2sd %rax, %xmm0
mulsd 0xb3da(%rip), %xmm0     # 0x34010
divsd 0xd5ca(%rip), %xmm0     # 0x36208
movq %r14, %rdi
callq 0x86b0
leaq 0xdb8d(%rip), %rsi      # 0x367da
movq %rax, %rdi
callq 0x8420
movq 0x8(%rsp), %rax
movq 0x8(%rax), %r12
testq %r12, %r12
je 0x28e5e
addq $0x10, %r12
movq 0x8(%rsp), %rax
addq $0x68, %rax
movq %rax, 0x10(%rsp)
xorl %ebp, %ebp
leaq 0xd899(%rip), %r13      # 0x3651b
movq (%r12), %r12
testq %r12, %r12
je 0x28dec
leaq 0xf0(%r12), %rbx
xorl %r15d, %r15d
movq (%rbx), %rbx
testq %rbx, %rbx
je 0x28dde
movq 0x68(%rbx), %rdi
testq %rdi, %rdi
je 0x28d78
movsd 0x18(%rsp), %xmm0
movsd 0x20(%rsp), %xmm1
callq 0x240ca
movq 0x8(%rsp), %rax
cmpl $0x2, 0x60(%rax)
jl 0x28dd2
movq 0x10(%rsp), %rdi
movq %r13, %rsi
callq 0x8420
movq %rax, %rdi
movq %r12, %rsi
callq 0x8420
movq %rax, %rdi
leaq 0xdc14(%rip), %rsi      # 0x36909
callq 0x8420
movq %rax, %rdi
movl %ebp, %esi
callq 0x8740
movq %rax, %rdi
leaq 0xe522(%rip), %rsi      # 0x37230
callq 0x8420
movq %rax, %rdi
movl %r15d, %esi
callq 0x8740
movq %rax, %rdi
leaq 0xdc00(%rip), %rsi      # 0x36928
callq 0x8420
movq 0x68(%rbx), %rcx
movl 0x8(%rcx), %esi
movq %rax, %rdi
callq 0x8740
movq %rax, %rdi
leaq 0xdaf2(%rip), %rsi      # 0x36838
callq 0x8420
movq %r12, %r13
movq %rax, %r12
movq 0x68(%rbx), %rdi
callq 0x22296
movq %r12, %rdi
movq %r13, %r12
leaq 0xd7b4(%rip), %r13      # 0x3651b
callq 0x86b0
movq %rax, %rdi
leaq 0xd8ee(%rip), %rsi      # 0x36664
jmp 0x28dcd
movq 0x10(%rsp), %rdi
movq %r13, %rsi
callq 0x8420
movq %rax, %rdi
movq %r12, %rsi
callq 0x8420
movq %rax, %rdi
leaq 0xdb6f(%rip), %rsi      # 0x36909
callq 0x8420
movq %rax, %rdi
movl %ebp, %esi
callq 0x8740
movq %rax, %rdi
leaq 0xe47d(%rip), %rsi      # 0x37230
callq 0x8420
movq %rax, %rdi
movl %r15d, %esi
callq 0x8740
movq %rax, %rdi
leaq 0xdb44(%rip), %rsi      # 0x36911
callq 0x8420
addq $0x48, %rbx
incl %r15d
jmp 0x28c9a
addq $0xf8, %r12
incl %ebp
jmp 0x28c82
movq 0x8(%rsp), %rax
cmpl $0x0, 0x60(%rax)
jle 0x28e5e
leaq 0xdb3f(%rip), %rsi      # 0x3693d
movq 0x10(%rsp), %rdi
callq 0x8420
movq %rax, %r14
callq 0x8300
movq 0x8(%rsp), %rcx
subq 0x268(%rcx), %rax
cvtsi2sd %rax, %xmm0
mulsd 0xb1e7(%rip), %xmm0     # 0x34010
divsd 0xd3d7(%rip), %xmm0     # 0x36208
movq %r14, %rdi
callq 0x86b0
leaq 0xda88(%rip), %rsi      # 0x368c8
movq %rax, %rdi
callq 0x8420
movq %rax, %rdi
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x8320
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop