// File: /workspace/github_cpp_makefile_star2_O3/rurban[P]dgnlib/cpl_error.cpp
// Function: CPLErrorV
void    CPLErrorV(CPLErr eErrClass, int err_no, const char *fmt, va_list args )
{
    CPLErrorContext *psCtx = CPLGetErrorContext();

/* -------------------------------------------------------------------- */
/*      Expand the error message                                        */
/* -------------------------------------------------------------------- */
#if defined(HAVE_VSNPRINTF)
    {
        int nPR;

        while( ((nPR = vsnprintf( psCtx->szLastErrMsg, 
                                 psCtx->nLastErrMsgMax, fmt, args )) == -1
                || nPR >= psCtx->nLastErrMsgMax-1)
               && psCtx->nLastErrMsgMax < 1000000 )
        {
            psCtx->nLastErrMsgMax *= 3;
            psCtx = (CPLErrorContext *) 
                CPLRealloc(psCtx, sizeof(CPLErrorContext) - DEFAULT_LAST_ERR_MSG_SIZE + psCtx->nLastErrMsgMax + 1);
            CPLSetTLS( CTLS_ERRORCONTEXT, psCtx, TRUE );
        }
    }
#else
    vsprintf( psCtx->szLastErrMsg, fmt, args);
#endif

/* -------------------------------------------------------------------- */
/*      If the user provided his own error handling function, then      */
/*      call it, otherwise print the error to stderr and return.        */
/* -------------------------------------------------------------------- */
    psCtx->nLastErrNo = err_no;
    psCtx->eLastErrType = eErrClass;

    if( CPLGetConfigOption("CPL_LOG_ERRORS",NULL) != NULL )
        CPLDebug( "CPLError", "%s", psCtx->szLastErrMsg );

/* -------------------------------------------------------------------- */
/*      Invoke the current error handler.                               */
/* -------------------------------------------------------------------- */
    if( psCtx->psHandlerStack != NULL )
    {
        psCtx->psHandlerStack->pfnHandler(eErrClass, err_no, 
                                          psCtx->szLastErrMsg);
    }
    else
    {
        CPLMutexHolderD( &hErrorMutex );
        if( pfnErrorHandler != NULL )
            pfnErrorHandler(eErrClass, err_no, psCtx->szLastErrMsg);
    }

    if( eErrClass == CE_Fatal )
        abort();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rcx, %r12
movq %rdx, %r13
movl %esi, %ebp
movl %edi, %ebx
callq 0x47fa
movq %rax, %r15
leaq 0x14(%rax), %r14
movslq 0x10(%rax), %rsi
movq %r14, %rdi
movq %r13, %rdx
movq %r12, %rcx
callq 0x2190
cmpl $-0x1, %eax
sete %dl
movl 0x10(%r15), %ecx
leal -0x1(%rcx), %esi
cmpl %esi, %eax
setge %al
orb %dl, %al
cmpl $0xf4240, %ecx          # imm = 0xF4240
setl %dl
andb %al, %dl
cmpb $0x1, %dl
jne 0x4747
leal (%rcx,%rcx,2), %eax
movl %eax, 0x10(%r15)
movslq %eax, %rsi
addq $0x15, %rsi
movq %r15, %rdi
callq 0x2dcb
movq %rax, %r15
movl $0x5, %edi
movq %rax, %rsi
movl $0x1, %edx
callq 0x50f1
leaq 0x14(%r15), %r14
movslq 0x10(%r15), %rsi
movq %r14, %rdi
movq %r13, %rdx
movq %r12, %rcx
callq 0x2190
cmpl $-0x1, %eax
sete %dl
movl 0x10(%r15), %ecx
leal -0x1(%rcx), %esi
cmpl %esi, %eax
setge %al
orb %dl, %al
cmpb $0x1, %al
jne 0x4747
cmpl $0xf4240, %ecx          # imm = 0xF4240
jl 0x46e6
movl %ebp, (%r15)
movl %ebx, 0x4(%r15)
leaq 0xadd3(%rip), %rdi      # 0xf528
xorl %esi, %esi
callq 0x3872
testq %rax, %rax
je 0x4779
leaq 0xadcf(%rip), %rdi      # 0xf537
leaq 0xad57(%rip), %rsi      # 0xf4c6
movq %r14, %rdx
xorl %eax, %eax
callq 0x4844
movq 0x8(%r15), %rax
testq %rax, %rax
je 0x478e
movl %ebx, %edi
movl %ebp, %esi
movq %r14, %rdx
callq *0x8(%rax)
jmp 0x47ce
leaq 0x10bcb(%rip), %rsi     # 0x15360
leaq 0xada4(%rip), %rdx      # 0xf540
movq %rsp, %rdi
movsd 0xaa69(%rip), %xmm0     # 0xf210
movl $0xe5, %ecx
callq 0x4ecc
movq 0x10b18(%rip), %rax     # 0x152d0
testq %rax, %rax
je 0x47c6
movl %ebx, %edi
movl %ebp, %esi
movq %r14, %rdx
callq *%rax
movq %rsp, %rdi
callq 0x4ece
cmpl $0x4, %ebx
je 0x47e2
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x2170
movq %rax, %rbx
movq %rsp, %rdi
callq 0x4ece
movq %rbx, %rdi
callq 0x2500