// File: /workspace/github_cpp_makefile_star2_O2/tobias93[P]piano/rtmidi_build/RtMidi.cpp
// Function: MidiOutAlsa::initialize(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>> const&)
void MidiOutAlsa :: initialize( const std::string& clientName )
{
  // Set up the ALSA sequencer client.
  snd_seq_t *seq;
  int result1 = snd_seq_open( &seq, "default", SND_SEQ_OPEN_OUTPUT, SND_SEQ_NONBLOCK );
  if ( result1 < 0 ) {
    errorString_ = "MidiOutAlsa::initialize: error creating ALSA sequencer client object.";
    error( RtMidiError::DRIVER_ERROR, errorString_ );
    return;
	}

  // Set client name.
  snd_seq_set_client_name( seq, clientName.c_str() );

  // Save our api-specific connection information.
  AlsaMidiData *data = (AlsaMidiData *) new AlsaMidiData;
  data->seq = seq;
  data->portNum = -1;
  data->vport = -1;
  data->bufferSize = 32;
  data->coder = 0;
  data->buffer = 0;
  int result = snd_midi_event_new( data->bufferSize, &data->coder );
  if ( result < 0 ) {
    delete data;
    errorString_ = "MidiOutAlsa::initialize: error initializing MIDI event parser!\n\n";
    error( RtMidiError::DRIVER_ERROR, errorString_ );
    return;
  }
  data->buffer = (unsigned char *) malloc( data->bufferSize );
  if ( data->buffer == NULL ) {
    delete data;
    errorString_ = "MidiOutAlsa::initialize: error allocating buffer memory!\n\n";
    error( RtMidiError::MEMORY_ERROR, errorString_ );
    return;
  }
  snd_midi_event_init( data->coder );
  apiData_ = (void *) data;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x70, %rsp
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x2961(%rip), %rsi      # 0xc22d
leaq 0x8(%rsp), %rdi
pushq $0x1
popq %rcx
movl %ecx, %edx
callq 0x7160
testl %eax, %eax
js 0x994e
movq 0x8(%rsp), %rdi
movq (%r14), %rsi
callq 0x74e0
pushq $0x58
popq %rdi
callq 0x7480
movq %rax, %r14
movq 0x8(%rsp), %rax
movq %rax, (%r14)
orq $-0x1, 0x8(%r14)
movl $0x20, 0x20(%r14)
andq $0x0, 0x18(%r14)
leaq 0x18(%r14), %rsi
andq $0x0, 0x28(%r14)
pushq $0x20
popq %rdi
callq 0x7750
testl %eax, %eax
js 0x9989
movl 0x20(%r14), %edi
callq 0x76a0
movq %rax, 0x28(%r14)
testq %rax, %rax
je 0x99cc
movq 0x18(%r14), %rdi
callq 0x71b0
movq %r14, 0x8(%rbx)
jmp 0x9a12
leaq 0x18(%rbx), %r15
leaq 0x2b6e(%rip), %rsi      # 0xc4c7
movq %r15, %rdi
callq 0x7af0
leaq 0x50(%rsp), %r14
movq %r14, %rdi
movq %r15, %rsi
callq 0x7720
pushq $0x8
popq %rsi
movq %rbx, %rdi
movq %r14, %rdx
callq 0x7240
leaq 0x50(%rsp), %rdi
jmp 0x9a0d
pushq $0x58
popq %rsi
movq %r14, %rdi
callq 0x7490
leaq 0x18(%rbx), %r15
leaq 0x2b6e(%rip), %rsi      # 0xc50d
movq %r15, %rdi
callq 0x7af0
leaq 0x30(%rsp), %r14
movq %r14, %rdi
movq %r15, %rsi
callq 0x7720
pushq $0x8
popq %rsi
movq %rbx, %rdi
movq %r14, %rdx
callq 0x7240
leaq 0x30(%rsp), %rdi
jmp 0x9a0d
pushq $0x58
popq %rsi
movq %r14, %rdi
callq 0x7490
leaq 0x18(%rbx), %r15
leaq 0x2b6c(%rip), %rsi      # 0xc54e
movq %r15, %rdi
callq 0x7af0
leaq 0x10(%rsp), %r14
movq %r14, %rdi
movq %r15, %rsi
callq 0x7720
pushq $0x5
popq %rsi
movq %rbx, %rdi
movq %r14, %rdx
callq 0x7240
leaq 0x10(%rsp), %rdi
callq 0x7180
addq $0x70, %rsp
popq %rbx
popq %r14
popq %r15
retq
jmp 0x9a20
jmp 0x9a20
movq %rax, %rbx
movq %r14, %rdi
callq 0x7180
movq %rbx, %rdi
callq 0x7a10
nop