// File: /workspace/github_c_makefile_star2_O2/schroeder-lvb[P]sissm/src/api.c
// Function: apiSay
int apiSay( const char * format, ... )
{
    static char buffer[API_T_BUFSIZE];
    char rconCmd[API_T_BUFSIZE], rconResp[API_R_BUFSIZE];
    int bytesRead, errCode;
    int triplePrint = 0;

    va_list args;
    va_start( args, format ); 
    vsnprintf( buffer, (API_T_BUFSIZE >= API_MAXSAY) ? API_MAXSAY : API_T_BUFSIZE, format, args );

    apiRemoveCodes( buffer );                         // remove color codes if mod is not installed

    if ( snprintf( rconCmd, API_T_BUFSIZE, "say %s%s%s", sayPrefix, buffer, sayPostfix ) < 0) 
        logPrintf( LOG_LEVEL_WARN, "api", "Overflow warning at apiSay" );
    if ( 0 != strlen( buffer ) )  {  // say only when something to be said
        if ( buffer[0] == '*' ) triplePrint = 1;
        if ( 0 == (int) p2pGetF("api.p2p.sayDisable", 0.0 ) ) {
            errCode = rdrvCommand( _rPtr, 2, rconCmd, rconResp, &bytesRead ); 
            if ( triplePrint ) errCode |= rdrvCommand( _rPtr, 2, rconCmd, rconResp, &bytesRead ); 
            if ( triplePrint ) errCode |= rdrvCommand( _rPtr, 2, rconCmd, rconResp, &bytesRead ); 
        }
    }
    va_end (args);
    return errCode;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x20e8, %rsp           # imm = 0x20E8
movq %rdi, %r10
leaq 0x30(%rsp), %rdi
movq %rsi, 0x8(%rdi)
movq %rdx, 0x10(%rdi)
movq %rcx, 0x18(%rdi)
movq %r8, 0x20(%rdi)
movq %r9, 0x28(%rdi)
testb %al, %al
je 0x12614
movapd %xmm0, 0x60(%rsp)
movaps %xmm1, 0x70(%rsp)
movaps %xmm2, 0x80(%rsp)
movaps %xmm3, 0x90(%rsp)
movaps %xmm4, 0xa0(%rsp)
movaps %xmm5, 0xb0(%rsp)
movaps %xmm6, 0xc0(%rsp)
movaps %xmm7, 0xd0(%rsp)
leaq 0x10(%rsp), %rcx
movq %rdi, 0x10(%rcx)
leaq 0x2120(%rsp), %rax
movq %rax, 0x8(%rcx)
movabsq $0x3000000008, %rax     # imm = 0x3000000008
movq %rax, (%rcx)
leaq 0x1615a3(%rip), %rbx    # 0x173be0
pushq $0x50
popq %rsi
movq %rbx, %rdi
movq %r10, %rdx
callq 0x80c0
movq %rbx, %rdi
callq 0x1040c
leaq 0xadc4(%rip), %rdx      # 0x1d41e
leaq 0x14516f(%rip), %rcx    # 0x1577d0
leaq 0x145268(%rip), %r9     # 0x1578d0
leaq 0xe0(%rsp), %rdi
movl $0x1000, %esi           # imm = 0x1000
movq %rbx, %r8
xorl %eax, %eax
callq 0x8190
testl %eax, %eax
jns 0x1269b
leaq 0xa7e5(%rip), %rsi      # 0x1ce6f
leaq 0xad98(%rip), %rdx      # 0x1d429
pushq $0x1
popq %rdi
xorl %eax, %eax
callq 0x1920b
movb 0x16153e(%rip), %bpl    # 0x173be0
testb %bpl, %bpl
je 0x1273f
leaq 0x880d(%rip), %rdi      # 0x1aebf
xorpd %xmm0, %xmm0
callq 0x17102
cvttsd2si %xmm0, %eax
testl %eax, %eax
jne 0x1273f
movq 0xc6dbe(%rip), %rdi     # 0xd9488
pushq $0x2
popq %rsi
leaq 0xe0(%rsp), %rdx
leaq 0x10e0(%rsp), %rcx
leaq 0xc(%rsp), %r8
callq 0x961f
movl %eax, %ebx
cmpb $0x2a, %bpl
jne 0x1273f
movq 0xc6d92(%rip), %rdi     # 0xd9488
pushq $0x2
popq %rbp
leaq 0xe0(%rsp), %r14
leaq 0x10e0(%rsp), %r15
leaq 0xc(%rsp), %r12
movl %ebp, %esi
movq %r14, %rdx
movq %r15, %rcx
movq %r12, %r8
callq 0x961f
movl %eax, %r13d
movq 0xc6d60(%rip), %rdi     # 0xd9488
movl %ebp, %esi
movq %r14, %rdx
movq %r15, %rcx
movq %r12, %r8
callq 0x961f
orl %r13d, %eax
orl %eax, %ebx
jmp 0x1273f
movl %ebx, %eax
addq $0x20e8, %rsp           # imm = 0x20E8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq