user: Translate the below assembly code into C programming language:

```asm
<read_freq>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %rdi,-0x28(%rbp)
  mov    %rsi,-0x30(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movw   $0x0,-0x14(%rbp)
  movw   $0x0,-0x12(%rbp)
  lea    -0x14(%rbp),%rax
  mov    %rax,-0x10(%rbp)
  jmp    L65
L44:
  movzbl -0x15(%rbp),%eax
  cmp    $0x2f,%al
  jle    L51
  movzbl -0x15(%rbp),%eax
  cmp    $0x39,%al
  jg     L51
  movzbl -0x15(%rbp),%eax
  sub    $0x30,%eax
  mov    %al,-0x15(%rbp)
  mov    -0x10(%rbp),%rax
  movzwl (%rax),%edx
  mov    %edx,%eax
  shl    $0x2,%eax
  add    %edx,%eax
  add    %eax,%eax
  mov    %eax,%edx
  mov    -0x10(%rbp),%rax
  mov    %dx,(%rax)
  mov    -0x10(%rbp),%rax
  movzwl (%rax),%edx
  movzbl -0x15(%rbp),%eax
  cbtw
  add    %eax,%edx
  mov    -0x10(%rbp),%rax
  mov    %dx,(%rax)
  jmp    L65
L51:
  movzbl -0x15(%rbp),%eax
  cmp    $0x3a,%al
  jne    L13
  lea    -0x14(%rbp),%rax
  add    $0x2,%rax
  mov    %rax,-0x10(%rbp)
  mov    -0x10(%rbp),%rax
  movw   $0x0,(%rax)
  jmp    L65
L13:
  movzbl -0x15(%rbp),%eax
  cmp    $0x20,%al
  jne    L65
  lea    -0x14(%rbp),%rax
  mov    %rax,-0x10(%rbp)
  mov    -0x30(%rbp),%rax
  movzwl (%rax),%eax
  lea    0x1(%rax),%ecx
  mov    -0x30(%rbp),%rdx
  mov    %cx,(%rdx)
  movzwl %ax,%eax
  lea    (%rax,%rax,1),%rdx
  mov    -0x28(%rbp),%rax
  add    %rax,%rdx
  movzwl -0x14(%rbp),%eax
  mov    %ax,(%rdx)
  movzwl -0x12(%rbp),%eax
  test   %ax,%ax
  je     L0
  movzwl -0x12(%rbp),%edx
  jmp    L48
L0:
  mov    $0xc8,%edx
L48:
  mov    -0x30(%rbp),%rax
  movzwl (%rax),%eax
  lea    0x1(%rax),%esi
  mov    -0x30(%rbp),%rcx
  mov    %si,(%rcx)
  movzwl %ax,%eax
  lea    (%rax,%rax,1),%rcx
  mov    -0x28(%rbp),%rax
  add    %rcx,%rax
  mov    %dx,(%rax)
  movw   $0x0,-0x12(%rbp)
  movzwl -0x12(%rbp),%eax
  mov    %ax,-0x14(%rbp)
L65:
  lea    -0x15(%rbp),%rax
  mov    $0x1,%edx
  mov    %rax,%rsi
  mov    $0x0,%edi
  call   <read@plt>
  cmp    $0x1,%eax
  je     L44
  movzwl -0x14(%rbp),%eax
  test   %ax,%ax
  je     L87
  mov    -0x30(%rbp),%rax
  movzwl (%rax),%eax
  lea    0x1(%rax),%ecx
  mov    -0x30(%rbp),%rdx
  mov    %cx,(%rdx)
  movzwl %ax,%eax
  lea    (%rax,%rax,1),%rdx
  mov    -0x28(%rbp),%rax
  add    %rax,%rdx
  movzwl -0x14(%rbp),%eax
  mov    %ax,(%rdx)
  movzwl -0x12(%rbp),%eax
  test   %ax,%ax
  je     L139
  movzwl -0x12(%rbp),%edx
  jmp    L79
L139:
  mov    $0xc8,%edx
L79:
  mov    -0x30(%rbp),%rax
  movzwl (%rax),%eax
  lea    0x1(%rax),%esi
  mov    -0x30(%rbp),%rcx
  mov    %si,(%rcx)
  movzwl %ax,%eax
  lea    (%rax,%rax,1),%rcx
  mov    -0x28(%rbp),%rax
  add    %rcx,%rax
  mov    %dx,(%rax)
L87:
  nop
  mov    -0x8(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L119
  call   <__stack_chk_fail@plt>
L119:
  leave
  ret
```

assistant: ```c
void read_freq(unsigned short *buf, unsigned short *i) {
  char b;
  struct {
    unsigned short freq;
    unsigned short len;
  } sound = {0, 0};
  unsigned short *p = &sound.freq;
  while (read(0, &b, 1) == 1) {
    if (b >= '0' && b <= '9') {
      b -= '0';
      *p *= 10;
      *p += b;
    } else if (b == ':') {
      p = &sound.len;
      *p = 0;
    } else if (b == ' ') {
      p = &sound.freq;
      buf[(*i)++] = sound.freq;
      buf[(*i)++] = sound.len ? sound.len : 200;
      sound.freq = sound.len = 0;
    }
  }
  if (sound.freq) {
    buf[(*i)++] = sound.freq;
    buf[(*i)++] = sound.len ? sound.len : 200;
  }
}
```