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

```asm
<latLongToOsGrid>:
  endbr64
  push   %r13
  push   %r12
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  mov    %rsi,%rbx
  sub    $0x68,%rsp
  movsd  D24(%rip),%xmm0
  movsd  (%rdi),%xmm6
  movsd  (%rsi),%xmm4
  mulsd  %xmm0,%xmm6
  mulsd  %xmm0,%xmm4
  cvttsd2si %xmm6,%r12d
  movsd  %xmm6,0x8(%rsp)
  movsd  %xmm4,0x58(%rsp)
  mov    %r12d,%edi
  call   <cos@plt>
  pxor   %xmm5,%xmm5
  mov    %r12d,%edi
  cvtsi2sd %eax,%xmm5
  movsd  %xmm5,0x28(%rsp)
  call   <sin@plt>
  pxor   %xmm6,%xmm6
  movsd  D215(%rip),%xmm0
  movsd  D44(%rip),%xmm1
  cvtsi2sd %eax,%xmm6
  mulsd  %xmm6,%xmm0
  movsd  %xmm6,0x50(%rsp)
  mulsd  %xmm6,%xmm0
  subsd  %xmm0,%xmm1
  cvttsd2si %xmm1,%r12d
  mov    %r12d,%edi
  call   <sqrt@plt>
  movsd  D82(%rip),%xmm1
  mov    %r12d,%edi
  divsd  %xmm0,%xmm1
  movsd  D27(%rip),%xmm0
  movsd  %xmm1,(%rsp)
  call   <pow@plt>
  movsd  (%rsp),%xmm1
  movsd  0x8(%rsp),%xmm3
  movapd %xmm0,%xmm2
  movsd  D234(%rip),%xmm0
  subsd  D81(%rip),%xmm3
  movapd %xmm1,%xmm9
  movsd  %xmm1,0x48(%rsp)
  divsd  %xmm2,%xmm0
  cvttsd2si %xmm3,%edi
  movsd  %xmm3,(%rsp)
  divsd  %xmm0,%xmm9
  movapd %xmm9,%xmm7
  subsd  D44(%rip),%xmm7
  movsd  %xmm9,0x40(%rsp)
  movsd  %xmm7,0x38(%rsp)
  call   <sin@plt>
  movsd  D81(%rip),%xmm2
  addsd  0x8(%rsp),%xmm2
  mov    %eax,%r12d
  cvttsd2si %xmm2,%edi
  movsd  %xmm2,0x10(%rsp)
  call   <cos@plt>
  pxor   %xmm0,%xmm0
  pxor   %xmm3,%xmm3
  movsd  (%rsp),%xmm5
  cvtsi2sd %r12d,%xmm0
  mulsd  D146(%rip),%xmm0
  cvtsi2sd %eax,%xmm3
  movapd %xmm0,%xmm7
  mulsd  %xmm3,%xmm7
  movapd %xmm5,%xmm3
  addsd  %xmm5,%xmm3
  cvttsd2si %xmm3,%edi
  movsd  %xmm7,0x18(%rsp)
  call   <sin@plt>
  movsd  0x10(%rsp),%xmm2
  mov    %eax,%r12d
  movapd %xmm2,%xmm1
  addsd  %xmm2,%xmm1
  cvttsd2si %xmm1,%edi
  call   <cos@plt>
  pxor   %xmm0,%xmm0
  pxor   %xmm3,%xmm3
  cvtsi2sd %r12d,%xmm0
  mulsd  D90(%rip),%xmm0
  cvtsi2sd %eax,%xmm3
  movapd %xmm0,%xmm1
  movsd  D214(%rip),%xmm0
  mulsd  (%rsp),%xmm0
  mulsd  %xmm3,%xmm1
  cvttsd2si %xmm0,%edi
  movsd  %xmm1,0x20(%rsp)
  call   <sin@plt>
  movsd  0x10(%rsp),%xmm2
  mulsd  D214(%rip),%xmm2
  mov    %eax,%r13d
  cvttsd2si %xmm2,%edi
  call   <cos@plt>
  movsd  0x28(%rsp),%xmm5
  movsd  0x8(%rsp),%xmm0
  mov    %eax,%r12d
  movapd %xmm5,%xmm8
  movapd %xmm5,%xmm3
  mulsd  %xmm5,%xmm8
  mulsd  %xmm5,%xmm8
  mulsd  %xmm8,%xmm3
  movsd  %xmm8,0x30(%rsp)
  movapd %xmm3,%xmm7
  mulsd  %xmm5,%xmm7
  movsd  %xmm7,0x10(%rsp)
  call   <tan@plt>
  movsd  D185(%rip),%xmm2
  movsd  D308(%rip),%xmm8
  movapd %xmm0,%xmm3
  movsd  0x38(%rsp),%xmm7
  movsd  D153(%rip),%xmm12
  mulsd  %xmm0,%xmm3
  movsd  0x58(%rsp),%xmm4
  movsd  D196(%rip),%xmm0
  movsd  0x48(%rsp),%xmm1
  movsd  0x28(%rsp),%xmm5
  addsd  %xmm4,%xmm0
  movsd  0x10(%rsp),%xmm4
  movsd  0x50(%rsp),%xmm6
  movapd %xmm1,%xmm9
  divsd  D289(%rip),%xmm9
  mulsd  %xmm3,%xmm8
  movapd %xmm3,%xmm11
  movapd %xmm0,%xmm14
  mulsd  %xmm3,%xmm11
  movapd %xmm0,%xmm15
  movapd %xmm0,%xmm13
  mulsd  %xmm3,%xmm12
  movapd %xmm0,%xmm10
  mulsd  %xmm0,%xmm14
  subsd  %xmm8,%xmm2
  movsd  D158(%rip),%xmm8
  mulsd  %xmm7,%xmm8
  addsd  %xmm11,%xmm2
  mulsd  %xmm14,%xmm15
  addsd  %xmm8,%xmm2
  movapd %xmm12,%xmm8
  mulsd  %xmm7,%xmm8
  mulsd  %xmm15,%xmm13
  mulsd  D243(%rip),%xmm7
  subsd  %xmm8,%xmm2
  movapd %xmm1,%xmm8
  divsd  D65(%rip),%xmm8
  mulsd  %xmm8,%xmm4
  movsd  0x30(%rsp),%xmm8
  mulsd  %xmm13,%xmm10
  mulsd  %xmm4,%xmm2
  movapd %xmm9,%xmm4
  movsd  0x40(%rsp),%xmm9
  mulsd  %xmm8,%xmm4
  subsd  %xmm3,%xmm9
  mulsd  %xmm10,%xmm2
  mulsd  %xmm9,%xmm4
  movapd %xmm5,%xmm9
  mulsd  %xmm1,%xmm9
  mulsd  %xmm15,%xmm4
  mulsd  %xmm0,%xmm9
  addsd  D61(%rip),%xmm9
  mulsd  %xmm10,%xmm0
  addsd  %xmm9,%xmm4
  pxor   %xmm9,%xmm9
  cvtsi2sd %r13d,%xmm9
  mulsd  D78(%rip),%xmm9
  addsd  %xmm4,%xmm2
  pxor   %xmm4,%xmm4
  cvtsi2sd %r12d,%xmm4
  movsd  %xmm2,0x0(%rbp)
  movsd  (%rsp),%xmm2
  mulsd  D111(%rip),%xmm2
  subsd  0x18(%rsp),%xmm2
  addsd  0x20(%rsp),%xmm2
  mulsd  %xmm9,%xmm4
  subsd  %xmm4,%xmm2
  movsd  D256(%rip),%xmm4
  mulsd  D117(%rip),%xmm2
  subsd  D119(%rip),%xmm2
  mulsd  %xmm1,%xmm4
  mulsd  %xmm6,%xmm4
  mulsd  %xmm5,%xmm4
  movsd  D185(%rip),%xmm5
  subsd  %xmm3,%xmm5
  mulsd  %xmm14,%xmm4
  addsd  %xmm5,%xmm7
  addsd  %xmm4,%xmm2
  movapd %xmm1,%xmm4
  divsd  D108(%rip),%xmm4
  divsd  D141(%rip),%xmm1
  mulsd  %xmm6,%xmm4
  mulsd  %xmm6,%xmm1
  mulsd  0x10(%rsp),%xmm1
  mulsd  %xmm8,%xmm4
  mulsd  %xmm4,%xmm7
  mulsd  %xmm13,%xmm7
  addsd  %xmm2,%xmm7
  movsd  D176(%rip),%xmm2
  subsd  %xmm12,%xmm2
  addsd  %xmm11,%xmm2
  mulsd  %xmm2,%xmm1
  mulsd  %xmm1,%xmm0
  addsd  %xmm0,%xmm7
  movsd  %xmm7,(%rbx)
  add    $0x68,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
```

tool_calls: name: extract_symbolic_data
arguments: tag: D24
datatype: byte[8]
name: extract_symbolic_data
arguments: tag: D215
datatype: byte[8]
name: extract_symbolic_data
arguments: tag: D44
datatype: f64
name: extract_symbolic_data
arguments: tag: D82
datatype: byte[8]
name: extract_symbolic_data
arguments: tag: D27
datatype: f64
name: extract_symbolic_data
arguments: tag: D234
datatype: byte[8]
name: extract_symbolic_data
arguments: tag: D81
datatype: byte[8]
name: extract_symbolic_data
arguments: tag: D146
datatype: byte[8]
name: extract_symbolic_data
arguments: tag: D90
datatype: byte[8]
name: extract_symbolic_data
arguments: tag: D214
datatype: f64
name: extract_symbolic_data
arguments: tag: D185
datatype: f64
name: extract_symbolic_data
arguments: tag: D308
datatype: f64
name: extract_symbolic_data
arguments: tag: D153
datatype: f64
name: extract_symbolic_data
arguments: tag: D196
datatype: byte[8]
name: extract_symbolic_data
arguments: tag: D289
datatype: f64
name: extract_symbolic_data
arguments: tag: D158
datatype: f64
name: extract_symbolic_data
arguments: tag: D243
datatype: f64
name: extract_symbolic_data
arguments: tag: D65
datatype: f64
name: extract_symbolic_data
arguments: tag: D61
datatype: byte[8]
name: extract_symbolic_data
arguments: tag: D78
datatype: byte[8]
name: extract_symbolic_data
arguments: tag: D111
datatype: byte[8]
name: extract_symbolic_data
arguments: tag: D256
datatype: byte[8]
name: extract_symbolic_data
arguments: tag: D117
datatype: byte[8]
name: extract_symbolic_data
arguments: tag: D119
datatype: byte[8]
name: extract_symbolic_data
arguments: tag: D108
datatype: f64
name: extract_symbolic_data
arguments: tag: D141
datatype: f64
name: extract_symbolic_data
arguments: tag: D176
datatype: f64

tool: {"D24": [0x39,0x9d,0x52,0xa2,0x46,0xdf,0x91,0x3f]}

tool: {"D215": [0x00,0x2a,0x71,0x77,0x91,0x52,0x7b,0x3f]}

tool: D44: 1

tool: {"D82": [0xf7,0x85,0xc8,0x1e,0x9b,0x51,0x58,0x41]}

tool: D27: 1.5

tool: {"D234": [0x18,0x7d,0xb0,0xe9,0x13,0x28,0x58,0x41]}

tool: {"D81": [0xbf,0x80,0x8e,0x28,0xe4,0x5d,0xeb,0x3f]}

tool: {"D146": [0xc1,0xe3,0x0b,0x17,0x50,0x98,0x74,0x3f]}

tool: {"D90": [0x09,0xcf,0xe7,0x1d,0x4c,0x86,0xc7,0x3e]}

tool: D214: 3

tool: D185: 5

tool: D308: 18

tool: D153: 58

tool: {"D196": [0x39,0x9d,0x52,0xa2,0x46,0xdf,0xa1,0x3f]}

tool: D289: 6

tool: D158: 14

tool: D243: 9

tool: D65: 120

tool: {"D61": [0x00,0x00,0x00,0x00,0x00,0x6a,0x18,0x41]}

