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

```asm
<loop>:
  endbr64
  push   %r15
  mov    $0x1,%r15d
  push   %r14
  lea    D147(%rip),%r14
  push   %r13
  lea    D77(%rip),%r13
  push   %r12
  lea    D8(%rip),%r12
  push   %rbp
  lea    D20(%rip),%rbp
  push   %rbx
  mov    %rbp,%rdi
  lea    D79(%rip),%rbx
  sub    $0xb8,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0xa8(%rsp)
  xor    %eax,%eax
  call   <readDbl@plt>
  mov    %r12,%rdi
  movsd  %xmm0,0x8(%rsp)
  call   <readDbl@plt>
  mov    %r13,%rdi
  movsd  %xmm0,0x18(%rsp)
  call   <readDbl@plt>
  mov    %r14,%rdi
  call   <readDbl@plt>
  movsd  D130(%rip),%xmm1
  mov    $0x32,%edi
  mov    D107(%rip),%rax
  movsd  %xmm0,(%rsp)
  movsd  D19(%rip),%xmm0
  movsd  %xmm1,0x78(%rsp)
  movsd  %xmm0,0x60(%rsp)
  movsd  %xmm0,0x70(%rsp)
  movsd  D55(%rip),%xmm0
  movsd  %xmm1,0x98(%rsp)
  movsd  %xmm0,0x88(%rsp)
  movq   $0x0,0x50(%rsp)
  movq   $0x0,0x58(%rsp)
  movq   $0x0,0x68(%rsp)
  mov    %rax,0x80(%rsp)
  movq   $0x0,0x90(%rsp)
  call   <beginScene@plt>
  mov    $0xff,%ecx
  xor    %edx,%edx
  xor    %esi,%esi
  mov    $0xff,%r8d
  mov    %rbx,%rdi
  call   <setColor@plt>
  mov    D55(%rip),%rax
  mov    %rbx,%rdi
  movq   %rax,%xmm0
  call   <setStroke@plt>
  lea    0x50(%rsp),%rax
  pxor   %xmm1,%xmm1
  mov    %r15,%rdx
  movsd  (%rsp),%xmm8
  mov    %rax,%rcx
  mov    %rax,0x10(%rsp)
  movapd %xmm1,%xmm3
  mov    $0x1,%eax
  mov    %rcx,%r15
  movsd  %xmm8,0x20(%rsp)
L14:
  mov    $0xcccccccd,%ecx
  mov    %rbx,%rdi
  mov    %rdx,(%rsp)
  add    $0x10,%r15
  imul   %rcx,%rax
  movsd  -0x10(%r15),%xmm0
  shr    $0x22,%rax
  lea    (%rax,%rax,4),%esi
  mov    %edx,%eax
  sub    %esi,%eax
  cltq
  shl    $0x4,%rax
  movsd  0x50(%rsp,%rax,1),%xmm2
  call   <drawLine@plt>
  mov    (%rsp),%rdx
  add    $0x1,%rdx
  cmp    $0x6,%rdx
  je     L34
  mov    %edx,%eax
  mov    $0xcccccccd,%esi
  movsd  0x8(%r15),%xmm1
  imul   %rax,%rsi
  shr    $0x22,%rsi
  lea    (%rsi,%rsi,4),%edi
  mov    %edx,%esi
  sub    %edi,%esi
  movslq %esi,%rsi
  shl    $0x4,%rsi
  movsd  0x58(%rsp,%rsi,1),%xmm3
  jmp    L14
L34:
  movsd  0x8(%rsp),%xmm6
  movsd  0x18(%rsp),%xmm7
  xor    %eax,%eax
  lea    0x48(%rsp),%r15
  movsd  0x20(%rsp),%xmm8
  movsd  %xmm6,0x28(%rsp)
  movsd  %xmm7,0x8(%rsp)
  movsd  %xmm8,(%rsp)
  call   <endScene@plt>
  movsd  0x8(%rsp),%xmm7
  movsd  (%rsp),%xmm8
  movq   $0x1,0x38(%rsp)
  pxor   %xmm2,%xmm2
  lea    0x40(%rsp),%rax
  movsd  0x28(%rsp),%xmm6
  mov    %rax,0x30(%rsp)
  movapd %xmm7,%xmm1
  mov    $0x1,%eax
  movsd  %xmm2,0x20(%rsp)
  movsd  %xmm2,0x18(%rsp)
  movapd %xmm8,%xmm2
L29:
  mov    $0xcccccccd,%ecx
  xor    %ebx,%ebx
  imul   %rcx,%rax
  shr    $0x22,%rax
  lea    (%rax,%rax,4),%edx
  mov    0x38(%rsp),%eax
  sub    %edx,%eax
  cltq
  shl    $0x4,%rax
  add    $0xb0,%rax
  add    %rsp,%rax
  mov    %rax,0x28(%rsp)
  mov    %r15,%rax
  mov    %ebx,%r15d
  mov    %rax,%rbx
  xchg   %ax,%ax
L20:
  mov    0x10(%rsp),%rax
  movsd  D72(%rip),%xmm4
  pxor   %xmm5,%xmm5
  mov    %rbx,%rsi
  cvtsi2sd %r15d,%xmm5
  mov    0x30(%rsp),%rdi
  add    $0x1,%r15d
  divsd  D78(%rip),%xmm5
  movsd  (%rax),%xmm3
  mov    0x28(%rsp),%rax
  subsd  %xmm5,%xmm4
  movsd  -0x60(%rax),%xmm0
  mulsd  %xmm4,%xmm3
  mulsd  %xmm5,%xmm0
  mulsd  0x18(%rsp),%xmm4
  mulsd  0x20(%rsp),%xmm5
  addsd  %xmm0,%xmm3
  movapd %xmm6,%xmm0
  addsd  %xmm5,%xmm4
  movsd  %xmm3,(%rsp)
  movsd  %xmm4,0x8(%rsp)
  call   <control_to@plt>
  movsd  0x40(%rsp),%xmm0
  lea    D89(%rip),%rdi
  call   <writeDbl@plt>
  movsd  0x48(%rsp),%xmm0
  lea    D74(%rip),%rdi
  call   <writeDbl@plt>
  movsd  0x8(%rsp),%xmm4
  movsd  (%rsp),%xmm3
  lea    D95(%rip),%rdi
  movapd %xmm4,%xmm1
  movapd %xmm3,%xmm0
  call   <paintPoint@plt>
  mov    $0x64,%edi
  call   <sleep_ms@plt>
  mov    %rbp,%rdi
  call   <readDbl@plt>
  mov    %r12,%rdi
  movsd  %xmm0,0x8(%rsp)
  call   <readDbl@plt>
  mov    %r13,%rdi
  movsd  %xmm0,(%rsp)
  call   <readDbl@plt>
  mov    %r14,%rdi
  call   <readDbl@plt>
  cmp    $0x64,%r15d
  movsd  (%rsp),%xmm1
  movsd  0x8(%rsp),%xmm6
  movapd %xmm0,%xmm2
  jne    L20
  addq   $0x1,0x38(%rsp)
  mov    0x38(%rsp),%rax
  mov    %rbx,%r15
  addq   $0x10,0x10(%rsp)
  mov    0x10(%rsp),%rcx
  mov    %rax,%rbx
  cmp    $0x6,%rax
  je     L7
  mov    %eax,%eax
  mov    $0xcccccccd,%edx
  movsd  0x8(%rcx),%xmm7
  imul   %rax,%rdx
  movsd  %xmm7,0x18(%rsp)
  shr    $0x22,%rdx
  lea    (%rdx,%rdx,4),%ecx
  mov    %ebx,%edx
  sub    %ecx,%edx
  movslq %edx,%rdx
  shl    $0x4,%rdx
  movsd  0x58(%rsp,%rdx,1),%xmm7
  movsd  %xmm7,0x20(%rsp)
  jmp    L29
L7:
  mov    0xa8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L5
  add    $0xb8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L5:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: extract_symbolic_data
arguments: data_tag: D147
type: string
name: extract_symbolic_data
arguments: data_tag: D77
type: string
name: extract_symbolic_data
arguments: data_tag: D8
type: string
name: extract_symbolic_data
arguments: data_tag: D20
type: string
name: extract_symbolic_data
arguments: data_tag: D79
type: string
name: extract_symbolic_data
arguments: data_tag: D130
type: f32[2]
name: extract_symbolic_data
arguments: data_tag: D107
type: f32[2]
name: extract_symbolic_data
arguments: data_tag: D19
type: f32[2]
name: extract_symbolic_data
arguments: data_tag: D55
type: f64
name: extract_symbolic_data
arguments: data_tag: D72
type: f64
name: extract_symbolic_data
arguments: data_tag: D78
type: f64
name: extract_symbolic_data
arguments: data_tag: D89
type: string
name: extract_symbolic_data
arguments: data_tag: D74
type: string
name: extract_symbolic_data
arguments: data_tag: D95
type: string

tool: D147: robot.theta

tool: D77: robot.vel

tool: D8: robot.py

tool: D20: robot.px

tool: D79: route

tool: {"D130": [0.0,2.25]}

tool: {"D107": [0.0,2.125]}

tool: {"D19": [0.0,2.375]}

tool: D55: 2

tool: D72: 1

tool: D78: 100

tool: D89: thrust

tool: D74: aileron

tool: D95: destine

assistant: ```c
void loop() {
  double px = readDbl("robot.px");
  double py = readDbl("robot.py");
  double vel = readDbl("robot.vel");
  double theta = readDbl("robot.theta");
  int N = 5;
  double waypoints[N][2];
  waypoints[0][0] = 0;
  waypoints[0][1] = 0;
  waypoints[1][0] = 6;
  waypoints[1][1] = 0;
  waypoints[2][0] = 6;
  waypoints[2][1] = 4;
  waypoints[3][0] = 3;
  waypoints[3][1] = 2;
  waypoints[4][0] = 0;
  waypoints[4][1] = 4;
  int n, t;
  beginScene(50);
  setColor("route", 0, 0, 255, 255);
  setStroke("route", 2.0);
  for (n = 0; n < N; n++) {
    t = (n + 1) % N;
    drawLine("route", waypoints[n][0], waypoints[n][1], waypoints[t][0], waypoints[t][1]);
  }
  endScene();
  for (n = 0; n < N; n++) {
    for (t = 0; t < 100; t++) {
      double lambda = t / 100.0;
      double dx = waypoints[n][0] * (1 - lambda) + waypoints[(n + 1) % N][0] * lambda;
      double dy = waypoints[n][1] * (1 - lambda) + waypoints[(n + 1) % N][1] * lambda;
      double thrust, aileron;
      control_to(px, py, theta, dx, dy, &thrust, &aileron);
      writeDbl("thrust", thrust);
      writeDbl("aileron", aileron);
      paintPoint("destine", dx, dy);
      sleep_ms(100);
      px = readDbl("robot.px");
      py = readDbl("robot.py");
      vel = readDbl("robot.vel");
      theta = readDbl("robot.theta");
    }
  }
}
```