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

```asm
<sor>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  movapd %xmm0,%xmm6
  mov    %edi,%r12d
  mov    %esi,%ebp
  mov    %rdx,%rbx
  mov    %r8,0x8(%rsp)
  mulsd  %xmm1,%xmm1
  mulsd  %xmm2,%xmm2
  movsd  D14(%rip),%xmm3
  movapd %xmm3,%xmm0
  divsd  %xmm1,%xmm0
  divsd  %xmm2,%xmm3
  addsd  %xmm3,%xmm0
  addsd  %xmm0,%xmm0
  movapd %xmm6,%xmm7
  divsd  %xmm0,%xmm7
  pxor   %xmm0,%xmm0
  test   %edi,%edi
  jle    L8
  mov    %rcx,%r14
  mov    %rdx,%rcx
  lea    0x8(%r14),%r9
  lea    -0x1(%rdi),%r13d
  lea    0x8(%rdx,%r13,8),%r15
  lea    -0x1(%rsi),%r10d
  add    $0x2,%r10
  lea    0x0(,%r10,8),%r11
  movsd  D14(%rip),%xmm8
  jmp    L71
L118:
  mov    0x8(%rcx),%rdi
  lea    (%rdi,%rax,1),%rdx
  mov    0x10(%rcx),%r8
  mov    (%rcx),%rsi
  movsd  (%r8,%rax,1),%xmm4
  addsd  (%rsi,%rax,1),%xmm4
  divsd  %xmm1,%xmm4
  mov    %rax,%rsi
  add    $0x8,%rax
  movsd  -0x8(%rdi,%rsi,1),%xmm3
  movapd %xmm3,%xmm0
  addsd  (%rdi,%rax,1),%xmm0
  divsd  %xmm2,%xmm0
  addsd  %xmm4,%xmm0
  mov    (%r9),%rdi
  subsd  (%rdi,%rsi,1),%xmm0
  mulsd  %xmm7,%xmm0
  movapd %xmm5,%xmm3
  mulsd  (%rdx),%xmm3
  addsd  %xmm3,%xmm0
  movsd  %xmm0,(%rdx)
  cmp    %r11,%rax
  jne    L118
L43:
  add    $0x8,%rcx
  add    $0x8,%r9
  cmp    %r15,%rcx
  je     L79
L71:
  mov    $0x8,%eax
  test   %ebp,%ebp
  jle    L43
  movapd %xmm8,%xmm5
  subsd  %xmm6,%xmm5
  jmp    L118
L79:
  add    $0x2,%r13
  mov    $0x1,%r8d
  pxor   %xmm0,%xmm0
  jmp    L67
L58:
  mov    0x8(%rbx,%r8,8),%rdi
  mov    (%rbx,%r8,8),%rdx
  mov    -0x8(%rbx,%r8,8),%rsi
  mov    (%r14,%r8,8),%rcx
  mov    $0x1,%eax
L138:
  movsd  (%rdx,%rax,8),%xmm5
  addsd  %xmm5,%xmm5
  movsd  (%rdi,%rax,8),%xmm3
  subsd  %xmm5,%xmm3
  addsd  (%rsi,%rax,8),%xmm3
  divsd  %xmm1,%xmm3
  movsd  0x8(%rdx,%rax,8),%xmm4
  subsd  %xmm5,%xmm4
  addsd  -0x8(%rdx,%rax,8),%xmm4
  divsd  %xmm2,%xmm4
  addsd  %xmm4,%xmm3
  subsd  (%rcx,%rax,8),%xmm3
  mulsd  %xmm3,%xmm3
  addsd  %xmm3,%xmm0
  add    $0x1,%rax
  cmp    %r10,%rax
  jne    L138
L128:
  add    $0x1,%r8
  cmp    %r13,%r8
  je     L8
L67:
  test   %ebp,%ebp
  jg     L58
  jmp    L128
L8:
  mov    %r12d,%eax
  imul   %ebp,%eax
  pxor   %xmm1,%xmm1
  cvtsi2sd %eax,%xmm1
  divsd  %xmm1,%xmm0
  pxor   %xmm1,%xmm1
  ucomisd %xmm0,%xmm1
  ja     L154
  sqrtsd %xmm0,%xmm0
L59:
  mov    0x8(%rsp),%rax
  movsd  %xmm0,(%rax)
  test   %r12d,%r12d
  jle    L124
  movslq %ebp,%rcx
  shl    $0x3,%rcx
  lea    0x8(%rcx),%rdi
  lea    0x8(%rbx),%rax
  lea    -0x1(%r12),%edx
  lea    0x10(%rbx,%rdx,8),%rsi
L149:
  mov    (%rax),%rdx
  movsd  0x8(%rdx),%xmm0
  movsd  %xmm0,(%rdx)
  mov    (%rax),%rdx
  movsd  (%rdx,%rcx,1),%xmm0
  movsd  %xmm0,(%rdx,%rdi,1)
  add    $0x8,%rax
  cmp    %rsi,%rax
  jne    L149
L124:
  test   %ebp,%ebp
  jle    L99
  movslq %r12d,%rax
  shl    $0x3,%rax
  lea    (%rbx,%rax,1),%rdi
  lea    0x8(%rbx,%rax,1),%rsi
  lea    0x1(%rbp),%ecx
  shl    $0x3,%rcx
  mov    $0x8,%eax
L10:
  mov    0x8(%rbx),%rdx
  movsd  (%rdx,%rax,1),%xmm0
  mov    (%rbx),%rdx
  movsd  %xmm0,(%rdx,%rax,1)
  mov    (%rdi),%rdx
  movsd  (%rdx,%rax,1),%xmm0
  mov    (%rsi),%rdx
  movsd  %xmm0,(%rdx,%rax,1)
  add    $0x8,%rax
  cmp    %rcx,%rax
  jne    L10
L99:
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L154:
  call   <sqrt@plt>
  jmp    L59
```

tool_calls: name: unpack_data
arguments: data_tag: D14
type_guessed: f64

tool: D14: 1

assistant: ```c
void sor(double omg, double dx, double dy, int imax, int jmax, double **P, double **RS, double *res) {
  int i, j;
  double rloc;
  double coeff = omg / (2.0 * (1.0 / (dx * dx) + 1.0 / (dy * dy)));
  for (i = 1; i <= imax; i++) {
    for (j = 1; j <= jmax; j++) {
      P[i][j] = (1.0 - omg) * P[i][j] + coeff * ((P[i + 1][j] + P[i - 1][j]) / (dx * dx) + (P[i][j + 1] + P[i][j - 1]) / (dy * dy) - RS[i][j]);
    }
  }
  rloc = 0;
  for (i = 1; i <= imax; i++) {
    for (j = 1; j <= jmax; j++) {
      rloc += ((P[i + 1][j] - 2.0 * P[i][j] + P[i - 1][j]) / (dx * dx) + (P[i][j + 1] - 2.0 * P[i][j] + P[i][j - 1]) / (dy * dy) - RS[i][j]) * ((P[i + 1][j] - 2.0 * P[i][j] + P[i - 1][j]) / (dx * dx) + (P[i][j + 1] - 2.0 * P[i][j] + P[i][j - 1]) / (dy * dy) - RS[i][j]);
    }
  }
  rloc = rloc / (imax * jmax);
  rloc = sqrt(rloc);
  *res = rloc;
  for (i = 1; i <= imax; i++) {
    P[i][0] = P[i][1];
    P[i][jmax + 1] = P[i][jmax];
  }
  for (j = 1; j <= jmax; j++) {
    P[0][j] = P[1][j];
    P[imax + 1][j] = P[imax][j];
  }
}
```