// File: /workspace/github_cpp_makefile_star2_O3/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 0x2e081
leaq 0x68(%rbx), %r14
leaq 0x108da(%rip), %rsi     # 0x3e90e
movl $0x3a, %edx
movq %r14, %rdi
callq 0x74e0
callq 0x72f0
subq 0x268(%rbx), %rax
xorps %xmm0, %xmm0
cvtsi2sd %rax, %xmm0
mulsd 0xdfb3(%rip), %xmm0     # 0x3c010
divsd 0x101e3(%rip), %xmm0    # 0x3e248
movq %r14, %rdi
callq 0x7690
leaq 0x107a6(%rip), %rsi     # 0x3e81a
movl $0x3, %edx
movq %rax, %rdi
callq 0x74e0
movq 0x8(%rbx), %rax
testq %rax, %rax
je 0x2e2cc
movq %rbx, (%rsp)
movq 0x10(%rax), %r14
testq %r14, %r14
je 0x2e251
movq (%rsp), %rax
leaq 0x68(%rax), %r15
xorl %ebp, %ebp
movq 0xf0(%r14), %rbx
testq %rbx, %rbx
je 0x2e23f
xorl %r13d, %r13d
movq 0x68(%rbx), %rdi
testq %rdi, %rdi
je 0x2e1b1
movsd 0x8(%rsp), %xmm0
movsd 0x10(%rsp), %xmm1
callq 0x29080
movq (%rsp), %rax
cmpl $0x2, 0x60(%rax)
jl 0x2e22f
movl $0x7, %edx
movq %r15, %rdi
leaq 0x10464(%rip), %rsi     # 0x3e55b
callq 0x74e0
movq %r14, %rdi
callq 0x71d0
movq %r15, %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0x74e0
movl $0x7, %edx
movq %r15, %rdi
leaq 0x10828(%rip), %rsi     # 0x3e949
callq 0x74e0
movq %r15, %rdi
movl %ebp, %esi
callq 0x7720
movq %rax, %r12
movl $0x6, %edx
movq %rax, %rdi
leaq 0x1112e(%rip), %rsi     # 0x3f270
callq 0x74e0
movq %r12, %rdi
movl %r13d, %esi
callq 0x7720
movq %rax, %r12
movl $0x14, %edx
movq %rax, %rdi
leaq 0x10804(%rip), %rsi     # 0x3e968
callq 0x74e0
movq 0x68(%rbx), %rax
movl 0x8(%rax), %esi
movq %r12, %rdi
callq 0x7720
movq %rax, %r12
movl $0x13, %edx
movq %rax, %rdi
leaq 0x106ee(%rip), %rsi     # 0x3e878
callq 0x74e0
movq 0x68(%rbx), %rdi
callq 0x266bc
movq %r12, %rdi
callq 0x7690
movl $0x5, %edx
movq %rax, %rdi
leaq 0x104f5(%rip), %rsi     # 0x3e6a4
jmp 0x2e22a
movl $0x7, %edx
movq %r15, %rdi
leaq 0x1039b(%rip), %rsi     # 0x3e55b
callq 0x74e0
movq %r14, %rdi
callq 0x71d0
movq %r15, %rdi
movq %r14, %rsi
movq %rax, %rdx
callq 0x74e0
movl $0x7, %edx
movq %r15, %rdi
leaq 0x1075f(%rip), %rsi     # 0x3e949
callq 0x74e0
movq %r15, %rdi
movl %ebp, %esi
callq 0x7720
movq %rax, %r12
movl $0x6, %edx
movq %rax, %rdi
leaq 0x11065(%rip), %rsi     # 0x3f270
callq 0x74e0
movq %r12, %rdi
movl %r13d, %esi
callq 0x7720
movl $0x16, %edx
movq %rax, %rdi
leaq 0x10727(%rip), %rsi     # 0x3e951
callq 0x74e0
incl %r13d
movq 0x48(%rbx), %rbx
testq %rbx, %rbx
jne 0x2e0bc
incl %ebp
movq 0xf8(%r14), %r14
testq %r14, %r14
jne 0x2e0a9
movq (%rsp), %rbx
cmpl $0x0, 0x60(%rbx)
jle 0x2e2cc
leaq 0x68(%rbx), %r14
leaq 0x10717(%rip), %rsi     # 0x3e97d
movl $0x36, %edx
movq %r14, %rdi
callq 0x74e0
callq 0x72f0
subq 0x268(%rbx), %rax
xorps %xmm0, %xmm0
cvtsi2sd %rax, %xmm0
mulsd 0xdd81(%rip), %xmm0     # 0x3c010
divsd 0xffb1(%rip), %xmm0     # 0x3e248
movq %r14, %rdi
callq 0x7690
movq %rax, %rbx
leaq 0x1065f(%rip), %rsi     # 0x3e908
movl $0x5, %edx
movq %rax, %rdi
callq 0x74e0
movq %rbx, %rdi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x7310
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
nop