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

```asm
<get_value>:
  endbr64
  push   %r15
  pxor   %xmm0,%xmm0
  push   %r14
  push   %r13
  mov    %rdx,%r13
  push   %r12
  xor    %r12d,%r12d
  push   %rbp
  push   %rbx
  lea    D33(%rip),%rbx
  sub    $0x48,%rsp
  mov    %rdi,0x18(%rsp)
  mov    %rbx,%rdi
  mov    %rsi,0x10(%rsp)
  movsbl (%rdx),%esi
  mov    %fs:0x28,%rax
  mov    %rax,0x38(%rsp)
  xor    %eax,%eax
  movl   $0x0,0x30(%rsp)
  movaps %xmm0,0x20(%rsp)
  call   <printf@plt>
  movsbl 0x0(%r13),%esi
  test   %sil,%sil
  je     L3
  xor    %r15d,%r15d
  lea    D7(%rip),%r14
  lea    0x20(%rsp),%rbp
  jmp    L113
  nopl   0x0(%rax)
L22:
  mov    %rbx,%rdi
  xor    %eax,%eax
  add    $0x1,%r15d
  call   <printf@plt>
  movslq %r15d,%r8
  add    %r13,%r8
  movsbl (%r8),%esi
  test   %sil,%sil
  je     L3
L113:
  cmp    $0x52,%sil
  je     L59
  cmp    $0x54,%sil
  jne    L22
  lea    0x8(%r15),%r9d
  movslq %r9d,%r8
  add    %r13,%r8
  movzbl (%r8),%esi
  lea    -0x30(%rsi),%eax
  cmp    $0x9,%al
  ja     L38
  lea    0x9(%r15),%eax
  movslq %r15d,%r8
  mov    %rbp,%rdi
  cltq
  sub    %r8,%rdi
  nopl   (%rax)
L75:
  mov    %sil,-0x9(%rdi,%rax,1)
  movzbl 0x0(%r13,%rax,1),%esi
  mov    %eax,%r9d
  lea    0x0(%r13,%rax,1),%r8
  add    $0x1,%rax
  lea    -0x30(%rsi),%edx
  cmp    $0x9,%dl
  jbe    L75
L38:
  mov    %rbp,%rdi
  mov    %r8,0x8(%rsp)
  mov    %r9d,0x4(%rsp)
  call   <atol@plt>
  mov    %r14,%rdi
  mov    %rax,%rsi
  mov    0x10(%rsp),%rax
  mov    %rsi,(%rax)
L76:
  xor    %eax,%eax
  add    $0x1,%r12d
  call   <printf@plt>
  xor    %esi,%esi
  mov    $0x14,%edx
  mov    %rbp,%rdi
  call   <memset@plt>
  mov    0x8(%rsp),%r8
  mov    0x4(%rsp),%r15d
  movsbl (%r8),%esi
  test   %sil,%sil
  jne    L113
L3:
  mov    0x38(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L28
  add    $0x48,%rsp
  mov    %r12d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  cs nopw 0x0(%rax,%rax,1)
L59:
  lea    D24(%rip),%rdi
  call   <puts@plt>
  lea    0x8(%r15),%r9d
  movslq %r9d,%r8
  add    %r13,%r8
  movzbl (%r8),%esi
  lea    -0x30(%rsi),%eax
  cmp    $0x9,%al
  ja     L4
  lea    0x9(%r15),%eax
  movslq %r15d,%r8
  mov    %rbp,%rdi
  cltq
  sub    %r8,%rdi
L43:
  mov    %sil,-0x9(%rdi,%rax,1)
  movzbl 0x0(%r13,%rax,1),%esi
  mov    %eax,%r9d
  lea    0x0(%r13,%rax,1),%r8
  add    $0x1,%rax
  lea    -0x30(%rsi),%edx
  cmp    $0x9,%dl
  jbe    L43
L4:
  mov    %rbp,%rdi
  mov    %r8,0x8(%rsp)
  mov    %r9d,0x4(%rsp)
  call   <atol@plt>
  lea    D39(%rip),%rdi
  mov    %rax,%rsi
  mov    0x18(%rsp),%rax
  mov    %rsi,(%rax)
  jmp    L76
L28:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: data_tag: D33
type: string
name: read_data
arguments: data_tag: D7
type: string
name: read_data
arguments: data_tag: D24
type: string
name: read_data
arguments: data_tag: D39
type: string

tool: D33: buf is %c


tool: D7: Tx is %ld


tool: D24: find R

tool: D39: Rx is %ld


assistant: ```c
int get_value(long int *Rx, long int *Tx, char *buf) {
  int index = 0;
  char temp[20] = {'\0'};
  int num_len = 0;
  int return_value = 0;
  printf("buf is %c\r\n", *buf);
  while (*(buf + index) != '\0') {
    if (*(buf + index) == 'R') {
      printf("find R\r\n");
      index += 8;
      while (('0' - 1) < *(buf + index) && *(buf + index) < ('9' + 1)) {
        temp[num_len] = buf[index];
        num_len++;
        index++;
      }
      *Rx = atol(temp);
      printf("Rx is %ld\r\n", *Rx);
      memset(temp, '\0', 20);
      num_len = 0;
      return_value++;
      continue;
    } else if (*(buf + index) == 'T') {
      index += 8;
      while (('0' - 1) < *(buf + index) && *(buf + index) < ('9' + 1)) {
        temp[num_len] = *(buf + index);
        num_len++;
        index++;
      }
      *Tx = atol(temp);
      printf("Tx is %ld\r\n", *Tx);
      memset(temp, '\0', 20);
      num_len = 0;
      return_value++;
      continue;
    }
    printf("buf is %c\r\n", *(buf + index));
    index++;
  }
  return return_value;
}
```