text:
(*_F.STAXXX._pfn)(_F.STAXXX._slink);

        // line 3344
        throw NL_READER_STACMD_21;

        { /* NOP */ }
    }

    { /* NOP */ }
}

// line 3368
//================================================================================
// scope: READER_WHACMD (level : 3)

// activation record
struct Frame_READER_WHACMD
{
   Frame_READER* _slink;
};

// function body
void P_READER_WHACMD(void* _slink)
{
    // prologue/frame definition
    Frame_READER_WHACMD _F = { (Frame_READER*)_slink };

    // subroutine body
    // line 3371
    Output << MOVMS << _WRITELN;

    { /* NOP */ }
}

// line 3410
//================================================================================
// scope: MINENG (level : 2)

// forward declarations
void P_MINENG_ADDCHR(void* _slink, T_char A);
void P_MINENG_ADDSQR(void* _slink, T_TS A, T_RD B);
void P_MINENG_ADDWRD(void* _slink, T_RA A, T_TA B);
T_boolean F_MINENG_DIFFER(void* _slink, T_RM A, T_RM B);
void P_MINENG_SETSQD(void* _slink, T_TS A, T_RD B, T_SR& C, T_SF& O);
void P_MINENG_MINGEN(void* _slink, T_RM A, T_integer B, T_integer C);

// activation record
struct Frame_MINENG
{
    // parameters
    T_RM A;
    T_RA B;

    // locals
    T_TN INTN;
};

// function body
void P_MINENG(void* _slink, T_RM A, T_RA B)
{
    // prologue/frame definition
    Frame_MINENG _F = {A, B };

    assert(nullptr == _slink);

    // subroutine body
    // line 3597
    MOVMS = "                              ";

    // line 3599
    _F.INTN = (C_AN + 1);

    // line 3600
    P_MINENG_ADDWRD(&_F, _F.B, T_TA::C(C_ZA));

    // line 3601
    P_MINENG_ADDWRD(&_F, T_RA::C("-         "), T_TA::C(2));

    // line 3604
    if(_F.A.RMOO)
    {
        // line 3606
        P_MINENG_ADDWRD(&_F, T_RA::C("O-O       "), T_TA::C(3));

        // line 3607
        if(_F.A.RMQS)
        {
            // line 3608
            P_MINENG_ADDWRD(&_F, T_RA::C("-O        "), T_TA::C(2));
        }

        { /* NOP */ }
    }
    else
    {
        // line 3611
        if(_F.A.RMCA)
        {
            // line 3612
            P_MINENG_MINGEN(&_F, _F.A, C_SYNCF, C_SYNCL);
        }
        else
        {
            // line 3614
            P_MINENG_MINGEN(&_F, _F.A, C_SYNMF, C_SYNML);
        }
    }

    // line 3615
    if(_F.A.RMPR)
    {
        // line 3617
        P_MINENG_ADDCHR(&_F, '=');

        // line 3618
        P_MINENG_ADDCHR(&_F, XTGC[_F.A.RMPP]);

        { /* NOP */ }
    }

    // line 3620
    P_MINENG_ADDWRD(&_F, T_RA::C(".         "), T_TA::C(3));

    // line 3621
    if(_F.A.RMCH)
    {
        // line 3623
        P_MINENG_ADDWRD(&_F, T_RA::C("CHECK     "), T_TA::C(5));

        // line 3624
        if(_F.A.RMMT)
        {
            // line 3625
            P_MINENG_ADDWRD(&_F, T_RA::C("MATE      "), T_TA::C(4));
        }

        // line 3626
        P_MINENG_ADDCHR(&_F, '.');

        { /* NOP */ }
    }
    else
    {
        // line 3629
        if(_F.A.RMMT)
        {
            // line 3630
            P_MINENG_ADDWRD(&_F, T_RA::C("STALEMATE."), T_TA::C(10));
        }
    }

    { /* NOP */ }

    { /* NOP */ }
}

// line 3418
//================================================================================
// scope: MINENG_ADDCHR (level : 3)

// activation record
struct Frame_MINENG_ADDCHR
{
   Frame_MINENG* _slink;

    // parameters
    T_char A;
};

// function body
void P_MINENG_ADDCHR(void* _slink, T_char A)
{
    // prologue/frame definition
    Frame_MINENG_ADDCHR _F = { (Frame_MINENG*)_slink, A };

    // subroutine body
    // line 3422
    MOVMS[_F._slink->INTN] = _F.A;

    // line 3423
    if((_F._slink->INTN < C_ZN))
    {
        // line 3424
        _F._slink->INTN = (_F._slink->INTN + 1);
    }

    { /* NOP */ }
}

// line 3428
//================================================================================
// scope: MINENG_ADDSQR (level : 3)

// activation record
struct Frame_MINENG_ADDSQR
{
   Frame_MINENG* _slink;

    // parameters
    T_TS A;
    T_RD B;
};

// function body
void P_MINENG_ADDSQR(void* _slink, T_TS A, T_RD B)
{
    // prologue/frame definition
    Frame_MINENG_ADDSQR _F = { (Frame_MINENG*)_slink, A, B };

    // hoisted definitions
    _T_GenericSet _setLiteral1;
    _setLiteral1.set(C_F1, C_F4);

    // subroutine body
    // line 3435
    if(_F.B.RDPC)
    {
        // line 3436
        P_MINENG_ADDCHR(_F._slink, XTUC[XTPU[MBORD[_F.A]]]);
    }

    // line 3437
    if(_F.B.RDSL)
    {
        // line 3438
        P_MINENG_ADDCHR(_F._slink, '/');
    }

    // line 3439
    if(_F.B.RDKQ)
    {
        // line 3440
        if((_setLiteral1 & XTSF[_F.A]))
        {
            // line 3441
            P_MINENG_ADDCHR(_F._slink, 'Q');
        }
        else
        {
            // line 3442
            P_MINENG_ADDCHR(_F._slink, 'K');
        }
    }

    // line 3443
    if(_F.B.RDNB)
    {
        // line 3444
        switch(XTSF[_F.A])
        {
        case C_F1:
        case C_F8:
            // line 3445
            P_MINENG_ADDCHR(_F._slink, 'R');
            break;

        case C_F2:
        case C_F7:
            // line 3446
            P_MINENG_ADDCHR(_F._slink, 'N');
            break;

        case C_F3:
        case C_F6:
            // line 3447
            P_MINENG_ADDCHR(_F._slink, 'B');
            break;

        case C_F4:
            // line 3448
            P_MINENG_ADDCHR(_F._slink, 'Q');
            break;

        case C_F5:
            // line 3449
            P_MINENG_ADDCHR(_F._slink, 'K');
            break;
        }
    }

    // line 3451
    if(_F.B.RDRK)
    {
        // line 3452
        if((JNTM == C_LITE))
        {
            // line 3453
            switch(XTSR[_F.A])
            {
            case C_R1:
                // line 3454
                P_MINENG_ADDCHR(_F._slink, '1');
                break;

            case C_R2:
                // line 3455
                P_MINENG_ADDCHR(_F._slink, '2');
                break;

            case C_R3:
                // line 3456
                P_MINENG_ADDCHR(_F._slink, '3');
                break;

            case C_R4:
                // line 3457
                P_MINENG_ADDCHR(_F._slink, '4');
                break;

            case C_R5:
                // line 3458
                P_MINENG_ADDCHR(_F._slink, '5');
                break;

            case C_R6:
                // line 3459
                P_MINENG_ADDCHR(_F._slink, '6');
                break;

            case C_R7:
                // line 3460
                P_MINENG_ADDCHR(_F._slink, '7');
                break;

            case C_R8:
                // line 3461
                P_MINENG_ADDCHR(_F._slink, '8');
                break;
            }
        }
        else
        {
            // line 3464
            switch(XTSR[_F.A])
            {
            case C_R1:
                // line 3465
                P_MINENG_ADDCHR(_F._slink, '8');
                break;

            case C_R2:
                // line 3466
                P_MINENG_ADDCHR(_F._slink, '7');
                break;

            case C_R3:
                // line 3467
                P_MINENG_ADDCHR(_F._slink, '6');
                break;

            case C_R4:
                // line 3468
                P_MINENG_ADDCHR(_F._slink, '5');
                break;

            case C_R5:
                // line 3469
                P_MINENG_ADDCHR(_F._slink, '4');
                break;

            case C_R6:
                // line 3470
                P_MINENG_ADDCHR(_F._slink, '3');
                break;

            case C_R7:
                // line 3471
                P_MINENG_ADDCHR(_F._slink, '2');
                break;

            case C_R8:
                // line 3472
                P_MINENG_ADDCHR(_F._slink, '1');
                break;
            }
        }
    }

    { /* NOP */ }

    { /* NOP */ }
}

// line 3478
//================================================================================
// scope: MINENG_ADDWRD (level : 3)

// activation record
struct Frame_MINENG_ADDWRD
{
   Frame_MINENG* _slink;

    // parameters
    T_RA A;
    T_TA B;

    // locals
    T_TA INTA;
};

// function body
void P_MINENG_ADDWRD(void* _slink, T_RA A, T_TA B)
{
    // prologue/frame definition
    Frame_MINENG_ADDWRD _F = { (Frame_MINENG*)_slink, A, B };

    // subroutine body
    // line 3486
    _FOR_TO(_F.INTA, C_AA, _F.B)
    {
        // line 3487
        P_MINENG_ADDCHR(_F._slink, _F.A[_F.INTA]);
    }
    _FOR_END(_F.INTA)

    { /* NOP */ }
}

// line 3491
//================================================================================
// scope: MINENG_DIFFER (level : 3)

// activation record
struct Frame_MINENG_DIFFER
{
   Frame_MINENG* _slink;

    // parameters
    T_RM A;
    T_RM B;

    // locals
    T_boolean _fnvalue;
    T_boolean INTB;
};

// function body
T_boolean F_MINENG_DIFFER(void* _slink, T_RM A, T_RM B)
{
    // prologue/frame definition
    Frame_MINENG_DIFFER _F = { (Frame_MINENG*)_slink, A, B };

    // subroutine body
    // line 3499
    _F.INTB = (((_F.A.RMFR != _F.B.RMFR) || (_F.A.RMTO != _F.B.RMTO)) || (_F.A.RMCP != _F.B.RMCP));

    // line 3500
    if((_F.A.RMPR == _F.B.RMPR))
    {
        // line 3501
        if(_F.A.RMPR)
        {
            // line 3502
            _F._fnvalue = (_F.INTB || (_F.A.RMPP != _F.B.RMPP));
        }
        else
        {
            // line 3504
            if((_F.A.RMOO == _F.B.RMOO))
            {
                // line 3505
                if(_F.A.RMOO)
                {
                    // line 3506
                    _F._fnvalue = (_F.INTB || (_F.A.RMQS != _F.B.RMQS));
                }
                else
                {
                    // line 3508
                    _F._fnvalue = _F.INTB;
                }
            }
            else
            {
                // line 3510
                _F._fnvalue = C_true;
            }
        }
    }
    else
    {
        // line 3512
        _F._fnvalue = C_true;
    }

    { /* NOP */ }

    // epilogue
    return _F._fnvalue;
}

// line 3516
//================================================================================
// scope: MINENG_SETSQD (level : 3)

// activation record
struct Frame_MINENG_SETSQD
{
   Frame_MINENG* _slink;

    // parameters
    T_TS A;
    T_RD B;
    T_SR& C;
    T_SF& O;
};

// function body
void P_MINENG_SETSQD(void* _slink, T_TS A, T_RD B, T_SR& C, T_SF& O)
{
    // prologue/frame definition
    Frame_MINENG_SETSQD _F = { (Frame_MINENG*)_slink, A, B, C, O };

    // hoisted definitions
    _T_GenericSet _setLiteral1;
    _setLiteral1.set(C_R1, C_R8);

    _T_GenericSet _setLiteral2;
    _setLiteral2.set(C_F1, C_F8);

    _T_GenericSet _setLiteral4;
    _setLiteral4.set(C_F1);
    _setLiteral4.set(C_F8);

    _T_GenericSet _setLiteral5;
    _setLiteral5.set(C_F2);
    _setLiteral5.set(C_F7);

    _T_GenericSet _setLiteral6;
    _setLiteral6.set(C_F3);
    _setLiteral6.set(C_F6);

    _T_GenericSet _setLiteral7;
    _setLiteral7.set(C_F4);

    _T_GenericSet _setLiteral8;
    _setLiteral8.set(C_F5);

    // subroutine body
    // line 3524
    _F.C = _setLiteral1;

    // line 3525
    _F.O = _setLiteral2;

    // line 3528
    if((_F.B.RDKQ && _F.B.RDNB))
    {
        // line 3529
        {
            _T_GenericSet _setLiteral3;
            _setLiteral3.set(XTSF[_F.A]);

            _F.O = _setLiteral3;
        }
    }

    // line 3530
    if(((!_F.B.RDKQ) && _F.B.RDNB))
    {
        // line 3531
        switch(XTSF[_F.A])
        {
        case C_F1:
        case C_F8:
            // line 3532
            _F.O = _setLiteral4;
            break;

        case C_F2:
        case C_F7:
            // line 3533
            _F.O = _setLiteral5;
            break;

        case C_F3:
        case C_F6:
            // line 3534
            _F.O = _setLiteral6;
            break;

        case C_F4:
            // line 3535
            _F.O = _setLiteral7;
            break;

        case C_F5:
            // line 3536
            _F.O = _setLiteral8;
            break;
        }
    }

    // line 3538
    if(_F.B.RDRK)
    {
        // line 3539
        {
            _T_GenericSet _setLiteral9;
            _setLiteral9.set(XTSR[_F.A]);

            _F.C = _setLiteral9;
        }
    }

    { /* NOP */ }

    { /* NOP */ }
}

// line 3544
//================================================================================
// scope: MINENG_MINGEN (level : 3)

// activation record
struct Frame_MINENG_MINGEN
{
   Frame_MINENG* _slink;

    // parameters
    T_RM A;
    T_integer B;
    T_integer C;

    // locals
    T_SF INLF;
    T_SR INLR;
    T_SF INRF;
    T_SR INRR;
    T_TG INTG;
    T_integer INTI;
    T_TW INTW;
};

// function body
void P_MINENG_MINGEN(void* _slink, T_RM A, T_integer B, T_integer C)
{
    // prologue/frame definition
    Frame_MINENG_MINGEN _F = { (Frame_MINENG*)_slink, A, B, C };

    // subroutine body
    // line 3565
    _FOR_TO(_F.INTI, _F.B, _F.C)
    {
        // line 3568
        if(_F.A.RMPR)
        {
            // line 3569
            _F.INTG = _F.A.RMPP;
        }
        else
        {
            // line 3571
            _F.INTG = C_PB;
        }

        // line 3572
        P_MINENG_SETSQD(_F._slink, _F.A.RMFR, SYNTX[_F.INTI].RYLS, _F.INLR, _F.INLF);

        // line 3573
        P_MINENG_SETSQD(_F._slink, _F.A.RMTO, SYNTX[_F.INTI].RYRS, _F.INRR, _F.INRF);

        // line 3574
        _FOR_TO(_F.INTW, (C_AW + 1), (JNTW - 1))
        {
            // line 3575
            if(F_MINENG_DIFFER(_F._slink, MOVES[_F.INTW], _F.A))
            {
                // line 3576
                if(((MBORD[_F.A.RMFR] == MBORD[MOVES[_F.INTW].RMFR]) && (_F.A.RMCP == MOVES[_F.INTW].RMCP)))
                {
                    // line 3579
                    if((((((_F.INLR & XTSR[MOVES[_F.INTW].RMFR]) && (_F.INRR & XTSR[MOVES[_F.INTW].RMTO])) && (_F.INLF & XTSF[MOVES[_F.INTW].RMFR])) && (_F.INRF & XTSF[MOVES[_F.INTW].RMTO])) && ((MOVES[_F.INTW].RMPR && (_F.INTG == MOVES[_F.INTW].RMPP)) || (!MOVES[_F.INTW].RMPR))))
                    {
                        // line 3584
                        goto L_21;
                    }
                }
            }
        }
        _FOR_END(_F.INTW)

        // line 3587
        P_MINENG_ADDSQR(_F._slink, _F.A.RMFR, SYNTX[_F.INTI].RYLS);

        // line 3588
        P_MINENG_ADDCHR(_F._slink, SYNTX[_F.INTI].RYCH);

        // line 3589
        P_MINENG_ADDSQR(_F._slink, _F.A.RMTO, SYNTX[_F.INTI].RYRS);

        // line 3590
        goto L_22;

        L_21:
        { /* NOP */ }
    }
    _FOR_END(_F.INTI)

    L_22:
    { /* NOP */ }
}

// line 3635
//================================================================================
// scope: MYMOVE (level : 2)

// activation record
struct Frame_MYMOVE
{
    // locals
    T_RM INRM;
};

// function body
void P_MYMOVE(void* _slink)
{
    // prologue/frame definition
    Frame_MYMOVE _F = { };

    assert(nullptr == _slink);

    // subroutine body
    // line 3641
    P_CREATE(nullptr);

    // line 3642
    _F.INRM = MOVES[F_SEARCH(nullptr)];

    // line 3643
    if(_F.INRM.RMIL)
    {
        // line 3645
        GOING = 0;

        // line 3646
        if(LSTMV.RMCH)
        {
            // line 3647
            Output << " CONGRATULATIONS." << _WRITELN;
        }
        else
        {
            // line 3649
            Output << " DRAWN. " << _WRITELN;
        }

        { /* NOP */ }
    }
    else
    {
        // line 3653
        P_MINENG(nullptr, _F.INRM, T_RA::C("  MY MOVE "));

        // line 3654
        Output << MOVMS << _WRITELN;

        // line 3655
        P_THEMOV(nullptr, _F.INRM);

        // line 3656
        if(SWSU)
        {
            // line 3657
            Output << BOARD.RBTI << '.' << NODES << " NODES," << BSTVL[C_AK] << _WRITELN;
        }

        { /* NOP */ }
    }

    { /* NOP */ }
}

// line 3662
//================================================================================
// scope: YRMOVE (level : 2)

// types
typedef _T_Pfn<void (*)(void*)> T_YRMOVE_subroutine_48;

// forward declarations
void P_YRMOVE_YRMHIT(void* _slink);
void P_YRMOVE_YRMCOM(void* _slink);
void P_YRMOVE_YRMCAP(void* _slink);
void P_YRMOVE_YRMCAS(void* _slink);
void P_YRMOVE_YRMCPC(void* _slink);
void P_YRMOVE_YRMCQS(void* _slink);
void P_YRMOVE_YRMLKQ(void* _slink);
void P_YRMOVE_YRMLRB(void* _slink);
void P_YRMOVE_YRMLRK(void* _slink);
void P_YRMOVE_YRMNUL(void* _slink);
void P_YRMOVE_YRMPCM(void* _slink);
void P_YRMOVE_YRMPRO(void* _slink);
void P_YRMOVE_YRMRKQ(void* _slink);
void P_YRMOVE_YRMRRB(void* _slink);
void P_YRMOVE_YRMRRK(void* _slink);
T_boolean F_YRMOVE_NCHIN(void* _slink, T_SC A, T_YRMOVE_subroutine_48 YRMXXX);

// non-local goto targets
const int NL_YRMOVE_17 = 11;
const int NL_YRMOVE_19 = 12;

// activation record
struct Frame_YRMOVE
{
    // locals
    T_boolean IFCA;
    T_boolean IFLD;
    T_boolean IFLF;
    T_boolean IFMV;
    T_boolean IFOO;
    T_boolean IFPR;
    T_boolean IFQS;
    T_boolean IFRD;
    T_boolean IFRF;
    T_TP INCP;
    T_SF INLF;
    T_SR INLR;
    T_SF INRF;
    T_RM INRM;
    T_SR INRR;
    T_boolean INTB;
    T_char INTC;
    T_TG INTG;
    T_TP INTP;
    T_TJ INTW;
    T_boolean Jumpin;
};

// function body
void P_YRMOVE(void* _slink)
{
    // prologue/frame definition
    Frame_YRMOVE _F = { };

    assert(nullptr == _slink);

    // hoisted definitions
    _T_GenericSet _setLiteral1;
    _setLiteral1.set(C_F1, C_F8);

    _T_GenericSet _setLiteral2;
    _setLiteral2.set(C_F1, C_F8);

    _T_GenericSet _setLiteral3;
    _setLiteral3.set(C_R1, C_R8);

    _T_GenericSet _setLiteral4;
    _setLiteral4.set(C_R1, C_R8);

    _T_GenericSet _setLiteral5;
    _setLiteral5.set('P');
    _setLiteral5.set('R');
    _setLiteral5.set('N');
    _setLiteral5.set('B');
    _setLiteral5.set('Q');
    _setLiteral5.set('K');

    _T_GenericSet _setLiteral6;
    _setLiteral6.set('/');

    _T_GenericSet _setLiteral7;
    _setLiteral7.set('K');
    _setLiteral7.set('Q');

    _T_GenericSet _setLiteral8;
    _setLiteral8.set('R');
    _setLiteral8.set('N');
    _setLiteral8.set('B');

    _T_GenericSet _setLiteral9;
    _setLiteral9.set('1', '8');

    _T_GenericSet _setLiteral10;
    _setLiteral10.set('-');

    _T_GenericSet _setLiteral11;
    _setLiteral11.set('+');
    _setLiteral11.set('X');

    _T_GenericSet _setLiteral12;
    _setLiteral12.set('P');
    _setLiteral12.set('R');
    _setLiteral12.set('N');
    _setLiteral12.set('B');
    _setLiteral12.set('Q');

    _T_GenericSet _setLiteral13;
    _setLiteral13.set('/');

    _T_GenericSet _setLiteral14;
    _setLiteral14.set('K');
    _setLiteral14.set('Q');

    _T_GenericSet _setLiteral15;
    _setLiteral15.set('R');
    _setLiteral15.set('N');
    _setLiteral15.set('B');

    _T_GenericSet _setLiteral16;
    _setLiteral16.set('1', '8');

    _T_GenericSet _setLiteral17;
    _setLiteral17.set('=');

    _T_GenericSet _setLiteral18;
    _setLiteral18.set('R');
    _setLiteral18.set('N');
    _setLiteral18.set('B');
    _setLiteral18.set('Q');

    _T_GenericSet _setLiteral19;
    _setLiteral19.set('O');
    _setLiteral19.set('0');

    _T_GenericSet _setLiteral20;
    _setLiteral20.set('-');

    _T_GenericSet _setLiteral21;
    _setLiteral21.set('O');
    _setLiteral21.set('0');

    _T_GenericSet _setLiteral22;
    _setLiteral22.set('-');

    _T_GenericSet _setLiteral23;
    _setLiteral23.set('O');
    _setLiteral23.set('0');

    _T_GenericSet _setLiteral24;
    _setLiteral24.set(C_F4);
    _setLiteral24.set(C_F5);

    _T_GenericSet _setLiteral25;
    _setLiteral25.set(C_F4);
    _setLiteral25.set(C_F5);

    int _nonlocalTarget = 0;

    _nonlocalGoto:
    try
    {
        switch(_nonlocalTarget)
        {
        case 0: break;
        case NL_YRMOVE_17: goto L_17;
        case NL_YRMOVE_19: goto L_19;
        default: _RTError("unexpected non-local target");
        }

        // subroutine body
        // line 3940
        _F.Jumpin = C_false;

        // line 3941
        _F.INTB = C_false;

        // line 3943
        L_19:
        while(((!_F.INTB) || _F.Jumpin))
        {
            // line 3946
            if(_F.Jumpin)
            {
                // line 3946
                goto L_15;
            }

            // line 3948
            P_READER(nullptr);

            // line 3949
            P_LSTMOV(nullptr);

            // line 3951
            _F.IFCA = C_false;

            // line 3952
            _F.IFPR = C_false;

            // line 3953
            _F.IFOO = C_false;

            // line 3954
            _F.IFQS = C_false;

            // line 3955
            _F.IFLD = C_false;

            // line 3956
            _F.IFLF = C_false;

            // line 3957
            _F.IFRD = C_false;

            // line 3958
            _F.IFRF = C_false;

            // line 3959
            _F.INTP = C_MT;

            // line 3960
            _F.INCP = C_MT;

            // line 3961
            _F.INLF = _setLiteral1;

            // line 3962
            _F.INRF = _setLiteral2;

            // line 3963
            _F.INLR = _setLiteral3;

            // line 3964
            _F.INRR = _setLiteral4;

            // line 3965
            _F.INTC = ILINE[JNTJ];

            // line 3967
            if(F_YRMOVE_NCHIN(&_F, T_SC::C(_setLiteral5), _makePfn(P_YRMOVE_YRMPCM, &_F)))
            {
                // line 3967
                goto L_14;
            }

            // line 3968
            if(F_YRMOVE_NCHIN(&_F, T_SC::C(_setLiteral6), _makePfn(P_YRMOVE_YRMNUL, &_F)))
            {
                // line 3968
                goto L_11;
            }

            // line 3969
            if(F_YRMOVE_NCHIN(&_F, T_SC::C(_setLiteral7), _makePfn(P_YRMOVE_YRMLKQ, &_F)))
            {
                { /* NOP */ }
            }

            // line 3970
            if(F_YRMOVE_NCHIN(&_F, T_SC::C(_setLiteral8), _makePfn(P_YRMOVE_YRMLRB, &_F)))
            {
                { /* NOP */ }
            }

            // line 3971
            if(F_YRMOVE_NCHIN(&_F, T_SC::C(_setLiteral9), _makePfn(P_YRMOVE_YRMLRK, &_F)))
            {
                { /* NOP */ }
            }

            // line 3973
            L_11:
            if((!F_YRMOVE_NCHIN(&_F, T_SC::C(_setLiteral10), _makePfn(P_YRMOVE_YRMNUL, &_F))))
            {
                // line 3973
                goto L_12;
            }

            // line 3974
            if(F_YRMOVE_NCHIN(&_F, T_SC::C(_setLiteral11), _makePfn(P_YRMOVE_YRMCAP, &_F)))
            {
                // line 3974
                goto L_16;
            }

            // line 3975
            if(F_YRMOVE_NCHIN(&_F, T_SC::C(_setLiteral12), _makePfn(P_YRMOVE_YRMCPC, &_F)))
            {
                // line 3975
                goto L_16;
            }

            // line 3976
            if(F_YRMOVE_NCHIN(&_F, T_SC::C(_setLiteral13), _makePfn(P_YRMOVE_YRMNUL, &_F)))
            {
                // line 3976
                goto L_13;
            }

            // line 3978
            L_12:
            if(F_YRMOVE_NCHIN(&_F, T_SC::C(_setLiteral14), _makePfn(P_YRMOVE_YRMRKQ, &_F)))
            {
                { /* NOP */ }
            }

            // line 3979
            if(F_YRMOVE_NCHIN(&_F, T_SC::C(_setLiteral15), _makePfn(P_YRMOVE_YRMRRB, &_F)))
            {
                { /* NOP */ }
            }

            // line 3980
            if(F_YRMOVE_NCHIN(&_F, T_SC::C(_setLiteral16), _makePfn(P_YRMOVE_YRMRRK, &_F)))
            {
                { /* NOP */ }
            }

            // line 3982
            L_13:
            if(F_YRMOVE_NCHIN(&_F, T_SC::C(_setLiteral17), _makePfn(P_YRMOVE_YRMNUL, &_F)))
            {
                // line 3982
                goto L_15;
            }

            // line 3983
            if(F_YRMOVE_NCHIN(&_F, T_SC::C(_setLiteral18), _makePfn(P_YRMOVE_YRMPRO, &_F)))
            {
                // line 3983
                goto L_16;
            }

            // line 3984
            goto L_15;

            // line 3987
            L_14:
            if(F_YRMOVE_NCHIN(&_F, T_SC::C(_setLiteral19), _makePfn(P_YRMOVE_YRMNUL, &_F)))
            {
                // line 3987
                goto L_16;
            }

            // line 3988
            if(F_YRMOVE_NCHIN(&_F, T_SC::C(_setLiteral20), _makePfn(P_YRMOVE_YRMNUL, &_F)))
            {
                // line 3988
                goto L_16;
            }

            // line 3989
            if(F_YRMOVE_NCHIN(&_F, T_SC::C(_setLiteral21), _makePfn(P_YRMOVE_YRMCAS, &_F)))
            {
                // line 3989
                goto L_16;
            }

            // line 3990
            if(F_YRMOVE_NCHIN(&_F, T_SC::C(_setLiteral22), _makePfn(P_YRMOVE_YRMCQS, &_F)))
            {
                // line 3990
                goto L_15;
            }

            // line 3991
            if(F_YRMOVE_NCHIN(&_F, T_SC::C(_setLiteral23), _makePfn(P_YRMOVE_YRMNUL, &_F)))
            {
                // line 3991
                goto L_16;
            }

            // line 3993
            L_15:
            _F.Jumpin = C_false;

            // line 3995
            if((_F.IFRF && (!_F.IFRD)))
            {
                // line 3996
                _F.INRF = (_F.INRF * _setLiteral24);
            }

            // line 3997
            if((_F.IFLF && (!_F.IFLD)))
            {
                // line 3998
                _F.INLF = (_F.INLF * _setLiteral25);
            }

            // line 3999
            _F.IFMV = C_false;

            // line 4000
            _F.INTW = C_AW;

            // line 4001
            while((_F.INTW < JNTW))
            {
                // line 4004
                if((MOVES[_F.INTW].RMPR == _F.IFPR))
                {
                    // line 4005
                    if(MOVES[_F.INTW].RMPR)
                    {
                        // line 4006
                        if((MOVES[_F.INTW].RMPP == _F.INTG))
                        {
                            // line 4007
                            P_YRMOVE_YRMCOM(&_F);
                        }
                        else
                        {
                            { /* NOP */ }
                        }
                    }
                    else
                    {
                        // line 4010
                        if((MOVES[_F.INTW].RMOO == _F.IFOO))
                        {
                            // line 4011
                            if(MOVES[_F.INTW].RMOO)
                            {
                                // line 4012
                                if((MOVES[_F.INTW].RMQS == _F.IFQS))
                                {
                                    // line 4013
                                    P_YRMOVE_YRMHIT(&_F);
                                }
                                else
                                {
                                    { /* NOP */ }
                                }
                            }
                            else
                            {
                                // line 4016
                                P_YRMOVE_YRMCOM(&_F);
                            }
                        }
                    }
                }

                // line 4017
                _F.INTW = (_F.INTW + 1);

                { /* NOP */ }
            }

            // line 4019
            if(_F.IFMV)
            {
                // line 4021
                P_MINENG(nullptr, _F.INRM, T_RA::C("YOUR MOVE "));

                // line 4022
                Output << MOVMS << _WRITELN;

                // line 4023
                P_THEMOV(nullptr, _F.INRM);

                // line 4024
                _F.INTB = C_true;

                { /* NOP */ }
            }
            else
            {
                // line 4027
                Output << "   ILLEGAL MOVE." << _WRITELN;
            }

            // line 4028
            goto L_18;

            // line 4030
            L_16:
            Output << " SYNTAX ERROR." << _WRITELN;

            // line 4031
            goto L_18;

            L_18:
            { /* NOP */ }
        }

        L_17:
        { /* NOP */ }
    }
    catch(int _target)
    {
        switch(_target)
        {
        case NL_YRMOVE_17:
        case NL_YRMOVE_19:
            _nonlocalTarget = _target;
            goto _nonlocalGoto;
        default: throw;
        }
    }
}

