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

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

tool_calls: name: unpack_data
arguments: data_label: D9
type: string
name: unpack_data
arguments: data_label: D14
type: string
name: unpack_data
arguments: data_label: D23
type: string
name: unpack_data
arguments: data_label: D30
type: string
name: unpack_data
arguments: data_label: D48
type: string

tool: D9: %x

tool: D14: :

tool: D23: auth

tool: D30: 1

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