user: Converte this assembly snippet into its equivalent C code:

```asm
<sha1>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  mov    %rdx,%r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x88,%rsp
  movdqa D7(%rip),%xmm0
  mov    %fs:0x28,%rax
  mov    %rax,0x78(%rsp)
  xor    %eax,%eax
  movl   $0xf0e1d2c3,0x20(%rsp)
  movaps %xmm0,0x10(%rsp)
  test   %sil,%sil
  je     L65
  movzbl (%rdi),%eax
  lea    -0x1(%rsi),%ecx
  lea    0x1(%rdi),%rbx
  mov    %esi,%r8d
  movzbl %cl,%ecx
  mov    $0x8,%ebp
  lea    0x30(%rsp),%r14
  xor    %r12d,%r12d
  mov    %al,0x30(%rsp)
  add    %rbx,%rcx
  mov    $0x1,%eax
  lea    0x10(%rsp),%r15
  jmp    L110
  cs nopw 0x0(%rax,%rax,1)
L24:
  movzbl (%rbx),%esi
  add    $0x8,%ebp
  cmp    $0x1,%bpl
  mov    %sil,0x30(%rsp,%rdx,1)
  adc    $0x0,%r12b
  add    $0x1,%rbx
L110:
  cmp    $0x40,%al
  je     L172
  movzbl %al,%edx
  add    $0x1,%eax
L75:
  cmp    %rbx,%rcx
  jne    L24
  movb   $0x80,0x30(%rsp,%rdx,1)
  lea    0x0(,%r8,8),%ebx
  cmp    $0x37,%al
  jbe    L83
  cmp    $0x3f,%al
  ja     L97
  mov    $0x40,%edx
  xor    %edi,%edi
  sub    %eax,%edx
  movzbl %al,%eax
  movzbl %dl,%edx
  add    %r14,%rax
  cmp    $0x8,%edx
  jae    L113
  test   $0x4,%dl
  jne    L74
  test   %edx,%edx
  jne    L32
L97:
  mov    %r14,%rdx
  mov    %r13,%rsi
  mov    %r15,%rdi
  call   <processBlock@plt>
  mov    0x10(%r13),%eax
  movdqu 0x0(%r13),%xmm2
  mov    %eax,0x20(%rsp)
  xor    %eax,%eax
  movaps %xmm2,0x10(%rsp)
L83:
  xor    %ecx,%ecx
  mov    %r12b,%cl
  mov    %bl,%ch
  nopl   (%rax)
L156:
  movzbl %al,%edx
  add    $0x1,%eax
  movb   $0x0,0x30(%rsp,%rdx,1)
  cmp    $0x3e,%al
  jne    L156
  mov    %r14,%rdx
  mov    %r13,%rsi
  mov    %r15,%rdi
  mov    %cx,0x6e(%rsp)
  call   <processBlock@plt>
  mov    0x78(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L173
  add    $0x88,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L172:
  mov    %r14,%rdx
  mov    %r13,%rsi
  mov    %r15,%rdi
  mov    %r8d,0xc(%rsp)
  mov    %rcx,(%rsp)
  call   <processBlock@plt>
  mov    0x10(%r13),%eax
  mov    (%rsp),%rcx
  xor    %edx,%edx
  movdqu 0x0(%r13),%xmm1
  mov    0xc(%rsp),%r8d
  mov    %eax,0x20(%rsp)
  mov    $0x1,%eax
  movaps %xmm1,0x10(%rsp)
  jmp    L75
  nop
L113:
  lea    0x8(%rax),%rcx
  movq   $0x0,(%rax)
  movq   $0x0,-0x8(%rdx,%rax,1)
  and    $0xfffffffffffffff8,%rcx
  sub    %rcx,%rax
  add    %eax,%edx
  and    $0xfffffff8,%edx
  cmp    $0x8,%edx
  jb     L97
  and    $0xfffffff8,%edx
  xor    %eax,%eax
L141:
  mov    %eax,%esi
  add    $0x8,%eax
  mov    %rdi,(%rcx,%rsi,1)
  cmp    %edx,%eax
  jb     L141
  jmp    L97
L32:
  movb   $0x0,(%rax)
  test   $0x2,%dl
  je     L97
  xor    %ecx,%ecx
  mov    %cx,-0x2(%rdx,%rax,1)
  jmp    L97
  nopl   0x0(%rax,%rax,1)
L65:
  movb   $0x80,0x30(%rsp)
  mov    %esi,%ebx
  xor    %r12d,%r12d
  mov    $0x1,%eax
  lea    0x30(%rsp),%r14
  lea    0x10(%rsp),%r15
  jmp    L83
L74:
  movl   $0x0,(%rax)
  movl   $0x0,-0x4(%rdx,%rax,1)
  jmp    L97
L173:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: unpack_data
arguments: data_tag: D7
type: byte[16]

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

assistant: ```c
void sha1(const unsigned char message[], unsigned char length, unsigned char out[]) {
  unsigned char old[] = {0x67, 0x45, 0x23, 0x01, 0xEF, 0xCD, 0xAB, 0x89, 0x98, 0xBA, 0xDC, 0xFE, 0x10, 0x32, 0x54, 0x76, 0xC3, 0xD2, 0xE1, 0xF0};
  unsigned char lenght_low = 0;
  unsigned char lenght_high = 0;
  unsigned char index = 0;
  unsigned char message_block[64];
  for (unsigned char i = 0; i < length; i++) {
    message_block[index++] = message[i];
    lenght_low += 8;
    if (lenght_low == 0) {
      lenght_high++;
    }
    if (index == 64) {
      processBlock(old, out, message_block);
      for (unsigned char i = 0; i < 20; i++) {
        old[i] = out[i];
      }
      index = 0;
    }
  }
  message_block[index++] = 0x80;
  if (index > 55) {
    while (index < 64) {
      message_block[index++] = 0;
    }
    processBlock(old, out, message_block);
    for (unsigned char i = 0; i < 20; i++) {
      old[i] = out[i];
    }
    index = 0;
  }
  while (index < 62) {
    message_block[index++] = 0;
  }
  message_block[62] = lenght_high;
  message_block[63] = lenght_low;
  processBlock(old, out, message_block);
}
```