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

```asm
<find_number>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x28,%rsp
  mov    %rdi,%rbp
  mov    %esi,%ebx
  mov    %rdx,%r13
  mov    %rcx,%r12
  mov    %fs:0x28,%rax
  mov    %rax,0x18(%rsp)
  xor    %eax,%eax
  movl   $0x0,(%rdx)
  movl   $0x0,(%rcx)
  cmp    $0xc,%esi
  jg     L331
L224:
  cmp    $0xe,%ebx
  jg     L40
L125:
  lea    0xc(%rsp),%rcx
  lea    0x8(%rsp),%rdx
  mov    %ebx,%esi
  mov    %rbp,%rdi
  call   <find_rightmost_num@plt>
  test   %eax,%eax
  jne    L260
L395:
  mov    0x18(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L246
  add    $0x28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
L331:
  movslq %esi,%rax
  lea    -0xd(%rdi,%rax,1),%rsi
  mov    $0xd,%edx
  lea    D4(%rip),%rdi
  call   <strncmp@plt>
  test   %eax,%eax
  jne    L224
  sub    $0xd,%ebx
  jmp    L125
L40:
  movslq %ebx,%rax
  lea    -0xf(%rbp,%rax,1),%rsi
  mov    $0xf,%edx
  lea    D8(%rip),%rdi
  call   <strncmp@plt>
  mov    %eax,%edx
  lea    -0xf(%rbx),%eax
  test   %edx,%edx
  cmove  %eax,%ebx
  jmp    L125
L260:
  mov    0x8(%rsp),%edi
  mov    0xc(%rsp),%esi
  sub    %edi,%esi
  movslq %edi,%rdi
  add    %rbp,%rdi
  call   <to_i@plt>
  mov    0xc(%rsp),%edx
  cmp    %ebx,%edx
  jl     L210
  mov    0x8(%rsp),%esi
  cmp    $0x1,%esi
  jle    L142
  movslq %esi,%rdx
  cmpb   $0x5f,-0x1(%rbp,%rdx,1)
  je     L34
L142:
  cmp    $0x2,%esi
  setg   %dl
  test   %eax,%eax
  jne    L231
  test   %dl,%dl
  jne    L247
L231:
  cmp    $0x3,%eax
  jne    L129
  test   %dl,%dl
  jne    L361
L129:
  cmp    $0x4,%esi
  jle    L215
  cmp    $0x3,%eax
  jbe    L348
L215:
  mov    0x8(%rsp),%eax
  mov    %eax,0x0(%r13)
  mov    0xc(%rsp),%eax
L13:
  mov    %eax,(%r12)
  jmp    L395
L210:
  mov    0x8(%rsp),%eax
  mov    %eax,0x0(%r13)
  mov    %edx,(%r12)
  jmp    L395
L34:
  movzbl -0x2(%rbp,%rdx,1),%edx
  lea    -0x41(%rdx),%ecx
  cmp    $0x19,%cl
  jbe    L203
  sub    $0x30,%edx
  cmp    $0x9,%dl
  jbe    L203
  cmp    $0x2,%esi
  setg   %dl
  test   %eax,%eax
  jne    L231
  test   %dl,%dl
  je     L231
  jmp    L129
L247:
  movslq %esi,%rdx
  cmpb   $0x53,-0x1(%rbp,%rdx,1)
  jne    L129
  cmpb   $0x5f,-0x2(%rbp,%rdx,1)
  jne    L215
  movzbl -0x3(%rbp,%rdx,1),%eax
  lea    -0x41(%rax),%edx
  cmp    $0x19,%dl
  jbe    L203
  sub    $0x30,%eax
  cmp    $0x9,%al
  ja     L215
L203:
  lea    0x14(%rsp),%rcx
  lea    0x10(%rsp),%rdx
  mov    %rbp,%rdi
  call   <find_rightmost_num@plt>
  test   %eax,%eax
  je     L215
  mov    0x10(%rsp),%eax
  mov    %eax,0x0(%r13)
  mov    0x14(%rsp),%eax
  jmp    L13
L361:
  movslq %esi,%rdx
  cmpb   $0x4e,-0x1(%rbp,%rdx,1)
  jne    L129
  cmpb   $0x5f,-0x2(%rbp,%rdx,1)
  jne    L215
  movzbl -0x3(%rbp,%rdx,1),%eax
  lea    -0x41(%rax),%edx
  cmp    $0x19,%dl
  jbe    L203
  sub    $0x30,%eax
  cmp    $0x9,%al
  ja     L215
  jmp    L203
L348:
  movslq %esi,%rax
  cmpb   $0x54,-0x1(%rbp,%rax,1)
  jne    L215
  cmpb   $0x4e,-0x2(%rbp,%rax,1)
  jne    L215
  cmpb   $0x49,-0x3(%rbp,%rax,1)
  jne    L215
  cmpb   $0x5f,-0x4(%rbp,%rax,1)
  jne    L215
  movzbl -0x5(%rbp,%rax,1),%eax
  lea    -0x41(%rax),%edx
  cmp    $0x19,%dl
  jbe    L203
  sub    $0x30,%eax
  cmp    $0x9,%al
  ja     L215
  jmp    L203
L246:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: retrieve_data
arguments: data_label: D4
data_type: string
name: retrieve_data
arguments: data_label: D8
data_type: string

tool: D4: _DSP48A1_SITE

tool: D8: _DSP48A1_B_SITE

assistant: ```c
void find_number(const char *s, int s_len, int *num_start, int *num_end) {
  int result, dig_start, dig_end, found_num, search_more;
  int next_dig_start, next_dig_end;
  *num_start = 0;
  *num_end = 0;
  if (s_len >= 13 && !strncmp("_DSP48A1_SITE", &s[s_len - 13], 13))
    s_len -= 13;
  else if (s_len >= 15 && !strncmp("_DSP48A1_B_SITE", &s[s_len - 15], 15))
    s_len -= 15;
  result = find_rightmost_num(s, s_len, &dig_start, &dig_end);
  if (!result)
    return;
  found_num = to_i(&s[dig_start], dig_end - dig_start);
  if (dig_end < s_len) {
    *num_start = dig_start;
    *num_end = dig_end;
    return;
  }
  search_more = 0;
  if (dig_start >= 2 && s[dig_start - 1] == '_' && ((s[dig_start - 2] >= 'A' && s[dig_start - 2] <= 'Z') || (s[dig_start - 2] >= '0' && s[dig_start - 2] <= '9')))
    search_more = 1;
  else if (found_num == 0 && dig_start >= 3 && s[dig_start - 1] == 'S' && s[dig_start - 2] == '_' && ((s[dig_start - 3] >= 'A' && s[dig_start - 3] <= 'Z') || (s[dig_start - 3] >= '0' && s[dig_start - 3] <= '9')))
    search_more = 1;
  else if (found_num == 3 && dig_start >= 3 && s[dig_start - 1] == 'N' && s[dig_start - 2] == '_' && ((s[dig_start - 3] >= 'A' && s[dig_start - 3] <= 'Z') || (s[dig_start - 3] >= '0' && s[dig_start - 3] <= '9')))
    search_more = 1;
  else if ((found_num >= 0 && found_num <= 3) && dig_start >= 5 && s[dig_start - 1] == 'T' && s[dig_start - 2] == 'N' && s[dig_start - 3] == 'I' && s[dig_start - 4] == '_' && ((s[dig_start - 5] >= 'A' && s[dig_start - 5] <= 'Z') || (s[dig_start - 5] >= '0' && s[dig_start - 5] <= '9')))
    search_more = 1;
  if (!search_more || !find_rightmost_num(s, dig_start, &next_dig_start, &next_dig_end)) {
    *num_start = dig_start;
    *num_end = dig_end;
  } else {
    *num_start = next_dig_start;
    *num_end = next_dig_end;
  }
}
```