// File: /workspace/github_c_makefile_star2_O0/kieselsteini[P]PiXL-old/pixl.c
// Function: mml_parse_next
static void mml_parse_next(AudioChannel *channel) {
  for (;;) {
    if (!channel->in) return;
    mml_skip_spaces(channel);
    switch (*channel->in++) {
    case 0:
      if (channel->looping) channel->in = channel->source;
      else mml_reset_channel(channel);
      break;
    case 'T': case 't':
      channel->tempo = mml_parse_number(channel);
      break;
    case 'L': case 'l':
      channel->default_length = mml_parse_number(channel);
      break;
    case 'O': case 'o':
      channel->octave = mml_parse_number(channel);
      break;
    case '<':
      --channel->octave;
      break;
    case '>':
      ++channel->octave;
      break;
    case 'R': case 'r': case 'P': case 'p':
      mml_parse_duration(channel);
      channel->silence = channel->duration;
      return;
    case 'C': case 'c':
      mml_parse_note(channel, 4);
      return;
    case 'D': case 'd':
      mml_parse_note(channel, 6);
      return;
    case 'E': case 'e':
      mml_parse_note(channel, 8);
      return;
    case 'F': case 'f':
      mml_parse_note(channel, 9);
      return;
    case 'G': case 'g':
      mml_parse_note(channel, 11);
      return;
    case 'A': case 'a':
      mml_parse_note(channel, 13);
      return;
    case 'B': case 'b':
      mml_parse_note(channel, 15);
      return;
    case 'W': case 'w':
      switch (*channel->in++) {
      case '1': channel->waveform = PX_WAVEFORM_PULSE_12; break;
      case '2': channel->waveform = PX_WAVEFORM_PULSE_25; break;
      case '5': channel->waveform = PX_WAVEFORM_PULSE_50; break;
      case 'T': case 't': channel->waveform = PX_WAVEFORM_TRIANLGE; break;
      case 'S': case 's': channel->waveform = PX_WAVEFORM_SAWTOOTH; break;
      case 'N': case 'n': channel->waveform = PX_WAVEFORM_NOISE; break;
      }
      break;
    }
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
cmpq $0x0, 0x8(%rax)
jne 0x528cc
jmp 0x52aca
movq -0x8(%rbp), %rdi
callq 0x52ad0
movq -0x8(%rbp), %rcx
movq 0x8(%rcx), %rax
movq %rax, %rdx
incq %rdx
movq %rdx, 0x8(%rcx)
movsbl (%rax), %eax
movl %eax, %ecx
movq %rcx, -0x10(%rbp)
subl $0x77, %eax
ja 0x52ac5
movq -0x10(%rbp), %rax
leaq 0x4e14(%rip), %rcx      # 0x57718
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x8(%rbp), %rax
cmpl $0x0, 0x10(%rax)
je 0x52928
movq -0x8(%rbp), %rax
movq (%rax), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x8(%rax)
jmp 0x52931
movq -0x8(%rbp), %rdi
callq 0x51ee0
jmp 0x52ac5
movq -0x8(%rbp), %rdi
callq 0x52b10
movl %eax, %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x28(%rax)
jmp 0x52ac5
movq -0x8(%rbp), %rdi
callq 0x52b10
movl %eax, %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x30(%rax)
jmp 0x52ac5
movq -0x8(%rbp), %rdi
callq 0x52b10
movl %eax, %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x2c(%rax)
jmp 0x52ac5
movq -0x8(%rbp), %rax
movl 0x2c(%rax), %ecx
addl $-0x1, %ecx
movl %ecx, 0x2c(%rax)
jmp 0x52ac5
movq -0x8(%rbp), %rax
movl 0x2c(%rax), %ecx
addl $0x1, %ecx
movl %ecx, 0x2c(%rax)
jmp 0x52ac5
movq -0x8(%rbp), %rdi
callq 0x52b80
movq -0x8(%rbp), %rax
movl 0x20(%rax), %ecx
movq -0x8(%rbp), %rax
movl %ecx, 0x24(%rax)
jmp 0x52aca
movq -0x8(%rbp), %rdi
movl $0x4, %esi
callq 0x52c70
jmp 0x52aca
movq -0x8(%rbp), %rdi
movl $0x6, %esi
callq 0x52c70
jmp 0x52aca
movq -0x8(%rbp), %rdi
movl $0x8, %esi
callq 0x52c70
jmp 0x52aca
movq -0x8(%rbp), %rdi
movl $0x9, %esi
callq 0x52c70
jmp 0x52aca
movq -0x8(%rbp), %rdi
movl $0xb, %esi
callq 0x52c70
jmp 0x52aca
movq -0x8(%rbp), %rdi
movl $0xd, %esi
callq 0x52c70
jmp 0x52aca
movq -0x8(%rbp), %rdi
movl $0xf, %esi
callq 0x52c70
jmp 0x52aca
movq -0x8(%rbp), %rcx
movq 0x8(%rcx), %rax
movq %rax, %rdx
incq %rdx
movq %rdx, 0x8(%rcx)
movsbl (%rax), %eax
addl $-0x31, %eax
movl %eax, %ecx
movq %rcx, -0x18(%rbp)
subl $0x43, %eax
ja 0x52ac3
movq -0x18(%rbp), %rax
leaq 0x4e8a(%rip), %rcx      # 0x578f8
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq -0x8(%rbp), %rax
movl $0x1, 0x1c(%rax)
jmp 0x52ac3
movq -0x8(%rbp), %rax
movl $0x2, 0x1c(%rax)
jmp 0x52ac3
movq -0x8(%rbp), %rax
movl $0x3, 0x1c(%rax)
jmp 0x52ac3
movq -0x8(%rbp), %rax
movl $0x5, 0x1c(%rax)
jmp 0x52ac3
movq -0x8(%rbp), %rax
movl $0x4, 0x1c(%rax)
jmp 0x52ac3
movq -0x8(%rbp), %rax
movl $0x6, 0x1c(%rax)
jmp 0x52ac5
jmp 0x528bc
addq $0x20, %rsp
popq %rbp
retq