// line 3696
//================================================================================
// scope: YRMOVE_YRMHIT (level : 3)

// activation record
struct Frame_YRMOVE_YRMHIT
{
   Frame_YRMOVE* _slink;
};

// function body
void P_YRMOVE_YRMHIT(void* _slink)
{
    // prologue/frame definition
    Frame_YRMOVE_YRMHIT _F = { (Frame_YRMOVE*)_slink };

    // subroutine body
    // line 3703
    if(_F._slink->IFMV)
    {
        // line 3705
        Output << "   AMBIGUOUS MOVE." << _WRITELN;

        // line 3706
        throw NL_YRMOVE_17;

        { /* NOP */ }
    }

    // line 3709
    _F._slink->IFMV = C_true;

    // line 3710
    _F._slink->INRM = MOVES[_F._slink->INTW];

    { /* NOP */ }
}

// line 3714
//================================================================================
// scope: YRMOVE_YRMCOM (level : 3)

// activation record
struct Frame_YRMOVE_YRMCOM
{
   Frame_YRMOVE* _slink;
};

// function body
void P_YRMOVE_YRMCOM(void* _slink)
{
    // prologue/frame definition
    Frame_YRMOVE_YRMCOM _F = { (Frame_YRMOVE*)_slink };

    // subroutine body
    // line 3723
    if(((((((_F._slink->INLR & XTSR[MOVES[_F._slink->INTW].RMFR]) && (_F._slink->INLF & XTSF[MOVES[_F._slink->INTW].RMFR])) && (_F._slink->INRR & XTSR[MOVES[_F._slink->INTW].RMTO])) && (_F._slink->INRF & XTSF[MOVES[_F._slink->INTW].RMTO])) && (!MOVES[_F._slink->INTW].RMIL)) && (BOARD.RBIS[MOVES[_F._slink->INTW].RMFR] == _F._slink->INTP)))
    {
        // line 3728
        if((MOVES[_F._slink->INTW].RMCA == _F._slink->IFCA))
        {
            // line 3729
            if(MOVES[_F._slink->INTW].RMCA)
            {
                // line 3730
                if((MOVES[_F._slink->INTW].RMCP == _F._slink->INCP))
                {
                    // line 3731
                    P_YRMOVE_YRMHIT(_F._slink);
                }
                else
                {
                    { /* NOP */ }
                }
            }
            else
            {
                // line 3734
                P_YRMOVE_YRMHIT(_F._slink);
            }
        }
    }

    { /* NOP */ }
}

// line 3738
//================================================================================
// scope: YRMOVE_YRMCAP (level : 3)

// activation record
struct Frame_YRMOVE_YRMCAP
{
   Frame_YRMOVE* _slink;
};

// function body
void P_YRMOVE_YRMCAP(void* _slink)
{
    // prologue/frame definition
    Frame_YRMOVE_YRMCAP _F = { (Frame_YRMOVE*)_slink };

    // subroutine body
    // line 3741
    _F._slink->IFCA = C_true;

    { /* NOP */ }
}

// line 3745
//================================================================================
// scope: YRMOVE_YRMCAS (level : 3)

// activation record
struct Frame_YRMOVE_YRMCAS
{
   Frame_YRMOVE* _slink;
};

// function body
void P_YRMOVE_YRMCAS(void* _slink)
{
    // prologue/frame definition
    Frame_YRMOVE_YRMCAS _F = { (Frame_YRMOVE*)_slink };

    // subroutine body
    // line 3748
    _F._slink->IFOO = C_true;

    { /* NOP */ }
}

// line 3752
//================================================================================
// scope: YRMOVE_YRMCPC (level : 3)

// activation record
struct Frame_YRMOVE_YRMCPC
{
   Frame_YRMOVE* _slink;
};

// function body
void P_YRMOVE_YRMCPC(void* _slink)
{
    // prologue/frame definition
    Frame_YRMOVE_YRMCPC _F = { (Frame_YRMOVE*)_slink };

    // subroutine body
    // line 3755
    switch(_F._slink->INTC)
    {
    case 'P':
        // line 3756
        _F._slink->INCP = XTUMP[C_EP][OTHER[JNTM]];
        break;

    case 'R':
        // line 3757
        _F._slink->INCP = XTUMP[C_ER][OTHER[JNTM]];
        break;

    case 'N':
        // line 3758
        _F._slink->INCP = XTUMP[C_EN][OTHER[JNTM]];
        break;

    case 'B':
        // line 3759
        _F._slink->INCP = XTUMP[C_EB][OTHER[JNTM]];
        break;

    case 'Q':
        // line 3760
        _F._slink->INCP = XTUMP[C_EQ][OTHER[JNTM]];
        break;
    }

    { /* NOP */ }
}

// line 3765
//================================================================================
// scope: YRMOVE_YRMCQS (level : 3)

// activation record
struct Frame_YRMOVE_YRMCQS
{
   Frame_YRMOVE* _slink;
};

// function body
void P_YRMOVE_YRMCQS(void* _slink)
{
    // prologue/frame definition
    Frame_YRMOVE_YRMCQS _F = { (Frame_YRMOVE*)_slink };

    // subroutine body
    // line 3768
    _F._slink->IFQS = C_true;

    { /* NOP */ }
}

// line 3772
//================================================================================
// scope: YRMOVE_YRMLKQ (level : 3)

// activation record
struct Frame_YRMOVE_YRMLKQ
{
   Frame_YRMOVE* _slink;
};

// function body
void P_YRMOVE_YRMLKQ(void* _slink)
{
    // prologue/frame definition
    Frame_YRMOVE_YRMLKQ _F = { (Frame_YRMOVE*)_slink };

    // hoisted definitions
    _T_GenericSet _setLiteral1;
    _setLiteral1.set(C_F5, C_F8);

    _T_GenericSet _setLiteral2;
    _setLiteral2.set(C_F1, C_F4);

    // subroutine body
    // line 3775
    switch(_F._slink->INTC)
    {
    case 'K':
        // line 3776
        _F._slink->INLF = (_setLiteral1 * _F._slink->INLF);
        break;

    case 'Q':
        // line 3777
        _F._slink->INLF = (_setLiteral2 * _F._slink->INLF);
        break;
    }

    // line 3779
    _F._slink->IFLF = C_true;

    { /* NOP */ }
}

// line 3783
//================================================================================
// scope: YRMOVE_YRMLRB (level : 3)

// activation record
struct Frame_YRMOVE_YRMLRB
{
   Frame_YRMOVE* _slink;
};

// function body
void P_YRMOVE_YRMLRB(void* _slink)
{
    // prologue/frame definition
    Frame_YRMOVE_YRMLRB _F = { (Frame_YRMOVE*)_slink };

    // hoisted definitions
    _T_GenericSet _setLiteral1;
    _setLiteral1.set(C_F1);
    _setLiteral1.set(C_F8);

    _T_GenericSet _setLiteral2;
    _setLiteral2.set(C_F2);
    _setLiteral2.set(C_F7);

    _T_GenericSet _setLiteral3;
    _setLiteral3.set(C_F3);
    _setLiteral3.set(C_F6);

    // subroutine body
    // line 3786
    switch(_F._slink->INTC)
    {
    case 'R':
        // line 3787
        _F._slink->INLF = (_setLiteral1 * _F._slink->INLF);
        break;

    case 'N':
        // line 3788
        _F._slink->INLF = (_setLiteral2 * _F._slink->INLF);
        break;

    case 'B':
        // line 3789
        _F._slink->INLF = (_setLiteral3 * _F._slink->INLF);
        break;
    }

    // line 3791
    _F._slink->IFLD = C_true;

    { /* NOP */ }
}

// line 3795
//================================================================================
// scope: YRMOVE_YRMLRK (level : 3)

// activation record
struct Frame_YRMOVE_YRMLRK
{
   Frame_YRMOVE* _slink;
};

// function body
void P_YRMOVE_YRMLRK(void* _slink)
{
    // prologue/frame definition
    Frame_YRMOVE_YRMLRK _F = { (Frame_YRMOVE*)_slink };

    // hoisted definitions
    _T_GenericSet _setLiteral1;
    _setLiteral1.set(C_R1);

    _T_GenericSet _setLiteral2;
    _setLiteral2.set(C_R2);

    _T_GenericSet _setLiteral3;
    _setLiteral3.set(C_R3);

    _T_GenericSet _setLiteral4;
    _setLiteral4.set(C_R4);

    _T_GenericSet _setLiteral5;
    _setLiteral5.set(C_R5);

    _T_GenericSet _setLiteral6;
    _setLiteral6.set(C_R6);

    _T_GenericSet _setLiteral7;
    _setLiteral7.set(C_R7);

    _T_GenericSet _setLiteral8;
    _setLiteral8.set(C_R8);

    _T_GenericSet _setLiteral9;
    _setLiteral9.set(C_R8);

    _T_GenericSet _setLiteral10;
    _setLiteral10.set(C_R7);

    _T_GenericSet _setLiteral11;
    _setLiteral11.set(C_R6);

    _T_GenericSet _setLiteral12;
    _setLiteral12.set(C_R5);

    _T_GenericSet _setLiteral13;
    _setLiteral13.set(C_R4);

    _T_GenericSet _setLiteral14;
    _setLiteral14.set(C_R3);

    _T_GenericSet _setLiteral15;
    _setLiteral15.set(C_R2);

    _T_GenericSet _setLiteral16;
    _setLiteral16.set(C_R1);

    // subroutine body
    // line 3798
    if((JNTM == C_LITE))
    {
        // line 3799
        switch(_F._slink->INTC)
        {
        case '1':
            // line 3800
            _F._slink->INLR = _setLiteral1;
            break;

        case '2':
            // line 3801
            _F._slink->INLR = _setLiteral2;
            break;

        case '3':
            // line 3802
            _F._slink->INLR = _setLiteral3;
            break;

        case '4':
            // line 3803
            _F._slink->INLR = _setLiteral4;
            break;

        case '5':
            // line 3804
            _F._slink->INLR = _setLiteral5;
            break;

        case '6':
            // line 3805
            _F._slink->INLR = _setLiteral6;
            break;

        case '7':
            // line 3806
            _F._slink->INLR = _setLiteral7;
            break;

        case '8':
            // line 3807
            _F._slink->INLR = _setLiteral8;
            break;
        }
    }
    else
    {
        // line 3810
        switch(_F._slink->INTC)
        {
        case '1':
            // line 3811
            _F._slink->INLR = _setLiteral9;
            break;

        case '2':
            // line 3812
            _F._slink->INLR = _setLiteral10;
            break;

        case '3':
            // line 3813
            _F._slink->INLR = _setLiteral11;
            break;

        case '4':
            // line 3814
            _F._slink->INLR = _setLiteral12;
            break;

        case '5':
            // line 3815
            _F._slink->INLR = _setLiteral13;
            break;

        case '6':
            // line 3816
            _F._slink->INLR = _setLiteral14;
            break;

        case '7':
            // line 3817
            _F._slink->INLR = _setLiteral15;
            break;

        case '8':
            // line 3818
            _F._slink->INLR = _setLiteral16;
            break;
        }
    }

    { /* NOP */ }
}

