// File: /workspace/github_c_makefile_star2_O2/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 0x8973
movq %rax, %rdi
callq 0x8f80
movq %rax, %rbx
leaq 0x7278(%rip), %rsi      # 0x1ee68
xorpd %xmm0, %xmm0
movq %rax, %rdi
callq 0x91bd
cvttsd2si %xmm0, %eax
movl %eax, 0x21e01a(%rip)    # 0x235c20
leaq 0x7273(%rip), %rsi      # 0x1ee80
movsd 0x2413(%rip), %xmm0     # 0x1a028
movq %rbx, %rdi
callq 0x91bd
cvttsd2si %xmm0, %eax
movl %eax, 0x21dffd(%rip)    # 0x235c24
leaq 0x726e(%rip), %rsi      # 0x1ee9c
xorpd %xmm0, %xmm0
movq %rbx, %rdi
callq 0x91bd
cvttsd2si %xmm0, %eax
movl %eax, 0x21dfe4(%rip)    # 0x235c28
leaq 0x726c(%rip), %rsi      # 0x1eeb7
leaq 0x2ab7(%rip), %r14      # 0x1a709
movq %rbx, %rdi
movq %r14, %rdx
callq 0x8ff5
leaq 0x21dfd8(%rip), %rdi    # 0x235c3c
movl $0x400, %edx            # imm = 0x400
movq %rax, %rsi
callq 0xe97a
leaq 0x725e(%rip), %rsi      # 0x1eed6
movq %rbx, %rdi
movq %r14, %rdx
callq 0x8ff5
leaq 0x21e3b2(%rip), %rdi    # 0x23603c
movl $0x400, %edx            # imm = 0x400
movq %rax, %rsi
callq 0xe97a
leaq 0x7257(%rip), %rsi      # 0x1eef5
movq %rbx, %rdi
movsd 0x237f(%rip), %xmm0     # 0x1a028
callq 0x91bd
cvttsd2si %xmm0, %eax
movl %eax, 0x21df74(%rip)    # 0x235c2c
leaq 0x724c(%rip), %rsi      # 0x1ef0b
movq %rbx, %rdi
movq %r14, %rdx
callq 0x8ff5
leaq 0x21e76b(%rip), %rdi    # 0x23643c
movl $0x400, %edx            # imm = 0x400
movq %rax, %rsi
callq 0xe97a
leaq 0x7241(%rip), %rsi      # 0x1ef26
movq %rbx, %rdi
movq %r14, %rdx
callq 0x8ff5
leaq 0x21eb45(%rip), %rdi    # 0x23683c
movl $0x400, %edx            # imm = 0x400
movq %rax, %rsi
callq 0xe97a
leaq 0x7236(%rip), %rsi      # 0x1ef41
movq %rbx, %rdi
movq %r14, %rdx
callq 0x8ff5
leaq 0x21ef1f(%rip), %rdi    # 0x236c3c
movl $0x400, %edx            # imm = 0x400
movq %rax, %rsi
callq 0xe97a
leaq 0x722b(%rip), %rsi      # 0x1ef5c
movq %rbx, %rdi
movq %r14, %rdx
callq 0x8ff5
leaq 0x21f2f9(%rip), %rdi    # 0x23703c
movl $0x400, %edx            # imm = 0x400
movq %rax, %rsi
callq 0xe97a
leaq 0x7220(%rip), %rsi      # 0x1ef77
movq %rbx, %rdi
movq %r14, %rdx
callq 0x8ff5
leaq 0x21f6d3(%rip), %rdi    # 0x23743c
movl $0x400, %edx            # imm = 0x400
movq %rax, %rsi
callq 0xe97a
leaq 0x7215(%rip), %rsi      # 0x1ef92
movq %rbx, %rdi
movq %r14, %rdx
callq 0x8ff5
leaq 0x21faad(%rip), %rdi    # 0x23783c
movl $0x400, %edx            # imm = 0x400
movq %rax, %rsi
callq 0xe97a
leaq 0x720a(%rip), %rsi      # 0x1efad
movq %rbx, %rdi
movq %r14, %rdx
callq 0x8ff5
leaq 0x21fe87(%rip), %rdi    # 0x237c3c
movl $0x400, %edx            # imm = 0x400
movq %rax, %rsi
callq 0xe97a
leaq 0x71ff(%rip), %rsi      # 0x1efc8
movq %rbx, %rdi
movq %r14, %rdx
callq 0x8ff5
leaq 0x220261(%rip), %rdi    # 0x23803c
movl $0x400, %edx            # imm = 0x400
movq %rax, %rsi
callq 0xe97a
leaq 0x71f4(%rip), %rsi      # 0x1efe3
movq %rbx, %rdi
movq %r14, %rdx
callq 0x8ff5
leaq 0x22063b(%rip), %rdi    # 0x23843c
movl $0x400, %edx            # imm = 0x400
movq %rax, %rsi
callq 0xe97a
leaq 0x71e9(%rip), %rsi      # 0x1effe
movq %rbx, %rdi
movq %r14, %rdx
callq 0x8ff5
leaq 0x220a15(%rip), %rdi    # 0x23883c
movl $0x400, %edx            # imm = 0x400
movq %rax, %rsi
callq 0xe97a
leaq 0x71de(%rip), %rsi      # 0x1f019
xorpd %xmm0, %xmm0
movq %rbx, %rdi
callq 0x91bd
cvttsd2si %xmm0, %eax
movl %eax, 0x21dddf(%rip)    # 0x235c30
leaq 0x71d5(%rip), %rsi      # 0x1f02d
xorpd %xmm0, %xmm0
movq %rbx, %rdi
callq 0x91bd
cvttsd2si %xmm0, %eax
movl %eax, 0x21ddc6(%rip)    # 0x235c34
leaq 0x71cd(%rip), %rsi      # 0x1f042
xorpd %xmm0, %xmm0
movq %rbx, %rdi
callq 0x91bd
cvttsd2si %xmm0, %eax
movl %eax, 0x21ddad(%rip)    # 0x235c38
leaq 0x71c8(%rip), %rsi      # 0x1f05a
movq %rbx, %rdi
movq %r14, %rdx
callq 0x8ff5
leaq 0x220d98(%rip), %rdi    # 0x238c3c
movl $0x400, %edx            # imm = 0x400
movq %rax, %rsi
callq 0xe97a
leaq 0x71bb(%rip), %rsi      # 0x1f073
movq %rbx, %rdi
movq %r14, %rdx
callq 0x8ff5
leaq 0x221172(%rip), %rdi    # 0x23903c
movl $0x400, %edx            # imm = 0x400
movq %rax, %rsi
callq 0xe97a
leaq 0x71ae(%rip), %rsi      # 0x1f08c
movq %rbx, %rdi
movq %r14, %rdx
callq 0x8ff5
leaq 0x22154c(%rip), %rdi    # 0x23943c
movl $0x400, %edx            # imm = 0x400
movq %rax, %rsi
callq 0xe97a
leaq 0x71a1(%rip), %rsi      # 0x1f0a5
movq %rbx, %rdi
movq %r14, %rdx
callq 0x8ff5
leaq 0x221926(%rip), %rdi    # 0x23983c
movl $0x400, %edx            # imm = 0x400
movq %rax, %rsi
callq 0xe97a
leaq 0x7194(%rip), %rsi      # 0x1f0be
movq %rbx, %rdi
movq %r14, %rdx
callq 0x8ff5
leaq 0x221d00(%rip), %rdi    # 0x239c3c
movl $0x400, %edx            # imm = 0x400
movq %rax, %rsi
callq 0xe97a
leaq 0x7187(%rip), %rsi      # 0x1f0d7
movq %rbx, %rdi
movq %r14, %rdx
callq 0x8ff5
leaq 0x2220da(%rip), %rdi    # 0x23a03c
movl $0x400, %edx            # imm = 0x400
movq %rax, %rsi
callq 0xe97a
leaq 0x717a(%rip), %rsi      # 0x1f0f0
movq %rbx, %rdi
movq %r14, %rdx
callq 0x8ff5
leaq 0x2224b4(%rip), %rdi    # 0x23a43c
movl $0x400, %edx            # imm = 0x400
movq %rax, %rsi
callq 0xe97a
leaq 0x716d(%rip), %rsi      # 0x1f109
movq %rbx, %rdi
movq %r14, %rdx
callq 0x8ff5
leaq 0x22288e(%rip), %rdi    # 0x23a83c
movl $0x400, %edx            # imm = 0x400
movq %rax, %rsi
callq 0xe97a
leaq 0x7160(%rip), %rsi      # 0x1f122
movq %rbx, %rdi
movq %r14, %rdx
callq 0x8ff5
leaq 0x222c68(%rip), %rdi    # 0x23ac3c
movl $0x400, %edx            # imm = 0x400
movq %rax, %rsi
callq 0xe97a
leaq 0x7153(%rip), %rsi      # 0x1f13b
movq %rbx, %rdi
movq %r14, %rdx
callq 0x8ff5
leaq 0x223042(%rip), %rdi    # 0x23b03c
movl $0x400, %edx            # imm = 0x400
movq %rax, %rsi
callq 0xe97a
leaq 0x7146(%rip), %rsi      # 0x1f154
movq %rbx, %rdi
movq %r14, %rdx
callq 0x8ff5
leaq 0x22341c(%rip), %rdi    # 0x23b43c
movl $0x400, %edx            # imm = 0x400
movq %rax, %rsi
callq 0xe97a
leaq 0x713a(%rip), %rsi      # 0x1f16e
leaq 0x7187(%rip), %rdx      # 0x1f1c2
movq %rbx, %rdi
callq 0x8ff5
leaq 0x2237f2(%rip), %rdi    # 0x23b83c
movl $0x400, %edx            # imm = 0x400
movq %rax, %rsi
callq 0xe97a
leaq 0x7126(%rip), %rsi      # 0x1f184
leaq 0x712b(%rip), %rdx      # 0x1f190
movq %rbx, %rdi
callq 0x8ff5
leaq 0x223fc8(%rip), %rdi    # 0x23c03c
movl $0x400, %edx            # imm = 0x400
movq %rax, %rsi
callq 0xe97a
leaq 0x7115(%rip), %rsi      # 0x1f19d
leaq 0x712b(%rip), %rdx      # 0x1f1ba
movq %rbx, %rdi
callq 0x8ff5
leaq 0x223b9e(%rip), %rdi    # 0x23bc3c
movl $0x400, %edx            # imm = 0x400
movq %rax, %rsi
callq 0xe97a
leaq 0x711a(%rip), %rsi      # 0x1f1cc
leaq 0x386b(%rip), %r15      # 0x1b924
movq %rbx, %rdi
movq %r15, %rdx
callq 0x8ff5
leaq 0x224371(%rip), %rdi    # 0x23c43c
movl $0x400, %edx            # imm = 0x400
movq %rax, %rsi
callq 0xe97a
leaq 0x7109(%rip), %rsi      # 0x1f1e8
movq %rbx, %rdi
movq %r15, %rdx
callq 0x8ff5
leaq 0x22474b(%rip), %rdi    # 0x23c83c
movl $0x400, %edx            # imm = 0x400
movq %rax, %rsi
callq 0xe97a
leaq 0x7100(%rip), %rsi      # 0x1f205
movq %rbx, %rdi
movq %r15, %rdx
callq 0x8ff5
leaq 0x224b25(%rip), %rdi    # 0x23cc3c
movl $0x400, %edx            # imm = 0x400
movq %rax, %rsi
callq 0xe97a
leaq 0x70fd(%rip), %rsi      # 0x1f228
movq %rbx, %rdi
movq %r15, %rdx
callq 0x8ff5
leaq 0x224eff(%rip), %rdi    # 0x23d03c
movl $0x400, %edx            # imm = 0x400
movq %rax, %rsi
callq 0xe97a
leaq 0x70fb(%rip), %rsi      # 0x1f24c
movq %rbx, %rdi
movq %r15, %rdx
callq 0x8ff5
leaq 0x2252d9(%rip), %rdi    # 0x23d43c
movl $0x400, %edx            # imm = 0x400
movq %rax, %rsi
callq 0xe97a
leaq 0x70f4(%rip), %rsi      # 0x1f26b
movq %rbx, %rdi
movq %r15, %rdx
callq 0x8ff5
leaq 0x2256b3(%rip), %rdi    # 0x23d83c
movl $0x400, %edx            # imm = 0x400
movq %rax, %rsi
callq 0xe97a
leaq 0x70ee(%rip), %rsi      # 0x1f28b
movq %rbx, %rdi
movq %r14, %rdx
callq 0x8ff5
leaq 0x225e8d(%rip), %rdi    # 0x23e03c
movl $0x400, %edx            # imm = 0x400
movq %rax, %rsi
callq 0xe97a
leaq 0x70e0(%rip), %rsi      # 0x1f2a3
movq %rbx, %rdi
movq %r14, %rdx
callq 0x8ff5
leaq 0x225a67(%rip), %rdi    # 0x23dc3c
movl $0x400, %edx            # imm = 0x400
movq %rax, %rsi
callq 0xe97a
leaq 0x70d3(%rip), %rsi      # 0x1f2bc
movq %rbx, %rdi
movq %r14, %rdx
callq 0x8ff5
leaq 0x226241(%rip), %rdi    # 0x23e43c
movl $0x400, %edx            # imm = 0x400
movq %rax, %rsi
callq 0xe97a
movq %rbx, %rdi
callq 0x8fd6
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq