// File: /workspace/github_cpp_makefile_star2_O1/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
movl $0x0, (%rax)
xorl %ecx, %ecx
movq %rcx, 0x8(%rax)
movq %rax, 0x10(%rax)
movq %rax, 0x18(%rax)
movq %rcx, 0x20(%rax)
leaq 0x10(%rsp), %rsi
movl $0x1, (%rsi)
leaq 0x48(%rsp), %rdi
callq 0x2a62
movq 0x8(%rax), %rdx
leaq 0xcda(%rip), %rcx       # 0x3004
movl $0xd, %r8d
movq %rax, %rdi
xorl %esi, %esi
callq 0x2170
leaq 0x10(%rsp), %rsi
movl $0x4, (%rsi)
leaq 0x48(%rsp), %rdi
callq 0x2a62
movq 0x8(%rax), %rdx
leaq 0xcb8(%rip), %rcx       # 0x3012
movl $0x12, %r8d
movq %rax, %rdi
xorl %esi, %esi
callq 0x2170
leaq 0x10(%rsp), %rsi
movl $0x3, (%rsi)
leaq 0x48(%rsp), %rdi
callq 0x2a62
movq 0x8(%rax), %rdx
leaq 0xc9b(%rip), %rcx       # 0x3025
movl $0xb, %r8d
movq %rax, %rdi
xorl %esi, %esi
callq 0x2170
leaq 0x10(%rsp), %rsi
movl $0x2, (%rsi)
leaq 0x48(%rsp), %rdi
callq 0x2a62
movq 0x8(%rax), %rdx
leaq 0xc77(%rip), %rcx       # 0x3031
movl $0xa, %r8d
movq %rax, %rdi
xorl %esi, %esi
callq 0x2170
leaq 0x10(%rsp), %rsi
movl $0x5, (%rsi)
leaq 0x48(%rsp), %rdi
callq 0x2a62
movq 0x8(%rax), %rdx
leaq 0xc52(%rip), %rcx       # 0x303c
movl $0xc, %r8d
movq %rax, %rdi
xorl %esi, %esi
callq 0x2170
xorps %xmm0, %xmm0
leaq 0x30(%rsp), %rdi
movaps %xmm0, (%rdi)
movq $0x0, 0x10(%rdi)
callq 0x2040
movq 0x2bbf(%rip), %rdi      # 0x4fd8
leaq 0xc29(%rip), %rsi       # 0x3049
movl $0x10, %edx
callq 0x2140
movq 0x38(%rsp), %rax
cmpq 0x30(%rsp), %rax
je 0x24d3
movl $0x1, %ebp
xorl %r13d, %r13d
movq 0x2b8f(%rip), %rbx      # 0x4fd8
leaq 0xc0a(%rip), %r14       # 0x305a
leaq 0x48(%rsp), %r15
leaq 0x10(%rsp), %r12
movl $0x2, %edx
movq %rbx, %rdi
movq %r14, %rsi
callq 0x2140
movq 0x30(%rsp), %rax
movl (%rax,%r13,4), %eax
movl %eax, 0x10(%rsp)
movq %r15, %rdi
movq %r12, %rsi
callq 0x2a62
movq (%rax), %rsi
movq 0x8(%rax), %rdx
movq %rbx, %rdi
callq 0x2140
movq %rax, %r13
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %r13, %rdi
movl $0xa, %esi
callq 0x2100
movsbl %al, %esi
movq %r13, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2090
movq 0x38(%rsp), %rax
subq 0x30(%rsp), %rax
movl %ebp, %r13d
sarq $0x2, %rax
incl %ebp
cmpq %r13, %rax
ja 0x245a
movq $0x0, 0x8(%rsp)
movl $0x10, %edi
callq 0x2110
movq %rax, %r14
leaq 0xa8(%rsp), %rbx
movq %rbx, -0x10(%rbx)
leaq 0xb61(%rip), %rsi       # 0x305d
leaq 0xb6d(%rip), %rdx       # 0x3070
leaq 0x98(%rsp), %rdi
movq %rax, 0x8(%rsp)
callq 0x2d5a
leaq 0x98(%rsp), %rdx
movq %r14, %rdi
xorl %esi, %esi
movl $0x64, %ecx
callq 0x20c0
movq 0x98(%rsp), %rdi
cmpq %rbx, %rdi
je 0x2549
movq 0xa8(%rsp), %rsi
incq %rsi
callq 0x2120
movq 0x2a88(%rip), %rdi      # 0x4fd8
leaq 0xb1a(%rip), %rsi       # 0x3071
movl $0x14, %edx
callq 0x2140
movq 0x8(%rsp), %rax
movq 0x8(%rax), %rdi
movq (%rdi), %rax
callq *0x10(%rax)
leaq 0x10(%rsp), %rsi
movl %eax, (%rsi)
leaq 0x48(%rsp), %rdi
callq 0x2a62
movq (%rax), %rsi
movq 0x8(%rax), %rdx
movq 0x2a49(%rip), %rdi      # 0x4fd8
callq 0x2140
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2100
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2090
movq 0x8(%rsp), %rdi
movq (%rdi), %rax
xorl %r14d, %r14d
callq *0x10(%rax)
movl %eax, %ebx
xorl %r14d, %r14d
movq 0x2a00(%rip), %rdi      # 0x4fd8
leaq 0xaa7(%rip), %rsi       # 0x3086
movl $0xb, %edx
callq 0x2140
movl %ebx, %r15d
xorl %r14d, %r14d
movq 0x29e2(%rip), %rdi      # 0x4fd8
movq %r15, %rsi
callq 0x2080
xorl %r14d, %r14d
leaq 0xa8a(%rip), %rsi       # 0x3092
movl $0x1f, %edx
movq %rax, %rdi
callq 0x2140
testl %ebx, %ebx
je 0x26c5
xorl %ebx, %ebx
movq 0x29b2(%rip), %r12      # 0x4fd8
leaq 0xa56(%rip), %rbp       # 0x3083
leaq 0x7(%rsp), %r14
movq 0x8(%rsp), %rsi
movq (%rsi), %rax
leaq 0x10(%rsp), %rdi
movl %ebx, %edx
callq *0x18(%rax)
movl $0xe, %edx
movq %r12, %rdi
leaq 0xa5f(%rip), %rsi       # 0x30b2
callq 0x2140
incq %rbx
movq %r12, %rdi
movq %rbx, %rsi
callq 0x2080
movq %rax, %r13
movl $0x2, %edx
movq %rax, %rdi
movq %rbp, %rsi
callq 0x2140
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rdx
movq %r13, %rdi
callq 0x2140
movb $0xa, 0x7(%rsp)
movl $0x1, %edx
movq %rax, %rdi
movq %r14, %rsi
callq 0x2140
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x26bc
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x2120
cmpq %rbx, %r15
jne 0x2632
xorl %r14d, %r14d
movl $0x10, %edi
callq 0x2110
movq %rax, %r14
leaq 0x88(%rsp), %rbx
movq %rbx, -0x10(%rbx)
leaq 0x9d9(%rip), %rsi       # 0x30c1
leaq 0x9e6(%rip), %rdx       # 0x30d5
leaq 0x78(%rsp), %rdi
callq 0x2d5a
leaq 0x78(%rsp), %rdx
movq %r14, %rdi
xorl %esi, %esi
callq 0x20f0
movq 0x78(%rsp), %rdi
cmpq %rbx, %rdi
je 0x2722
movq 0x88(%rsp), %rsi
incq %rsi
callq 0x2120
movq 0x28af(%rip), %rdi      # 0x4fd8
leaq 0x9a6(%rip), %rsi       # 0x30d6
movl $0x15, %edx
callq 0x2140
movq 0x8(%r14), %rdi
movq (%rdi), %rax
callq *0x10(%rax)
leaq 0x10(%rsp), %rsi
movl %eax, (%rsi)
leaq 0x48(%rsp), %rdi
callq 0x2a62
movq (%rax), %rsi
movq 0x8(%rax), %rdx
movq 0x2875(%rip), %rdi      # 0x4fd8
callq 0x2140
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2100
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2090
movq (%r14), %rax
movq %r14, %rdi
callq *0x10(%rax)
movl %eax, %ebx
movq 0x2834(%rip), %rdi      # 0x4fd8
leaq 0x8db(%rip), %rsi       # 0x3086
movl $0xb, %edx
callq 0x2140
movl %ebx, %r12d
movq 0x2819(%rip), %rdi      # 0x4fd8
movq %r12, %rsi
callq 0x2080
leaq 0x91e(%rip), %rsi       # 0x30ec
movl $0x1e, %edx
movq %rax, %rdi
callq 0x2140
testl %ebx, %ebx
je 0x289b
xorl %r13d, %r13d
movq 0x27eb(%rip), %r15      # 0x4fd8
leaq 0x88f(%rip), %rbp       # 0x3083
movq (%r14), %rax
leaq 0x10(%rsp), %rdi
movq %r14, %rsi
movl %r13d, %edx
callq *0x18(%rax)
movl $0xf, %edx
movq %r15, %rdi
leaq 0x8f7(%rip), %rsi       # 0x310b
callq 0x2140
incq %r13
movq %r15, %rdi
movq %r13, %rsi
callq 0x2080
movq %rax, %rbx
movl $0x2, %edx
movq %rax, %rdi
movq %rbp, %rsi
callq 0x2140
movq 0x10(%rsp), %rsi
movq 0x18(%rsp), %rdx
movq %rbx, %rdi
callq 0x2140
movq %rax, %rbx
movq (%rax), %rax
movq -0x18(%rax), %rdi
addq %rbx, %rdi
movl $0xa, %esi
callq 0x2100
movsbl %al, %esi
movq %rbx, %rdi
callq 0x2030
movq %rax, %rdi
callq 0x2090
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x2892
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x2120
cmpq %r13, %r12
jne 0x27f4
movq 0x2736(%rip), %rdi      # 0x4fd8
movq (%rdi), %rax
addq -0x18(%rax), %rdi
movl $0xa, %esi
callq 0x2100
movsbl %al, %esi
movq 0x271b(%rip), %rdi      # 0x4fd8
callq 0x2030
movq %rax, %rdi
callq 0x2090
movq 0x8(%rsp), %rdi
testq %rdi, %rdi
je 0x28da
movq (%rdi), %rax
callq *0x40(%rax)
testq %r14, %r14
je 0x28e8
movq (%r14), %rax
movq %r14, %rdi
callq *0x40(%rax)
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x28ff
movq 0x40(%rsp), %rsi
subq %rdi, %rsi
callq 0x2120
leaq 0x48(%rsp), %rdi
callq 0x2ad2
xorl %eax, %eax
addq $0xb8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
jmp 0x2954
movq %rdx, %r12
movq %rax, %r15
movq 0x78(%rsp), %rdi
cmpq %rbx, %rdi
je 0x2947
movq 0x88(%rsp), %rsi
incq %rsi
callq 0x2120
jmp 0x2947
movq %rdx, %r12
movq %rax, %r15
movl $0x10, %esi
movq %r14, %rdi
jmp 0x29e7
movq %rax, %rdi
callq 0x2ac6
movq %rdx, %r12
movq %rax, %r15
movq 0x98(%rsp), %rdi
cmpq %rbx, %rdi
je 0x2987
movq 0xa8(%rsp), %rsi
incq %rsi
callq 0x2120
jmp 0x2987
movq %rdx, %r12
movq %rax, %r15
movl $0x10, %esi
movq 0x8(%rsp), %rdi
callq 0x2120
movq $0x0, 0x8(%rsp)
jmp 0x29ec
jmp 0x29f1
jmp 0x29c0
jmp 0x29ad
jmp 0x29ad
jmp 0x29ad
jmp 0x29ad
movq %rax, %r15
jmp 0x2a0b
jmp 0x29b8
jmp 0x29c0
jmp 0x29b8
movq %rdx, %r12
movq %rax, %r15
jmp 0x2a3f
movq %rdx, %r12
movq %rax, %r15
jmp 0x29ec
jmp 0x29f1
movq %rdx, %r12
movq %rax, %r15
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x29ec
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x2120
xorl %r14d, %r14d
jmp 0x2a3f
movq %rax, %r15
movq 0x30(%rsp), %rdi
testq %rdi, %rdi
je 0x2a0b
movq 0x40(%rsp), %rsi
subq %rdi, %rsi
callq 0x2120
leaq 0x48(%rsp), %rdi
callq 0x2ad2
movq %r15, %rdi
callq 0x2190
movq %rdx, %r12
movq %rax, %r15
movq 0x10(%rsp), %rdi
leaq 0x20(%rsp), %rax
cmpq %rax, %rdi
je 0x2a3f
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x2120
cmpl $0x1, %r12d
jne 0x29f4
movq %r15, %rdi
callq 0x2070
movq (%rax), %rcx
movq %rax, %rdi
callq *0x18(%rcx)
callq 0x2180
jmp 0x28ca
jmp 0x29f1