// line 3823
//================================================================================
// scope: YRMOVE_YRMNUL (level : 3)

// activation record
struct Frame_YRMOVE_YRMNUL
{
   Frame_YRMOVE* _slink;
};

// function body
void P_YRMOVE_YRMNUL(void* _slink)
{
    // prologue/frame definition
    Frame_YRMOVE_YRMNUL _F = { (Frame_YRMOVE*)_slink };

    // subroutine body
    { /* NOP */ }
}

// line 3829
//================================================================================
// scope: YRMOVE_YRMPCM (level : 3)

// activation record
struct Frame_YRMOVE_YRMPCM
{
   Frame_YRMOVE* _slink;
};

// function body
void P_YRMOVE_YRMPCM(void* _slink)
{
    // prologue/frame definition
    Frame_YRMOVE_YRMPCM _F = { (Frame_YRMOVE*)_slink };

    // subroutine body
    // line 3832
    switch(_F._slink->INTC)
    {
    case 'P':
        // line 3833
        _F._slink->INTP = XTUMP[C_EP][JNTM];
        break;

    case 'R':
        // line 3834
        _F._slink->INTP = XTUMP[C_ER][JNTM];
        break;

    case 'N':
        // line 3835
        _F._slink->INTP = XTUMP[C_EN][JNTM];
        break;

    case 'B':
        // line 3836
        _F._slink->INTP = XTUMP[C_EB][JNTM];
        break;

    case 'Q':
        // line 3837
        _F._slink->INTP = XTUMP[C_EQ][JNTM];
        break;

    case 'K':
        // line 3838
        _F._slink->INTP = XTUMP[C_EK][JNTM];
        break;
    }

    { /* NOP */ }
}

// line 3842
//================================================================================
// scope: YRMOVE_YRMPRO (level : 3)

// activation record
struct Frame_YRMOVE_YRMPRO
{
   Frame_YRMOVE* _slink;
};

// function body
void P_YRMOVE_YRMPRO(void* _slink)
{
    // prologue/frame definition
    Frame_YRMOVE_YRMPRO _F = { (Frame_YRMOVE*)_slink };

    // subroutine body
    // line 3845
    switch(_F._slink->INTC)
    {
    case 'R':
        // line 3846
        _F._slink->INTG = C_PR;
        break;

    case 'N':
        // line 3847
        _F._slink->INTG = C_PN;
        break;

    case 'B':
        // line 3848
        _F._slink->INTG = C_PB;
        break;

    case 'Q':
        // line 3849
        _F._slink->INTG = C_PQ;
        break;
    }

    // line 3851
    _F._slink->IFPR = C_true;

    { /* NOP */ }
}

// line 3855
//================================================================================
// scope: YRMOVE_YRMRKQ (level : 3)

// activation record
struct Frame_YRMOVE_YRMRKQ
{
   Frame_YRMOVE* _slink;
};

// function body
void P_YRMOVE_YRMRKQ(void* _slink)
{
    // prologue/frame definition
    Frame_YRMOVE_YRMRKQ _F = { (Frame_YRMOVE*)_slink };

    // hoisted definitions
    _T_GenericSet _setLiteral1;
    _setLiteral1.set(C_F5, C_F8);

    _T_GenericSet _setLiteral2;
    _setLiteral2.set(C_F1, C_F4);

    // subroutine body
    // line 3858
    switch(_F._slink->INTC)
    {
    case 'K':
        // line 3859
        _F._slink->INRF = (_setLiteral1 * _F._slink->INRF);
        break;

    case 'Q':
        // line 3860
        _F._slink->INRF = (_setLiteral2 * _F._slink->INRF);
        break;
    }

    // line 3862
    _F._slink->IFRF = C_true;

    { /* NOP */ }
}

// line 3866
//================================================================================
// scope: YRMOVE_YRMRRB (level : 3)

// activation record
struct Frame_YRMOVE_YRMRRB
{
   Frame_YRMOVE* _slink;
};

// function body
void P_YRMOVE_YRMRRB(void* _slink)
{
    // prologue/frame definition
    Frame_YRMOVE_YRMRRB _F = { (Frame_YRMOVE*)_slink };

    // hoisted definitions
    _T_GenericSet _setLiteral1;
    _setLiteral1.set(C_F1);
    _setLiteral1.set(C_F8);

    _T_GenericSet _setLiteral2;
    _setLiteral2.set(C_F2);
    _setLiteral2.set(C_F7);

    _T_GenericSet _setLiteral3;
    _setLiteral3.set(C_F3);
    _setLiteral3.set(C_F6);

    // subroutine body
    // line 3869
    switch(_F._slink->INTC)
    {
    case 'R':
        // line 3870
        _F._slink->INRF = (_setLiteral1 * _F._slink->INRF);
        break;

    case 'N':
        // line 3871
        _F._slink->INRF = (_setLiteral2 * _F._slink->INRF);
        break;

    case 'B':
        // line 3872
        _F._slink->INRF = (_setLiteral3 * _F._slink->INRF);
        break;
    }

    // line 3874
    _F._slink->IFRD = C_true;

    { /* NOP */ }
}

// line 3878
//================================================================================
// scope: YRMOVE_YRMRRK (level : 3)

// activation record
struct Frame_YRMOVE_YRMRRK
{
   Frame_YRMOVE* _slink;
};

// function body
void P_YRMOVE_YRMRRK(void* _slink)
{
    // prologue/frame definition
    Frame_YRMOVE_YRMRRK _F = { (Frame_YRMOVE*)_slink };

    // hoisted definitions
    _T_GenericSet _setLiteral1;
    _setLiteral1.set(C_R1);

    _T_GenericSet _setLiteral2;
    _setLiteral2.set(C_R2);

    _T_GenericSet _setLiteral3;
    _setLiteral3.set(C_R3);

    _T_GenericSet _setLiteral4;
    _setLiteral4.set(C_R4);

    _T_GenericSet _setLiteral5;
    _setLiteral5.set(C_R5);

    _T_GenericSet _setLiteral6;
    _setLiteral6.set(C_R6);

    _T_GenericSet _setLiteral7;
    _setLiteral7.set(C_R7);

    _T_GenericSet _setLiteral8;
    _setLiteral8.set(C_R8);

    _T_GenericSet _setLiteral9;
    _setLiteral9.set(C_R8);

    _T_GenericSet _setLiteral10;
    _setLiteral10.set(C_R7);

    _T_GenericSet _setLiteral11;
    _setLiteral11.set(C_R6);

    _T_GenericSet _setLiteral12;
    _setLiteral12.set(C_R5);

    _T_GenericSet _setLiteral13;
    _setLiteral13.set(C_R4);

    _T_GenericSet _setLiteral14;
    _setLiteral14.set(C_R3);

    _T_GenericSet _setLiteral15;
    _setLiteral15.set(C_R2);

    _T_GenericSet _setLiteral16;
    _setLiteral16.set(C_R1);

    // subroutine body
    // line 3881
    if((JNTM == C_LITE))
    {
        // line 3882
        switch(_F._slink->INTC)
        {
        case '1':
            // line 3883
            _F._slink->INRR = _setLiteral1;
            break;

        case '2':
            // line 3884
            _F._slink->INRR = _setLiteral2;
            break;

        case '3':
            // line 3885
            _F._slink->INRR = _setLiteral3;
            break;

        case '4':
            // line 3886
            _F._slink->INRR = _setLiteral4;
            break;

        case '5':
            // line 3887
            _F._slink->INRR = _setLiteral5;
            break;

        case '6':
            // line 3888
            _F._slink->INRR = _setLiteral6;
            break;

        case '7':
            // line 3889
            _F._slink->INRR = _setLiteral7;
            break;

        case '8':
            // line 3890
            _F._slink->INRR = _setLiteral8;
            break;
        }
    }
    else
    {
        // line 3893
        switch(_F._slink->INTC)
        {
        case '1':
            // line 3894
            _F._slink->INRR = _setLiteral9;
            break;

        case '2':
            // line 3895
            _F._slink->INRR = _setLiteral10;
            break;

        case '3':
            // line 3896
            _F._slink->INRR = _setLiteral11;
            break;

        case '4':
            // line 3897
            _F._slink->INRR = _setLiteral12;
            break;

        case '5':
            // line 3898
            _F._slink->INRR = _setLiteral13;
            break;

        case '6':
            // line 3899
            _F._slink->INRR = _setLiteral14;
            break;

        case '7':
            // line 3900
            _F._slink->INRR = _setLiteral15;
            break;

        case '8':
            // line 3901
            _F._slink->INRR = _setLiteral16;
            break;
        }
    }

    { /* NOP */ }
}

// line 3906
//================================================================================
// scope: YRMOVE_NCHIN (level : 3)

// activation record
struct Frame_YRMOVE_NCHIN
{
   Frame_YRMOVE* _slink;

    // parameters
    T_SC A;
    T_YRMOVE_subroutine_48 YRMXXX;

    // locals
    T_boolean _fnvalue;
    T_boolean INTB;
};

// function body
T_boolean F_YRMOVE_NCHIN(void* _slink, T_SC A, T_YRMOVE_subroutine_48 YRMXXX)
{
    // prologue/frame definition
    Frame_YRMOVE_NCHIN _F = { (Frame_YRMOVE*)_slink, A, YRMXXX };

    // subroutine body
    // line 3918
    _F.INTB = (!(_F.A & _F._slink->INTC));

    // line 3919
    if((!_F.INTB))
    {
        // line 3921
        (*_F.YRMXXX._pfn)(_F.YRMXXX._slink);

        // line 3922
        JNTJ = (JNTJ + 1);

        // line 3923
        while(((JNTJ < C_ZJ) && ((ILINE[JNTJ] == ' ') || (_ord(ILINE[JNTJ]) > _ord(C_ZC)))))
        {
            // line 3925
            JNTJ = (JNTJ + 1);
        }

        // line 3926
        _F._slink->INTC = ILINE[JNTJ];

        // line 3927
        if(((_F._slink->INTC == '.') || (_F._slink->INTC == ';')))
        {
            // line 3929
            _F._slink->Jumpin = C_true;

            // line 3930
            throw NL_YRMOVE_19;

            { /* NOP */ }
        }
    }

    // line 3934
    _F._fnvalue = _F.INTB;

    { /* NOP */ }

    // epilogue
    return _F._fnvalue;
}


text:
require ../../../recipes-image/image/base-image.bb

DESCRIPTION = "A fully functional image to run EDISON"
LICENSE = "MIT"

# Ref OS IOT image features
REF_OS_IMAGE_PKG_FEATURES += " \
     arduino-support \
     nodejs-runtime \
     pam \
     omp \
     alsa \
     pulseaudio \
     pulseaudio-bluetooth \
     ofono \
     multimedia \
     mosquitto \
     wpa-supplicant \
     intel-xdk \
     intel-xdk-support \
     sensors \
     mraa-dev-support \
     tools-debug \
     tools-develop \
     tools-networking \
     tools-archive \
     misc-tools \
     paho-mqtt \
     ext2-tools \
     tls-support \
     python-extra \
"

IMAGE_FEATURES += " \
    ${REF_OS_IMAGE_PKG_FEATURES} \
"

IMAGE_INSTALL_append = "\
    ${MACHINE_EXTRA_RRECOMMENDS} \
    python3-modules \
    python-modules \
    python-mraa \
    python-upm \
"

inherit refosiot-image

license: MIT

repository: intel/ref-os-iot

license_type: permissive

repo_name: intel/ref-os-iot

branch_name: refs/heads/master

extension: bb


text:
package main

func sortList(head *ListNode) *ListNode {
	if head == nil || head.Next == nil {
		return head
	}

	// divide into two part
	//var fast, slow *ListNode
	slow := head
	for fast := head.Next; fast != nil && fast.Next != nil; fast, slow = fast.Next.Next, slow.Next {
	}
	right := sortList(slow.Next)
	slow.Next = nil
	left := sortList(head)

	// merge sorted list
	if left.Val > right.Val {
		head = right
		right = right.Next
	} else {
		head = left
		left = left.Next
	}
	tail := head
	for left != nil && right != nil {
		if left.Val > right.Val {
			tail.Next = right
			right = right.Next
		} else {
			tail.Next = left
			left = left.Next
		}
		tail = tail.Next
	}
	if left != nil {
		tail.Next = left
	} else {
		tail.Next = right
	}
	return head
}

repository: ldsink/LeetCode

repo_name: ldsink/LeetCode

extension: go


text:
# The set of languages for which implicit dependencies are needed:
set(CMAKE_DEPENDS_LANGUAGES
  "C"
  )
