// File: /workspace/github_c_makefile_star2_O2/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 0x1618a
cmpl $0x0, 0x200e21(%rip)    # 0x2178a0
je 0x16c6b
leaq 0x1e3(%rip), %rdi       # 0x16c6f
callq 0xf145
movq %rax, 0x208e88(%rip)    # 0x21f920
leaq 0x209(%rip), %rdi       # 0x16ca8
callq 0xf145
movq %rax, 0x20939d(%rip)    # 0x21fe48
leaq 0x292(%rip), %rdi       # 0x16d44
callq 0xf145
movq %rax, 0x2093c2(%rip)    # 0x21fe80
leaq 0x2b7(%rip), %rdi       # 0x16d7c
callq 0xf145
movq %rax, 0x20939f(%rip)    # 0x21fe70
leaq 0x328(%rip), %rdi       # 0x16e00
callq 0xf145
movq %rax, 0x20936c(%rip)    # 0x21fe50
movq 0x209385(%rip), %rdi    # 0x21fe70
xorl %esi, %esi
callq 0xf1b1
movq 0x209357(%rip), %rdi    # 0x21fe50
xorl %esi, %esi
callq 0xf1b1
leaq 0x2fc(%rip), %rdi       # 0x16e03
callq 0xf145
movq %rax, 0x209365(%rip)    # 0x21fe78
movq %rax, %rdi
xorl %esi, %esi
callq 0xf1b1
leaq 0x35d(%rip), %rdi       # 0x16e81
callq 0xf145
movq %rax, 0x208df8(%rip)    # 0x21f928
movq %rax, %rdi
xorl %esi, %esi
callq 0xf1b1
movb $0x0, 0x2092ff(%rip)    # 0x21fe40
leaq 0x38c(%rip), %rdi       # 0x16ed4
callq 0xf145
movq %rax, 0x2092e4(%rip)    # 0x21fe38
movq %rax, %rdi
xorl %esi, %esi
callq 0xf1b1
leaq -0x1a47(%rip), %rsi     # 0x1511e
pushq $0x3
popq %rdi
callq 0xcba7
leaq -0x1a53(%rip), %rsi     # 0x15121
pushq $0x4
popq %rdi
callq 0xcba7
leaq -0x1a5f(%rip), %rsi     # 0x15124
pushq $0x1
popq %rdi
callq 0xcba7
leaq -0x1a02(%rip), %rsi     # 0x15190
pushq $0x2
popq %rdi
callq 0xcba7
leaq -0x19f9(%rip), %rsi     # 0x151a8
pushq $0x5
popq %rdi
callq 0xcba7
leaq -0x19fe(%rip), %rsi     # 0x151b2
pushq $0x6
popq %rdi
callq 0xcba7
leaq -0x19cf(%rip), %rsi     # 0x151f0
pushq $0x7
popq %rdi
callq 0xcba7
leaq -0x19b0(%rip), %rsi     # 0x1521e
pushq $0x8
popq %rdi
callq 0xcba7
leaq -0x191a(%rip), %rsi     # 0x152c3
pushq $0x9
popq %rdi
callq 0xcba7
leaq -0x190a(%rip), %rsi     # 0x152e2
pushq $0xa
popq %rdi
callq 0xcba7
leaq -0x1876(%rip), %rsi     # 0x15385
pushq $0xb
popq %rdi
callq 0xcba7
leaq -0x1388(%rip), %rsi     # 0x15882
pushq $0xf
popq %rdi
callq 0xcba7
leaq -0x136c(%rip), %rsi     # 0x158ad
pushq $0x13
popq %rdi
callq 0xcba7
leaq -0x130c(%rip), %rsi     # 0x1591c
pushq $0x14
popq %rdi
callq 0xcba7
leaq -0x1147(%rip), %rsi     # 0x15af0
xorl %edi, %edi
callq 0xcba7
leaq -0xfd1(%rip), %rsi      # 0x15c74
pushq $0x18
popq %rdi
callq 0xcba7
leaq -0xc3a(%rip), %rsi      # 0x1601a
pushq $0x19
popq %rdi
callq 0xcba7
leaq -0x1d49(%rip), %rsi     # 0x14f1a
pushq $0x1c
popq %rdi
callq 0xcba7
xorl %eax, %eax
popq %rcx
retq