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

    if ( debug_level > 0 )
    {
        OutDebug << "---------------- Entering EnlargePaths, 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 path to a polygon
		for (NSVGpath *path = shape->paths; path != NULL; path = path->next, nPath++)
		{
            if ( path->ClosePolygon == NULL )
            {
                OutDebug << path->id << " has no closed polygon, skipping large polygon generation\n";
                continue;
            }
            if ( debug_level > 1 )
            {
                OutDebug << path->id << " before elarging polygon with " << path->ClosePolygon->nVertices << " vertices and area " << path->ClosePolygon->area() << "mm²\n" << std::flush;
            }
            path->LargePolygon = path->ClosePolygon->enlarge(Diff);
            if ( debug_level > 1 )
            {
                OutDebug << path->id << " before simplify large polygon with " << path->LargePolygon->nVertices << " vertices and area " << path->LargePolygon->area() << "mm²\n" << std::flush;
            }
            path->LargePolygon->Simplify(Diff*Diff/5);
            if ( debug_level > 1 )
            {
                OutDebug << path->id << " after simplify large polygon with " << path->LargePolygon->nVertices << " vertices and area " << path->LargePolygon->area() << "mm²\n" << std::flush;
            }
		}
	}
    if ( debug_level > 0 )
    {
        OutDebug << "---------------- Exit EnlargePaths, elapsed time: " <<  1000.0*(clock() - StartClock)/CLOCKS_PER_SEC << "ms\n\n\n" << std::flush;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movsd %xmm0, -0x10(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x30(%rbp)
cmpl $0x0, 0x60(%rax)
jle 0x6addc
movq -0x30(%rbp), %rdi
addq $0x68, %rdi
leaq 0x19a41(%rip), %rsi     # 0x847cf
callq 0x9530
movq %rax, -0x38(%rbp)
callq 0x93c0
movq -0x30(%rbp), %rcx
movq -0x38(%rbp), %rdi
subq 0x268(%rcx), %rax
cvtsi2sd %rax, %xmm1
movsd 0x193c0(%rip), %xmm0    # 0x84178
mulsd %xmm1, %xmm0
movsd 0x193ac(%rip), %xmm1    # 0x84170
divsd %xmm1, %xmm0
callq 0x9a30
movq %rax, %rdi
leaq 0x19a2f(%rip), %rsi     # 0x84806
callq 0x9530
movq -0x30(%rbp), %rax
movl $0x0, -0x14(%rbp)
cmpq $0x0, 0x8(%rax)
jne 0x6adf3
jmp 0x6b104
movq -0x30(%rbp), %rax
movq 0x8(%rax), %rax
movq 0x10(%rax), %rax
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0x6b08e
movl $0x0, -0x18(%rbp)
movq -0x20(%rbp), %rax
movq 0xf0(%rax), %rax
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
je 0x6b06f
movq -0x28(%rbp), %rax
cmpq $0x0, 0x60(%rax)
jne 0x6ae66
movq -0x30(%rbp), %rdi
addq $0x68, %rdi
movq -0x28(%rbp), %rsi
addq $0x90, %rsi
callq 0x9530
movq %rax, %rdi
leaq 0x199ae(%rip), %rsi     # 0x8480a
callq 0x9530
jmp 0x6b055
movq -0x30(%rbp), %rax
cmpl $0x1, 0x60(%rax)
jle 0x6aef5
movq -0x30(%rbp), %rdi
addq $0x68, %rdi
movq -0x28(%rbp), %rsi
addq $0x90, %rsi
callq 0x9530
movq %rax, %rdi
leaq 0x199af(%rip), %rsi     # 0x84845
callq 0x9530
movq %rax, %rdi
movq -0x28(%rbp), %rax
movq 0x60(%rax), %rax
movl 0x8(%rax), %esi
callq 0x9930
movq %rax, %rdi
leaq 0x199ac(%rip), %rsi     # 0x84864
callq 0x9530
movq %rax, -0x40(%rbp)
movq -0x28(%rbp), %rax
movq 0x60(%rax), %rdi
callq 0x5ed10
movq -0x40(%rbp), %rdi
callq 0x9a30
movq %rax, %rdi
leaq 0x197af(%rip), %rsi     # 0x84690
callq 0x9530
movq %rax, %rdi
movq 0x4d0a8(%rip), %rsi     # 0xb7f98
callq 0x9590
movq -0x28(%rbp), %rax
movq 0x60(%rax), %rdi
movsd -0x10(%rbp), %xmm0
callq 0x5f860
movq %rax, %rdx
movq -0x30(%rbp), %rax
movq -0x28(%rbp), %rcx
movq %rdx, 0x68(%rcx)
cmpl $0x1, 0x60(%rax)
jle 0x6afa1
movq -0x30(%rbp), %rdi
addq $0x68, %rdi
movq -0x28(%rbp), %rsi
addq $0x90, %rsi
callq 0x9530
movq %rax, %rdi
leaq 0x19936(%rip), %rsi     # 0x84878
callq 0x9530
movq %rax, %rdi
movq -0x28(%rbp), %rax
movq 0x68(%rax), %rax
movl 0x8(%rax), %esi
callq 0x9930
movq %rax, %rdi
leaq 0x19900(%rip), %rsi     # 0x84864
callq 0x9530
movq %rax, -0x48(%rbp)
movq -0x28(%rbp), %rax
movq 0x68(%rax), %rdi
callq 0x5ed10
movq -0x48(%rbp), %rdi
callq 0x9a30
movq %rax, %rdi
leaq 0x19703(%rip), %rsi     # 0x84690
callq 0x9530
movq %rax, %rdi
movq 0x4cffc(%rip), %rsi     # 0xb7f98
callq 0x9590
movq -0x28(%rbp), %rax
movq 0x68(%rax), %rdi
movsd -0x10(%rbp), %xmm0
mulsd -0x10(%rbp), %xmm0
movsd 0x191c5(%rip), %xmm1    # 0x84180
divsd %xmm1, %xmm0
callq 0x62ca0
movq -0x30(%rbp), %rax
cmpl $0x1, 0x60(%rax)
jle 0x6b053
movq -0x30(%rbp), %rdi
addq $0x68, %rdi
movq -0x28(%rbp), %rsi
addq $0x90, %rsi
callq 0x9530
movq %rax, %rdi
leaq 0x198a9(%rip), %rsi     # 0x8489d
callq 0x9530
movq %rax, %rdi
movq -0x28(%rbp), %rax
movq 0x68(%rax), %rax
movl 0x8(%rax), %esi
callq 0x9930
movq %rax, %rdi
leaq 0x1984e(%rip), %rsi     # 0x84864
callq 0x9530
movq %rax, -0x50(%rbp)
movq -0x28(%rbp), %rax
movq 0x68(%rax), %rdi
callq 0x5ed10
movq -0x50(%rbp), %rdi
callq 0x9a30
movq %rax, %rdi
leaq 0x19651(%rip), %rsi     # 0x84690
callq 0x9530
movq %rax, %rdi
movq 0x4cf4a(%rip), %rsi     # 0xb7f98
callq 0x9590
jmp 0x6b055
movq -0x28(%rbp), %rax
movq 0x48(%rax), %rax
movq %rax, -0x28(%rbp)
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
jmp 0x6ae24
jmp 0x6b071
movq -0x20(%rbp), %rax
movq 0xf8(%rax), %rax
movq %rax, -0x20(%rbp)
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x6ae03
movq -0x30(%rbp), %rax
cmpl $0x0, 0x60(%rax)
jle 0x6b104
movq -0x30(%rbp), %rdi
addq $0x68, %rdi
leaq 0x1981a(%rip), %rsi     # 0x848c1
callq 0x9530
movq %rax, -0x58(%rbp)
callq 0x93c0
movq -0x30(%rbp), %rcx
movq -0x58(%rbp), %rdi
subq 0x268(%rcx), %rax
cvtsi2sd %rax, %xmm1
movsd 0x190a7(%rip), %xmm0    # 0x84178
mulsd %xmm1, %xmm0
movsd 0x19093(%rip), %xmm1    # 0x84170
divsd %xmm1, %xmm0
callq 0x9a30
movq %rax, %rdi
leaq 0x19804(%rip), %rsi     # 0x848f4
callq 0x9530
movq %rax, %rdi
movq 0x4ce99(%rip), %rsi     # 0xb7f98
callq 0x9590
addq $0x60, %rsp
popq %rbp
retq
nopw (%rax,%rax)