# The set of files for implicit dependencies of each language:
set(CMAKE_DEPENDS_CHECK_C
  "/home/yongliang.li/mess/Chipmunk2D/demo/Bench.c" "/home/yongliang.li/mess/Chipmunk2D/demo/CMakeFiles/chipmunk_demos.dir/Bench.c.o"
  "/home/yongliang.li/mess/Chipmunk2D/demo/Buoyancy.c" "/home/yongliang.li/mess/Chipmunk2D/demo/CMakeFiles/chipmunk_demos.dir/Buoyancy.c.o"
  "/home/yongliang.li/mess/Chipmunk2D/demo/Chains.c" "/home/yongliang.li/mess/Chipmunk2D/demo/CMakeFiles/chipmunk_demos.dir/Chains.c.o"
  "/home/yongliang.li/mess/Chipmunk2D/demo/ChipmunkDebugDraw.c" "/home/yongliang.li/mess/Chipmunk2D/demo/CMakeFiles/chipmunk_demos.dir/ChipmunkDebugDraw.c.o"
  "/home/yongliang.li/mess/Chipmunk2D/demo/ChipmunkDemo.c" "/home/yongliang.li/mess/Chipmunk2D/demo/CMakeFiles/chipmunk_demos.dir/ChipmunkDemo.c.o"
  "/home/yongliang.li/mess/Chipmunk2D/demo/ChipmunkDemoShaderSupport.c" "/home/yongliang.li/mess/Chipmunk2D/demo/CMakeFiles/chipmunk_demos.dir/ChipmunkDemoShaderSupport.c.o"
  "/home/yongliang.li/mess/Chipmunk2D/demo/ChipmunkDemoTextSupport.c" "/home/yongliang.li/mess/Chipmunk2D/demo/CMakeFiles/chipmunk_demos.dir/ChipmunkDemoTextSupport.c.o"
  "/home/yongliang.li/mess/Chipmunk2D/demo/ContactGraph.c" "/home/yongliang.li/mess/Chipmunk2D/demo/CMakeFiles/chipmunk_demos.dir/ContactGraph.c.o"
  "/home/yongliang.li/mess/Chipmunk2D/demo/Convex.c" "/home/yongliang.li/mess/Chipmunk2D/demo/CMakeFiles/chipmunk_demos.dir/Convex.c.o"
  "/home/yongliang.li/mess/Chipmunk2D/demo/Crane.c" "/home/yongliang.li/mess/Chipmunk2D/demo/CMakeFiles/chipmunk_demos.dir/Crane.c.o"
  "/home/yongliang.li/mess/Chipmunk2D/demo/Joints.c" "/home/yongliang.li/mess/Chipmunk2D/demo/CMakeFiles/chipmunk_demos.dir/Joints.c.o"
  "/home/yongliang.li/mess/Chipmunk2D/demo/LogoSmash.c" "/home/yongliang.li/mess/Chipmunk2D/demo/CMakeFiles/chipmunk_demos.dir/LogoSmash.c.o"
  "/home/yongliang.li/mess/Chipmunk2D/demo/OneWay.c" "/home/yongliang.li/mess/Chipmunk2D/demo/CMakeFiles/chipmunk_demos.dir/OneWay.c.o"
  "/home/yongliang.li/mess/Chipmunk2D/demo/Planet.c" "/home/yongliang.li/mess/Chipmunk2D/demo/CMakeFiles/chipmunk_demos.dir/Planet.c.o"
  "/home/yongliang.li/mess/Chipmunk2D/demo/Player.c" "/home/yongliang.li/mess/Chipmunk2D/demo/CMakeFiles/chipmunk_demos.dir/Player.c.o"
  "/home/yongliang.li/mess/Chipmunk2D/demo/Plink.c" "/home/yongliang.li/mess/Chipmunk2D/demo/CMakeFiles/chipmunk_demos.dir/Plink.c.o"
  "/home/yongliang.li/mess/Chipmunk2D/demo/Pump.c" "/home/yongliang.li/mess/Chipmunk2D/demo/CMakeFiles/chipmunk_demos.dir/Pump.c.o"
  "/home/yongliang.li/mess/Chipmunk2D/demo/PyramidStack.c" "/home/yongliang.li/mess/Chipmunk2D/demo/CMakeFiles/chipmunk_demos.dir/PyramidStack.c.o"
  "/home/yongliang.li/mess/Chipmunk2D/demo/PyramidTopple.c" "/home/yongliang.li/mess/Chipmunk2D/demo/CMakeFiles/chipmunk_demos.dir/PyramidTopple.c.o"
  "/home/yongliang.li/mess/Chipmunk2D/demo/Query.c" "/home/yongliang.li/mess/Chipmunk2D/demo/CMakeFiles/chipmunk_demos.dir/Query.c.o"
  "/home/yongliang.li/mess/Chipmunk2D/demo/Shatter.c" "/home/yongliang.li/mess/Chipmunk2D/demo/CMakeFiles/chipmunk_demos.dir/Shatter.c.o"
  "/home/yongliang.li/mess/Chipmunk2D/demo/Slice.c" "/home/yongliang.li/mess/Chipmunk2D/demo/CMakeFiles/chipmunk_demos.dir/Slice.c.o"
  "/home/yongliang.li/mess/Chipmunk2D/demo/Springies.c" "/home/yongliang.li/mess/Chipmunk2D/demo/CMakeFiles/chipmunk_demos.dir/Springies.c.o"
  "/home/yongliang.li/mess/Chipmunk2D/demo/Sticky.c" "/home/yongliang.li/mess/Chipmunk2D/demo/CMakeFiles/chipmunk_demos.dir/Sticky.c.o"
  "/home/yongliang.li/mess/Chipmunk2D/demo/Tank.c" "/home/yongliang.li/mess/Chipmunk2D/demo/CMakeFiles/chipmunk_demos.dir/Tank.c.o"
  "/home/yongliang.li/mess/Chipmunk2D/demo/TheoJansen.c" "/home/yongliang.li/mess/Chipmunk2D/demo/CMakeFiles/chipmunk_demos.dir/TheoJansen.c.o"
  "/home/yongliang.li/mess/Chipmunk2D/demo/Tumble.c" "/home/yongliang.li/mess/Chipmunk2D/demo/CMakeFiles/chipmunk_demos.dir/Tumble.c.o"
  "/home/yongliang.li/mess/Chipmunk2D/demo/Unicycle.c" "/home/yongliang.li/mess/Chipmunk2D/demo/CMakeFiles/chipmunk_demos.dir/Unicycle.c.o"
  )
set(CMAKE_C_COMPILER_ID "GNU")

# The include file search paths:
set(CMAKE_C_TARGET_INCLUDE_PATH
  )

# Targets to which this target links.
set(CMAKE_TARGET_LINKED_INFO_FILES
  )

# Fortran module output directory.
set(CMAKE_Fortran_TARGET_MODULE_DIR "")

repository: sspemail/opensourceUI

repo_name: sspemail/opensourceUI

extension: cmake


text:
#pragma once

#include <base/config.h>
#include <cstdint>

namespace base { namespace warcraft3 { namespace detail {
	_BASE_API uint32_t string_hash(const char* str);
}}}

repository: alanoooaao/YDWE

repo_name: alanoooaao/YDWE

extension: h


text:
SUMMARY = "Highly configurable and low resource X11 Window manager"
DESCRIPTION = "\
	Fairly similar to blackbox, from which it is derived, but has been \
	extended with features such as pwm-style window tabs, configurable \
	key bindings, toolbar, and an iconbar. It also includes some cosmetic\
	fixes over blackbox"
HOMEPAGE = "http://fluxbox.org"

LICENSE = "MIT & CC-BY-SA-3.0"
LIC_FILES_CHKSUM = "\
	file://COPYING;md5=e90c7c0bee6fc368be0ba779e0eac053 \
	file://data/styles/bora_blue/theme.cfg;beginline=1;endline=2;md5=d7b703c84a3be84264906e7f87e3710b \
"

DEPENDS = "virtual/libx11 libxt"
PR = "r0"
inherit autotools-brokensep pkgconfig

inherit debian-package
DEBIAN_SECTION = "x11"
EXTRA_OECONF += "\
	--with-windowmenu=${sysconfdir}/X11/${DPN}/window.menu \
	--with-keys=${sysconfdir}/X11/${DPN}/keys \
	--with-apps=${sysconfdir}/X11/${DPN}/apps \
	--with-overlay=${sysconfdir}/X11/${DPN}/overlay \
	--with-init=${sysconfdir}/X11/${DPN}/init \
"
do_compile_append() {
	oe_runmake -C ${S}/debian/additional-themes
}

