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

```asm
<tls1_prf>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0xe8,%rsp
  mov    %rdi,%r15
  mov    %esi,%ebp
  mov    %rdx,%rbx
  mov    %rcx,0x10(%rsp)
  mov    %r8d,%r14d
  mov    %r9,0x28(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0xd8(%rsp)
  xor    %eax,%eax
  mov    %rdx,%rdi
  call   <strlen@plt>
  lea    0x14(%r14,%rax,1),%eax
  cmp    $0x80,%eax
  ja     L9
  lea    0x1(%rbp),%eax
  mov    %eax,%r13d
  shr    $0x1f,%r13d
  add    %eax,%r13d
  sar    %r13d
  movslq %ebp,%rbp
  movslq %r13d,%rax
  sub    %rax,%rbp
  mov    %r15,0x18(%rsp)
  add    %r15,%rbp
  mov    %rbp,0x8(%rsp)
  mov    %rbx,%rdi
  call   <strlen@plt>
  mov    %eax,%r15d
  lea    0x50(%rsp),%r12
  lea    0x64(%rsp),%rbp
  mov    %eax,%edx
  mov    %rbx,%rsi
  mov    %rbp,%rdi
  mov    $0x0,%eax
  call   <memcpy@plt>
  movslq %r15d,%rax
  lea    0x14(%r12,%rax,1),%rdi
  mov    %r14d,%edx
  mov    0x10(%rsp),%rsi
  mov    $0x0,%eax
  call   <memcpy@plt>
  lea    (%r14,%r15,1),%eax
  mov    %eax,0x10(%rsp)
  lea    0x54(%rsp),%r8
  mov    %eax,%ecx
  mov    %rbp,%rdx
  mov    %r13d,%esi
  mov    0x18(%rsp),%r15
  mov    %r15,%rdi
  call   <md5_hmac@plt>
  cmpl   $0x0,0x120(%rsp)
  jle    L56
  mov    0x120(%rsp),%eax
  sar    $0x1f,%eax
  shr    $0x1c,%eax
  mov    %eax,%edx
  add    0x120(%rsp),%edx
  and    $0xf,%edx
  sub    %eax,%edx
  mov    %edx,0x24(%rsp)
  mov    0x28(%rsp),%rbp
  mov    0x120(%rsp),%eax
  sub    $0x1,%eax
  and    $0xfffffff0,%eax
  add    $0x10,%eax
  mov    %eax,0x18(%rsp)
  mov    $0x0,%r14d
  lea    0x30(%rsp),%r12
  jmp    L73
L34:
  mov    $0x0,%eax
L16:
  movzbl (%rax,%r12,1),%edx
  mov    %dl,0x0(%rbp,%rax,1)
  add    $0x1,%rax
  cmp    %eax,%ecx
  jg     L16
L86:
  add    $0x10,%r14d
  add    $0x10,%rbp
  cmp    0x18(%rsp),%r14d
  je     L28
L73:
  mov    0x10(%rsp),%eax
  lea    0x10(%rax),%ecx
  lea    0x54(%rsp),%rbx
  mov    %r12,%r8
  mov    %rbx,%rdx
  mov    %r13d,%esi
  mov    %r15,%rdi
  call   <md5_hmac@plt>
  mov    %rbx,%r8
  mov    $0x10,%ecx
  mov    %rbx,%rdx
  mov    %r13d,%esi
  mov    %r15,%rdi
  call   <md5_hmac@plt>
  lea    0xf(%r14),%eax
  mov    $0x10,%ecx
  cmp    %eax,0x120(%rsp)
  jg     L34
  mov    0x24(%rsp),%eax
  test   %eax,%eax
  jle    L86
  mov    %eax,%ecx
  jmp    L34
L28:
  mov    0x28(%rsp),%rbx
  lea    0x64(%rsp),%rdx
  lea    0x50(%rsp),%r8
  mov    0x10(%rsp),%ecx
  mov    %r13d,%esi
  mov    0x8(%rsp),%rdi
  call   <sha1_hmac@plt>
  movslq 0x120(%rsp),%r15
  imul   $0x66666667,%r15,%r15
  sar    $0x23,%r15
  mov    0x120(%rsp),%eax
  sar    $0x1f,%eax
  sub    %eax,%r15d
  lea    (%r15,%r15,4),%eax
  shl    $0x2,%eax
  mov    0x120(%rsp),%r15d
  sub    %eax,%r15d
  mov    $0x0,%r12d
  lea    0x30(%rsp),%rbp
  mov    %r15d,0x18(%rsp)
  mov    0x120(%rsp),%r15d
  jmp    L64
L91:
  mov    $0x0,%eax
L131:
  movzbl (%rax,%rbp,1),%edx
  xor    %dl,(%rbx,%rax,1)
  add    $0x1,%rax
  cmp    %eax,%ecx
  jg     L131
L23:
  add    $0x14,%r12d
  add    $0x14,%rbx
  cmp    %r12d,%r15d
  jle    L51
L64:
  mov    0x10(%rsp),%eax
  lea    0x14(%rax),%ecx
  lea    0x50(%rsp),%r14
  mov    %rbp,%r8
  mov    %r14,%rdx
  mov    %r13d,%esi
  mov    0x8(%rsp),%rdi
  call   <sha1_hmac@plt>
  mov    %r14,%r8
  mov    $0x14,%ecx
  mov    %r14,%rdx
  mov    %r13d,%esi
  mov    0x8(%rsp),%rdi
  call   <sha1_hmac@plt>
  lea    0x13(%r12),%eax
  mov    $0x14,%ecx
  cmp    %eax,%r15d
  jg     L91
  mov    0x18(%rsp),%eax
  test   %eax,%eax
  jle    L23
  mov    %eax,%ecx
  jmp    L91
L9:
  mov    $0xffffe800,%eax
  jmp    L11
L56:
  lea    0x64(%rsp),%rdx
  lea    0x50(%rsp),%r8
  mov    0x10(%rsp),%ecx
  mov    %r13d,%esi
  mov    0x8(%rsp),%rdi
  call   <sha1_hmac@plt>
L51:
  lea    0x50(%rsp),%rdi
  mov    $0x80,%edx
  mov    $0x0,%esi
  call   <memset@plt>
  lea    0x30(%rsp),%rdi
  mov    $0x14,%edx
  mov    $0x0,%esi
  call   <memset@plt>
  mov    $0x0,%eax
L11:
  mov    0xd8(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L80
  add    $0xe8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L80:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int tls1_prf(unsigned char *secret, int slen, char *label, unsigned char *random, int rlen, unsigned char *dstbuf, int dlen) {
  int nb, hs;
  int i, j, k;
  unsigned char *S1, *S2;
  unsigned char tmp[128];
  unsigned char h_i[20];
  if (sizeof(tmp) < 20 + strlen(label) + rlen)
    return (-0x1800);
  hs = (slen + 1) / 2;
  S1 = secret;
  S2 = secret + slen - hs;
  nb = strlen(label);
  memcpy(tmp + 20, label, nb);
  memcpy(tmp + 20 + nb, random, rlen);
  nb += rlen;
  md5_hmac(S1, hs, tmp + 20, nb, 4 + tmp);
  for (i = 0; i < dlen; i += 16) {
    md5_hmac(S1, hs, 4 + tmp, 16 + nb, h_i);
    md5_hmac(S1, hs, 4 + tmp, 16, 4 + tmp);
    k = (i + 16 > dlen) ? dlen % 16 : 16;
    for (j = 0; j < k; j++)
      dstbuf[i + j] = h_i[j];
  }
  sha1_hmac(S2, hs, tmp + 20, nb, tmp);
  for (i = 0; i < dlen; i += 20) {
    sha1_hmac(S2, hs, tmp, 20 + nb, h_i);
    sha1_hmac(S2, hs, tmp, 20, tmp);
    k = (i + 20 > dlen) ? dlen % 20 : 20;
    for (j = 0; j < k; j++)
      dstbuf[i + j] = (unsigned char)(dstbuf[i + j] ^ h_i[j]);
  }
  memset(tmp, 0, sizeof(tmp));
  memset(h_i, 0, sizeof(h_i));
  return (0);
}
```