// File: /workspace/github_c_makefile_star2_O0/schroeder-lvb[P]sissm/src/api.c
// Function: apiIdListRead
int apiIdListRead( char *listFile, idList_t idList )
{
    int  i, idType;
    char tmpLine[1024], testGUID[256]; //  *w;
    FILE *fpr;

    for (i=0; i<IDLISTMAXELEM; i++) strclr( idList[i] );

    // EPIC

    i = -1;
    if (NULL != (fpr = fopen( listFile, "rt" ))) {
        i = 0;
        while (!feof( fpr )) {
            if (NULL != fgets( tmpLine, 1024, fpr )) {
                tmpLine[ strlen( tmpLine ) - 1] = 0;

                strlcpy( testGUID, tmpLine, IDEPICIDLEN+1 );           // 65-char EPIC ID + terminator
                if ( 2 == ( idType = rosterIsValidGUID( testGUID ) )) {
                    strlcpy( idList[i++], testGUID, IDEPICIDLEN+1 );
                }
                else {
                    strlcpy( testGUID, tmpLine, IDSTEAMID64LEN+1 );   // 17-char Steam ID + terminator
                    if ( 1 == ( idType = rosterIsValidGUID ( testGUID ))) { 
                        strlcpy( idList[i++], testGUID, IDSTEAMID64LEN+1 );
                    }
                } 
                if ( i >= (IDLISTMAXELEM-1) ) break;    // check for overflow
            }
        }
        fclose( fpr );
    }
    return( i );
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x530, %rsp            # imm = 0x530
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x0, -0x14(%rbp)
cmpl $0x100, -0x14(%rbp)     # imm = 0x100
jge 0x149d2
movq -0x10(%rbp), %rdi
movslq -0x14(%rbp), %rax
shlq $0x8, %rax
addq %rax, %rdi
callq 0x122b0
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x149aa
movl $0xffffffff, -0x14(%rbp) # imm = 0xFFFFFFFF
movq -0x8(%rbp), %rdi
leaq 0xf4af(%rip), %rsi      # 0x23e93
callq 0x8310
movq %rax, %rcx
movq %rcx, -0x528(%rbp)
xorl %eax, %eax
cmpq %rcx, %rax
je 0x14b38
movl $0x0, -0x14(%rbp)
movq -0x528(%rbp), %rdi
callq 0x8250
cmpl $0x0, %eax
setne %al
xorb $-0x1, %al
testb $0x1, %al
jne 0x14a22
jmp 0x14b2c
leaq -0x420(%rbp), %rdi
movq -0x528(%rbp), %rdx
movl $0x400, %esi            # imm = 0x400
callq 0x81e0
movq %rax, %rcx
xorl %eax, %eax
cmpq %rcx, %rax
je 0x14b27
leaq -0x420(%rbp), %rdi
callq 0x8110
subq $0x1, %rax
movb $0x0, -0x420(%rbp,%rax)
leaq -0x520(%rbp), %rdi
leaq -0x420(%rbp), %rsi
movl $0x42, %edx
callq 0x11bc0
leaq -0x520(%rbp), %rdi
callq 0x190a0
movl %eax, %ecx
movl %ecx, -0x18(%rbp)
movl $0x2, %eax
cmpl %ecx, %eax
jne 0x14abd
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %eax
movl %eax, %ecx
addl $0x1, %ecx
movl %ecx, -0x14(%rbp)
cltq
shlq $0x8, %rax
addq %rax, %rdi
leaq -0x520(%rbp), %rsi
movl $0x42, %edx
callq 0x11bc0
jmp 0x14b1a
leaq -0x520(%rbp), %rdi
leaq -0x420(%rbp), %rsi
movl $0x12, %edx
callq 0x11bc0
leaq -0x520(%rbp), %rdi
callq 0x190a0
movl %eax, %ecx
movl %ecx, -0x18(%rbp)
movl $0x1, %eax
cmpl %ecx, %eax
jne 0x14b18
movq -0x10(%rbp), %rdi
movl -0x14(%rbp), %eax
movl %eax, %ecx
addl $0x1, %ecx
movl %ecx, -0x14(%rbp)
cltq
shlq $0x8, %rax
addq %rax, %rdi
leaq -0x520(%rbp), %rsi
movl $0x12, %edx
callq 0x11bc0
jmp 0x14b1a
cmpl $0xff, -0x14(%rbp)
jl 0x14b25
jmp 0x14b2c
jmp 0x14b27
jmp 0x14a05
movq -0x528(%rbp), %rdi
callq 0x80f0
movl -0x14(%rbp), %eax
addq $0x530, %rsp            # imm = 0x530
popq %rbp
retq
nopw %cs:(%rax,%rax)