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

```asm
<hputm>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x98,%rsp
  mov    %rdi,(%rsp)
  mov    %rsi,%rbp
  mov    %rdx,%rbx
  mov    %fs:0x28,%rax
  mov    %rax,0x88(%rsp)
  xor    %eax,%eax
  mov    %rsi,%rdi
  call   <strlen@plt>
  cmp    $0x7,%eax
  jne    L123
  mov    $0x7,%edx
  lea    D6(%rip),%rsi
  mov    %rbp,%rdi
  call   <strncmp@plt>
  mov    %eax,%r15d
  mov    $0x1,%r14d
  test   %eax,%eax
  je     L158
  mov    $0x7,%edx
  lea    D7(%rip),%rsi
  mov    %rbp,%rdi
  call   <strncmp@plt>
  mov    %eax,%r15d
  test   %eax,%eax
  je     L158
L123:
  lea    0x1c(%rsp),%r12
  mov    %rbp,%rsi
  mov    %r12,%rdi
  call   <strcpy@plt>
  mov    %r12,%rdi
  call   <strlen@plt>
  mov    %eax,%r15d
  mov    $0x0,%r14d
  cmp    $0x6,%eax
  jle    L158
  movb   $0x0,0x22(%rsp)
  mov    $0x6,%r15d
L158:
  mov    %rbx,%rdi
  call   <strlen@plt>
  mov    %rax,%r13
  mov    %eax,%ebp
  lea    0x1c(%rsp),%rsi
  lea    0x24(%rsp),%r12
  mov    %r12,%rdi
  call   <strcpy@plt>
  mov    %r12,%rdi
  call   <strlen@plt>
  movw   $0x5f,0x24(%rsp,%rax,1)
  mov    %r15d,%edi
  lea    0x2(%r15),%eax
  cltq
  movb   $0x0,0x24(%rsp,%rax,1)
  test   %r13d,%r13d
  jle    L12
  mov    $0x0,%r12d
  mov    $0x31,%r13d
  mov    $0x1,%r15d
  mov    %edi,%eax
  add    $0x1,%eax
  cltq
  mov    %rax,0x8(%rsp)
  jmp    L44
L45:
  add    $0x1,%edx
  cmp    $0x8,%edx
  jg     L8
  movslq %edx,%rdx
L97:
  movb   $0x20,0x30(%rsp,%rdx,1)
  add    $0x1,%rdx
  cmp    $0x8,%edx
  jle    L97
  mov    $0x8,%edx
  jmp    L147
L8:
  mov    $0x8,%edx
  jmp    L147
L136:
  mov    0x8(%rsp),%rax
  mov    %r13b,0x24(%rsp,%rax,1)
  add    $0x1,%r13d
  lea    0x30(%rsp),%rdx
  lea    0x24(%rsp),%rsi
  mov    (%rsp),%rdi
  mov    $0x0,%eax
  call   <hputc@plt>
L104:
  test   %eax,%eax
  jne    L89
  add    $0x1,%r12d
  cmp    $0x43,%ebp
  jle    L176
  sub    $0x43,%ebp
L44:
  mov    $0x43,%edx
  cmp    %edx,%ebp
  cmovle %ebp,%edx
  movb   $0x27,0x30(%rsp)
  test   %ebp,%ebp
  jle    L0
  mov    $0x1,%eax
L92:
  movzbl -0x1(%rbx,%rax,1),%ecx
  mov    %cl,0x30(%rsp,%rax,1)
  add    $0x1,%rax
  cmp    %eax,%edx
  jge    L92
  lea    -0x1(%rdx),%eax
  add    $0x1,%rax
  test   %ebp,%ebp
  cmovle %r15,%rax
  add    %rax,%rbx
L0:
  cmp    $0x7,%ebp
  jle    L45
L147:
  lea    0x1(%rdx),%eax
  cltq
  movb   $0x27,0x30(%rsp,%rax,1)
  add    $0x2,%edx
  movslq %edx,%rdx
  movb   $0x0,0x30(%rsp,%rdx,1)
  test   %r14d,%r14d
  je     L136
  lea    0x30(%rsp),%rdx
  lea    0x1c(%rsp),%rsi
  mov    (%rsp),%rdi
  mov    $0x0,%eax
  call   <hputc@plt>
  jmp    L104
L12:
  mov    $0x0,%eax
  jmp    L89
L176:
  mov    %r12d,%eax
L89:
  mov    0x88(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L106
  add    $0x98,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L106:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: disassemble_data
arguments: label: D6
type: string
name: disassemble_data
arguments: label: D7
type: string

tool: D6: COMMENT

tool: D7: 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);
}
```