// File: /workspace/github_c_makefile_star2_O1/schroeder-lvb[P]sissm/src/pigreetings.c
// Function: pigreetingsInitConfig
int pigreetingsInitConfig( void )
{
    cfsPtr cP;

    cP = cfsCreate( sissmGetConfigPath() );

    // read "pigreetings.pluginstate" variable from the .cfg file
    //
    pigreetingsConfig.pluginState = (int) cfsFetchNum( cP, "pigreetings.pluginState", 0.0 );  // disabled by default

    // read the connection/disconnection display enabler
    // if maskdisconnsec is nonzero, the disconnect notices are masked for 'n' seconds after round-end
    //
    pigreetingsConfig.showConnDisconn = (int) cfsFetchNum( cP, "pigreetings.showconndisconn", 1.0 );
    pigreetingsConfig.maskdisconnsec  = (int) cfsFetchNum( cP, "pigreetings.maskdisconnsec",  0.0 );

    // read the 2-line greeting messages
    // 
    strlcpy( pigreetingsConfig.serverGreetings[0], cfsFetchStr( cP, "pigreetings.servergreetings[0]", "" ), CFS_FETCH_MAX );
    strlcpy( pigreetingsConfig.serverGreetings[1], cfsFetchStr( cP, "pigreetings.servergreetings[1]", "" ), CFS_FETCH_MAX );

    // read the rules display enabler
    //
    pigreetingsConfig.showRules       = (int) cfsFetchNum( cP, "pigreetings.showrules", 1.0 );

    // read the 10 rule lines
    // 
    strlcpy( pigreetingsConfig.serverRules[0], cfsFetchStr( cP, "pigreetings.serverrules[0]", "" ), CFS_FETCH_MAX );
    strlcpy( pigreetingsConfig.serverRules[1], cfsFetchStr( cP, "pigreetings.serverrules[1]", "" ), CFS_FETCH_MAX );
    strlcpy( pigreetingsConfig.serverRules[2], cfsFetchStr( cP, "pigreetings.serverrules[2]", "" ), CFS_FETCH_MAX );
    strlcpy( pigreetingsConfig.serverRules[3], cfsFetchStr( cP, "pigreetings.serverrules[3]", "" ), CFS_FETCH_MAX );
    strlcpy( pigreetingsConfig.serverRules[4], cfsFetchStr( cP, "pigreetings.serverrules[4]", "" ), CFS_FETCH_MAX );
    strlcpy( pigreetingsConfig.serverRules[5], cfsFetchStr( cP, "pigreetings.serverrules[5]", "" ), CFS_FETCH_MAX );
    strlcpy( pigreetingsConfig.serverRules[6], cfsFetchStr( cP, "pigreetings.serverrules[6]", "" ), CFS_FETCH_MAX );
    strlcpy( pigreetingsConfig.serverRules[7], cfsFetchStr( cP, "pigreetings.serverrules[7]", "" ), CFS_FETCH_MAX );
    strlcpy( pigreetingsConfig.serverRules[8], cfsFetchStr( cP, "pigreetings.serverrules[8]", "" ), CFS_FETCH_MAX );
    strlcpy( pigreetingsConfig.serverRules[9], cfsFetchStr( cP, "pigreetings.serverrules[9]", "" ), CFS_FETCH_MAX );

    // read the ads display enabler and display timing parameters
    //
    pigreetingsConfig.showAds         = (int) cfsFetchNum( cP, "pigreetings.showads", 0.0 );
    pigreetingsConfig.adsDelay        = (int) cfsFetchNum( cP, "pigreetings.adsdelay", 0.0 );
    pigreetingsConfig.adsInterval     = (int) cfsFetchNum( cP, "pigreetings.adsinterval", 0.0 );

    // read the 10 ads lines
    // 
    strlcpy( pigreetingsConfig.serverAds[0],   cfsFetchStr( cP, "pigreetings.serverads[0]", "" ),   CFS_FETCH_MAX );
    strlcpy( pigreetingsConfig.serverAds[1],   cfsFetchStr( cP, "pigreetings.serverads[1]", "" ),   CFS_FETCH_MAX );
    strlcpy( pigreetingsConfig.serverAds[2],   cfsFetchStr( cP, "pigreetings.serverads[2]", "" ),   CFS_FETCH_MAX );
    strlcpy( pigreetingsConfig.serverAds[3],   cfsFetchStr( cP, "pigreetings.serverads[3]", "" ),   CFS_FETCH_MAX );
    strlcpy( pigreetingsConfig.serverAds[4],   cfsFetchStr( cP, "pigreetings.serverads[4]", "" ),   CFS_FETCH_MAX );
    strlcpy( pigreetingsConfig.serverAds[5],   cfsFetchStr( cP, "pigreetings.serverads[5]", "" ),   CFS_FETCH_MAX );
    strlcpy( pigreetingsConfig.serverAds[6],   cfsFetchStr( cP, "pigreetings.serverads[6]", "" ),   CFS_FETCH_MAX );
    strlcpy( pigreetingsConfig.serverAds[7],   cfsFetchStr( cP, "pigreetings.serverads[7]", "" ),   CFS_FETCH_MAX );
    strlcpy( pigreetingsConfig.serverAds[8],   cfsFetchStr( cP, "pigreetings.serverads[8]", "" ),   CFS_FETCH_MAX );
    strlcpy( pigreetingsConfig.serverAds[9],   cfsFetchStr( cP, "pigreetings.serverads[9]", "" ),   CFS_FETCH_MAX );

    // read the list of incognito GUIDs
    //
    strlcpy( pigreetingsConfig.incognitoGUID, cfsFetchStr( cP, "pigreetings.incognitoGUID", "" ), CFS_FETCH_MAX );

    // read 'connected' and 'disconnected' (as in 'ZZZZ connected' for localization)
    // 
    strlcpy( pigreetingsConfig.connected, cfsFetchStr( cP, "pigreetings.connected", "connected" ), CFS_FETCH_MAX );
    strlcpy( pigreetingsConfig.disconnected, cfsFetchStr( cP, "pigreetings.disconnected", "disconnected" ), CFS_FETCH_MAX );
    strlcpy( pigreetingsConfig.connectedAsAdmin, cfsFetchStr( cP, "pigreetings.connectedasadmin", "[admin] connected" ), CFS_FETCH_MAX );

    // String 'tags' encapsulates the player names on connect/disconnect notifications, for use with color/bold codes
    // Defaults to single quote (') marks 
    // 
    strlcpy( pigreetingsConfig.connectedPrefix,         cfsFetchStr( cP, "pigreetings.connectedPrefix",         "\'" ), CFS_FETCH_MAX );
    strlcpy( pigreetingsConfig.connectedPostfix,        cfsFetchStr( cP, "pigreetings.connectedPostfix",        "\'" ), CFS_FETCH_MAX );
    strlcpy( pigreetingsConfig.connectedAsAdminPrefix,  cfsFetchStr( cP, "pigreetings.connectedAsAdminPrefix",  "\'" ), CFS_FETCH_MAX );
    strlcpy( pigreetingsConfig.connectedAsAdminPostfix, cfsFetchStr( cP, "pigreetings.connectedAsAdminPostfix", "\'" ), CFS_FETCH_MAX );
    strlcpy( pigreetingsConfig.disconnectedPrefix,      cfsFetchStr( cP, "pigreetings.disconnectedPrefix",      "\'" ), CFS_FETCH_MAX );
    strlcpy( pigreetingsConfig.disconnectedPostfix,     cfsFetchStr( cP, "pigreetings.disconnectedPostfix",     "\'" ), CFS_FETCH_MAX );

    // read round win and lose messages, set to "" to disable
    // 
    strlcpy( pigreetingsConfig.roundWinMsg,  cfsFetchStr( cP, "pigreetings.roundwinmsg",  "" ), CFS_FETCH_MAX );
    strlcpy( pigreetingsConfig.roundLoseMsg, cfsFetchStr( cP, "pigreetings.roundlosemsg", "" ), CFS_FETCH_MAX );
    strlcpy( pigreetingsConfig.roundPvPMsg,  cfsFetchStr( cP, "pigreetings.roundpvpmsg",  "" ), CFS_FETCH_MAX );

    cfsDestroy( cP );
    return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
callq 0x8969
movq %rax, %rdi
callq 0x9004
movq %rax, %rbx
leaq 0x7374(%rip), %rsi      # 0x1feb8
xorpd %xmm0, %xmm0
movq %rax, %rdi
callq 0x9276
cvttsd2si %xmm0, %eax
movl %eax, 0x21d0c6(%rip)    # 0x235c20
leaq 0x736f(%rip), %rsi      # 0x1fed0
movsd 0x24bf(%rip), %xmm0     # 0x1b028
movq %rbx, %rdi
callq 0x9276
cvttsd2si %xmm0, %eax
movl %eax, 0x21d0a9(%rip)    # 0x235c24
leaq 0x736a(%rip), %rsi      # 0x1feec
xorpd %xmm0, %xmm0
movq %rbx, %rdi
callq 0x9276
cvttsd2si %xmm0, %eax
movl %eax, 0x21d090(%rip)    # 0x235c28
leaq 0x7368(%rip), %rsi      # 0x1ff07
leaq 0x2b6b(%rip), %r14      # 0x1b711
movq %rbx, %rdi
movq %r14, %rdx
callq 0x907b
leaq 0x21d084(%rip), %rdi    # 0x235c3c
movl $0x400, %edx            # imm = 0x400
movq %rax, %rsi
callq 0xf038
leaq 0x735a(%rip), %rsi      # 0x1ff26
movq %rbx, %rdi
movq %r14, %rdx
callq 0x907b
leaq 0x21d45e(%rip), %rdi    # 0x23603c
movl $0x400, %edx            # imm = 0x400
movq %rax, %rsi
callq 0xf038
leaq 0x7353(%rip), %rsi      # 0x1ff45
movq %rbx, %rdi
movsd 0x242b(%rip), %xmm0     # 0x1b028
callq 0x9276
cvttsd2si %xmm0, %eax
movl %eax, 0x21d020(%rip)    # 0x235c2c
leaq 0x7348(%rip), %rsi      # 0x1ff5b
movq %rbx, %rdi
movq %r14, %rdx
callq 0x907b
leaq 0x21d817(%rip), %rdi    # 0x23643c
movl $0x400, %edx            # imm = 0x400
movq %rax, %rsi
callq 0xf038
leaq 0x733d(%rip), %rsi      # 0x1ff76
movq %rbx, %rdi
movq %r14, %rdx
callq 0x907b
leaq 0x21dbf1(%rip), %rdi    # 0x23683c
movl $0x400, %edx            # imm = 0x400
movq %rax, %rsi
callq 0xf038
leaq 0x7332(%rip), %rsi      # 0x1ff91
movq %rbx, %rdi
movq %r14, %rdx
callq 0x907b
leaq 0x21dfcb(%rip), %rdi    # 0x236c3c
movl $0x400, %edx            # imm = 0x400
movq %rax, %rsi
callq 0xf038
leaq 0x7327(%rip), %rsi      # 0x1ffac
movq %rbx, %rdi
movq %r14, %rdx
callq 0x907b
leaq 0x21e3a5(%rip), %rdi    # 0x23703c
movl $0x400, %edx            # imm = 0x400
movq %rax, %rsi
callq 0xf038
leaq 0x731c(%rip), %rsi      # 0x1ffc7
movq %rbx, %rdi
movq %r14, %rdx
callq 0x907b
leaq 0x21e77f(%rip), %rdi    # 0x23743c
movl $0x400, %edx            # imm = 0x400
movq %rax, %rsi
callq 0xf038
leaq 0x7311(%rip), %rsi      # 0x1ffe2
movq %rbx, %rdi
movq %r14, %rdx
callq 0x907b
leaq 0x21eb59(%rip), %rdi    # 0x23783c
movl $0x400, %edx            # imm = 0x400
movq %rax, %rsi
callq 0xf038
leaq 0x7306(%rip), %rsi      # 0x1fffd
movq %rbx, %rdi
movq %r14, %rdx
callq 0x907b
leaq 0x21ef33(%rip), %rdi    # 0x237c3c
movl $0x400, %edx            # imm = 0x400
movq %rax, %rsi
callq 0xf038
leaq 0x72fb(%rip), %rsi      # 0x20018
movq %rbx, %rdi
movq %r14, %rdx
callq 0x907b
leaq 0x21f30d(%rip), %rdi    # 0x23803c
movl $0x400, %edx            # imm = 0x400
movq %rax, %rsi
callq 0xf038
leaq 0x72f0(%rip), %rsi      # 0x20033
movq %rbx, %rdi
movq %r14, %rdx
callq 0x907b
leaq 0x21f6e7(%rip), %rdi    # 0x23843c
movl $0x400, %edx            # imm = 0x400
movq %rax, %rsi
callq 0xf038
leaq 0x72e5(%rip), %rsi      # 0x2004e
movq %rbx, %rdi
movq %r14, %rdx
callq 0x907b
leaq 0x21fac1(%rip), %rdi    # 0x23883c
movl $0x400, %edx            # imm = 0x400
movq %rax, %rsi
callq 0xf038
leaq 0x72da(%rip), %rsi      # 0x20069
xorpd %xmm0, %xmm0
movq %rbx, %rdi
callq 0x9276
cvttsd2si %xmm0, %eax
movl %eax, 0x21ce8b(%rip)    # 0x235c30
leaq 0x72d1(%rip), %rsi      # 0x2007d
xorpd %xmm0, %xmm0
movq %rbx, %rdi
callq 0x9276
cvttsd2si %xmm0, %eax
movl %eax, 0x21ce72(%rip)    # 0x235c34
leaq 0x72c9(%rip), %rsi      # 0x20092
xorpd %xmm0, %xmm0
movq %rbx, %rdi
callq 0x9276
cvttsd2si %xmm0, %eax
movl %eax, 0x21ce59(%rip)    # 0x235c38
leaq 0x72c4(%rip), %rsi      # 0x200aa
movq %rbx, %rdi
movq %r14, %rdx
callq 0x907b
leaq 0x21fe44(%rip), %rdi    # 0x238c3c
movl $0x400, %edx            # imm = 0x400
movq %rax, %rsi
callq 0xf038
leaq 0x72b7(%rip), %rsi      # 0x200c3
movq %rbx, %rdi
movq %r14, %rdx
callq 0x907b
leaq 0x22021e(%rip), %rdi    # 0x23903c
movl $0x400, %edx            # imm = 0x400
movq %rax, %rsi
callq 0xf038
leaq 0x72aa(%rip), %rsi      # 0x200dc
movq %rbx, %rdi
movq %r14, %rdx
callq 0x907b
leaq 0x2205f8(%rip), %rdi    # 0x23943c
movl $0x400, %edx            # imm = 0x400
movq %rax, %rsi
callq 0xf038
leaq 0x729d(%rip), %rsi      # 0x200f5
movq %rbx, %rdi
movq %r14, %rdx
callq 0x907b
leaq 0x2209d2(%rip), %rdi    # 0x23983c
movl $0x400, %edx            # imm = 0x400
movq %rax, %rsi
callq 0xf038
leaq 0x7290(%rip), %rsi      # 0x2010e
movq %rbx, %rdi
movq %r14, %rdx
callq 0x907b
leaq 0x220dac(%rip), %rdi    # 0x239c3c
movl $0x400, %edx            # imm = 0x400
movq %rax, %rsi
callq 0xf038
leaq 0x7283(%rip), %rsi      # 0x20127
movq %rbx, %rdi
movq %r14, %rdx
callq 0x907b
leaq 0x221186(%rip), %rdi    # 0x23a03c
movl $0x400, %edx            # imm = 0x400
movq %rax, %rsi
callq 0xf038
leaq 0x7276(%rip), %rsi      # 0x20140
movq %rbx, %rdi
movq %r14, %rdx
callq 0x907b
leaq 0x221560(%rip), %rdi    # 0x23a43c
movl $0x400, %edx            # imm = 0x400
movq %rax, %rsi
callq 0xf038
leaq 0x7269(%rip), %rsi      # 0x20159
movq %rbx, %rdi
movq %r14, %rdx
callq 0x907b
leaq 0x22193a(%rip), %rdi    # 0x23a83c
movl $0x400, %edx            # imm = 0x400
movq %rax, %rsi
callq 0xf038
leaq 0x725c(%rip), %rsi      # 0x20172
movq %rbx, %rdi
movq %r14, %rdx
callq 0x907b
leaq 0x221d14(%rip), %rdi    # 0x23ac3c
movl $0x400, %edx            # imm = 0x400
movq %rax, %rsi
callq 0xf038
leaq 0x724f(%rip), %rsi      # 0x2018b
movq %rbx, %rdi
movq %r14, %rdx
callq 0x907b
leaq 0x2220ee(%rip), %rdi    # 0x23b03c
movl $0x400, %edx            # imm = 0x400
movq %rax, %rsi
callq 0xf038
leaq 0x7242(%rip), %rsi      # 0x201a4
movq %rbx, %rdi
movq %r14, %rdx
callq 0x907b
leaq 0x2224c8(%rip), %rdi    # 0x23b43c
movl $0x400, %edx            # imm = 0x400
movq %rax, %rsi
callq 0xf038
leaq 0x7236(%rip), %rsi      # 0x201be
leaq 0x7283(%rip), %rdx      # 0x20212
movq %rbx, %rdi
callq 0x907b
leaq 0x22289e(%rip), %rdi    # 0x23b83c
movl $0x400, %edx            # imm = 0x400
movq %rax, %rsi
callq 0xf038
leaq 0x7222(%rip), %rsi      # 0x201d4
leaq 0x7227(%rip), %rdx      # 0x201e0
movq %rbx, %rdi
callq 0x907b
leaq 0x223074(%rip), %rdi    # 0x23c03c
movl $0x400, %edx            # imm = 0x400
movq %rax, %rsi
callq 0xf038
leaq 0x7211(%rip), %rsi      # 0x201ed
leaq 0x7227(%rip), %rdx      # 0x2020a
movq %rbx, %rdi
callq 0x907b
leaq 0x222c4a(%rip), %rdi    # 0x23bc3c
movl $0x400, %edx            # imm = 0x400
movq %rax, %rsi
callq 0xf038
leaq 0x7216(%rip), %rsi      # 0x2021c
leaq 0x3935(%rip), %r15      # 0x1c942
movq %rbx, %rdi
movq %r15, %rdx
callq 0x907b
leaq 0x22341d(%rip), %rdi    # 0x23c43c
movl $0x400, %edx            # imm = 0x400
movq %rax, %rsi
callq 0xf038
leaq 0x7205(%rip), %rsi      # 0x20238
movq %rbx, %rdi
movq %r15, %rdx
callq 0x907b
leaq 0x2237f7(%rip), %rdi    # 0x23c83c
movl $0x400, %edx            # imm = 0x400
movq %rax, %rsi
callq 0xf038
leaq 0x71fc(%rip), %rsi      # 0x20255
movq %rbx, %rdi
movq %r15, %rdx
callq 0x907b
leaq 0x223bd1(%rip), %rdi    # 0x23cc3c
movl $0x400, %edx            # imm = 0x400
movq %rax, %rsi
callq 0xf038
leaq 0x71f9(%rip), %rsi      # 0x20278
movq %rbx, %rdi
movq %r15, %rdx
callq 0x907b
leaq 0x223fab(%rip), %rdi    # 0x23d03c
movl $0x400, %edx            # imm = 0x400
movq %rax, %rsi
callq 0xf038
leaq 0x71f7(%rip), %rsi      # 0x2029c
movq %rbx, %rdi
movq %r15, %rdx
callq 0x907b
leaq 0x224385(%rip), %rdi    # 0x23d43c
movl $0x400, %edx            # imm = 0x400
movq %rax, %rsi
callq 0xf038
leaq 0x71f0(%rip), %rsi      # 0x202bb
movq %rbx, %rdi
movq %r15, %rdx
callq 0x907b
leaq 0x22475f(%rip), %rdi    # 0x23d83c
movl $0x400, %edx            # imm = 0x400
movq %rax, %rsi
callq 0xf038
leaq 0x71ea(%rip), %rsi      # 0x202db
movq %rbx, %rdi
movq %r14, %rdx
callq 0x907b
leaq 0x224f39(%rip), %rdi    # 0x23e03c
movl $0x400, %edx            # imm = 0x400
movq %rax, %rsi
callq 0xf038
leaq 0x71dc(%rip), %rsi      # 0x202f3
movq %rbx, %rdi
movq %r14, %rdx
callq 0x907b
leaq 0x224b13(%rip), %rdi    # 0x23dc3c
movl $0x400, %edx            # imm = 0x400
movq %rax, %rsi
callq 0xf038
leaq 0x71cf(%rip), %rsi      # 0x2030c
movq %rbx, %rdi
movq %r14, %rdx
callq 0x907b
leaq 0x2252ed(%rip), %rdi    # 0x23e43c
movl $0x400, %edx            # imm = 0x400
movq %rax, %rsi
callq 0xf038
movq %rbx, %rdi
callq 0x905c
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq