user: 请将以下的汇编代码转换成C语言代码：

```asm
<hputm>:
  endbr64
  push   %r15
  push   %r14
  mov    %rdi,%r14
  mov    %rsi,%rdi
  push   %r13
  push   %r12
  mov    %rdx,%r12
  push   %rbp
  mov    %rsi,%rbp
  push   %rbx
  sub    $0xa8,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x98(%rsp)
  xor    %eax,%eax
  call   <strlen@plt>
  mov    %rax,%rbx
  cmp    $0x7,%eax
  jne    L6
  mov    $0x7,%edx
  lea    D4(%rip),%rsi
  mov    %rbp,%rdi
  call   <strncmp@plt>
  mov    %eax,%edx
  test   %eax,%eax
  jne    L144
L139:
  lea    0x2c(%rsp),%rax
  movl   $0x1,0x4(%rsp)
  mov    $0x2,%ebx
  mov    %rax,0x8(%rsp)
  jmp    L199
L144:
  mov    $0x7,%edx
  lea    D16(%rip),%rsi
  mov    %rbp,%rdi
  call   <strncmp@plt>
  mov    %eax,%edx
  test   %eax,%eax
  je     L139
L6:
  lea    0x2c(%rsp),%rax
  lea    0x1(%rbx),%rdx
  mov    %rbp,%rsi
  mov    %rax,%rdi
  mov    %rax,0x8(%rsp)
  call   <memcpy@plt>
  cmp    $0x7,%rbx
  je     L42
  movl   $0x0,0x4(%rsp)
  mov    %ebx,%edx
  add    $0x2,%ebx
L199:
  mov    %r12,%rdi
  mov    %edx,0x18(%rsp)
  movslq %ebx,%rbx
  call   <strlen@plt>
  mov    0x8(%rsp),%rsi
  mov    %rax,%rbp
  mov    %eax,%r15d
  lea    0x34(%rsp),%rax
  mov    %rax,%r13
  mov    %rax,%rdi
  mov    %rax,0x10(%rsp)
  call   <strcpy@plt>
  mov    %r13,%rdi
  call   <strlen@plt>
  mov    $0x5f,%edx
  mov    %dx,0x0(%r13,%rax,1)
  movb   $0x0,0x34(%rsp,%rbx,1)
  test   %ebp,%ebp
  jle    L69
  mov    0x18(%rsp),%edx
  xor    %ebx,%ebx
  lea    0x41(%rsp),%rbp
  lea    0x40(%rsp),%r13
  movl   $0x31,(%rsp)
  add    $0x1,%edx
  movslq %edx,%rax
  mov    %rax,0x18(%rsp)
  mov    %r14,%rax
  mov    %r15d,%r14d
  mov    %rax,%r15
  jmp    L32
  nopw   0x0(%rax,%rax,1)
L135:
  test   $0x4,%al
  jne    L78
  test   %eax,%eax
  je     L221
  movzbl (%r12),%ecx
  mov    %cl,0x0(%rbp)
  test   $0x2,%al
  jne    L3
L221:
  add    %rdx,%r12
  lea    0x1(%rax),%ecx
  lea    0x2(%rax),%edx
  cmp    $0x7,%r14d
  jle    L142
L180:
  mov    0x4(%rsp),%eax
  movslq %ecx,%rcx
  movslq %edx,%rdx
  movb   $0x27,0x40(%rsp,%rcx,1)
  movb   $0x0,0x40(%rsp,%rdx,1)
  test   %eax,%eax
  je     L72
  mov    0x8(%rsp),%rsi
  xor    %eax,%eax
  mov    %r13,%rdx
  mov    %r15,%rdi
  call   <hputc@plt>
  test   %eax,%eax
  jne    L57
L231:
  add    $0x1,%ebx
  cmp    $0x43,%r14d
  jle    L218
  sub    $0x43,%r14d
L32:
  mov    $0x43,%eax
  movb   $0x27,0x40(%rsp)
  cmp    %eax,%r14d
  cmovle %r14d,%eax
  movslq %eax,%rdx
  cmp    $0x8,%eax
  jb     L135
  mov    (%r12),%rcx
  lea    0x48(%rsp),%rdi
  mov    %rcx,0x0(%rbp)
  mov    %eax,%ecx
  mov    -0x8(%r12,%rcx,1),%rsi
  mov    %rsi,-0x8(%rbp,%rcx,1)
  mov    %rbp,%rcx
  mov    %r12,%rsi
  add    %rdx,%r12
  sub    %rdi,%rcx
  lea    0x2(%rax),%edx
  sub    %rcx,%rsi
  add    %eax,%ecx
  shr    $0x3,%ecx
  rep movsq %ds:(%rsi),%es:(%rdi)
  lea    0x1(%rax),%ecx
  cmp    $0x7,%r14d
  jg     L180
L142:
  mov    $0x7,%edx
  movslq %ecx,%rcx
  mov    $0x20,%esi
  sub    %eax,%edx
  lea    0x0(%r13,%rcx,1),%rdi
  add    $0x1,%rdx
  call   <memset@plt>
  mov    $0xa,%edx
  mov    $0x9,%ecx
  jmp    L180
L42:
  movb   $0x0,0x32(%rsp)
  mov    $0x8,%ebx
  mov    $0x6,%edx
  movl   $0x0,0x4(%rsp)
  jmp    L199
  nopl   0x0(%rax,%rax,1)
L72:
  mov    (%rsp),%eax
  mov    0x18(%rsp),%rdi
  mov    %r13,%rdx
  mov    0x10(%rsp),%rsi
  mov    %al,0x34(%rsp,%rdi,1)
  add    $0x1,%eax
  mov    %r15,%rdi
  mov    %eax,(%rsp)
  xor    %eax,%eax
  call   <hputc@plt>
  test   %eax,%eax
  je     L231
L57:
  mov    0x98(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L77
  add    $0xa8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L78:
  mov    (%r12),%ecx
  mov    %ecx,0x0(%rbp)
  mov    %eax,%ecx
  mov    -0x4(%r12,%rcx,1),%esi
  mov    %esi,-0x4(%rbp,%rcx,1)
  jmp    L221
L218:
  mov    %ebx,%eax
  jmp    L57
L3:
  mov    %eax,%ecx
  movzwl -0x2(%r12,%rcx,1),%esi
  mov    %si,-0x2(%rbp,%rcx,1)
  jmp    L221
L69:
  xor    %eax,%eax
  jmp    L57
L77:
  call   <__stack_chk_fail@plt>
```

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

