// File: /workspace/github_c_makefile_star2_O3/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 0x8970
movq %rax, %rdi
callq 0x8ffc
movq %rax, %rbx
leaq 0x71a8(%rip), %rsi      # 0x1fea8
xorpd %xmm0, %xmm0
movq %rax, %rdi
callq 0x926a
cvttsd2si %xmm0, %eax
movl %eax, 0x21cf0a(%rip)    # 0x235c20
leaq 0x71a3(%rip), %rsi      # 0x1fec0
movsd 0x2303(%rip), %xmm0     # 0x1b028
movq %rbx, %rdi
callq 0x926a
cvttsd2si %xmm0, %eax
movl %eax, 0x21ceed(%rip)    # 0x235c24
leaq 0x719e(%rip), %rsi      # 0x1fedc
xorpd %xmm0, %xmm0
movq %rbx, %rdi
callq 0x926a
cvttsd2si %xmm0, %eax
movl %eax, 0x21ced4(%rip)    # 0x235c28
leaq 0x719c(%rip), %rsi      # 0x1fef7
leaq 0x29a7(%rip), %r14      # 0x1b709
movq %rbx, %rdi
movq %r14, %rdx
callq 0x9073
leaq 0x21cec8(%rip), %rdi    # 0x235c3c
movl $0x400, %edx            # imm = 0x400
movq %rax, %rsi
callq 0xf384
leaq 0x718e(%rip), %rsi      # 0x1ff16
movq %rbx, %rdi
movq %r14, %rdx
callq 0x9073
leaq 0x21d2a2(%rip), %rdi    # 0x23603c
movl $0x400, %edx            # imm = 0x400
movq %rax, %rsi
callq 0xf384
leaq 0x7187(%rip), %rsi      # 0x1ff35
movq %rbx, %rdi
movsd 0x226f(%rip), %xmm0     # 0x1b028
callq 0x926a
cvttsd2si %xmm0, %eax
movl %eax, 0x21ce64(%rip)    # 0x235c2c
leaq 0x717c(%rip), %rsi      # 0x1ff4b
movq %rbx, %rdi
movq %r14, %rdx
callq 0x9073
leaq 0x21d65b(%rip), %rdi    # 0x23643c
movl $0x400, %edx            # imm = 0x400
movq %rax, %rsi
callq 0xf384
leaq 0x7171(%rip), %rsi      # 0x1ff66
movq %rbx, %rdi
movq %r14, %rdx
callq 0x9073
leaq 0x21da35(%rip), %rdi    # 0x23683c
movl $0x400, %edx            # imm = 0x400
movq %rax, %rsi
callq 0xf384
leaq 0x7166(%rip), %rsi      # 0x1ff81
movq %rbx, %rdi
movq %r14, %rdx
callq 0x9073
leaq 0x21de0f(%rip), %rdi    # 0x236c3c
movl $0x400, %edx            # imm = 0x400
movq %rax, %rsi
callq 0xf384
leaq 0x715b(%rip), %rsi      # 0x1ff9c
movq %rbx, %rdi
movq %r14, %rdx
callq 0x9073
leaq 0x21e1e9(%rip), %rdi    # 0x23703c
movl $0x400, %edx            # imm = 0x400
movq %rax, %rsi
callq 0xf384
leaq 0x7150(%rip), %rsi      # 0x1ffb7
movq %rbx, %rdi
movq %r14, %rdx
callq 0x9073
leaq 0x21e5c3(%rip), %rdi    # 0x23743c
movl $0x400, %edx            # imm = 0x400
movq %rax, %rsi
callq 0xf384
leaq 0x7145(%rip), %rsi      # 0x1ffd2
movq %rbx, %rdi
movq %r14, %rdx
callq 0x9073
leaq 0x21e99d(%rip), %rdi    # 0x23783c
movl $0x400, %edx            # imm = 0x400
movq %rax, %rsi
callq 0xf384
leaq 0x713a(%rip), %rsi      # 0x1ffed
movq %rbx, %rdi
movq %r14, %rdx
callq 0x9073
leaq 0x21ed77(%rip), %rdi    # 0x237c3c
movl $0x400, %edx            # imm = 0x400
movq %rax, %rsi
callq 0xf384
leaq 0x712f(%rip), %rsi      # 0x20008
movq %rbx, %rdi
movq %r14, %rdx
callq 0x9073
leaq 0x21f151(%rip), %rdi    # 0x23803c
movl $0x400, %edx            # imm = 0x400
movq %rax, %rsi
callq 0xf384
leaq 0x7124(%rip), %rsi      # 0x20023
movq %rbx, %rdi
movq %r14, %rdx
callq 0x9073
leaq 0x21f52b(%rip), %rdi    # 0x23843c
movl $0x400, %edx            # imm = 0x400
movq %rax, %rsi
callq 0xf384
leaq 0x7119(%rip), %rsi      # 0x2003e
movq %rbx, %rdi
movq %r14, %rdx
callq 0x9073
leaq 0x21f905(%rip), %rdi    # 0x23883c
movl $0x400, %edx            # imm = 0x400
movq %rax, %rsi
callq 0xf384
leaq 0x710e(%rip), %rsi      # 0x20059
xorpd %xmm0, %xmm0
movq %rbx, %rdi
callq 0x926a
cvttsd2si %xmm0, %eax
movl %eax, 0x21cccf(%rip)    # 0x235c30
leaq 0x7105(%rip), %rsi      # 0x2006d
xorpd %xmm0, %xmm0
movq %rbx, %rdi
callq 0x926a
cvttsd2si %xmm0, %eax
movl %eax, 0x21ccb6(%rip)    # 0x235c34
leaq 0x70fd(%rip), %rsi      # 0x20082
xorpd %xmm0, %xmm0
movq %rbx, %rdi
callq 0x926a
cvttsd2si %xmm0, %eax
movl %eax, 0x21cc9d(%rip)    # 0x235c38
leaq 0x70f8(%rip), %rsi      # 0x2009a
movq %rbx, %rdi
movq %r14, %rdx
callq 0x9073
leaq 0x21fc88(%rip), %rdi    # 0x238c3c
movl $0x400, %edx            # imm = 0x400
movq %rax, %rsi
callq 0xf384
leaq 0x70eb(%rip), %rsi      # 0x200b3
movq %rbx, %rdi
movq %r14, %rdx
callq 0x9073
leaq 0x220062(%rip), %rdi    # 0x23903c
movl $0x400, %edx            # imm = 0x400
movq %rax, %rsi
callq 0xf384
leaq 0x70de(%rip), %rsi      # 0x200cc
movq %rbx, %rdi
movq %r14, %rdx
callq 0x9073
leaq 0x22043c(%rip), %rdi    # 0x23943c
movl $0x400, %edx            # imm = 0x400
movq %rax, %rsi
callq 0xf384
leaq 0x70d1(%rip), %rsi      # 0x200e5
movq %rbx, %rdi
movq %r14, %rdx
callq 0x9073
leaq 0x220816(%rip), %rdi    # 0x23983c
movl $0x400, %edx            # imm = 0x400
movq %rax, %rsi
callq 0xf384
leaq 0x70c4(%rip), %rsi      # 0x200fe
movq %rbx, %rdi
movq %r14, %rdx
callq 0x9073
leaq 0x220bf0(%rip), %rdi    # 0x239c3c
movl $0x400, %edx            # imm = 0x400
movq %rax, %rsi
callq 0xf384
leaq 0x70b7(%rip), %rsi      # 0x20117
movq %rbx, %rdi
movq %r14, %rdx
callq 0x9073
leaq 0x220fca(%rip), %rdi    # 0x23a03c
movl $0x400, %edx            # imm = 0x400
movq %rax, %rsi
callq 0xf384
leaq 0x70aa(%rip), %rsi      # 0x20130
movq %rbx, %rdi
movq %r14, %rdx
callq 0x9073
leaq 0x2213a4(%rip), %rdi    # 0x23a43c
movl $0x400, %edx            # imm = 0x400
movq %rax, %rsi
callq 0xf384
leaq 0x709d(%rip), %rsi      # 0x20149
movq %rbx, %rdi
movq %r14, %rdx
callq 0x9073
leaq 0x22177e(%rip), %rdi    # 0x23a83c
movl $0x400, %edx            # imm = 0x400
movq %rax, %rsi
callq 0xf384
leaq 0x7090(%rip), %rsi      # 0x20162
movq %rbx, %rdi
movq %r14, %rdx
callq 0x9073
leaq 0x221b58(%rip), %rdi    # 0x23ac3c
movl $0x400, %edx            # imm = 0x400
movq %rax, %rsi
callq 0xf384
leaq 0x7083(%rip), %rsi      # 0x2017b
movq %rbx, %rdi
movq %r14, %rdx
callq 0x9073
leaq 0x221f32(%rip), %rdi    # 0x23b03c
movl $0x400, %edx            # imm = 0x400
movq %rax, %rsi
callq 0xf384
leaq 0x7076(%rip), %rsi      # 0x20194
movq %rbx, %rdi
movq %r14, %rdx
callq 0x9073
leaq 0x22230c(%rip), %rdi    # 0x23b43c
movl $0x400, %edx            # imm = 0x400
movq %rax, %rsi
callq 0xf384
leaq 0x706a(%rip), %rsi      # 0x201ae
leaq 0x70b7(%rip), %rdx      # 0x20202
movq %rbx, %rdi
callq 0x9073
leaq 0x2226e2(%rip), %rdi    # 0x23b83c
movl $0x400, %edx            # imm = 0x400
movq %rax, %rsi
callq 0xf384
leaq 0x7056(%rip), %rsi      # 0x201c4
leaq 0x705b(%rip), %rdx      # 0x201d0
movq %rbx, %rdi
callq 0x9073
leaq 0x222eb8(%rip), %rdi    # 0x23c03c
movl $0x400, %edx            # imm = 0x400
movq %rax, %rsi
callq 0xf384
leaq 0x7045(%rip), %rsi      # 0x201dd
leaq 0x705b(%rip), %rdx      # 0x201fa
movq %rbx, %rdi
callq 0x9073
leaq 0x222a8e(%rip), %rdi    # 0x23bc3c
movl $0x400, %edx            # imm = 0x400
movq %rax, %rsi
callq 0xf384
leaq 0x704a(%rip), %rsi      # 0x2020c
leaq 0x3753(%rip), %r15      # 0x1c91c
movq %rbx, %rdi
movq %r15, %rdx
callq 0x9073
leaq 0x223261(%rip), %rdi    # 0x23c43c
movl $0x400, %edx            # imm = 0x400
movq %rax, %rsi
callq 0xf384
leaq 0x7039(%rip), %rsi      # 0x20228
movq %rbx, %rdi
movq %r15, %rdx
callq 0x9073
leaq 0x22363b(%rip), %rdi    # 0x23c83c
movl $0x400, %edx            # imm = 0x400
movq %rax, %rsi
callq 0xf384
leaq 0x7030(%rip), %rsi      # 0x20245
movq %rbx, %rdi
movq %r15, %rdx
callq 0x9073
leaq 0x223a15(%rip), %rdi    # 0x23cc3c
movl $0x400, %edx            # imm = 0x400
movq %rax, %rsi
callq 0xf384
leaq 0x702d(%rip), %rsi      # 0x20268
movq %rbx, %rdi
movq %r15, %rdx
callq 0x9073
leaq 0x223def(%rip), %rdi    # 0x23d03c
movl $0x400, %edx            # imm = 0x400
movq %rax, %rsi
callq 0xf384
leaq 0x702b(%rip), %rsi      # 0x2028c
movq %rbx, %rdi
movq %r15, %rdx
callq 0x9073
leaq 0x2241c9(%rip), %rdi    # 0x23d43c
movl $0x400, %edx            # imm = 0x400
movq %rax, %rsi
callq 0xf384
leaq 0x7024(%rip), %rsi      # 0x202ab
movq %rbx, %rdi
movq %r15, %rdx
callq 0x9073
leaq 0x2245a3(%rip), %rdi    # 0x23d83c
movl $0x400, %edx            # imm = 0x400
movq %rax, %rsi
callq 0xf384
leaq 0x701e(%rip), %rsi      # 0x202cb
movq %rbx, %rdi
movq %r14, %rdx
callq 0x9073
leaq 0x224d7d(%rip), %rdi    # 0x23e03c
movl $0x400, %edx            # imm = 0x400
movq %rax, %rsi
callq 0xf384
leaq 0x7010(%rip), %rsi      # 0x202e3
movq %rbx, %rdi
movq %r14, %rdx
callq 0x9073
leaq 0x224957(%rip), %rdi    # 0x23dc3c
movl $0x400, %edx            # imm = 0x400
movq %rax, %rsi
callq 0xf384
leaq 0x7003(%rip), %rsi      # 0x202fc
movq %rbx, %rdi
movq %r14, %rdx
callq 0x9073
leaq 0x225131(%rip), %rdi    # 0x23e43c
movl $0x400, %edx            # imm = 0x400
movq %rax, %rsi
callq 0xf384
movq %rbx, %rdi
callq 0x9054
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq