user: Please show me the C implementation that matches the assembly code listed below:

```asm
<get_list>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %edi,-0x14(%rbp)
  mov    %esi,-0x18(%rbp)
  mov    %edx,-0x1c(%rbp)
  mov    %rcx,-0x28(%rbp)
  movl   $0x0,-0x8(%rbp)
  subl   $0x1,-0x1c(%rbp)
  mov    $0x0,%eax
  call   <wait_keyup@plt>
L50:
  mov    $0x0,%eax
  call   <get_key@plt>
  mov    %eax,-0x4(%rbp)
  cmpl   $0x33,-0x4(%rbp)
  ja     L162
  mov    -0x4(%rbp),%eax
  lea    0x0(,%rax,4),%rdx
  lea    D8(%rip),%rax
  mov    (%rdx,%rax,1),%eax
  cltq
  lea    D8(%rip),%rdx
  add    %rdx,%rax
  notrack jmp *%rax
  cmpl   $0x0,-0x8(%rbp)
  je     L111
  mov    -0x8(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movb   $0x0,(%rax)
  jmp    L121
  cmpl   $0x0,-0x8(%rbp)
  jle    L122
  subl   $0x1,-0x8(%rbp)
  mov    -0x8(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movb   $0x20,(%rax)
  jmp    L122
  mov    -0x8(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x8(%rbp)
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movb   $0x30,(%rax)
  jmp    L162
  mov    -0x8(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x8(%rbp)
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movb   $0x31,(%rax)
  jmp    L162
  mov    -0x8(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x8(%rbp)
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movb   $0x32,(%rax)
  jmp    L162
  mov    -0x8(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x8(%rbp)
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movb   $0x33,(%rax)
  jmp    L162
  mov    -0x8(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x8(%rbp)
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movb   $0x34,(%rax)
  jmp    L162
  mov    -0x8(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x8(%rbp)
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movb   $0x35,(%rax)
  jmp    L162
  mov    -0x8(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x8(%rbp)
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movb   $0x36,(%rax)
  jmp    L162
  mov    -0x8(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x8(%rbp)
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movb   $0x37,(%rax)
  jmp    L162
  mov    -0x8(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x8(%rbp)
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movb   $0x38,(%rax)
  jmp    L162
  mov    -0x8(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x8(%rbp)
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movb   $0x39,(%rax)
  jmp    L162
  mov    -0x8(%rbp),%eax
  lea    0x1(%rax),%edx
  mov    %edx,-0x8(%rbp)
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movb   $0x2c,(%rax)
  jmp    L162
L111:
  nop
  jmp    L162
L122:
  nop
L162:
  mov    -0x28(%rbp),%rdx
  mov    -0x18(%rbp),%ecx
  mov    -0x14(%rbp),%eax
  mov    %ecx,%esi
  mov    %eax,%edi
  call   <cprint@plt>
  mov    -0x8(%rbp),%eax
  cmp    -0x1c(%rbp),%eax
  jl     L50
  mov    -0x8(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x28(%rbp),%rax
  add    %rdx,%rax
  movb   $0x0,(%rax)
L121:
  leave
  ret
```

assistant: ```c
void get_list(int x, int y, int len, char *buf) {
  int c, n = 0;
  len--;
  wait_keyup();
  while (1) {
    c = get_key();
    switch (c) {
    case 0x1c:
      if (n) {
        buf[n] = 0;
        return;
      }
      break;
    case 0x0e:
      if (n > 0) {
        n -= 1;
        buf[n] = ' ';
      }
      break;
    case 0x0B:
      buf[n++] = '0';
      break;
    case 0x02:
      buf[n++] = '1';
      break;
    case 0x03:
      buf[n++] = '2';
      break;
    case 0x04:
      buf[n++] = '3';
      break;
    case 0x05:
      buf[n++] = '4';
      break;
    case 0x06:
      buf[n++] = '5';
      break;
    case 0x07:
      buf[n++] = '6';
      break;
    case 0x08:
      buf[n++] = '7';
      break;
    case 0x09:
      buf[n++] = '8';
      break;
    case 0x0a:
      buf[n++] = '9';
      break;
    case 0x33:
      buf[n++] = ',';
      break;
    }
    cprint(x, y, buf);
    if (n >= len) {
      buf[n] = 0;
      return;
    }
  }
}
```