// File: /workspace/github_c_makefile_star2_O3/schroeder-lvb[P]sissm/src/piantirush.c
// Function: piantirushInstallPlugin
int piantirushInstallPlugin( void )
{
    // Read the plugin-specific variables from the .cfg file 
    // 
    piantirushInitConfig();

    // if plugin is disabled in the .cfg file then do not activate
    //
    if ( piantirushConfig.pluginState == 0 ) return 0;

    // Setup alarms
    //
    aPtr  = alarmCreate( _normalSpeedAlarmCB );
    dPtr  = alarmCreate( _rulesAlarmCB );
    wPtr  = alarmCreate( _notifyNoDestroyCB );

    rPtr  = alarmCreate( _earlyDestroyReqCB );
    tPtr  = alarmCreate( _earlyTerritorialCB );    // Territorial Rush trap [TRUSH]
    alarmReset( rPtr, 0L );
    alarmReset( tPtr, 0L );

    bPtr = alarmCreate( _earlyBreachReqCB );
    alarmReset( bPtr, 0L );

    xPtr = alarmCreate( _trainingModeReminderCB );
    alarmReset( xPtr, 0L );

    kickArmed = 0;

    sPtr = alarmCreate( _closeBotSpawnWindowCB );  // bot spawnkill window timer
    alarmReset( sPtr, 0L );


    // Install Event-driven CallBack hooks so the plugin gets
    // notified for various happenings.  A complete list is here,
    // but comment out what is not needed for your plug-in.
    // 
    eventsRegister( SISSM_EV_CLIENT_ADD,           piantirushClientAddCB );
    eventsRegister( SISSM_EV_CLIENT_DEL,           piantirushClientDelCB );
    eventsRegister( SISSM_EV_INIT,                 piantirushInitCB );
    eventsRegister( SISSM_EV_RESTART,              piantirushRestartCB );
    eventsRegister( SISSM_EV_MAPCHANGE,            piantirushMapChangeCB );
    eventsRegister( SISSM_EV_GAME_START,           piantirushGameStartCB );
    eventsRegister( SISSM_EV_GAME_END,             piantirushGameEndCB );
    eventsRegister( SISSM_EV_ROUND_START,          piantirushRoundStartCB );
    eventsRegister( SISSM_EV_ROUND_END,            piantirushRoundEndCB );
    eventsRegister( SISSM_EV_OBJECTIVE_CAPTURED,   piantirushCapturedCB );
    eventsRegister( SISSM_EV_PERIODIC,             piantirushPeriodicCB );
    eventsRegister( SISSM_EV_SIGTERM,              piantirushSigKillCB );
    eventsRegister( SISSM_EV_OBJECT_SYNTH,         piantirushObjectSynth );
    eventsRegister( SISSM_EV_CACHE_DESTROY,        piantirushCacheDestroyed );
    eventsRegister( SISSM_EV_CHAT,                 piantirushChatCB     );

    eventsRegister( SISSM_EV_BP_TOUCHED_OBJ,       piantirushObjTouchCB );
    eventsRegister( SISSM_EV_BP_UNTOUCHED_OBJ,     piantirushObjUntouchCB );

    eventsRegister( SISSM_EV_ACTIVITY,             piantirushActivityCB );

    return 0;
}

// Assembly:
pushq %rax
callq 0x171ba
cmpl $0x0, 0x1ffdf4(%rip)    # 0x2178a0
je 0x17cba
leaq 0x205(%rip), %rdi       # 0x17cbe
callq 0xfc23
movq %rax, 0x207e5b(%rip)    # 0x21f920
leaq 0x230(%rip), %rdi       # 0x17cfc
callq 0xfc23
movq %rax, 0x208370(%rip)    # 0x21fe48
leaq 0x2b9(%rip), %rdi       # 0x17d98
callq 0xfc23
movq %rax, 0x208395(%rip)    # 0x21fe80
leaq 0x2de(%rip), %rdi       # 0x17dd0
callq 0xfc23
movq %rax, 0x208372(%rip)    # 0x21fe70
leaq 0x34f(%rip), %rdi       # 0x17e54
callq 0xfc23
movq %rax, 0x20833f(%rip)    # 0x21fe50
movq 0x208358(%rip), %rdi    # 0x21fe70
xorl %esi, %esi
callq 0xfc98
movq 0x20832a(%rip), %rdi    # 0x21fe50
xorl %esi, %esi
callq 0xfc98
leaq 0x323(%rip), %rdi       # 0x17e57
callq 0xfc23
movq %rax, 0x208338(%rip)    # 0x21fe78
movq %rax, %rdi
xorl %esi, %esi
callq 0xfc98
leaq 0x386(%rip), %rdi       # 0x17ed7
callq 0xfc23
movq %rax, 0x207dcb(%rip)    # 0x21f928
movq %rax, %rdi
xorl %esi, %esi
callq 0xfc98
movb $0x0, 0x2082d2(%rip)    # 0x21fe40
leaq 0x3b5(%rip), %rdi       # 0x17f2a
callq 0xfc23
movq %rax, 0x2082b7(%rip)    # 0x21fe38
movq %rax, %rdi
xorl %esi, %esi
callq 0xfc98
leaq -0x1aa5(%rip), %rsi     # 0x160ed
movl $0x3, %edi
callq 0xd40c
leaq -0x1ab3(%rip), %rsi     # 0x160f0
movl $0x4, %edi
callq 0xd40c
leaq -0x1ac1(%rip), %rsi     # 0x160f3
movl $0x1, %edi
callq 0xd40c
leaq -0x1a5e(%rip), %rsi     # 0x16167
movl $0x2, %edi
callq 0xd40c
leaq -0x1a57(%rip), %rsi     # 0x1617f
movl $0x5, %edi
callq 0xd40c
leaq -0x1a5b(%rip), %rsi     # 0x1618c
movl $0x6, %edi
callq 0xd40c
leaq -0x1a29(%rip), %rsi     # 0x161cf
movl $0x7, %edi
callq 0xd40c
leaq -0x1a09(%rip), %rsi     # 0x16200
movl $0x8, %edi
callq 0xd40c
leaq -0x1972(%rip), %rsi     # 0x162a8
movl $0x9, %edi
callq 0xd40c
leaq -0x1961(%rip), %rsi     # 0x162ca
movl $0xa, %edi
callq 0xd40c
leaq -0x18cf(%rip), %rsi     # 0x1636d
movl $0xb, %edi
callq 0xd40c
leaq -0x13cb(%rip), %rsi     # 0x16882
movl $0xf, %edi
callq 0xd40c
leaq -0x13ac(%rip), %rsi     # 0x168b2
movl $0x13, %edi
callq 0xd40c
leaq -0x134b(%rip), %rsi     # 0x16924
movl $0x14, %edi
callq 0xd40c
leaq -0x117e(%rip), %rsi     # 0x16b02
xorl %edi, %edi
callq 0xd40c
leaq -0x1004(%rip), %rsi     # 0x16c8a
movl $0x18, %edi
callq 0xd40c
leaq -0xc60(%rip), %rsi      # 0x1703f
movl $0x19, %edi
callq 0xd40c
leaq -0x1df1(%rip), %rsi     # 0x15ebf
movl $0x1c, %edi
callq 0xd40c
xorl %eax, %eax
popq %rcx
retq