user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<mg_http_create_digest_auth_header>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0xc8,%rsp
  mov    %rdi,0x10(%rsp)
  mov    %rsi,0x18(%rsp)
  mov    %rdx,(%rsp)
  mov    %rcx,%r12
  mov    %r8,%rbp
  mov    %r9,%r15
  mov    0x100(%rsp),%r13
  mov    %fs:0x28,%rax
  mov    %rax,0xb8(%rsp)
  xor    %eax,%eax
  mov    $0x0,%edi
  call   <time@plt>
  lea    0x90(%rsp),%rbx
  mov    %eax,%ecx
  lea    D18(%rip),%rdx
  mov    $0x28,%esi
  mov    %rbx,%rdi
  mov    $0x0,%eax
  call   <snprintf@plt>
  mov    %r13,%rdi
  call   <strlen@plt>
  mov    %rax,%r14
  mov    %rbp,%rdi
  call   <strlen@plt>
  mov    %rax,0x20(%rsp)
  mov    %r15,0x8(%rsp)
  mov    %r15,%rdi
  call   <strlen@plt>
  mov    %rax,%rdx
  lea    0x30(%rsp),%r15
  push   $0x0
  push   %r14
  push   %r13
  push   $0x1
  lea    D9(%rip),%rcx
  push   %rcx
  push   0x48(%rsp)
  mov    %rbp,%r9
  mov    $0x1,%r8d
  mov    0x38(%rsp),%rsi
  mov    %r15,%rdi
  call   <mg_md5@plt>
  add    $0x30,%rsp
  mov    %rbx,%rdi
  call   <strlen@plt>
  mov    %rax,0x20(%rsp)
  mov    %r12,%rdi
  call   <strlen@plt>
  mov    %rax,0x28(%rsp)
  mov    (%rsp),%rdi
  call   <strlen@plt>
  mov    %rax,%rsi
  sub    $0x8,%rsp
  lea    0x68(%rsp),%r14
  push   %r14
  push   $0x4
  lea    D17(%rip),%r13
  push   %r13
  mov    0x40(%rsp),%rdx
  push   %rdx
  push   %rbx
  push   $0x1
  lea    D42(%rip),%r10
  push   %r10
  push   %rdx
  push   %rbx
  mov    $0x20,%r9d
  mov    %r15,%r8
  mov    0x78(%rsp),%rcx
  mov    %r12,%rdx
  mov    0x50(%rsp),%rdi
  call   <mkmd5resp@plt>
  add    $0x50,%rsp
  push   %r14
  push   %rbx
  push   %rbx
  push   %r13
  mov    %r12,%r9
  mov    %rbp,%r8
  mov    0x28(%rsp),%rcx
  lea    D44(%rip),%rdx
  mov    0x38(%rsp),%rsi
  mov    0x30(%rsp),%rdi
  mov    $0x0,%eax
  call   <snprintf@plt>
  add    $0x20,%rsp
  mov    0xb8(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L5
  add    $0xc8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L5:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: disassemble_data
arguments: data_label: D18
type: string
name: disassemble_data
arguments: data_label: D9
type: string
name: disassemble_data
arguments: data_label: D17
type: string
name: disassemble_data
arguments: data_label: D42
type: string
name: disassemble_data
arguments: data_label: D44
type: string

tool: D18: %x

tool: D9: :

tool: D17: auth

tool: D42: 1

tool: D44: Authorization: Digest username="%s",realm="%s",uri="%s",qop=%s,nc=1,cnonce=%s,nonce=%s,response=%s


assistant: ```c
int mg_http_create_digest_auth_header(char *buf, size_t buf_len, const char *method, const char *uri, const char *auth_domain, const char *user, const char *passwd) {
  static const char colon[] = ":", qop[] = "auth";
  static const size_t one = 1;
  char ha1[33], resp[33], cnonce[40];
  snprintf(cnonce, sizeof(cnonce), "%x", (unsigned int)time(NULL));
  mg_md5(ha1, user, (size_t)strlen(user), colon, one, auth_domain, (size_t)strlen(auth_domain), colon, one, passwd, (size_t)strlen(passwd), NULL);
  mkmd5resp(method, strlen(method), uri, strlen(uri), ha1, sizeof(ha1) - 1, cnonce, strlen(cnonce), "1", one, cnonce, strlen(cnonce), qop, sizeof(qop) - 1, resp);
  return snprintf(buf, buf_len,
                  "Authorization: Digest username=\"%s\","
                  "realm=\"%s\",uri=\"%s\",qop=%s,nc=1,cnonce=%s,"
                  "nonce=%s,response=%s\r\n",
                  user, auth_domain, uri, qop, cnonce, cnonce, resp);
}
```