// File: /workspace/github_c_makefile_star2_O1/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 0x2007ba(%rip), %rdi    # 0x2154a0
callq 0xf4dd
leaq 0x1f3a4e(%rip), %r12    # 0x208740
movl $0x80, %ebp
decl %r14d
leaq 0x20279f(%rip), %r13    # 0x2174a0
leaq 0x99f0(%rip), %r15      # 0x1e6f8
cmpb $0x0, -0xa0(%r12)
je 0x14e1a
movq %r12, %rdi
callq 0x1403c
testl %eax, %eax
je 0x14e1a
cmpb $0x0, 0x50(%r12)
je 0x14e1a
cmpl $0x4, %r14d
ja 0x14de8
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 0x9b6f(%rip), %rdx      # 0x1e8ce
movq %r12, %r8
jmp 0x14d97
movl $0x100, %esi            # imm = 0x100
movq %r13, %rdi
leaq 0x9b76(%rip), %rdx      # 0x1e8e9
movq %r12, %rcx
jmp 0x14dfc
leaq -0x50(%r12), %rcx
leaq 0xa0(%r12), %r8
movl $0x100, %esi            # imm = 0x100
movq %r13, %rdi
leaq 0x9b37(%rip), %rdx      # 0x1e8ce
movq %rbx, %r9
jmp 0x14ddf
movq %r9, %rdi
callq 0xf711
leaq -0x50(%r12), %r9
movq %rbx, (%rsp)
movl $0x100, %esi            # imm = 0x100
movq %r13, %rdi
leaq 0x9b27(%rip), %rdx      # 0x1e8e3
movq %r12, %rcx
movq %rax, %r8
jmp 0x14ddf
leaq -0x50(%r12), %rcx
movq %rbx, (%rsp)
movl $0x100, %esi            # imm = 0x100
movq %r13, %rdi
leaq 0x9afb(%rip), %rdx      # 0x1e8d7
movq %r12, %r8
xorl %eax, %eax
callq 0x8190
jmp 0x14e06
leaq -0x50(%r12), %rcx
movl $0x100, %esi            # imm = 0x100
movq %r13, %rdi
leaq 0x9aed(%rip), %rdx      # 0x1e8e9
movq %rbx, %r8
xorl %eax, %eax
callq 0x8190
movl $0x1fff, %edx           # imm = 0x1FFF
leaq 0x20068e(%rip), %rdi    # 0x2154a0
movq %r13, %rsi
callq 0xefc4
addq $0x190, %r12            # imm = 0x190
decq %rbp
jne 0x14d08
leaq 0x20066f(%rip), %rax    # 0x2154a0
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq