user: What is the c source code of the assembly code below:

```asm
<pcapack_sweep>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  mov    0x28(%rsp),%eax
  test   %edi,%edi
  je     L922
  test   %esi,%esi
  je     L922
  mov    %rdx,%r10
  mov    %r9d,%edx
  lea    -0x1(%r9),%r9d
  cmp    $0x1,%r9d
  ja     L53
  lea    -0x1(%rax),%r9d
  cmp    $0x3,%r9d
  ja     L875
  cmp    $0x1,%edx
  jne    L423
  cmp    %r8d,%edi
  jne    L423
  cmp    $0x1,%eax
  je     L963
  cmp    $0x2,%eax
  je     L57
  cmp    $0x3,%eax
  je     L933
  test   %esi,%esi
  jle    L922
  xor    %r11d,%r11d
  xor    %r9d,%r9d
  mov    %edi,%r8d
  nopw   0x0(%rax,%rax,1)
L313:
  test   %edi,%edi
  jle    L375
  movslq %r11d,%rax
  lea    (%r10,%rax,8),%rdx
  xor    %eax,%eax
  nopl   (%rax)
L109:
  movsd  (%rdx,%rax,8),%xmm0
  divsd  (%rcx,%rax,8),%xmm0
  movsd  %xmm0,(%rdx,%rax,8)
  add    $0x1,%rax
  cmp    %rax,%r8
  jne    L109
L375:
  add    $0x1,%r9d
  add    %edi,%r11d
  cmp    %r9d,%esi
  jne    L313
  nopl   0x0(%rax)
L922:
  xor    %eax,%eax
L193:
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  nopl   0x0(%rax)
L423:
  cmp    $0x2,%edx
  jne    L979
  cmp    %r8d,%esi
  jne    L979
  cmp    $0x1,%eax
  je     L176
  cmp    $0x2,%eax
  je     L121
  cmp    $0x3,%eax
  je     L1010
  test   %esi,%esi
  jle    L922
  lea    -0x1(%rsi),%eax
  lea    -0x1(%rdi),%r11d
  xor    %esi,%esi
  lea    0x8(%rcx,%rax,8),%r8
  lea    0x8(%r10),%r9
  nopl   0x0(%rax,%rax,1)
L732:
  movsd  (%rcx),%xmm1
  test   %edi,%edi
  jle    L957
  movslq %esi,%rdx
  lea    (%r10,%rdx,8),%rax
  add    %r11,%rdx
  lea    (%r9,%rdx,8),%rdx
  xchg   %ax,%ax
L755:
  movsd  (%rax),%xmm0
  add    $0x8,%rax
  divsd  %xmm1,%xmm0
  movsd  %xmm0,-0x8(%rax)
  cmp    %rax,%rdx
  jne    L755
L957:
  add    $0x8,%rcx
  add    %edi,%esi
  cmp    %rcx,%r8
  jne    L732
  jmp    L922
  cs nopw 0x0(%rax,%rax,1)
L979:
  cmp    $0x1,%eax
  je     L534
  cmp    $0x2,%eax
  je     L518
  cmp    $0x3,%eax
  je     L503
  cmp    $0x1,%edx
  je     L540
  xor    %ebp,%ebp
  lea    -0x1(%rdi),%r13d
  lea    0x8(%r10),%r12
  xor    %ebx,%ebx
  test   %esi,%esi
  jle    L922
  nopl   0x0(%rax,%rax,1)
L200:
  mov    %ebx,%eax
  cltd
  idiv   %r8d
  test   %edi,%edi
  jle    L693
  movslq %ebp,%rax
  lea    (%r10,%rax,8),%r9
  add    %r13,%rax
  lea    (%r12,%rax,8),%r11
  nopl   0x0(%rax,%rax,1)
L895:
  movslq %edx,%rax
  movsd  (%r9),%xmm0
  add    $0x8,%r9
  addsd  (%rcx,%rax,8),%xmm0
  lea    (%rsi,%rdx,1),%eax
  cltd
  idiv   %r8d
  movsd  %xmm0,-0x8(%r9)
  cmp    %r11,%r9
  jne    L895
L693:
  add    $0x1,%ebx
  add    %edi,%ebp
  cmp    %ebx,%esi
  jne    L200
  jmp    L922
L57:
  test   %esi,%esi
  jle    L922
  xor    %r11d,%r11d
  xor    %r9d,%r9d
  mov    %edi,%r8d
  nopw   0x0(%rax,%rax,1)
L994:
  test   %edi,%edi
  jle    L959
  movslq %r11d,%rax
  lea    (%r10,%rax,8),%rdx
  xor    %eax,%eax
  nopl   (%rax)
L943:
  movsd  (%rdx,%rax,8),%xmm0
  subsd  (%rcx,%rax,8),%xmm0
  movsd  %xmm0,(%rdx,%rax,8)
  add    $0x1,%rax
  cmp    %r8,%rax
  jne    L943
L959:
  add    $0x1,%r9d
  add    %edi,%r11d
  cmp    %r9d,%esi
  jne    L994
  jmp    L922
  nopl   0x0(%rax)
L963:
  test   %esi,%esi
  jle    L922
  xor    %r11d,%r11d
  xor    %r9d,%r9d
  mov    %edi,%r8d
  nopl   0x0(%rax)
L292:
  test   %edi,%edi
  jle    L274
  movslq %r11d,%rax
  lea    (%r10,%rax,8),%rdx
  xor    %eax,%eax
  nopl   (%rax)
L411:
  movsd  (%rdx,%rax,8),%xmm0
  addsd  (%rcx,%rax,8),%xmm0
  movsd  %xmm0,(%rdx,%rax,8)
  add    $0x1,%rax
  cmp    %r8,%rax
  jne    L411
L274:
  add    $0x1,%r9d
  add    %edi,%r11d
  cmp    %r9d,%esi
  jne    L292
  jmp    L922
L176:
  test   %esi,%esi
  jle    L922
  lea    -0x1(%rsi),%eax
  lea    -0x1(%rdi),%r11d
  xor    %esi,%esi
  lea    0x8(%rcx,%rax,8),%r8
  lea    0x8(%r10),%r9
  nopl   0x0(%rax,%rax,1)
L905:
  movsd  (%rcx),%xmm1
  test   %edi,%edi
  jle    L233
  movslq %esi,%rdx
  lea    (%r10,%rdx,8),%rax
  add    %r11,%rdx
  lea    (%r9,%rdx,8),%rdx
  xchg   %ax,%ax
L348:
  movsd  (%rax),%xmm0
  add    $0x8,%rax
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x8(%rax)
  cmp    %rax,%rdx
  jne    L348
L233:
  add    $0x8,%rcx
  add    %edi,%esi
  cmp    %rcx,%r8
  jne    L905
  jmp    L922
L534:
  cmp    $0x1,%edx
  je     L219
  xor    %ebp,%ebp
  lea    -0x1(%rdi),%r13d
  lea    0x8(%r10),%r12
  xor    %ebx,%ebx
  test   %esi,%esi
  jle    L922
  nopl   0x0(%rax,%rax,1)
L628:
  mov    %ebx,%eax
  cltd
  idiv   %r8d
  test   %edi,%edi
  jle    L143
  movslq %ebp,%rax
  lea    (%r10,%rax,8),%r9
  add    %r13,%rax
  lea    (%r12,%rax,8),%r11
L870:
  movslq %edx,%rax
  movsd  (%r9),%xmm0
  add    $0x8,%r9
  addsd  (%rcx,%rax,8),%xmm0
  lea    (%rsi,%rdx,1),%eax
  cltd
  idiv   %r8d
  movsd  %xmm0,-0x8(%r9)
  cmp    %r9,%r11
  jne    L870
L143:
  add    $0x1,%ebx
  add    %edi,%ebp
  cmp    %ebx,%esi
  jne    L628
  jmp    L922
L503:
  cmp    $0x1,%edx
  je     L225
  xor    %ebp,%ebp
  lea    -0x1(%rdi),%r13d
  lea    0x8(%r10),%r12
  xor    %ebx,%ebx
  test   %esi,%esi
  jle    L922
  xchg   %ax,%ax
L931:
  mov    %ebx,%eax
  cltd
  idiv   %r8d
  test   %edi,%edi
  jle    L877
  movslq %ebp,%rax
  lea    (%r10,%rax,8),%r9
  add    %r13,%rax
  lea    (%r12,%rax,8),%r11
  nopl   0x0(%rax,%rax,1)
L151:
  movslq %edx,%rax
  movsd  (%r9),%xmm0
  add    $0x8,%r9
  addsd  (%rcx,%rax,8),%xmm0
  lea    (%rsi,%rdx,1),%eax
  cltd
  idiv   %r8d
  movsd  %xmm0,-0x8(%r9)
  cmp    %r11,%r9
  jne    L151
L877:
  add    $0x1,%ebx
  add    %edi,%ebp
  cmp    %ebx,%esi
  jne    L931
  jmp    L922
L1010:
  test   %esi,%esi
  jle    L922
  lea    -0x1(%rsi),%eax
  lea    -0x1(%rdi),%r11d
  xor    %esi,%esi
  lea    0x8(%rcx,%rax,8),%r8
  lea    0x8(%r10),%r9
  nopl   0x0(%rax,%rax,1)
L415:
  movsd  (%rcx),%xmm1
  test   %edi,%edi
  jle    L941
  movslq %esi,%rdx
  lea    (%r10,%rdx,8),%rax
  add    %r11,%rdx
  lea    (%r9,%rdx,8),%rdx
  cs nopw 0x0(%rax,%rax,1)
L205:
  movsd  (%rax),%xmm0
  add    $0x8,%rax
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,-0x8(%rax)
  cmp    %rax,%rdx
  jne    L205
L941:
  add    $0x8,%rcx
  add    %edi,%esi
  cmp    %rcx,%r8
  jne    L415
  jmp    L922
L219:
  test   %esi,%esi
  jle    L922
  xor    %ebp,%ebp
  lea    -0x1(%rdi),%r13d
  lea    0x8(%r10),%r12
  xor    %ebx,%ebx
  nopw   0x0(%rax,%rax,1)
L420:
  test   %edi,%edi
  jle    L275
  movslq %ebp,%rax
  lea    (%r10,%rax,8),%r9
  add    %r13,%rax
  lea    (%r12,%rax,8),%r11
  nopw   0x0(%rax,%rax,1)
L428:
  movslq %edx,%rax
  movsd  (%r9),%xmm0
  add    $0x8,%r9
  addsd  (%rcx,%rax,8),%xmm0
  lea    0x1(%rdx),%eax
  cltd
  idiv   %r8d
  movsd  %xmm0,-0x8(%r9)
  cmp    %r9,%r11
  jne    L428
L275:
  add    $0x1,%ebx
  add    %edi,%ebp
  cmp    %ebx,%esi
  jne    L420
  jmp    L922
L933:
  test   %esi,%esi
  jle    L922
  xor    %r11d,%r11d
  xor    %r9d,%r9d
  mov    %edi,%r8d
  nopw   0x0(%rax,%rax,1)
L576:
  test   %edi,%edi
  jle    L944
  movslq %r11d,%rax
  lea    (%r10,%rax,8),%rdx
  xor    %eax,%eax
  nopl   (%rax)
L565:
  movsd  (%rdx,%rax,8),%xmm0
  mulsd  (%rcx,%rax,8),%xmm0
  movsd  %xmm0,(%rdx,%rax,8)
  add    $0x1,%rax
  cmp    %rax,%r8
  jne    L565
L944:
  add    $0x1,%r9d
  add    %edi,%r11d
  cmp    %r9d,%esi
  jne    L576
  jmp    L922
L518:
  cmp    $0x1,%edx
  je     L921
  xor    %ebp,%ebp
  lea    -0x1(%rdi),%r13d
  lea    0x8(%r10),%r12
  xor    %ebx,%ebx
  test   %esi,%esi
  jle    L922
  cs nopw 0x0(%rax,%rax,1)
L63:
  mov    %ebx,%eax
  cltd
  idiv   %r8d
  test   %edi,%edi
  jle    L742
  movslq %ebp,%rax
  lea    (%r10,%rax,8),%r9
  add    %r13,%rax
  lea    (%r12,%rax,8),%r11
  nopl   0x0(%rax,%rax,1)
L880:
  movslq %edx,%rax
  movsd  (%r9),%xmm0
  add    $0x8,%r9
  addsd  (%rcx,%rax,8),%xmm0
  lea    (%rsi,%rdx,1),%eax
  cltd
  idiv   %r8d
  movsd  %xmm0,-0x8(%r9)
  cmp    %r9,%r11
  jne    L880
L742:
  add    $0x1,%ebx
  add    %edi,%ebp
  cmp    %ebx,%esi
  jne    L63
  jmp    L922
L121:
  test   %esi,%esi
  jle    L922
  lea    -0x1(%rsi),%eax
  lea    -0x1(%rdi),%r11d
  xor    %esi,%esi
  lea    0x8(%rcx,%rax,8),%r8
  lea    0x8(%r10),%r9
  nopl   0x0(%rax,%rax,1)
L619:
  movsd  (%rcx),%xmm1
  test   %edi,%edi
  jle    L1007
  movslq %esi,%rdx
  lea    (%r10,%rdx,8),%rax
  add    %r11,%rdx
  lea    (%r9,%rdx,8),%rdx
  cs nopw 0x0(%rax,%rax,1)
L526:
  movsd  (%rax),%xmm0
  add    $0x8,%rax
  subsd  %xmm1,%xmm0
  movsd  %xmm0,-0x8(%rax)
  cmp    %rax,%rdx
  jne    L526
L1007:
  add    $0x8,%rcx
  add    %edi,%esi
  cmp    %rcx,%r8
  jne    L619
  jmp    L922
L540:
  test   %esi,%esi
  jle    L922
  xor    %ebp,%ebp
  lea    -0x1(%rdi),%r13d
  lea    0x8(%r10),%r12
  xor    %ebx,%ebx
  nopw   0x0(%rax,%rax,1)
L722:
  test   %edi,%edi
  jle    L643
  movslq %ebp,%rax
  lea    (%r10,%rax,8),%r9
  add    %r13,%rax
  lea    (%r12,%rax,8),%r11
  nopw   0x0(%rax,%rax,1)
L125:
  movslq %edx,%rax
  movsd  (%r9),%xmm0
  add    $0x8,%r9
  addsd  (%rcx,%rax,8),%xmm0
  lea    0x1(%rdx),%eax
  cltd
  idiv   %r8d
  movsd  %xmm0,-0x8(%r9)
  cmp    %r11,%r9
  jne    L125
L643:
  add    $0x1,%ebx
  add    %edi,%ebp
  cmp    %ebx,%esi
  jne    L722
  jmp    L922
L921:
  test   %esi,%esi
  jle    L922
  xor    %ebp,%ebp
  lea    -0x1(%rdi),%r13d
  lea    0x8(%r10),%r12
  xor    %ebx,%ebx
  nopl   (%rax)
L1:
  test   %edi,%edi
  jle    L701
  movslq %ebp,%rax
  lea    (%r10,%rax,8),%r9
  add    %r13,%rax
  lea    (%r12,%rax,8),%r11
  nopw   0x0(%rax,%rax,1)
L293:
  movslq %edx,%rax
  movsd  (%r9),%xmm0
  add    $0x8,%r9
  addsd  (%rcx,%rax,8),%xmm0
  lea    0x1(%rdx),%eax
  cltd
  idiv   %r8d
  movsd  %xmm0,-0x8(%r9)
  cmp    %r9,%r11
  jne    L293
L701:
  add    $0x1,%ebx
  add    %edi,%ebp
  cmp    %ebx,%esi
  jne    L1
  jmp    L922
L53:
  mov    $0xfffffffa,%eax
  jmp    L193
L225:
  test   %esi,%esi
  jle    L922
  xor    %ebp,%ebp
  lea    -0x1(%rdi),%r13d
  lea    0x8(%r10),%r12
  xor    %ebx,%ebx
L169:
  test   %edi,%edi
  jle    L856
  movslq %ebp,%rax
  lea    (%r10,%rax,8),%r9
  add    %r13,%rax
  lea    (%r12,%rax,8),%r11
  nopl   0x0(%rax)
L617:
  movslq %edx,%rax
  movsd  (%r9),%xmm0
  add    $0x8,%r9
  addsd  (%rcx,%rax,8),%xmm0
  lea    0x1(%rdx),%eax
  cltd
  idiv   %r8d
  movsd  %xmm0,-0x8(%r9)
  cmp    %r11,%r9
  jne    L617
L856:
  add    $0x1,%ebx
  add    %edi,%ebp
  cmp    %ebx,%esi
  jne    L169
  jmp    L922
L875:
  mov    $0xfffffff9,%eax
  jmp    L193
```

