// File: /workspace/github_c_makefile_star2_O1/schroeder-lvb[P]sissm/src/picladmin.c
// Function: cmdHelp
int _cmdHelp( char *arg, char *arg2, char *passThru ) 
{ 
    int i = 0, notFound = 1;
    char outStr[1024], originID[256];

    // if has parameter then look for a specific help for that command
    //
    if ( 0 != strlen( arg ) ) {
        while ( 1 == 1 ) {
            if ( ( 0 == strcmp( arg, cmdTable[i].cmdShort )) || ( 0 == strcmp( arg, cmdTable[i].cmdLong )) ) {
                apiSaySys("'%s' or %s", cmdTable[i].cmdShort, cmdTable[i].cmdHelp);
                notFound = 0;
                break;
            }
            i++;
            if ( 0 == strcmp( "*", cmdTable[i].cmdShort )) break; 
        }
    }

    // if above search was invalid command, or no arg was specified, display list of commands
    // 
    if ( notFound ) {
        strlcpy( originID, _getOriginID(), 256 );   // get requester ID

        strlcpy( outStr, "help [cmd], avail: ", 1024);
        i = 0;           
        while ( 1 == 1 ) {
            if ( apiAuthIsAllowedCommand( originID, cmdTable[i].cmdLong ) ) {
                strlcat( outStr, cmdTable[i].cmdLong, 1024 );
                strlcat( outStr, " ", 1024 );
                if ( strlen(outStr) > 40 ) {
                    apiSaySys( outStr );
                    strclr( outStr );
                }
            }
            i++;
            if ( 0 == strcmp( "*", cmdTable[i].cmdShort )) break; 
        }
        if (0 != strlen( outStr ))  apiSaySys( outStr );
    }
   
    return 0; 
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x508, %rsp            # imm = 0x508
cmpb $0x0, (%rdi)
je 0x9d74
movq %rdi, %r14
leaq 0x1e4ed(%rip), %rbx     # 0x28220
leaq 0x11ec2(%rip), %r15     # 0x1bbfc
movq %r14, %rdi
movq %rbx, %rsi
callq 0x8220
testl %eax, %eax
je 0x9e3c
leaq 0x14(%rbx), %rsi
movq %r14, %rdi
callq 0x8220
testl %eax, %eax
je 0x9e3c
addq $0x70, %rbx
movq %r15, %rdi
movq %rbx, %rsi
callq 0x8220
testl %eax, %eax
jne 0x9d3a
leaq 0x53ff5(%rip), %rsi     # 0x5dd70
movq %rsp, %rbx
movl $0x100, %edx            # imm = 0x100
movq %rbx, %rdi
callq 0xf038
movups 0x119b0(%rip), %xmm0    # 0x1b742
leaq 0x100(%rsp), %r14
movaps %xmm0, (%r14)
movl $0x203a6c, 0x10(%r14)   # imm = 0x203A6C
leaq 0x1e4e3(%rip), %r15     # 0x28290
leaq 0x11e48(%rip), %r12     # 0x1bbfc
leaq 0x1239b(%rip), %r13     # 0x1c156
leaq -0x5c(%r15), %rbp
movq %rbx, %rdi
movq %rbp, %rsi
callq 0x136e2
testl %eax, %eax
je 0x9e0e
movl $0x400, %edx            # imm = 0x400
movq %r14, %rdi
movq %rbp, %rsi
callq 0xefc4
movl $0x400, %edx            # imm = 0x400
movq %r14, %rdi
movq %r13, %rsi
callq 0xefc4
movq %r14, %rdi
callq 0x8120
cmpq $0x29, %rax
jb 0x9e0e
movq %r14, %rdi
xorl %eax, %eax
callq 0x1316b
movq %r14, %rdi
callq 0xf4dd
movq %r12, %rdi
movq %r15, %rsi
callq 0x8220
addq $0x70, %r15
testl %eax, %eax
jne 0x9dbb
cmpb $0x0, 0x100(%rsp)
je 0x9e51
leaq 0x100(%rsp), %rdi
xorl %eax, %eax
callq 0x1316b
jmp 0x9e51
leaq 0x3c(%rbx), %rdx
leaq 0x118f0(%rip), %rdi     # 0x1b737
movq %rbx, %rsi
xorl %eax, %eax
callq 0x1316b
xorl %eax, %eax
addq $0x508, %rsp            # imm = 0x508
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq