// File: rofl0r[P]ascc/cc_error.cpp
// Function: cc_error(char const*, ...)
void cc_error(const char *descr, ...)
{
    ccErrorIsUserError = false;
    if (descr[0] == '!')
    {
        ccErrorIsUserError = true;
        descr++;
    }

    char displbuf[1000];
    va_list ap;

    va_start(ap, descr);
    vsprintf(displbuf, descr, ap);
    va_end(ap);

    if (currentline > 0)
    {
        // [IKM] Implementation is project-specific
        std::pair<String, String> errinfo = cc_error_at_line(displbuf);
        ccErrorString = errinfo.first;
        ccErrorCallStack = errinfo.second;
    }
    else
    {
        ccErrorString = cc_error_without_line(displbuf);
        ccErrorCallStack = "";
    }

    if(ccPrintAllErrors) {
        std::cout << ccErrorString;
        std::cout << std::endl;
        if(ccErrorCallStack != "") {
            std::cout << ccErrorCallStack;
            std::cout << std::endl;
        }
    }

    ccError = 1;
    ccErrorLine = currentline;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x500, %rsp            # imm = 0x500
testb %al, %al
je 0x1bb07
movaps %xmm0, -0x4c0(%rbp)
movaps %xmm1, -0x4b0(%rbp)
movaps %xmm2, -0x4a0(%rbp)
movaps %xmm3, -0x490(%rbp)
movaps %xmm4, -0x480(%rbp)
movaps %xmm5, -0x470(%rbp)
movaps %xmm6, -0x460(%rbp)
movaps %xmm7, -0x450(%rbp)
movq %r9, -0x4c8(%rbp)
movq %r8, -0x4d0(%rbp)
movq %rcx, -0x4d8(%rbp)
movq %rdx, -0x4e0(%rbp)
movq %rsi, -0x4e8(%rbp)
movq %rdi, -0x8(%rbp)
movb $0x0, 0x26d33(%rip)     # 0x42868
movq -0x8(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x21, %eax
jne 0x1bb54
movb $0x1, 0x26d20(%rip)     # 0x42868
movq -0x8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x8(%rbp)
leaq -0x410(%rbp), %rax
leaq -0x4f0(%rbp), %rcx
movq %rcx, 0x10(%rax)
leaq 0x10(%rbp), %rcx
movq %rcx, 0x8(%rax)
movl $0x30, 0x4(%rax)
movl $0x8, (%rax)
leaq -0x3f0(%rbp), %rdi
movq -0x8(%rbp), %rsi
leaq -0x410(%rbp), %rdx
callq 0x41f0
leaq -0x410(%rbp), %rax
leaq 0x26d90(%rip), %rax     # 0x42930
cmpl $0x0, (%rax)
jle 0x1bc1d
leaq -0x420(%rbp), %rdi
movq %rdi, -0x4f8(%rbp)
leaq -0x3f0(%rbp), %rsi
callq 0x265d0
movq -0x4f8(%rbp), %rsi
leaq 0x26c8b(%rip), %rdi     # 0x42858
callq 0x27b20
jmp 0x1bbd4
leaq -0x418(%rbp), %rsi
leaq 0x26c7e(%rip), %rdi     # 0x42860
callq 0x27b20
jmp 0x1bbe9
leaq -0x420(%rbp), %rdi
callq 0x1bd40
jmp 0x1bc90
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x428(%rbp)
movl %eax, -0x42c(%rbp)
leaq -0x420(%rbp), %rdi
callq 0x1bd40
jmp 0x1bd32
leaq -0x438(%rbp), %rdi
movq %rdi, -0x500(%rbp)
leaq -0x3f0(%rbp), %rsi
callq 0x26680
movq -0x500(%rbp), %rsi
leaq 0x26c13(%rip), %rdi     # 0x42858
callq 0x27b20
jmp 0x1bc4c
leaq -0x438(%rbp), %rdi
callq 0x27de0
leaq 0x26c01(%rip), %rdi     # 0x42860
leaq 0x18506(%rip), %rsi     # 0x3416c
callq 0x27bd0
jmp 0x1bc90
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x428(%rbp)
movl %eax, -0x42c(%rbp)
leaq -0x438(%rbp), %rdi
callq 0x27de0
jmp 0x1bd32
cmpl $0x0, 0x26bb5(%rip)     # 0x4284c
je 0x1bd10
leaq 0x26bb8(%rip), %rdi     # 0x42858
callq 0x6180
movq %rax, %rsi
movq 0x26309(%rip), %rdi     # 0x41fb8
callq 0x4360
movq 0x262fd(%rip), %rdi     # 0x41fb8
movq 0x262de(%rip), %rsi     # 0x41fa0
callq 0x43b0
leaq 0x26b92(%rip), %rdi     # 0x42860
leaq 0x18497(%rip), %rsi     # 0x3416c
callq 0x1bd70
testb $0x1, %al
jne 0x1bce0
jmp 0x1bd0e
leaq 0x26b79(%rip), %rdi     # 0x42860
callq 0x6180
movq %rax, %rsi
movq 0x262c2(%rip), %rdi     # 0x41fb8
callq 0x4360
movq 0x262b6(%rip), %rdi     # 0x41fb8
movq 0x26297(%rip), %rsi     # 0x41fa0
callq 0x43b0
jmp 0x1bd10
movl $0x1, 0x26b36(%rip)     # 0x42850
leaq 0x26c0f(%rip), %rax     # 0x42930
movl (%rax), %eax
movl %eax, 0x26b2b(%rip)     # 0x42854
addq $0x500, %rsp            # imm = 0x500
popq %rbp
retq
movq -0x428(%rbp), %rdi
callq 0x4670
nop