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

```asm
<scan>:
  endbr64
  push   %r15
  push   %r14
  mov    %rdi,%r14
  push   %r13
  lea    D0(%rip),%r13
  push   %r12
  lea    D45(%rip),%r12
  push   %rbp
  lea    D47(%rip),%rbp
  push   %rbx
  lea    D28(%rip),%rbx
  sub    $0x8,%rsp
L92:
  movzbl (%r14),%eax
  cmp    $0x2d,%al
  je     L2
L59:
  jg     L102
  test   %al,%al
  je     L90
  cmp    $0x2b,%al
  jne    L138
  add    $0x1,%r14
  mov    %rbp,%rdi
  call   <printf@plt>
  movzbl (%r14),%eax
  cmp    $0x2d,%al
  jne    L59
  nopl   0x0(%rax,%rax,1)
L2:
  mov    %r12,%rdi
  add    $0x1,%r14
  call   <printf@plt>
  jmp    L92
  xchg   %ax,%ax
L102:
  cmp    $0x30,%al
  je     L114
  sub    $0x31,%eax
  cmp    $0x8,%al
  jbe    L115
L138:
  lea    D49(%rip),%rdi
  call   <printf@plt>
  add    $0x8,%rsp
  mov    $0x1,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nop
L115:
  movsbl 0x1(%r14),%eax
  lea    0x1(%r14),%r15
  sub    $0x30,%eax
  cmp    $0x9,%eax
  ja     L134
L28:
  movsbl 0x1(%r15),%eax
  add    $0x1,%r15
  sub    $0x30,%eax
  cmp    $0x9,%eax
  jbe    L28
L134:
  mov    %rbx,%rdi
  mov    %r15,%r14
  call   <printf@plt>
  jmp    L92
  nopw   0x0(%rax,%rax,1)
L90:
  lea    D9(%rip),%rdi
  call   <printf@plt>
  add    $0x8,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   (%rax)
L114:
  movsbl 0x1(%r14),%eax
  lea    0x1(%r14),%r15
  sub    $0x30,%eax
  cmp    $0x9,%eax
  ja     L134
  nopl   0x0(%rax)
L123:
  movsbl 0x1(%r15),%eax
  add    $0x1,%r15
  sub    $0x30,%eax
  cmp    $0x9,%eax
  jbe    L123
  mov    %r13,%rdi
  mov    %r15,%r14
  call   <printf@plt>
  jmp    L92
```

tool_calls: name: retrieve_data
arguments: data_label: D0
datatype: string
name: retrieve_data
arguments: data_label: D45
datatype: string
name: retrieve_data
arguments: data_label: D47
datatype: string
name: retrieve_data
arguments: data_label: D28
datatype: string
name: retrieve_data
arguments: data_label: D49
datatype: string
name: retrieve_data
arguments: data_label: D9
datatype: string

tool: D0: Oct


tool: D45: -


tool: D47: +


tool: D28: Num


tool: D49: ERR


tool: D9: EOF


assistant: ```c
int scan(char *s, int l) {
  char *p = s;
  char *q = 0;
  for (;;) {
    {
      char yych;
      if (((s + l) - p) < 2)
        ;
      yych = *p;
      switch (yych) {
      case 0x00:
        goto yy10;
      case '+':
        goto yy6;
      case '-':
        goto yy8;
      case '0':
        goto yy2;
      case '1':
      case '2':
      case '3':
      case '4':
      case '5':
      case '6':
      case '7':
      case '8':
      case '9':
        goto yy4;
      default:
        goto yy12;
      }
    yy2:
      ++p;
      switch ((yych = *p)) {
      case '0':
      case '1':
      case '2':
      case '3':
      case '4':
      case '5':
      case '6':
      case '7':
      case '8':
      case '9':
        goto yy16;
      default:
        goto yy3;
      }
    yy3 : {
      printf("Num\n");
      continue;
    }
    yy4:
      ++p;
      yych = *p;
      goto yy15;
    yy5 : {
      printf("Num\n");
      continue;
    }
    yy6:
      ++p;
      {
        printf("+\n");
        continue;
      }
    yy8:
      ++p;
      {
        printf("-\n");
        continue;
      }
    yy10:
      ++p;
      {
        printf("EOF\n");
        return 0;
      }
    yy12:
      ++p;
      {
        printf("ERR\n");
        return 1;
      }
    yy14:
      ++p;
      if ((s + l) <= p)
        ;
      yych = *p;
    yy15:
      switch (yych) {
      case '0':
      case '1':
      case '2':
      case '3':
      case '4':
      case '5':
      case '6':
      case '7':
      case '8':
      case '9':
        goto yy14;
      default:
        goto yy5;
      }
    yy16:
      ++p;
      if ((s + l) <= p)
        ;
      yych = *p;
      switch (yych) {
      case '0':
      case '1':
      case '2':
      case '3':
      case '4':
      case '5':
      case '6':
      case '7':
      case '8':
      case '9':
        goto yy16;
      default:
        goto yy18;
      }
    yy18 : {
      printf("Oct\n");
      continue;
    }
    }
  }
}
```