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

```asm
<get_next_number>:
  endbr64
  mov    %rdx,%r8
  movzbl (%rdi),%edx
  cmp    $0x20,%dl
  je     L336
  cmp    $0x9,%dl
  jne    L134
L336:
  mov    $0x1,%eax
  nopl   (%rax)
L156:
  movzbl (%rdi,%rax,1),%edx
  mov    %eax,%r10d
  add    $0x1,%rax
  cmp    $0x20,%dl
  je     L156
  cmp    $0x9,%dl
  je     L156
L271:
  mov    $0x1,%r9d
  test   %dl,%dl
  je     L62
  lea    -0x30(%rdx),%eax
  cmp    $0x9,%al
  ja     L316
  movslq %r10d,%r9
  push   %rbp
  movsbl (%rdi,%r9,1),%edx
  push   %rbx
  lea    -0x30(%rdx),%r11d
  mov    %edx,%eax
  mov    %edx,%ecx
  cmp    $0x9,%r11b
  jbe    L113
L335:
  and    $0xffffffdf,%eax
  sub    $0x41,%eax
  cmp    $0x5,%al
  ja     L191
L14:
  xor    %eax,%eax
  jmp    L226
  nopl   0x0(%rax,%rax,1)
L328:
  shl    $0x4,%eax
  lea    -0x30(%rax,%rdx,1),%eax
L123:
  movsbl 0x1(%rdi,%r9,1),%edx
  add    $0x1,%r9
L226:
  lea    -0x30(%rdx),%ecx
  mov    %r9d,%r10d
  cmp    $0x9,%cl
  jbe    L328
  lea    -0x61(%rdx),%ecx
  cmp    $0x5,%cl
  ja     L244
  shl    $0x4,%eax
  lea    -0x57(%rax,%rdx,1),%eax
  jmp    L123
  nopl   (%rax)
L316:
  cmp    $0x24,%dl
  jne    L62
  lea    0x1(%r10),%r9d
  xor    %eax,%eax
  movslq %r9d,%r9
  jmp    L203
L41:
  shl    $0x4,%eax
  lea    -0x30(%rax,%rdx,1),%eax
L277:
  add    $0x1,%r9
L203:
  movsbl (%rdi,%r9,1),%edx
  mov    %r9d,%r10d
  lea    -0x30(%rdx),%ecx
  cmp    $0x9,%cl
  jbe    L41
  lea    -0x61(%rdx),%ecx
  cmp    $0x5,%cl
  ja     L190
  shl    $0x4,%eax
  lea    -0x57(%rax,%rdx,1),%eax
  jmp    L277
L234:
  test   $0xdf,%dl
  je     L320
  mov    $0x1,%r9d
  cmp    $0x9,%dl
  jne    L62
L320:
  mov    %eax,(%rsi)
  xor    %r9d,%r9d
  add    %r10d,(%r8)
L62:
  mov    %r9d,%eax
  ret
  nopl   0x0(%rax)
L244:
  lea    -0x41(%rdx),%ecx
  cmp    $0x5,%cl
  ja     L286
  shl    $0x4,%eax
  lea    -0x37(%rax,%rdx,1),%eax
  jmp    L123
  nopl   0x0(%rax)
L286:
  mov    %edx,%ecx
  and    $0xffffffdf,%ecx
  cmp    $0x48,%cl
  je     L104
  cmp    $0x20,%dl
  ja     L251
  movabs $0x100000201,%rcx
  bt     %rdx,%rcx
  jb     L104
L251:
  mov    $0x1,%r9d
  pop    %rbx
  pop    %rbp
  mov    %r9d,%eax
  ret
  nopl   0x0(%rax,%rax,1)
L191:
  and    $0xffffffdf,%ecx
  cmp    $0x48,%cl
  je     L14
  lea    0x1(%r10),%ecx
  xor    %eax,%eax
  movslq %ecx,%rcx
  cmp    $0x9,%r11b
  ja     L150
  nopl   0x0(%rax,%rax,1)
L148:
  lea    (%rax,%rax,4),%eax
  mov    %ecx,%r10d
  lea    -0x30(%rdx,%rax,2),%eax
  movsbl (%rdi,%rcx,1),%edx
  add    $0x1,%rcx
  lea    -0x30(%rdx),%r9d
  cmp    $0x9,%r9b
  jbe    L148
L150:
  test   $0xdf,%dl
  je     L104
  mov    $0x1,%r9d
  cmp    $0x9,%dl
  jne    L33
  nopl   0x0(%rax)
L104:
  mov    %eax,(%rsi)
  xor    %r9d,%r9d
  add    %r10d,(%r8)
L33:
  mov    %r9d,%eax
  pop    %rbx
  pop    %rbp
  ret
  cs nopw 0x0(%rax,%rax,1)
L134:
  xor    %r10d,%r10d
  jmp    L271
  nopl   0x0(%rax,%rax,1)
L190:
  lea    -0x41(%rdx),%ecx
  cmp    $0x5,%cl
  ja     L234
  shl    $0x4,%eax
  lea    -0x37(%rax,%rdx,1),%eax
  jmp    L277
  nopl   0x0(%rax,%rax,1)
L113:
  lea    0x1(%rdi,%r9,1),%rbx
L5:
  movzbl (%rbx),%ecx
  add    $0x1,%rbx
  lea    -0x30(%rcx),%ebp
  mov    %ecx,%eax
  cmp    $0x9,%bpl
  ja     L335
  jmp    L5
```

