user: Converte this assembly snippet into its equivalent C code:

```asm
<temp_parm>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0xa8,%rsp
  mov    %rcx,0x28(%rsp)
  mov    %r8,0x20(%rsp)
  mov    %r9,0x10(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x98(%rsp)
  xor    %eax,%eax
  movl   $0x0,(%r8)
  mov    (%rsi),%ecx
  lea    0x38(%rsp),%rax
  movl   $0x0,0xc(%rsp)
  mov    %rax,0x18(%rsp)
  test   %ecx,%ecx
  jle    L82
  mov    %rdi,%rbp
  mov    %rsi,%r12
  mov    %rdx,%r13
  xor    %r14d,%r14d
  jmp    L31
  nopl   0x0(%rax,%rax,1)
L40:
  mov    0x38(%rsp),%rax
  lea    D39(%rip),%rdi
  movsbl 0x1(%rax),%esi
  call   <strchr@plt>
  test   %rax,%rax
  je     L30
  mov    0x38(%rsp),%rax
  mov    0x28(%rsp),%rdx
  movzbl (%rax),%eax
  mov    %al,(%rdx)
L33:
  mov    (%rbx),%rax
  addl   $0x2,0xc(%rsp)
  movb   $0x0,(%rax)
  mov    0x20(%rsp),%rax
  movl   $0x1,(%rax)
L200:
  mov    (%r12),%eax
  add    $0x1,%r14d
  cmp    %r14d,%eax
  jle    L109
L31:
  movslq %r14d,%rcx
  lea    0x0(,%rcx,8),%r15
  lea    0x0(%rbp,%r15,1),%rbx
  mov    (%rbx),%rdi
  call   <strupper@plt>
  mov    (%rbx),%rdi
  mov    %r13,%rsi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L200
  mov    (%rbx),%rax
  add    $0x1,%r14d
  movb   $0x0,(%rax)
  cmp    %r14d,(%r12)
  jle    L98
  lea    0x8(%rbp,%r15,1),%rbx
  mov    (%rbx),%rdi
  call   <strupper@plt>
  mov    0x18(%rsp),%rsi
  mov    (%rbx),%rdi
  call   <strtod@plt>
  mov    0x10(%rsp),%rax
  lea    D47(%rip),%rdi
  movsd  %xmm0,(%rax)
  mov    0x38(%rsp),%rax
  movsbl (%rax),%esi
  call   <strchr@plt>
  test   %rax,%rax
  jne    L40
L30:
  mov    0x38(%rsp),%rax
  lea    D39(%rip),%rdi
  movsbl (%rax),%esi
  call   <strchr@plt>
  test   %rax,%rax
  jne    L33
  lea    0x40(%rsp),%rbp
  mov    %r13,%rdx
  lea    D1(%rip),%rsi
  jmp    L24
  nopl   0x0(%rax)
L159:
  sub    0xc(%rsp),%eax
  mov    %eax,(%r12)
L82:
  xor    %eax,%eax
L23:
  mov    0x98(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L35
  add    $0xa8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax,%rax,1)
L109:
  mov    0xc(%rsp),%edx
  test   %edx,%edx
  je     L82
  test   %eax,%eax
  jle    L159
  xor    %esi,%esi
  xor    %edi,%edi
  lea    0x10(%rbp),%r10
  jmp    L171
  cs nopw 0x0(%rax,%rax,1)
L196:
  add    $0x1,%rsi
  cmp    %edi,%eax
  jle    L159
L171:
  mov    0x0(%rbp,%rsi,8),%r9
  add    $0x1,%edi
  cmpb   $0x0,(%r9)
  jne    L196
  cmp    %edi,%eax
  jle    L196
  lea    -0x2(%rax),%ecx
  movslq %edi,%rdx
  sub    %esi,%ecx
  lea    0x0(%rbp,%rdx,8),%rdx
  add    %rsi,%rcx
  lea    (%r10,%rcx,8),%r8
  jmp    L158
L48:
  add    $0x8,%rdx
  cmp    %r8,%rdx
  je     L196
L158:
  mov    (%rdx),%rcx
  cmpb   $0x0,(%rcx)
  je     L48
  mov    %rcx,0x0(%rbp,%rsi,8)
  mov    %r9,(%rdx)
  movb   $0x0,(%r9)
  mov    (%r12),%eax
  jmp    L196
  nopl   0x0(%rax,%rax,1)
L98:
  lea    0x40(%rsp),%rbp
  mov    %r13,%rdx
  lea    D45(%rip),%rsi
L24:
  mov    %rbp,%rdi
  call   <sprintf@plt>
  mov    %rbp,%rdi
  call   <store_error_message@plt>
  mov    $0x1,%eax
  jmp    L23
L35:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: unpack_data
arguments: data_tag: D39
type_guessed: string
name: unpack_data
arguments: data_tag: D47
type_guessed: string
name: unpack_data
arguments: data_tag: D1
type_guessed: string
name: unpack_data
arguments: data_tag: D45
type_guessed: string

tool: D39:  	


tool: D47: CFKR

tool: D1: Invalid %s value or scale.

tool: D45: Missing %s value.

assistant: ```c
int temp_parm(char **tokens, int *ntokens, char *tparmname, char *tscale, int *tflag, double *tvalue) {
  char msg[80];
  int j, k, count = 0;
  char *sp, *tmptok;
  *tflag = 0;
  j = 0;
  while (j < *ntokens) {
    strupper(tokens[j]);
    if (strcmp(tokens[j], tparmname) == 0) {
      *tokens[j] = '\0';
      j++;
      if (j >= *ntokens) {
        sprintf(msg, "Missing %s value.", tparmname);
        store_error_message(msg);
        return 1;
      }
      strupper(tokens[j]);
      *tvalue = strtod(tokens[j], &sp);
      if (strchr("CFKR", *sp) && strchr(" \t\n\r", *(sp + 1))) {
        *tscale = *sp;
      } else if (!strchr(" \t\n\r", *sp)) {
        sprintf(msg, "Invalid %s value or scale.", tparmname);
        store_error_message(msg);
        return 1;
      }
      *tokens[j] = '\0';
      *tflag = 1;
      count += 2;
    }
    j++;
  }
  if (count == 0)
    return 0;
  for (j = 0; j < *ntokens; j++) {
    if (*tokens[j] == '\0') {
      for (k = j + 1; k < *ntokens; k++) {
        if (*tokens[k] != '\0') {
          tmptok = tokens[j];
          tokens[j] = tokens[k];
          tokens[k] = tmptok;
          *tmptok = '\0';
          break;
        }
      }
    }
  }
  *ntokens -= count;
  return 0;
}
```