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    $0x1d8,%rsp
  movsd  D80(%rip),%xmm1
  movsd  D275(%rip),%xmm4
  mov    %edi,0x74(%rsp)
  divsd  %xmm0,%xmm1
  movsd  D80(%rip),%xmm0
  mov    %esi,0x18(%rsp)
  mov    %rdx,0x100(%rsp)
  mov    %rcx,0x50(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x1c8(%rsp)
  xor    %eax,%eax
  divsd  %xmm2,%xmm0
  mulsd  %xmm1,%xmm1
  movapd %xmm0,%xmm3
  addsd  %xmm0,%xmm3
  divsd  %xmm1,%xmm0
  divsd  %xmm1,%xmm3
  movapd %xmm0,%xmm1
  addsd  D80(%rip),%xmm0
  xorpd  D149(%rip),%xmm1
  mulsd  %xmm4,%xmm1
  movsd  %xmm0,0x8(%rsp)
  movapd %xmm3,%xmm2
  addsd  D80(%rip),%xmm3
  xorpd  D149(%rip),%xmm2
  mulsd  %xmm4,%xmm2
  movsd  %xmm3,(%rsp)
  test   %edi,%edi
  jle    L36
  mov    %rdx,%r11
  movslq %esi,%rdx
  mov    %rcx,%rdi
  mov    %r9,0x68(%rsp)
  lea    0x0(,%rdx,8),%r15
  lea    -0x1(%rdx),%esi
  movapd %xmm2,%xmm7
  movl   $0x1,0x70(%rsp)
  lea    (%r8,%r15,1),%rax
  mov    %esi,0x14(%rsp)
  lea    0x110(%rsp),%rbx
  xorpd  D149(%rip),%xmm7
  mov    %rax,0x98(%rsp)
  lea    (%r9,%r15,1),%rax
  mov    %rax,0xd8(%rsp)
  mov    %edx,%eax
  imul   %esi,%eax
  mov    %rbx,0x90(%rsp)
  lea    0x140(%rsp),%rbx
  mov    %rbx,0x80(%rsp)
  lea    0x170(%rsp),%rbx
  mov    %rbx,0x88(%rsp)
  lea    0x1a0(%rsp),%rbx
  cltq
  mov    %rbx,0x78(%rsp)
  lea    0x8(%rcx,%rax,8),%rsi
  lea    (%rdi,%rax,8),%rdi
  mov    %r8,0x108(%rsp)
  mov    %rsi,0xe0(%rsp)
  lea    (%r11,%r15,1),%rsi
  mov    %rsi,0xe8(%rsp)
  lea    -0x3(%rdx),%esi
  lea    (%rdx,%rsi,1),%rcx
  mov    %rdi,0x20(%rsp)
  lea    0x8(%r8,%rcx,8),%rcx
  mov    %rsi,0xf8(%rsp)
  mov    %rcx,0xf0(%rsp)
  mov    %edx,%ecx
  neg    %ecx
  movsd  %xmm7,0x58(%rsp)
  movslq %ecx,%rcx
  movsd  %xmm2,0x60(%rsp)
  lea    0x0(,%rcx,8),%rdi
  mov    %edx,%ecx
  mov    %rdi,0xb0(%rsp)
  lea    -0x2(%rdx),%edi
  imul   %edi,%ecx
  mov    %edi,0x1c(%rsp)
  movslq %ecx,%rcx
  sub    %rax,%rcx
  lea    (%rdx,%rdx,1),%rax
  sub    %rsi,%rax
  mov    %rcx,0xa0(%rsp)
  lea    -0x10(,%rax,8),%rax
  mov    %rax,0xd0(%rsp)
  lea    0x8(%r15),%rax
  mov    %rax,0xc8(%rsp)
  mov    %r15,%rax
  neg    %rax
  mov    %rax,0xa8(%rsp)
  lea    (%rdx,%rdx,1),%eax
  cltq
  shl    $0x3,%rax
  mov    %rax,0xc0(%rsp)
  lea    0x2(%rdx,%rsi,1),%rax
  shl    $0x3,%rax
  mov    %rax,0xb8(%rsp)
  movslq %edi,%rax
  lea    -0x8(,%rax,8),%rax
  mov    %rax,0x28(%rsp)
  nopw   0x0(%rax,%rax,1)
L152:
  cmpl   $0x1,0x14(%rsp)
  jle    L117
  movapd %xmm1,%xmm6
  mov    0xf8(%rsp),%rax
  movapd %xmm1,%xmm3
  mov    0xf0(%rsp),%r10
  addsd  %xmm1,%xmm6
  addsd  D80(%rip),%xmm6
  xorpd  D149(%rip),%xmm3
  mov    $0x1,%r11d
  mov    0xe8(%rsp),%rbx
  mov    0xe0(%rsp),%r13
  lea    0x2(%rax),%r8
  mov    0xd8(%rsp),%rdi
  mov    0x98(%rsp),%rsi
  movsd  0x60(%rsp),%xmm2
  mov    0xa0(%rsp),%r9
  mov    0xb0(%rsp),%rbp
  mov    0x50(%rsp),%r12
  mov    0x1c(%rsp),%r14d
  movsd  0x58(%rsp),%xmm7
  nopw   0x0(%rax,%rax,1)
L42:
  mov    D80(%rip),%rax
  mov    %rdi,%rcx
  mov    %rbx,%rdx
  mov    %rax,(%r12,%r11,8)
  mov    %rsi,%rax
  movq   $0x0,(%rsi)
  movsd  (%r12,%r11,8),%xmm0
  movsd  %xmm0,(%rdi)
  nopl   (%rax)
L81:
  movsd  (%rax),%xmm4
  movapd %xmm7,%xmm0
  add    $0x8,%rax
  add    $0x8,%rcx
  mulsd  %xmm2,%xmm4
  addsd  (%rsp),%xmm4
  divsd  %xmm4,%xmm0
  movsd  %xmm0,(%rax)
  movsd  (%rdx),%xmm0
  movsd  0x8(%rdx),%xmm5
  mulsd  %xmm3,%xmm0
  mulsd  %xmm6,%xmm5
  addsd  %xmm5,%xmm0
  movsd  0x10(%rdx),%xmm5
  add    %r15,%rdx
  mulsd  %xmm1,%xmm5
  subsd  %xmm5,%xmm0
  movsd  -0x8(%rcx),%xmm5
  mulsd  %xmm2,%xmm5
  subsd  %xmm5,%xmm0
  divsd  %xmm4,%xmm0
  movsd  %xmm0,(%rcx)
  cmp    %r10,%rax
  jne    L81
  mov    0x20(%rsp),%rax
  mov    D80(%rip),%rcx
  mov    %rcx,(%rax,%r11,8)
  test   %r14d,%r14d
  je     L120
  movslq %r14d,%rax
  mov    %r13,%rdx
  nopl   0x0(%rax,%rax,1)
L73:
  movsd  (%rsi,%rax,8),%xmm0
  mulsd  (%rdx),%xmm0
  addsd  (%rdi,%rax,8),%xmm0
  sub    $0x1,%rax
  movsd  %xmm0,(%rdx,%r9,8)
  add    %rbp,%rdx
  test   %eax,%eax
  jne    L73
  add    $0x1,%r11
  add    %r15,%rsi
  add    %r15,%rdi
  add    $0x8,%r13
  add    $0x8,%rbx
  add    %r15,%r10
  cmp    %r8,%r11
  jne    L42
  nopl   (%rax)
L120:
  movsd  0x60(%rsp),%xmm2
  mov    0xb8(%rsp),%rdi
  xor    %r8d,%r8d
  mov    $0x1,%r13d
  mov    0xc0(%rsp),%rbx
  mov    0xa8(%rsp),%r11
  movapd %xmm2,%xmm6
  mov    0xc8(%rsp),%r10
  mov    0xd0(%rsp),%rsi
  addsd  %xmm2,%xmm6
  addsd  D80(%rip),%xmm6
  mov    0x100(%rsp),%r9
  mov    0x50(%rsp),%rbp
  mov    0x108(%rsp),%r12
  mov    0x68(%rsp),%r14
  movsd  0x58(%rsp),%xmm7
  nop
L93:
  mov    D80(%rip),%rax
  lea    (%r11,%r8,1),%rcx
  lea    (%rbx,%r11,1),%rdx
  add    $0x1,%r13d
  add    %rbp,%rcx
  add    %rbp,%rdx
  mov    %rax,-0x8(%r9,%r10,1)
  mov    %r10,%rax
  movq   $0x0,-0x8(%r12,%r10,1)
  movsd  -0x8(%r9,%r10,1),%xmm0
  movsd  %xmm0,-0x8(%r14,%r10,1)
  nopl   0x0(%rax,%rax,1)
L40:
  movsd  -0x8(%r12,%rax,1),%xmm4
  movapd %xmm3,%xmm0
  mulsd  %xmm1,%xmm4
  addsd  0x8(%rsp),%xmm4
  divsd  %xmm4,%xmm0
  movsd  %xmm0,(%r12,%rax,1)
  movsd  (%rcx,%rax,1),%xmm0
  movsd  0x0(%rbp,%rax,1),%xmm5
  mulsd  %xmm7,%xmm0
  mulsd  %xmm6,%xmm5
  addsd  %xmm5,%xmm0
  movsd  (%rdx,%rax,1),%xmm5
  mulsd  %xmm2,%xmm5
  subsd  %xmm5,%xmm0
  movsd  -0x8(%r14,%rax,1),%xmm5
  mulsd  %xmm1,%xmm5
  subsd  %xmm5,%xmm0
  divsd  %xmm4,%xmm0
  movsd  %xmm0,(%r14,%rax,1)
  add    $0x8,%rax
  cmp    %rax,%rdi
  jne    L40
  mov    D80(%rip),%rax
  mov    0x1c(%rsp),%edx
  mov    %rax,-0x8(%r9,%rbx,1)
  test   %edx,%edx
  jle    L146
  mov    0x28(%rsp),%rax
  mov    D80(%rip),%rcx
  add    %r10,%rax
  movq   %rcx,%xmm0
  jmp    L50
  nop
L134:
  sub    $0x8,%rax
L50:
  mulsd  (%r12,%rax,1),%xmm0
  addsd  (%r14,%rax,1),%xmm0
  movsd  %xmm0,(%r9,%rax,1)
  cmp    %rax,%rsi
  jne    L134
L146:
  add    %r15,%rsi
  add    %r15,%r10
  add    %r15,%r8
  sub    %r15,%r11
  add    %r15,%rbx
  add    %r15,%rdi
  cmp    0x14(%rsp),%r13d
  jne    L93
L117:
  mov    0x70(%rsp),%ebx
  mov    0x90(%rsp),%r13
  lea    D163(%rip),%rsi
  movsd  %xmm1,0x48(%rsp)
  mov    %ebx,%edx
  mov    %r13,%rdi
  call   <sprintf@plt>
  mov    0x80(%rsp),%rbp
  mov    %ebx,%edx
  lea    D163(%rip),%rsi
  mov    %rbp,%rdi
  call   <sprintf@plt>
  mov    0x88(%rsp),%r14
  mov    %ebx,%edx
  lea    D163(%rip),%rsi
  mov    %r14,%rdi
  call   <sprintf@plt>
  mov    %ebx,%edx
  mov    0x78(%rsp),%rbx
  lea    D163(%rip),%rsi
  mov    %rbx,%rdi
  call   <sprintf@plt>
  lea    D130(%rip),%rsi
  mov    %r13,%rdi
  call   <strcat@plt>
  mov    %rbp,%rdi
  lea    D198(%rip),%rsi
  call   <strcat@plt>
  lea    D153(%rip),%rsi
  mov    %r14,%rdi
  call   <strcat@plt>
  lea    D114(%rip),%rsi
  mov    %rbx,%rdi
  call   <strcat@plt>
  lea    D67(%rip),%rsi
  mov    %r13,%rdi
  call   <fopen@plt>
  mov    %rbp,%rdi
  lea    D67(%rip),%rsi
  mov    %rax,0x30(%rsp)
  call   <fopen@plt>
  lea    D67(%rip),%rsi
  mov    %r14,%rdi
  mov    %rax,0x38(%rsp)
  call   <fopen@plt>
  lea    D67(%rip),%rsi
  mov    %rbx,%rdi
  mov    %rax,0x40(%rsp)
  call   <fopen@plt>
  movsd  0x48(%rsp),%xmm1
  mov    %rax,%rbp
  mov    0x18(%rsp),%eax
  test   %eax,%eax
  jle    L159
  mov    0x68(%rsp),%r13
  mov    0x14(%rsp),%eax
  xor    %ebx,%ebx
  mov    %r13,%r12
  mov    %rax,%r13
  nopl   0x0(%rax)
L28:
  xor    %r14d,%r14d
  nopl   0x0(%rax,%rax,1)
L89:
  movsd  (%r12,%r14,8),%xmm0
  mov    %r14d,%ecx
  mov    %ebx,%edx
  mov    %rbp,%rdi
  lea    D34(%rip),%rsi
  call   <fprintf@plt>
  mov    %r14,%rax
  add    $0x1,%r14
  cmp    %r13,%rax
  jne    L89
  add    $0x1,%ebx
  add    %r15,%r12
  cmp    %ebx,0x18(%rsp)
  jne    L28
  movsd  0x48(%rsp),%xmm1
L159:
  mov    0x30(%rsp),%rdi
  movsd  %xmm1,0x48(%rsp)
  call   <fclose@plt>
  mov    0x38(%rsp),%rdi
  call   <fclose@plt>
  mov    0x40(%rsp),%rdi
  call   <fclose@plt>
  mov    %rbp,%rdi
  call   <fclose@plt>
  addl   $0x1,0x70(%rsp)
  mov    0x70(%rsp),%eax
  cmp    %eax,0x74(%rsp)
  movsd  0x48(%rsp),%xmm1
  jge    L152
L36:
  mov    0x1c8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L46
  add    $0x1d8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L46:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: retrieve_data
arguments: data_tag: D80
type_infered: f64
name: retrieve_data
arguments: data_tag: D275
type_infered: f32[2]
name: retrieve_data
arguments: data_tag: D149
type_infered: f32[4]
name: retrieve_data
arguments: data_tag: D163
type_infered: string
name: retrieve_data
arguments: data_tag: D130
type_infered: string
name: retrieve_data
arguments: data_tag: D198
type_infered: string
name: retrieve_data
arguments: data_tag: D153
type_infered: string
name: retrieve_data
arguments: data_tag: D114
type_infered: string
name: retrieve_data
arguments: data_tag: D67
type_infered: string
name: retrieve_data
arguments: data_tag: D34
type_infered: string

tool: D80: 1

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

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

tool: D163: %d

tool: D130: _simData_u.dat

tool: D198: _simData_v.dat

tool: D153: _simData_p.dat

tool: D114: _simData_q.dat

tool: D67: wb

tool: D34: %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
}
```