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

```asm
<getvalue>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x48,%rsp
  mov    %rdi,%r12
  mov    %rsi,%r13
  mov    %rdx,%r14
  mov    %rcx,%r15
  mov    %fs:0x28,%rax
  mov    %rax,0x38(%rsp)
  xor    %eax,%eax
  lea    D42(%rip),%rax
  mov    %rax,(%rsp)
  lea    D55(%rip),%rax
  mov    %rax,0x8(%rsp)
  lea    D29(%rip),%rax
  mov    %rax,0x10(%rsp)
  lea    D14(%rip),%rax
  mov    %rax,0x18(%rsp)
  mov    $0x1,%ebx
  lea    0x2e(%rsp),%rbp
L66:
  mov    %r13,%rsi
  mov    %rbp,%rdi
  call   <strcpy@plt>
  mov    -0x8(%rsp,%rbx,8),%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
  mov    %rbp,%rsi
  mov    %r12,%rdi
  mov    $0x0,%eax
  call   <stringpos@plt>
  test   %eax,%eax
  sete   %cl
  cmp    $0x3,%ebx
  setle  %dl
  add    $0x1,%rbx
  test   %dl,%cl
  jne    L66
  test   %eax,%eax
  je     L71
  movzbl (%r14),%edx
  cmp    $0x66,%dl
  je     L7
  jg     L95
  cmp    $0x46,%dl
  je     L83
  cmp    $0x64,%dl
  jne    L29
  cltq
  lea    (%r12,%rax,1),%rdi
  mov    $0x0,%eax
  call   <atoi@plt>
  mov    %eax,(%r15)
L74:
  mov    0x38(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L30
  mov    $0x0,%eax
  add    $0x48,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L71:
  mov    %r13,%rsi
  lea    D8(%rip),%rdi
  call   <printf@plt>
  mov    $0xffffffff,%edi
  call   <exit@plt>
L95:
  cmp    $0x73,%dl
  jne    L29
  cltq
  lea    (%r12,%rax,1),%rsi
  mov    %r15,%rdi
  call   <strcpy@plt>
  jmp    L74
L7:
  cltq
  lea    (%r12,%rax,1),%rdi
  mov    $0x0,%eax
  call   <atof@plt>
  pxor   %xmm0,%xmm0
  cvtsi2ss %eax,%xmm0
  movss  %xmm0,(%r15)
  jmp    L74
L83:
  cltq
  lea    (%r12,%rax,1),%rdi
  mov    $0x0,%eax
  call   <atof@plt>
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  movsd  %xmm0,(%r15)
  jmp    L74
L29:
  mov    %r14,%rsi
  lea    D49(%rip),%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0xffffffff,%edi
  call   <exit@plt>
L30:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: tag: D42
type_guessed: string
name: read_data
arguments: tag: D55
type_guessed: string
name: read_data
arguments: tag: D29
type_guessed: string
name: read_data
arguments: tag: D14
type_guessed: string
name: read_data
arguments: tag: D8
type_guessed: string
name: read_data
arguments: tag: D49
type_guessed: string

tool: D42: =

tool: D55: :

tool: D29:  =

tool: D14:  :

tool: D8: Variable "%s" not found!


tool: D49: WARNING: bad argument type "%s" found!


assistant: ```c
int getvalue(char *s, char *arg, char *type, int *var) {
  int pos, inum;
  double *dbl;
  float *flt;
  char argt[10], *str, *symb[4];
  symb[0] = "=";
  symb[1] = ":";
  symb[2] = " =";
  symb[3] = " :";
  pos = 0;
  inum = 0;
  while (pos == 0 && inum < 4) {
    strcpy(argt, arg);
    strcat(argt, symb[inum]);
    pos = stringpos(s, argt);
    inum++;
  }
  if (pos == 0) {
    printf("Variable \"%s\" not found!\n", arg);
    exit(-1);
  }
  switch (type[0]) {
  case 'd':
    *var = atoi(&s[pos]);
    return (0);
  case 'f':
    flt = (float *)var;
    *flt = atof(&s[pos]);
    return (0);
  case 'F':
    dbl = (double *)var;
    *dbl = atof(&s[pos]);
    return (0);
  case 's':
    str = (char *)var;
    strcpy(str, &s[pos]);
    return (0);
  default:
    printf("WARNING: bad argument type \"%s\" found!\n", type);
    exit(-1);
  }
}
```