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

```asm
<SHA1_Update>:
  endbr64
  test   %rdx,%rdx
  je     L427
  push   %r12
  lea    0x0(,%rdx,8),%eax
  mov    %rsi,%r12
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  mov    %rdx,%rbx
  xor    %edx,%edx
  add    (%rdi),%eax
  mov    0x10(%rdi),%rcx
  setb   %dl
  mov    %eax,(%rdi)
  cmp    $0x1,%edx
  mov    %rbx,%rdx
  sbb    $0xffffffffffffffff,%rcx
  shr    $0x1d,%rdx
  add    %rcx,%rdx
  mov    %rdx,0x10(%rdi)
  mov    0x4(%rdi),%edx
  test   %edx,%edx
  jne    L205
  cmp    $0x3f,%rbx
  ja     L477
L100:
  mov    %rbx,%rsi
  mov    %ebx,0x4(%rbp)
  mov    0x8(%rbp),%rcx
  and    $0x3,%esi
  shr    $0x2,%rbx
  je     L37
  shl    $0x2,%rbx
  xor    %edx,%edx
  nopl   (%rax)
L341:
  mov    (%r12,%rdx,1),%eax
  bswap  %eax
  mov    %eax,(%rcx,%rdx,1)
  add    $0x4,%rdx
  cmp    %rdx,%rbx
  jne    L341
  add    %rbx,%r12
  add    %rbx,%rcx
L37:
  lea    (%r12,%rsi,1),%rdx
  cmp    $0x2,%rsi
  je     L509
  cmp    $0x3,%rsi
  je     L5
  xor    %eax,%eax
  cmp    $0x1,%rsi
  je     L382
L40:
  mov    %eax,(%rcx)
L366:
  pop    %rbx
  mov    $0x1,%eax
  pop    %rbp
  pop    %r12
  ret
  nopl   0x0(%rax,%rax,1)
L205:
  mov    %edx,%eax
  mov    0x8(%rdi),%rsi
  movslq %edx,%r9
  mov    %edx,%edi
  sar    $0x2,%eax
  add    %rbx,%r9
  and    $0x3,%edi
  cltq
  lea    0x0(,%rax,4),%rcx
  lea    (%rsi,%rcx,1),%r10
  cmp    $0x3f,%r9
  jbe    L179
  mov    (%r10),%edx
  movzbl (%r12),%r8d
  cmp    $0x2,%edi
  je     L243
  cmp    $0x3,%edi
  je     L55
  cmp    $0x1,%edi
  je     L36
  mov    %r8d,%edx
  add    $0x1,%r12
  shl    $0x18,%edx
L36:
  movzbl (%r12),%r8d
  lea    0x1(%r12),%rdi
  shl    $0x10,%r8
  or     %r8d,%edx
L65:
  lea    0x1(%rdi),%r12
  movzbl (%rdi),%edi
  shl    $0x8,%rdi
  or     %edi,%edx
L55:
  movzbl (%r12),%edi
  lea    0x1(%r12),%r8
  or     %edi,%edx
  mov    %edx,(%r10)
  lea    0x1(%rax),%rdx
  cmp    $0xf,%rdx
  ja     L252
  mov    0x1(%r12),%edx
  bswap  %edx
  mov    %edx,0x4(%rsi,%rcx,1)
  cmp    $0xe,%rax
  je     L374
  mov    0x5(%r12),%edx
  bswap  %edx
  mov    %edx,0x8(%rsi,%rcx,1)
  cmp    $0xd,%rax
  je     L374
  mov    0x9(%r12),%edx
  bswap  %edx
  mov    %edx,0xc(%rsi,%rcx,1)
  cmp    $0xc,%rax
  je     L374
  mov    0xd(%r12),%edx
  bswap  %edx
  mov    %edx,0x10(%rsi,%rcx,1)
  cmp    $0xb,%rax
  je     L374
  mov    0x11(%r12),%edx
  bswap  %edx
  mov    %edx,0x14(%rsi,%rcx,1)
  cmp    $0xa,%rax
  je     L374
  mov    0x15(%r12),%edx
  bswap  %edx
  mov    %edx,0x18(%rsi,%rcx,1)
  cmp    $0x9,%rax
  je     L374
  mov    0x19(%r12),%edx
  bswap  %edx
  mov    %edx,0x1c(%rsi,%rcx,1)
  cmp    $0x8,%rax
  je     L374
  mov    0x1d(%r12),%edx
  bswap  %edx
  mov    %edx,0x20(%rsi,%rcx,1)
  cmp    $0x7,%rax
  je     L374
  mov    0x21(%r12),%edx
  bswap  %edx
  mov    %edx,0x24(%rsi,%rcx,1)
  cmp    $0x6,%rax
  je     L374
  mov    0x25(%r12),%edx
  bswap  %edx
  mov    %edx,0x28(%rsi,%rcx,1)
  cmp    $0x5,%rax
  je     L374
  mov    0x29(%r12),%edx
  bswap  %edx
  mov    %edx,0x2c(%rsi,%rcx,1)
  cmp    $0x4,%rax
  je     L374
  mov    0x2d(%r12),%edx
  bswap  %edx
  mov    %edx,0x30(%rsi,%rcx,1)
  cmp    $0x3,%rax
  je     L374
  mov    0x31(%r12),%edx
  bswap  %edx
  mov    %edx,0x34(%rsi,%rcx,1)
  cmp    $0x2,%rax
  je     L374
  mov    0x35(%r12),%edx
  lea    0xf(%rax),%rdi
  bswap  %edx
  mov    %edx,0x38(%rsi,%rcx,1)
  cmp    $0x1,%rax
  je     L374
  mov    0x39(%r12),%edx
  bswap  %edx
  mov    %edx,0x3c(%rsi,%rcx,1)
  cmp    $0xe,%rdi
  jne    L374
  mov    0x3d(%r12),%edx
  bswap  %edx
  mov    %edx,0x3c(%rsi)
  nopl   0x0(%rax)
L374:
  mov    $0xf,%edx
  sub    %rax,%rdx
  lea    (%r8,%rdx,4),%r12
L479:
  mov    $0x1,%edx
  mov    %rbp,%rdi
  call   <sha1_block_host_order@plt>
  mov    $0x40,%eax
  sub    0x4(%rbp),%eax
  movl   $0x0,0x4(%rbp)
  cltq
  sub    %rax,%rbx
  cmp    $0x3f,%rbx
  ja     L477
L379:
  test   %rbx,%rbx
  jne    L100
  pop    %rbx
  mov    $0x1,%eax
  pop    %rbp
  pop    %r12
  ret
  cs nopw 0x0(%rax,%rax,1)
L5:
  movzbl -0x1(%rdx),%eax
  add    $0x2,%r12
  shl    $0x8,%eax
L138:
  movzbl -0x1(%r12),%esi
  lea    -0x1(%r12),%rdx
  shl    $0x10,%rsi
  or     %esi,%eax
L382:
  movzbl -0x1(%rdx),%edx
  shl    $0x18,%rdx
  or     %edx,%eax
  jmp    L40
  nopl   0x0(%rax,%rax,1)
L427:
  mov    $0x1,%eax
  ret
  cs nopw 0x0(%rax,%rax,1)
L243:
  mov    %r12,%rdi
  jmp    L65
  nopl   0x0(%rax,%rax,1)
L477:
  mov    %rbx,%rdx
  mov    %r12,%rsi
  mov    %rbp,%rdi
  shr    $0x6,%rdx
  call   <sha1_block_data_order@plt>
  mov    %rbx,%rax
  and    $0xffffffffffffffc0,%rax
  add    %rax,%r12
  sub    %rax,%rbx
  jmp    L379
  nopl   0x0(%rax)
L179:
  movslq %edi,%r8
  add    %ebx,%edx
  add    %rbx,%r8
  mov    %edx,0x4(%rbp)
  cmp    $0x3,%r8
  ja     L11
  mov    (%r10),%eax
  cmp    $0x1,%edi
  je     L273
  cmp    $0x2,%edi
  je     L475
  test   %edi,%edi
  je     L305
L407:
  mov    %eax,(%r10)
  jmp    L366
  xchg   %ax,%ax
L509:
  mov    %rdx,%r12
  xor    %eax,%eax
  jmp    L138
  nopw   0x0(%rax,%rax,1)
L11:
  mov    %edx,%r8d
  and    $0x3,%edx
  sar    $0x2,%r8d
  movslq %r8d,%r8
  test   %edi,%edi
  je     L297
  mov    (%r10),%r11d
  cmp    $0x2,%edi
  je     L54
  cmp    $0x3,%edi
  je     L486
  cmp    $0x1,%edi
  je     L164
L297:
  movzbl (%r12),%r11d
  add    $0x1,%r12
  shl    $0x18,%r11d
L164:
  movzbl (%r12),%r9d
  lea    0x1(%r12),%rdi
  shl    $0x10,%r9
  or     %r9d,%r11d
L173:
  lea    0x1(%rdi),%r12
  movzbl (%rdi),%edi
  shl    $0x8,%rdi
  or     %edi,%r11d
L486:
  movzbl (%r12),%ebx
  lea    0x1(%rax),%rdi
  lea    0x1(%r12),%r9
  or     %ebx,%r11d
  mov    %r11d,(%r10)
  cmp    %rdi,%r8
  jbe    L290
  sub    %rcx,%r12
  nop
L44:
  mov    -0x3(%r12,%rdi,4),%ecx
  bswap  %ecx
  mov    %ecx,(%rsi,%rdi,4)
  add    $0x1,%rdi
  cmp    %rdi,%r8
  jne    L44
  mov    %rdi,%rcx
  sub    %rax,%rcx
  lea    -0x4(%r9,%rcx,4),%r9
L290:
  test   %edx,%edx
  je     L366
  movslq %edx,%rax
  add    %rax,%r9
  xor    %eax,%eax
  movzbl -0x1(%r9),%ecx
  cmp    $0x2,%edx
  je     L389
  cmp    $0x3,%edx
  jne    L472
  movzbl %cl,%eax
  sub    $0x1,%r9
  shl    $0x8,%eax
L389:
  movzbl -0x1(%r9),%edx
  sub    $0x1,%r9
  shl    $0x10,%rdx
  or     %edx,%eax
L472:
  movzbl -0x1(%r9),%edx
  shl    $0x18,%rdx
  or     %edx,%eax
  mov    %eax,(%rsi,%rdi,4)
  jmp    L366
L252:
  mov    %r8,%r12
  jmp    L479
L305:
  movzbl (%r12),%eax
  shl    $0x18,%eax
  sub    $0x1,%rbx
  je     L407
  add    $0x1,%r12
L273:
  movzbl (%r12),%edx
  shl    $0x10,%rdx
  or     %edx,%eax
  cmp    $0x1,%rbx
  je     L407
  add    $0x1,%r12
L475:
  movzbl (%r12),%edx
  shl    $0x8,%rdx
  or     %edx,%eax
  jmp    L407
L54:
  mov    %r12,%rdi
  jmp    L173
```

