user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<bn_mul_words>:
  endbr64
  mov    %rsi,%r8
  mov    %edx,%r9d
  mov    %rcx,%r10
  mov    $0x0,%ecx
  test   %edx,%edx
  jle    L15
  test   $0xfffffffc,%edx
  je     L60
L24:
  mov    %r10,%rax
  mulq   (%r8)
  add    %rax,%rcx
  adc    $0x0,%rdx
  mov    %rdx,%rsi
  mov    %rcx,(%rdi)
  mov    %r10,%rax
  mulq   0x8(%r8)
  add    %rax,%rsi
  adc    $0x0,%rdx
  mov    %rdx,%rcx
  mov    %rsi,0x8(%rdi)
  mov    %r10,%rax
  mulq   0x10(%r8)
  add    %rax,%rcx
  adc    $0x0,%rdx
  mov    %rdx,%rsi
  mov    %rcx,0x10(%rdi)
  mov    %r10,%rax
  mulq   0x18(%r8)
  add    %rax,%rsi
  adc    $0x0,%rdx
  mov    %rdx,%rcx
  mov    %rsi,0x18(%rdi)
  add    $0x20,%r8
  add    $0x20,%rdi
  sub    $0x4,%r9d
  test   $0xfffffffc,%r9d
  jne    L24
  test   %r9d,%r9d
  jne    L64
L15:
  mov    %rcx,%rax
  ret
L60:
  mov    $0x0,%ecx
L64:
  mov    %r10,%rax
  mulq   (%r8)
  add    %rax,%rcx
  adc    $0x0,%rdx
  mov    %rdx,%rsi
  mov    %rcx,(%rdi)
  mov    %rdx,%rcx
  cmp    $0x1,%r9d
  je     L15
  mov    %r10,%rax
  mulq   0x8(%r8)
  add    %rax,%rsi
  adc    $0x0,%rdx
  mov    %rdx,%r11
  mov    %rsi,0x8(%rdi)
  mov    %rdx,%rcx
  cmp    $0x2,%r9d
  je     L15
  mov    %r10,%rax
  mulq   0x10(%r8)
  add    %rax,%r11
  adc    $0x0,%rdx
  mov    %rdx,%rcx
  mov    %r11,0x10(%rdi)
  jmp    L15
```

assistant: ```c
unsigned long bn_mul_words(unsigned long *rp, unsigned long *ap, int num, unsigned long w) {
  unsigned long c1 = 0;
  if (num <= 0)
    return (c1);
  while (num & ~3) {
    do {
      register unsigned long high, low;
      asm("mulq %3" : "=a"(low), "=d"(high) : "a"(w), "g"(ap[0]) : "cc");
      asm("addq %2,%0; adcq %3,%1" : "+r"(c1), "+d"(high) : "a"(low), "g"(0) : "cc");
      (rp[0]) = c1, c1 = high;
    } while (0);
    do {
      register unsigned long high, low;
      asm("mulq %3" : "=a"(low), "=d"(high) : "a"(w), "g"(ap[1]) : "cc");
      asm("addq %2,%0; adcq %3,%1" : "+r"(c1), "+d"(high) : "a"(low), "g"(0) : "cc");
      (rp[1]) = c1, c1 = high;
    } while (0);
    do {
      register unsigned long high, low;
      asm("mulq %3" : "=a"(low), "=d"(high) : "a"(w), "g"(ap[2]) : "cc");
      asm("addq %2,%0; adcq %3,%1" : "+r"(c1), "+d"(high) : "a"(low), "g"(0) : "cc");
      (rp[2]) = c1, c1 = high;
    } while (0);
    do {
      register unsigned long high, low;
      asm("mulq %3" : "=a"(low), "=d"(high) : "a"(w), "g"(ap[3]) : "cc");
      asm("addq %2,%0; adcq %3,%1" : "+r"(c1), "+d"(high) : "a"(low), "g"(0) : "cc");
      (rp[3]) = c1, c1 = high;
    } while (0);
    ap += 4;
    rp += 4;
    num -= 4;
  }
  if (num) {
    do {
      register unsigned long high, low;
      asm("mulq %3" : "=a"(low), "=d"(high) : "a"(w), "g"(ap[0]) : "cc");
      asm("addq %2,%0; adcq %3,%1" : "+r"(c1), "+d"(high) : "a"(low), "g"(0) : "cc");
      (rp[0]) = c1, c1 = high;
    } while (0);
    if (--num == 0)
      return c1;
    do {
      register unsigned long high, low;
      asm("mulq %3" : "=a"(low), "=d"(high) : "a"(w), "g"(ap[1]) : "cc");
      asm("addq %2,%0; adcq %3,%1" : "+r"(c1), "+d"(high) : "a"(low), "g"(0) : "cc");
      (rp[1]) = c1, c1 = high;
    } while (0);
    if (--num == 0)
      return c1;
    do {
      register unsigned long high, low;
      asm("mulq %3" : "=a"(low), "=d"(high) : "a"(w), "g"(ap[2]) : "cc");
      asm("addq %2,%0; adcq %3,%1" : "+r"(c1), "+d"(high) : "a"(low), "g"(0) : "cc");
      (rp[2]) = c1, c1 = high;
    } while (0);
  }
  return (c1);
}
```