user: Translate the below assembly code into C programming language:

```asm
<kernel_adi>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x190,%rsp
  mov    %edi,-0x164(%rbp)
  mov    %esi,-0x168(%rbp)
  mov    %rdx,-0x170(%rbp)
  mov    %rcx,-0x178(%rbp)
  mov    %r8,-0x180(%rbp)
  mov    %r9,-0x188(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  pxor   %xmm1,%xmm1
  cvtsi2sdl -0x168(%rbp),%xmm1
  movsd  D324(%rip),%xmm0
  divsd  %xmm1,%xmm0
  movsd  %xmm0,-0x148(%rbp)
  pxor   %xmm1,%xmm1
  cvtsi2sdl -0x168(%rbp),%xmm1
  movsd  D324(%rip),%xmm0
  divsd  %xmm1,%xmm0
  movsd  %xmm0,-0x140(%rbp)
  pxor   %xmm1,%xmm1
  cvtsi2sdl -0x164(%rbp),%xmm1
  movsd  D324(%rip),%xmm0
  divsd  %xmm1,%xmm0
  movsd  %xmm0,-0x138(%rbp)
  movsd  D5(%rip),%xmm0
  movsd  %xmm0,-0x130(%rbp)
  movsd  D324(%rip),%xmm0
  movsd  %xmm0,-0x128(%rbp)
  movsd  -0x130(%rbp),%xmm0
  movapd %xmm0,%xmm1
  mulsd  -0x138(%rbp),%xmm1
  movsd  -0x148(%rbp),%xmm0
  movapd %xmm0,%xmm2
  mulsd  %xmm0,%xmm2
  divsd  %xmm2,%xmm1
  movapd %xmm1,%xmm0
  movsd  %xmm0,-0x120(%rbp)
  movsd  -0x128(%rbp),%xmm0
  movapd %xmm0,%xmm1
  mulsd  -0x138(%rbp),%xmm1
  movsd  -0x140(%rbp),%xmm0
  movapd %xmm0,%xmm2
  mulsd  %xmm0,%xmm2
  divsd  %xmm2,%xmm1
  movapd %xmm1,%xmm0
  movsd  %xmm0,-0x118(%rbp)
  movsd  -0x120(%rbp),%xmm0
  movq   D279(%rip),%xmm1
  xorpd  %xmm1,%xmm0
  movsd  D5(%rip),%xmm1
  divsd  %xmm1,%xmm0
  movsd  %xmm0,-0x110(%rbp)
  movsd  -0x120(%rbp),%xmm1
  movsd  D324(%rip),%xmm0
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x108(%rbp)
  movsd  -0x110(%rbp),%xmm0
  movsd  %xmm0,-0x100(%rbp)
  movsd  -0x118(%rbp),%xmm0
  movq   D279(%rip),%xmm1
  xorpd  %xmm1,%xmm0
  movsd  D5(%rip),%xmm1
  divsd  %xmm1,%xmm0
  movsd  %xmm0,-0xf8(%rbp)
  movsd  -0x118(%rbp),%xmm1
  movsd  D324(%rip),%xmm0
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0xf0(%rbp)
  movsd  -0xf8(%rbp),%xmm0
  movsd  %xmm0,-0xe8(%rbp)
  movl   $0x1,-0x15c(%rbp)
  jmp    L38
L3:
  movl   $0x1,-0x158(%rbp)
  jmp    L17
L159:
  mov    -0x158(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x178(%rbp),%rax
  add    %rdx,%rax
  movsd  D324(%rip),%xmm0
  movsd  %xmm0,(%rax)
  mov    -0x158(%rbp),%eax
  imul   -0x168(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x180(%rbp),%rax
  add    %rdx,%rax
  pxor   %xmm0,%xmm0
  movsd  %xmm0,(%rax)
  mov    -0x158(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x178(%rbp),%rax
  add    %rax,%rdx
  mov    -0x158(%rbp),%eax
  imul   -0x168(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rcx
  mov    -0x188(%rbp),%rax
  add    %rcx,%rax
  movsd  (%rdx),%xmm0
  movsd  %xmm0,(%rax)
  movl   $0x1,-0x154(%rbp)
  jmp    L153
L40:
  movsd  -0x100(%rbp),%xmm0
  movq   D279(%rip),%xmm1
  xorpd  %xmm1,%xmm0
  mov    -0x158(%rbp),%eax
  imul   -0x168(%rbp),%eax
  mov    %eax,%edx
  mov    -0x154(%rbp),%eax
  sub    $0x1,%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x180(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  mulsd  -0x110(%rbp),%xmm1
  addsd  -0x108(%rbp),%xmm1
  mov    -0x158(%rbp),%eax
  imul   -0x168(%rbp),%eax
  mov    %eax,%edx
  mov    -0x154(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x180(%rbp),%rax
  add    %rdx,%rax
  divsd  %xmm1,%xmm0
  movsd  %xmm0,(%rax)
  movsd  -0xf8(%rbp),%xmm0
  movq   D279(%rip),%xmm1
  xorpd  %xmm0,%xmm1
  mov    -0x154(%rbp),%eax
  imul   -0x168(%rbp),%eax
  mov    %eax,%edx
  mov    -0x158(%rbp),%eax
  sub    $0x1,%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x170(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm0,%xmm1
  movsd  -0xf8(%rbp),%xmm0
  movapd %xmm0,%xmm2
  addsd  %xmm0,%xmm2
  movsd  D324(%rip),%xmm0
  addsd  %xmm0,%xmm2
  mov    -0x154(%rbp),%eax
  imul   -0x168(%rbp),%eax
  mov    %eax,%edx
  mov    -0x158(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x170(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm2,%xmm0
  addsd  %xmm1,%xmm0
  mov    -0x154(%rbp),%eax
  imul   -0x168(%rbp),%eax
  mov    %eax,%edx
  mov    -0x158(%rbp),%eax
  add    $0x1,%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x170(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  mulsd  -0xe8(%rbp),%xmm1
  subsd  %xmm1,%xmm0
  mov    -0x158(%rbp),%eax
  imul   -0x168(%rbp),%eax
  mov    %eax,%edx
  mov    -0x154(%rbp),%eax
  sub    $0x1,%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x188(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  mulsd  -0x110(%rbp),%xmm1
  subsd  %xmm1,%xmm0
  mov    -0x158(%rbp),%eax
  imul   -0x168(%rbp),%eax
  mov    %eax,%edx
  mov    -0x154(%rbp),%eax
  sub    $0x1,%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x180(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  mulsd  -0x110(%rbp),%xmm1
  addsd  -0x108(%rbp),%xmm1
  mov    -0x158(%rbp),%eax
  imul   -0x168(%rbp),%eax
  mov    %eax,%edx
  mov    -0x154(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x188(%rbp),%rax
  add    %rdx,%rax
  divsd  %xmm1,%xmm0
  movsd  %xmm0,(%rax)
  addl   $0x1,-0x154(%rbp)
L153:
  mov    -0x168(%rbp),%eax
  sub    $0x1,%eax
  cmp    %eax,-0x154(%rbp)
  jl     L40
  mov    -0x168(%rbp),%eax
  sub    $0x1,%eax
  imul   -0x168(%rbp),%eax
  mov    %eax,%edx
  mov    -0x158(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x178(%rbp),%rax
  add    %rdx,%rax
  movsd  D324(%rip),%xmm0
  movsd  %xmm0,(%rax)
  mov    -0x168(%rbp),%eax
  sub    $0x2,%eax
  mov    %eax,-0x154(%rbp)
  jmp    L69
L178:
  mov    -0x158(%rbp),%eax
  imul   -0x168(%rbp),%eax
  mov    %eax,%edx
  mov    -0x154(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x180(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  mov    -0x154(%rbp),%eax
  add    $0x1,%eax
  imul   -0x168(%rbp),%eax
  mov    %eax,%edx
  mov    -0x158(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x178(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm0,%xmm1
  mov    -0x158(%rbp),%eax
  imul   -0x168(%rbp),%eax
  mov    %eax,%edx
  mov    -0x154(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x188(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mov    -0x154(%rbp),%eax
  imul   -0x168(%rbp),%eax
  mov    %eax,%edx
  mov    -0x158(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x178(%rbp),%rax
  add    %rdx,%rax
  addsd  %xmm1,%xmm0
  movsd  %xmm0,(%rax)
  subl   $0x1,-0x154(%rbp)
L69:
  cmpl   $0x0,-0x154(%rbp)
  jg     L178
  addl   $0x1,-0x158(%rbp)
L17:
  mov    -0x168(%rbp),%eax
  sub    $0x1,%eax
  cmp    %eax,-0x158(%rbp)
  jl     L159
  movl   $0x1,-0x158(%rbp)
  jmp    L19
L65:
  mov    -0x158(%rbp),%eax
  imul   -0x168(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x170(%rbp),%rax
  add    %rdx,%rax
  movsd  D324(%rip),%xmm0
  movsd  %xmm0,(%rax)
  mov    -0x158(%rbp),%eax
  imul   -0x168(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x180(%rbp),%rax
  add    %rdx,%rax
  pxor   %xmm0,%xmm0
  movsd  %xmm0,(%rax)
  mov    -0x158(%rbp),%eax
  imul   -0x168(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x170(%rbp),%rax
  add    %rax,%rdx
  mov    -0x158(%rbp),%eax
  imul   -0x168(%rbp),%eax
  cltq
  lea    0x0(,%rax,8),%rcx
  mov    -0x188(%rbp),%rax
  add    %rcx,%rax
  movsd  (%rdx),%xmm0
  movsd  %xmm0,(%rax)
  movl   $0x1,-0x154(%rbp)
  jmp    L12
L70:
  movsd  -0xe8(%rbp),%xmm0
  movq   D279(%rip),%xmm1
  xorpd  %xmm1,%xmm0
  mov    -0x158(%rbp),%eax
  imul   -0x168(%rbp),%eax
  mov    %eax,%edx
  mov    -0x154(%rbp),%eax
  sub    $0x1,%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x180(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  mulsd  -0xf8(%rbp),%xmm1
  addsd  -0xf0(%rbp),%xmm1
  mov    -0x158(%rbp),%eax
  imul   -0x168(%rbp),%eax
  mov    %eax,%edx
  mov    -0x154(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x180(%rbp),%rax
  add    %rdx,%rax
  divsd  %xmm1,%xmm0
  movsd  %xmm0,(%rax)
  movsd  -0x110(%rbp),%xmm0
  movq   D279(%rip),%xmm1
  xorpd  %xmm0,%xmm1
  mov    -0x158(%rbp),%eax
  sub    $0x1,%eax
  imul   -0x168(%rbp),%eax
  mov    %eax,%edx
  mov    -0x154(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x178(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm0,%xmm1
  movsd  -0x110(%rbp),%xmm0
  movapd %xmm0,%xmm2
  addsd  %xmm0,%xmm2
  movsd  D324(%rip),%xmm0
  addsd  %xmm0,%xmm2
  mov    -0x158(%rbp),%eax
  imul   -0x168(%rbp),%eax
  mov    %eax,%edx
  mov    -0x154(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x178(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm2,%xmm0
  addsd  %xmm1,%xmm0
  mov    -0x158(%rbp),%eax
  add    $0x1,%eax
  imul   -0x168(%rbp),%eax
  mov    %eax,%edx
  mov    -0x154(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x178(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  mulsd  -0x100(%rbp),%xmm1
  subsd  %xmm1,%xmm0
  mov    -0x158(%rbp),%eax
  imul   -0x168(%rbp),%eax
  mov    %eax,%edx
  mov    -0x154(%rbp),%eax
  sub    $0x1,%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x188(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  mulsd  -0xf8(%rbp),%xmm1
  subsd  %xmm1,%xmm0
  mov    -0x158(%rbp),%eax
  imul   -0x168(%rbp),%eax
  mov    %eax,%edx
  mov    -0x154(%rbp),%eax
  sub    $0x1,%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x180(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  mulsd  -0xf8(%rbp),%xmm1
  addsd  -0xf0(%rbp),%xmm1
  mov    -0x158(%rbp),%eax
  imul   -0x168(%rbp),%eax
  mov    %eax,%edx
  mov    -0x154(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x188(%rbp),%rax
  add    %rdx,%rax
  divsd  %xmm1,%xmm0
  movsd  %xmm0,(%rax)
  addl   $0x1,-0x154(%rbp)
L12:
  mov    -0x168(%rbp),%eax
  sub    $0x1,%eax
  cmp    %eax,-0x154(%rbp)
  jl     L70
  mov    -0x158(%rbp),%eax
  imul   -0x168(%rbp),%eax
  mov    %eax,%edx
  mov    -0x168(%rbp),%eax
  sub    $0x1,%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x170(%rbp),%rax
  add    %rdx,%rax
  movsd  D324(%rip),%xmm0
  movsd  %xmm0,(%rax)
  mov    -0x168(%rbp),%eax
  sub    $0x2,%eax
  mov    %eax,-0x154(%rbp)
  jmp    L165
L148:
  mov    -0x158(%rbp),%eax
  imul   -0x168(%rbp),%eax
  mov    %eax,%edx
  mov    -0x154(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x180(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm1
  mov    -0x158(%rbp),%eax
  imul   -0x168(%rbp),%eax
  mov    %eax,%edx
  mov    -0x154(%rbp),%eax
  add    $0x1,%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x170(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mulsd  %xmm0,%xmm1
  mov    -0x158(%rbp),%eax
  imul   -0x168(%rbp),%eax
  mov    %eax,%edx
  mov    -0x154(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x188(%rbp),%rax
  add    %rdx,%rax
  movsd  (%rax),%xmm0
  mov    -0x158(%rbp),%eax
  imul   -0x168(%rbp),%eax
  mov    %eax,%edx
  mov    -0x154(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x170(%rbp),%rax
  add    %rdx,%rax
  addsd  %xmm1,%xmm0
  movsd  %xmm0,(%rax)
  subl   $0x1,-0x154(%rbp)
L165:
  cmpl   $0x0,-0x154(%rbp)
  jg     L148
  addl   $0x1,-0x158(%rbp)
L19:
  mov    -0x168(%rbp),%eax
  sub    $0x1,%eax
  cmp    %eax,-0x158(%rbp)
  jl     L65
  mov    -0x15c(%rbp),%edx
  lea    -0xc0(%rbp),%rax
  lea    D207(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <sprintf@plt>
  mov    -0x15c(%rbp),%edx
  lea    -0x90(%rbp),%rax
  lea    D207(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <sprintf@plt>
  mov    -0x15c(%rbp),%edx
  lea    -0x60(%rbp),%rax
  lea    D207(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <sprintf@plt>
  mov    -0x15c(%rbp),%edx
  lea    -0x30(%rbp),%rax
  lea    D207(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <sprintf@plt>
  lea    -0xc0(%rbp),%rax
  lea    D103(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcat@plt>
  lea    -0x90(%rbp),%rax
  lea    D275(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcat@plt>
  lea    -0x60(%rbp),%rax
  lea    D117(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcat@plt>
  lea    -0x30(%rbp),%rax
  lea    D150(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcat@plt>
  lea    -0xc0(%rbp),%rax
  lea    D119(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <fopen@plt>
  mov    %rax,-0xe0(%rbp)
  lea    -0x90(%rbp),%rax
  lea    D119(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <fopen@plt>
  mov    %rax,-0xd8(%rbp)
  lea    -0x60(%rbp),%rax
  lea    D119(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <fopen@plt>
  mov    %rax,-0xd0(%rbp)
  lea    -0x30(%rbp),%rax
  lea    D119(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <fopen@plt>
  mov    %rax,-0xc8(%rbp)
  movl   $0x0,-0x150(%rbp)
  jmp    L164
L98:
  movl   $0x0,-0x14c(%rbp)
  jmp    L44
L83:
  mov    -0x150(%rbp),%eax
  imul   -0x168(%rbp),%eax
  mov    %eax,%edx
  mov    -0x14c(%rbp),%eax
  add    %edx,%eax
  cltq
  lea    0x0(,%rax,8),%rdx
  mov    -0x188(%rbp),%rax
  add    %rdx,%rax
  mov    (%rax),%rsi
  mov    -0x14c(%rbp),%ecx
  mov    -0x150(%rbp),%edx
  mov    -0xc8(%rbp),%rax
  movq   %rsi,%xmm0
  lea    D295(%rip),%rsi
  mov    %rax,%rdi
  call   <fprintf@plt>
  addl   $0x1,-0x14c(%rbp)
L44:
  mov    -0x14c(%rbp),%eax
  cmp    -0x168(%rbp),%eax
  jl     L83
  addl   $0x1,-0x150(%rbp)
L164:
  mov    -0x150(%rbp),%eax
  cmp    -0x168(%rbp),%eax
  jl     L98
  mov    -0xe0(%rbp),%rax
  mov    %rax,%rdi
  call   <fclose@plt>
  mov    -0xd8(%rbp),%rax
  mov    %rax,%rdi
  call   <fclose@plt>
  mov    -0xd0(%rbp),%rax
  mov    %rax,%rdi
  call   <fclose@plt>
  mov    -0xc8(%rbp),%rax
  mov    %rax,%rdi
  call   <fclose@plt>
  addl   $0x1,-0x15c(%rbp)
L38:
  mov    -0x15c(%rbp),%eax
  cmp    -0x164(%rbp),%eax
  jle    L3
  nop
  mov    -0x8(%rbp),%rax
  sub    %fs:0x28,%rax
  je     L54
  call   <__stack_chk_fail@plt>
L54:
  leave
  ret
```

tool_calls: name: disassemble_data
arguments: label: D324
data_type: f64
name: disassemble_data
arguments: label: D5
data_type: f64
name: disassemble_data
arguments: label: D279
data_type: f32[2]
name: disassemble_data
arguments: label: D207
data_type: string
name: disassemble_data
arguments: label: D103
data_type: string
name: disassemble_data
arguments: label: D275
data_type: string
name: disassemble_data
arguments: label: D117
data_type: string
name: disassemble_data
arguments: label: D150
data_type: string
name: disassemble_data
arguments: label: D119
data_type: string
name: disassemble_data
arguments: label: D295
data_type: string

tool: D324: 1

tool: D5: 2

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

tool: D207: %d

tool: D103: _simData_u.dat

tool: D275: _simData_v.dat

tool: D117: _simData_p.dat

tool: D150: _simData_q.dat

tool: D119: wb

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