assistant: ```c
int SHA1_Update(SHA_CTX *c, const void *data_, size_t len) {
  const unsigned char *data = (const unsigned char *)data_;
  register unsigned int *p;
  register unsigned int l;
  size_t sw, sc, ew, ec;
  if (len == 0) {
    return 1;
  }
  l = (c->Nl + (((unsigned int)len) << 3)) & 0xffffffffUL;
  if (l < c->Nl) {
    c->Nh++;
  }
  c->Nh += (len >> 29);
  c->Nl = l;
  if (c->num != 0) {
    p = c->data;
    sw = c->num >> 2;
    sc = c->num & 0x03;
    if ((c->num + len) >= (16 * 4)) {
      l = p[sw];
      {
        switch (sc) {
        case 0:
          l = ((unsigned long)(*((data)++))) << 24;
        case 1:
          l |= ((unsigned long)(*((data)++))) << 16;
        case 2:
          l |= ((unsigned long)(*((data)++))) << 8;
        case 3:
          l |= ((unsigned long)(*((data)++)));
        }
      };
      p[sw++] = l;
      for (; sw < 16; sw++) {
        ({
          unsigned int r = *((const unsigned int *)(data));
          asm("bswapl %0" : "=r"(r) : "0"(r));
          (data) += 4;
          (l) = r;
        });
        p[sw] = l;
      }
      sha1_block_host_order(c, p, 1);
      len -= ((16 * 4) - c->num);
      c->num = 0;
    } else {
      c->num += (unsigned int)len;
      if ((sc + len) < 4) {
        l = p[sw];
        {
          switch (sc) {
          case 0:
            l = ((unsigned long)(*((data)++))) << 24;
            if (--len == 0)
              break;
          case 1:
            l |= ((unsigned long)(*((data)++))) << 16;
            if (--len == 0)
              break;
          case 2:
            l |= ((unsigned long)(*((data)++))) << 8;
          }
        };
        p[sw] = l;
      } else {
        ew = (c->num >> 2);
        ec = (c->num & 0x03);
        if (sc) {
          l = p[sw];
        }
        {
          switch (sc) {
          case 0:
            l = ((unsigned long)(*((data)++))) << 24;
          case 1:
            l |= ((unsigned long)(*((data)++))) << 16;
          case 2:
            l |= ((unsigned long)(*((data)++))) << 8;
          case 3:
            l |= ((unsigned long)(*((data)++)));
          }
        };
        p[sw++] = l;
        for (; sw < ew; sw++) {
          ({
            unsigned int r = *((const unsigned int *)(data));
            asm("bswapl %0" : "=r"(r) : "0"(r));
            (data) += 4;
            (l) = r;
          });
          p[sw] = l;
        }
        if (ec) {
          {
            l = 0;
            (data) += ec;
            switch (ec) {
            case 3:
              l = ((unsigned long)(*(--(data)))) << 8;
            case 2:
              l |= ((unsigned long)(*(--(data)))) << 16;
            case 1:
              l |= ((unsigned long)(*(--(data)))) << 24;
            }
          };
          p[sw] = l;
        }
      }
      return 1;
    }
  }
  sw = len / (16 * 4);
  if (sw > 0) {
    {
      sha1_block_data_order(c, data, sw);
      sw *= (16 * 4);
      data += sw;
      len -= sw;
    }
  }
  if (len != 0) {
    p = c->data;
    c->num = len;
    ew = len >> 2;
    ec = len & 0x03;
    for (; ew; ew--, p++) {
      ({
        unsigned int r = *((const unsigned int *)(data));
        asm("bswapl %0" : "=r"(r) : "0"(r));
        (data) += 4;
        (l) = r;
      });
      *p = l;
    }
    {
      l = 0;
      (data) += ec;
      switch (ec) {
      case 3:
        l = ((unsigned long)(*(--(data)))) << 8;
      case 2:
        l |= ((unsigned long)(*(--(data)))) << 16;
      case 1:
        l |= ((unsigned long)(*(--(data)))) << 24;
      }
    };
    *p = l;
  }
  return 1;
}
```