$B$3$N>O$NL\
$BA0JG(B:$BBh(B3$B>O(B $BA4HL$K$b$I$k(B
$BO(B I-right/V$BFH<+$N5!G=$K$9$9$`(B

$BBh(B5$B>O(B ITRON$B3HD%5!G=(B

5.1 $B3HD%5!G=0lMw(B

$B?75,DI2C%7%9%F%`%3!<%k(B


        ER vend_exc(void);
        ER vdis_fex(ID tskid, UINT fexcmsk);
        ER vena_fex(ID tskid, UINT fexcmsk);
        ER vdef_fex(ID tskid, FP fexchdr);
        ER vras_fex(ID tskid, INT fexcode);
        ER vdef_brk(FN s_fncd, FP brkhdr);

        ER vdis_wai(ID tskid, UINT waitptn, UINT *tskwait);
        ER vena_wai(ID tskid);

        ER vchg_slt(ID tskid, INT slicetime);

        ER vinf_tsk(T_INFTSK *pk_inftsk, ID tskid, BOOL clr);

        ER vset_tev(ID tskid, INT tskevt);
        ER vwai_tev(INT tevmsk, TMO tmout);

        ER veif_tsk(VP *oldinf, VP newinf, ID tskid);

        ER vref_svc(T_RSVC* pk_rsvc, FN s_fncd);

        ER vpget_bks(VP *p_bks, VP *p_grp, INT nblk, UINT atr);
        ER vrel_bks(VP *p_grp, VP bks);
        ER vatr_bks(UINT *p_atr, VP bks);
        ER vref_bks(T_RBKS *pk_rbks);

        ER vset_pow( UINT pwmode );

        ER vget_otm(SYSTIME *pk_tim);

$B9=B$BN!?Dj5A$NDI2C!?JQ99(B

        typedef struct t_rtsk {
                VP      exinf;          /* $B3HD%>pJs(B                     */
                PRI     tskpri;         /* $B8=:_$NM%@hEY(B                 */
                UINT    tskstat;        /* $B%?%9%/>uBV(B                   */
                UINT    tskwait;        /* $BBT$AMW0x(B                     */
                ID      wid;            /* $BBT$A%*%V%8%'%/%H(BID           */
                INT     wupcnt;         /* $B5/>2MW5a%-%e!<%$%s%0?t(B       */
                INT     suscnt;         /* SUSPEND$BMW5a%M%9%H?t(B          */
    $B"*(B          UINT    waitmask;       /* $B6X;_BT$AMW0x(B                 */
    $B"*(B          INT     slicetime;      /* $B%9%i%$%9%?%$%`(B               */
    $B"*(B          UINT    fexcmsk;        /* $B6/@)Nc30%S%C%H%^%9%/(B         */
    $B"*(B          UINT    tskevent;       /* $B%?%9%/%$%Y%s%HH/@8>uBV(B       */
        } T_RTSK;

    $B"*(B          TTW_EV1 0x01000000      /* $B%?%9%/%$%Y%s%H(B#1$BBT$A(B         */
    $B"*(B          TTW_EV2 0x02000000      /* $B%?%9%/%$%Y%s%H(B#2$BBT$A(B         */
    $B"*(B          TTW_EV3 0x04000000      /* $B%?%9%/%$%Y%s%H(B#3$BBT$A(B         */
    $B"*(B          TTW_EV4 0x08000000      /* $B%?%9%/%$%Y%s%H(B#4$BBT$A(B         */
    $B"*(B          TTW_EV5 0x10000000      /* $B%?%9%/%$%Y%s%H(B#5$BBT$A(B         */
    $B"*(B          TTW_EV6 0x20000000      /* $B%?%9%/%$%Y%s%H(B#6$BBT$A(B         */
    $B"*(B          TTW_EV7 0x40000000      /* $B%?%9%/%$%Y%s%H(B#7$BBT$A(B         */
    $B"*(B          TTW_EV8 0x80000000      /* $B%?%9%/%$%Y%s%H(B#8$BBT$A(B         */

    $B"*(B  typedef struct t_inftsk {
    $B"*(B          UINT    stime;          /* $B%7%9%F%`%?%$%`%+%&%s%?(B       */
    $B"*(B          UINT    utime;          /* $B%f!<%6%?%$%`%+%&%s%?(B         */
    $B"*(B  } T_INFTSK;

        typedef struct t_rsem {
                VP      exinf;          /* $B3HD%>pJs(B                     */
                BOOL_ID wtsk;           /* $BBT$A%?%9%/$NM-L5(B             */
                INT     semcnt;         /* $B8=:_$N%;%^%U%)%+%&%s%HCM(B     */
    $B"*(B          ID      gtsk;           /* $B%m%C%/7?%;%^%U%)3MF@%?%9%/(BID */
        } T_RSEM;

    $B"*(B          TA_LOCKSEM 0x00010000   /* $B%m%C%/7?%;%^%U%)$r;XDj(B       */

        typedef struct t_rsys {
                INT     sysstat;        /* $B%7%9%F%`>uBV(B                 */
                ID      runtskid;       /* $BuBV$K$"$k%?%9%/$N(B ID    */
                ID      schedtskid;     /* $BuBV$K$9$Y$-%?%9%/$N(BID   */
    $B"*(B          INT     cpuload;        /* $B%7%9%F%`$N%m!<%I(B(0-10000)    */
        } T_RSYS;

    $B"*(B  typedef struct t_rcfg {
    $B"*(B      INT     timer_period;         /* $B%?%$%^!<3d9~4V3V(B (ms) */
    $B"*(B      INT     default_slice_time;   /* $B%G%U%)%k%HO"B3uBV$X0\9T(B */
    $B"*(B  #define TPW_DISLOWPOW   2       /* $BDc>CHqEENO%b!<%I@ZBX6X;_(B */
    $B"*(B  #define TPW_ENALOWPOW   3       /* $BDc>CHqEENO%b!<%I@ZBX5v2D(B */

$B%(%i!<%3!<%I$NDI2C(B

    $B"*(B          EV_DISWAI     (-226)    /* $BBT$A6X;_$K$h$kBT$A2r=|(B       */
    $B"*(B          EV_LOCKSEM    (-227)    /* $B%m%C%/7?%;%^%U%)$NIT@5A`:n(B   */

5.2 $B3HD%(BSVC$B%O%s%I%i5!G=%3!<%I(B

$B3HD%(B SVC $B$N5!G=%3!<%I$N2<0L(B 8 $B%S%C%H$N$_$r3HD%(B SVC $BHV9f$H$9$k!#(B $B;D$j$N>e0L%S%C%H$OG$0U$K;HMQ$G$-$k!#(B $B$?$@$7!":G>e0L%S%C%H(B ( MSB ) $B$O(B 0 $B$G$J$1$l$P$J$i$J$$!#(B $B5!G=%3!<%I$r3HD%(B SVC $B%O%s%I%i$X$N%Q%i%a!<%?$H$7$FDI2C$9$k!#(B

    i386 $B$N>l9g(B
        ER svchdr( VP para, FN s_fncd )

5.3 $B3HD%(BSVC$B%O%s%I%i;2>H5!G=(B

    ER vref_svc(T_RSVC* pk_rsvc, FN s_fncd)

s_fncd$B$G<($93HD%(BSVC$B$,Dj5A$5$l$F$$$l$P!"(B $B$=$NDj5A>pJs$r(B *pk_rsvc $B$XJV$9!#(B

5.4 $B%i%&%s%I%m%S%s%9%1%8%e!<%j%s%0(B

$BF10lM%@hEY$N%?%9%/$O%i%&%s%I%m%S%s%9%1%8%e!<%j%s%0$r9T$&!#(B $B%?%9%/Kh$K@_Dj$5$l$k:GBg3d$jEv$F%?%$%`(B(slicetime)$B$r7P2a$9$k$H!"(B $B<+F0E*$K$=$NM%@hEY$N%l%G%#%-%e!<$N:G8e$K2s$5$l$k!#(B

$B%?%9%/@8@.;~$J$I5Y;_(B(DORMANT)$B>uBV$K$J$k$H$-!"(B $B%G%U%)%k%HCM$H$7$F(B slicetime = 0 $B$,@_Dj$5$l$k!#(B

slicetime = 0 $B$N%?%9%/$O%i%&%s%I%m%S%s$H$J$i$:!"(B FCFS(First Come First Service) $BJ}<0$G%9%1%8%e!<%j%s%0$5$l$k!#(B

    ER vchg_slt(ID tskid, INT slicetime)

slicetime ($BC10L%_%jIC(B)$B$r@_Dj$9$k!#(B

    tskid     : TSK_SELF $B2D(B
    slicetime : < 0 $B$O%(%i!<(B

ref_tsk() $B$K$h$j8=:_$N(B slicetime $B$,;2>H2DG=!#(B (T_RTSK $B$K(B slicetime $B$rDI2C(B)

ref_cfg() $B$K$h$j%G%U%)%k%H$N(B slicetime (default_slice_time) $B$,;2>H2DG=(B (T_RCFG $B$K%U%#!<%k%IDI2C(B)$B!#(B

5.5 $B%?%9%/%$%Y%s%HBT$A5!G=(B

$B%?%9%/$K8GM-$J%$%Y%s%H$r(B8$B8DMQ0U$7!"(B $B$=$N8D!9$N%$%Y%s%H$KBP$7$F(B slp_tsk() $B!A(B wup_tsk() $B$HF1MM$JC1=c$J%?%9%/$NF14|5!G=$r%5%]!<%H$9$k!#(B

    ER vwai_tev(INT tevmsk, TMO tmout)

tevmsk $B$G;XDj$7$?!"(B $B$$$:$l$+$N%?%9%/%$%Y%s%H(B(tskevt = 1$B!A(B8)$B$NH/@8$rBT$D!#(B $B%$%Y%s%H$NH/@8$^$?$O%?%$%`%"%&%H$GBT$A$,2r=|$5$l$k!#(B tevmsk $B$O!"(B1 << (tskevt-1) $B$GI=$o$9%S%C%HCM$N(B OR $B$G;XDj$9$k!#(B $B%j%?!<%s;~$K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]|[TTW_SEM]|
    [TTW_MBX]|[TTW_SMBF]|[TTW_MBF]|[TTW_CAL]|[TTW_ACP]|
    [TTW_RDV]|[TTW_MPL ]|[TTW_MPF]|[TTW_PIS]|[TTW_EV1$B!A(BTTW_EV8]
$B"((B
TTW_RDV $B$O(B TTW_CAL $B$H6&$K;XDj$7$J$/$F$O$$$1$J$$!#(B

$B%?%9%/$KBP$7$F@_Dj$5$l$F$$$k6X;_BT$A>uBV$O!"(B ref_tsk() $B$G;2>H2DG=(B (T_RTSK $B$K(B waitmask $B$rDI2C(B)

$B3HD%(B SVC $B=hM}Cf$K@_Dj$5$l$?6X;_BT$A>uBV$O!"(B $B3HD%(B SVC $B$N=hM}8e$K85$N>uBV$KLa$k!#(B

    ER vdis_wai(ID tskid, UW waitptn, UW *tskwait)

tskid $B$G<($5$l$?%?%9%/$KBP$7$F!"(B waitptn $B$G;XDj$7$?BT$A$r6X;_$9$k!#(B $B%?%9%/$,$9$G$K(B waitptn $B$K4^$^$l$kMW0x$GBT$A$KF~$C$F$$$k>l9g$OBT$A$r6/@)2r=|$9$k!#(B $B$3$N%7%9%F%`%3!<%k$K$h$j!"(B $B%?%9%/$N(B waitmask = waitptn $B$H$J$k!#(B

tskid :
TSK_SELF $B2D(B
waitptn :
$B6X;_$9$kBT$AMW0x$N%Q%?!<%s(B ( TTW_* $B$NAH$_9g$o$;(B )
*tskwait :
$B$3$N8F$S=P$7$K$h$C$FBT$A>uBV$N6X;_$N=hM}$,9T$o$l$?D>8e$N%?%9%/$NBT$AMW0x$,@_Dj$5$l$k!#(B $BBT$A$KF~$C$F$$$J$$>l9g(B 0 $B$,@_Dj$5$l$k!#(B 0 $B0J30$N>l9g!"%?%9%/$O(B waitmask $B$K$O4^$^$l$J$$BT$AMW0x$GBT$A>uBV$K$J$C$F$$$k!#(B ref_tsk() $B$GF@$i$l$k(B tskwait $B$HF1$G$"$k!#(B
($BNc(B)
mail protected])A0$N%i%s%G%V$OBT$A$r6/@)2r=|$7$?$$$,!"(B $B%i%s%G%[email protected])8e$OBT$A$N6/@)2r=|$O9T$$$?$/$J$$>l9g!#(B
  vdis_wai(tskid, TTW_CAL, &taskwait);
$B$9$G$K%i%s%G%V$,@.N)$7$F$$$k>l9g!"(Btaskwait $B$K$O(B TTW_RDV $B$,@_Dj$5$l$k!#(B
    ER vena_wai(ID tskid)

tskid $B$G<($5$l$?%?%9%/$KBP$7$F!"BT$A$r5v2D$9$k!#(B $B$3$N%7%9%F%`%3!<%k$K$h$j!"(B $B%?%9%/$N(B waitmask = 0 $B$H$J$k!#(B

    tskid : TSK_SELF $B2D(B

5.7 $B%?%9%/6/@)Nc305!G=(B

$B%?%9%/6/@)Nc30$O!"(B $BNc30$,H/@8$7$?%?%9%/$N%3%s%F%-%9%H$G!"(B $B$+$D%?%9%/@8@.;~$K;XDj$7$?J]8n%l%Y%k(B($B%j%s%0(B)$B$G!"(B $B6/@)Nc30%O%s%I%i$r

$B6/@)Nc30$K$O!"(B0$B!A(B31 $B$N(B 32 $B$N(B 1$B!A(B31 $B$H$O0[$J$kFCD'$r;}$D!#(B

$BNc30%3!<%I(B 1$B!A(B31
$BNc30%3!<%I(B 0 ($BI|5"ITG=Nc30(B)

$B%?%9%/@8@.;~$NJ]8n%l%Y%k(B($B%j%s%0(B)$B$,(B TA_RNG0 $B$N%?%9%/$KBP$7$F!"6/@)Nc30$r;HMQ$9$k$3$H$O=PMh$J$$!#(B

    ER vdef_brk(FN s_fncd, FP brkhdr)

$B3HD%(BSVC$B$N%V%l!<%/4X?t$rDj5A$9$k!#(B $B3HD%(BSVC$B$,L$EPO?$N;~$O%(%i!<$H$J$k!#(B $B4{$KDj5A$5$l$F$$$?>l9g$O!"8e$+$iDj5A$7$?4X?t$,M-8z$H$J$k!#(B brkhdr == NADR $B$N;~$ODj5A$r2r=|$9$k!#(B

brkhdr() $B$O(B TA_HLNG $B$N$_!#(B PIC $B$*$h$S(B PID (Position Independent Code/Data) $BBP1~$N>l9g$K$O!"(B s_fncd$B$N3HD%(BSVC$B$rDj5A(B(def_svc) $B$7$?;~$K;XDj$7$?%Y!<%9%"%I%l%9$,!"(B $B9b5i8@8lBP1~%k!<%A%s$G@_Dj$5$l$k!#(B

    VOID    brkhdr(ID tskid)
    {
            /* taskid  : $BBP>]%?%9%/(BID */
    }
    ER vdef_fex(ID tskid, FP fexchdr)

$B;XDj$7$?%?%9%/$KBP$7$F6/@)Nc30%O%s%I%i$rDj5A$9$k!#(B $B6/@)Nc30%O%s%I%i$O%?%9%/$KBP$7$F(B 1 $B$D$N$_Dj5A2DG=$G!"(B $B4{$KDj5A$5$l$F$$$?>l9g$O!"8e$+$iDj5A$7$?4X?t$,M-8z$H$J$k!#(B exchdr == NADR $B$N;~$ODj5A$r2r=|$9$k!#(B

$B%Z%s%G%#%s%0$N6/@)Nc30MW5a$O%/%j%"$5$l!"(B $B$9$Y$F$N6/@)Nc30$O6X;_>uBV$H$J$k!#(B

$B6/@)Nc30%O%s%I%i$O!"(Btskid $B$N%?%9%/$N%3%s%F%-%9%H$G@\(B fexchdr() $B$,8F$S=P$5$l$k$+H]$+$O!"(B $B%$%s%W%j%a%s%H$K0MB8$9$k!#(B $B%$%s%W%j%a%s%H$K$h$C$F$O!"(B $B$=$N%$%s%W%j%a%s%H8GM-$N%(%s%H%j!<%k!<%A%s$r;}$DI,MW$,$"$k(B ($B3F(BCPU $B$N%$%s%W%j%a%s%H$K4X$9$k%I%-%e%a%s%H$r;2>H$N$3$H(B)$B!#(B

PIC $B$*$h$S(B PID (Position Independent Code/Data) $BBP1~$N>l9g$K$O!"(B tskid $B$N%?%9%/$r@8@.(B(cre_tsk) $B$7$?;~$K;XDj$7$?%Y!<%9%"%I%l%9$,@_Dj$5$l$k!#(B

    VOID    fexchdr(INT fexcode)
    {
            /* fexcode : $BH/@8$7$?Nc30%3!<%I(B 0$B!A(B31 */
            $B!'!'!'!'!'(B
            /* $BNc30=hM}$N=*N;(B */
            if ( fexcode == 0 ) {
                    ext_tsk() $B$^$?$O(B exd_tsk();
            } else {
                    vend_exc();
                    return $B$^$?$O(B longjmp();
            }
    }
   ER vdis_fex(ID tskid, UINT fexcmsk)
   ER vena_fex(ID tskid, UINT fexcmsk)

$B;XDj$7$?%?%9%/$KBP$9$k6/@)Nc30(B(fexcode : 0$B!A(B31) $B$r5v2D(B/$B6X;_$9$k!#(B fexmask $B$N(B1$B$N%S%C%H$KBP1~$9$k6/@)Nc30$rBP>]$H$9$k!#(B

$B6/@)Nc30%O%s%I%i$,Dj5A$5$l$F$$$J$$$H$-$O(B E_NOEXS $B$N%(%i!<$H$J$k!#(B

$B6X;_$5$l$?6/@)Nc30$NH/@8$O40A4$KL5;k$5$l$k!#(B

$B6/@)Nc30$N5v2D(B/$B6X;_>uBV$O(B ref_tsk() $B$GT_RTSK $B$K(B fexcmsk $B$rDI2C(B)$B!#(B fexcmsk $B$O(B $B%S%C%HC10L$N%^%9%/(B(0:LSB $B!A(B 31:MSB) $B$G(B0$B$G6X;_!"(B1$B$G5v2D!#(B

    ER vras_fex(ID tskid, INT fexcode)

$B;XDj$7$?%?%9%/$KBP$7$F6/@)Nc30(B (fexcode : 0$B!A(B31)$B$rH/@8$5$;$k!#(B

$B%?%9%/$,3HD%(BSVC$B$d(BSVC$B$r

$B%?%9%/$,6/@)Nc30%O%s%I%i$rl9g$O!"(B vend_exc() $B$,l9g$O%Z%s%G%#%s%0$5$l$:!"(B $B%M%9%H$7$F6/@)Nc30%O%s%I%i$,

$B%?%9%/$,3HD%(BSVC$B$rl9g$O!"(B $B%V%l!<%/4X?t$r

$B%?%9%/$K6/@)Nc30MW5a$,%Z%s%G%#%s%0$5$l$F$$$k;~$O!"(B $B%?%9%/$,3HD%(BSVC$B$r

    ER vend_exc()

$BNc30%O%s%I%i$r=*N;$7!"?7$?$J6/@)Nc30$NH/@8$r5v2D$9$k!#(B

$B%Z%s%G%#%s%0$5$l$F$$$k6/@)Nc30$,$"$k>l9g$K$O!"(B $B6/@)Nc30%O%s%I%i$,l9g$K$O!"(B $BNc30%3!<%I$N:G$b>.$5$$$b$N$,M%@h$5$l$k!#(B

$BNc30%3!<%I(B0$B$NNc30%O%s%I%i$O!"(Bvend_exc() $B$r8F$S=P$9$3$H$O=PMh$J$$!#(B $BNc30%3!<%I(B0$B$N6/@)Nc30%O%s%I%i$O!"(B ext_tsk() $B$^$?$O(B exd_tsk() $B$K$h$C$F%?%9%/$r=*N;$7$J$1$l$P$J$i$J$$!#(B

5.8 $B%?%9%/E}7W>pJs(B

$B%?%9%/$, $B%?%$%^!<3d$j9~$_$4$H$KF0:n$7$F$$$?%?%9%/$r%+%&%s%H$9$k4J0WE*$JJ}K!!#(B $B$=$N;~$N%7%9%F%`%b!<%I$K$h$j%f!<%6$+%7%9%F%`$+$r6hJL$9$k!#(B

    ER vinf_tsk(T_INFTSK *inf, ID tskid, BOOL clr)

tskid $B$N%?%9%/$NE}7W>pJs$rclr == TRUE $B$N;~$O!"(B $BE}7W>pJs$r

    typedef struct {
            UINT    stime;  /* $B%7%9%F%`

$B"((B $B%7%9%F%`%b!<%I(B

$B%?%9%/$,%7%9%F%`%*%V%8%'%/%H$K%"%/%;%9$G$-$k>uBV$N$H$-(B $B!V%7%9%F%`!W!"(B $B%7%9%F%`%*%V%8%'%/%H$K%"%/%;%9$9$k$H(B E_OACV $B%(%i!<$K$J$k>uBV$N$H$-!V%f!<%6!

5.9 $B%7%9%F%`%m!<%I$N

$B%7%9%F%`$N(BCPU$B%m!<%I$r7WB,$9$k!#(B
$B%?%$%^!<3d$j9~$_$4$H$K2?$b%?%9%/$,F0:n$7$F$$$J$$>l9g$r%+%&%s%H$7!"(B $B$=$N%+%&%s%HCM$HA4BN;~4V$+$i(BCPU$B%m!<%I$r5a$a$k4J0WE*$JJ}K!$G$"$k!#(B

    T_RSYS $B$K(B cpuload $B$rDI2C(B
        cpuload :  0 $B!A(B 10000 $B$NCM$G!"(B10000 $B$O(B 100 % $B$r0UL#$9$k!#(B

ref_sys()$B$G!"(B $BA02s$N(B ref_sys() $B8F$S=P$70J9_$N(BCPU$B%m!<%I$r $BA02s$N(B ref_sys() $B$+$i(B 2^32 ms $B0J>e$N4V3V$r$"$1$k$H!"(B $B$=$N7k2L$OJ]>Z$5$l$J$$!#(B

5.10 $B%i%s%G%V$NM%@hEYBT$A(B

cre_por $B$N(B poratr $B$N;XDj$K$*$$$F0J2<$r%5%]!<%H$9$k!#(B

    TA_TPRI         H'0...01        $B8F=PBT$A%?%9%/$,%?%9%/M%@hEY=g(B

5.11 $B%m%C%/7?%;%^%U%)(B

$B%?%9%/=*N;;~$K<+F0E*$K%m%C%/$r2rJ|$9$k%m%C%/7?%;%^%U%)5!G=!#(B

    $B%;%^%U%)B0@-$H$7$F!"0J2<$rDI2C(B

    TA_LOCKSEM              0x00010000

TA_LOCKSEM $B$N>l9g$NF0:n!'(B

ref_sem() $B$K$h$j!"(B $B%m%C%/7?%;%^%U%)$r3MF@$7$F$$$k%?%9%/$N(B ID $B$rCN$k$3$H$,$G$-$k!#(B

    typedef struct t_rsem {
            VP      exinf;          /* $B3HD%>pJs(B */
            BOOL_ID wtsk;           /* $BBT$A%?%9%/$NM-L5(B */
            INT     semcnt;         /* $B8=:_$N%;%^%U%)%+%&%s%HCM(B */
            ID      gtsk;           /* $B%m%C%/7?%;%^%U%)3MF@%?%9%/(B ID */
    } T_RSEM;

gtsk $B$O%m%C%/7?%;%^%U%)$N>l9g$N$_M-8z$G!"(B $B$=$l0J30$N>l9g$O>o$K(B0$B$rJV$9!#(B

5.12 $B%?%9%/3HD%>pJs$NJQ995!G=(B

$B%?%9%/$N3HD%>pJs(B (exinf)$B$rJQ99$9$k5!G=$G$"$k!#(B

    ER veif_tsk(VP *oldinf, VP newinf, ID tskid)

$B;XDj$7$?%?%9%/$N(B exinf $B$r(B *oldinf $B$Kexinf $B$NCM$r(B newinf $B$NCM$KJQ99$9$k!#(B

    oldinf == NADR $B$N;~$O

5.13 $B%"%i!<%`%O%s%I%i(B

$B%"%i!<%`%O%s%I%i$N

vdef_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