user: 请从给定的汇编指令推导出C源代码：

```asm
<residual_gauss>:
  endbr64
  lea    -0x1(%rdx),%r10d
  mov    %edx,%r8d
  mov    %ecx,%r9d
  cmp    $0x1,%r10d
  jbe    L80
  lea    0x10(%rdi),%rdx
  lea    0x8(%rsi),%rax
  cmp    %rax,%rdx
  je     L18
  lea    -0x3(%r8),%eax
  cmp    $0x2,%eax
  jbe    L18
  lea    -0x2(%r8),%ecx
  mov    %ecx,%eax
  shr    %eax
  lea    -0x1(%rax),%edx
  mov    $0x8,%eax
  shl    $0x4,%rdx
  add    $0x18,%rdx
  xchg   %ax,%ax
L139:
  movupd (%rdi,%rax,1),%xmm4
  movups %xmm4,(%rsi,%rax,1)
  add    $0x10,%rax
  cmp    %rax,%rdx
  jne    L139
  mov    %ecx,%eax
  or     $0x1,%eax
  and    $0x1,%ecx
  je     L31
  movsd  (%rdi,%rax,8),%xmm0
  movsd  %xmm0,(%rsi,%rax,8)
L31:
  lea    -0x1(%r9),%ecx
  cmp    $0x1,%ecx
  ja     L118
L132:
  mov    $0x1,%r9d
  push   %r12
  mov    %r8d,%r11d
  pxor   %xmm2,%xmm2
  movsd  D8(%rip),%xmm3
  push   %rbp
  lea    0x1(%r8),%r10d
  sub    %r8d,%r9d
  push   %rbx
  lea    -0x2(%r8,%r8,1),%ebx
  nopl   0x0(%rax,%rax,1)
L131:
  mov    %r11d,%eax
  mov    $0x1,%edx
  cmp    $0x1,%ecx
  jbe    L32
  nopl   (%rax)
L10:
  mov    %eax,%ebp
  lea    0x2(%rax),%r12d
  add    $0x1,%edx
  movsd  (%rdi,%r12,8),%xmm0
  addsd  (%rsi,%rbp,8),%xmm0
  lea    (%r9,%rax,1),%ebp
  addsd  (%rsi,%rbp,8),%xmm0
  lea    (%r10,%rax,1),%ebp
  addsd  (%rdi,%rbp,8),%xmm0
  lea    0x1(%rax),%ebp
  add    %r8d,%eax
  mulsd  %xmm3,%xmm0
  movapd %xmm0,%xmm1
  subsd  (%rdi,%rbp,8),%xmm1
  movsd  %xmm0,(%rsi,%rbp,8)
  mulsd  %xmm1,%xmm1
  addsd  %xmm1,%xmm2
  cmp    %ecx,%edx
  jne    L10
L32:
  add    $0x1,%r11d
  cmp    %ebx,%r11d
  jne    L131
  pop    %rbx
  movapd %xmm2,%xmm0
  pop    %rbp
  pop    %r12
  ret
L18:
  mov    %r10d,%edx
  mov    $0x1,%eax
  nopl   0x0(%rax)
L176:
  movsd  (%rdi,%rax,8),%xmm0
  movsd  %xmm0,(%rsi,%rax,8)
  add    $0x1,%rax
  cmp    %rax,%rdx
  jne    L176
  lea    -0x1(%r9),%ecx
  cmp    $0x1,%ecx
  jbe    L132
L118:
  mov    %r8d,%eax
L124:
  mov    $0x1,%edx
L213:
  mov    %eax,%r9d
  add    $0x1,%edx
  add    %r8d,%eax
  movsd  (%rdi,%r9,8),%xmm0
  movsd  %xmm0,(%rsi,%r9,8)
  cmp    %edx,%ecx
  jne    L213
  cmp    $0x1,%r10d
  ja     L132
L28:
  pxor   %xmm2,%xmm2
  movapd %xmm2,%xmm0
  ret
  nopl   0x0(%rax)
L80:
  lea    -0x1(%rcx),%edx
  mov    %edx,%ecx
  cmp    $0x1,%edx
  jbe    L28
  cmp    $0x1,%r8d
  jne    L119
  lea    0x10(%rdi),%rcx
  lea    0x8(%rsi),%rax
  cmp    %rax,%rcx
  je     L140
  lea    -0x3(%r9),%eax
  cmp    $0x2,%eax
  jbe    L140
  sub    $0x2,%r9d
  mov    %r9d,%eax
  shr    %eax
  lea    -0x1(%rax),%edx
  mov    $0x8,%eax
  shl    $0x4,%rdx
  add    $0x18,%rdx
  nopl   0x0(%rax,%rax,1)
L91:
  movupd (%rdi,%rax,1),%xmm5
  movups %xmm5,(%rsi,%rax,1)
  add    $0x10,%rax
  cmp    %rax,%rdx
  jne    L91
  mov    %r9d,%eax
  or     $0x1,%eax
  and    $0x1,%r9d
  je     L28
  movsd  (%rdi,%rax,8),%xmm0
  pxor   %xmm2,%xmm2
  movsd  %xmm0,(%rsi,%rax,8)
  movapd %xmm2,%xmm0
  ret
L140:
  mov    $0x1,%eax
  xchg   %ax,%ax
L159:
  movsd  (%rdi,%rax,8),%xmm0
  movsd  %xmm0,(%rsi,%rax,8)
  add    $0x1,%rax
  cmp    %rax,%rdx
  jne    L159
  jmp    L28
L119:
  mov    $0x2,%eax
  jmp    L124
```

tool_calls: name: retrieve_data
arguments: data_label: D8
type: f64

tool: D8: 0.25

assistant: ```c
double residual_gauss(double *u, double *utmp, unsigned sizex, unsigned sizey) {
  unsigned i, j;
  double unew, diff, sum = 0.0;
  for (j = 1; j < sizex - 1; j++)
    utmp[0 * sizex + j] = u[0 * sizex + j];
  for (i = 1; i < sizey - 1; i++)
    utmp[i * sizex + 0] = u[i * sizex + 0];
  for (j = 1; j < sizex - 1; j++) {
    for (i = 1; i < sizey - 1; i++) {
      unew = 0.25 * (utmp[i * sizex + (j - 1)] + u[i * sizex + (j + 1)] + utmp[(i - 1) * sizex + j] + u[(i + 1) * sizex + j]);
      diff = unew - u[i * sizex + j];
      sum += diff * diff;
      utmp[i * sizex + j] = unew;
    }
  }
  return sum;
}
```