// File: /workspace/github_c_makefile_star2_O0/schroeder-lvb[P]sissm/src/pigateway.c
// Function: pigatewayClientSynthAddCB
int pigatewayClientSynthAddCB( char *strIn )
{
    static char playerName[256], playerGUID[256], playerIP[256];
    int alreadyKicked = 0;
    int kickReason, firstAdminSlot;

    rosterParsePlayerSynthConn( strIn, 256, playerName, playerGUID, playerIP );
    logPrintf( LOG_LEVEL_INFO, "pigateway", "Synthetic ADD Callback Name ::%s:: IP ::%s:: GUID ::%s::", 
        playerName, playerIP, playerGUID );

    // copy to local, first admin slot from sissm.cfg
    //
    firstAdminSlot = pigatewayConfig.firstAdminSlotNo;
  
    // server lockout via picladmin "lock off|on|perm|clan" command
    // if "locked" then make all slots "admin" or via the allowin exemption
    //
    if ( 0L != p2pGetL( "pigateway.p2p.lockOut", 0L ))   // default is 0L = unlock
        firstAdminSlot = 1;

    if (apiPlayersGetCount() >= firstAdminSlot ) {         // check if these are admin-only slots

        if ( _allowInExemption( playerName ) ) {
            logPrintf( LOG_LEVEL_CRITICAL, "pigateway", "Special full server join granted by admin ::%s::%s::%s::", 
                    playerName, playerGUID, playerIP );
        }
        // else if ( !_isPriority( playerGUID, playerName ) && (pigatewayConfig.adminPortDisable == 0) ) {     // check if this is an admin
        else if ( !_isPriority( playerGUID, playerName ) ) {     // check if this is an admin

            // this block of code kicks incoming players
            //
            if ( (apiTimeGet() - timeRestarted) > PIGATEWAY_RESTART_LOCKOUT_SEC ) {  // check if we are restarting
                // apiKickOrBan( 0, playerGUID, "Server_full, under maintenance, or hosting a private session." );

                if ( 0L == p2pGetL( "pigateway.p2p.lockOut", 0L ) ) {
                    apiKickOrBan( 0, playerGUID, pigatewayConfig.adminPortKickMsgFull );    // server full
                    apiSay ( "Player %s kicked Server Full", playerName );
                }
                else {
                    apiKickOrBan( 0, playerGUID, pigatewayConfig.adminPortKickMsgLock );    // special events !lock
                    apiSay ( "Player %s kicked Server Reserved", playerName );
                }

                logPrintf( LOG_LEVEL_CRITICAL, "pigateway", "Full Server Kick ::%s::%s::%s::", 
                    playerName, playerGUID, playerIP );
                alreadyKicked = 1;
            }
            else {
                logPrintf( LOG_LEVEL_INFO, "pigateway", 
                    "Exempt Full Server Kick due to Restart ::%s::%s::%s::", playerName, playerGUID, playerIP );
            }
        }
    }

    // process badname auto-kicking
    //
    if ( (0 == alreadyKicked) && (pigatewayConfig.enableBadNameFilter) ) {
        if ( 0 != (kickReason = _isBadName( playerName, playerGUID )) ) {
            apiKickOrBan( 0, playerGUID, "" );
            if ( kickReason == 1 ) {
                apiSay ( "Player %s auto-kicked by server", playerName );
                logPrintf( LOG_LEVEL_INFO, "pigateway", "Bad Name Auto-kick ::%s::%s::%s::", 
                    playerName, playerGUID, playerIP );
            }
            else {
                logPrintf( LOG_LEVEL_INFO, "pigateway", "Suspended User Auto-kick ::%s::%s::%s::", 
                    playerName, playerGUID, playerIP );
            }
            alreadyKicked = 1;
        }
    }

    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movl $0x0, -0xc(%rbp)
movq -0x8(%rbp), %rdi
movl $0x100, %esi            # imm = 0x100
leaq 0x2268dd(%rip), %rdx    # 0x2478a0
leaq 0x2269d6(%rip), %rcx    # 0x2479a0
leaq 0x226acf(%rip), %r8     # 0x247aa0
callq 0x1aa80
movl $0x2, %edi
leaq 0x73f6(%rip), %rsi      # 0x283d8
leaq 0x6d4d(%rip), %rdx      # 0x27d36
leaq 0x2268b0(%rip), %rcx    # 0x2478a0
leaq 0x226aa9(%rip), %r8     # 0x247aa0
leaq 0x2269a2(%rip), %r9     # 0x2479a0
movb $0x0, %al
callq 0x21bf0
movl 0x225869(%rip), %eax    # 0x246874
movl %eax, -0x14(%rbp)
leaq 0x2771(%rip), %rdi      # 0x23786
xorl %eax, %eax
movl %eax, %esi
callq 0x1eda0
movq %rax, %rcx
xorl %eax, %eax
cmpq %rcx, %rax
je 0x2102f
movl $0x1, -0x14(%rbp)
callq 0x17fe0
cmpl -0x14(%rbp), %eax
jl 0x21196
leaq 0x22685c(%rip), %rdi    # 0x2478a0
callq 0x21280
cmpl $0x0, %eax
je 0x2107f
xorl %edi, %edi
leaq 0x7381(%rip), %rsi      # 0x283d8
leaq 0x7544(%rip), %rdx      # 0x285a2
leaq 0x22683b(%rip), %rcx    # 0x2478a0
leaq 0x226934(%rip), %r8     # 0x2479a0
leaq 0x226a2d(%rip), %r9     # 0x247aa0
movb $0x0, %al
callq 0x21bf0
jmp 0x21194
leaq 0x22691a(%rip), %rdi    # 0x2479a0
leaq 0x226813(%rip), %rsi    # 0x2478a0
callq 0x21320
cmpl $0x0, %eax
jne 0x21192
callq 0x150c0
subq 0x226af9(%rip), %rax    # 0x247ba0
cmpq $0x3c, %rax
jbe 0x21161
leaq 0x26ce(%rip), %rdi      # 0x23786
xorl %eax, %eax
movl %eax, %esi
callq 0x1eda0
movq %rax, %rcx
xorl %eax, %eax
cmpq %rcx, %rax
jne 0x210fe
xorl %edi, %edi
leaq 0x2268cc(%rip), %rsi    # 0x2479a0
leaq 0x225795(%rip), %rdx    # 0x246870
addq $0x408, %rdx            # imm = 0x408
callq 0x17cf0
leaq 0x74ed(%rip), %rdi      # 0x285db
leaq 0x2267ab(%rip), %rsi    # 0x2478a0
movb $0x0, %al
callq 0x178d0
jmp 0x2112c
xorl %edi, %edi
leaq 0x226899(%rip), %rsi    # 0x2479a0
leaq 0x225762(%rip), %rdx    # 0x246870
addq $0x8, %rdx
callq 0x17cf0
leaq 0x74da(%rip), %rdi      # 0x285f8
leaq 0x22677b(%rip), %rsi    # 0x2478a0
movb $0x0, %al
callq 0x178d0
xorl %edi, %edi
leaq 0x72a3(%rip), %rsi      # 0x283d8
leaq 0x74dd(%rip), %rdx      # 0x28619
leaq 0x22675d(%rip), %rcx    # 0x2478a0
leaq 0x226856(%rip), %r8     # 0x2479a0
leaq 0x22694f(%rip), %r9     # 0x247aa0
movb $0x0, %al
callq 0x21bf0
movl $0x1, -0xc(%rbp)
jmp 0x21190
movl $0x2, %edi
leaq 0x726b(%rip), %rsi      # 0x283d8
leaq 0x74c5(%rip), %rdx      # 0x28639
leaq 0x226725(%rip), %rcx    # 0x2478a0
leaq 0x22681e(%rip), %r8     # 0x2479a0
leaq 0x226917(%rip), %r9     # 0x247aa0
movb $0x0, %al
callq 0x21bf0
jmp 0x21192
jmp 0x21194
jmp 0x21196
xorl %eax, %eax
cmpl -0xc(%rbp), %eax
jne 0x21269
cmpl $0x0, 0x225ed8(%rip)    # 0x247080
je 0x21269
leaq 0x2266eb(%rip), %rdi    # 0x2478a0
leaq 0x2267e4(%rip), %rsi    # 0x2479a0
callq 0x21430
movl %eax, %ecx
movl %ecx, -0x10(%rbp)
xorl %eax, %eax
cmpl %ecx, %eax
je 0x21267
xorl %edi, %edi
leaq 0x2267c7(%rip), %rsi    # 0x2479a0
leaq 0x2531(%rip), %rdx      # 0x23711
callq 0x17cf0
cmpl $0x1, -0x10(%rbp)
jne 0x21231
leaq 0x747d(%rip), %rdi      # 0x2866f
leaq 0x2266a7(%rip), %rsi    # 0x2478a0
movb $0x0, %al
callq 0x178d0
movl $0x2, %edi
leaq 0x71cc(%rip), %rsi      # 0x283d8
leaq 0x747c(%rip), %rdx      # 0x2868f
leaq 0x226686(%rip), %rcx    # 0x2478a0
leaq 0x22677f(%rip), %r8     # 0x2479a0
leaq 0x226878(%rip), %r9     # 0x247aa0
movb $0x0, %al
callq 0x21bf0
jmp 0x21260
movl $0x2, %edi
leaq 0x719b(%rip), %rsi      # 0x283d8
leaq 0x746d(%rip), %rdx      # 0x286b1
leaq 0x226655(%rip), %rcx    # 0x2478a0
leaq 0x22674e(%rip), %r8     # 0x2479a0
leaq 0x226847(%rip), %r9     # 0x247aa0
movb $0x0, %al
callq 0x21bf0
movl $0x1, -0xc(%rbp)
jmp 0x21269
xorl %eax, %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)