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

```asm
<kernel_adi>:
  endbr64
  push   %r15
  pxor   %xmm0,%xmm0
  pxor   %xmm2,%xmm2
  push   %r14
  cvtsi2sd %esi,%xmm0
  push   %r13
  cvtsi2sd %edi,%xmm2
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x248,%rsp
  movsd  D103(%rip),%xmm1
  mov    %edi,0xfc(%rsp)
  divsd  %xmm0,%xmm1
  movsd  D103(%rip),%xmm0
  mov    %esi,0x4c(%rsp)
  mov    %rdx,0x88(%rsp)
  mov    %r8,0x18(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x238(%rsp)
  xor    %eax,%eax
  divsd  %xmm2,%xmm0
  mulsd  %xmm1,%xmm1
  movapd %xmm0,%xmm2
  addsd  %xmm0,%xmm2
  divsd  %xmm1,%xmm0
  divsd  %xmm1,%xmm2
  movsd  D31(%rip),%xmm1
  movapd %xmm2,%xmm3
  addsd  D103(%rip),%xmm2
  xorpd  D182(%rip),%xmm3
  mulsd  %xmm1,%xmm3
  movsd  %xmm2,(%rsp)
  movapd %xmm0,%xmm2
  addsd  D103(%rip),%xmm0
  xorpd  D182(%rip),%xmm2
  mulsd  %xmm1,%xmm2
  movsd  %xmm0,0x8(%rsp)
  test   %edi,%edi
  jle    L176
  lea    -0x2(%rsi),%eax
  mov    %esi,%ebx
  mov    %rdx,%r15
  mov    %r9,%r12
  lea    -0x1(%rsi),%edx
  movslq %esi,%rsi
  mov    %eax,%r10d
  mov    %eax,0x48(%rsp)
  movslq %r10d,%r11
  mov    %edx,0x6c(%rsp)
  mov    %rcx,%r14
  movapd %xmm3,%xmm7
  lea    0x0(,%rsi,8),%r13
  mov    %r11,0x78(%rsp)
  lea    (%r8,%r13,1),%rdi
  mov    %rdi,0xc8(%rsp)
  lea    (%r9,%r13,1),%rdi
  mov    %rdi,0xd0(%rsp)
  mov    %ebx,%edi
  imul   %edx,%ebx
  imul   %edi,%eax
  lea    -0x3(%rdi),%ebp
  mov    %ebp,0xb8(%rsp)
  movslq %ebx,%rdx
  mov    %rbp,0x170(%rsp)
  movslq %eax,%r9
  lea    0x8(%rcx,%rdx,8),%rbx
  lea    0x8(,%r9,8),%rax
  mov    %rbx,0x148(%rsp)
  mov    %edi,%ebx
  mov    %rax,0x150(%rsp)
  lea    (%rsi,%r11,1),%rax
  shl    $0x3,%rax
  lea    (%r12,%rax,1),%rcx
  add    %r8,%rax
  mov    %rax,0x160(%rsp)
  lea    (%r15,%r13,1),%rax
  mov    %rax,0xd8(%rsp)
  lea    (%rsi,%rbp,1),%rax
  lea    0x8(%r8,%rax,8),%rax
  mov    %rcx,0x158(%rsp)
  mov    %r11d,%ecx
  mov    %rax,0x168(%rsp)
  lea    (%r14,%rdx,8),%rax
  mov    %rax,0x80(%rsp)
  mov    %edi,%eax
  xor    %edi,%edi
  neg    %eax
  mov    %rcx,0x10(%rsp)
  movslq %eax,%r8
  lea    -0x1(%rcx),%rax
  mov    %rdi,%rcx
  imul   %r8,%rax
  shl    $0x3,%rax
  test   %ebx,%ebx
  cmovg  %rax,%rcx
  cmovle %rax,%rdi
  lea    0x0(,%r8,8),%rax
  sub    %rdx,%r9
  mov    %rax,0x178(%rsp)
  sub    %r14,%rax
  shl    $0x4,%r8
  mov    %rax,0xb0(%rsp)
  mov    %r10d,%eax
  shr    %eax
  mov    %rcx,0xa8(%rsp)
  mov    0x10(%rsp),%rcx
  sub    $0x1,%eax
  mov    %rdi,0xa0(%rsp)
  not    %rax
  mov    %r8,0x138(%rsp)
  neg    %rcx
  shl    $0x4,%rax
  mov    %r9,0xf0(%rsp)
  mov    %rax,0xc0(%rsp)
  mov    %r10d,%eax
  and    $0xfffffffe,%r10d
  mov    %r10d,0xbc(%rsp)
  mov    %eax,%r10d
  and    $0x1,%r10d
  lea    0x1(%r10),%eax
  mov    %r10d,0x24(%rsp)
  imul   %ebx,%eax
  imul   %ebx,%r10d
  mov    %eax,0x2c(%rsp)
  lea    0x8(%r13),%rax
  mov    %rax,0x130(%rsp)
  mov    %r13,%rax
  neg    %rax
  mov    %r10d,0x28(%rsp)
  mov    %rax,0x140(%rsp)
  lea    (%rbx,%rbx,1),%eax
  cltq
  shl    $0x3,%rax
  mov    %rax,0x128(%rsp)
  lea    0x2(%rsi,%rbp,1),%rax
  shl    $0x3,%rax
  mov    %rax,0x120(%rsp)
  lea    (%r15,%r11,8),%rax
  mov    %rax,0x98(%rsp)
  lea    0x180(%rsp),%rax
  movl   $0x1,0xf8(%rsp)
  xorpd  D182(%rip),%xmm7
  mov    %rax,0x108(%rsp)
  lea    0x1b0(%rsp),%rax
  mov    %rax,0x118(%rsp)
  lea    0x1e0(%rsp),%rax
  mov    %rax,0x100(%rsp)
  lea    0x210(%rsp),%rax
  mov    %rax,0x110(%rsp)
  lea    0x8(,%rcx,8),%rax
  mov    %rax,0x60(%rsp)
  mov    %r12,0x10(%rsp)
  movsd  %xmm7,0xe0(%rsp)
  movsd  %xmm3,0xe8(%rsp)
  nopw   0x0(%rax,%rax,1)
L186:
  cmpl   $0x1,0x6c(%rsp)
  jle    L124
  mov    0xd8(%rsp),%rbx
  mov    0x170(%rsp),%rax
  movapd %xmm2,%xmm5
  movapd %xmm2,%xmm4
  addsd  %xmm2,%xmm5
  addsd  D103(%rip),%xmm5
  xorpd  D182(%rip),%xmm4
  mov    $0x1,%r8d
  mov    %rbx,0x50(%rsp)
  add    $0x2,%rax
  mov    0x4c(%rsp),%r9d
  mov    0x160(%rsp),%rbx
  mov    %rax,0x90(%rsp)
  mov    0x148(%rsp),%rax
  mov    0x168(%rsp),%rdi
  mov    %rbx,0x58(%rsp)
  mov    0x158(%rsp),%rbx
  mov    %rax,0x40(%rsp)
  mov    0xd0(%rsp),%r11
  mov    %rbx,0x38(%rsp)
  mov    0x150(%rsp),%rbx
  mov    %rax,0x70(%rsp)
  mov    0xc8(%rsp),%r10
  mov    %rbx,0x30(%rsp)
  movsd  0xe8(%rsp),%xmm3
  mov    0x138(%rsp),%rbp
  mov    0x178(%rsp),%rbx
  movsd  0xe0(%rsp),%xmm7
  xchg   %ax,%ax
L110:
  mov    D103(%rip),%rsi
  mov    0x50(%rsp),%rcx
  mov    %r8d,%eax
  mov    %r10,%rdx
  mov    %rsi,(%r14,%r8,8)
  mov    %r11,%rsi
  movq   $0x0,(%r10)
  movsd  (%r14,%r8,8),%xmm0
  movsd  %xmm0,(%r11)
  nopl   0x0(%rax,%rax,1)
L184:
  movsd  (%rdx),%xmm1
  movapd %xmm7,%xmm0
  add    $0x8,%rdx
  add    $0x8,%rsi
  mulsd  %xmm3,%xmm1
  addsd  (%rsp),%xmm1
  divsd  %xmm1,%xmm0
  movsd  %xmm0,(%rdx)
  movsd  (%rcx),%xmm0
  movsd  0x8(%rcx),%xmm6
  mulsd  %xmm4,%xmm0
  mulsd  %xmm5,%xmm6
  addsd  %xmm6,%xmm0
  movsd  0x10(%rcx),%xmm6
  add    %r13,%rcx
  mulsd  %xmm2,%xmm6
  subsd  %xmm6,%xmm0
  movsd  -0x8(%rsi),%xmm6
  mulsd  %xmm3,%xmm6
  subsd  %xmm6,%xmm0
  divsd  %xmm1,%xmm0
  movsd  %xmm0,(%rsi)
  cmp    %rdi,%rdx
  jne    L184
  mov    D103(%rip),%rcx
  mov    0x80(%rsp),%rsi
  mov    %rcx,(%rsi,%r8,8)
  mov    0x48(%rsp),%ecx
  test   %ecx,%ecx
  je     L94
  mov    0x30(%rsp),%r15
  mov    0xa8(%rsp),%rdx
  mov    0xa0(%rsp),%rcx
  mov    0x40(%rsp),%rsi
  add    %r15,%rdx
  add    0xb0(%rsp),%rsi
  add    %r15,%rcx
  add    %r14,%rdx
  add    %r14,%rcx
  cmp    %r15,%rsi
  mov    0x38(%rsp),%r15
  setne  %r12b
  cmpl   $0x9,0xb8(%rsp)
  seta   %sil
  and    %esi,%r12d
  mov    0x60(%rsp),%rsi
  add    %r15,%rsi
  cmp    %rsi,%rcx
  setb   %sil
  cmp    %r15,%rdx
  seta   %r15b
  or     %r15d,%esi
  test   %sil,%r12b
  je     L148
  mov    0x58(%rsp),%r12
  mov    0x60(%rsp),%rsi
  add    %r12,%rsi
  cmp    %rsi,%rcx
  setb   %cl
  cmp    %r12,%rdx
  seta   %dl
  or     %cl,%dl
  je     L148
  mov    0x38(%rsp),%rdx
  mov    0x30(%rsp),%rsi
  mov    %eax,0x68(%rsp)
  lea    -0x8(%r12),%r15
  mov    0x40(%rsp),%rcx
  mov    0xc0(%rsp),%rax
  lea    -0x8(%rdx),%r12
  add    %r14,%rsi
  xor    %edx,%edx
  nopl   0x0(%rax)
L88:
  movsd  (%rcx),%xmm0
  movupd (%r15,%rdx,1),%xmm1
  movhpd (%rcx,%rbx,1),%xmm0
  shufpd $0x1,%xmm1,%xmm1
  add    %rbp,%rcx
  mulpd  %xmm1,%xmm0
  movupd (%r12,%rdx,1),%xmm1
  sub    $0x10,%rdx
  shufpd $0x1,%xmm1,%xmm1
  addpd  %xmm1,%xmm0
  movlpd %xmm0,(%rsi)
  movhpd %xmm0,(%rsi,%rbx,1)
  add    %rbp,%rsi
  cmp    %rax,%rdx
  jne    L88
  mov    0x68(%rsp),%eax
  mov    0xbc(%rsp),%ecx
  cmp    %ecx,0x48(%rsp)
  je     L179
  mov    0x24(%rsp),%esi
  lea    (%r9,%rsi,1),%edx
  mov    0x28(%rsp),%esi
  movslq %edx,%rdx
  lea    (%rax,%rsi,1),%ecx
  add    0x2c(%rsp),%eax
  cltq
  movslq %ecx,%rcx
  movsd  (%r14,%rax,8),%xmm0
  mov    0x18(%rsp),%rax
  mulsd  (%rax,%rdx,8),%xmm0
  mov    0x10(%rsp),%rax
  addsd  (%rax,%rdx,8),%xmm0
  movsd  %xmm0,(%r14,%rcx,8)
L179:
  addq   $0x8,0x70(%rsp)
  add    $0x1,%r8
  add    %r13,%r10
  add    %r13,%r11
  addq   $0x8,0x30(%rsp)
  add    0x4c(%rsp),%r9d
  add    %r13,%rdi
  add    %r13,0x38(%rsp)
  add    %r13,0x58(%rsp)
  addq   $0x8,0x50(%rsp)
  addq   $0x8,0x40(%rsp)
  cmp    0x90(%rsp),%r8
  jne    L110
  nopl   (%rax)
L94:
  movsd  0xe8(%rsp),%xmm3
  movl   $0x1,0x30(%rsp)
  xor    %r15d,%r15d
  mov    0x120(%rsp),%r9
  mov    0x128(%rsp),%r11
  movapd %xmm3,%xmm6
  mov    0x140(%rsp),%r10
  mov    0x130(%rsp),%rbp
  addsd  %xmm3,%xmm6
  addsd  D103(%rip),%xmm6
  mov    0xd0(%rsp),%r8
  mov    0xc8(%rsp),%rdi
  mov    0xd8(%rsp),%rsi
  mov    0x18(%rsp),%rbx
  mov    0x10(%rsp),%r12
  movsd  0xe0(%rsp),%xmm7
  nopw   0x0(%rax,%rax,1)
L128:
  mov    D103(%rip),%rax
  addl   $0x1,0x30(%rsp)
  lea    (%r15,%r10,1),%rcx
  lea    (%r11,%r10,1),%rdx
  add    %r14,%rcx
  add    %r14,%rdx
  mov    %rax,(%rsi)
  mov    %rbp,%rax
  movq   $0x0,(%rdi)
  movsd  (%rsi),%xmm0
  movsd  %xmm0,(%r8)
L11:
  movsd  -0x8(%rbx,%rax,1),%xmm1
  movapd %xmm4,%xmm0
  mulsd  %xmm2,%xmm1
  addsd  0x8(%rsp),%xmm1
  divsd  %xmm1,%xmm0
  movsd  %xmm0,(%rbx,%rax,1)
  movsd  (%rcx,%rax,1),%xmm0
  movsd  (%r14,%rax,1),%xmm5
  mulsd  %xmm7,%xmm0
  mulsd  %xmm6,%xmm5
  addsd  %xmm5,%xmm0
  movsd  (%rdx,%rax,1),%xmm5
  mulsd  %xmm3,%xmm5
  subsd  %xmm5,%xmm0
  movsd  -0x8(%r12,%rax,1),%xmm5
  mulsd  %xmm2,%xmm5
  subsd  %xmm5,%xmm0
  divsd  %xmm1,%xmm0
  movsd  %xmm0,(%r12,%rax,1)
  add    $0x8,%rax
  cmp    %rax,%r9
  jne    L11
  mov    0x88(%rsp),%rax
  mov    D103(%rip),%rcx
  mov    0x48(%rsp),%edx
  mov    %rcx,-0x8(%rax,%r11,1)
  test   %edx,%edx
  jle    L43
  mov    0x98(%rsp),%rax
  movsd  (%rax,%rbp,1),%xmm0
  mov    0x78(%rsp),%rax
  nopl   0x0(%rax)
L112:
  mulsd  (%rdi,%rax,8),%xmm0
  addsd  (%r8,%rax,8),%xmm0
  movsd  %xmm0,(%rsi,%rax,8)
  sub    $0x1,%rax
  test   %eax,%eax
  jg     L112
L43:
  mov    0x6c(%rsp),%ecx
  add    %r13,%rsi
  add    %r13,%rdi
  add    %r13,%r8
  add    %r13,%rbp
  sub    %r13,%r10
  add    %r13,%r15
  add    %r13,%r11
  add    %r13,%r9
  cmp    %ecx,0x30(%rsp)
  jne    L128
L124:
  mov    0xf8(%rsp),%ebx
  mov    0x108(%rsp),%r12
  lea    D85(%rip),%rsi
  movsd  %xmm2,0x50(%rsp)
  mov    %ebx,%edx
  mov    %r12,%rdi
  call   <sprintf@plt>
  mov    0x118(%rsp),%rbp
  mov    %ebx,%edx
  lea    D85(%rip),%rsi
  mov    %rbp,%rdi
  call   <sprintf@plt>
  mov    0x100(%rsp),%r15
  mov    %ebx,%edx
  lea    D85(%rip),%rsi
  mov    %r15,%rdi
  call   <sprintf@plt>
  mov    %ebx,%edx
  mov    0x110(%rsp),%rbx
  lea    D85(%rip),%rsi
  mov    %rbx,%rdi
  call   <sprintf@plt>
  lea    D268(%rip),%rsi
  mov    %r12,%rdi
  call   <strcat@plt>
  lea    D115(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcat@plt>
  mov    %r15,%rdi
  lea    D48(%rip),%rsi
  call   <strcat@plt>
  lea    D249(%rip),%rsi
  mov    %rbx,%rdi
  call   <strcat@plt>
  lea    D189(%rip),%rsi
  mov    %r12,%rdi
  call   <fopen@plt>
  lea    D189(%rip),%rsi
  mov    %rbp,%rdi
  mov    %rax,0x30(%rsp)
  call   <fopen@plt>
  mov    %r15,%rdi
  lea    D189(%rip),%rsi
  mov    %rax,0x38(%rsp)
  call   <fopen@plt>
  lea    D189(%rip),%rsi
  mov    %rbx,%rdi
  mov    %rax,0x40(%rsp)
  call   <fopen@plt>
  movsd  0x50(%rsp),%xmm2
  mov    %rax,%r15
  mov    0x4c(%rsp),%eax
  test   %eax,%eax
  jle    L89
  mov    0x10(%rsp),%rbp
  mov    0x6c(%rsp),%eax
  xor    %edi,%edi
  mov    %r14,0x58(%rsp)
  mov    %edi,%r14d
  mov    %rbp,%rbx
  mov    %rax,%rbp
  nopl   0x0(%rax,%rax,1)
L46:
  xor    %r12d,%r12d
  nopl   0x0(%rax,%rax,1)
L190:
  movsd  (%rbx,%r12,8),%xmm0
  mov    %r12d,%ecx
  mov    %r14d,%edx
  mov    %r15,%rdi
  lea    D21(%rip),%rsi
  call   <fprintf@plt>
  mov    %r12,%rax
  add    $0x1,%r12
  cmp    %rbp,%rax
  jne    L190
  add    $0x1,%r14d
  add    %r13,%rbx
  cmp    %r14d,0x4c(%rsp)
  jne    L46
  movsd  0x50(%rsp),%xmm2
  mov    0x58(%rsp),%r14
L89:
  mov    0x30(%rsp),%rdi
  movsd  %xmm2,0x50(%rsp)
  call   <fclose@plt>
  mov    0x38(%rsp),%rdi
  call   <fclose@plt>
  mov    0x40(%rsp),%rdi
  call   <fclose@plt>
  mov    %r15,%rdi
  call   <fclose@plt>
  addl   $0x1,0xf8(%rsp)
  mov    0xf8(%rsp),%eax
  cmp    %eax,0xfc(%rsp)
  movsd  0x50(%rsp),%xmm2
  jge    L186
L176:
  mov    0x238(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L171
  add    $0x248,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax,%rax,1)
L148:
  mov    0x70(%rsp),%rdx
  mov    0x78(%rsp),%rax
  mov    0xf0(%rsp),%rcx
  nopw   0x0(%rax,%rax,1)
L113:
  movsd  (%rdx),%xmm0
  mulsd  (%r10,%rax,8),%xmm0
  addsd  (%r11,%rax,8),%xmm0
  sub    $0x1,%rax
  movsd  %xmm0,(%rdx,%rcx,8)
  add    %rbx,%rdx
  test   %eax,%eax
  jne    L113
  jmp    L179
L171:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: parse_data
arguments: label: D103
datatype: f64
name: parse_data
arguments: label: D31
datatype: f32[2]
name: parse_data
arguments: label: D182
datatype: f32[4]
name: parse_data
arguments: label: D85
datatype: string
name: parse_data
arguments: label: D268
datatype: string
name: parse_data
arguments: label: D115
datatype: string
name: parse_data
arguments: label: D48
datatype: string
name: parse_data
arguments: label: D249
datatype: string
name: parse_data
arguments: label: D189
datatype: string
name: parse_data
arguments: label: D21
datatype: string

tool: D103: 1

tool: {"D31": [0.0,1.75]}

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

tool: D85: %d

tool: D268: _simData_u.dat

tool: D115: _simData_v.dat

tool: D48: _simData_p.dat

tool: D249: _simData_q.dat

tool: D189: wb

tool: D21: %d %d %lf


assistant: ```c
void kernel_adi(int tsteps, int n, double *u, double *v, double *p, double *q) {
  FILE *fp_u;
  FILE *fp_v;
  FILE *fp_p;
  FILE *fp_q;
  int t, i, j;
  double DX, DY, DT;
  double B1, B2;
  double mul1, mul2;
  double a, b, c, d, e, f;
#pragma scop
  DX = 1.0 / (double)n;
  DY = 1.0 / (double)n;
  DT = 1.0 / (double)tsteps;
  B1 = 2.0;
  B2 = 1.0;
  mul1 = B1 * DT / (DX * DX);
  mul2 = B2 * DT / (DY * DY);
  a = -mul1 / 2.0;
  b = 1.0 + mul1;
  c = a;
  d = -mul2 / 2.0;
  e = 1.0 + mul2;
  f = d;
  for (t = 1; t <= tsteps; t++) {
    for (i = 1; i < n - 1; i++) {
      v[i] = 1.0;
      p[i * n] = 0.0;
      q[i * n] = v[i];
      for (j = 1; j < n - 1; j++) {
        p[i * n + j] = -c / (a * p[i * n + (j - 1)] + b);
        q[i * n + j] = (-d * u[j * n + (i - 1)] + (1.0 + 2.0 * d) * u[j * n + i] - f * u[j * n + (i + 1)] - a * q[i * n + (j - 1)]) / (a * p[i * n + (j - 1)] + b);
      }
      v[n * (n - 1) + i] = 1.0;
      for (j = n - 2; j >= 1; j--) {
        v[j * n + i] = p[i * n + j] * v[(j + 1) * n + i] + q[i * n + j];
      }
    }
    for (i = 1; i < n - 1; i++) {
      u[i * n] = 1.0;
      p[i * n] = 0.0;
      q[i * n] = u[i * n];
      for (j = 1; j < n - 1; j++) {
        p[i * n + j] = -f / (d * p[i * n + (j - 1)] + e);
        q[i * n + j] = (-a * v[(i - 1) * n + j] + (1.0 + 2.0 * a) * v[i * n + j] - c * v[(i + 1) * n + j] - d * q[i * n + (j - 1)]) / (d * p[i * n + (j - 1)] + e);
      }
      u[i * n + (n - 1)] = 1.0;
      for (j = n - 2; j >= 1; j--) {
        u[i * n + j] = p[i * n + j] * u[i * n + (j + 1)] + q[i * n + j];
      }
    }
    char buffer_u[40];
    char buffer_v[40];
    char buffer_p[40];
    char buffer_q[40];
    sprintf(buffer_u, "%d", t);
    sprintf(buffer_v, "%d", t);
    sprintf(buffer_p, "%d", t);
    sprintf(buffer_q, "%d", t);
    strcat(buffer_u, "_simData_u.dat");
    strcat(buffer_v, "_simData_v.dat");
    strcat(buffer_p, "_simData_p.dat");
    strcat(buffer_q, "_simData_q.dat");
    fp_u = fopen(buffer_u, "wb");
    fp_v = fopen(buffer_v, "wb");
    fp_p = fopen(buffer_p, "wb");
    fp_q = fopen(buffer_q, "wb");
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < n; j++) {
        fprintf(fp_q, "%d %d %lf\n", i, j, q[i * n + j]);
      }
    }
    fclose(fp_u);
    fclose(fp_v);
    fclose(fp_p);
    fclose(fp_q);
  }
#pragma endscop
}
```