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

```asm
<cmd_bytes>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x40,%rsp
  mov    %rdi,-0x28(%rbp)
  mov    %rsi,-0x30(%rbp)
  mov    %rdx,-0x38(%rbp)
  mov    -0x38(%rbp),%rax
  mov    %rax,-0x8(%rbp)
  movq   $0x0,-0x18(%rbp)
  mov    -0x30(%rbp),%rax
  mov    %rax,-0x10(%rbp)
  mov    -0x10(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x69,%al
  jne    L101
  mov    -0x10(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  cmp    $0x6e,%al
  jne    L101
  mov    -0x10(%rbp),%rax
  add    $0x2,%rax
  movzbl (%rax),%eax
  cmp    $0x66,%al
  jne    L101
  mov    -0x10(%rbp),%rax
  add    $0x3,%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L101
  mov    -0x8(%rbp),%rax
  movq   $0x0,(%rax)
  mov    $0x1,%eax
  jmp    L215
L90:
  mov    -0x18(%rbp),%rdx
  mov    %rdx,%rax
  shl    $0x2,%rax
  add    %rdx,%rax
  add    %rax,%rax
  mov    %rax,%rdx
  mov    -0x10(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  sub    $0x30,%eax
  cltq
  add    %rdx,%rax
  mov    %rax,-0x18(%rbp)
  addq   $0x1,-0x10(%rbp)
L101:
  mov    -0x10(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  je     L205
  mov    -0x10(%rbp),%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  mov    %eax,%edi
  call   <isdigit@plt>
  test   %rax,%rax
  jne    L90
L205:
  mov    -0x10(%rbp),%rax
  cmp    -0x30(%rbp),%rax
  je     L20
  mov    -0x10(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  je     L169
  mov    -0x10(%rbp),%rax
  add    $0x1,%rax
  movzbl (%rax),%eax
  test   %al,%al
  je     L169
L20:
  mov    -0x30(%rbp),%rdx
  mov    -0x28(%rbp),%rax
  mov    %rax,%rsi
  lea    D14(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  mov    $0x0,%eax
  jmp    L215
L169:
  mov    -0x10(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <tolower@plt>
  cmp    $0x6d,%eax
  je     L157
  cmp    $0x6d,%eax
  jg     L170
  cmp    $0x6b,%eax
  je     L174
  cmp    $0x6b,%eax
  jg     L170
  test   %eax,%eax
  je     L44
  cmp    $0x67,%eax
  je     L89
  jmp    L170
L174:
  shlq   $0xa,-0x18(%rbp)
  jmp    L46
L157:
  shlq   $0x14,-0x18(%rbp)
  jmp    L46
L89:
  shlq   $0x1e,-0x18(%rbp)
  jmp    L46
L170:
  mov    -0x30(%rbp),%rdx
  mov    -0x28(%rbp),%rax
  mov    %rax,%rsi
  lea    D14(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  mov    $0x0,%eax
  jmp    L215
L44:
  nop
L46:
  mov    -0x8(%rbp),%rax
  mov    -0x18(%rbp),%rdx
  mov    %rdx,(%rax)
  mov    $0x1,%eax
L215:
  leave
  ret
```

tool_calls: name: extract_symbolic_data
arguments: data_label: D14
type_guessed: string

tool: D14: %s: Invalid specification `%s'


assistant: ```c
int cmd_bytes(const char *com, const char *val, void *closure) {
  long result;
  long *out = (long *)closure;
  const char *p;
  result = 0;
  p = val;
  if (p[0] == 'i' && p[1] == 'n' && p[2] == 'f' && p[3] == '\0') {
    *out = 0;
    return 1;
  }
  for (; *p && isdigit((unsigned char)(*p)); p++)
    result = (10 * result) + (*p - '0');
  if (p == val || (*p != '\0' && *(p + 1) != '\0')) {
    printf("%s: Invalid specification `%s'\n", com, val);
    return 0;
  }
  switch (tolower(*p)) {
  case '\0':
    break;
  case 'k':
    result *= 1024;
    break;
  case 'm':
    result *= (long)1024 * 1024;
    break;
  case 'g':
    result *= (long)1024 * 1024 * 1024;
    break;
  default:
    printf("%s: Invalid specification `%s'\n", com, val);
    return 0;
  }
  *out = result;
  return 1;
}
```