// File: tobias93[P]piano/rtaudio/RtAudio.cpp
// Function: RtApi::error(RtAudioError::Type)
void RtApi :: error( RtAudioError::Type type )
{
  errorStream_.str(""); // clear the ostringstream

  RtAudioErrorCallback errorCallback = (RtAudioErrorCallback) stream_.callbackInfo.errorCallback;
  if ( errorCallback ) {
    // abortStream() can generate new error messages. Ignore them. Just keep original one.

    if ( firstErrorOccurred_ )
      return;

    firstErrorOccurred_ = true;
    const std::string errorMessage = errorText_;

    if ( type != RtAudioError::WARNING && stream_.state != STREAM_STOPPED) {
      stream_.callbackInfo.isRunning = false; // exit from the thread
      abortStream();
    }

    errorCallback( type, errorMessage );
    firstErrorOccurred_ = false;
    return;
  }

  if ( type == RtAudioError::WARNING && showWarnings_ == true )
    std::cerr << '\n' << errorText_ << "\n\n";
  else if ( type != RtAudioError::WARNING )
    throw( RtAudioError( errorText_, type ) );
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x88(%rbp)
addq $0x8, %rax
movq %rax, -0x80(%rbp)
leaq -0x31(%rbp), %rdi
movq %rdi, -0x78(%rbp)
callq 0x8480
movq -0x78(%rbp), %rdx
leaq 0x9576(%rip), %rsi      # 0x13513
leaq -0x30(%rbp), %rdi
callq 0xf9e0
jmp 0x9fa8
movq -0x80(%rbp), %rdi
leaq -0x30(%rbp), %rsi
callq 0x8100
jmp 0x9fb7
leaq -0x30(%rbp), %rdi
callq 0x8140
leaq -0x31(%rbp), %rdi
callq 0x8270
movq -0x88(%rbp), %rax
movq 0x278(%rax), %rax
movq %rax, -0x50(%rbp)
cmpq $0x0, -0x50(%rbp)
je 0xa0c0
movq -0x88(%rbp), %rax
testb $0x1, 0x348(%rax)
je 0xa02c
jmp 0xa161
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0xa01e
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x30(%rbp), %rdi
callq 0x8140
leaq -0x31(%rbp), %rdi
callq 0x8270
jmp 0xa16a
movq -0x88(%rbp), %rsi
movb $0x1, 0x348(%rsi)
addq $0x180, %rsi            # imm = 0x180
leaq -0x70(%rbp), %rdi
callq 0x80e0
cmpl $0x0, -0xc(%rbp)
je 0xa095
movq -0x88(%rbp), %rax
cmpl $0x0, 0x1bc(%rax)
je 0xa095
movq -0x88(%rbp), %rdi
movb $0x0, 0x288(%rdi)
movq (%rdi), %rax
movq 0x50(%rax), %rax
callq *%rax
jmp 0xa079
jmp 0xa095
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x70(%rbp), %rdi
callq 0x8140
jmp 0xa16a
movq -0x50(%rbp), %rax
movl -0xc(%rbp), %edi
leaq -0x70(%rbp), %rsi
callq *%rax
jmp 0xa0a4
movq -0x88(%rbp), %rax
movb $0x0, 0x348(%rax)
leaq -0x70(%rbp), %rdi
callq 0x8140
jmp 0xa161
cmpl $0x0, -0xc(%rbp)
jne 0xa115
movq -0x88(%rbp), %rax
movb 0x1a0(%rax), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x1, %eax
jne 0xa115
movq 0xdf0c(%rip), %rdi      # 0x17ff0
movl $0xa, %esi
callq 0x82a0
movq -0x88(%rbp), %rsi
movq %rax, %rdi
addq $0x180, %rsi            # imm = 0x180
callq 0x81e0
movq %rax, %rdi
leaq 0x9403(%rip), %rsi      # 0x13511
callq 0x8210
jmp 0xa161
cmpl $0x0, -0xc(%rbp)
je 0xa15f
movl $0x30, %edi
callq 0x8110
movq -0x88(%rbp), %rsi
movq %rax, %rdi
movq %rdi, -0x90(%rbp)
addq $0x180, %rsi            # imm = 0x180
movl -0xc(%rbp), %edx
callq 0xfb80
movq -0x90(%rbp), %rdi
leaq 0xda9d(%rip), %rsi      # 0x17bf0
leaq 0x5a86(%rip), %rdx      # 0xfbe0
callq 0x8450
jmp 0xa161
addq $0x90, %rsp
popq %rbp
retq
movq -0x40(%rbp), %rdi
callq 0x8460
nopw %cs:(%rax,%rax)