user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<sha1>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  mov    %esi,%r13d
  push   %r12
  push   %rbp
  mov    %rdx,%rbp
  push   %rbx
  mov    %rdi,%rbx
  sub    $0x238,%rsp
  movdqa D0(%rip),%xmm0
  mov    %fs:0x28,%rax
  mov    %rax,0x228(%rsp)
  xor    %eax,%eax
  and    $0x3f,%esi
  movl   $0xc3d2e1f0,0x10(%rsp)
  movaps %xmm0,(%rsp)
  je     L98
  mov    %r13d,%r14d
  and    $0xffffffc0,%r14d
  cmp    %r14d,%r13d
  jle    L98
  mov    %r13d,%r15d
  lea    0x20(%rsp),%r12
  sub    %r14d,%r15d
  lea    -0x1(%r15),%eax
  lea    0x4(,%rax,4),%rdx
  movslq %r14d,%rax
  lea    (%rdi,%rax,4),%rsi
  mov    %r12,%rdi
  call   <memcpy@plt>
  lea    0x0(,%r13,8),%r9d
  lea    0x1(%r15),%r13d
  movslq %r15d,%r15
  movl   $0x80,0x20(%rsp,%r15,4)
  mov    %r13d,%eax
  and    $0x3f,%eax
  cmp    $0x38,%eax
  jne    L16
  nopl   0x0(%rax,%rax,1)
L69:
  mov    $0x38,%ecx
  mov    %r9d,%edi
  mov    %r9d,%edx
  mov    %r9d,%esi
  sar    %cl,%edi
  mov    $0x30,%ecx
  movd   %r9d,%xmm4
  movslq %r13d,%rax
  sar    %cl,%edx
  movd   %edi,%xmm0
  lea    (%r12,%rax,4),%rax
  mov    $0x28,%ecx
  sar    %cl,%esi
  mov    $0x20,%ecx
  movd   %edx,%xmm3
  movd   %esi,%xmm1
  mov    %r9d,%esi
  punpckldq %xmm3,%xmm0
  sar    %cl,%esi
  mov    %r9d,%ecx
  movd   %esi,%xmm2
  sar    $0x18,%ecx
  punpckldq %xmm2,%xmm1
  punpcklqdq %xmm1,%xmm0
  movups %xmm0,(%rax)
  movd   %ecx,%xmm0
  mov    %r9d,%ecx
  sar    $0x10,%ecx
  mov    %ecx,%edx
  mov    %r9d,%ecx
  sar    $0x8,%ecx
  movd   %edx,%xmm5
  movd   %ecx,%xmm1
  punpckldq %xmm5,%xmm0
  punpckldq %xmm4,%xmm1
  punpcklqdq %xmm1,%xmm0
  movups %xmm0,0x10(%rax)
  test   %r14d,%r14d
  jle    L91
  sub    $0x1,%r14d
  shr    $0x6,%r14d
  shl    $0x8,%r14
  lea    0x100(%rbx,%r14,1),%r15
  mov    %rsp,%r14
  nopl   0x0(%rax,%rax,1)
L71:
  mov    %rbx,%rdi
  mov    %r14,%rsi
  add    $0x100,%rbx
  call   <sha1_chunk@plt>
  cmp    %rbx,%r15
  jne    L71
L51:
  add    $0x7,%r13d
  mov    %r12,%rbx
  shr    $0x6,%r13d
  shl    $0x8,%r13
  lea    0x120(%rsp,%r13,1),%r12
  cs nopw 0x0(%rax,%rax,1)
