user: 请从给定的汇编指令推导出C源代码：

```asm
<mg_http_create_digest_auth_header>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r14
  push   %r13
  push   %r12
  push   %rbx
  sub    $0xd0,%rsp
  mov    %rdi,-0xb8(%rbp)
  mov    %rsi,-0xc0(%rbp)
  mov    %rdx,-0xc8(%rbp)
  mov    %rcx,-0xd0(%rbp)
  mov    %r8,-0xd8(%rbp)
  mov    %r9,-0xe0(%rbp)
  mov    0x10(%rbp),%rax
  mov    %rax,-0xe8(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x28(%rbp)
  xor    %eax,%eax
  mov    $0x0,%edi
  call   <time@plt>
  mov    %eax,%edx
  lea    -0x50(%rbp),%rax
  mov    %edx,%ecx
  lea    D35(%rip),%rdx
  mov    $0x28,%esi
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <snprintf@plt>
  mov    -0xe8(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %rax,%r14
  mov    D40(%rip),%rbx
  mov    -0xd8(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %rax,%r13
  mov    D40(%rip),%r12
  mov    -0xe0(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %rax,%rdi
  mov    -0xd8(%rbp),%rcx
  mov    -0xe0(%rbp),%rsi
  lea    -0xb0(%rbp),%rax
  push   $0x0
  push   %r14
  push   -0xe8(%rbp)
  push   %rbx
  lea    D73(%rip),%rdx
  push   %rdx
  push   %r13
  mov    %rcx,%r9
  mov    %r12,%r8
  lea    D73(%rip),%rdx
  mov    %rdx,%rcx
  mov    %rdi,%rdx
  mov    %rax,%rdi
  call   <cs_md5@plt>
  add    $0x30,%rsp
  lea    -0x50(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %rax,%r12
  mov    D40(%rip),%r13
  lea    -0x50(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %rax,%rbx
  mov    -0xd0(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %rax,%r14
  mov    -0xc8(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %rax,%rsi
  lea    -0xb0(%rbp),%rdi
  mov    -0xd0(%rbp),%rdx
  mov    -0xc8(%rbp),%rax
  sub    $0x8,%rsp
  lea    -0x80(%rbp),%rcx
  push   %rcx
  push   $0x4
  lea    D89(%rip),%rcx
  push   %rcx
  push   %r12
  lea    -0x50(%rbp),%rcx
  push   %rcx
  push   %r13
  lea    D21(%rip),%rcx
  push   %rcx
  push   %rbx
  lea    -0x50(%rbp),%rcx
  push   %rcx
  mov    $0x20,%r9d
  mov    %rdi,%r8
  mov    %r14,%rcx
  mov    %rax,%rdi
  call   <mkmd5resp@plt>
  add    $0x50,%rsp
  mov    -0xd0(%rbp),%r8
  mov    -0xd8(%rbp),%rdi
  mov    -0xe0(%rbp),%rdx
  mov    -0xc0(%rbp),%rsi
  mov    -0xb8(%rbp),%rax
  lea    -0x80(%rbp),%rcx
  push   %rcx
  lea    -0x50(%rbp),%rcx
  push   %rcx
  lea    -0x50(%rbp),%rcx
  push   %rcx
  lea    D89(%rip),%rcx
  push   %rcx
  mov    %r8,%r9
  mov    %rdi,%r8
  mov    %rdx,%rcx
  lea    D72(%rip),%rdx
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <snprintf@plt>
  add    $0x20,%rsp
  mov    -0x28(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L2
  call   <__stack_chk_fail@plt>
L2:
  lea    -0x20(%rbp),%rsp
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %rbp
  ret
```

tool_calls: name: unpack_data
arguments: data_tag: D35
type_guessed: string
name: unpack_data
arguments: data_tag: D40
type_guessed: byte[8]
name: unpack_data
arguments: data_tag: D73
type_guessed: string
name: unpack_data
arguments: data_tag: D89
type_guessed: string
name: unpack_data
arguments: data_tag: D21
type_guessed: string
name: unpack_data
arguments: data_tag: D72
type_guessed: string

tool: D35: %x

tool: {"D40": [0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00]}

tool: D73: :

tool: D89: auth

tool: D21: 1

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