assistant: ```c
int get_next_number(char *in, int *out, int *pos) {
  int i, o, n;
  for (i = 0; in[i] == ' ' || in[i] == 0x09; i++)
    ;
  if (in[i] == 0)
    return 1;
  if (in[i] >= '0' && in[i] <= '9') {
    n = 0;
    for (o = 0; 1; o++) {
      if (in[i + o] >= '0' && in[i + o] <= '9')
        continue;
      if (in[i + o] >= 'a' && in[i + o] <= 'f') {
        n = 1;
        break;
      }
      if (in[i + o] >= 'A' && in[i + o] <= 'F') {
        n = 1;
        break;
      }
      if (in[i + o] == 'h' || in[i + o] == 'H') {
        n = 1;
        break;
      }
      break;
    }
    if (n == 1) {
      o = 0;
      while (1) {
        if (in[i] >= '0' && in[i] <= '9')
          o = (o * 16) + in[i] - '0';
        else if (in[i] >= 'a' && in[i] <= 'f')
          o = (o * 16) + in[i] - 'a' + 0xA;
        else if (in[i] >= 'A' && in[i] <= 'F')
          o = (o * 16) + in[i] - 'A' + 0xA;
        else if (in[i] == 'h' || in[i] == 'H')
          break;
        else if (in[i] == ' ' || in[i] == 0x09 || in[i] == 0)
          break;
        else
          return 1;
        i++;
      }
    } else {
      for (o = 0; in[i] >= '0' && in[i] <= '9'; i++)
        o = (o * 10) + in[i] - '0';
      if (!(in[i] == ' ' || in[i] == 0x09 || in[i] == 0))
        return 1;
    }
  } else if (in[i] == '$') {
    i++;
    o = 0;
    while (1) {
      if (in[i] >= '0' && in[i] <= '9')
        o = (o * 16) + in[i] - '0';
      else if (in[i] >= 'a' && in[i] <= 'f')
        o = (o * 16) + in[i] - 'a' + 0xA;
      else if (in[i] >= 'A' && in[i] <= 'F')
        o = (o * 16) + in[i] - 'A' + 0xA;
      else if (in[i] == ' ' || in[i] == 0x09 || in[i] == 0)
        break;
      else
        return 1;
      i++;
    }
  } else
    return 1;
  *out = o;
  *pos += i;
  return 0;
}
```