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

```asm
<tls1_P_hash>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbx
  sub    $0x58,%rsp
  mov    %rdi,-0x68(%rbp)
  mov    %rsi,-0x70(%rbp)
  mov    %edx,-0x48(%rbp)
  mov    %rcx,-0x50(%rbp)
  mov    %r8d,-0x74(%rbp)
  mov    %r9,-0x58(%rbp)
  mov    0x18(%rbp),%r14
  mov    0x28(%rbp),%rax
  mov    %rax,-0x60(%rbp)
  mov    0x30(%rbp),%r13d
  mov    %fs:0x28,%rax
  mov    %rax,-0x38(%rbp)
  xor    %eax,%eax
  mov    D2(%rip),%rax
  movslq (%rax),%rax
  add    $0xf,%rax
  mov    %rax,%rcx
  and    $0xfffffffffffffff0,%rcx
  and    $0xfffffffffffff000,%rax
  mov    %rsp,%rdx
  sub    %rax,%rdx
L84:
  cmp    %rdx,%rsp
  je     L31
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  jmp    L84
L31:
  mov    %rcx,%rax
  and    $0xfff,%eax
  sub    %rax,%rsp
  test   %rax,%rax
  je     L46
  orq    $0x0,-0x8(%rsp,%rax,1)
L46:
  mov    %rsp,%r15
  mov    $0x0,%eax
  call   <HMAC_CTX_new@plt>
  mov    %rax,%r12
  mov    $0x0,%r8d
  mov    -0x68(%rbp),%rcx
  mov    -0x48(%rbp),%edx
  mov    -0x70(%rbp),%rsi
  mov    %rax,%rdi
  call   <HMAC_Init_ex@plt>
  mov    $0x0,%ebx
  jmp    L122
L63:
  lea    -0x3c(%rbp),%rdx
  mov    %r15,%rsi
  mov    %r12,%rdi
  call   <HMAC_Final@plt>
  mov    $0x0,%r8d
  mov    $0x0,%ecx
  mov    $0x0,%edx
  mov    $0x0,%esi
  mov    %r12,%rdi
  call   <HMAC_Init_ex@plt>
L81:
  mov    -0x3c(%rbp),%edx
  mov    %r15,%rsi
  mov    %r12,%rdi
  call   <HMAC_Update@plt>
L9:
  add    $0x1,%ebx
L122:
  mov    %ebx,-0x44(%rbp)
  mov    -0x50(%rbp),%rax
  test   %rax,%rax
  je     L11
  mov    -0x74(%rbp),%edx
  mov    %rax,%rsi
  mov    %r12,%rdi
  call   <HMAC_Update@plt>
L11:
  mov    -0x58(%rbp),%rax
  test   %rax,%rax
  je     L57
  mov    0x10(%rbp),%edx
  mov    %rax,%rsi
  mov    %r12,%rdi
  call   <HMAC_Update@plt>
L57:
  test   %r14,%r14
  je     L40
  mov    0x20(%rbp),%edx
  mov    %r14,%rsi
  mov    %r12,%rdi
  call   <HMAC_Update@plt>
L40:
  cmpl   $0x0,-0x44(%rbp)
  je     L63
  mov    -0x3c(%rbp),%eax
  mov    %eax,%esi
  imul   %ebx,%esi
  cmp    %r13d,%esi
  ja     L105
  sub    %eax,%esi
  add    -0x60(%rbp),%rsi
  mov    $0x0,%edx
  mov    %r12,%rdi
  call   <HMAC_Final@plt>
  sub    $0x8,%rsp
  push   $0x0
  mov    %r15,%r9
  mov    -0x3c(%rbp),%r8d
  mov    %r15,%rcx
  mov    -0x48(%rbp),%edx
  mov    -0x70(%rbp),%rsi
  mov    -0x68(%rbp),%rdi
  call   <HMAC@plt>
  mov    $0x0,%r8d
  mov    $0x0,%ecx
  mov    $0x0,%edx
  mov    $0x0,%esi
  mov    %r12,%rdi
  call   <HMAC_Init_ex@plt>
  mov    %ebx,%eax
  imul   -0x3c(%rbp),%eax
  add    $0x10,%rsp
  cmp    %eax,%r13d
  jb     L17
  cmp    $0xffffffff,%ebx
  je     L9
  jmp    L81
L105:
  mov    $0x0,%edx
  mov    %r15,%rsi
  mov    %r12,%rdi
  call   <HMAC_Final@plt>
  mov    -0x3c(%rbp),%ecx
  mov    %r13d,%eax
  mov    $0x0,%edx
  div    %ecx
  mov    -0x44(%rbp),%r14d
  sub    $0x1,%r14d
  imul   %ecx,%r14d
  mov    -0x60(%rbp),%rdi
  add    %r14,%rdi
  mov    %r15,%rsi
  call   <memcpy@plt>
L17:
  mov    %r12,%rdi
  call   <HMAC_CTX_free@plt>
  mov    -0x38(%rbp),%rax
  sub    %fs:0x28,%rax
  jne    L41
  mov    $0x1,%eax
  lea    -0x28(%rbp),%rsp
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  pop    %rbp
  ret
L41:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int tls1_P_hash(const EVP_MD *md, const unsigned char *sec, int sec_len, const void *seed1, int seed1_len, const void *seed2, int seed2_len, const void *seed3, int seed3_len, unsigned char *out, int olen) {
  unsigned char A1[EVP_MAX_MD_SIZE];
  HMAC_CTX *ctx = HMAC_CTX_new();
  unsigned int chunk;
  int i = 0;
  HMAC_Init_ex(ctx, sec, sec_len, md, NULL);
  do {
    if (i)
      HMAC_Update(ctx, A1, chunk);
    if (seed1)
      HMAC_Update(ctx, seed1, seed1_len);
    if (seed2)
      HMAC_Update(ctx, seed2, seed2_len);
    if (seed3)
      HMAC_Update(ctx, seed3, seed3_len);
    if (!i)
      HMAC_Final(ctx, A1, &chunk);
    else if (i * chunk <= olen) {
      HMAC_Final(ctx, out + ((i - 1) * chunk), NULL);
      HMAC(md, sec, sec_len, A1, chunk, A1, NULL);
    } else {
      HMAC_Final(ctx, A1, NULL);
      memcpy(out + ((i - 1) * chunk), A1, olen % chunk);
      break;
    }
    HMAC_Init_ex(ctx, NULL, 0, NULL, NULL);
    i++;
  } while ((i - 1) * chunk <= olen);
  HMAC_CTX_free(ctx);
  return 1;
}
```