L72:
  mov    %rbx,%rdi
  mov    %r14,%rsi
  add    $0x100,%rbx
  call   <sha1_chunk@plt>
  cmp    %r12,%rbx
  jne    L72
  mov    (%rsp),%edi
  mov    0x4(%rsp),%esi
  mov    0x8(%rsp),%ecx
  mov    0xc(%rsp),%edx
  mov    %edi,%ebx
  mov    %edi,%r8d
  movd   %edi,%xmm6
  mov    0x10(%rsp),%eax
  sar    $0x18,%ebx
  sar    $0x10,%r8d
  movd   %esi,%xmm2
  movd   %ecx,%xmm4
  movd   %ebx,%xmm0
  mov    %edi,%ebx
  movd   %r8d,%xmm7
  mov    %esi,%edi
  sar    $0x8,%ebx
  punpckldq %xmm7,%xmm0
  sar    $0x18,%edi
  movd   %ebx,%xmm1
  mov    %esi,%ebx
  punpckldq %xmm6,%xmm1
  sar    $0x8,%ebx
  movd   %edx,%xmm6
  punpcklqdq %xmm1,%xmm0
  movd   %ebx,%xmm1
  movups %xmm0,0x0(%rbp)
  movd   %edi,%xmm0
  mov    %esi,%edi
  punpckldq %xmm2,%xmm1
  sar    $0x10,%edi
  mov    %ecx,%esi
  movd   %eax,%xmm2
  movd   %edi,%xmm3
  sar    $0x18,%esi
  mov    %ecx,%edi
  punpckldq %xmm3,%xmm0
  sar    $0x8,%edi
  punpcklqdq %xmm1,%xmm0
  movd   %edi,%xmm1
  mov    %edx,%edi
  movups %xmm0,0x10(%rbp)
  movd   %esi,%xmm0
  mov    %ecx,%esi
  punpckldq %xmm4,%xmm1
  sar    $0x10,%esi
  mov    %edx,%ecx
  sar    $0x8,%edi
  movd   %esi,%xmm5
  sar    $0x18,%ecx
  punpckldq %xmm5,%xmm0
  punpcklqdq %xmm1,%xmm0
  movd   %edi,%xmm1
  movups %xmm0,0x20(%rbp)
  movd   %ecx,%xmm0
  mov    %edx,%ecx
  punpckldq %xmm6,%xmm1
  sar    $0x10,%ecx
  mov    %eax,%edx
  movd   %ecx,%xmm7
  mov    %eax,%ecx
  sar    $0x10,%edx
  punpckldq %xmm7,%xmm0
  sar    $0x18,%ecx
  movd   %edx,%xmm3
  punpcklqdq %xmm1,%xmm0
  movups %xmm0,0x30(%rbp)
  movd   %ecx,%xmm0
  mov    %eax,%ecx
  sar    $0x8,%ecx
  punpckldq %xmm3,%xmm0
  movd   %ecx,%xmm1
  punpckldq %xmm2,%xmm1
  punpcklqdq %xmm1,%xmm0
  movups %xmm0,0x40(%rbp)
  mov    0x228(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L82
  add    $0x238,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   (%rax)
L98:
  movl   $0x80,0x20(%rsp)
  lea    0x0(,%r13,8),%r9d
  mov    %r13d,%r14d
  lea    0x20(%rsp),%r12
  mov    $0x1,%r13d
L16:
  lea    0x1(%r13),%eax
  cltq
  nopl   0x0(%rax)
L88:
  movl   $0x0,-0x4(%r12,%rax,4)
  mov    %eax,%r13d
  add    $0x1,%rax
  mov    %r13d,%edx
  and    $0x3f,%edx
  cmp    $0x38,%edx
  jne    L88
  jmp    L69
  nopl   0x0(%rax,%rax,1)
L91:
  mov    %rsp,%r14
  jmp    L51
L82:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: data_label: D0
type_infered: byte[16]

tool: {"D0": [0x01,0x23,0x45,0x67,0x89,0xab,0xcd,0xef,0xfe,0xdc,0xba,0x98,0x76,0x54,0x32,0x10]}

assistant: ```c
void sha1(uint8_t *data, uint64_t size, uint8_t *out) {
  uint32_t hash[5] = {0x67452301, 0xEFCDAB89, 0x98BADCFE, 0x10325476, 0xC3D2E1F0};
  uint8_t last[128];
  uint32_t last_size = 0;
  if ((size & 63) != 0) {
    for (uint32_t src = size - (size & 63); src < size; src++) {
      last[last_size++] = data[src];
    }
  }
  uint64_t bitsize = size * 8;
  size -= last_size;
  last[last_size++] = 0x80;
  while ((last_size & 63) != 56) {
    last[last_size++] = 0;
  }
  last[last_size++] = bitsize >> 56;
  last[last_size++] = bitsize >> 48;
  last[last_size++] = bitsize >> 40;
  last[last_size++] = bitsize >> 32;
  last[last_size++] = bitsize >> 24;
  last[last_size++] = bitsize >> 16;
  last[last_size++] = bitsize >> 8;
  last[last_size++] = bitsize;
  for (uint64_t cur = 0; cur < size; cur += 64) {
    sha1_chunk(data + cur, hash);
  }
  for (uint64_t cur = 0; cur < last_size; cur += 64) {
    sha1_chunk(last + cur, hash);
  }
  for (uint32_t cur = 0; cur < 20; cur += 4) {
    uint32_t val = hash[cur >> 2];
    out[cur] = val >> 24;
    out[cur + 1] = val >> 16;
    out[cur + 2] = val >> 8;
    out[cur + 3] = val;
  }
}
```