// File: tobias93[P]piano/rtaudio/tests/audioprobe.cpp
// Function: main
int main()
{
  // Create an api map.
  std::map<int, std::string> apiMap;
  apiMap[RtAudio::MACOSX_CORE] = "OS-X Core Audio";
  apiMap[RtAudio::WINDOWS_ASIO] = "Windows ASIO";
  apiMap[RtAudio::WINDOWS_DS] = "Windows Direct Sound";
  apiMap[RtAudio::WINDOWS_WASAPI] = "Windows WASAPI";
  apiMap[RtAudio::UNIX_JACK] = "Jack Client";
  apiMap[RtAudio::LINUX_ALSA] = "Linux ALSA";
  apiMap[RtAudio::LINUX_PULSE] = "Linux PulseAudio";
  apiMap[RtAudio::LINUX_OSS] = "Linux OSS";
  apiMap[RtAudio::RTAUDIO_DUMMY] = "RtAudio Dummy";

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

  std::cout << "\nRtAudio Version " << RtAudio::getVersion() << std::endl;

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

  RtAudio audio;
  RtAudio::DeviceInfo info;

  std::cout << "\nCurrent API: " << apiMap[ audio.getCurrentApi() ] << std::endl;

  unsigned int devices = audio.getDeviceCount();
  std::cout << "\nFound " << devices << " device(s) ...\n";

  for (unsigned int i=0; i<devices; i++) {
    info = audio.getDeviceInfo(i);

    std::cout << "\nDevice Name = " << info.name << '\n';
    if ( info.probed == false )
      std::cout << "Probe Status = UNsuccessful\n";
    else {
      std::cout << "Probe Status = Successful\n";
      std::cout << "Output Channels = " << info.outputChannels << '\n';
      std::cout << "Input Channels = " << info.inputChannels << '\n';
      std::cout << "Duplex Channels = " << info.duplexChannels << '\n';
      if ( info.isDefaultOutput ) std::cout << "This is the default output device.\n";
      else std::cout << "This is NOT the default output device.\n";
      if ( info.isDefaultInput ) std::cout << "This is the default input device.\n";
      else std::cout << "This is NOT the default input device.\n";
      if ( info.nativeFormats == 0 )
        std::cout << "No natively supported data formats(?)!";
      else {
        std::cout << "Natively supported data formats:\n";
        if ( info.nativeFormats & RTAUDIO_SINT8 )
          std::cout << "  8-bit int\n";
        if ( info.nativeFormats & RTAUDIO_SINT16 )
          std::cout << "  16-bit int\n";
        if ( info.nativeFormats & RTAUDIO_SINT24 )
          std::cout << "  24-bit int\n";
        if ( info.nativeFormats & RTAUDIO_SINT32 )
          std::cout << "  32-bit int\n";
        if ( info.nativeFormats & RTAUDIO_FLOAT32 )
          std::cout << "  32-bit float\n";
        if ( info.nativeFormats & RTAUDIO_FLOAT64 )
          std::cout << "  64-bit float\n";
      }
      if ( info.sampleRates.size() < 1 )
        std::cout << "No supported sample rates found!";
      else {
        std::cout << "Supported sample rates = ";
        for (unsigned int j=0; j<info.sampleRates.size(); j++)
          std::cout << info.sampleRates[j] << " ";
      }
      std::cout << std::endl;
    }
  }
  std::cout << std::endl;

  return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x2a0, %rsp            # imm = 0x2A0
movl $0x0, -0x4(%rbp)
leaq -0x38(%rbp), %rdi
movq %rdi, -0x1a0(%rbp)
callq 0xbfd0
movq -0x1a0(%rbp), %rdi
movl $0x5, -0x3c(%rbp)
leaq -0x3c(%rbp), %rsi
callq 0xbff0
movq %rax, -0x198(%rbp)
jmp 0xb682
movq -0x198(%rbp), %rdi
leaq 0xb974(%rip), %rsi      # 0x17004
callq 0xb350
jmp 0xb697
movl $0x7, -0x50(%rbp)
leaq -0x38(%rbp), %rdi
leaq -0x50(%rbp), %rsi
callq 0xbff0
movq %rax, -0x1a8(%rbp)
jmp 0xb6b4
movq -0x1a8(%rbp), %rdi
leaq 0xb952(%rip), %rsi      # 0x17014
callq 0xb350
jmp 0xb6c9
movl $0x8, -0x54(%rbp)
leaq -0x38(%rbp), %rdi
leaq -0x54(%rbp), %rsi
callq 0xbff0
movq %rax, -0x1b0(%rbp)
jmp 0xb6e6
movq -0x1b0(%rbp), %rdi
leaq 0xb92d(%rip), %rsi      # 0x17021
callq 0xb350
jmp 0xb6fb
movl $0x6, -0x58(%rbp)
leaq -0x38(%rbp), %rdi
leaq -0x58(%rbp), %rsi
callq 0xbff0
movq %rax, -0x1b8(%rbp)
jmp 0xb718
movq -0x1b8(%rbp), %rdi
leaq 0xb910(%rip), %rsi      # 0x17036
callq 0xb350
jmp 0xb72d
movl $0x4, -0x5c(%rbp)
leaq -0x38(%rbp), %rdi
leaq -0x5c(%rbp), %rsi
callq 0xbff0
movq %rax, -0x1c0(%rbp)
jmp 0xb74a
movq -0x1c0(%rbp), %rdi
leaq 0xb8ed(%rip), %rsi      # 0x17045
callq 0xb350
jmp 0xb75f
movl $0x1, -0x60(%rbp)
leaq -0x38(%rbp), %rdi
leaq -0x60(%rbp), %rsi
callq 0xbff0
movq %rax, -0x1c8(%rbp)
jmp 0xb77c
movq -0x1c8(%rbp), %rdi
leaq 0xb8c7(%rip), %rsi      # 0x17051
callq 0xb350
jmp 0xb791
movl $0x2, -0x64(%rbp)
leaq -0x38(%rbp), %rdi
leaq -0x64(%rbp), %rsi
callq 0xbff0
movq %rax, -0x1d0(%rbp)
jmp 0xb7ae
movq -0x1d0(%rbp), %rdi
leaq 0xb8a0(%rip), %rsi      # 0x1705c
callq 0xb350
jmp 0xb7c3
movl $0x3, -0x68(%rbp)
leaq -0x38(%rbp), %rdi
leaq -0x68(%rbp), %rsi
callq 0xbff0
movq %rax, -0x1d8(%rbp)
jmp 0xb7e0
movq -0x1d8(%rbp), %rdi
leaq 0xb87f(%rip), %rsi      # 0x1706d
callq 0xb350
jmp 0xb7f5
movl $0x9, -0x6c(%rbp)
leaq -0x38(%rbp), %rdi
leaq -0x6c(%rbp), %rsi
callq 0xbff0
movq %rax, -0x1e0(%rbp)
jmp 0xb812
movq -0x1e0(%rbp), %rdi
leaq 0xb857(%rip), %rsi      # 0x17077
callq 0xb350
jmp 0xb827
leaq -0x88(%rbp), %rdi
movq %rdi, -0x1f0(%rbp)
callq 0xc0d0
movq -0x1f0(%rbp), %rdi
callq 0xe030
movq 0x11783(%rip), %rdi     # 0x1cfd0
leaq 0xb831(%rip), %rsi      # 0x17085
callq 0xb230
movq %rax, -0x1e8(%rbp)
jmp 0xb862
leaq -0xa8(%rbp), %rdi
movq %rdi, -0x200(%rbp)
callq 0xdfd0
movq -0x1e8(%rbp), %rdi
movq -0x200(%rbp), %rsi
callq 0xb200
movq %rax, -0x1f8(%rbp)
jmp 0xb891
movq -0x1f8(%rbp), %rdi
movq 0x11719(%rip), %rsi     # 0x1cfb8
callq 0xb280
jmp 0xb8a6
leaq -0xa8(%rbp), %rdi
callq 0xb150
movq 0x11717(%rip), %rdi     # 0x1cfd0
leaq 0xb7d7(%rip), %rsi      # 0x17097
callq 0xb230
jmp 0xb8c7
movl $0x0, -0xac(%rbp)
movl -0xac(%rbp), %eax
movq %rax, -0x208(%rbp)
leaq -0x88(%rbp), %rdi
callq 0xc0f0
movq %rax, %rcx
movq -0x208(%rbp), %rax
cmpq %rcx, %rax
jae 0xb9d4
movq 0x116cc(%rip), %rdi     # 0x1cfd0
leaq 0xb79d(%rip), %rsi      # 0x170a8
callq 0xb230
movq %rax, -0x210(%rbp)
jmp 0xb919
movl -0xac(%rbp), %eax
movl %eax, %esi
leaq -0x88(%rbp), %rdi
callq 0xc110
movl (%rax), %eax
movl %eax, -0xb0(%rbp)
leaq -0x38(%rbp), %rdi
leaq -0xb0(%rbp), %rsi
callq 0xbff0
movq %rax, -0x218(%rbp)
jmp 0xb94e
movq -0x218(%rbp), %rsi
movq -0x210(%rbp), %rdi
callq 0xb200
movq %rax, -0x220(%rbp)
jmp 0xb96a
movq -0x220(%rbp), %rdi
movq 0x11640(%rip), %rsi     # 0x1cfb8
callq 0xb280
jmp 0xb97f
jmp 0xb981
movl -0xac(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xac(%rbp)
jmp 0xb8d1
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0xbfbe
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0xbfb2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0xa8(%rbp), %rdi
callq 0xb150
jmp 0xbfb2
leaq -0xb8(%rbp), %rdi
xorl %esi, %esi
callq 0xe130
jmp 0xb9e4
leaq -0x118(%rbp), %rdi
callq 0xc130
jmp 0xb9f2
movq 0x115d7(%rip), %rdi     # 0x1cfd0
leaq 0xb6ab(%rip), %rsi      # 0x170ab
callq 0xb230
movq %rax, -0x228(%rbp)
jmp 0xba0e
leaq -0xb8(%rbp), %rdi
callq 0xc1a0
movl %eax, -0x11c(%rbp)
leaq -0x38(%rbp), %rdi
leaq -0x11c(%rbp), %rsi
callq 0xbff0
movq %rax, -0x230(%rbp)
jmp 0xba39
movq -0x230(%rbp), %rsi
movq -0x228(%rbp), %rdi
callq 0xb200
movq %rax, -0x238(%rbp)
jmp 0xba55
movq -0x238(%rbp), %rdi
movq 0x11555(%rip), %rsi     # 0x1cfb8
callq 0xb280
jmp 0xba6a
leaq -0xb8(%rbp), %rdi
callq 0xc1e0
movl %eax, -0x120(%rbp)
movq 0x1154d(%rip), %rdi     # 0x1cfd0
leaq 0xb630(%rip), %rsi      # 0x170ba
callq 0xb230
movq %rax, -0x240(%rbp)
jmp 0xba98
movq -0x240(%rbp), %rdi
movl -0x120(%rbp), %esi
callq 0xb330
movq %rax, -0x248(%rbp)
jmp 0xbab3
movq -0x248(%rbp), %rdi
leaq 0xb601(%rip), %rsi      # 0x170c2
callq 0xb230
jmp 0xbac8
movl $0x0, -0x124(%rbp)
movl -0x124(%rbp), %eax
cmpl -0x120(%rbp), %eax
jae 0xbf51
movl -0x124(%rbp), %edx
leaq -0x188(%rbp), %rdi
leaq -0xb8(%rbp), %rsi
callq 0xc220
jmp 0xbaff
leaq -0x118(%rbp), %rdi
leaq -0x188(%rbp), %rsi
movq %rsi, -0x258(%rbp)
callq 0xc260
movq -0x258(%rbp), %rdi
callq 0xc2e0
movq 0x114a4(%rip), %rdi     # 0x1cfd0
leaq 0xb59f(%rip), %rsi      # 0x170d2
callq 0xb230
movq %rax, -0x250(%rbp)
jmp 0xbb41
movq -0x250(%rbp), %rdi
leaq -0x110(%rbp), %rsi
callq 0xb200
movq %rax, -0x260(%rbp)
jmp 0xbb5d
movq -0x260(%rbp), %rdi
movl $0xa, %esi
callq 0xb2d0
jmp 0xbb70
movb -0x118(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0xbbc8
movq 0x11449(%rip), %rdi     # 0x1cfd0
leaq 0xb554(%rip), %rsi      # 0x170e2
callq 0xb230
jmp 0xbb95
jmp 0xbf3b
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
jmp 0xbfa6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x48(%rbp)
movl %eax, -0x4c(%rbp)
leaq -0x118(%rbp), %rdi
callq 0xc2e0
jmp 0xbfa6
movq 0x11401(%rip), %rdi     # 0x1cfd0
leaq 0xb529(%rip), %rsi      # 0x170ff
callq 0xb230
jmp 0xbbdd
movq 0x113ec(%rip), %rdi     # 0x1cfd0
leaq 0xb52f(%rip), %rsi      # 0x1711a
callq 0xb230
movq %rax, -0x268(%rbp)
jmp 0xbbf9
movq -0x268(%rbp), %rdi
movl -0xf0(%rbp), %esi
callq 0xb330
movq %rax, -0x270(%rbp)
jmp 0xbc14
movq -0x270(%rbp), %rdi
movl $0xa, %esi
callq 0xb2d0
jmp 0xbc27
movq 0x113a2(%rip), %rdi     # 0x1cfd0
leaq 0xb4f8(%rip), %rsi      # 0x1712d
callq 0xb230
movq %rax, -0x278(%rbp)
jmp 0xbc43
movq -0x278(%rbp), %rdi
movl -0xec(%rbp), %esi
callq 0xb330
movq %rax, -0x280(%rbp)
jmp 0xbc5e
movq -0x280(%rbp), %rdi
movl $0xa, %esi
callq 0xb2d0
jmp 0xbc71
movq 0x11358(%rip), %rdi     # 0x1cfd0
leaq 0xb4c0(%rip), %rsi      # 0x1713f
callq 0xb230
movq %rax, -0x288(%rbp)
jmp 0xbc8d
movq -0x288(%rbp), %rdi
movl -0xe8(%rbp), %esi
callq 0xb330
movq %rax, -0x290(%rbp)
jmp 0xbca8
movq -0x290(%rbp), %rdi
movl $0xa, %esi
callq 0xb2d0
jmp 0xbcbb
testb $0x1, -0xe4(%rbp)
je 0xbcdb
movq 0x11305(%rip), %rdi     # 0x1cfd0
leaq 0xb480(%rip), %rsi      # 0x17152
callq 0xb230
jmp 0xbcd9
jmp 0xbcf2
movq 0x112ee(%rip), %rdi     # 0x1cfd0
leaq 0xb48d(%rip), %rsi      # 0x17176
callq 0xb230
jmp 0xbcf0
jmp 0xbcf2
testb $0x1, -0xe3(%rbp)
je 0xbd12
movq 0x112ce(%rip), %rdi     # 0x1cfd0
leaq 0xb495(%rip), %rsi      # 0x1719e
callq 0xb230
jmp 0xbd10
jmp 0xbd29
movq 0x112b7(%rip), %rdi     # 0x1cfd0
leaq 0xb4a1(%rip), %rsi      # 0x171c1
callq 0xb230
jmp 0xbd27
jmp 0xbd29
cmpq $0x0, -0xc0(%rbp)
jne 0xbd4d
movq 0x11296(%rip), %rdi     # 0x1cfd0
leaq 0xb4a7(%rip), %rsi      # 0x171e8
callq 0xb230
jmp 0xbd48
jmp 0xbe54
movq 0x1127c(%rip), %rdi     # 0x1cfd0
leaq 0xb4b4(%rip), %rsi      # 0x1720f
callq 0xb230
jmp 0xbd62
movq -0xc0(%rbp), %rax
andq $0x1, %rax
cmpq $0x0, %rax
je 0xbd8a
movq 0x11256(%rip), %rdi     # 0x1cfd0
leaq 0xb4b0(%rip), %rsi      # 0x17231
callq 0xb230
jmp 0xbd88
jmp 0xbd8a
movq -0xc0(%rbp), %rax
andq $0x2, %rax
cmpq $0x0, %rax
je 0xbdb2
movq 0x1122e(%rip), %rdi     # 0x1cfd0
leaq 0xb495(%rip), %rsi      # 0x1723e
callq 0xb230
jmp 0xbdb0
jmp 0xbdb2
movq -0xc0(%rbp), %rax
andq $0x4, %rax
cmpq $0x0, %rax
je 0xbdda
movq 0x11206(%rip), %rdi     # 0x1cfd0
leaq 0xb47b(%rip), %rsi      # 0x1724c
callq 0xb230
jmp 0xbdd8
jmp 0xbdda
movq -0xc0(%rbp), %rax
andq $0x8, %rax
cmpq $0x0, %rax
je 0xbe02
movq 0x111de(%rip), %rdi     # 0x1cfd0
leaq 0xb461(%rip), %rsi      # 0x1725a
callq 0xb230
jmp 0xbe00
jmp 0xbe02
movq -0xc0(%rbp), %rax
andq $0x10, %rax
cmpq $0x0, %rax
je 0xbe2a
movq 0x111b6(%rip), %rdi     # 0x1cfd0
leaq 0xb447(%rip), %rsi      # 0x17268
callq 0xb230
jmp 0xbe28
jmp 0xbe2a
movq -0xc0(%rbp), %rax
andq $0x20, %rax
cmpq $0x0, %rax
je 0xbe52
movq 0x1118e(%rip), %rdi     # 0x1cfd0
leaq 0xb42f(%rip), %rsi      # 0x17278
callq 0xb230
jmp 0xbe50
jmp 0xbe52
jmp 0xbe54
leaq -0x118(%rbp), %rdi
addq $0x38, %rdi
callq 0xc310
cmpq $0x1, %rax
jae 0xbe84
movq 0x1115f(%rip), %rdi     # 0x1cfd0
leaq 0xb410(%rip), %rsi      # 0x17288
callq 0xb230
jmp 0xbe7f
jmp 0xbf24
movq 0x11145(%rip), %rdi     # 0x1cfd0
leaq 0xb417(%rip), %rsi      # 0x172a9
callq 0xb230
jmp 0xbe99
movl $0x0, -0x18c(%rbp)
movl -0x18c(%rbp), %eax
movq %rax, -0x298(%rbp)
leaq -0x118(%rbp), %rdi
addq $0x38, %rdi
callq 0xc310
movq %rax, %rcx
movq -0x298(%rbp), %rax
cmpq %rcx, %rax
jae 0xbf22
leaq -0xe0(%rbp), %rdi
movl -0x18c(%rbp), %eax
movl %eax, %esi
callq 0xc330
movl (%rax), %esi
movq 0x110e4(%rip), %rdi     # 0x1cfd0
callq 0xb330
movq %rax, -0x2a0(%rbp)
jmp 0xbefa
movq -0x2a0(%rbp), %rdi
leaq 0xb1a1(%rip), %rsi      # 0x170a9
callq 0xb230
jmp 0xbf0f
jmp 0xbf11
movl -0x18c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18c(%rbp)
jmp 0xbea3
jmp 0xbf24
movq 0x110a5(%rip), %rdi     # 0x1cfd0
movq 0x11086(%rip), %rsi     # 0x1cfb8
callq 0xb280
jmp 0xbf39
jmp 0xbf3b
jmp 0xbf3d
movl -0x124(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x124(%rbp)
jmp 0xbad2
movq 0x11078(%rip), %rdi     # 0x1cfd0
movq 0x11059(%rip), %rsi     # 0x1cfb8
callq 0xb280
jmp 0xbf66
movl $0x0, -0x4(%rbp)
leaq -0x118(%rbp), %rdi
callq 0xc2e0
leaq -0xb8(%rbp), %rdi
callq 0xe300
leaq -0x88(%rbp), %rdi
callq 0xc350
leaq -0x38(%rbp), %rdi
callq 0xc3b0
movl -0x4(%rbp), %eax
addq $0x2a0, %rsp            # imm = 0x2A0
popq %rbp
retq
leaq -0xb8(%rbp), %rdi
callq 0xe300
leaq -0x88(%rbp), %rdi
callq 0xc350
leaq -0x38(%rbp), %rdi
callq 0xc3b0
movq -0x48(%rbp), %rdi
callq 0xb440