assistant: ```c
int pcapack_sweep(const int m, const int n, double *restrict x, double *restrict vec, const int lvec, const int margin, const int fun) {
  int i, j;
  int pos;
  double tmp;
  if (m == 0 || n == 0)
    return 0;
  if (margin != 1 && margin != 2)
    return -6;
  if (fun != 1 && fun != 2 && fun != 3 && fun != 4)
    return -7;
  if (margin == 1 && lvec == m) {
    if (fun == 1) {
      for (j = 0; j < n; j++) {
        for (i = 0; i < m; i++) {
          x[i + m * j] += vec[i];
        }
      };
    } else if (fun == 2) {
      for (j = 0; j < n; j++) {
        for (i = 0; i < m; i++) {
          x[i + m * j] -= vec[i];
        }
      };
    } else if (fun == 3) {
      for (j = 0; j < n; j++) {
        for (i = 0; i < m; i++) {
          x[i + m * j] *= vec[i];
        }
      };
    } else if (fun == 4) {
      for (j = 0; j < n; j++) {
        for (i = 0; i < m; i++) {
          x[i + m * j] /= vec[i];
        }
      };
    }
  } else if (margin == 2 && lvec == n) {
    if (fun == 1) {

#pragma omp parallel for default(shared) private(i, j, tmp) if (m * n > OMP_MIN_SIZE)
      for (j = 0; j < n; j++) {
        tmp = vec[j];
        for (i = 0; i < m; i++) {
          x[i + m * j] += tmp;
        }
      };
    } else if (fun == 2) {

#pragma omp parallel for default(shared) private(i, j, tmp) if (m * n > OMP_MIN_SIZE)
      for (j = 0; j < n; j++) {
        tmp = vec[j];
        for (i = 0; i < m; i++) {
          x[i + m * j] -= tmp;
        }
      };
    } else if (fun == 3) {

#pragma omp parallel for default(shared) private(i, j, tmp) if (m * n > OMP_MIN_SIZE)
      for (j = 0; j < n; j++) {
        tmp = vec[j];
        for (i = 0; i < m; i++) {
          x[i + m * j] *= tmp;
        }
      };
    }
    if (fun == 4) {

#pragma omp parallel for default(shared) private(i, j, tmp) if (m * n > OMP_MIN_SIZE)
      for (j = 0; j < n; j++) {
        tmp = vec[j];
        for (i = 0; i < m; i++) {
          x[i + m * j] /= tmp;
        }
      };
    }
  } else {
    if (fun == 1) {
      if (margin == 1) {
        pos = 1;
        for (j = 0; j < n; j++) {
          for (i = 0; i < m; i++) {
            x[i + m * j] += vec[pos];
            pos = (pos + 1) % lvec;
          }
        };
      } else if (margin == 2) {

#pragma omp parallel for default(shared) private(i, j, tmp) if (m * n > OMP_MIN_SIZE)
        for (j = 0; j < n; j++) {
          pos = j % lvec;
          for (i = 0; i < m; i++) {
            x[i + m * j] += vec[pos];
            pos = (pos + n) % lvec;
          }
        };
      }
    } else if (fun == 2) {
      if (margin == 1) {
        pos = 1;
        for (j = 0; j < n; j++) {
          for (i = 0; i < m; i++) {
            x[i + m * j] += vec[pos];
            pos = (pos + 1) % lvec;
          }
        };
      } else if (margin == 2) {

#pragma omp parallel for default(shared) private(i, j, tmp) if (m * n > OMP_MIN_SIZE)
        for (j = 0; j < n; j++) {
          pos = j % lvec;
          for (i = 0; i < m; i++) {
            x[i + m * j] += vec[pos];
            pos = (pos + n) % lvec;
          }
        };
      }
    } else if (fun == 3) {
      if (margin == 1) {
        pos = 1;
        for (j = 0; j < n; j++) {
          for (i = 0; i < m; i++) {
            x[i + m * j] += vec[pos];
            pos = (pos + 1) % lvec;
          }
        };
      } else if (margin == 2) {

#pragma omp parallel for default(shared) private(i, j, tmp) if (m * n > OMP_MIN_SIZE)
        for (j = 0; j < n; j++) {
          pos = j % lvec;
          for (i = 0; i < m; i++) {
            x[i + m * j] += vec[pos];
            pos = (pos + n) % lvec;
          }
        };
      }
    } else if (fun == 4) {
      if (margin == 1) {
        pos = 1;
        for (j = 0; j < n; j++) {
          for (i = 0; i < m; i++) {
            x[i + m * j] += vec[pos];
            pos = (pos + 1) % lvec;
          }
        };
      } else if (margin == 2) {

#pragma omp parallel for default(shared) private(i, j, tmp) if (m * n > OMP_MIN_SIZE)
        for (j = 0; j < n; j++) {
          pos = j % lvec;
          for (i = 0; i < m; i++) {
            x[i + m * j] += vec[pos];
            pos = (pos + n) % lvec;
          }
        };
      }
    }
  }
  return 0;
}
```