// File: /workspace/github_c_makefile_star2_O2/schroeder-lvb[P]sissm/src/roster.c
// Function: rosterPlayerList
char *rosterPlayerList( int infoDepth, char *delimiter )
{
    static char playerList[8192], single[256];    // EPIC - doubled to 8K
    int i;
    strclr( playerList );
    for (i=0; i<ROSTER_MAX; i++) {
        if ( strlen( masterRoster[i].netID ) ) {
            if ( ( rosterIsValidGUID( masterRoster[i].steamID )) && ( 0 != strlen( masterRoster[i].IPaddress )) )  {   
		switch ( infoDepth ) {
		case 1:   //  includes name + steamID for identifying names with alt-charsets, less privacy
                    snprintf( single, 256, "%s[%s]%s", masterRoster[i].playerName, masterRoster[i].steamID, delimiter );
		    break;
		case 2:   // security web display that includes name:SteamID::IP
                    snprintf( single, 256, "%s[%s:%s]%s", 
                        masterRoster[i].playerName, masterRoster[i].steamID, masterRoster[i].IPaddress, delimiter );
		    break;
		case 3:   // alternative web display that includes name:score
                    snprintf( single, 256, "%s[%s]%s", masterRoster[i].playerName, masterRoster[i].score, delimiter );
		    break;
		case 4:   // used for synthetic event handler, for reliable but less responsive player conect/disconnect
                    snprintf( single, 256, "%s %s %s%s", 
                        masterRoster[i].steamID, reformatIP( masterRoster[i].IPaddress ), masterRoster[i].playerName, delimiter );
		    break;
		case 5:   // SteamID list only
                    snprintf( single, 256, "%s%s", masterRoster[i].steamID, delimiter );
		    break;
	        default:  // (case 0) default miniamlist public dispaly, player name only
                    snprintf( single, 256, "%s%s", masterRoster[i].playerName, delimiter );
		}
                strlcat( playerList, single, 8191 );   // EPIC
            }
        }
    }
    return( playerList );
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movl %edi, %r14d
leaq 0x20145b(%rip), %rdi    # 0x2154a0
callq 0xed98
movl $0x80, %ebp
leaq 0x1f46ea(%rip), %r12    # 0x208740
decl %r14d
leaq 0x203440(%rip), %r13    # 0x2174a0
leaq 0x9671(%rip), %r15      # 0x1d6d8
subq $0x1, %rbp
jb 0x1418f
cmpb $0x0, -0xa0(%r12)
je 0x14183
movq %r12, %rdi
callq 0x13480
testl %eax, %eax
je 0x14183
cmpb $0x0, 0x50(%r12)
je 0x14183
cmpl $0x4, %r14d
ja 0x14151
leaq 0x50(%r12), %r9
movslq (%r15,%r14,4), %rax
addq %r15, %rax
jmpq *%rax
leaq -0x50(%r12), %rcx
movl $0x100, %esi            # imm = 0x100
movq %r13, %rdi
leaq 0x97e6(%rip), %rdx      # 0x1d8ae
movq %r12, %r8
jmp 0x14100
movl $0x100, %esi            # imm = 0x100
movq %r13, %rdi
leaq 0x97ed(%rip), %rdx      # 0x1d8c9
movq %r12, %rcx
jmp 0x14165
leaq -0x50(%r12), %rcx
leaq 0xa0(%r12), %r8
movl $0x100, %esi            # imm = 0x100
movq %r13, %rdi
leaq 0x97ae(%rip), %rdx      # 0x1d8ae
movq %rbx, %r9
jmp 0x14148
movq %r9, %rdi
callq 0xef87
leaq -0x50(%r12), %r9
movq %rbx, (%rsp)
movl $0x100, %esi            # imm = 0x100
movq %r13, %rdi
leaq 0x979e(%rip), %rdx      # 0x1d8c3
movq %r12, %rcx
movq %rax, %r8
jmp 0x14148
leaq -0x50(%r12), %rcx
movq %rbx, (%rsp)
movl $0x100, %esi            # imm = 0x100
movq %r13, %rdi
leaq 0x9772(%rip), %rdx      # 0x1d8b7
movq %r12, %r8
xorl %eax, %eax
callq 0x8190
jmp 0x1416f
leaq -0x50(%r12), %rcx
movl $0x100, %esi            # imm = 0x100
movq %r13, %rdi
leaq 0x9764(%rip), %rdx      # 0x1d8c9
movq %rbx, %r8
xorl %eax, %eax
callq 0x8190
movl $0x1fff, %edx           # imm = 0x1FFF
leaq 0x201325(%rip), %rdi    # 0x2154a0
movq %r13, %rsi
callq 0xe918
addq $0x190, %r12            # imm = 0x190
jmp 0x14067
leaq 0x20130a(%rip), %rax    # 0x2154a0
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq