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

```asm
<SHA256_Update>:
  endbr64
  test   %rdx,%rdx
  je     L15
  push   %r14
  push   %r13
  mov    %rsi,%r13
  mov    %edx,%esi
  push   %r12
  mov    %rdi,%r12
  push   %rbp
  mov    D7(%rip),%rbp
  push   %rbx
  mov    (%rdi),%eax
  mov    %rdx,%rbx
  lea    (%rax,%rdx,8),%ecx
  xor    %edx,%edx
  cmp    %ecx,%eax
  mov    %rbx,%rax
  mov    %ecx,(%rdi)
  mov    0x0(%rbp),%rcx
  setg   %dl
  shr    $0x1d,%rax
  add    0x10(%rdi),%rdx
  add    %rdx,%rax
  mov    %rax,0x10(%rdi)
  mov    0x4(%rdi),%eax
  test   %eax,%eax
  jne    L12
  cmp    %rcx,%rbx
  jae    L250
L289:
  mov    %esi,0x4(%r12)
  mov    %rbx,%rsi
  mov    0x8(%r12),%rcx
  and    $0x3,%esi
  shr    $0x2,%rbx
  je     L398
  shl    $0x2,%rbx
  xor    %eax,%eax
  nopw   0x0(%rax,%rax,1)
L205:
  mov    0x0(%r13,%rax,1),%edx
  bswap  %edx
  mov    %edx,(%rcx,%rax,1)
  add    $0x4,%rax
  cmp    %rax,%rbx
  jne    L205
  add    %rbx,%r13
  add    %rbx,%rcx
L398:
  lea    0x0(%r13,%rsi,1),%rdx
  cmp    $0x2,%rsi
  je     L300
  cmp    $0x3,%rsi
  je     L21
  xor    %eax,%eax
  cmp    $0x1,%rsi
  je     L376
L1:
  mov    %eax,(%rcx)
L34:
  pop    %rbx
  mov    $0x1,%eax
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
  xchg   %ax,%ax
L12:
  mov    0x8(%rdi),%rsi
  mov    %eax,%edi
  movslq %eax,%r10
  mov    %eax,%edx
  sar    $0x2,%edi
  add    %rbx,%r10
  and    $0x3,%edx
  movslq %edi,%rdi
  lea    0x0(,%rdi,4),%r8
  lea    (%rsi,%r8,1),%r9
  cmp    %rcx,%r10
  jb     L185
  mov    (%r9),%eax
  movzbl 0x0(%r13),%ecx
  cmp    $0x2,%edx
  je     L195
  cmp    $0x3,%edx
  je     L395
  cmp    $0x1,%edx
  je     L44
  mov    %ecx,%eax
  add    $0x1,%r13
  shl    $0x18,%eax
L44:
  movzbl 0x0(%r13),%ecx
  lea    0x1(%r13),%rdx
  shl    $0x10,%rcx
  or     %ecx,%eax
L24:
  lea    0x1(%rdx),%r13
  movzbl (%rdx),%edx
  shl    $0x8,%rdx
  or     %edx,%eax
L395:
  movzbl 0x0(%r13),%ecx
  lea    0x1(%rdi),%rdx
  lea    0x1(%r13),%r10
  or     %ecx,%eax
  mov    %eax,(%r9)
  mov    D16(%rip),%rax
  mov    (%rax),%rcx
  cmp    %rcx,%rdx
  jae    L121
  sub    %r8,%r13
  nopl   0x0(%rax)
L172:
  mov    -0x3(%r13,%rdx,4),%eax
  bswap  %eax
  mov    %eax,(%rsi,%rdx,4)
  add    $0x1,%rdx
  cmp    %rcx,%rdx
  jne    L172
  sub    $0x1,%rdx
  sub    %rdi,%rdx
  lea    (%r10,%rdx,4),%r13
L321:
  mov    $0x1,%edx
  mov    %r12,%rdi
  call   <sha256_block_host_order@plt>
  movslq 0x4(%r12),%rax
  mov    0x0(%rbp),%rcx
  movl   $0x0,0x4(%r12)
  add    %rbx,%rax
  sub    %rcx,%rax
  mov    %rax,%rbx
  cmp    %rax,%rcx
  jbe    L250
L394:
  test   %rbx,%rbx
  je     L34
  mov    %ebx,%esi
  jmp    L289
  nopl   0x0(%rax,%rax,1)
L21:
  movzbl -0x1(%rdx),%eax
  add    $0x2,%r13
  shl    $0x8,%eax
L84:
  movzbl -0x1(%r13),%esi
  lea    -0x1(%r13),%rdx
  shl    $0x10,%rsi
  or     %esi,%eax
L376:
  movzbl -0x1(%rdx),%edx
  shl    $0x18,%rdx
  or     %edx,%eax
  jmp    L1
  nopl   0x0(%rax)
L15:
  mov    $0x1,%eax
  ret
  xchg   %ax,%ax
L195:
  mov    %r13,%rdx
  jmp    L24
  nopl   0x0(%rax,%rax,1)
L250:
  mov    %rbx,%rax
  xor    %edx,%edx
  mov    %r13,%rsi
  mov    %r12,%rdi
  div    %rcx
  mov    %rax,%rdx
  mov    %rax,%r14
  call   <sha256_block_data_order@plt>
  mov    0x0(%rbp),%rax
  imul   %r14,%rax
  add    %rax,%r13
  sub    %rax,%rbx
  jmp    L394
  nopl   0x0(%rax)
L185:
  movslq %edx,%rcx
  add    %ebx,%eax
  add    %rbx,%rcx
  mov    %eax,0x4(%r12)
  cmp    $0x3,%rcx
  ja     L161
  mov    (%r9),%eax
  cmp    $0x1,%edx
  je     L220
  cmp    $0x2,%edx
  je     L362
  test   %edx,%edx
  je     L102
L389:
  mov    %eax,(%r9)
  jmp    L34
  nopl   0x0(%rax,%rax,1)
L300:
  mov    %rdx,%r13
  xor    %eax,%eax
  jmp    L84
  nopw   0x0(%rax,%rax,1)
L161:
  mov    %eax,%r10d
  and    $0x3,%eax
  sar    $0x2,%r10d
  movslq %r10d,%r10
  test   %edx,%edx
  je     L47
  mov    (%r9),%ebx
  cmp    $0x2,%edx
  je     L145
  cmp    $0x3,%edx
  je     L183
  cmp    $0x1,%edx
  je     L311
L47:
  movzbl 0x0(%r13),%ebx
  add    $0x1,%r13
  shl    $0x18,%ebx
L311:
  movzbl 0x0(%r13),%ecx
  lea    0x1(%r13),%rdx
  shl    $0x10,%rcx
  or     %ecx,%ebx
L275:
  lea    0x1(%rdx),%r13
  movzbl (%rdx),%edx
  shl    $0x8,%rdx
  or     %edx,%ebx
L183:
  movzbl 0x0(%r13),%edx
  lea    0x1(%rdi),%rcx
  lea    0x1(%r13),%r11
  or     %ebx,%edx
  mov    %edx,(%r9)
  cmp    %rcx,%r10
  jbe    L20
  sub    %r8,%r13
  nopl   0x0(%rax)
L101:
  mov    -0x3(%r13,%rcx,4),%edx
  bswap  %edx
  mov    %edx,(%rsi,%rcx,4)
  add    $0x1,%rcx
  cmp    %rcx,%r10
  jne    L101
  mov    %rcx,%rdx
  sub    %rdi,%rdx
  lea    -0x4(%r11,%rdx,4),%r11
L20:
  test   %eax,%eax
  je     L34
  movslq %eax,%rdx
  add    %rdx,%r11
  xor    %edx,%edx
  movzbl -0x1(%r11),%edi
  cmp    $0x2,%eax
  je     L57
  cmp    $0x3,%eax
  jne    L365
  movzbl %dil,%edx
  sub    $0x1,%r11
  shl    $0x8,%edx
L57:
  movzbl -0x1(%r11),%eax
  sub    $0x1,%r11
  shl    $0x10,%rax
  or     %eax,%edx
L365:
  movzbl -0x1(%r11),%eax
  shl    $0x18,%rax
  or     %eax,%edx
  mov    %edx,(%rsi,%rcx,4)
  jmp    L34
L121:
  mov    %r10,%r13
  jmp    L321
L102:
  movzbl 0x0(%r13),%eax
  shl    $0x18,%eax
  sub    $0x1,%rbx
  je     L389
  add    $0x1,%r13
L220:
  movzbl 0x0(%r13),%edx
  shl    $0x10,%rdx
  or     %edx,%eax
  cmp    $0x1,%rbx
  je     L389
  add    $0x1,%r13
L362:
  movzbl 0x0(%r13),%edx
  shl    $0x8,%rdx
  or     %edx,%eax
  jmp    L389
L145:
  mov    %r13,%rdx
  jmp    L275
```

assistant: ```c
int SHA256_Update(SHA256_CTX *c, const void *data_, size_t len) {
  const unsigned char *data = data_;
  register SHA_LONG *p;
  register SHA_LONG l;
  size_t sw, sc, ew, ec;
  if (len == 0)
    return 1;
  l = (c->Nl + (((SHA_LONG)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) >= SHA_CBLOCK) {
      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 < SHA_LBLOCK; sw++) {
        ({
          unsigned int r = *((const unsigned int *)(data));
          asm("bswapl %0" : "=r"(r) : "0"(r));
          (data) += 4;
          (l) = r;
        });
        p[sw] = l;
      }
      sha256_block_host_order(c, p, 1);
      len -= (SHA_CBLOCK - 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 / SHA_CBLOCK;
  if (sw > 0) {
    {
      sha256_block_data_order(c, data, sw);
      sw *= SHA_CBLOCK;
      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;
}
```