// File: /workspace/github_cpp_makefile_star2_O2/tobias93[P]piano/rtmidi_build/tests/midiprobe.cpp
// Function: main
int main()
{
  // Create an api map.
  std::map<int, std::string> apiMap;
  apiMap[RtMidi::MACOSX_CORE] = "OS-X CoreMidi";
  apiMap[RtMidi::WINDOWS_MM] = "Windows MultiMedia";
  apiMap[RtMidi::UNIX_JACK] = "Jack Client";
  apiMap[RtMidi::LINUX_ALSA] = "Linux ALSA";
  apiMap[RtMidi::RTMIDI_DUMMY] = "RtMidi Dummy";

  std::vector< RtMidi::Api > apis;
  RtMidi :: getCompiledApi( apis );

  std::cout << "\nCompiled APIs:\n";
  for ( unsigned int i=0; i<apis.size(); i++ )
    std::cout << "  " << apiMap[ apis[i] ] << std::endl;

  RtMidiIn  *midiin = 0;
  RtMidiOut *midiout = 0;

  try {

    // RtMidiIn constructor ... exception possible
    midiin = new RtMidiIn();

    std::cout << "\nCurrent input API: " << apiMap[ midiin->getCurrentApi() ] << std::endl;

    // Check inputs.
    unsigned int nPorts = midiin->getPortCount();
    std::cout << "\nThere are " << nPorts << " MIDI input sources available.\n";

    for ( unsigned i=0; i<nPorts; i++ ) {
      std::string portName = midiin->getPortName(i);
      std::cout << "  Input Port #" << i+1 << ": " << portName << '\n';
    }

    // RtMidiOut constructor ... exception possible
    midiout = new RtMidiOut();

    std::cout << "\nCurrent output API: " << apiMap[ midiout->getCurrentApi() ] << std::endl;

    // Check outputs.
    nPorts = midiout->getPortCount();
    std::cout << "\nThere are " << nPorts << " MIDI output ports available.\n";

    for ( unsigned i=0; i<nPorts; i++ ) {
      std::string portName = midiout->getPortName(i);
      std::cout << "  Output Port #" << i+1 << ": " << portName << std::endl;
    }
    std::cout << std::endl;

  } catch ( RtMidiError &error ) {
    error.printMessage();
  }

  delete midiin;
  delete midiout;

  return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xb8, %rsp
leaq 0x50(%rsp), %rax
andl $0x0, (%rax)
andq $0x0, 0x8(%rax)
movq %rax, 0x10(%rax)
movq %rax, 0x18(%rax)
andq $0x0, 0x20(%rax)
leaq 0x10(%rsp), %rsi
movl $0x1, (%rsi)
leaq 0x48(%rsp), %rdi
callq 0x287e
leaq 0xca1(%rip), %rsi       # 0x3004
movq %rax, %rdi
callq 0x21e0
leaq 0x10(%rsp), %rsi
movl $0x4, (%rsi)
leaq 0x48(%rsp), %rdi
callq 0x287e
leaq 0xc8b(%rip), %rsi       # 0x3012
movq %rax, %rdi
callq 0x21e0
leaq 0x10(%rsp), %rsi
movl $0x3, (%rsi)
leaq 0x48(%rsp), %rdi
callq 0x287e
leaq 0xc7a(%rip), %rsi       # 0x3025
movq %rax, %rdi
callq 0x21e0
leaq 0x10(%rsp), %rsi
movl $0x2, (%rsi)
leaq 0x48(%rsp), %rdi
callq 0x287e
leaq 0xc62(%rip), %rsi       # 0x3031
movq %rax, %rdi
callq 0x21e0
leaq 0x10(%rsp), %rsi
movl $0x5, (%rsi)
leaq 0x48(%rsp), %rdi
callq 0x287e
leaq 0xc49(%rip), %rsi       # 0x303c
movq %rax, %rdi
callq 0x21e0
xorps %xmm0, %xmm0
leaq 0x30(%rsp), %rdi
movaps %xmm0, (%rdi)
andq $0x0, 0x10(%rdi)
callq 0x2030
movq 0x2bc1(%rip), %rdi      # 0x4fd8
leaq 0xc2b(%rip), %rsi       # 0x3049
callq 0x2140
xorl %ebp, %ebp
movq 0x2bac(%rip), %rbx      # 0x4fd8
leaq 0xc27(%rip), %r14       # 0x305a
leaq 0x48(%rsp), %r15
leaq 0x10(%rsp), %r12
movl %ebp, %ebp
movq 0x38(%rsp), %rax
subq 0x30(%rsp), %rax
sarq $0x2, %rax
cmpq %rbp, %rax
jbe 0x248e
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2140
movq %rax, %r13
movq 0x30(%rsp), %rax
movl (%rax,%rbp,4), %eax
movl %eax, 0x10(%rsp)
movq %r15, %rdi
movq %r12, %rsi
callq 0x287e
movq %r13, %rdi
movq %rax, %rsi
callq 0x2120
movq %rax, %rdi
callq 0x20a0
incl %ebp
jmp 0x243d
xorl %r13d, %r13d
pushq $0x10
popq %rdi
callq 0x2150
movq %rax, 0x8(%rsp)
leaq 0xbb8(%rip), %rsi       # 0x305d
leaq 0x98(%rsp), %rdi
leaq 0x10(%rsp), %rdx
callq 0x28cc
leaq 0x98(%rsp), %rdx
pushq $0x64
popq %rcx
movq 0x8(%rsp), %r14
movq %r14, %rdi
xorl %esi, %esi
callq 0x20e0
leaq 0x98(%rsp), %rdi
callq 0x2090
movq 0x2af3(%rip), %rdi      # 0x4fd8
leaq 0xb85(%rip), %rsi       # 0x3071
movq %r14, %r13
callq 0x2140
movq %rax, %rbx
movq %r14, %rdi
callq 0x2908
leaq 0x10(%rsp), %rsi
movl %eax, (%rsi)
leaq 0x48(%rsp), %rdi
callq 0x287e
movq %rbx, %rdi
movq %rax, %rsi
callq 0x2120
movq %rax, %rdi
callq 0x20a0
movq 0x8(%rsp), %rdi
movq (%rdi), %rax
xorl %r13d, %r13d
callq *0x10(%rax)
movl %eax, %ebx
xorl %r13d, %r13d
movq 0x2a9b(%rip), %rdi      # 0x4fd8
leaq 0xb42(%rip), %rsi       # 0x3086
callq 0x2140
movl %ebx, %r14d
xorl %r13d, %r13d
movq %rax, %rdi
movq %r14, %rsi
callq 0x20b0
xorl %r13d, %r13d
leaq 0xb2e(%rip), %rsi       # 0x3092
movq %rax, %rdi
callq 0x2140
xorl %r15d, %r15d
leaq 0x10(%rsp), %r12
leaq 0xb37(%rip), %rbp       # 0x30b2
leaq 0xb01(%rip), %rbx       # 0x3083
pushq $0xa
popq %r13
cmpq %r15, %r14
je 0x25e4
movq 0x8(%rsp), %rsi
movq (%rsi), %rax
movq %r12, %rdi
movl %r15d, %edx
callq *0x18(%rax)
movq 0x2a35(%rip), %rdi      # 0x4fd8
movq %rbp, %rsi
callq 0x2140
incq %r15
movq %rax, %rdi
movq %r15, %rsi
callq 0x20b0
movq %rax, %rdi
movq %rbx, %rsi
callq 0x2140
movq %rax, %rdi
movq %r12, %rsi
callq 0x2120
movq %rax, %rdi
movl %r13d, %esi
callq 0x2180
movq %r12, %rdi
callq 0x2090
jmp 0x2586
xorl %r13d, %r13d
pushq $0x10
popq %rdi
callq 0x2150
movq %rax, %r14
leaq 0xac8(%rip), %rsi       # 0x30c1
leaq 0x78(%rsp), %rdi
leaq 0x10(%rsp), %rdx
callq 0x28cc
leaq 0x78(%rsp), %rdx
movq %r14, %rdi
xorl %esi, %esi
callq 0x2130
leaq 0x78(%rsp), %rdi
callq 0x2090
movq 0x29b0(%rip), %rdi      # 0x4fd8
leaq 0xaa7(%rip), %rsi       # 0x30d6
movq %r14, %r13
callq 0x2140
movq %rax, %rbx
movq %r14, %rdi
callq 0x291e
leaq 0x10(%rsp), %rsi
movl %eax, (%rsi)
leaq 0x48(%rsp), %rdi
callq 0x287e
movq %rbx, %rdi
movq %rax, %rsi
callq 0x2120
movq %rax, %rdi
callq 0x20a0
movq (%r14), %rax
movq %r14, %r13
movq %r14, %rdi
callq *0x10(%rax)
movl %eax, %ebx
movq 0x295d(%rip), %rdi      # 0x4fd8
leaq 0xa04(%rip), %rsi       # 0x3086
movq %r14, %r13
callq 0x2140
movl %ebx, %r15d
movq %r14, %r13
movq %rax, %rdi
movq %r15, %rsi
callq 0x20b0
leaq 0xa4a(%rip), %rsi       # 0x30ec
movq %r14, %r13
movq %rax, %rdi
callq 0x2140
xorl %r12d, %r12d
leaq 0x10(%rsp), %r13
leaq 0xa4f(%rip), %rbp       # 0x310b
leaq 0x9c0(%rip), %rbx       # 0x3083
cmpq %r12, %r15
je 0x271c
movq (%r14), %rax
movq %r13, %rdi
movq %r14, %rsi
movl %r12d, %edx
callq *0x18(%rax)
movq 0x28fa(%rip), %rdi      # 0x4fd8
movq %rbp, %rsi
callq 0x2140
incq %r12
movq %rax, %rdi
movq %r12, %rsi
callq 0x20b0
movq %rax, %rdi
movq %rbx, %rsi
callq 0x2140
movq %rax, %rdi
movq %r13, %rsi
callq 0x2120
movq %rax, %rdi
callq 0x20a0
movq %r13, %rdi
callq 0x2090
jmp 0x26c3
movq 0x28b5(%rip), %rdi      # 0x4fd8
movq %r14, %r13
callq 0x20a0
movq 0x8(%rsp), %rdi
movq (%rdi), %rax
callq *0x40(%rax)
testq %r14, %r14
je 0x2744
movq (%r14), %rax
movq %r14, %rdi
callq *0x40(%rax)
leaq 0x30(%rsp), %rdi
callq 0x2c1c
leaq 0x48(%rsp), %rdi
callq 0x293e
xorl %eax, %eax
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rdx, %r12
movq %rax, %r15
leaq 0x78(%rsp), %rdi
callq 0x2090
jmp 0x2784
movq %rdx, %r12
movq %rax, %r15
pushq $0x10
popq %rsi
movq %r14, %rdi
callq 0x2160
jmp 0x284b
movq %rdx, %r12
movq %rax, %r15
leaq 0x98(%rsp), %rdi
callq 0x2090
jmp 0x27af
movq %rdx, %r12
movq %rax, %r15
pushq $0x10
popq %rsi
movq 0x8(%rsp), %rdi
callq 0x2160
movq $0x0, 0x8(%rsp)
jmp 0x284b
jmp 0x280a
movq %rdx, %r12
movq %rax, %r15
xorl %r14d, %r14d
movq %r13, 0x8(%rsp)
jmp 0x284e
jmp 0x27e4
jmp 0x27e4
jmp 0x27e4
jmp 0x27e4
movq %rax, %r15
jmp 0x2817
jmp 0x27f8
jmp 0x2800
movq %rdx, %r12
movq %rax, %r15
movq %r13, %r14
jmp 0x284e
movq %rdx, %r12
movq %rax, %r15
jmp 0x284e
movq %rdx, %r12
movq %rax, %r15
jmp 0x284b
jmp 0x280a
movq %rax, %r15
leaq 0x30(%rsp), %rdi
callq 0x2c1c
leaq 0x48(%rsp), %rdi
callq 0x293e
movq %r15, %rdi
callq 0x21c0
movq %rdx, %r12
movq %rax, %r15
leaq 0x10(%rsp), %rdi
callq 0x2090
jmp 0x284e
movq %rdx, %r12
movq %rax, %r15
leaq 0x10(%rsp), %rdi
callq 0x2090
xorl %r14d, %r14d
cmpl $0x1, %r12d
jne 0x280d
movq %r15, %rdi
callq 0x2070
movq (%rax), %rcx
movq %rax, %rdi
callq *0x18(%rcx)
callq 0x21b0
cmpq $0x0, 0x8(%rsp)
jne 0x272b
jmp 0x2736
jmp 0x280a
nop