tool: {"D78": [0xbd,0xe6,0x0c,0xda,0x9d,0x1e,0x34,0x3e]}

tool: {"D111": [0x96,0xfc,0x72,0x70,0xdd,0x06,0xf0,0x3f]}

tool: {"D256": [0x00,0x00,0x00,0x00,0x00,0x00,0xe0,0x3f]}

tool: {"D117": [0xc8,0xc6,0x53,0x9f,0xce,0x3c,0x58,0x41]}

tool: {"D119": [0x00,0x00,0x00,0x00,0x00,0x6a,0xf8,0x40]}

tool: D108: 24

tool: D141: 720

tool: D176: 61

assistant: ```c
void latLongToOsGrid(double *x, double *y) {
  double lat = *x * .0174532925199432958;
  double lon = *y * .0174532925199432958;
  double a = 6377563.396, b = 6356256.909;
  double F0 = 0.9996012717;
  double lat0 = 49 * .0174532925199432958, lon0 = -2 * .0174532925199432958;
  int N0 = -100000, E0 = 400000;
  double e2 = 1 - (b * b) / (a * a);
  double n = (a - b) / (a + b), n2 = n * n, n3 = n * n * n;
  double cosLat = cos(lat), sinLat = sin(lat);
  double nu = a * F0 / sqrt(1 - e2 * sinLat * sinLat);
  double rho = a * F0 * (1 - e2) / pow(1 - e2 * sinLat * sinLat, 1.5);
  double eta2 = nu / rho - 1;
  double Ma = (1 + n + (5 / 4) * n2 + (5 / 4) * n3) * (lat - lat0);
  double Mb = (3 * n + 3 * n * n + (21 / 8) * n3) * sin(lat - lat0) * cos(lat + lat0);
  double Mc = ((15 / 8) * n2 + (15 / 8) * n3) * sin(2 * (lat - lat0)) * cos(2 * (lat + lat0));
  double Md = (35 / 24) * n3 * sin(3 * (lat - lat0)) * cos(3 * (lat + lat0));
  double M = b * F0 * (Ma - Mb + Mc - Md);
  double cos3lat = cosLat * cosLat * cosLat;
  double cos5lat = cos3lat * cosLat * cosLat;
  double tan2lat = tan(lat) * tan(lat);
  double tan4lat = tan2lat * tan2lat;
  double I = M + N0;
  double II = (nu / 2) * sinLat * cosLat;
  double III = (nu / 24) * sinLat * cos3lat * (5 - tan2lat + 9 * eta2);
  double IIIA = (nu / 720) * sinLat * cos5lat * (61 - 58 * tan2lat + tan4lat);
  double IV = nu * cosLat;
  double V = (nu / 6) * cos3lat * (nu / rho - tan2lat);
  double VI = (nu / 120) * cos5lat * (5 - 18 * tan2lat + tan4lat + 14 * eta2 - 58 * tan2lat * eta2);
  double dLon = lon - lon0;
  double dLon2 = dLon * dLon, dLon3 = dLon2 * dLon, dLon4 = dLon3 * dLon, dLon5 = dLon4 * dLon, dLon6 = dLon5 * dLon;
  double N = I + II * dLon2 + III * dLon4 + IIIA * dLon6;
  double E = E0 + IV * dLon + V * dLon3 + VI * dLon5;
  *x = E;
  *y = N;
}
```