user: Please show me the C implementation that matches the assembly code listed below:

```asm
<poisson>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x88,%rsp
  mov    %rdi,0x30(%rsp)
  mov    %rsi,%r15
  mov    %rdx,0x38(%rsp)
  mov    %ecx,0x58(%rsp)
  mov    %r8d,0x28(%rsp)
  movsd  %xmm2,0x78(%rsp)
  mov    %r9d,0x5c(%rsp)
  movsd  %xmm3,0x10(%rsp)
  mov    0xc0(%rsp),%r14
  mulsd  %xmm0,%xmm0
  movsd  D59(%rip),%xmm2
  movapd %xmm2,%xmm7
  divsd  %xmm0,%xmm7
  movsd  %xmm7,(%rsp)
  mulsd  %xmm1,%xmm1
  movapd %xmm2,%xmm5
  divsd  %xmm1,%xmm5
  movsd  %xmm5,0x8(%rsp)
  xorpd  D39(%rip),%xmm3
  movsd  %xmm3,0x60(%rsp)
  addsd  %xmm5,%xmm7
  movapd %xmm7,%xmm0
  addsd  %xmm7,%xmm0
  divsd  %xmm0,%xmm3
  movsd  %xmm3,0x18(%rsp)
  test   %ecx,%ecx
  jle    L13
  mov    %rdi,%rbx
  mov    %r8d,%eax
  lea    0x1(%rcx),%r8d
  mov    $0x1,%edi
  pxor   %xmm1,%xmm1
  lea    0x1(%rax),%ecx
  mov    %rbx,%r9
  mov    %rdx,%r11
  mov    %eax,%r10d
  jmp    L250
L308:
  add    $0x1,%rax
  cmp    %rcx,%rax
  je     L94
L143:
  testb  $0x10,(%rdx,%rax,1)
  je     L308
  mov    (%r9,%rdi,8),%rsi
  movsd  (%rsi,%rax,8),%xmm0
  mulsd  %xmm0,%xmm0
  addsd  %xmm0,%xmm1
  jmp    L308
L94:
  add    $0x1,%rdi
  cmp    %r8,%rdi
  je     L100
L250:
  test   %r10d,%r10d
  jle    L94
  mov    (%r11,%rdi,8),%rdx
  mov    $0x1,%eax
  jmp    L143
L13:
  pxor   %xmm1,%xmm1
L100:
  pxor   %xmm7,%xmm7
  cvtsi2sdl 0xc8(%rsp),%xmm7
  movsd  %xmm7,0x68(%rsp)
  divsd  %xmm7,%xmm1
  movapd %xmm1,%xmm0
  pxor   %xmm1,%xmm1
  ucomisd %xmm0,%xmm1
  ja     L315
  sqrtsd %xmm0,%xmm0
  movsd  %xmm0,0x50(%rsp)
L62:
  movsd  D4(%rip),%xmm0
  comisd 0x50(%rsp),%xmm0
  jbe    L81
  movsd  D59(%rip),%xmm7
  movsd  %xmm7,0x50(%rsp)
L81:
  cmpl   $0x0,0x5c(%rsp)
  jle    L388
  mov    0x58(%rsp),%eax
  lea    -0x1(%rax),%eax
  mov    %rax,0x40(%rsp)
  mov    0x30(%rsp),%rbx
  lea    0x8(%rbx,%rax,8),%rax
  mov    %rax,0x70(%rsp)
  movl   $0x0,0x2c(%rsp)
  jmp    L325
L315:
  call   <sqrt@plt>
  movsd  %xmm0,0x50(%rsp)
  jmp    L62
L165:
  mov    0x8(%rdi),%r11
  lea    (%r11,%rdx,1),%r10
  movapd %xmm2,%xmm1
  subsd  0x10(%rsp),%xmm1
  mulsd  (%r10),%xmm1
  mov    0x10(%rdi),%rbp
  mov    (%rdi),%rbx
  movsd  0x0(%rbp,%rdx,1),%xmm0
  addsd  (%rbx,%rdx,1),%xmm0
  mulsd  (%rsp),%xmm0
  movsd  0x8(%r11,%rdx,1),%xmm6
  addsd  -0x8(%r11,%rdx,1),%xmm6
  mulsd  0x8(%rsp),%xmm6
  addsd  %xmm6,%xmm0
  mov    (%r15,%rcx,8),%r11
  subsd  (%r11,%rdx,1),%xmm0
  mulsd  0x18(%rsp),%xmm0
  subsd  %xmm0,%xmm1
  movsd  %xmm1,(%r10)
L226:
  add    $0x8,%rdx
  add    $0x1,%rax
  cmp    %r8,%rax
  je     L25
L269:
  lea    (%rax,%rcx,1),%r10d
  mov    %r10d,%r11d
  shr    $0x1f,%r11d
  add    %r11d,%r10d
  and    $0x1,%r10d
  sub    %r11d,%r10d
  cmp    %r9d,%r10d
  jne    L226
  mov    0x8(%rsi),%r10
  movzbl (%r10,%rax,1),%r11d
  cmp    $0x1f,%r11b
  je     L165
  test   $0x10,%r11b
  je     L226
  mov    0x10(%rsi),%r11
  movzbl (%r11,%rax,1),%r13d
  mov    (%rsi),%r11
  movzbl (%r11,%rax,1),%r12d
  movzbl 0x1(%r10,%rax,1),%ebp
  movzbl -0x1(%r10,%rax,1),%ebx
  mov    %r13d,%r10d
  shr    $0x4,%r10d
  and    $0x1,%r10d
  mov    %r12d,%r11d
  shr    $0x4,%r11d
  and    $0x1,%r11d
  add    %r11d,%r10d
  pxor   %xmm0,%xmm0
  cvtsi2sd %r10d,%xmm0
  mulsd  (%rsp),%xmm0
  mov    %ebp,%r10d
  shr    $0x4,%r10d
  and    $0x1,%r10d
  mov    %ebx,%r11d
  shr    $0x4,%r11d
  and    $0x1,%r11d
  add    %r11d,%r10d
  pxor   %xmm1,%xmm1
  cvtsi2sd %r10d,%xmm1
  mulsd  0x8(%rsp),%xmm1
  addsd  %xmm1,%xmm0
  movapd %xmm10,%xmm8
  divsd  %xmm0,%xmm8
  mov    %rdi,%r14
  mov    0x8(%rdi),%r10
  lea    (%r10,%rdx,1),%r11
  movsd  D59(%rip),%xmm3
  subsd  0x10(%rsp),%xmm3
  mulsd  (%r11),%xmm3
  movsd  D59(%rip),%xmm1
  test   $0x10,%r13b
  jne    L40
  pxor   %xmm1,%xmm1
L40:
  mov    0x10(%r14),%r13
  mulsd  0x0(%r13,%rdx,1),%xmm1
  movapd %xmm7,%xmm0
  test   $0x10,%r12b
  jne    L363
  pxor   %xmm0,%xmm0
L363:
  mov    (%r14),%r12
  mulsd  (%r12,%rdx,1),%xmm0
  addsd  %xmm1,%xmm0
  movapd %xmm0,%xmm6
  mulsd  (%rsp),%xmm6
  movapd %xmm5,%xmm9
  test   $0x10,%bpl
  jne    L266
  pxor   %xmm9,%xmm9
L266:
  mulsd  0x8(%r10,%rdx,1),%xmm9
  movapd %xmm4,%xmm1
  test   $0x10,%bl
  jne    L125
  pxor   %xmm1,%xmm1
L125:
  mulsd  -0x8(%r10,%rdx,1),%xmm1
  addsd  %xmm9,%xmm1
  movapd %xmm1,%xmm0
  mulsd  0x8(%rsp),%xmm0
  addsd  %xmm6,%xmm0
  mov    (%r15,%rcx,8),%r10
  subsd  (%r10,%rdx,1),%xmm0
  mulsd  %xmm8,%xmm0
  subsd  %xmm0,%xmm3
  movsd  %xmm3,(%r11)
  jmp    L226
L25:
  add    $0x1,%rcx
  add    $0x8,%rdi
  add    $0x8,%rsi
  cmp    0x20(%rsp),%rcx
  je     L50
L86:
  cmpl   $0x0,0x28(%rsp)
  jle    L25
  mov    0x28(%rsp),%eax
  lea    0x1(%rax),%r8d
  mov    $0x1,%eax
  mov    $0x8,%edx
  movsd  D59(%rip),%xmm2
  jmp    L269
L50:
  add    $0x1,%r9d
  cmp    $0x2,%r9d
  je     L147
L304:
  cmpl   $0x0,0x58(%rsp)
  jle    L50
  mov    0x38(%rsp),%rsi
  mov    0x40(%rsp),%rax
  add    $0x2,%rax
  mov    %rax,0x20(%rsp)
  mov    0x30(%rsp),%rdi
  mov    $0x1,%ecx
  movsd  D59(%rip),%xmm4
  jmp    L86
L147:
  mov    0xc0(%rsp),%r14
  movq   $0x0,(%r14)
  cmpl   $0x0,0x58(%rsp)
  jle    L183
  lea    0x8(%r15),%r13
  mov    0x38(%rsp),%rsi
  mov    0x30(%rsp),%r9
  movsd  D59(%rip),%xmm6
  movapd %xmm6,%xmm5
  movapd %xmm6,%xmm4
  movapd %xmm6,%xmm3
  pxor   %xmm7,%xmm7
  mov    0x70(%rsp),%r12
  mov    %r15,0x48(%rsp)
  mov    0x28(%rsp),%r15d
  jmp    L391
L145:
  subsd  (%rdi,%rdx,1),%xmm8
  mulsd  %xmm1,%xmm8
  subsd  %xmm8,%xmm0
  mulsd  0x8(%rsp),%xmm0
  addsd  %xmm2,%xmm0
  mov    0x0(%r13),%rcx
  subsd  (%rcx,%r10,1),%xmm0
  mulsd  %xmm0,%xmm0
  addsd  (%r14),%xmm0
  movsd  %xmm0,(%r14)
L432:
  add    $0x8,%rdx
  cmp    %rbx,%rax
  je     L90
L253:
  mov    %rsi,%r11
  mov    0x8(%rsi),%rcx
  mov    %rax,%r8
  add    $0x1,%rax
  testb  $0x10,(%rcx,%rax,1)
  je     L432
  mov    0x10(%rsi),%rdi
  movapd %xmm6,%xmm0
  testb  $0x10,(%rdi,%rax,1)
  jne    L261
  pxor   %xmm0,%xmm0
L261:
  mov    %r9,%rbp
  lea    0x8(%rdx),%r10
  mov    0x8(%r9),%rdi
  movsd  0x8(%rdi,%rdx,1),%xmm8
  mov    0x10(%r9),%r12
  movsd  0x8(%r12,%rdx,1),%xmm2
  subsd  %xmm8,%xmm2
  mulsd  %xmm0,%xmm2
  mov    (%r11),%r11
  movapd %xmm5,%xmm1
  testb  $0x10,(%r11,%rax,1)
  jne    L293
  pxor   %xmm1,%xmm1
L293:
  mov    0x0(%rbp),%r11
  movapd %xmm8,%xmm0
  subsd  (%r11,%r10,1),%xmm0
  mulsd  %xmm1,%xmm0
  subsd  %xmm0,%xmm2
  mulsd  (%rsp),%xmm2
  movapd %xmm4,%xmm0
  testb  $0x10,0x2(%rcx,%r8,1)
  jne    L72
  pxor   %xmm0,%xmm0
L72:
  movsd  0x10(%rdi,%rdx,1),%xmm1
  subsd  %xmm8,%xmm1
  mulsd  %xmm1,%xmm0
  movapd %xmm3,%xmm1
  testb  $0x10,(%rcx,%r8,1)
  jne    L145
  movapd %xmm7,%xmm1
  jmp    L145
L90:
  mov    0x20(%rsp),%r12
L396:
  add    $0x8,%r13
  add    $0x8,%r9
  add    $0x8,%rsi
  cmp    %r12,%r9
  je     L139
L391:
  mov    %r15d,%ebx
  mov    $0x0,%edx
  mov    $0x0,%eax
  test   %r15d,%r15d
  jle    L396
  mov    %r12,0x20(%rsp)
  jmp    L253
L139:
  mov    0x48(%rsp),%r15
L183:
  movsd  (%r14),%xmm0
  divsd  0x68(%rsp),%xmm0
  pxor   %xmm1,%xmm1
  ucomisd %xmm0,%xmm1
  ja     L229
  sqrtsd %xmm0,%xmm0
L411:
  divsd  0x50(%rsp),%xmm0
  movsd  %xmm0,(%r14)
  movsd  0x78(%rsp),%xmm7
  comisd %xmm0,%xmm7
  ja     L5
  addl   $0x1,0x2c(%rsp)
  mov    0x2c(%rsp),%eax
  cmp    %eax,0x5c(%rsp)
  je     L306
L325:
  mov    $0x0,%r9d
  movsd  D59(%rip),%xmm7
  movapd %xmm7,%xmm5
  movsd  0x60(%rsp),%xmm10
  mov    %r14,0xc0(%rsp)
  jmp    L304
L229:
  call   <sqrt@plt>
  jmp    L411
L388:
  movl   $0x0,0x2c(%rsp)
  jmp    L5
L306:
  mov    0x5c(%rsp),%eax
  mov    %eax,0x2c(%rsp)
L5:
  mov    0x2c(%rsp),%eax
  add    $0x88,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

tool_calls: name: unpack_data
arguments: data_label: D59
datatype: f64
name: unpack_data
arguments: data_label: D39
datatype: f32[4]
name: unpack_data
arguments: data_label: D4
datatype: f64

tool: D59: 1

tool: {"D39": [0.0,-0.0,0.0,0.0]}

tool: D4: 0.0001

assistant: ```c
int poisson(double **p, double **rhs, char **flag, int imax, int jmax, double delx, double dely, double eps, int itermax, double omega, double *res, int ifull) {
  int i, j, iter;
  double add, beta_2, beta_mod;
  double p0 = 0.0;
  int rb;
  double rdx2 = 1.0 / (delx * delx);
  double rdy2 = 1.0 / (dely * dely);
  beta_2 = -omega / (2.0 * (rdx2 + rdy2));
  for (i = 1; i <= imax; i++) {
    for (j = 1; j <= jmax; j++) {
      if (flag[i][j] & 0x0010) {
        p0 += p[i][j] * p[i][j];
      }
    }
  }
  p0 = sqrt(p0 / ifull);
  if (p0 < 0.0001) {
    p0 = 1.0;
  }
  for (iter = 0; iter < itermax; iter++) {
    for (rb = 0; rb <= 1; rb++) {
      for (i = 1; i <= imax; i++) {
        for (j = 1; j <= jmax; j++) {
          if ((i + j) % 2 != rb) {
            continue;
          }
          if (flag[i][j] == (0x0010 | (0x0001 | 0x0002 | 0x0008 | 0x0004))) {
            p[i][j] = (1. - omega) * p[i][j] - beta_2 * ((p[i + 1][j] + p[i - 1][j]) * rdx2 + (p[i][j + 1] + p[i][j - 1]) * rdy2 - rhs[i][j]);
          } else if (flag[i][j] & 0x0010) {
            beta_mod = -omega / ((((flag[i + 1][j] & 0x0010) ? 1 : 0) + ((flag[i - 1][j] & 0x0010) ? 1 : 0)) * rdx2 + (((flag[i][j + 1] & 0x0010) ? 1 : 0) + ((flag[i][j - 1] & 0x0010) ? 1 : 0)) * rdy2);
            p[i][j] = (1. - omega) * p[i][j] - beta_mod * ((((flag[i + 1][j] & 0x0010) ? 1 : 0) * p[i + 1][j] + ((flag[i - 1][j] & 0x0010) ? 1 : 0) * p[i - 1][j]) * rdx2 + (((flag[i][j + 1] & 0x0010) ? 1 : 0) * p[i][j + 1] + ((flag[i][j - 1] & 0x0010) ? 1 : 0) * p[i][j - 1]) * rdy2 - rhs[i][j]);
          }
        }
      }
    }
    *res = 0.0;
    for (i = 1; i <= imax; i++) {
      for (j = 1; j <= jmax; j++) {
        if (flag[i][j] & 0x0010) {
          add = (((flag[i + 1][j] & 0x0010) ? 1 : 0) * (p[i + 1][j] - p[i][j]) - ((flag[i - 1][j] & 0x0010) ? 1 : 0) * (p[i][j] - p[i - 1][j])) * rdx2 + (((flag[i][j + 1] & 0x0010) ? 1 : 0) * (p[i][j + 1] - p[i][j]) - ((flag[i][j - 1] & 0x0010) ? 1 : 0) * (p[i][j] - p[i][j - 1])) * rdy2 - rhs[i][j];
          *res += add * add;
        }
      }
    }
    *res = sqrt((*res) / ifull) / p0;
    if (*res < eps)
      break;
  }
  return iter;
}
```