// File: tobias93[P]piano/rtmidi_build/RtMidi.cpp
// Function: MidiOutAlsa::getPortName[abi:cxx11](unsigned int)
std::string MidiOutAlsa :: 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_WRITE|SND_SEQ_PORT_CAP_SUBS_WRITE, (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_ = "MidiOutAlsa::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 0x11db2
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 $0x42, %edx
callq 0xd4c0
movl %eax, -0x234(%rbp)
jmp 0x11e2f
movl -0x234(%rbp), %eax
cmpl $0x0, %eax
je 0x11f97
movq -0x28(%rbp), %rdi
callq 0xd380
movl %eax, -0x238(%rbp)
jmp 0x11e4f
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 0x11e6d
leaq -0x1c0(%rbp), %rdi
callq 0xdf80
jmp 0x11e7b
movq -0x20(%rbp), %rdi
callq 0xdc60
movq %rax, -0x240(%rbp)
jmp 0x11e8d
movq -0x240(%rbp), %rsi
leaq -0x1c0(%rbp), %rdi
callq 0xda30
jmp 0x11ea2
leaq 0x740b(%rip), %rsi      # 0x192b4
leaq -0x1c0(%rbp), %rdi
callq 0xda30
jmp 0x11eb7
movq -0x28(%rbp), %rdi
callq 0xd380
movl %eax, -0x244(%rbp)
jmp 0x11ec8
movl -0x244(%rbp), %esi
leaq -0x1c0(%rbp), %rdi
callq 0xe540
jmp 0x11edc
leaq 0x73d3(%rip), %rsi      # 0x192b6
leaq -0x1c0(%rbp), %rdi
callq 0xda30
jmp 0x11ef1
movq -0x28(%rbp), %rdi
callq 0xe390
movl %eax, -0x248(%rbp)
jmp 0x11f02
movl -0x248(%rbp), %esi
leaq -0x1c0(%rbp), %rdi
callq 0xe540
jmp 0x11f16
leaq -0x1e0(%rbp), %rdi
leaq -0x1c0(%rbp), %rsi
callq 0xdad0
jmp 0x11f2b
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 0x12016
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
jmp 0x12034
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x1c0(%rbp), %rdi
callq 0xd1a0
jmp 0x12034
movq -0x210(%rbp), %rdi
addq $0x18, %rdi
leaq 0x75d8(%rip), %rsi      # 0x19581
callq 0xdfb0
jmp 0x11fb0
movq -0x210(%rbp), %rsi
addq $0x18, %rsi
leaq -0x208(%rbp), %rdi
callq 0xd3d0
jmp 0x11fc9
movq -0x210(%rbp), %rdi
xorl %esi, %esi
leaq -0x208(%rbp), %rdx
callq 0xd5f0
jmp 0x11fe0
leaq -0x208(%rbp), %rdi
callq 0xd600
movb $0x1, -0x29(%rbp)
movl $0x1, -0x1e4(%rbp)
jmp 0x12016
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x40(%rbp)
movl %eax, -0x44(%rbp)
leaq -0x208(%rbp), %rdi
callq 0xd600
jmp 0x12034
testb $0x1, -0x29(%rbp)
jne 0x12028
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)