user: 请将以下的汇编代码转换成C语言代码:

```asm
<SHA1_Update>:
  endbr64
  test   %rdx,%rdx
  je     L148
  push   %r12
  push   %rbp
  push   %rbx
  mov    %rdi,%r12
  mov    %rsi,%rbp
  mov    %rdx,%rbx
  mov    (%rdi),%edx
  mov    %ebx,%r8d
  lea    (%rdx,%rbx,8),%eax
  cmp    %eax,%edx
  jbe    L299
  addq   $0x1,0x10(%rdi)
L299:
  mov    %rbx,%rdx
  shr    $0x1d,%rdx
  add    %rdx,0x10(%r12)
  mov    %eax,(%r12)
  mov    0x4(%r12),%eax
  test   %eax,%eax
  je     L216
  mov    0x8(%r12),%rsi
  mov    %eax,%edi
  sar    $0x2,%edi
  movslq %edi,%rdi
  mov    %eax,%edx
  and    $0x3,%edx
  movslq %eax,%rcx
  add    %rbx,%rcx
  cmp    $0x3f,%rcx
  jbe    L192
  lea    (%rsi,%rdi,4),%rcx
  mov    (%rcx),%eax
  cmp    $0x2,%edx
  je     L138
  cmp    $0x2,%edx
  jg     L403
  test   %edx,%edx
  je     L190
  cmp    $0x1,%edx
  jne    L89
L399:
  lea    0x1(%rbp),%rdx
  movzbl 0x0(%rbp),%r8d
  shl    $0x10,%r8
  or     %r8d,%eax
L424:
  lea    0x1(%rdx),%rbp
  movzbl (%rdx),%edx
  shl    $0x8,%rdx
  or     %edx,%eax
L403:
  lea    0x1(%rbp),%r8
  movzbl 0x0(%rbp),%edx
  or     %edx,%eax
L314:
  lea    0x1(%rdi),%rdx
  mov    %eax,(%rcx)
  cmp    $0xf,%rdx
  ja     L53
  mov    %rdi,%rax
  neg    %rax
  lea    (%r8,%rax,4),%rcx
L99:
  mov    -0x4(%rcx,%rdx,4),%eax
  bswap  %eax
  mov    %eax,(%rsi,%rdx,4)
  add    $0x1,%rdx
  cmp    $0x10,%rdx
  jne    L99
  mov    $0xf,%eax
  sub    %rdi,%rax
  lea    (%r8,%rax,4),%rbp
L38:
  mov    $0x1,%edx
  mov    %r12,%rdi
  call   <sha1_block_host_order@plt>
  mov    $0x40,%eax
  sub    0x4(%r12),%eax
  cltq
  sub    %rax,%rbx
  movl   $0x0,0x4(%r12)
  cmp    $0x3f,%rbx
  jbe    L29
  mov    %rbx,%rdx
  shr    $0x6,%rdx
L289:
  mov    %rbp,%rsi
  mov    %r12,%rdi
  call   <sha1_block_data_order@plt>
  mov    %rbx,%rax
  and    $0xffffffffffffffc0,%rax
  add    %rax,%rbp
  sub    %rax,%rbx
L29:
  test   %rbx,%rbx
  jne    L158
L177:
  mov    $0x1,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  ret
L89:
  mov    %rbp,%r8
  jmp    L314
L190:
  movzbl 0x0(%rbp),%eax
  shl    $0x18,%eax
  lea    0x1(%rbp),%rbp
  jmp    L399
L138:
  mov    %rbp,%rdx
  jmp    L424
L53:
  mov    %r8,%rbp
  jmp    L38
L192:
  movslq %edx,%rcx
  add    %r8d,%eax
  mov    %eax,0x4(%r12)
  lea    (%rbx,%rcx,1),%r8
  cmp    $0x3,%r8
  ja     L213
  lea    (%rsi,%rdi,4),%rcx
  mov    (%rcx),%eax
  cmp    $0x1,%edx
  je     L82
  cmp    $0x2,%edx
  je     L441
  test   %edx,%edx
  je     L137
L101:
  mov    %eax,(%rcx)
  jmp    L177
L137:
  movzbl 0x0(%rbp),%eax
  shl    $0x18,%eax
  sub    $0x1,%rbx
  je     L101
  add    $0x1,%rbp
L82:
  movzbl 0x0(%rbp),%edx
  shl    $0x10,%rdx
  or     %edx,%eax
  cmp    $0x1,%rbx
  je     L101
  add    $0x1,%rbp
L441:
  movzbl 0x0(%rbp),%edx
  shl    $0x8,%rdx
  or     %edx,%eax
  jmp    L101
L213:
  mov    %eax,%r8d
  sar    $0x2,%r8d
  movslq %r8d,%r8
  mov    %eax,%r11d
  and    $0x3,%r11d
  and    $0x3,%eax
  test   %rcx,%rcx
  je     L54
  mov    (%rsi,%rdi,4),%r9d
  cmp    $0x2,%edx
  je     L122
  cmp    $0x2,%edx
  jg     L406
  mov    %rbp,%r10
  cmp    $0x1,%edx
  jne    L228
L278:
  lea    0x1(%rbp),%rdx
  movzbl 0x0(%rbp),%ecx
  shl    $0x10,%rcx
  or     %ecx,%r9d
L225:
  lea    0x1(%rdx),%rbp
  movzbl (%rdx),%edx
  shl    $0x8,%rdx
  or     %edx,%r9d
L406:
  lea    0x1(%rbp),%r10
  movzbl 0x0(%rbp),%edx
  or     %edx,%r9d
L228:
  lea    0x1(%rdi),%rcx
  mov    %r9d,(%rsi,%rdi,4)
  cmp    %rcx,%r8
  jbe    L475
  mov    %rdi,%rdx
  neg    %rdx
  lea    (%r10,%rdx,4),%r9
L94:
  mov    -0x4(%r9,%rcx,4),%edx
  bswap  %edx
  mov    %edx,(%rsi,%rcx,4)
  add    $0x1,%rcx
  cmp    %rcx,%r8
  jne    L94
  mov    %rcx,%rdx
  sub    %rdi,%rdx
  lea    -0x4(%r10,%rdx,4),%r10
L475:
  test   %rax,%rax
  je     L177
  add    %rax,%r10
  cmp    $0x2,%r11d
  je     L59
  cmp    $0x3,%r11d
  je     L356
  mov    $0x0,%eax
  cmp    $0x1,%r11d
  jne    L426
  mov    $0x0,%eax
  jmp    L303
L54:
  movzbl 0x0(%rbp),%r9d
  shl    $0x18,%r9d
  lea    0x1(%rbp),%rbp
  jmp    L278
L122:
  mov    %rbp,%rdx
  jmp    L225
L356:
  movzbl -0x1(%r10),%eax
  shl    $0x8,%eax
  lea    -0x1(%r10),%r10
L394:
  movzbl -0x1(%r10),%edx
  shl    $0x10,%rdx
  or     %edx,%eax
  lea    -0x1(%r10),%r10
L303:
  movzbl -0x1(%r10),%edx
  shl    $0x18,%rdx
  or     %edx,%eax
L426:
  mov    %eax,(%rsi,%rcx,4)
  jmp    L177
L59:
  mov    $0x0,%eax
  jmp    L394
L9:
  movzbl -0x1(%rbp),%eax
  shl    $0x8,%eax
  lea    -0x1(%rbp),%rbp
L0:
  movzbl -0x1(%rbp),%edx
  shl    $0x10,%rdx
  or     %edx,%eax
  lea    -0x1(%rbp),%rbp
L445:
  movzbl -0x1(%rbp),%edx
  shl    $0x18,%rdx
  or     %edx,%eax
L187:
  mov    %eax,(%rcx)
  jmp    L177
L155:
  mov    $0x0,%eax
  jmp    L0
L216:
  mov    %rbx,%rdx
  shr    $0x6,%rdx
  cmp    $0x3f,%rbx
  ja     L289
L158:
  mov    0x8(%r12),%rcx
  mov    %ebx,0x4(%r12)
  mov    %rbx,%rsi
  and    $0x3,%esi
  shr    $0x2,%rbx
  je     L391
  shl    $0x2,%rbx
  mov    $0x0,%edx
L209:
  mov    0x0(%rbp,%rdx,1),%eax
  bswap  %eax
  mov    %eax,(%rcx,%rdx,1)
  add    $0x4,%rdx
  cmp    %rbx,%rdx
  jne    L209
  add    %rbx,%rbp
  add    %rbx,%rcx
L391:
  add    %rsi,%rbp
  cmp    $0x2,%rsi
  je     L155
  cmp    $0x3,%rsi
  je     L9
  mov    $0x0,%eax
  cmp    $0x1,%rsi
  jne    L187
  mov    $0x0,%eax
  jmp    L445
L148:
  mov    $0x1,%eax
  ret
```

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;
}
```