// File: tobias93[P]piano/rtmidi_build/RtMidi.cpp
// Function: MidiInAlsa::getPortName[abi:cxx11](unsigned int)
std::string MidiInAlsa :: getPortName( unsigned int portNumber )
{
  snd_seq_client_info_t *cinfo;
  snd_seq_port_info_t *pinfo;
  snd_seq_client_info_alloca( &cinfo );
  snd_seq_port_info_alloca( &pinfo );

  std::string stringName;
  AlsaMidiData *data = static_cast<AlsaMidiData *> (apiData_);
  if ( portInfo( data->seq, pinfo, SND_SEQ_PORT_CAP_READ|SND_SEQ_PORT_CAP_SUBS_READ, (int) portNumber ) ) {
    int cnum = snd_seq_port_info_get_client( pinfo );
    snd_seq_get_any_client_info( data->seq, cnum, cinfo );
    std::ostringstream os;
    os << snd_seq_client_info_get_name( cinfo );
    os << " ";                                    // These lines added to make sure devices are listed
    os << snd_seq_port_info_get_client( pinfo );  // with full portnames added to ensure individual device names
    os << ":";
    os << snd_seq_port_info_get_port( pinfo );
    stringName = os.str();
    return stringName;
  }

  // If we get here, we didn't find a match.
  errorString_ = "MidiInAlsa::getPortName: error looking for port name!";
  error( RtMidiError::WARNING, errorString_ );
  return stringName;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x250, %rsp            # imm = 0x250
movq %rdi, -0x220(%rbp)
movq %rdi, %rax
movq %rax, -0x218(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x210(%rbp)
callq 0xe490
movq %rax, %rcx
addq $0xf, %rcx
andq $-0x10, %rcx
movq %rsp, %rax
subq %rcx, %rax
movq %rax, %rsp
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rax
movq %rax, -0x228(%rbp)
callq 0xe490
movq -0x228(%rbp), %rdi
movq %rax, %rdx
xorl %esi, %esi
callq 0xd530
jmp 0x10242
callq 0xe2f0
movq %rax, %rcx
addq $0xf, %rcx
andq $-0x10, %rcx
movq %rsp, %rax
subq %rcx, %rax
movq %rax, %rsp
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0x230(%rbp)
callq 0xe2f0
movq -0x230(%rbp), %rdi
movq %rax, %rdx
xorl %esi, %esi
callq 0xd530
movq -0x220(%rbp), %rdi
movb $0x0, -0x29(%rbp)
callq 0xe030
movq -0x210(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
movq (%rax), %rdi
movq -0x28(%rbp), %rsi
movl -0x14(%rbp), %ecx
movl $0x21, %edx
callq 0xd4c0
movl %eax, -0x234(%rbp)
jmp 0x102bf
movl -0x234(%rbp), %eax
cmpl $0x0, %eax
je 0x10427
movq -0x28(%rbp), %rdi
callq 0xd380
movl %eax, -0x238(%rbp)
jmp 0x102df
movl -0x238(%rbp), %eax
movl %eax, -0x48(%rbp)
movq -0x38(%rbp), %rax
movq (%rax), %rdi
movl -0x48(%rbp), %esi
movq -0x20(%rbp), %rdx
callq 0xdf00
jmp 0x102fd
leaq -0x1c0(%rbp), %rdi
callq 0xdf80
jmp 0x1030b
movq -0x20(%rbp), %rdi
callq 0xdc60
movq %rax, -0x240(%rbp)
jmp 0x1031d
movq -0x240(%rbp), %rsi
leaq -0x1c0(%rbp), %rdi
callq 0xda30
jmp 0x10332
leaq 0x8f7b(%rip), %rsi      # 0x192b4
leaq -0x1c0(%rbp), %rdi
callq 0xda30
jmp 0x10347
movq -0x28(%rbp), %rdi
callq 0xd380
movl %eax, -0x244(%rbp)
jmp 0x10358
movl -0x244(%rbp), %esi
leaq -0x1c0(%rbp), %rdi
callq 0xe540
jmp 0x1036c
leaq 0x8f43(%rip), %rsi      # 0x192b6
leaq -0x1c0(%rbp), %rdi
callq 0xda30
jmp 0x10381
movq -0x28(%rbp), %rdi
callq 0xe390
movl %eax, -0x248(%rbp)
jmp 0x10392
movl -0x248(%rbp), %esi
leaq -0x1c0(%rbp), %rdi
callq 0xe540
jmp 0x103a6
leaq -0x1e0(%rbp), %rdi
leaq -0x1c0(%rbp), %rsi
callq 0xdad0
jmp 0x103bb
movq -0x220(%rbp), %rdi
leaq -0x1e0(%rbp), %rsi
callq 0xddc0
leaq -0x1e0(%rbp), %rdi
callq 0xd600
movb $0x1, -0x29(%rbp)
movl $0x1, -0x1e4(%rbp)
leaq -0x1c0(%rbp), %rdi
callq 0xd1a0
jmp 0x104a6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x104c4
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x1c0(%rbp), %rdi
callq 0xd1a0
jmp 0x104c4
movq -0x210(%rbp), %rdi
addq $0x18, %rdi
leaq 0x8e7f(%rip), %rsi      # 0x192b8
callq 0xdfb0
jmp 0x10440
movq -0x210(%rbp), %rsi
addq $0x18, %rsi
leaq -0x208(%rbp), %rdi
callq 0xd3d0
jmp 0x10459
movq -0x210(%rbp), %rdi
xorl %esi, %esi
leaq -0x208(%rbp), %rdx
callq 0xd5f0
jmp 0x10470
leaq -0x208(%rbp), %rdi
callq 0xd600
movb $0x1, -0x29(%rbp)
movl $0x1, -0x1e4(%rbp)
jmp 0x104a6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x208(%rbp), %rdi
callq 0xd600
jmp 0x104c4
testb $0x1, -0x29(%rbp)
jne 0x104b8
movq -0x220(%rbp), %rdi
callq 0xd600
movq -0x218(%rbp), %rax
movq %rbp, %rsp
popq %rbp
retq
movq -0x220(%rbp), %rdi
callq 0xd600
movq -0x40(%rbp), %rdi
callq 0xe590
nopl (%rax)