// File: /workspace/github_c_makefile_star2_O1/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 0x16fa7
cmpl $0x0, 0x200007(%rip)    # 0x2178a0
je 0x17aa7
leaq 0x205(%rip), %rdi       # 0x17aab
callq 0xf8d7
movq %rax, 0x20806e(%rip)    # 0x21f920
leaq 0x230(%rip), %rdi       # 0x17ae9
callq 0xf8d7
movq %rax, 0x208583(%rip)    # 0x21fe48
leaq 0x2b9(%rip), %rdi       # 0x17b85
callq 0xf8d7
movq %rax, 0x2085a8(%rip)    # 0x21fe80
leaq 0x2de(%rip), %rdi       # 0x17bbd
callq 0xf8d7
movq %rax, 0x208585(%rip)    # 0x21fe70
leaq 0x34f(%rip), %rdi       # 0x17c41
callq 0xf8d7
movq %rax, 0x208552(%rip)    # 0x21fe50
movq 0x20856b(%rip), %rdi    # 0x21fe70
xorl %esi, %esi
callq 0xf953
movq 0x20853d(%rip), %rdi    # 0x21fe50
xorl %esi, %esi
callq 0xf953
leaq 0x323(%rip), %rdi       # 0x17c44
callq 0xf8d7
movq %rax, 0x20854b(%rip)    # 0x21fe78
movq %rax, %rdi
xorl %esi, %esi
callq 0xf953
leaq 0x386(%rip), %rdi       # 0x17cc4
callq 0xf8d7
movq %rax, 0x207fde(%rip)    # 0x21f928
movq %rax, %rdi
xorl %esi, %esi
callq 0xf953
movb $0x0, 0x2084e5(%rip)    # 0x21fe40
leaq 0x3b5(%rip), %rdi       # 0x17d17
callq 0xf8d7
movq %rax, 0x2084ca(%rip)    # 0x21fe38
movq %rax, %rdi
xorl %esi, %esi
callq 0xf953
leaq -0x1adf(%rip), %rsi     # 0x15ea0
movl $0x3, %edi
callq 0xd08c
leaq -0x1aed(%rip), %rsi     # 0x15ea3
movl $0x4, %edi
callq 0xd08c
leaq -0x1afb(%rip), %rsi     # 0x15ea6
movl $0x1, %edi
callq 0xd08c
leaq -0x1a98(%rip), %rsi     # 0x15f1a
movl $0x2, %edi
callq 0xd08c
leaq -0x1a91(%rip), %rsi     # 0x15f32
movl $0x5, %edi
callq 0xd08c
leaq -0x1a95(%rip), %rsi     # 0x15f3f
movl $0x6, %edi
callq 0xd08c
leaq -0x1a63(%rip), %rsi     # 0x15f82
movl $0x7, %edi
callq 0xd08c
leaq -0x1a43(%rip), %rsi     # 0x15fb3
movl $0x8, %edi
callq 0xd08c
leaq -0x19ac(%rip), %rsi     # 0x1605b
movl $0x9, %edi
callq 0xd08c
leaq -0x199b(%rip), %rsi     # 0x1607d
movl $0xa, %edi
callq 0xd08c
leaq -0x1909(%rip), %rsi     # 0x16120
movl $0xb, %edi
callq 0xd08c
leaq -0x13fd(%rip), %rsi     # 0x1663d
movl $0xf, %edi
callq 0xd08c
leaq -0x13de(%rip), %rsi     # 0x1666d
movl $0x13, %edi
callq 0xd08c
leaq -0x137d(%rip), %rsi     # 0x166df
movl $0x14, %edi
callq 0xd08c
leaq -0x11b0(%rip), %rsi     # 0x168bd
xorl %edi, %edi
callq 0xd08c
leaq -0x1036(%rip), %rsi     # 0x16a45
movl $0x18, %edi
callq 0xd08c
leaq -0xc7b(%rip), %rsi      # 0x16e11
movl $0x19, %edi
callq 0xd08c
leaq -0x1e4c(%rip), %rsi     # 0x15c51
movl $0x1c, %edi
callq 0xd08c
xorl %eax, %eax
popq %rcx
retq