tool: D4: COMMENT

tool: D16: HISTORY

assistant: ```c
int hputm(hstring, keyword, cval)
char *hstring;
char *keyword;
char *cval;
{
  int lroot = 0, lcv, i, ii, nkw, lkw, lval;
  int comment = 0;
  char keyroot[8], newkey[12], *v, value[80];
  char squot = 39;
  lkw = strlen(keyword);
  if (lkw == 7 && (strncmp(keyword, "COMMENT", 7) == 0 || strncmp(keyword, "HISTORY", 7) == 0))
    comment = 1;
  else {
    comment = 0;
    strcpy(keyroot, keyword);
    lroot = strlen(keyroot);
    if (lroot > 6) {
      keyroot[6] = (char)0;
      lroot = 6;
    }
  }
  ii = '1';
  nkw = 0;
  lcv = strlen(cval);
  strcpy(newkey, keyroot);
  strcat(newkey, "_");
  newkey[lroot + 2] = (char)0;
  v = cval;
  while (lcv > 0) {
    if (lcv > 67)
      lval = 67;
    else
      lval = lcv;
    value[0] = squot;
    for (i = 1; i <= lval; i++)
      value[i] = *v++;
    if (lval < 8) {
      for (i = lval + 1; i < 9; i++)
        value[i] = ' ';
      lval = 8;
    }
    value[lval + 1] = squot;
    value[lval + 2] = (char)0;
    if (comment)
      i = hputc(hstring, keyroot, value);
    else {
      newkey[lroot + 1] = ii;
      ii++;
      i = hputc(hstring, newkey, value);
    }
    if (i != 0)
      return (i);
    nkw++;
    if (lcv > 67)
      lcv = lcv - 67;
    else
      break;
  }
  return (nkw);
}
```