user: 请从给定的汇编指令推导出C源代码：

```asm
<metaevent>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %edi,-0x14(%rbp)
  mov    $0x0,%eax
  call   <msgleng@plt>
  mov    %eax,-0xc(%rbp)
  mov    $0x0,%eax
  call   <msg@plt>
  mov    %rax,-0x8(%rbp)
  cmpl   $0x7f,-0x14(%rbp)
  je     L17
  cmpl   $0x7f,-0x14(%rbp)
  jg     L107
  cmpl   $0x59,-0x14(%rbp)
  je     L25
  cmpl   $0x59,-0x14(%rbp)
  jg     L107
  cmpl   $0x58,-0x14(%rbp)
  je     L26
  cmpl   $0x58,-0x14(%rbp)
  jg     L107
  cmpl   $0x54,-0x14(%rbp)
  je     L118
  cmpl   $0x54,-0x14(%rbp)
  jg     L107
  cmpl   $0x51,-0x14(%rbp)
  je     L16
  cmpl   $0x51,-0x14(%rbp)
  jg     L107
  cmpl   $0x2f,-0x14(%rbp)
  je     L229
  cmpl   $0x2f,-0x14(%rbp)
  jg     L107
  cmpl   $0x0,-0x14(%rbp)
  je     L63
  cmpl   $0x0,-0x14(%rbp)
  js     L107
  mov    -0x14(%rbp),%eax
  sub    $0x1,%eax
  cmp    $0xe,%eax
  ja     L107
  jmp    L198
L63:
  mov    -0x8(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  movsbl %al,%edx
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %edx,%esi
  mov    %eax,%edi
  call   <to16bit@plt>
  mov    %eax,%edi
  call   <copy_metaseqnum@plt>
  jmp    L132
L198:
  mov    -0x8(%rbp),%rdx
  mov    -0xc(%rbp),%ecx
  mov    -0x14(%rbp),%eax
  mov    %ecx,%esi
  mov    %eax,%edi
  call   <copy_metatext@plt>
  jmp    L132
L229:
  mov    $0x0,%eax
  call   <copy_metaeot@plt>
  jmp    L132
L16:
  mov    -0x8(%rbp),%rax
  add    $0x2,%rax
  movzbl (%rax),%eax
  movsbl %al,%ecx
  mov    -0x8(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  movsbl %al,%edx
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%esi
  mov    $0x0,%edi
  call   <to32bit@plt>
  mov    %eax,%edi
  call   <mf_write_tempo@plt>
  jmp    L132
L118:
  mov    -0x8(%rbp),%rax
  mov    $0x5,%edx
  mov    %rax,%rsi
  mov    $0x54,%edi
  call   <mf_write_meta_event@plt>
  jmp    L132
L26:
  mov    -0x8(%rbp),%rax
  add    $0x3,%rax
  movzbl (%rax),%eax
  movsbl %al,%ecx
  mov    -0x8(%rbp),%rax
  add    $0x2,%rax
  movzbl (%rax),%eax
  movsbl %al,%edx
  mov    -0x8(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  movsbl %al,%esi
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <copy_timesig@plt>
  jmp    L132
L25:
  mov    -0x8(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  movsbl %al,%edx
  mov    -0x8(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %edx,%esi
  mov    %eax,%edi
  call   <copy_keysig@plt>
  jmp    L132
L17:
  mov    -0x8(%rbp),%rdx
  mov    -0xc(%rbp),%eax
  mov    %rdx,%rsi
  mov    %eax,%edi
  call   <copy_metaspecial@plt>
  jmp    L132
L107:
  mov    -0x8(%rbp),%rdx
  mov    -0xc(%rbp),%ecx
  mov    -0x14(%rbp),%eax
  mov    %ecx,%esi
  mov    %eax,%edi
  call   <copy_metamisc@plt>
  nop
L132:
  nop
  leave
  ret
```

assistant: ```c
void metaevent(int type) {
  int leng;
  char *m;
  leng = msgleng();
  m = msg();
  switch (type) {
  case 0x00:
    copy_metaseqnum(to16bit(m[0], m[1]));
    break;
  case 0x01:
  case 0x02:
  case 0x03:
  case 0x04:
  case 0x05:
  case 0x06:
  case 0x07:
  case 0x08:
  case 0x09:
  case 0x0a:
  case 0x0b:
  case 0x0c:
  case 0x0d:
  case 0x0e:
  case 0x0f:
    copy_metatext(type, leng, m);
    break;
  case 0x2f:
    copy_metaeot();
    break;
  case 0x51:
    mf_write_tempo(to32bit(0, m[0], m[1], m[2]));
    break;
  case 0x54:
    mf_write_meta_event(0x54, m, 5);
    break;
  case 0x58:
    copy_timesig(m[0], m[1], m[2], m[3]);
    break;
  case 0x59:
    copy_keysig(m[0], m[1]);
    break;
  case 0x7f:
    copy_metaspecial(leng, m);
    break;
  default:
    copy_metamisc(type, leng, m);
  }
}
```