user: Converte this assembly snippet into its equivalent C code:

```asm
<pcapack_sweep>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %edi,-0x24(%rbp)
  mov    %esi,-0x28(%rbp)
  mov    %rdx,-0x30(%rbp)
  mov    %rcx,-0x38(%rbp)
  mov    %r8d,-0x3c(%rbp)
  mov    %r9d,-0x40(%rbp)
  cmpl   $0x0,-0x24(%rbp)
  je     L308
  cmpl   $0x0,-0x28(%rbp)
  jne    L957
L308:
  mov    $0x0,%eax
  jmp    L289
L957:
  cmpl   $0x1,-0x40(%rbp)
  je     L934
  cmpl   $0x2,-0x40(%rbp)
  je     L934
  mov    $0xfffffffa,%eax
  jmp    L289
L934:
  cmpl   $0x1,0x10(%rbp)
  je     L340
  cmpl   $0x2,0x10(%rbp)
  je     L340
  cmpl   $0x3,0x10(%rbp)
  je     L340
  cmpl   $0x4,0x10(%rbp)
  je     L340
  mov    $0xfffffff9,%eax
  jmp    L289
L340:
  cmpl   $0x1,-0x40(%rbp)
  jne    L223
  mov    -0x3c(%rbp),%eax
  cmp    -0x24(%rbp),%eax
  jne    L223
  cmpl   $0x1,0x10(%rbp)
  jne    L530
  movl   $0x0,-0x10(%rbp)
  jmp    L540
L250:
  movl   $0x0,-0x14(%rbp)
  jmp    L118
L66:
  mov    -0x24(%rbp),%eax
  imul   -0x10(%rbp),%eax
  mov    %eax,%edx
  mov    -0x14(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mov    -0x24(%rbp),%eax
  imul   -0x10(%rbp),%eax
  mov    %eax,%edx
  mov    -0x14(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  addsd  %xmm1,%xmm0
  movsd  %xmm0,(%rax)
  addl   $0x1,-0x14(%rbp)
L118:
  mov    -0x14(%rbp),%eax
  cmp    -0x24(%rbp),%eax
  jl     L66
  addl   $0x1,-0x10(%rbp)
L540:
  mov    -0x10(%rbp),%eax
  cmp    -0x28(%rbp),%eax
  jl     L250
  jmp    L643
L530:
  cmpl   $0x2,0x10(%rbp)
  jne    L603
  movl   $0x0,-0x10(%rbp)
  jmp    L750
L358:
  movl   $0x0,-0x14(%rbp)
  jmp    L70
L102:
  mov    -0x24(%rbp),%eax
  imul   -0x10(%rbp),%eax
  mov    %eax,%edx
  mov    -0x14(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  mov    -0x24(%rbp),%eax
  imul   -0x10(%rbp),%eax
  mov    %eax,%edx
  mov    -0x14(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  subsd  %xmm1,%xmm0
  movsd  %xmm0,(%rax)
  addl   $0x1,-0x14(%rbp)
L70:
  mov    -0x14(%rbp),%eax
  cmp    -0x24(%rbp),%eax
  jl     L102
  addl   $0x1,-0x10(%rbp)
L750:
  mov    -0x10(%rbp),%eax
  cmp    -0x28(%rbp),%eax
  jl     L358
  jmp    L643
L603:
  cmpl   $0x3,0x10(%rbp)
  jne    L828
  movl   $0x0,-0x10(%rbp)
  jmp    L749
L287:
  movl   $0x0,-0x14(%rbp)
  jmp    L1050
L239:
  mov    -0x24(%rbp),%eax
  imul   -0x10(%rbp),%eax
  mov    %eax,%edx
  mov    -0x14(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mov    -0x24(%rbp),%eax
  imul   -0x10(%rbp),%eax
  mov    %eax,%edx
  mov    -0x14(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,(%rax)
  addl   $0x1,-0x14(%rbp)
L1050:
  mov    -0x14(%rbp),%eax
  cmp    -0x24(%rbp),%eax
  jl     L239
  addl   $0x1,-0x10(%rbp)
L749:
  mov    -0x10(%rbp),%eax
  cmp    -0x28(%rbp),%eax
  jl     L287
  jmp    L643
L828:
  cmpl   $0x4,0x10(%rbp)
  jne    L643
  movl   $0x0,-0x10(%rbp)
  jmp    L469
L546:
  movl   $0x0,-0x14(%rbp)
  jmp    L748
L619:
  mov    -0x24(%rbp),%eax
  imul   -0x10(%rbp),%eax
  mov    %eax,%edx
  mov    -0x14(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mov    -0x14(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  mov    -0x24(%rbp),%eax
  imul   -0x10(%rbp),%eax
  mov    %eax,%edx
  mov    -0x14(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  divsd  %xmm1,%xmm0
  movsd  %xmm0,(%rax)
  addl   $0x1,-0x14(%rbp)
L748:
  mov    -0x14(%rbp),%eax
  cmp    -0x24(%rbp),%eax
  jl     L619
  addl   $0x1,-0x10(%rbp)
L469:
  mov    -0x10(%rbp),%eax
  cmp    -0x28(%rbp),%eax
  jl     L546
  jmp    L643
L223:
  cmpl   $0x2,-0x40(%rbp)
  jne    L461
  mov    -0x3c(%rbp),%eax
  cmp    -0x28(%rbp),%eax
  jne    L461
  cmpl   $0x1,0x10(%rbp)
  jne    L632
  movl   $0x0,-0x10(%rbp)
  jmp    L813
L306:
  mov    -0x10(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  movsd  %xmm0,-0x8(%rbp)
  movl   $0x0,-0x14(%rbp)
  jmp    L198
L564:
  mov    -0x24(%rbp),%eax
  imul   -0x10(%rbp),%eax
  mov    %eax,%edx
  mov    -0x14(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mov    -0x24(%rbp),%eax
  imul   -0x10(%rbp),%eax
  mov    %eax,%edx
  mov    -0x14(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  addsd  -0x8(%rbp),%xmm0
  movsd  %xmm0,(%rax)
  addl   $0x1,-0x14(%rbp)
L198:
  mov    -0x14(%rbp),%eax
  cmp    -0x24(%rbp),%eax
  jl     L564
  addl   $0x1,-0x10(%rbp)
L813:
  mov    -0x10(%rbp),%eax
  cmp    -0x28(%rbp),%eax
  jl     L306
  jmp    L893
L632:
  cmpl   $0x2,0x10(%rbp)
  jne    L490
  movl   $0x0,-0x10(%rbp)
  jmp    L357
L278:
  mov    -0x10(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  movsd  %xmm0,-0x8(%rbp)
  movl   $0x0,-0x14(%rbp)
  jmp    L233
L958:
  mov    -0x24(%rbp),%eax
  imul   -0x10(%rbp),%eax
  mov    %eax,%edx
  mov    -0x14(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mov    -0x24(%rbp),%eax
  imul   -0x10(%rbp),%eax
  mov    %eax,%edx
  mov    -0x14(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  subsd  -0x8(%rbp),%xmm0
  movsd  %xmm0,(%rax)
  addl   $0x1,-0x14(%rbp)
L233:
  mov    -0x14(%rbp),%eax
  cmp    -0x24(%rbp),%eax
  jl     L958
  addl   $0x1,-0x10(%rbp)
L357:
  mov    -0x10(%rbp),%eax
  cmp    -0x28(%rbp),%eax
  jl     L278
  jmp    L893
L490:
  cmpl   $0x3,0x10(%rbp)
  jne    L893
  movl   $0x0,-0x10(%rbp)
  jmp    L460
L401:
  mov    -0x10(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  movsd  %xmm0,-0x8(%rbp)
  movl   $0x0,-0x14(%rbp)
  jmp    L332
L351:
  mov    -0x24(%rbp),%eax
  imul   -0x10(%rbp),%eax
  mov    %eax,%edx
  mov    -0x14(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mov    -0x24(%rbp),%eax
  imul   -0x10(%rbp),%eax
  mov    %eax,%edx
  mov    -0x14(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  mulsd  -0x8(%rbp),%xmm0
  movsd  %xmm0,(%rax)
  addl   $0x1,-0x14(%rbp)
L332:
  mov    -0x14(%rbp),%eax
  cmp    -0x24(%rbp),%eax
  jl     L351
  addl   $0x1,-0x10(%rbp)
L460:
  mov    -0x10(%rbp),%eax
  cmp    -0x28(%rbp),%eax
  jl     L401
L893:
  cmpl   $0x4,0x10(%rbp)
  jne    L497
  movl   $0x0,-0x10(%rbp)
  jmp    L539
L576:
  mov    -0x10(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  movsd  %xmm0,-0x8(%rbp)
  movl   $0x0,-0x14(%rbp)
  jmp    L6
L606:
  mov    -0x24(%rbp),%eax
  imul   -0x10(%rbp),%eax
  mov    %eax,%edx
  mov    -0x14(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mov    -0x24(%rbp),%eax
  imul   -0x10(%rbp),%eax
  mov    %eax,%edx
  mov    -0x14(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  divsd  -0x8(%rbp),%xmm0
  movsd  %xmm0,(%rax)
  addl   $0x1,-0x14(%rbp)
L6:
  mov    -0x14(%rbp),%eax
  cmp    -0x24(%rbp),%eax
  jl     L606
  addl   $0x1,-0x10(%rbp)
L539:
  mov    -0x10(%rbp),%eax
  cmp    -0x28(%rbp),%eax
  jl     L576
  jmp    L497
L461:
  cmpl   $0x1,0x10(%rbp)
  jne    L184
  cmpl   $0x1,-0x40(%rbp)
  jne    L258
  movl   $0x1,-0xc(%rbp)
  movl   $0x0,-0x10(%rbp)
  jmp    L962
L451:
  movl   $0x0,-0x14(%rbp)
  jmp    L44
L218:
  mov    -0x24(%rbp),%eax
  imul   -0x10(%rbp),%eax
  mov    %eax,%edx
  mov    -0x14(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  mov    -0xc(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mov    -0x24(%rbp),%eax
  imul   -0x10(%rbp),%eax
  mov    %eax,%edx
  mov    -0x14(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  addsd  %xmm1,%xmm0
  movsd  %xmm0,(%rax)
  mov    -0xc(%rbp),%eax
  add    $0x1,%eax
  cltd
  idivl  -0x3c(%rbp)
  mov    %edx,-0xc(%rbp)
  addl   $0x1,-0x14(%rbp)
L44:
  mov    -0x14(%rbp),%eax
  cmp    -0x24(%rbp),%eax
  jl     L218
  addl   $0x1,-0x10(%rbp)
L962:
  mov    -0x10(%rbp),%eax
  cmp    -0x28(%rbp),%eax
  jl     L451
  jmp    L497
L258:
  cmpl   $0x2,-0x40(%rbp)
  jne    L497
  movl   $0x0,-0x10(%rbp)
  jmp    L269
L723:
  mov    -0x10(%rbp),%eax
  cltd
  idivl  -0x3c(%rbp)
  mov    %edx,-0xc(%rbp)
  movl   $0x0,-0x14(%rbp)
  jmp    L1006
L826:
  mov    -0x24(%rbp),%eax
  imul   -0x10(%rbp),%eax
  mov    %eax,%edx
  mov    -0x14(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  mov    -0xc(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mov    -0x24(%rbp),%eax
  imul   -0x10(%rbp),%eax
  mov    %eax,%edx
  mov    -0x14(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  addsd  %xmm1,%xmm0
  movsd  %xmm0,(%rax)
  mov    -0xc(%rbp),%edx
  mov    -0x28(%rbp),%eax
  add    %edx,%eax
  cltd
  idivl  -0x3c(%rbp)
  mov    %edx,-0xc(%rbp)
  addl   $0x1,-0x14(%rbp)
L1006:
  mov    -0x14(%rbp),%eax
  cmp    -0x24(%rbp),%eax
  jl     L826
  addl   $0x1,-0x10(%rbp)
L269:
  mov    -0x10(%rbp),%eax
  cmp    -0x28(%rbp),%eax
  jl     L723
  jmp    L497
L184:
  cmpl   $0x2,0x10(%rbp)
  jne    L186
  cmpl   $0x1,-0x40(%rbp)
  jne    L262
  movl   $0x1,-0xc(%rbp)
  movl   $0x0,-0x10(%rbp)
  jmp    L364
L519:
  movl   $0x0,-0x14(%rbp)
  jmp    L588
L883:
  mov    -0x24(%rbp),%eax
  imul   -0x10(%rbp),%eax
  mov    %eax,%edx
  mov    -0x14(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  mov    -0xc(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mov    -0x24(%rbp),%eax
  imul   -0x10(%rbp),%eax
  mov    %eax,%edx
  mov    -0x14(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  addsd  %xmm1,%xmm0
  movsd  %xmm0,(%rax)
  mov    -0xc(%rbp),%eax
  add    $0x1,%eax
  cltd
  idivl  -0x3c(%rbp)
  mov    %edx,-0xc(%rbp)
  addl   $0x1,-0x14(%rbp)
L588:
  mov    -0x14(%rbp),%eax
  cmp    -0x24(%rbp),%eax
  jl     L883
  addl   $0x1,-0x10(%rbp)
L364:
  mov    -0x10(%rbp),%eax
  cmp    -0x28(%rbp),%eax
  jl     L519
  jmp    L497
L262:
  cmpl   $0x2,-0x40(%rbp)
  jne    L497
  movl   $0x0,-0x10(%rbp)
  jmp    L436
L869:
  mov    -0x10(%rbp),%eax
  cltd
  idivl  -0x3c(%rbp)
  mov    %edx,-0xc(%rbp)
  movl   $0x0,-0x14(%rbp)
  jmp    L696
L314:
  mov    -0x24(%rbp),%eax
  imul   -0x10(%rbp),%eax
  mov    %eax,%edx
  mov    -0x14(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  mov    -0xc(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mov    -0x24(%rbp),%eax
  imul   -0x10(%rbp),%eax
  mov    %eax,%edx
  mov    -0x14(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  addsd  %xmm1,%xmm0
  movsd  %xmm0,(%rax)
  mov    -0xc(%rbp),%edx
  mov    -0x28(%rbp),%eax
  add    %edx,%eax
  cltd
  idivl  -0x3c(%rbp)
  mov    %edx,-0xc(%rbp)
  addl   $0x1,-0x14(%rbp)
L696:
  mov    -0x14(%rbp),%eax
  cmp    -0x24(%rbp),%eax
  jl     L314
  addl   $0x1,-0x10(%rbp)
L436:
  mov    -0x10(%rbp),%eax
  cmp    -0x28(%rbp),%eax
  jl     L869
  jmp    L497
L186:
  cmpl   $0x3,0x10(%rbp)
  jne    L148
  cmpl   $0x1,-0x40(%rbp)
  jne    L907
  movl   $0x1,-0xc(%rbp)
  movl   $0x0,-0x10(%rbp)
  jmp    L163
L729:
  movl   $0x0,-0x14(%rbp)
  jmp    L994
L900:
  mov    -0x24(%rbp),%eax
  imul   -0x10(%rbp),%eax
  mov    %eax,%edx
  mov    -0x14(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  mov    -0xc(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mov    -0x24(%rbp),%eax
  imul   -0x10(%rbp),%eax
  mov    %eax,%edx
  mov    -0x14(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  addsd  %xmm1,%xmm0
  movsd  %xmm0,(%rax)
  mov    -0xc(%rbp),%eax
  add    $0x1,%eax
  cltd
  idivl  -0x3c(%rbp)
  mov    %edx,-0xc(%rbp)
  addl   $0x1,-0x14(%rbp)
L994:
  mov    -0x14(%rbp),%eax
  cmp    -0x24(%rbp),%eax
  jl     L900
  addl   $0x1,-0x10(%rbp)
L163:
  mov    -0x10(%rbp),%eax
  cmp    -0x28(%rbp),%eax
  jl     L729
  jmp    L497
L907:
  cmpl   $0x2,-0x40(%rbp)
  jne    L497
  movl   $0x0,-0x10(%rbp)
  jmp    L214
L146:
  mov    -0x10(%rbp),%eax
  cltd
  idivl  -0x3c(%rbp)
  mov    %edx,-0xc(%rbp)
  movl   $0x0,-0x14(%rbp)
  jmp    L612
L405:
  mov    -0x24(%rbp),%eax
  imul   -0x10(%rbp),%eax
  mov    %eax,%edx
  mov    -0x14(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  mov    -0xc(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mov    -0x24(%rbp),%eax
  imul   -0x10(%rbp),%eax
  mov    %eax,%edx
  mov    -0x14(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  addsd  %xmm1,%xmm0
  movsd  %xmm0,(%rax)
  mov    -0xc(%rbp),%edx
  mov    -0x28(%rbp),%eax
  add    %edx,%eax
  cltd
  idivl  -0x3c(%rbp)
  mov    %edx,-0xc(%rbp)
  addl   $0x1,-0x14(%rbp)
L612:
  mov    -0x14(%rbp),%eax
  cmp    -0x24(%rbp),%eax
  jl     L405
  addl   $0x1,-0x10(%rbp)
L214:
  mov    -0x10(%rbp),%eax
  cmp    -0x28(%rbp),%eax
  jl     L146
  jmp    L497
L148:
  cmpl   $0x4,0x10(%rbp)
  jne    L497
  cmpl   $0x1,-0x40(%rbp)
  jne    L819
  movl   $0x1,-0xc(%rbp)
  movl   $0x0,-0x10(%rbp)
  jmp    L730
L702:
  movl   $0x0,-0x14(%rbp)
  jmp    L838
L827:
  mov    -0x24(%rbp),%eax
  imul   -0x10(%rbp),%eax
  mov    %eax,%edx
  mov    -0x14(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  mov    -0xc(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mov    -0x24(%rbp),%eax
  imul   -0x10(%rbp),%eax
  mov    %eax,%edx
  mov    -0x14(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  addsd  %xmm1,%xmm0
  movsd  %xmm0,(%rax)
  mov    -0xc(%rbp),%eax
  add    $0x1,%eax
  cltd
  idivl  -0x3c(%rbp)
  mov    %edx,-0xc(%rbp)
  addl   $0x1,-0x14(%rbp)
L838:
  mov    -0x14(%rbp),%eax
  cmp    -0x24(%rbp),%eax
  jl     L827
  addl   $0x1,-0x10(%rbp)
L730:
  mov    -0x10(%rbp),%eax
  cmp    -0x28(%rbp),%eax
  jl     L702
  jmp    L497
L819:
  cmpl   $0x2,-0x40(%rbp)
  jne    L497
  movl   $0x0,-0x10(%rbp)
  jmp    L271
L485:
  mov    -0x10(%rbp),%eax
  cltd
  idivl  -0x3c(%rbp)
  mov    %edx,-0xc(%rbp)
  movl   $0x0,-0x14(%rbp)
  jmp    L924
L318:
  mov    -0x24(%rbp),%eax
  imul   -0x10(%rbp),%eax
  mov    %eax,%edx
  mov    -0x14(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  mov    -0xc(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mov    -0x24(%rbp),%eax
  imul   -0x10(%rbp),%eax
  mov    %eax,%edx
  mov    -0x14(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x30(%rbp),%rax
  add    %rdx,%rax
  addsd  %xmm1,%xmm0
  movsd  %xmm0,(%rax)
  mov    -0xc(%rbp),%edx
  mov    -0x28(%rbp),%eax
  add    %edx,%eax
  cltd
  idivl  -0x3c(%rbp)
  mov    %edx,-0xc(%rbp)
  addl   $0x1,-0x14(%rbp)
L924:
  mov    -0x14(%rbp),%eax
  cmp    -0x24(%rbp),%eax
  jl     L318
  addl   $0x1,-0x10(%rbp)
L271:
  mov    -0x10(%rbp),%eax
  cmp    -0x28(%rbp),%eax
  jl     L485
  jmp    L497
L643:
  nop
L497:
  mov    $0x0,%eax
L289:
  pop    %rbp
  ret
```

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