// File: /workspace/github_c_makefile_star2_O3/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 %r12
pushq %rbx
subq $0x20e0, %rsp           # imm = 0x20E0
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 0x133a1
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 0x2110(%rsp), %rax
movq %rax, 0x8(%rcx)
movabsq $0x3000000008, %rax     # imm = 0x3000000008
movq %rax, (%rcx)
leaq 0x160816(%rip), %rbx    # 0x173be0
movl $0x50, %esi
movq %rbx, %rdi
movq %r10, %rdx
callq 0x80c0
movq %rbx, %rdi
callq 0x10fc8
leaq 0xb045(%rip), %rdx      # 0x1e42e
leaq 0x1443e0(%rip), %rcx    # 0x1577d0
leaq 0x1444d9(%rip), %r9     # 0x1578d0
leaq 0xe0(%rsp), %rdi
movl $0x1000, %esi           # imm = 0x1000
movq %rbx, %r8
xorl %eax, %eax
callq 0x8190
testl %eax, %eax
jns 0x1342c
leaq 0xaa66(%rip), %rsi      # 0x1de7f
leaq 0xb019(%rip), %rdx      # 0x1e439
movl $0x1, %edi
xorl %eax, %eax
callq 0x1a3e3
movb 0x1607ad(%rip), %bpl    # 0x173be0
testb %bpl, %bpl
je 0x134d3
leaq 0x8a7c(%rip), %rdi      # 0x1bebf
xorpd %xmm0, %xmm0
callq 0x18162
cvttsd2si %xmm0, %eax
testl %eax, %eax
jne 0x134d3
movq 0xc602d(%rip), %rdi     # 0xd9488
leaq 0xe0(%rsp), %rdx
leaq 0x10e0(%rsp), %rcx
leaq 0xc(%rsp), %r8
movl $0x2, %esi
callq 0x972d
movl %eax, %ebx
cmpb $0x2a, %bpl
jne 0x134d3
movq 0xc5fff(%rip), %rdi     # 0xd9488
leaq 0xe0(%rsp), %r14
leaq 0x10e0(%rsp), %r15
leaq 0xc(%rsp), %r12
movl $0x2, %esi
movq %r14, %rdx
movq %r15, %rcx
movq %r12, %r8
callq 0x972d
movl %eax, %ebp
movq 0xc5fce(%rip), %rdi     # 0xd9488
movl $0x2, %esi
movq %r14, %rdx
movq %r15, %rcx
movq %r12, %r8
callq 0x972d
orl %ebp, %eax
orl %eax, %ebx
jmp 0x134d3
movl %ebx, %eax
addq $0x20e0, %rsp           # imm = 0x20E0
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq