// File: /workspace/github_cpp_makefile_star2_O3/thierry7100[P]CutOptim/main.cpp
// Function: main
int main(int argc, char *argv[])
{
string InputFileName;
string OutputFileName;
double MinCutDistance = 1.0;
double StepAngle = 0;
double rect_cost = 0.0;
int Flag_file = 0;
int debug_level = 0;
int Output_Layer = 0;
int KeepNested = 1;
int OptimizingLevel = 1;
int FirstPos = CenterCenter;
int UseCache = 0;
bool Flag_free_rot = 1;
string debug_file_name = "Debug_CutOptim.txt";

double max_segment_length = 1000.0;
#ifdef UNDEF
        //  Used to check param passing from inkscape
        ofstream ParamDbg("/home/thierry/Programmes/CutOptim/DebgParam.txt");
        if ( ParamDbg.is_open() == false )
        {
            cerr << "unable to open /home/thierry/Programmes/CutOptim/DebgParam.txt\n";
            exit(1);
        }
         ParamDbg << "--- Params  ------\n";
        ParamDbg << " argc =" << argc << "\n";
        for ( int i = 0; i < argc; i++)
        {
            ParamDbg << "Argv[" << i << "]=" << argv[i] << "\n";
        }
        ParamDbg.close();
#endif
    auto result = parse(argc, argv);
    InputFileName = result["f"].as<std::string>();
    if (result.count("output"))
    {
        OutputFileName = result["output"].as<std::string>();
        Flag_file = 1;
    }
    if (result.count("distance"))
        MinCutDistance = result["distance"].as<double>();
    if (result.count("angle"))
    {
        StepAngle = result["angle"].as<double>();
        Flag_free_rot = 0;
    }
    if (result.count("max_length"))
        max_segment_length = result["max_length"].as<double>();
    if (result.count("rect_cost"))
        rect_cost = result["rect_cost"].as<double>();
    if (result.count("debug_level"))
        debug_level = result["debug_level"].as<int>();
    if (result.count("layer_output"))
        Output_Layer = result["layer_output"].as<int>();
    if (result.count("optimizing_level"))
        OptimizingLevel = result["optimizing_level"].as<int>();
    if (result.count("original"))
    {
        Output_Layer |= result["original"].as<bool>();
    }
    if ( result.count("firstpos"))
    {
        FirstPos = ConvertPos(result["firstpos"].as<string>() );
    }
    if ( result.count("df_name"))
    {
        debug_file_name = result["df_name"].as<string>();
    }
    if (result.count("nested"))
    {
        KeepNested = result["nested"].as<bool>();
    }

    if (result.count("use_cache"))
    {
        UseCache = result["use_cache"].as<bool>();
    }

    if (result.count("free_rot"))
    {
        Flag_free_rot = result["free_rot"].as<bool>();
    }
    if (result.count("debug_file"))
        debug_level += result["debug_file"].as<bool>();;
    if ( Flag_file )
    {
        cout << "Parse options complete" << endl;
        cout << "Input File = " << InputFileName << std::endl;
        cout << "Output File = " << OutputFileName << std::endl;
        cout << "angle = " << StepAngle << std::endl;
        cout << "MinCutDistance = " << MinCutDistance << std::endl;
        cout << "Debug Level = " << debug_level << std::endl;
        cout << "Output layers = " << Output_Layer << std::endl;
        cout << "Optimizing level = " << OptimizingLevel << std::endl;
        cout << "Max_segment_length = " << max_segment_length << std::endl;
        cout << "Use free rotation = " << Flag_free_rot << std::endl;
        cout << "Rectangle cost factor = " << rect_cost << std::endl;
        cout << "Keep nested paths = " << KeepNested << std::endl;
        cout << "Use Cache = " << UseCache << std::endl;
    }

      //    Read and process input file

    SvgDoc InputSVG(InputFileName);
    InputSVG.setDebugLevel(debug_level, debug_file_name);
    InputSVG.setUseCache(UseCache);
    InputSVG.setRectCost(rect_cost);
    if ( InputSVG.SvgData == NULL )
    {
    cerr << " No input to process aborting \n";
    return 1;
    }
    //    Change paths to polygones
    InputSVG.TransformPaths(MinCutDistance / 10.0, KeepNested);
    //    Make larger polygons
    InputSVG.EnlargePaths(MinCutDistance);
    //  Break longer edges if necessary
    InputSVG.BreakLongerEdges(max_segment_length, MinCutDistance / 10.0);
    //    Sort polygons by area
    InputSVG.BuilSingleListPath();
      //    Compute convex hulls of each path
      //  InputSVG.ComputeConvexHulls();
      //    Optimize
    if ( StepAngle == 0 ) StepAngle = 360;
    if ( Flag_free_rot )
        InputSVG.OptimizeFreeRot(OptimizingLevel, FirstPos, Flag_file);
    else
        InputSVG.Optimize(StepAngle * 2 * M_PI / 360, OptimizingLevel, FirstPos, Flag_file);
    InputSVG.WriteDoc(OutputFileName, Flag_file, Output_Layer);


#ifdef TEST_GEO
      //    Now test distance from point to Segment
      Point P00 = Point(0,0);
      Point P11 = Point(1,1);
      Segment Seg1 = Segment(P00, P11);
      Point P01 = Point(0, 1);
      Point P10 = Point(1, 0);
      printf("Distance from P10 to Seg1 =%.3f\n", sqrt(Seg1.sqrDistancePoint(P10)));
      printf("Distance from P01 to Seg1 =%.3f\n", sqrt(Seg1.sqrDistancePoint(P01)));
      Point P2 = Point(2,0);
      printf("Distance from P2 to Seg1 =%.3f\n", sqrt(Seg1.sqrDistancePoint(P2)));
      Point P3 = Point(-1,-1);
      printf("Distance from P3 to Seg1 =%.3f\n", sqrt(Seg1.sqrDistancePoint(P3)));
      Point P4 = Point(2,2);
      printf("Distance from P4 to Seg1 =%.3f\n", sqrt(Seg1.sqrDistancePoint(P4)));
      Point P5 = Point(-1,0);
      printf("Distance from P5 to Seg1 =%.3f\n", sqrt(Seg1.sqrDistancePoint(P5)));
      Segment Seg2 = Segment(P11, P00);
      printf("Distance from P1 to Seg2 =%.3f\n", sqrt(Seg2.sqrDistancePoint(P10)));
      printf("Distance from P2 to Seg2 =%.3f\n", sqrt(Seg2.sqrDistancePoint(P2)));
      printf("Distance from P3 to Seg2 =%.3f\n", sqrt(Seg2.sqrDistancePoint(P3)));
      printf("Distance from P4 to Seg2 =%.3f\n", sqrt(Seg2.sqrDistancePoint(P4)));
      printf("Distance from P5 to Seg2 =%.3f\n", sqrt(Seg2.sqrDistancePoint(P5)));

      //    Test Polygons
      Polygon Poly1 = Polygon();
      Polygon Poly2 = Polygon();
      //    First a rectangle
      Poly1.addVertice(P00);
      Poly1.addVertice(P01);
      Poly1.addVertice(P11);
      Poly1.addVertice(P10);
      Poly1.addVertice(P00);
      printf("Polygon 1 nVertices = %d clockwise =%d, area = %.3f\n", Poly1.nVertices, Poly1.isClockWise(), Poly1.area());

      Poly2.addVertice(P00);
      Poly2.addVertice(P10);
      Poly2.addVertice(P11);
      Poly2.addVertice(P01);
      Poly2.addVertice(P00);
      printf("Polygon 2 nVertices = %d clockwise =%d, area = %.3f\n", Poly2.nVertices, Poly2.isClockWise(), Poly2.area());
      printf("Distance P01 to Poly2 =%.3f\n", sqrt(Poly2.distance(P01)));
      printf("Distance P10 to Poly2 =%.3f\n", sqrt(Poly2.distance(P10)));
      printf("Distance P2 to Poly2 =%.3f\n", sqrt(Poly2.distance(P2)));
      printf("Distance P3 to Poly2 =%.3f\n", sqrt(Poly2.distance(P3)));
      printf("Distance P4 to Poly2 =%.3f\n", sqrt(Poly2.distance(P4)));
      printf("Distance P5 to Poly2 =%.3f\n", sqrt(Poly2.distance(P5)));

      Polygon Poly8 = Polygon();
      for (int i = 0; i <= 8; i++)
      {
        Point p = Point(cos(i*M_PI/4.0), sin(i*M_PI/4.0));
        Poly8.addVertice(p);
      }
      printf("Polygon 8 nVertices = %d clockwise =%d, area = %.3f\n", Poly8.nVertices, Poly8.isClockWise(), Poly8.area());

      printf("Distance P01 to Poly8 =%.3f\n", sqrt(Poly8.distance(P01)));
      printf("Distance P10 to Poly8 =%.3f\n", sqrt(Poly8.distance(P10)));
      printf("Distance P2 to Poly8 =%.3f\n", sqrt(Poly8.distance(P2)));
      printf("Distance P3 to Poly8 =%.3f\n", sqrt(Poly8.distance(P3)));
      printf("Distance P4 to Poly8 =%.3f\n", sqrt(Poly8.distance(P4)));
      printf("Distance P5 to Poly8 =%.3f\n", sqrt(Poly8.distance(P5)));
#endif
#if TEST_ANGLES > 0
    printf("Cas 1 : Départ en -1,0, arrivée en 0,0,  puis va en 0,1\n");
    double sf1 = atan2(-1, 0);
    double sf2 = atan2(-0.2, -1);

    if ( sf1 < 0 ) sf1 += 2*M_PI;
    if ( sf2 < 0 ) sf2 += 2*M_PI;
    double sm2 = 0;
    printf("sf1 = %.1f, sf2 = %.1f\n", sf1 * 180 / M_PI, sf2 *180.0 / M_PI);

    printf("Essai sm1 sm2\n");

    sm2 = 0;
    for ( double a = 1.0; a < 360; a+= 20.0)
    {
        sm2 = a/180.0 * M_PI;
        printf("Angle %.1f, SM1 %d  SM2 %d\n", a, CheckOKAngles(sf1, sf2, sm2), CheckOKAngles(sf2, sf1, sm2));
    }
#endif
      return(0);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x458, %rsp            # imm = 0x458
movq %rsi, %rbx
movl %edi, %ebp
leaq 0x88(%rsp), %rcx
movq %rcx, -0x10(%rcx)
xorl %eax, %eax
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
leaq 0x68(%rsp), %rcx
movq %rcx, -0x10(%rcx)
movq %rax, -0x8(%rcx)
movb %al, (%rcx)
leaq 0x48(%rsp), %rax
movq %rax, -0x10(%rax)
leaq 0x314a5(%rip), %rsi     # 0x3c446
leaq 0x314b0(%rip), %rdx     # 0x3c458
leaq 0x38(%rsp), %rdi
callq 0xff36
leaq 0x378(%rsp), %rdi
movl %ebp, %esi
movq %rbx, %rdx
callq 0x7e3c
leaq 0xa8(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0x34dc7(%rip), %rsi     # 0x3fd9f
leaq 0x34dc1(%rip), %rdx     # 0x3fda0
leaq 0x98(%rsp), %rdi
callq 0xff36
leaq 0x378(%rsp), %rdi
leaq 0x98(%rsp), %rsi
callq 0xcfc6
movq %rax, %rdi
callq 0xd03e
leaq 0x78(%rsp), %rdi
movq %rax, %rsi
callq 0x7260
movq 0x98(%rsp), %rdi
cmpq %r12, %rdi
je 0xb033
movq 0xa8(%rsp), %rsi
incq %rsi
callq 0x7450
leaq 0x98(%rsp), %rdi
movq %r12, (%rdi)
leaq 0x31247(%rip), %rsi     # 0x3c28c
leaq 0x31246(%rip), %rdx     # 0x3c292
callq 0xff36
leaq 0x378(%rsp), %rdi
leaq 0x98(%rsp), %rsi
callq 0xcafc
movq %rax, %r15
movq 0x98(%rsp), %rdi
cmpq %r12, %rdi
je 0xb086
movq 0xa8(%rsp), %rsi
incq %rsi
callq 0x7450
testq %r15, %r15
je 0xb0fa
leaq 0x98(%rsp), %rdi
movq %r12, (%rdi)
leaq 0x311ef(%rip), %rsi     # 0x3c28c
leaq 0x311ee(%rip), %rdx     # 0x3c292
callq 0xff36
leaq 0x378(%rsp), %rdi
leaq 0x98(%rsp), %rsi
callq 0xcfc6
movq %rax, %rdi
callq 0xd03e
leaq 0x58(%rsp), %rdi
movq %rax, %rsi
callq 0x7260
movq 0x98(%rsp), %rdi
cmpq %r12, %rdi
je 0xb0f0
movq 0xa8(%rsp), %rsi
incq %rsi
callq 0x7450
movl $0x1, 0xc(%rsp)
jmp 0xb102
movl $0x0, 0xc(%rsp)
leaq 0x98(%rsp), %rdi
movq %r12, (%rdi)
leaq 0x311cf(%rip), %rsi     # 0x3c2e3
leaq 0x311d0(%rip), %rdx     # 0x3c2eb
callq 0xff36
leaq 0x378(%rsp), %rdi
leaq 0x98(%rsp), %rsi
callq 0xcafc
movq %rax, %rbx
movq 0x98(%rsp), %rdi
cmpq %r12, %rdi
je 0xb155
movq 0xa8(%rsp), %rsi
incq %rsi
callq 0x7450
testq %rbx, %rbx
je 0xb1be
leaq 0x98(%rsp), %rdi
movq %r12, (%rdi)
leaq 0x31177(%rip), %rsi     # 0x3c2e3
leaq 0x31178(%rip), %rdx     # 0x3c2eb
callq 0xff36
leaq 0x378(%rsp), %rdi
leaq 0x98(%rsp), %rsi
callq 0xcfc6
movq %rax, %rdi
callq 0xd0c6
movsd (%rax), %xmm0
movsd %xmm0, 0x20(%rsp)
movq 0x98(%rsp), %rdi
cmpq %r12, %rdi
je 0xb1cc
movq 0xa8(%rsp), %rsi
incq %rsi
callq 0x7450
jmp 0xb1cc
movsd 0x30e42(%rip), %xmm0    # 0x3c008
movsd %xmm0, 0x20(%rsp)
leaq 0x98(%rsp), %rdi
movq %r12, (%rdi)
leaq 0x31398(%rip), %rsi     # 0x3c576
leaq 0x31396(%rip), %rdx     # 0x3c57b
callq 0xff36
leaq 0x378(%rsp), %rdi
leaq 0x98(%rsp), %rsi
callq 0xcafc
movq %rax, %rbx
movq 0x98(%rsp), %rdi
cmpq %r12, %rdi
je 0xb21f
movq 0xa8(%rsp), %rsi
incq %rsi
callq 0x7450
testq %rbx, %rbx
je 0xb290
leaq 0x98(%rsp), %rdi
movq %r12, (%rdi)
leaq 0x31340(%rip), %rsi     # 0x3c576
leaq 0x3133e(%rip), %rdx     # 0x3c57b
callq 0xff36
leaq 0x378(%rsp), %rdi
leaq 0x98(%rsp), %rsi
callq 0xcfc6
movq %rax, %rdi
callq 0xd0c6
movsd (%rax), %xmm0
movsd %xmm0, 0x28(%rsp)
movq 0x98(%rsp), %rdi
cmpq %r12, %rdi
je 0xb286
movq 0xa8(%rsp), %rsi
incq %rsi
callq 0x7450
movl $0x0, 0x10(%rsp)
jmp 0xb2a0
movb $0x1, %al
movl %eax, 0x10(%rsp)
xorpd %xmm0, %xmm0
movsd %xmm0, 0x28(%rsp)
leaq 0x98(%rsp), %rdi
movq %r12, (%rdi)
leaq 0x31088(%rip), %rsi     # 0x3c33a
leaq 0x3108b(%rip), %rdx     # 0x3c344
callq 0xff36
leaq 0x378(%rsp), %rdi
leaq 0x98(%rsp), %rsi
callq 0xcafc
movq %rax, %rbx
movq 0x98(%rsp), %rdi
cmpq %r12, %rdi
je 0xb2f3
movq 0xa8(%rsp), %rsi
incq %rsi
callq 0x7450
testq %rbx, %rbx
je 0xb35c
leaq 0x98(%rsp), %rdi
movq %r12, (%rdi)
leaq 0x31030(%rip), %rsi     # 0x3c33a
leaq 0x31033(%rip), %rdx     # 0x3c344
callq 0xff36
leaq 0x378(%rsp), %rdi
leaq 0x98(%rsp), %rsi
callq 0xcfc6
movq %rax, %rdi
callq 0xd0c6
movsd (%rax), %xmm0
movsd %xmm0, 0x30(%rsp)
movq 0x98(%rsp), %rdi
cmpq %r12, %rdi
je 0xb36a
movq 0xa8(%rsp), %rsi
incq %rsi
callq 0x7450
jmp 0xb36a
movsd 0x30cac(%rip), %xmm0    # 0x3c010
movsd %xmm0, 0x30(%rsp)
leaq 0x98(%rsp), %rdi
movq %r12, (%rdi)
leaq 0x30f9b(%rip), %rsi     # 0x3c317
leaq 0x30f9d(%rip), %rdx     # 0x3c320
callq 0xff36
leaq 0x378(%rsp), %rdi
leaq 0x98(%rsp), %rsi
callq 0xcafc
movq %rax, %rbx
movq 0x98(%rsp), %rdi
cmpq %r12, %rdi
je 0xb3bd
movq 0xa8(%rsp), %rsi
incq %rsi
callq 0x7450
testq %rbx, %rbx
je 0xb426
leaq 0x98(%rsp), %rdi
movq %r12, (%rdi)
leaq 0x30f43(%rip), %rsi     # 0x3c317
leaq 0x30f45(%rip), %rdx     # 0x3c320
callq 0xff36
leaq 0x378(%rsp), %rdi
leaq 0x98(%rsp), %rsi
callq 0xcfc6
movq %rax, %rdi
callq 0xd0c6
movsd (%rax), %xmm0
movsd %xmm0, 0x18(%rsp)
movq 0x98(%rsp), %rdi
cmpq %r12, %rdi
je 0xb430
movq 0xa8(%rsp), %rsi
incq %rsi
callq 0x7450
jmp 0xb430
xorpd %xmm0, %xmm0
movsd %xmm0, 0x18(%rsp)
leaq 0x98(%rsp), %rdi
movq %r12, (%rdi)
leaq 0x30f80(%rip), %rsi     # 0x3c3c2
leaq 0x30f84(%rip), %rdx     # 0x3c3cd
callq 0xff36
leaq 0x378(%rsp), %rdi
leaq 0x98(%rsp), %rsi
callq 0xcafc
movq %rax, %rbx
movq 0x98(%rsp), %rdi
cmpq %r12, %rdi
je 0xb483
movq 0xa8(%rsp), %rsi
incq %rsi
callq 0x7450
testq %rbx, %rbx
je 0xb4e5
leaq 0x98(%rsp), %rdi
movq %r12, (%rdi)
leaq 0x30f28(%rip), %rsi     # 0x3c3c2
leaq 0x30f2c(%rip), %rdx     # 0x3c3cd
callq 0xff36
leaq 0x378(%rsp), %rdi
leaq 0x98(%rsp), %rsi
callq 0xcfc6
movq %rax, %rdi
callq 0xd14e
movl (%rax), %r14d
movq 0x98(%rsp), %rdi
cmpq %r12, %rdi
je 0xb4e8
movq 0xa8(%rsp), %rsi
incq %rsi
callq 0x7450
jmp 0xb4e8
xorl %r14d, %r14d
leaq 0x98(%rsp), %rdi
movq %r12, (%rdi)
leaq 0x30fd8(%rip), %rsi     # 0x3c4d2
leaq 0x30fdd(%rip), %rdx     # 0x3c4de
callq 0xff36
leaq 0x378(%rsp), %rdi
leaq 0x98(%rsp), %rsi
callq 0xcafc
movq %rax, %rbx
movq 0x98(%rsp), %rdi
cmpq %r12, %rdi
je 0xb53b
movq 0xa8(%rsp), %rsi
incq %rsi
callq 0x7450
testq %rbx, %rbx
movq %r15, 0x350(%rsp)
je 0xb5a4
leaq 0x98(%rsp), %rdi
movq %r12, (%rdi)
leaq 0x30f78(%rip), %rsi     # 0x3c4d2
leaq 0x30f7d(%rip), %rdx     # 0x3c4de
callq 0xff36
leaq 0x378(%rsp), %rdi
leaq 0x98(%rsp), %rsi
callq 0xcfc6
movq %rax, %rdi
callq 0xd14e
movl (%rax), %ebp
movq 0x98(%rsp), %rdi
cmpq %r12, %rdi
je 0xb5a6
movq 0xa8(%rsp), %rsi
incq %rsi
callq 0x7450
jmp 0xb5a6
xorl %ebp, %ebp
leaq 0x98(%rsp), %rdi
movq %r12, (%rdi)
leaq 0x30dc3(%rip), %rsi     # 0x3c37b
leaq 0x30dcc(%rip), %rdx     # 0x3c38b
callq 0xff36
leaq 0x378(%rsp), %rdi
leaq 0x98(%rsp), %rsi
callq 0xcafc
movq %rax, %rbx
movq 0x98(%rsp), %rdi
cmpq %r12, %rdi
je 0xb5f9
movq 0xa8(%rsp), %rsi
incq %rsi
callq 0x7450
testq %rbx, %rbx
je 0xb65e
leaq 0x98(%rsp), %rdi
movq %r12, (%rdi)
leaq 0x30d6b(%rip), %rsi     # 0x3c37b
leaq 0x30d74(%rip), %rdx     # 0x3c38b
callq 0xff36
leaq 0x378(%rsp), %rdi
leaq 0x98(%rsp), %rsi
callq 0xcfc6
movq %rax, %rdi
callq 0xd14e
movl (%rax), %eax
movl %eax, 0x8(%rsp)
movq 0x98(%rsp), %rdi
cmpq %r12, %rdi
je 0xb666
movq 0xa8(%rsp), %rsi
incq %rsi
callq 0x7450
jmp 0xb666
movl $0x1, 0x8(%rsp)
leaq 0x98(%rsp), %rdi
movq %r12, (%rdi)
leaq 0x30de3(%rip), %rsi     # 0x3c45b
leaq 0x30de4(%rip), %rdx     # 0x3c463
callq 0xff36
leaq 0x378(%rsp), %rdi
leaq 0x98(%rsp), %rsi
callq 0xcafc
movq %rax, %rbx
movq 0x98(%rsp), %rdi
cmpq %r12, %rdi
je 0xb6b9
movq 0xa8(%rsp), %rsi
incq %rsi
callq 0x7450
testq %rbx, %rbx
je 0xb71b
leaq 0x98(%rsp), %rdi
movq %r12, (%rdi)
leaq 0x30d8b(%rip), %rsi     # 0x3c45b
leaq 0x30d8c(%rip), %rdx     # 0x3c463
callq 0xff36
leaq 0x378(%rsp), %rdi
leaq 0x98(%rsp), %rsi
callq 0xcfc6
movq %rax, %rdi
callq 0xd1d6
movzbl (%rax), %ebx
movq 0x98(%rsp), %rdi
cmpq %r12, %rdi
je 0xb719
movq 0xa8(%rsp), %rsi
incq %rsi
callq 0x7450
orl %ebx, %ebp
leaq 0x98(%rsp), %rdi
movq %r12, (%rdi)
leaq 0x30e83(%rip), %rsi     # 0x3c5b0
leaq 0x30e84(%rip), %rdx     # 0x3c5b8
callq 0xff36
leaq 0x378(%rsp), %rdi
leaq 0x98(%rsp), %rsi
callq 0xcafc
movq %rax, %rbx
movq 0x98(%rsp), %rdi
cmpq %r12, %rdi
je 0xb76e
movq 0xa8(%rsp), %rsi
incq %rsi
callq 0x7450
testq %rbx, %rbx
je 0xb80e
leaq 0x98(%rsp), %rdi
movq %r12, (%rdi)
leaq 0x30e27(%rip), %rsi     # 0x3c5b0
leaq 0x30e28(%rip), %rdx     # 0x3c5b8
callq 0xff36
leaq 0x378(%rsp), %rdi
leaq 0x98(%rsp), %rsi
callq 0xcfc6
movq %rax, %rdi
callq 0xd03e
leaq 0x448(%rsp), %rbx
movq %rbx, -0x10(%rbx)
movq (%rax), %rsi
movq 0x8(%rax), %rdx
addq %rsi, %rdx
leaq 0x438(%rsp), %rdi
callq 0x15ee6
movq 0x438(%rsp), %rdi
xorl %esi, %esi
cmpq $0x2, 0x440(%rsp)
jb 0xb883
movzbl (%rdi), %ecx
xorl %esi, %esi
cmpl $0x61, %ecx
jg 0xb81b
cmpl $0x42, %ecx
je 0xb831
cmpl $0x43, %ecx
je 0xb838
movl $0x0, %eax
cmpl $0x54, %ecx
je 0xb83d
jmp 0xb883
movl $0x5, 0x14(%rsp)
jmp 0xb8b9
cmpl $0x62, %ecx
je 0xb831
cmpl $0x63, %ecx
je 0xb838
movl $0x0, %eax
cmpl $0x74, %ecx
je 0xb83d
jmp 0xb883
movl $0x8, %eax
jmp 0xb83d
movl $0x4, %eax
movzbl 0x1(%rdi), %ecx
addl $-0x43, %ecx
cmpl $0x2f, %ecx
ja 0xb883
movabsq $0x100000001, %rdx      # imm = 0x100000001
btq %rcx, %rdx
jb 0xb87e
movabsq $0x20000000200, %rdx    # imm = 0x20000000200
btq %rcx, %rdx
jb 0xb881
movabsq $0x800000008000, %rdx   # imm = 0x800000008000
btq %rcx, %rdx
jae 0xb883
orl $0x2, %eax
jmp 0xb881
orl $0x1, %eax
movl %eax, %esi
movl %esi, 0x14(%rsp)
cmpq %rbx, %rdi
je 0xb89c
movq 0x448(%rsp), %rsi
incq %rsi
callq 0x7450
movq 0x98(%rsp), %rdi
cmpq %r12, %rdi
je 0xb8b9
movq 0xa8(%rsp), %rsi
incq %rsi
callq 0x7450
leaq 0x98(%rsp), %rdi
movq %r12, (%rdi)
leaq 0x30b60(%rip), %rsi     # 0x3c42b
leaq 0x30b60(%rip), %rdx     # 0x3c432
callq 0xff36
leaq 0x378(%rsp), %rdi
leaq 0x98(%rsp), %rsi
callq 0xcafc
movq %rax, %rbx
movq 0x98(%rsp), %rdi
cmpq %r12, %rdi
je 0xb90c
movq 0xa8(%rsp), %rsi
incq %rsi
callq 0x7450
testq %rbx, %rbx
je 0xb976
leaq 0x98(%rsp), %rdi
movq %r12, (%rdi)
leaq 0x30b08(%rip), %rsi     # 0x3c42b
leaq 0x30b08(%rip), %rdx     # 0x3c432
callq 0xff36
leaq 0x378(%rsp), %rdi
leaq 0x98(%rsp), %rsi
callq 0xcfc6
movq %rax, %rdi
callq 0xd03e
leaq 0x38(%rsp), %rdi
movq %rax, %rsi
callq 0x7260
movq 0x98(%rsp), %rdi
cmpq %r12, %rdi
je 0xb976
movq 0xa8(%rsp), %rsi
incq %rsi
callq 0x7450
leaq 0x98(%rsp), %rdi
movq %r12, (%rdi)
leaq 0x30afa(%rip), %rsi     # 0x3c482
leaq 0x30af9(%rip), %rdx     # 0x3c488
callq 0xff36
leaq 0x378(%rsp), %rdi
leaq 0x98(%rsp), %rsi
callq 0xcafc
movq %rax, %rbx
movq 0x98(%rsp), %rdi
cmpq %r12, %rdi
je 0xb9c9
movq 0xa8(%rsp), %rsi
incq %rsi
callq 0x7450
testq %rbx, %rbx
je 0xba2b
leaq 0x98(%rsp), %rdi
movq %r12, (%rdi)
leaq 0x30aa2(%rip), %rsi     # 0x3c482
leaq 0x30aa1(%rip), %rdx     # 0x3c488
callq 0xff36
leaq 0x378(%rsp), %rdi
leaq 0x98(%rsp), %rsi
callq 0xcfc6
movq %rax, %rdi
callq 0xd1d6
movzbl (%rax), %ebx
movq 0x98(%rsp), %rdi
cmpq %r12, %rdi
je 0xba30
movq 0xa8(%rsp), %rsi
incq %rsi
callq 0x7450
jmp 0xba30
movl $0x1, %ebx
leaq 0x98(%rsp), %rdi
movq %r12, (%rdi)
leaq 0x30a63(%rip), %rsi     # 0x3c4a5
leaq 0x30a65(%rip), %rdx     # 0x3c4ae
callq 0xff36
leaq 0x378(%rsp), %rdi
leaq 0x98(%rsp), %rsi
callq 0xcafc
movq %rax, %r15
movq 0x98(%rsp), %rdi
cmpq %r12, %rdi
je 0xba83
movq 0xa8(%rsp), %rsi
incq %rsi
callq 0x7450
testq %r15, %r15
je 0xbae6
leaq 0x98(%rsp), %rdi
movq %r12, (%rdi)
leaq 0x30a0b(%rip), %rsi     # 0x3c4a5
leaq 0x30a0d(%rip), %rdx     # 0x3c4ae
callq 0xff36
leaq 0x378(%rsp), %rdi
leaq 0x98(%rsp), %rsi
callq 0xcfc6
movq %rax, %rdi
callq 0xd1d6
movzbl (%rax), %r15d
movq 0x98(%rsp), %rdi
cmpq %r12, %rdi
je 0xbae9
movq 0xa8(%rsp), %rsi
incq %rsi
callq 0x7450
jmp 0xbae9
xorl %r15d, %r15d
leaq 0x98(%rsp), %rdi
movq %r12, (%rdi)
leaq 0x30a96(%rip), %rsi     # 0x3c591
leaq 0x30a97(%rip), %rdx     # 0x3c599
callq 0xff36
leaq 0x378(%rsp), %rdi
leaq 0x98(%rsp), %rsi
callq 0xcafc
movq %rax, %r13
movq 0x98(%rsp), %rdi
cmpq %r12, %rdi
je 0xbb3c
movq 0xa8(%rsp), %rsi
incq %rsi
callq 0x7450
testq %r13, %r13
je 0xbb9f
leaq 0x98(%rsp), %rdi
movq %r12, (%rdi)
leaq 0x30a3e(%rip), %rsi     # 0x3c591
leaq 0x30a3f(%rip), %rdx     # 0x3c599
callq 0xff36
leaq 0x378(%rsp), %rdi
leaq 0x98(%rsp), %rsi
callq 0xcfc6
movq %rax, %rdi
callq 0xd1d6
movb (%rax), %al
movl %eax, 0x10(%rsp)
movq 0x98(%rsp), %rdi
cmpq %r12, %rdi
je 0xbb9f
movq 0xa8(%rsp), %rsi
incq %rsi
callq 0x7450
leaq 0x98(%rsp), %rdi
movq %r12, (%rdi)
leaq 0x30848(%rip), %rsi     # 0x3c3f9
leaq 0x3084b(%rip), %rdx     # 0x3c403
callq 0xff36
leaq 0x378(%rsp), %rdi
leaq 0x98(%rsp), %rsi
callq 0xcafc
movq %rax, %r13
movq 0x98(%rsp), %rdi
cmpq %r12, %rdi
je 0xbbf2
movq 0xa8(%rsp), %rsi
incq %rsi
callq 0x7450
testq %r13, %r13
je 0xbc56
leaq 0x98(%rsp), %rdi
movq %r12, (%rdi)
leaq 0x307f0(%rip), %rsi     # 0x3c3f9
leaq 0x307f3(%rip), %rdx     # 0x3c403
callq 0xff36
leaq 0x378(%rsp), %rdi
leaq 0x98(%rsp), %rsi
callq 0xcfc6
movq %rax, %rdi
callq 0xd1d6
movzbl (%rax), %r13d
movq 0x98(%rsp), %rdi
cmpq %r12, %rdi
je 0xbc53
movq 0xa8(%rsp), %rsi
incq %rsi
callq 0x7450
addl %r13d, %r14d
cmpq $0x0, 0x350(%rsp)
je 0xc096
movq 0x45324(%rip), %r12     # 0x50f90
leaq 0x309a1(%rip), %rsi     # 0x3c614
movl $0x16, %edx
movq %r12, %rdi
callq 0x74e0
movq (%r12), %rax
addq -0x18(%rax), %r12
movq %r12, %rdi
movl $0xa, %esi
callq 0x7400
movsbl %al, %esi
movq 0x452f1(%rip), %rdi     # 0x50f90
callq 0x7050
movq %rax, %rdi
callq 0x7310
movq 0x452dd(%rip), %rdi     # 0x50f90
leaq 0x30971(%rip), %rsi     # 0x3c62b
movl $0xd, %edx
callq 0x74e0
movq 0x78(%rsp), %rsi
movq 0x80(%rsp), %rdx
movq 0x452b8(%rip), %rdi     # 0x50f90
callq 0x74e0
movq %rax, %r12
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x7400
movsbl %al, %esi
movq %r12, %rdi
callq 0x7050
movq %rax, %rdi
callq 0x7310
movq 0x45282(%rip), %rdi     # 0x50f90
leaq 0x30924(%rip), %rsi     # 0x3c639
movl $0xe, %edx
callq 0x74e0
movq 0x58(%rsp), %rsi
movq 0x60(%rsp), %rdx
movq 0x45260(%rip), %rdi     # 0x50f90
callq 0x74e0
movq %rax, %r12
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x7400
movsbl %al, %esi
movq %r12, %rdi
callq 0x7050
movq %rax, %rdi
callq 0x7310
movq 0x4522a(%rip), %rdi     # 0x50f90
leaq 0x308db(%rip), %rsi     # 0x3c648
movl $0x8, %edx
callq 0x74e0
movq 0x45212(%rip), %rdi     # 0x50f90
movsd 0x28(%rsp), %xmm0
callq 0x7690
movq %rax, %r12
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x7400
movsbl %al, %esi
movq %r12, %rdi
callq 0x7050
movq %rax, %rdi
callq 0x7310
movq 0x451d6(%rip), %rdi     # 0x50f90
leaq 0x30890(%rip), %rsi     # 0x3c651
movl $0x11, %edx
callq 0x74e0
movq 0x451be(%rip), %rdi     # 0x50f90
movsd 0x20(%rsp), %xmm0
callq 0x7690
movq %rax, %r12
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x7400
movsbl %al, %esi
movq %r12, %rdi
callq 0x7050
movq %rax, %rdi
callq 0x7310
movq 0x45182(%rip), %rdi     # 0x50f90
leaq 0x3084e(%rip), %rsi     # 0x3c663
movl $0xe, %edx
callq 0x74e0
movq 0x4516a(%rip), %rdi     # 0x50f90
movl %r14d, %esi
callq 0x7720
movq %rax, %r12
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x7400
movsbl %al, %esi
movq %r12, %rdi
callq 0x7050
movq %rax, %rdi
callq 0x7310
movq 0x45131(%rip), %rdi     # 0x50f90
leaq 0x3080c(%rip), %rsi     # 0x3c672
movl $0x10, %edx
callq 0x74e0
movq 0x45119(%rip), %rdi     # 0x50f90
movl %ebp, %esi
callq 0x7720
movq %rax, %r12
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x7400
movsbl %al, %esi
movq %r12, %rdi
callq 0x7050
movq %rax, %rdi
callq 0x7310
movq 0x450e1(%rip), %rdi     # 0x50f90
leaq 0x307cd(%rip), %rsi     # 0x3c683
movl $0x13, %edx
callq 0x74e0
movq 0x450c9(%rip), %rdi     # 0x50f90
movl 0x8(%rsp), %esi
callq 0x7720
movq %rax, %r12
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x7400
movsbl %al, %esi
movq %r12, %rdi
callq 0x7050
movq %rax, %rdi
callq 0x7310
movq 0x4508f(%rip), %rdi     # 0x50f90
leaq 0x3078f(%rip), %rsi     # 0x3c697
movl $0x15, %edx
callq 0x74e0
movq 0x45077(%rip), %rdi     # 0x50f90
movsd 0x30(%rsp), %xmm0
callq 0x7690
movq %rax, %r12
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x7400
movsbl %al, %esi
movq %r12, %rdi
callq 0x7050
movq %rax, %rdi
callq 0x7310
movq 0x4503b(%rip), %rdi     # 0x50f90
leaq 0x30751(%rip), %rsi     # 0x3c6ad
movl $0x14, %edx
callq 0x74e0
movzbl 0x10(%rsp), %esi
movq 0x4501e(%rip), %rdi     # 0x50f90
callq 0x76e0
movq %rax, %r12
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x7400
movsbl %al, %esi
movq %r12, %rdi
callq 0x7050
movq %rax, %rdi
callq 0x7310
movq 0x44fe8(%rip), %rdi     # 0x50f90
leaq 0x30713(%rip), %rsi     # 0x3c6c2
movl $0x18, %edx
callq 0x74e0
movq 0x44fd0(%rip), %rdi     # 0x50f90
movsd 0x18(%rsp), %xmm0
callq 0x7690
movq %rax, %r12
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x7400
movsbl %al, %esi
movq %r12, %rdi
callq 0x7050
movq %rax, %rdi
callq 0x7310
movq 0x44f94(%rip), %rdi     # 0x50f90
leaq 0x306d8(%rip), %rsi     # 0x3c6db
movl $0x14, %edx
callq 0x74e0
movq 0x44f7c(%rip), %rdi     # 0x50f90
movl %ebx, %esi
callq 0x7720
movq %rax, %r12
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x7400
movsbl %al, %esi
movq %r12, %rdi
callq 0x7050
movq %rax, %rdi
callq 0x7310
movq 0x44f44(%rip), %rdi     # 0x50f90
leaq 0x3069d(%rip), %rsi     # 0x3c6f0
movl $0xc, %edx
callq 0x74e0
movq 0x44f2c(%rip), %rdi     # 0x50f90
movl %r15d, %esi
callq 0x7720
movq %rax, %r12
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r12, %rdi
movl $0xa, %esi
callq 0x7400
movsbl %al, %esi
movq %r12, %rdi
callq 0x7050
movq %rax, %rdi
callq 0x7310
leaq 0x98(%rsp), %rdi
leaq 0x78(%rsp), %rsi
callq 0x2e2dc
leaq 0x368(%rsp), %r12
movq %r12, -0x10(%r12)
movq 0x38(%rsp), %rsi
movq 0x40(%rsp), %rdx
addq %rsi, %rdx
leaq 0x358(%rsp), %rdi
callq 0x15ee6
leaq 0x100(%rsp), %rdi
movl %r14d, -0x8(%rdi)
leaq 0x358(%rsp), %rsi
movl $0x10, %edx
callq 0x71f0
movq 0x358(%rsp), %rdi
cmpq %r12, %rdi
je 0xc10a
movq 0x368(%rsp), %rsi
incq %rsi
callq 0x7450
movl %r15d, 0xfc(%rsp)
movsd 0x18(%rsp), %xmm0
movsd %xmm0, 0xd0(%rsp)
cmpq $0x0, 0xa0(%rsp)
je 0xc1aa
movsd 0x20(%rsp), %xmm0
divsd 0x2fede(%rip), %xmm0    # 0x3c018
leaq 0x98(%rsp), %rdi
movsd %xmm0, 0x18(%rsp)
movl %ebx, %esi
callq 0x2c70c
leaq 0x98(%rsp), %rdi
movsd 0x20(%rsp), %xmm0
callq 0x2dc96
leaq 0x98(%rsp), %rdi
movsd 0x30(%rsp), %xmm0
movsd 0x18(%rsp), %xmm1
callq 0x2e006
leaq 0x98(%rsp), %rdi
callq 0x30c3c
cmpb $0x0, 0x10(%rsp)
je 0xc1c9
leaq 0x98(%rsp), %rdi
movl 0x8(%rsp), %esi
movl 0x14(%rsp), %edx
movl 0xc(%rsp), %ecx
callq 0x34e9c
jmp 0xc21d
movl $0x1, %ebx
movq 0x44e2a(%rip), %rdi     # 0x50fe0
leaq 0x30540(%rip), %rsi     # 0x3c6fd
movl $0x1f, %edx
callq 0x74e0
jmp 0xc237
movsd 0x28(%rsp), %xmm2
movapd %xmm2, %xmm1
addsd %xmm2, %xmm1
mulsd 0x2fe41(%rip), %xmm1    # 0x3c020
divsd 0x2fe41(%rip), %xmm1    # 0x3c028
xorpd %xmm0, %xmm0
cmpeqsd %xmm2, %xmm0
movsd 0x2fe38(%rip), %xmm2    # 0x3c030
andpd %xmm0, %xmm2
andnpd %xmm1, %xmm0
orpd %xmm2, %xmm0
leaq 0x98(%rsp), %rdi
movl 0x8(%rsp), %esi
movl 0x14(%rsp), %edx
movl 0xc(%rsp), %ecx
callq 0x31156
xorl %ebx, %ebx
leaq 0x98(%rsp), %rdi
leaq 0x58(%rsp), %rsi
movl 0xc(%rsp), %edx
movl %ebp, %ecx
callq 0x30b32
leaq 0x98(%rsp), %rdi
callq 0x2e42e
leaq 0x420(%rsp), %rdi
callq 0x1275e
leaq 0x3e0(%rsp), %rdi
callq 0x13fe8
leaq 0x3a8(%rsp), %rdi
callq 0x14086
leaq 0x388(%rsp), %r14
movq %r14, %rdi
callq 0xce86
movq -0x8(%r14), %rdi
testq %rdi, %rdi
je 0xc289
callq 0xd388
movq 0x38(%rsp), %rdi
leaq 0x48(%rsp), %rax
cmpq %rax, %rdi
leaq 0x88(%rsp), %r14
je 0xc2ad
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x7450
movq 0x58(%rsp), %rdi
leaq 0x68(%rsp), %rax
cmpq %rax, %rdi
je 0xc2c9
movq 0x68(%rsp), %rsi
incq %rsi
callq 0x7450
movq 0x78(%rsp), %rdi
cmpq %r14, %rdi
je 0xc2e3
movq 0x88(%rsp), %rsi
incq %rsi
callq 0x7450
movl %ebx, %eax
addq $0x458, %rsp            # imm = 0x458
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0xc41c
jmp 0xc41c
jmp 0xc41c
jmp 0xc41c
jmp 0xc41c
jmp 0xc41c
jmp 0xc41c
jmp 0xc41c
jmp 0xc41c
jmp 0xc41c
jmp 0xc41c
jmp 0xc41c
jmp 0xc41c
jmp 0xc41c
jmp 0xc41c
movq %rax, %rbx
movq 0x358(%rsp), %rdi
cmpq %r12, %rdi
je 0xc40d
movq 0x368(%rsp), %rsi
incq %rsi
callq 0x7450
jmp 0xc40d
jmp 0xc41c
jmp 0xc3e8
jmp 0xc41c
jmp 0xc3e8
jmp 0xc41c
jmp 0xc3e8
jmp 0xc41c
jmp 0xc3e8
jmp 0xc41c
jmp 0xc3e8
jmp 0xc41c
jmp 0xc3e8
jmp 0xc41c
jmp 0xc3e8
jmp 0xc41c
jmp 0xc3e8
jmp 0xc41c
jmp 0xc3e8
jmp 0xc41c
jmp 0xc3e8
jmp 0xc41c
jmp 0xc3e8
jmp 0xc41c
jmp 0xc3e8
jmp 0xc41c
jmp 0xc3e8
jmp 0xc41c
jmp 0xc3e8
jmp 0xc41c
jmp 0xc3e8
jmp 0xc41c
jmp 0xc41c
movq %rax, %rbx
jmp 0xc42c
movq %rax, %rbx
jmp 0xc448
jmp 0xc3e8
jmp 0xc3e8
jmp 0xc3e8
jmp 0xc3e8
jmp 0xc3e8
jmp 0xc3e8
jmp 0xc3e8
jmp 0xc3e8
jmp 0xc3e8
jmp 0xc3e8
jmp 0xc3e8
jmp 0xc3e8
jmp 0xc3e8
jmp 0xc3e8
jmp 0xc3e8
movq %rax, %rbx
movq 0x98(%rsp), %rdi
cmpq %r12, %rdi
je 0xc41f
movq 0xa8(%rsp), %rsi
incq %rsi
callq 0x7450
jmp 0xc41f
movq %rax, %rbx
leaq 0x98(%rsp), %rdi
callq 0x2e42e
jmp 0xc41f
movq %rax, %rbx
leaq 0x378(%rsp), %rdi
callq 0xcee4
movq 0x38(%rsp), %rdi
leaq 0x48(%rsp), %rax
cmpq %rax, %rdi
je 0xc448
movq 0x48(%rsp), %rsi
incq %rsi
callq 0x7450
movq 0x58(%rsp), %rdi
leaq 0x68(%rsp), %rax
cmpq %rax, %rdi
je 0xc464
movq 0x68(%rsp), %rsi
incq %rsi
callq 0x7450
movq 0x78(%rsp), %rdi
leaq 0x88(%rsp), %rax
cmpq %rax, %rdi
je 0xc486
movq 0x88(%rsp), %rsi
incq %rsi
callq 0x7450
movq %rbx, %rdi
callq 0x7740