// File: danomatika[P]miditester/src/RtMidi.cpp
// Function: RtMidiIn::RtMidiIn(RtMidi::Api, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, unsigned int)
RtMidiIn :: RtMidiIn( RtMidi::Api api, const std::string clientName, unsigned int queueSizeLimit )
  : RtMidi()
{
  if ( api != UNSPECIFIED ) {
    // Attempt to open the specified API.
    openMidiApi( api, clientName, queueSizeLimit );
    if ( rtapi_ ) return;

    // No compiled support for specified API value.  Issue a warning
    // and continue as if no API was specified.
    std::cerr << "\nRtMidiIn: no compiled support for specified API argument!\n\n" << std::endl;
  }

  // Iterate through the compiled APIs and return as soon as we find
  // one with at least one port or we reach the end of the list.
  std::vector< RtMidi::Api > apis;
  getCompiledApi( apis );
  for ( unsigned int i=0; i<apis.size(); i++ ) {
    openMidiApi( apis[i], clientName, queueSizeLimit );
    if ( rtapi_->getPortCount() ) break;
  }

  if ( rtapi_ ) return;

  // It should not be possible to get here because the preprocessor
  // definition __RTMIDI_DUMMY__ is automatically defined if no
  // API-specific definitions are passed to the compiler. But just in
  // case something weird happens, we'll throw an error.
  std::string errorText = "RtMidiIn: no compiled API support found ... critical error!!";
  throw( RtMidiError( errorText, RtMidiError::UNSPECIFIED ) );
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x100, %rsp            # imm = 0x100
movq %rdx, -0xc8(%rbp)
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movq -0x8(%rbp), %rdi
movq %rdi, -0xc0(%rbp)
callq 0xc610
movq -0xc0(%rbp), %rax
leaq 0xb172(%rip), %rcx      # 0x17a00
addq $0x10, %rcx
movq %rcx, (%rax)
cmpl $0x0, -0xc(%rbp)
je 0xc94f
movq -0xc8(%rbp), %rsi
movl -0xc(%rbp), %eax
movl %eax, -0xcc(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x30e0
jmp 0xc8ba
movl -0xcc(%rbp), %esi
movq -0xc0(%rbp), %rdi
movl -0x1c(%rbp), %ecx
leaq -0x40(%rbp), %rdx
callq 0xc750
jmp 0xc8d5
leaq -0x40(%rbp), %rdi
callq 0x3150
movq -0xc0(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0xc91c
jmp 0xcb2b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0xcb1d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x40(%rbp), %rdi
callq 0x3150
jmp 0xcb1d
movq 0xb6cd(%rip), %rdi      # 0x17ff0
leaq 0x3f54(%rip), %rsi      # 0x1087e
callq 0x31d0
movq %rax, -0xd8(%rbp)
jmp 0xc938
movq -0xd8(%rbp), %rdi
movq 0xb672(%rip), %rsi      # 0x17fb8
callq 0x3200
jmp 0xc94d
jmp 0xc94f
leaq -0x68(%rbp), %rdi
callq 0xd960
leaq -0x68(%rbp), %rdi
callq 0xc710
movl $0x0, -0x6c(%rbp)
movl -0x6c(%rbp), %eax
movq %rax, -0xe0(%rbp)
leaq -0x68(%rbp), %rdi
callq 0xd980
movq %rax, %rcx
movq -0xe0(%rbp), %rax
cmpq %rcx, %rax
jae 0xca4a
movl -0x6c(%rbp), %eax
movl %eax, %esi
leaq -0x68(%rbp), %rdi
callq 0xd9a0
movq -0xc8(%rbp), %rsi
movl (%rax), %eax
movl %eax, -0xe4(%rbp)
leaq -0x90(%rbp), %rdi
callq 0x30e0
jmp 0xc9b9
movl -0xe4(%rbp), %esi
movq -0xc0(%rbp), %rdi
movl -0x1c(%rbp), %ecx
leaq -0x90(%rbp), %rdx
callq 0xc750
jmp 0xc9d7
leaq -0x90(%rbp), %rdi
callq 0x3150
movq -0xc0(%rbp), %rax
movq 0x8(%rax), %rdi
movq (%rdi), %rax
movq 0x30(%rax), %rax
callq *%rax
movl %eax, -0xe8(%rbp)
jmp 0xc9ff
movl -0xe8(%rbp), %eax
cmpl $0x0, %eax
je 0xca3a
jmp 0xca4a
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0xcb14
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x90(%rbp), %rdi
callq 0x3150
jmp 0xcb14
jmp 0xca3c
movl -0x6c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x6c(%rbp)
jmp 0xc968
movq -0xc0(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0xca66
leaq -0x68(%rbp), %rdi
callq 0xda60
jmp 0xcb2b
leaq -0xb1(%rbp), %rdi
movq %rdi, -0xf0(%rbp)
callq 0x3330
movq -0xf0(%rbp), %rdx
leaq 0x3e34(%rip), %rsi      # 0x108bb
leaq -0xb0(%rbp), %rdi
callq 0x8130
jmp 0xca95
leaq -0xb1(%rbp), %rdi
callq 0x3220
movl $0x30, %edi
callq 0x3100
movq %rax, %rdi
movq %rdi, -0xf8(%rbp)
leaq -0xb0(%rbp), %rsi
movl $0x2, %edx
callq 0xd9c0
movq -0xf8(%rbp), %rdi
leaq 0xb174(%rip), %rsi      # 0x17c48
leaq 0xf45(%rip), %rdx       # 0xda20
callq 0x3300
jmp 0xcb3d
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0xb1(%rbp), %rdi
callq 0x3220
jmp 0xcb14
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0xb0(%rbp), %rdi
callq 0x3150
leaq -0x68(%rbp), %rdi
callq 0xda60
movq -0xc0(%rbp), %rdi
callq 0xc640
jmp 0xcb34
addq $0x100, %rsp            # imm = 0x100
popq %rbp
retq
movq -0x48(%rbp), %rdi
callq 0x3320
nopl (%rax)