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

```asm
<getvaluestat>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  add    $0xffffffffffffff80,%rsp
  mov    %rdi,-0x68(%rbp)
  mov    %rsi,-0x70(%rbp)
  mov    %rdx,-0x78(%rbp)
  mov    %rcx,-0x80(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  lea    D38(%rip),%rax
  mov    %rax,-0x40(%rbp)
  lea    D1(%rip),%rax
  mov    %rax,-0x38(%rbp)
  lea    D16(%rip),%rax
  mov    %rax,-0x30(%rbp)
  lea    D44(%rip),%rax
  mov    %rax,-0x28(%rbp)
  movl   $0x0,-0x60(%rbp)
  movl   $0x0,-0x5c(%rbp)
  jmp    L34
L132:
  mov    -0x70(%rbp),%rdx
  lea    -0x12(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcpy@plt>
  mov    -0x5c(%rbp),%eax
  cltq
  mov    -0x40(%rbp,%rax,8),%rdx
  lea    -0x12(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcat@plt>
  lea    -0x12(%rbp),%rdx
  mov    -0x68(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <stringpos@plt>
  mov    %eax,-0x60(%rbp)
  addl   $0x1,-0x5c(%rbp)
L34:
  cmpl   $0x0,-0x60(%rbp)
  jne    L141
  cmpl   $0x3,-0x5c(%rbp)
  jle    L132
L141:
  cmpl   $0x0,-0x60(%rbp)
  jne    L105
  mov    $0xffffffff,%eax
  jmp    L111
L105:
  mov    -0x78(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  cmp    $0x73,%eax
  je     L18
  cmp    $0x73,%eax
  jg     L52
  cmp    $0x66,%eax
  je     L53
  cmp    $0x66,%eax
  jg     L52
  cmp    $0x46,%eax
  je     L37
  cmp    $0x64,%eax
  jne    L52
  mov    -0x60(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x68(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <atoi@plt>
  mov    -0x80(%rbp),%rdx
  mov    %eax,(%rdx)
  mov    $0x0,%eax
  jmp    L111
L53:
  mov    -0x80(%rbp),%rax
  mov    %rax,-0x50(%rbp)
  mov    -0x60(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x68(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <atof@plt>
  pxor   %xmm0,%xmm0
  cvtsi2ss %eax,%xmm0
  mov    -0x50(%rbp),%rax
  movss  %xmm0,(%rax)
  mov    $0x0,%eax
  jmp    L111
L37:
  mov    -0x80(%rbp),%rax
  mov    %rax,-0x48(%rbp)
  mov    -0x60(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x68(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <atof@plt>
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  mov    -0x48(%rbp),%rax
  movsd  %xmm0,(%rax)
  mov    $0x0,%eax
  jmp    L111
L18:
  mov    -0x80(%rbp),%rax
  mov    %rax,-0x58(%rbp)
  mov    -0x60(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x68(%rbp),%rax
  add    %rax,%rdx
  mov    -0x58(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcpy@plt>
  mov    $0x0,%eax
  jmp    L111
L52:
  mov    -0x78(%rbp),%rax
  mov    %rax,%rsi
  lea    D23(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  mov    $0xffffffff,%edi
  call   <exit@plt>
L111:
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L13
  call   <__stack_chk_fail@plt>
L13:
  leave
  ret
```

tool_calls: name: unpack_data
arguments: label: D38
type_guessed: string
name: unpack_data
arguments: label: D1
type_guessed: string
name: unpack_data
arguments: label: D16
type_guessed: string
name: unpack_data
arguments: label: D44
type_guessed: string
name: unpack_data
arguments: label: D23
type_guessed: string

tool: D38: =

tool: D1: :

tool: D16:  =

tool: D44:  :

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


assistant: ```c
int getvaluestat(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) {
    return (-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);
  }
}
```