// File: tobias93[P]piano/rtaudio/RtAudio.cpp
// Function: RtAudio::RtAudio(RtAudio::Api)
RtAudio :: RtAudio( RtAudio::Api api )
{
  rtapi_ = 0;

  if ( api != UNSPECIFIED ) {
    // Attempt to open the specified API.
    openRtApi( api );
    if ( rtapi_ ) return;

    // No compiled support for specified API value.  Issue a debug
    // warning and continue as if no API was specified.
    std::cerr << "\nRtAudio: no compiled support for specified API argument!\n" << std::endl;
  }

  // Iterate through the compiled APIs and return as soon as we find
  // one with at least one device or we reach the end of the list.
  std::vector< RtAudio::Api > apis;
  getCompiledApi( apis );
  for ( unsigned int i=0; i<apis.size(); i++ ) {
    openRtApi( apis[i] );
    if ( rtapi_ && rtapi_->getDeviceCount() ) break;
  }

  if ( rtapi_ ) return;

  // It should not be possible to get here because the preprocessor
  // definition __RTAUDIO_DUMMY__ is automatically defined if no
  // API-specific definitions are passed to the compiler. But just in
  // case something weird happens, we'll thow an error.
  std::string errorText = "\nRtAudio: no compiled API support found ... critical error!!\n\n";
  throw( RtAudioError( errorText, RtAudioError::UNSPECIFIED ) );
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x70(%rbp)
movq $0x0, (%rax)
cmpl $0x0, -0xc(%rbp)
je 0x9894
movq -0x70(%rbp), %rdi
movl -0xc(%rbp), %esi
callq 0x9770
movq -0x70(%rbp), %rax
cmpq $0x0, (%rax)
je 0x9872
jmp 0x99ea
movq 0xe777(%rip), %rdi      # 0x17ff0
leaq 0x9c1a(%rip), %rsi      # 0x1349a
callq 0x8210
movq %rax, %rdi
movq 0xe719(%rip), %rsi      # 0x17fa8
callq 0x8250
leaq -0x28(%rbp), %rdi
callq 0xfb20
leaq -0x28(%rbp), %rdi
callq 0x9730
movl $0x0, -0x2c(%rbp)
movl -0x2c(%rbp), %eax
movq %rax, -0x78(%rbp)
leaq -0x28(%rbp), %rdi
callq 0xfb40
movq %rax, %rcx
movq -0x78(%rbp), %rax
cmpq %rcx, %rax
jae 0x992b
movl -0x2c(%rbp), %eax
movl %eax, %esi
leaq -0x28(%rbp), %rdi
callq 0xfb60
movq -0x70(%rbp), %rdi
movl (%rax), %esi
callq 0x9770
jmp 0x98e4
movq -0x70(%rbp), %rax
cmpq $0x0, (%rax)
je 0x991e
movq -0x70(%rbp), %rax
movq (%rax), %rdi
movq (%rdi), %rax
movq 0x18(%rax), %rax
callq *%rax
movl %eax, -0x7c(%rbp)
jmp 0x9903
movl -0x7c(%rbp), %eax
cmpl $0x0, %eax
je 0x991e
jmp 0x992b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
jmp 0x99df
jmp 0x9920
movl -0x2c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x2c(%rbp)
jmp 0x98ad
movq -0x70(%rbp), %rax
cmpq $0x0, (%rax)
je 0x9943
leaq -0x28(%rbp), %rdi
callq 0xfc20
jmp 0x99ea
leaq -0x61(%rbp), %rdi
movq %rdi, -0x88(%rbp)
callq 0x8480
movq -0x88(%rbp), %rdx
leaq 0x9b74(%rip), %rsi      # 0x134d5
leaq -0x60(%rbp), %rdi
callq 0xf9e0
jmp 0x996c
leaq -0x61(%rbp), %rdi
callq 0x8270
movl $0x30, %edi
callq 0x8110
movq %rax, %rdi
movq %rdi, -0x90(%rbp)
leaq -0x60(%rbp), %rsi
movl $0x2, %edx
callq 0xfb80
movq -0x90(%rbp), %rdi
leaq 0xe24b(%rip), %rsi      # 0x17bf0
leaq 0x6234(%rip), %rdx      # 0xfbe0
callq 0x8450
jmp 0x99fc
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x61(%rbp), %rdi
callq 0x8270
jmp 0x99df
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x38(%rbp)
movl %eax, -0x3c(%rbp)
leaq -0x60(%rbp), %rdi
callq 0x8140
leaq -0x28(%rbp), %rdi
callq 0xfc20
jmp 0x99f3
addq $0x90, %rsp
popq %rbp
retq
movq -0x38(%rbp), %rdi
callq 0x8460
nopl (%rax)