#install follow debian jessie
do_install_append() {
	install -d ${D}${datadir}/images/fluxbox
	cp -rv  ${S}/debian/additional-themes/stage/* \
		${D}${datadir}/fluxbox/styles/
	cp -rv  ${S}/debian/additional-themes/stage-images/* \
		${D}${datadir}/images/fluxbox/

	install -m 0644 ${S}/debian/system.fluxbox-menu \
			${D}${sysconfdir}/X11/${DPN}/
	install -m 0644 ${S}/debian/fluxbox.menu-user \
			${D}${sysconfdir}/X11/${DPN}/

	install -D -m 0644 ${S}/debian/fluxbox.menu-method \
			${D}${sysconfdir}/menu-methods/fluxbox
	install -D -m 0644 ${S}/debian/fluxbox.menu \
			${D}${datadir}/menu/fluxbox
	install -D -m 0644 ${S}/debian/fluxbox.desktop \
			${D}${datadir}/xsessions/fluxbox.desktop
	rm ${D}${datadir}/${DPN}/menu ${D}${bindir}/fluxbox-generate_menu
}
FILES_${PN} += "${datadir}/images ${datadir}/menu ${datadir}/xsessions"

repository: nghiaht-tsdv/meta-debian

repo_name: nghiaht-tsdv/meta-debian

branch_name: refs/heads/jethro

gha_language: BitBake


text:
@article{Edwards:2018lsl,
 archiveprefix = {arXiv},
 author = {Edwards, Thomas D.P. and Kavanagh, Bradley J. and Weniger, Christoph},
 doi = {10.1103/PhysRevLett.121.181101},
 eprint = {1805.04117},
 journal = {Phys. Rev. Lett.},
 number = {18},
 pages = {181101},
 primaryclass = {hep-ph},
 title = {Assessing Near-Future Direct Dark Matter Searches with Benchmark-Free Forecasting},
 volume = {121},
 year = {2018}
}

repository: cweniger/personal-website

repo_name: cweniger/personal-website

extension: bib


text:
@Book{xie2015,
  title = {Dynamic Documents with {R} and knitr},
  author = {Yihui Xie},
  publisher = {Chapman and Hall/CRC},
  address = {Boca Raton, Florida},
  year = {2015},
  edition = {2nd},
  note = {ISBN 978-1498716963},
  url = {http://yihui.org/knitr/},
}

@Manual{R-base,
  title = {R: A Language and Environment for Statistical Computing},
  author = {R Core Team},
  organization = {R Foundation for Statistical Computing},
  address = {Vienna, Austria},
  year = {2016},
  url = {https://www.R-project.org/},
}

@inreference{2020w,
  title = {Darcy Friction Factor Formulae},
  booktitle = {Wikipedia},
  date = {2020-04-27T13:54:27Z},
  url = {https://en.wikipedia.org/w/index.php?title=Darcy_friction_factor_formulae&oldid=953495830},
  urldate = {2020-04-28},
  abstract = {In fluid dynamics, the Darcy friction factor formulae are equations that allow the calculation of the Darcy friction factor, a dimensionless quantity used in the Darcy\textendash Weisbach equation, for the description of friction losses in pipe flow as well as open-channel flow.
The Darcy friction factor is also known as the Darcy\textendash Weisbach friction factor, resistance coefficient or simply friction factor; by definition it is four times larger than the Fanning friction factor.},
  langid = {english}
}

@inreference{2020wa,
  title = {Darcy\textendash{{Weisbach}} Equation},
  booktitle = {Wikipedia},
  date = {2020-07-11T22:53:52Z},
  url = {https://en.wikipedia.org/w/index.php?title=Darcy%E2%80%93Weisbach_equation&oldid=967222638},
  urldate = {2020-08-05},
  abstract = {In fluid dynamics, the Darcy\textendash Weisbach equation is an empirical equation, which relates the head loss, or pressure loss, due to friction along a given length of pipe to the average velocity of the fluid flow for an incompressible fluid. The equation is named after Henry Darcy and Julius Weisbach.
The Darcy\textendash Weisbach equation contains a dimensionless friction factor, known as the Darcy friction factor. This is also variously called the Darcy\textendash Weisbach friction factor, friction factor, resistance coefficient, or flow coefficient.},
  langid = {english}
}

@book{wagner2008,
  title = {Regel- und Sicherheitsarmaturen},
  author = {Wagner, Walter},
  date = {2008},
  edition = {1. Aufl. dieser Ausg},
  publisher = {{Vogel}},
  location = {{W\"urzburg}},
  isbn = {978-3-8343-3102-1},
  langid = {german},
  pagetotal = {287},
  series = {Vogel-Fachbuch}
}

@book{tullis1993,
  title = {Cavitation Guide for Control Valves},
  author = {Tullis, J. Paul},
  date = {1993},
  publisher = {{Division of Engineering, Office of Nuclear Regulatory Research, U.S. Nuclear Regulatory Commission (1993)}},
  langid = {english}
}

@book{r.heiler,
  title = {Valves for the {{Water Industry}} and for {{Waste Water Handling}}},
  author = {R. Heiler},
  edition = {VAG},
  publisher = {{VAG-Armaturen GmbH}}
}

@book{baumann2009,
  title = {Control Valve Primer: A User's Guide},
  shorttitle = {Control Valve Primer},
  author = {Baumann, Hans D.},
  date = {2009},
  edition = {4th ed},
  publisher = {{ISA}},
  location = {{Research Triangle Park, NC}},
  isbn = {978-1-934394-50-2},
  keywords = {Handbooks; manuals; etc,Pneumatic control valves,Valves},
  pagetotal = {161}
}

license: Unlicense

repository: ratral/PlungerValves

repo_name: ratral/PlungerValves


text:
DESCRIPTION = "Remote Control Handler"
LICENSE = "CLOSED"
#LIC_FILES_CHKSUM = "file://LICENSE;md5=254d223b9e70204fcb33cd46be4df2d7"

FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
SRC_URI = "file://cec_handler.service"

S = "${WORKDIR}"

RDEPENDS_${PN} = " snc libcec "
#DEPENDS = ""

inherit systemd

SYSTEMD_SERVICE_${PN} = "cec_handler.service"

do_install_append() {
  install -d ${D}${systemd_unitdir}/system
  install -m 0644 ${WORKDIR}/cec_handler.service ${D}${systemd_unitdir}/system
}

SYSTEMD_AUTO_ENABLE_${PN} = "enable"

repository: yorns/simpleMovieBuild

repo_name: yorns/simpleMovieBuild


text:
require icu-3.6.inc

DEPENDS += "icu-native"
PR = "${INC_PR}.1"

SRC_URI += "file://use-g++-for-linking.patch \
            file://rematch-gcc-bug.patch"

do_configure_append() {
        for i in */Makefile */*.inc */*/Makefile */*/*.inc icudefs.mk ; do
		sed -i -e 's:$(INVOKE) $(BINDIR)/:$(INVOKE) :g' $i
		sed -i -e 's:$(BINDIR)/::g' $i
		sed -i -e 's:LD_LIBRARY_PATH:LD_LIBRARY_PATH_FAKE:g' $i
        done
	sed -i -e 's:$(BINDIR)/::g' extra/uconv/pkgdata.inc || true
	sed -i -e 's:$(BINDIR)/::g' extra/uconv/pkgdata.inc.in || true
}

do_compile() {
	oe_runmake 'CXX=${CXX}'
}

do_install_append() {
        chmod +x ${D}${libdir}/lib*
}

PACKAGES =+ "libicudata libicuuc libicui18n libicule libiculx libicutu libicuio"

FILES_libicudata = "${libdir}/libicudata.so.*"
FILES_libicuuc = "${libdir}/libicuuc.so.*"
FILES_libicui18n = "${libdir}/libicui18n.so.*"
FILES_libicule = "${libdir}/libicule.so.*"
FILES_libiculx = "${libdir}/libiculx.so.*"
FILES_libicutu = "${libdir}/libicutu.so.*"
FILES_libicuio = "${libdir}/libicuio.so.*"

SYSROOT_PREPROCESS_FUNCS += "icu_sysroot_preprocess"

# We need to append this so it runs *after* binconfig's preprocess function
icu_sysroot_preprocess () {
        sed -i -e s:^prefix=:prefix=\"${STAGING_DIR_TARGET}/usr\": ${SYSROOT_DESTDIR}${STAGING_BINDIR_CROSS}/icu-config
}

SRC_URI[md5sum] = "6243f7a19e03e05403ce84e597510d4c"
SRC_URI[sha256sum] = "5135e8d69d6206d320515df7aeee7027711ab1aef9d8dbf29571a97a9746b041"

repository: overo/overo-oe-natty

repo_name: overo/overo-oe-natty

branch_name: HEAD


text:
/*===================================================================

MSI applications for interactive analysis in MITK (M2aia)

Copyright (c) Jonas Cordes

All rights reserved.

This software is distributed WITHOUT ANY WARRANTY; without
even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE.

See LICENSE.txt for details.

===================================================================*/

#include <m2CoreObjectFactory.h>

#include <m2ImzMLSpectrumImage.h>

#include <mitkLevelWindowProperty.h>
#include <mitkLookupTableProperty.h>

m2::CoreObjectFactory::CoreObjectFactory() : mitk::CoreObjectFactoryBase()
{
  static bool alreadyDone = false;
  if (!alreadyDone)
  {
    MITK_DEBUG << "ImagingMassSpectrometryObjectFactory c'tor" << std::endl;

    CreateFileExtensionsMap();

    alreadyDone = true;
  }
}

m2::CoreObjectFactory::~CoreObjectFactory() {}

mitk::Mapper::Pointer m2::CoreObjectFactory::CreateMapper(mitk::DataNode * /*node*/,
                                                                               MapperSlotId /*id*/)
{
  return nullptr;
}

void m2::CoreObjectFactory::SetDefaultProperties(mitk::DataNode * /*node*/) {}

std::string m2::CoreObjectFactory::GetFileExtensions()
{
  std::string fileExtension;
  this->CreateFileExtensions(m_FileExtensionsMap, fileExtension);
  return fileExtension.c_str();
}

mitk::CoreObjectFactoryBase::MultimapType m2::CoreObjectFactory::GetFileExtensionsMap()
{
  return m_FileExtensionsMap;
}

mitk::CoreObjectFactoryBase::MultimapType m2::CoreObjectFactory::GetSaveFileExtensionsMap()
{
  return m_SaveFileExtensionsMap;
}

void m2::CoreObjectFactory::CreateFileExtensionsMap() {}

std::string m2::CoreObjectFactory::GetSaveFileExtensions()
{
  std::string fileExtension;
  this->CreateFileExtensions(m_SaveFileExtensionsMap, fileExtension);
  return fileExtension.c_str();
}

struct Register_m2CoreObjectFactory
{
  Register_m2CoreObjectFactory() : m_Factory(m2::CoreObjectFactory::New())
  {
    mitk::CoreObjectFactory::GetInstance()->RegisterExtraFactory(m_Factory);
  }

  ~Register_m2CoreObjectFactory()
  {
    mitk::CoreObjectFactory::GetInstance()->UnRegisterExtraFactory(m_Factory);
  }
  m2::CoreObjectFactory::Pointer m_Factory;
};

static Register_m2CoreObjectFactory Register_m2CoreObjectFactory;

extension: cpp


text:
/*
 * Copyright 2017 Fraunhofer Institute for Manufacturing Engineering and Automation (IPA)
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *   http://www.apache.org/licenses/LICENSE-2.0

 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#include <string>
#include <vector>
#include <algorithm>
#include <ros/ros.h>

#include <sensor_msgs/JointState.h>
#include <control_msgs/JointTrajectoryControllerState.h>
#include <std_msgs/Float64.h>
#include <geometry_msgs/Twist.h>

#include <kdl_parser/kdl_parser.hpp>
#include <kdl/chainfksolvervel_recursive.hpp>
#include <kdl/chainjnttojacsolver.hpp>
#include <kdl/frames.hpp>
#include <kdl/jntarray.hpp>
#include <kdl/jntarrayvel.hpp>

#include <Eigen/Dense>
#include <kdl_conversions/kdl_msg.h>

class DebugFkVelRecursive
{
    ros::NodeHandle nh_;
    ros::Subscriber joint_states_sub_;
    ros::Subscriber controller_state_sub_;
    ros::Publisher manipulability_pub_;
    ros::Publisher twist_current_pub_;
    ros::Publisher twist_magnitude_desired_pub_;
    ros::Publisher twist_magnitude_actual_pub_;

    std::string chain_base_link_;
    std::string chain_tip_link_;

    KDL::Chain chain_;
    KDL::ChainFkSolverVel_recursive* p_fksolver_vel_;
    KDL::ChainJntToJacSolver* p_jnt2jac_;

public:
    int init()
    {
        if (!nh_.getParam("chain_base_link", this->chain_base_link_))
        {
            ROS_ERROR("Failed to get parameter \"chain_base_link\".");
            return -1;
        }

        if (!nh_.getParam("chain_tip_link", this->chain_tip_link_))
        {
            ROS_ERROR("Failed to get parameter \"chain_tip_link\".");
            return -2;
        }

        /// parse robot_description and generate KDL chains
        KDL::Tree my_tree;
        if (!kdl_parser::treeFromParam("/robot_description", my_tree))
        {
            ROS_ERROR("Failed to construct kdl tree");
            return -3;
        }

        my_tree.getChain(this->chain_base_link_, this->chain_tip_link_, chain_);
        if (chain_.getNrOfJoints() == 0)
        {
            ROS_ERROR("Failed to initialize kinematic chain");
            return -4;
        }

        //debug chain
        ROS_WARN("~~~~~~~~~~~~~ DEBUG CHAIN ~~~~~~~~~~~~~");
        ROS_WARN_STREAM("NrOfJoints: "<<chain_.getNrOfJoints());
        ROS_WARN_STREAM("NrOfSegments: "<<chain_.getNrOfSegments());
        for (unsigned int i = 0; i < chain_.getNrOfSegments(); i++)
        {
            KDL::Segment segment = chain_.getSegment(i);
            ROS_WARN_STREAM("SegmentName: "<<segment.getName());
            KDL::Joint joint = segment.getJoint();
            ROS_WARN_STREAM("JointName: "<<joint.getName());
            ROS_WARN_STREAM("JointType: "<<joint.getTypeName());
        }
        ROS_WARN("~~~~~~~~~~~~~ DEBUG CHAIN ~~~~~~~~~~~~~");

        p_fksolver_vel_ = new KDL::ChainFkSolverVel_recursive(chain_);
        p_jnt2jac_ = new KDL::ChainJntToJacSolver(chain_);

        /// initialize ROS interfaces
        // joint_states_sub_ = nh_.subscribe("joint_states", 1, &DebugFkVelRecursive::jointstatesCallback, this);  // analyzing controller_state instead
        controller_state_sub_ = nh_.subscribe("joint_trajectory_controller/state", 1, &DebugFkVelRecursive::controllerstateCallback, this);
        manipulability_pub_ = nh_.advertise<std_msgs::Float64> ("debug/manipulability", 1);
        twist_current_pub_ = nh_.advertise<geometry_msgs::Twist> ("debug/twist_current", 1);
        twist_magnitude_desired_pub_ = nh_.advertise<sensor_msgs::JointState> ("debug/twist_magnitude/desired", 1);
        twist_magnitude_actual_pub_ = nh_.advertise<sensor_msgs::JointState> ("debug/twist_magnitude/actual", 1);

        return 0;
    }

    void jointstatesCallback(const sensor_msgs::JointState::ConstPtr& msg)
    {
        KDL::JntArray q = KDL::JntArray(chain_.getNrOfJoints());
        KDL::JntArray q_dot = KDL::JntArray(chain_.getNrOfJoints());

        /// extract q, q_dot from JointStates
        for (unsigned int i = 0; i < chain_.getNrOfSegments(); i++)
        {
            KDL::Joint joint = chain_.getSegment(i).getJoint();
            std::string joint_name = joint.getName();
            if (joint.getType() == KDL::Joint::None)
            {
                ROS_DEBUG_STREAM("Skip fixed Joint '" << joint_name);
                continue;
            }
            else
            {
                if (std::find(msg->name.begin(), msg->name.end(), joint_name) != msg->name.end())
                {
                    unsigned int index = std::distance(msg->name.begin(), std::find(msg->name.begin(), msg->name.end(), joint_name));
                    q(index) = msg->position[index];
                    q_dot(index) = msg->velocity[index];
                }
                else
                {
                    ROS_ERROR_STREAM("Joint '" << joint_name << "' not found in JointStates");
                    return;
                }
            }
        }

        /// compute current twist
        std::vector< KDL::FrameVel > v_FrameVel;
        KDL::JntArrayVel jntArrayVel = KDL::JntArrayVel(q, q_dot);
        v_FrameVel.resize(chain_.getNrOfSegments());
        if (p_fksolver_vel_->JntToCart(jntArrayVel, v_FrameVel, chain_.getNrOfSegments()) >= 0)
        {
            //last entry is twist of tip_link
            geometry_msgs::Twist twist_msg;
            tf::twistKDLToMsg(v_FrameVel.back().GetTwist(), twist_msg);
            twist_current_pub_.publish(twist_msg);

            //recursively calculate FrameVel magnitudes
            sensor_msgs::JointState magnitude_msg;
            magnitude_msg.header.stamp = msg->header.stamp;
            for (unsigned int i = 0; i < chain_.getNrOfSegments(); i++)
            {
                magnitude_msg.name.push_back(chain_.getSegment(i).getName());
                magnitude_msg.velocity.push_back(v_FrameVel[i].GetTwist().vel.Norm());
            }
            twist_magnitude_actual_pub_.publish(magnitude_msg);
        }

        /// compute manipulability
        KDL::Jacobian jac(chain_.getNrOfJoints());
        p_jnt2jac_->JntToJac(q, jac);
        Eigen::Matrix<double, Eigen::Dynamic, Eigen::Dynamic> prod = jac.data * jac.data.transpose();
        double d = prod.determinant();
        double kappa = std::sqrt(std::abs(d));
        std_msgs::Float64 manipulability_msg;
        manipulability_msg.data = kappa;
        manipulability_pub_.publish(manipulability_msg);
    }

    void controllerstateCallback(const control_msgs::JointTrajectoryControllerState::ConstPtr& msg)
    {
        KDL::JntArray q_desired = KDL::JntArray(chain_.getNrOfJoints());
        KDL::JntArray q_desired_dot = KDL::JntArray(chain_.getNrOfJoints());
        KDL::JntArray q_actual = KDL::JntArray(chain_.getNrOfJoints());
        KDL::JntArray q_actual_dot = KDL::JntArray(chain_.getNrOfJoints());

        for (unsigned int i = 0; i < chain_.getNrOfSegments(); i++)
        {
            KDL::Joint joint = chain_.getSegment(i).getJoint();
            std::string joint_name = joint.getName();
            if (joint.getType() == KDL::Joint::None)
            {
                ROS_DEBUG_STREAM("Skip fixed Joint '" << joint_name);
                continue;
            }
            else
            {
                if (std::find(msg->joint_names.begin(), msg->joint_names.end(), joint_name) != msg->joint_names.end())
                {
                    unsigned int index = std::distance(msg->joint_names.begin(), std::find(msg->joint_names.begin(), msg->joint_names.end(), joint_name));
                    q_desired(index) = msg->desired.positions[index];
                    q_desired_dot(index) = msg->desired.velocities[index];
                    q_actual(index) = msg->actual.positions[index];
                    q_actual_dot(index) = msg->actual.velocities[index];
                }
                else
                {
                    ROS_ERROR_STREAM("Joint '" << joint_name << "' not found in JointTrajectoryControllerState");
                    return;
                }
            }
        }

        /// compute desired twists recursively
        std::vector< KDL::FrameVel > v_FrameVel_desired;
        KDL::JntArrayVel jntArrayVel_desired = KDL::JntArrayVel(q_desired, q_desired_dot);
        v_FrameVel_desired.resize(chain_.getNrOfSegments());
        if (p_fksolver_vel_->JntToCart(jntArrayVel_desired, v_FrameVel_desired, chain_.getNrOfSegments()) >= 0)
        {
            sensor_msgs::JointState magnitude_desired_msg;
            magnitude_desired_msg.header.stamp = msg->header.stamp;
            for (unsigned int i = 0; i < chain_.getNrOfSegments(); i++)
            {
                magnitude_desired_msg.name.push_back(chain_.getSegment(i).getName());
                magnitude_desired_msg.velocity.push_back(v_FrameVel_desired[i].GetTwist().vel.Norm());
            }
            twist_magnitude_desired_pub_.publish(magnitude_desired_msg);
        }
        /// compute actual twists recursively
        std::vector< KDL::FrameVel > v_FrameVel_actual;
        KDL::JntArrayVel jntArrayVel_actual = KDL::JntArrayVel(q_actual, q_actual_dot);
        v_FrameVel_actual.resize(chain_.getNrOfSegments());
        if (p_fksolver_vel_->JntToCart(jntArrayVel_actual, v_FrameVel_actual, chain_.getNrOfSegments()) >= 0)
        {
            sensor_msgs::JointState magnitude_actual_msg;
            magnitude_actual_msg.header.stamp = msg->header.stamp;
            for (unsigned int i = 0; i < chain_.getNrOfSegments(); i++)
            {
                magnitude_actual_msg.name.push_back(chain_.getSegment(i).getName());
                magnitude_actual_msg.velocity.push_back(v_FrameVel_actual[i].GetTwist().vel.Norm());
            }
            twist_magnitude_actual_pub_.publish(magnitude_actual_msg);
        }
    }

};

int main(int argc, char** argv)
{
    ros::init(argc, argv, "debug_fk_vel_recursive_node");

    DebugFkVelRecursive dfvr;
    if (dfvr.init() != 0)
    {
        ROS_ERROR("Failed to initialize DebugFkVelRecursive.");
        return -1;
    }

    ros::spin();
}


text:
# Copyright (c) 2019 LG Electronics, Inc.

DESCRIPTION = "Real-time collision detection and multi-physics simulation"
HOMEPAGE = "https://github.com/bulletphysics/bullet3"
SECTION = "devel"
LICENSE = "Zlib"
LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=74f06ab3011994d1b43d71ecbb42a7cf"

SRCREV = "6e4707df5fa1f9927109e89a7cd2a6d6a6ddd072"
SRC_URI = "git://github.com/bulletphysics/bullet3;protocol=https \
    file://0001-CMakeLists.txt-Use-FindPython2-instead-of-deprecated.patch \
"
S = "${WORKDIR}/git"

inherit cmake
inherit distutils-base

DEPENDS = "python-numpy"

# From https://github.com/bulletphysics/bullet3/blob/master/build_cmake_pybullet_double.sh
EXTRA_OECMAKE = "-DBUILD_PYBULLET=ON -DBUILD_PYBULLET_NUMPY=ON -DUSE_DOUBLE_PRECISION=ON -DBT_USE_EGL=ON -DCMAKE_BUILD_TYPE=Release"

EXTRA_OECMAKE += "-DBUILD_SHARED_LIBS=ON -DINSTALL_LIBS=ON -DINSTALL_EXTRA_LIBS=ON"

CFLAGS += "-fsigned-char"
CXXFLAGS += "-fsigned-char"

repository: herb-kuta-lge/meta-ros

repo_name: herb-kuta-lge/meta-ros

branch_name: refs/heads/master-draft

gha_license_id: MIT


text:
include qemu_${PV}.bb
inherit native
S = "${WORKDIR}/qemu-${PV}"
prefix = "${STAGING_DIR}/${BUILD_SYS}"

python __anonymous () {
    from bb import which, data

    cc = 'gcc'
    path = data.getVar('PATH', d)
    if len(which(path, 'gcc-3.4')) != 0:
        cc = 'gcc-3.4'
        data.setVar('EXTRA_OECONF', " --cc=gcc-3.4", d)
    elif len(which(path, 'gcc-3.3')) != 0:
        cc = 'gcc-3.3'
        data.setVar('EXTRA_OECONF', " --cc=gcc-3.3", d)
    data.setVar('QEMU_CC', cc, d)
}

python do_check_gcc () {
    from bb import which, data

    import os

    cc = data.getVar('QEMU_CC', d, 1)
    f = os.popen ("%s --version" % cc, 'r')
    line = f.readline()
    if f.close() or not line:
        raise bb.build.FuncFailed("Failed to run %s" % cc)

    import re

    m = re.match("^.* \(.*\) (.\..\..).*$", line)
    if not m:
        raise bb.build.FuncFailed("Failed to parse gcc version output")
    v = m.group(1).split('.')
    if not (v[0] == '3' and v[1] in ['3', '4']):
        raise bb.build.FuncFailed("qemu requires GCC 3.3.x or 3.4.x. Please install either version to build\nthis package.\nIf you haven't explicitely asked for this package to be built, it is likely\nthat ENABLE_BINARY_LOCALE_GENERATION is set. To work around the problem set it\nto \"0\" (but note that this will break internationalization).")
}

addtask check_gcc before do_configure after do_patch

repository: Terentyev/familiar-linux

repo_name: Terentyev/familiar-linux


text:
SECTION = "libs"
DEPENDS = "renderext x11"
DESCRIPTION = "X Render extension library."
LICENSE = "BSD"
PR = "r1"

SRC_URI = "${XLIBS_MIRROR}/libXrender-${PV}.tar.bz2 \
	   file://autofoo.patch;patch=1"
S = "${WORKDIR}/libXrender-${PV}"

inherit autotools pkgconfig

do_stage() {
	oe_runmake install prefix=${STAGING_DIR} \
	       bindir=${STAGING_BINDIR} \
	       includedir=${STAGING_INCDIR} \
	       libdir=${STAGING_LIBDIR} \
	       datadir=${STAGING_DATADIR}
}

repository: BackupTheBerlios/openslug-svn

repo_name: BackupTheBerlios/openslug-svn


text:
/**
 *  wsGame.h
 *  March 1, 2013
 *  D. Scott Nettleton
 *
 *  This file declares the abstract base class wsGame.
 *  The wsGame class is inherited by a game object, which
 *  is different from one game to another. Eventually, the
 *  world builder will generate and compile wsGame objects.
 *  For now, it should be used as a template for implementing
 *  the Whipstitch Game Engine as an API.
 *
 *  This software is provided under the terms of the MIT license
 *  Copyright (c) D. Scott Nettleton, 2013
 *
 *  Permission is hereby granted, free of charge, to any person
 *  obtaining a copy of this software and associated documentation
 *  files (the "Software"), to deal in the Software without
 *  restriction, including without limitation the rights to use, copy,
 *  modify, merge, publish, distribute, sublicense, and/or sell copies
 *  of the Software, and to permit persons to whom the Software is
 *  furnished to do so, subject to the following conditions:
 *
 *  The above copyright notice and this permission notice shall be
 *  included in all copies or substantial portions of the Software.
 *
 *  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 *  EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
 *  OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 *  NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
 *  HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
 *  WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 *  FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 *  OTHER DEALINGS IN THE SOFTWARE.
*/
#ifndef WS_GAME_H_
#define WS_GAME_H_

#include "wsEventManager.h"
#include "wsScene.h"

class wsGame {
  public:
    //  This returns the scene object to be updated by the game loop.
    virtual wsScene* getCurrentScene() = 0;
    //  This is run when the program opens, before the game loop starts.
    //  It runs immediately after the Engine subsystems are initialized.
    virtual void onStart() = 0;
    //  This contains functions which are run once every game loop.
    virtual void onLoop() = 0;
    //  This contains functions which handle events in the whipstitch
    //  game engine.
    virtual void onEvent(const wsEvent& event) = 0;
    //  This is run when the program closes, immediately before the
    //  Engine subsystems are shut down.
    virtual void onExit() = 0;
};

#endif //  WS_GAME_H_

repository: dsnettleton/whipstitch-game-engine

repo_name: dsnettleton/whipstitch-game-engine


text:
SUMMARY = "Multimedia processing server for Linux"
AUTHOR = "Wim Taymans <wtaymans@redhat.com>"
HOMEPAGE = "https://pipewire.org"
SECTION = "multimedia"
LICENSE = "LGPL-2.1-only"
LIC_FILES_CHKSUM = " \
    file://LICENSE;md5=d8153c6e65986f862a0550ca74a3ed73 \
    file://LGPL;md5=2d5025d4aa3495befef8f17206a5b0a1 \
"
DEPENDS = "alsa-lib dbus udev"
SRCREV = "14c11c0fe4d366bad4cfecdee97b6652ff9ed63d"
PV = "0.2.7"

SRC_URI = "git://github.com/PipeWire/pipewire;branch=master;protocol=https"

S = "${WORKDIR}/git"

inherit meson pkgconfig systemd manpages

PACKAGECONFIG ??= "\
    ${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)} \
    gstreamer \
"

PACKAGECONFIG[systemd] = "-Dsystemd=true,-Dsystemd=false,systemd"
PACKAGECONFIG[gstreamer] = "-Dgstreamer=enabled,-Dgstreamer=disabled,glib-2.0 gstreamer1.0 gstreamer1.0-plugins-base"
PACKAGECONFIG[manpages] = "-Dman=true,-Dman=false,libxml-parser-perl-native"

PACKAGES =+ "\
    ${PN}-spa-plugins \
    ${PN}-alsa \
    ${PN}-config \
    gstreamer1.0-${PN} \
    lib${PN} \
    lib${PN}-modules \
"

RDEPENDS:lib${PN} += "lib${PN}-modules ${PN}-spa-plugins"

FILES:${PN} = "\
    ${sysconfdir}/pipewire/pipewire.conf \
    ${bindir}/pipewire* \
    ${systemd_user_unitdir}/* \
"
FILES:lib${PN} = "\
    ${libdir}/libpipewire-*.so.* \
"
FILES:lib${PN}-modules = "\
    ${libdir}/pipewire-*/* \
"
FILES:${PN}-spa-plugins = "\
    ${bindir}/spa-* \
    ${libdir}/spa/* \
"
FILES:${PN}-alsa = "\
    ${libdir}/alsa-lib/* \
    ${datadir}/alsa/alsa.conf.d/50-pipewire.conf \
"
FILES:gstreamer1.0-${PN} = "\
    ${libdir}/gstreamer-1.0/* \
"

CONFFILES:${PN} = "\
    ${sysconfdir}/pipewire/pipewire.conf \
"

repository: openembedded/meta-openembedded

repo_name: openembedded/meta-openembedded


text:
/**
 * Copyright (c) 2015, Timothy Stack
 *
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * * Redistributions of source code must retain the above copyright notice, this
 * list of conditions and the following disclaimer.
 * * Redistributions in binary form must reproduce the above copyright notice,
 * this list of conditions and the following disclaimer in the documentation
 * and/or other materials provided with the distribution.
 * * Neither the name of Timothy Stack nor the names of its contributors
 * may be used to endorse or promote products derived from this software
 * without specific prior written permission.
 *
 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ''AS IS'' AND ANY
 * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 * DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY
 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
 * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 *
 * @file time-extension-functions.cc
 */

#include <string>
#include <unordered_map>

#include <string.h>

#include "base/date_time_scanner.hh"
#include "base/humanize.time.hh"
#include "config.h"
#include "relative_time.hh"
#include "sql_util.hh"
#include "vtab_module.hh"

static nonstd::optional<text_auto_buffer>
timeslice(sqlite3_value* time_in, nonstd::optional<const char*> slice_in_opt)
{
    thread_local date_time_scanner dts;
    thread_local struct {
        std::string c_slice_str;
        relative_time c_rel_time;
    } cache;
    const auto slice_in
        = string_fragment::from_c_str(slice_in_opt.value_or("15m"));

    if (slice_in.empty()) {
        throw sqlite_func_error("no time slice value given");
    }

    if (slice_in != cache.c_slice_str.c_str()) {
        auto parse_res = relative_time::from_str(slice_in);
        if (parse_res.isErr()) {
            throw sqlite_func_error(
                "unable to parse time slice value: {} -- {}",
                slice_in,
                parse_res.unwrapErr().pe_msg);
        }

        cache.c_rel_time = parse_res.unwrap();
        if (cache.c_rel_time.empty()) {
            throw sqlite_func_error("could not determine a time slice from: {}",
                                    slice_in);
        }

        cache.c_slice_str = slice_in.to_string();
    }

    struct timeval tv;
    struct exttm tm;

    switch (sqlite3_value_type(time_in)) {
        case SQLITE_BLOB:
        case SQLITE3_TEXT: {
            const char* time_in_str
                = reinterpret_cast<const char*>(sqlite3_value_text(time_in));

            if (dts.scan(
                    time_in_str, strlen(time_in_str), nullptr, &tm, tv, false)
                == nullptr)
            {
                dts.unlock();
                if (dts.scan(time_in_str,
                             strlen(time_in_str),
                             nullptr,
                             &tm,
                             tv,
                             false)
                    == nullptr)
                {
                    throw sqlite_func_error("unable to parse time value -- {}",
                                            time_in_str);
                }
            }
            break;
        }
        case SQLITE_INTEGER: {
            auto msecs
                = std::chrono::milliseconds(sqlite3_value_int64(time_in));

            tv.tv_sec = std::chrono::duration_cast<std::chrono::seconds>(msecs)
                            .count();
            tm.et_tm = *gmtime(&tv.tv_sec);
            tm.et_nsec = std::chrono::duration_cast<std::chrono::nanoseconds>(
                             msecs % 1000)
                             .count();
            break;
        }
        case SQLITE_FLOAT: {
            auto secs = sqlite3_value_double(time_in);
            double integ;
            auto fract = modf(secs, &integ);

            tv.tv_sec = integ;
            tm.et_tm = *gmtime(&tv.tv_sec);
            tm.et_nsec = floor(fract * 1000000000.0);
            break;
        }
        case SQLITE_NULL: {
            return nonstd::nullopt;
        }
    }

    auto win_start_opt = cache.c_rel_time.window_start(tm);

    if (!win_start_opt) {
        return nonstd::nullopt;
    }

    auto win_start = *win_start_opt;
    auto ts = auto_buffer::alloc(64);
    auto actual_length
        = sql_strftime(ts.in(), ts.size(), win_start.to_timeval());

    ts.resize(actual_length);
    return text_auto_buffer{std::move(ts)};
}

static nonstd::optional<double>
sql_timediff(string_fragment time1, string_fragment time2)
{
    struct timeval tv1, tv2, retval;
    date_time_scanner dts1, dts2;
    auto parse_res1 = relative_time::from_str(time1);

    if (parse_res1.isOk()) {
        tv1 = parse_res1.unwrap().adjust_now().to_timeval();
    } else if (!dts1.convert_to_timeval(
                   time1.data(), time1.length(), nullptr, tv1))
    {
        return nonstd::nullopt;
    }

    auto parse_res2 = relative_time::from_str(time2);
    if (parse_res2.isOk()) {
        tv2 = parse_res2.unwrap().adjust_now().to_timeval();
    } else if (!dts2.convert_to_timeval(
                   time2.data(), time2.length(), nullptr, tv2))
    {
        return nonstd::nullopt;
    }

    timersub(&tv1, &tv2, &retval);

    return (double) retval.tv_sec + (double) retval.tv_usec / 1000000.0;
}

static std::string
sql_humanize_duration(double value)
{
    auto secs = std::trunc(value);
    auto usecs = (value - secs) * 1000000.0;
    timeval tv;

    tv.tv_sec = secs;
    tv.tv_usec = usecs;
    return humanize::time::duration::from_tv(tv).to_string();
}

int
time_extension_functions(struct FuncDef** basic_funcs,
                         struct FuncDefAgg** agg_funcs)
{
    static struct FuncDef time_funcs[] = {
        sqlite_func_adapter<decltype(&timeslice), timeslice>::builder(
            help_text(
                "timeslice",
                "Return the start of the slice of time that the given "
                "timestamp falls in.  "
                "If the time falls outside of the slice, NULL is returned.")
                .sql_function()
                .with_parameter(
                    {"time", "The timestamp to get the time slice for."})
                .with_parameter({"slice", "The size of the time slices"})
                .with_tags({"datetime"})
                .with_example({
                    "To get the timestamp rounded down to the start of the "
                    "ten minute slice",
                    "SELECT timeslice('2017-01-01T05:05:00', '10m')",
                })
                .with_example({
                    "To group log messages into five minute buckets and count "
                    "them",
                    "SELECT timeslice(log_time_msecs, '5m') AS slice, "
                    "count(1)\n    FROM lnav_example_log GROUP BY slice",
                })
                .with_example({
                    "To group log messages by those before 4:30am and after",
                    "SELECT timeslice(log_time_msecs, 'before 4:30am') AS "
                    "slice, count(1) FROM lnav_example_log GROUP BY slice",
                })),

        sqlite_func_adapter<decltype(&sql_timediff), sql_timediff>::builder(
            help_text(
                "timediff",
                "Compute the difference between two timestamps in seconds")
                .sql_function()
                .with_parameter({"time1", "The first timestamp"})
                .with_parameter(
                    {"time2", "The timestamp to subtract from the first"})
                .with_tags({"datetime"})
                .with_example({
                    "To get the difference between two timestamps",
                    "SELECT timediff('2017-02-03T04:05:06', "
                    "'2017-02-03T04:05:00')",
                })
                .with_example({
                    "To get the difference between relative timestamps",
                    "SELECT timediff('today', 'yesterday')",
                })),

        sqlite_func_adapter<decltype(&sql_humanize_duration),
                            sql_humanize_duration>::
            builder(
                help_text("humanize_duration",
                          "Format the given seconds value as an abbreviated "
                          "duration string")
                    .sql_function()
                    .with_parameter({"secs", "The duration in seconds"})
                    .with_tags({"datetime", "string"})
                    .with_example({
                        "To format a duration",
                        "SELECT humanize_duration(15 * 60)",
                    })
                    .with_example({
                        "To format a sub-second value",
                        "SELECT humanize_duration(1.5)",
                    })),

        {nullptr},
    };

    *basic_funcs = time_funcs;
    *agg_funcs = nullptr;

    return SQLITE_OK;
}

repository: tstack/lnav

repo_name: tstack/lnav

extension: cc


text:
package merger

import (
	"bufio"
	"encoding/json"
	"log"
	"os"
	"reflect"
	"strings"
	"testing"
)

// TODO: Make negative test cases and check for errors

type Case struct {
	A   interface{}
	B   interface{}
	Exp interface{}
}

func TestMain(m *testing.M) {
	// Read tabletest content
	file, err := os.Open("testcases.list")
	if err != nil {
		log.Fatal(err)
	}
	defer file.Close()

	scanner := bufio.NewScanner(file)
	var counter int
	for scanner.Scan() {
		t := scanner.Text()
		if strings.HasPrefix(t, "#") {
			continue
		}

		var data interface{}
		err := json.Unmarshal([]byte(t), &data)
		if err != nil {
			log.Fatal(err)
		}

		switch counter % 3 {
		case 0:
			testcases = append(testcases, Case{})
			testcases[len(testcases)-1].A = data
		case 1:
			testcases[len(testcases)-1].B = data
		case 2:
			testcases[len(testcases)-1].Exp = data
		}
		counter++
	}

	if err := scanner.Err(); err != nil {
		log.Fatal(err)
	}

	os.Exit(m.Run())
}

/*
 * Table tests
 */
var testcases []Case

func TestTabletest(t *testing.T) {
	for _, c := range testcases {
		res, err := Merge(c.A, c.B)
		if err != nil {
			t.Fatal(err)
		}

		if !reflect.DeepEqual(res, c.Exp) {
			t.Errorf("Merge(%v, %v) => %v, want %v", c.A, c.B, res, c.Exp)
		} else {
			t.Logf("Merge(%v, %v) => %v", c.A, c.B, res)
		}
	}
}

/*
 * Merge tests
 */
func TestArray(t *testing.T) {
	A := [2]int{1, 2}
	B := [3]int{3, 4, 5}
	Exp := [5]int{1, 2, 3, 4, 5}
	res, err := Merge(A, B)
	if err != nil {
		t.Fatal(err)
	}

	if !reflect.DeepEqual(res, Exp) {
		t.Errorf("Merge(%v, %v) => %v, want %v", A, B, res, Exp)
	} else {
		t.Logf("Merge(%v, %v) => %v", A, B, res)
	}
}

func TestStructReplace2(t *testing.T) {
	A := struct {
		A int
		B int
		C int
	}{1, 2, 3}
	B := struct {
		A int
		C int
	}{2, 4}
	Exp := struct {
		A int
		B int
		C int
	}{2, 2, 4}
	res, err := Merge(A, B)
	if err != nil {
		t.Fatal(err)
	}

	if !reflect.DeepEqual(res, Exp) {
		t.Errorf("Merge(%v, %v) => %v, want %v", A, B, res, Exp)
	} else {
		t.Logf("Merge(%v, %v) => %v", A, B, res)
	}
}

func TestStructReplace(t *testing.T) {
	A := struct {
		A int
		B int
	}{1, 2}
	B := struct {
		A int
		B int
		C int
	}{1, 4, 5}
	Exp := struct {
		A int
		B int
		C int
	}{1, 4, 5}
	res, err := Merge(A, B)
	if err != nil {
		t.Fatal(err)
	}

	if !reflect.DeepEqual(res, Exp) {
		t.Errorf("Merge(%v, %v) => %v, want %v", A, B, res, Exp)
	} else {
		t.Logf("Merge(%v, %v) => %v", A, B, res)
	}
}

// Negative tests
func TestDiffSliceTypes(t *testing.T) {
	A := []int{1, 2}
	B := []string{"a", "b"}
	res, err := Merge(A, B)
	t.Logf("Res: %v, err: %s", res, err)

	if err == nil {
		t.Fatalf("Expected an error, but got %v", res)
	}

	if e2, ok := err.(*MergeError); !ok {
		t.Error("Expected an MergeError")
	} else if e2.Type() != ErrDiffSliceTypes {
		t.Errorf("Expected an ErrDiffSliceTypes but got %v (%v)", e2.Type(), e2)
	}
}

func TestDiffArrayTypes(t *testing.T) {
	A := [2]int{1, 2}
	B := [2]string{"a", "b"}
	res, err := Merge(A, B)
	t.Logf("Res: %v, err: %s", res, err)

	if err == nil {
		t.Fatalf("Expected an error, but got %v", res)
	}

	if e2, ok := err.(*MergeError); !ok {
		t.Error("Expected an MergeError")
	} else if e2.Type() != ErrDiffArrayTypes {
		t.Errorf("Expected an ErrDiffArrayTypes but got %v (%v)", e2.Type(), e2)
	}
}

func TestDiffMapKeyTypes(t *testing.T) {
	A := map[int]int{1: 1, 2: 2}
	B := map[string]int{"1": 1, "2": 2}
	res, err := Merge(A, B)
	t.Logf("Res: %v, err: %s", res, err)

	if err == nil {
		t.Fatalf("Expected an error, but got %v", res)
	}

	if e2, ok := err.(*MergeError); !ok {
		t.Error("Expected an MergeError")
	} else if e2.Type() != ErrDiffMapKeyTypes {
		t.Errorf("Expected an ErrDiffMapKeyTypes but got %v (%v)", e2.Type(), e2)
	}
}

func TestDiffMapValueTypes(t *testing.T) {
	A := map[int]int{1: 1, 2: 2}
	B := map[int]string{1: "1", 2: "2"}
	res, err := Merge(A, B)
	t.Logf("Res: %v, err: %s", res, err)

	if err == nil {
		t.Fatalf("Expected an error, but got %v", res)
	}

	if e2, ok := err.(*MergeError); !ok {
		t.Error("Expected an MergeError")
	} else if e2.Type() != ErrDiffMapValueTypes {
		t.Errorf("Expected an ErrDiffMapValueTypes but got %v (%v)", e2.Type(), e2)
	}
}

func TestSliceArrayMerge(t *testing.T) {
	A := []int{1, 2}
	B := [2]int{3, 4}
	res, err := Merge(A, B)
	t.Logf("Res: %v, err: %s", res, err)

	if err == nil {
		t.Fatalf("Expected an error, but got %v", res)
	}

	if e2, ok := err.(*MergeError); !ok {
		t.Error("Expected an MergeError")
	} else if e2.Type() != ErrDiffKind {
		t.Errorf("Expected an ErrDiffKind but got %v (%v)", e2.Type(), e2)
	}
}

func TestPointerMerge(t *testing.T) {
	A := "a"
	B := &A
	res, err := Merge(A, B)
	t.Logf("Res: %v, err: %s", res, err)

	if err == nil {
		t.Fatalf("Expected an error, but got %v", res)
	}

	if e2, ok := err.(*MergeError); !ok {
		t.Error("Expected an MergeError")
	} else if e2.Type() != ErrMergeUnsupported {
		t.Errorf("Expected an ErrMergeUnsupported but got %v (%v)", e2.Type(), e2)
	}
}

func TestDeepMapError(t *testing.T) {
	A := map[int]interface{}{1: "a"}
	B := map[int]interface{}{1: []int{}}
	res, err := Merge(A, B)
	t.Logf("Res: %v, err: %s", res, err)

	if err == nil {
		t.Fatalf("Expected an error, but got %v", res)
	}

	if e2, ok := err.(*MergeError); !ok {
		t.Error("Expected an MergeError")
	} else if e2.Type() != ErrMergeUnsupported {
		t.Errorf("Expected an ErrMergeUnsupported but got %v (%v)", e2.Type(), e2)
	}
}

func TestDeepStructError(t *testing.T) {
	A := struct {
		F string
	}{"a"}
	B := struct {
		F []int
	}{[]int{2}}
	res, err := Merge(A, B)
	t.Logf("Res: %v, err: %s", res, err)

	if err == nil {
		t.Fatalf("Expected an error, but got %v", res)
	}

	if e2, ok := err.(*MergeError); !ok {
		t.Error("Expected an MergeError")
	} else if e2.Type() != ErrMergeUnsupported {
		t.Errorf("Expected an ErrMergeUnsupported but got %v (%v)", e2.Type(), e2)
	}
}

func TestStructInvalidFields(t *testing.T) {
	// Expect ErrInvalidFields
	//
	// sf := []reflect.StructField{reflect.StructField{
	// 	Name: "F",
	// 	Type: reflect.TypeOf(nil),
	// }}
	// sT := reflect.StructOf(sf)
	// A := reflect.New(sT).Interface()
	// B := reflect.New(sT).Interface()

	// TODO: Research how to do this
	t.Skip("I have no idea how to construct a struct with an invalid field to provoke ErrInvalidFields")
}


text:
# Copyright (c) 2016 Ruslan Baratov
# All rights reserved.

# !!! DO NOT PLACE HEADER GUARDS HERE !!!

include(hunter_add_version)
include(hunter_cacheable)
include(hunter_cmake_args)
include(hunter_configuration_types)
include(hunter_download)
include(hunter_pick_scheme)

hunter_add_version(
    PACKAGE_NAME
    libpcre
    VERSION
    "8.41"
    URL
    "https://ftp.exim.org/pub/pcre/pcre-8.41.tar.bz2"
    SHA1
    7d1f4aae4191512744a718cc2b81bcf995ec1437
)

hunter_configuration_types(libpcre CONFIGURATION_TYPES Release)
hunter_pick_scheme(DEFAULT url_sha1_autotools)

hunter_cmake_args(
    libpcre
    CMAKE_ARGS
    PKGCONFIG_EXPORT_TARGETS=libpcre;libpcrecpp;libpcreposix
    EXTRA_FLAGS=--enable-unicode-properties
)

hunter_cacheable(libpcre)
hunter_download(
    PACKAGE_NAME libpcre
    PACKAGE_INTERNAL_DEPS_ID "2"
    PACKAGE_UNRELOCATABLE_TEXT_FILES
    "lib/libpcre.la"
    "lib/libpcrecpp.la"
    "lib/libpcreposix.la"
    "lib/pkgconfig/libpcre.pc"
    "lib/pkgconfig/libpcrecpp.pc"
    "lib/pkgconfig/libpcreposix.pc"
    "bin/pcre-config"
)

repository: cpp-pm/hunter

repo_name: cpp-pm/hunter

gha_language: CMake