user: What would the C source look like for the assembly code provided here?

```asm
<puthd>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x60,%rsp
  mov    %rdi,-0x48(%rbp)
  mov    %rsi,-0x50(%rbp)
  mov    %rdx,-0x58(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  mov    -0x58(%rbp),%rax
  mov    %rax,-0x30(%rbp)
  jmp    L46
L117:
  addq   $0x1,-0x30(%rbp)
L46:
  mov    -0x30(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x7d,%al
  jne    L117
  mov    -0x48(%rbp),%rax
  mov    %rax,-0x18(%rbp)
  jmp    L5
L61:
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%edx
  mov    -0x30(%rbp),%rax
  mov    %dl,(%rax)
  addq   $0x1,-0x30(%rbp)
  addq   $0x1,-0x18(%rbp)
L5:
  mov    -0x18(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L61
  mov    -0x30(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x30(%rbp)
  movb   $0x3d,(%rax)
  mov    -0x50(%rbp),%rax
  mov    %rax,-0x28(%rbp)
  jmp    L63
L15:
  mov    -0x28(%rbp),%rax
  movzbl (%rax),%edx
  mov    -0x30(%rbp),%rax
  mov    %dl,(%rax)
  addq   $0x1,-0x30(%rbp)
  addq   $0x1,-0x28(%rbp)
L63:
  mov    -0x28(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L15
  mov    -0x30(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x30(%rbp)
  movb   $0x3b,(%rax)
  mov    -0x30(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x30(%rbp)
  movb   $0xa,(%rax)
  mov    -0x30(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x30(%rbp)
  movb   $0x7d,(%rax)
  mov    -0x30(%rbp),%rax
  sub    -0x58(%rbp),%rax
  mov    %eax,-0x38(%rbp)
  mov    -0x38(%rbp),%eax
  cltd
  shr    $0x1e,%edx
  add    %edx,%eax
  and    $0x3,%eax
  sub    %edx,%eax
  mov    %eax,%edx
  mov    $0x4,%eax
  sub    %edx,%eax
  mov    %eax,-0x34(%rbp)
  cmpl   $0x3,-0x34(%rbp)
  jg     L1
  movl   $0x0,-0x38(%rbp)
  jmp    L58
L4:
  mov    -0x30(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,-0x30(%rbp)
  movb   $0x20,(%rax)
  addl   $0x1,-0x38(%rbp)
L58:
  mov    -0x38(%rbp),%eax
  cmp    -0x34(%rbp),%eax
  jl     L4
L1:
  mov    -0x30(%rbp),%rax
  sub    -0x58(%rbp),%rax
  mov    %eax,%edx
  lea    -0xd(%rbp),%rax
  lea    D6(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <sprintf@plt>
  movl   $0x0,-0x38(%rbp)
  mov    -0x58(%rbp),%rax
  add    $0xf,%rax
  mov    %rax,-0x30(%rbp)
  lea    -0xd(%rbp),%rax
  mov    %rax,-0x20(%rbp)
  jmp    L107
L39:
  mov    -0x20(%rbp),%rdx
  lea    0x1(%rdx),%rax
  mov    %rax,-0x20(%rbp)
  mov    -0x30(%rbp),%rax
  lea    0x1(%rax),%rcx
  mov    %rcx,-0x30(%rbp)
  movzbl (%rdx),%edx
  mov    %dl,(%rax)
  addl   $0x1,-0x38(%rbp)
L107:
  cmpl   $0x4,-0x38(%rbp)
  jle    L39
  nop
  mov    -0x8(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L88
  call   <__stack_chk_fail@plt>
L88:
  leave
  ret
```

tool_calls: name: retrieve_data
arguments: data_tag: D6
datatype: string

tool: D6: %5d

assistant: ```c
void puthd(char *field, char *value, char *header) {
  char temp[5];
  int i, diff;
  char *hp, *vp, *tp, *fp;
  for (hp = header; *hp != '}'; hp++)
    ;
  for (fp = field; *fp != 0; hp++, fp++)
    *hp = *fp;
  *hp++ = '=';
  for (vp = value; *vp != 0; hp++, vp++)
    *hp = *vp;
  *hp++ = ';';
  *hp++ = 10;
  *hp++ = '}';
  i = (int)(hp - header);
  diff = 4 - i % 4;
  if (diff < 4)
    for (i = 0; i < diff; i++)
      *hp++ = ' ';
  sprintf(temp, "%5d", (int)(hp - header));
  for (i = 0, hp = header + 15, tp = temp; i < 5; i++)
    *hp++ = *tp++;
}
```