// File: /workspace/github_cpp_makefile_star2_O1/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 0x3195(%rip), %rsi      # 0xd21d
leaq 0x8(%rsp), %rdi
movl $0x1, %edx
movl $0x1, %ecx
callq 0x7150
testl %eax, %eax
js 0xa11a
movq 0x8(%rsp), %rdi
movq (%r14), %rsi
callq 0x7450
movl $0x58, %edi
callq 0x7410
movq %rax, %r14
movq 0x8(%rsp), %rax
movq %rax, (%r14)
movq $-0x1, 0x8(%r14)
movl $0x20, 0x20(%r14)
leaq 0x18(%r14), %rsi
xorl %eax, %eax
movq %rax, 0x18(%r14)
movq %rax, 0x28(%r14)
movl $0x20, %edi
callq 0x7660
testl %eax, %eax
js 0xa17f
movl 0x20(%r14), %edi
callq 0x75e0
movq %rax, 0x28(%r14)
testq %rax, %rax
je 0xa1ea
movq 0x18(%r14), %rdi
callq 0x7180
movq %r14, 0x8(%rbx)
jmp 0xa25b
leaq 0x18(%rbx), %rdi
movq 0x20(%rbx), %rdx
leaq 0x338e(%rip), %rcx      # 0xd4b7
movl $0x45, %r8d
xorl %esi, %esi
callq 0x7710
leaq 0x60(%rsp), %r15
movq %r15, -0x10(%r15)
movq 0x18(%rbx), %rsi
movq 0x20(%rbx), %rdx
addq %rsi, %rdx
leaq 0x50(%rsp), %r14
movq %r14, %rdi
callq 0x7130
movq %rbx, %rdi
movl $0x8, %esi
movq %r14, %rdx
callq 0x7200
movq 0x50(%rsp), %rdi
cmpq %r15, %rdi
je 0xa25b
movq 0x60(%rsp), %rsi
jmp 0xa253
movl $0x58, %esi
movq %r14, %rdi
callq 0x7420
leaq 0x18(%rbx), %rdi
movq 0x20(%rbx), %rdx
leaq 0x3362(%rip), %rcx      # 0xd4fd
movl $0x40, %r8d
xorl %esi, %esi
callq 0x7710
leaq 0x40(%rsp), %r15
movq %r15, -0x10(%r15)
movq 0x18(%rbx), %rsi
movq 0x20(%rbx), %rdx
addq %rsi, %rdx
leaq 0x30(%rsp), %r14
movq %r14, %rdi
callq 0x7130
movq %rbx, %rdi
movl $0x8, %esi
movq %r14, %rdx
callq 0x7200
movq 0x30(%rsp), %rdi
cmpq %r15, %rdi
je 0xa25b
movq 0x40(%rsp), %rsi
jmp 0xa253
movl $0x58, %esi
movq %r14, %rdi
callq 0x7420
leaq 0x18(%rbx), %rdi
movq 0x20(%rbx), %rdx
leaq 0x3338(%rip), %rcx      # 0xd53e
movl $0x3a, %r8d
xorl %esi, %esi
callq 0x7710
leaq 0x20(%rsp), %r15
movq %r15, -0x10(%r15)
movq 0x18(%rbx), %rsi
movq 0x20(%rbx), %rdx
addq %rsi, %rdx
leaq 0x10(%rsp), %r14
movq %r14, %rdi
callq 0x7130
movq %rbx, %rdi
movl $0x5, %esi
movq %r14, %rdx
callq 0x7200
movq 0x10(%rsp), %rdi
cmpq %r15, %rdi
je 0xa25b
movq 0x20(%rsp), %rsi
incq %rsi
callq 0x7420
addq $0x70, %rsp
popq %rbx
popq %r14
popq %r15
retq
movq %rax, %rbx
movq 0x10(%rsp), %rdi
jmp 0xa281
movq %rax, %rbx
movq 0x30(%rsp), %rdi
jmp 0xa281
movq %rax, %rbx
movq 0x50(%rsp), %rdi
cmpq %r15, %rdi
je 0xa291
movq (%r15), %rsi
incq %rsi
callq 0x7420
movq %rbx, %rdi
callq 0x78b0
nop