// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x530, %rsp            # imm = 0x530
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl $0x0, -0x1c(%rbp)
movl $0x1, -0x20(%rbp)
movq -0x8(%rbp), %rdi
callq 0x8110
movq %rax, %rcx
xorl %eax, %eax
cmpq %rcx, %rax
je 0xa77f
jmp 0xa6be
movq -0x8(%rbp), %rdi
movslq -0x1c(%rbp), %rax
leaq 0x25b43(%rip), %rsi     # 0x30210
imulq $0x70, %rax, %rax
addq %rax, %rsi
callq 0x8200
movl %eax, %ecx
xorl %eax, %eax
cmpl %ecx, %eax
je 0xa708
movq -0x8(%rbp), %rdi
movslq -0x1c(%rbp), %rax
leaq 0x25b20(%rip), %rsi     # 0x30210
imulq $0x70, %rax, %rax
addq %rax, %rsi
addq $0x14, %rsi
callq 0x8200
movl %eax, %ecx
xorl %eax, %eax
cmpl %ecx, %eax
jne 0xa747
movslq -0x1c(%rbp), %rax
leaq 0x25afd(%rip), %rsi     # 0x30210
imulq $0x70, %rax, %rax
addq %rax, %rsi
movslq -0x1c(%rbp), %rax
leaq 0x25aeb(%rip), %rdx     # 0x30210
imulq $0x70, %rax, %rax
addq %rax, %rdx
addq $0x3c, %rdx
leaq 0x19000(%rip), %rdi     # 0x23737
movb $0x0, %al
callq 0x17af0
movl $0x0, -0x20(%rbp)
jmp 0xa77d
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
movslq -0x1c(%rbp), %rax
leaq 0x25ab5(%rip), %rsi     # 0x30210
imulq $0x70, %rax, %rax
addq %rax, %rsi
leaq 0x19493(%rip), %rdi     # 0x23bfc
callq 0x8200
movl %eax, %ecx
xorl %eax, %eax
cmpl %ecx, %eax
jne 0xa778
jmp 0xa77d
jmp 0xa6be
jmp 0xa77f
cmpl $0x0, -0x20(%rbp)
je 0xa8bf
leaq -0x520(%rbp), %rax
movq %rax, -0x528(%rbp)
callq 0xa8d0
movq -0x528(%rbp), %rdi
movq %rax, %rsi
movl $0x100, %edx            # imm = 0x100
callq 0x11bc0
leaq -0x420(%rbp), %rdi
leaq 0x18f84(%rip), %rsi     # 0x23742
movl $0x400, %edx            # imm = 0x400
callq 0x11bc0
movl $0x0, -0x1c(%rbp)
leaq -0x520(%rbp), %rdi
movslq -0x1c(%rbp), %rax
leaq 0x25a2f(%rip), %rsi     # 0x30210
imulq $0x70, %rax, %rax
addq %rax, %rsi
addq $0x14, %rsi
callq 0x18320
cmpl $0x0, %eax
je 0xa863
leaq -0x420(%rbp), %rdi
movslq -0x1c(%rbp), %rax
leaq 0x25a08(%rip), %rsi     # 0x30210
imulq $0x70, %rax, %rax
addq %rax, %rsi
addq $0x14, %rsi
movl $0x400, %edx            # imm = 0x400
callq 0x11aa0
leaq -0x420(%rbp), %rdi
leaq 0x1992d(%rip), %rsi     # 0x24158
movl $0x400, %edx            # imm = 0x400
callq 0x11aa0
leaq -0x420(%rbp), %rdi
callq 0x8110
cmpq $0x28, %rax
jbe 0xa861
leaq -0x420(%rbp), %rdi
movb $0x0, %al
callq 0x17af0
leaq -0x420(%rbp), %rdi
callq 0x122b0
jmp 0xa863
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
movslq -0x1c(%rbp), %rax
leaq 0x25999(%rip), %rsi     # 0x30210
imulq $0x70, %rax, %rax
addq %rax, %rsi
leaq 0x19377(%rip), %rdi     # 0x23bfc
callq 0x8200
movl %eax, %ecx
xorl %eax, %eax
cmpl %ecx, %eax
jne 0xa894
jmp 0xa899
jmp 0xa7cf
leaq -0x420(%rbp), %rdi
callq 0x8110
movq %rax, %rcx
xorl %eax, %eax
cmpq %rcx, %rax
je 0xa8bd
leaq -0x420(%rbp), %rdi
movb $0x0, %al
callq 0x17af0
jmp 0xa8bf
xorl %eax, %eax
addq $0x530, %rsp            # imm = 0x530
popq %rbp
retq
nopw (%rax,%rax)