user: Converte this assembly snippet into its equivalent C code:

```asm
<latLongToOsGrid>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x170,%rsp
  mov    %rdi,-0x158(%rbp)
  mov    %rsi,-0x160(%rbp)
  mov    -0x158(%rbp),%rax
  movsd  (%rax),%xmm1
  movsd  D181(%rip),%xmm0
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,-0x140(%rbp)
  mov    -0x160(%rbp),%rax
  movsd  (%rax),%xmm1
  movsd  D181(%rip),%xmm0
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,-0x138(%rbp)
  movsd  D223(%rip),%xmm0
  movsd  %xmm0,-0x130(%rbp)
  movsd  D233(%rip),%xmm0
  movsd  %xmm0,-0x128(%rbp)
  movsd  D224(%rip),%xmm0
  movsd  %xmm0,-0x120(%rbp)
  movsd  D37(%rip),%xmm0
  movsd  %xmm0,-0x118(%rbp)
  movsd  D25(%rip),%xmm0
  movsd  %xmm0,-0x110(%rbp)
  movl   $0xfffe7960,-0x148(%rbp)
  movl   $0x61a80,-0x144(%rbp)
  movsd  -0x128(%rbp),%xmm0
  movapd %xmm0,%xmm1
  mulsd  %xmm0,%xmm1
  movsd  -0x130(%rbp),%xmm0
  mulsd  %xmm0,%xmm0
  divsd  %xmm0,%xmm1
  movsd  D102(%rip),%xmm0
  subsd  %xmm1,%xmm0
  movsd  %xmm0,-0x108(%rbp)
  movsd  -0x130(%rbp),%xmm0
  subsd  -0x128(%rbp),%xmm0
  movsd  -0x130(%rbp),%xmm1
  addsd  -0x128(%rbp),%xmm1
  divsd  %xmm1,%xmm0
  movsd  %xmm0,-0x100(%rbp)
  movsd  -0x100(%rbp),%xmm0
  mulsd  %xmm0,%xmm0
  movsd  %xmm0,-0xf8(%rbp)
  movsd  -0x100(%rbp),%xmm0
  mulsd  %xmm0,%xmm0
  movsd  -0x100(%rbp),%xmm1
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,-0xf0(%rbp)
  movsd  -0x140(%rbp),%xmm0
  cvttsd2si %xmm0,%eax
  mov    %eax,%edi
  call   <cos@plt>
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  movsd  %xmm0,-0xe8(%rbp)
  movsd  -0x140(%rbp),%xmm0
  cvttsd2si %xmm0,%eax
  mov    %eax,%edi
  call   <sin@plt>
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  movsd  %xmm0,-0xe0(%rbp)
  movsd  -0x130(%rbp),%xmm0
  mulsd  -0x120(%rbp),%xmm0
  movsd  %xmm0,-0x168(%rbp)
  movsd  -0x108(%rbp),%xmm0
  mulsd  -0xe0(%rbp),%xmm0
  movapd %xmm0,%xmm1
  mulsd  -0xe0(%rbp),%xmm1
  movsd  D102(%rip),%xmm0
  subsd  %xmm1,%xmm0
  cvttsd2si %xmm0,%eax
  mov    %eax,%edi
  call   <sqrt@plt>
  movapd %xmm0,%xmm1
  movsd  -0x168(%rbp),%xmm0
  divsd  %xmm1,%xmm0
  movsd  %xmm0,-0xd8(%rbp)
  movsd  -0x130(%rbp),%xmm0
  movapd %xmm0,%xmm1
  mulsd  -0x120(%rbp),%xmm1
  movsd  D102(%rip),%xmm0
  subsd  -0x108(%rbp),%xmm0
  mulsd  %xmm0,%xmm1
  movsd  %xmm1,-0x168(%rbp)
  movsd  -0x108(%rbp),%xmm0
  mulsd  -0xe0(%rbp),%xmm0
  movapd %xmm0,%xmm4
  mulsd  -0xe0(%rbp),%xmm4
  movapd %xmm4,%xmm1
  movsd  D102(%rip),%xmm0
  subsd  %xmm1,%xmm0
  cvttsd2si %xmm0,%eax
  mov    D13(%rip),%rdx
  movq   %rdx,%xmm0
  mov    %eax,%edi
  call   <pow@plt>
  movapd %xmm0,%xmm1
  movsd  -0x168(%rbp),%xmm0
  divsd  %xmm1,%xmm0
  movsd  %xmm0,-0xd0(%rbp)
  movsd  -0xd8(%rbp),%xmm0
  divsd  -0xd0(%rbp),%xmm0
  movsd  D102(%rip),%xmm1
  subsd  %xmm1,%xmm0
  movsd  %xmm0,-0xc8(%rbp)
  movsd  -0x100(%rbp),%xmm1
  movsd  D102(%rip),%xmm0
  addsd  %xmm1,%xmm0
  addsd  -0xf8(%rbp),%xmm0
  movapd %xmm0,%xmm1
  addsd  -0xf0(%rbp),%xmm1
  movsd  -0x140(%rbp),%xmm0
  subsd  -0x118(%rbp),%xmm0
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,-0xc0(%rbp)
  movsd  -0x100(%rbp),%xmm1
  movsd  D97(%rip),%xmm0
  mulsd  %xmm0,%xmm1
  movsd  -0x100(%rbp),%xmm2
  movsd  D97(%rip),%xmm0
  mulsd  %xmm2,%xmm0
  mulsd  -0x100(%rbp),%xmm0
  addsd  %xmm0,%xmm1
  movsd  -0xf0(%rbp),%xmm0
  addsd  %xmm0,%xmm0
  addsd  %xmm0,%xmm1
  movsd  %xmm1,-0x168(%rbp)
  movsd  -0x140(%rbp),%xmm0
  subsd  -0x118(%rbp),%xmm0
  cvttsd2si %xmm0,%eax
  mov    %eax,%edi
  call   <sin@plt>
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  mulsd  -0x168(%rbp),%xmm0
  movsd  %xmm0,-0x168(%rbp)
  movsd  -0x140(%rbp),%xmm0
  addsd  -0x118(%rbp),%xmm0
  cvttsd2si %xmm0,%eax
  mov    %eax,%edi
  call   <cos@plt>
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  mulsd  -0x168(%rbp),%xmm0
  movsd  %xmm0,-0xb8(%rbp)
  movsd  -0xf8(%rbp),%xmm0
  addsd  -0xf0(%rbp),%xmm0
  movsd  %xmm0,-0x168(%rbp)
  movsd  -0x140(%rbp),%xmm0
  subsd  -0x118(%rbp),%xmm0
  addsd  %xmm0,%xmm0
  cvttsd2si %xmm0,%eax
  mov    %eax,%edi
  call   <sin@plt>
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  movapd %xmm0,%xmm7
  mulsd  -0x168(%rbp),%xmm7
  movsd  %xmm7,-0x168(%rbp)
  movsd  -0x140(%rbp),%xmm0
  addsd  -0x118(%rbp),%xmm0
  addsd  %xmm0,%xmm0
  cvttsd2si %xmm0,%eax
  mov    %eax,%edi
  call   <cos@plt>
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  mulsd  -0x168(%rbp),%xmm0
  movsd  %xmm0,-0xb0(%rbp)
  movsd  -0x140(%rbp),%xmm0
  movapd %xmm0,%xmm1
  subsd  -0x118(%rbp),%xmm1
  movsd  D97(%rip),%xmm0
  mulsd  %xmm1,%xmm0
  cvttsd2si %xmm0,%eax
  mov    %eax,%edi
  call   <sin@plt>
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  mulsd  -0xf0(%rbp),%xmm0
  movsd  %xmm0,-0x168(%rbp)
  movsd  -0x140(%rbp),%xmm0
  movapd %xmm0,%xmm1
  addsd  -0x118(%rbp),%xmm1
  movsd  D97(%rip),%xmm0
  mulsd  %xmm1,%xmm0
  cvttsd2si %xmm0,%eax
  mov    %eax,%edi
  call   <cos@plt>
  pxor   %xmm0,%xmm0
  cvtsi2sd %eax,%xmm0
  mulsd  -0x168(%rbp),%xmm0
  movsd  %xmm0,-0xa8(%rbp)
  movsd  -0x128(%rbp),%xmm0
  movapd %xmm0,%xmm1
  mulsd  -0x120(%rbp),%xmm1
  movsd  -0xc0(%rbp),%xmm0
  subsd  -0xb8(%rbp),%xmm0
  addsd  -0xb0(%rbp),%xmm0
  subsd  -0xa8(%rbp),%xmm0
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,-0xa0(%rbp)
  movsd  -0xe8(%rbp),%xmm0
  mulsd  %xmm0,%xmm0
  movsd  -0xe8(%rbp),%xmm1
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,-0x98(%rbp)
  movsd  -0x98(%rbp),%xmm0
  mulsd  -0xe8(%rbp),%xmm0
  movsd  -0xe8(%rbp),%xmm1
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,-0x90(%rbp)
  mov    -0x140(%rbp),%rax
  movq   %rax,%xmm0
  call   <tan@plt>
  movsd  %xmm0,-0x168(%rbp)
  mov    -0x140(%rbp),%rax
  movq   %rax,%xmm0
  call   <tan@plt>
  mulsd  -0x168(%rbp),%xmm0
  movsd  %xmm0,-0x88(%rbp)
  movsd  -0x88(%rbp),%xmm0
  mulsd  %xmm0,%xmm0
  movsd  %xmm0,-0x80(%rbp)
  pxor   %xmm0,%xmm0
  cvtsi2sdl -0x148(%rbp),%xmm0
  movsd  -0xa0(%rbp),%xmm1
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x78(%rbp)
  movsd  -0xd8(%rbp),%xmm0
  movsd  D288(%rip),%xmm1
  divsd  %xmm1,%xmm0
  mulsd  -0xe0(%rbp),%xmm0
  movsd  -0xe8(%rbp),%xmm1
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,-0x70(%rbp)
  movsd  -0xd8(%rbp),%xmm0
  movsd  D267(%rip),%xmm1
  divsd  %xmm1,%xmm0
  mulsd  -0xe0(%rbp),%xmm0
  movapd %xmm0,%xmm1
  mulsd  -0x98(%rbp),%xmm1
  movsd  D190(%rip),%xmm0
  movapd %xmm0,%xmm2
  subsd  -0x88(%rbp),%xmm2
  movsd  -0xc8(%rbp),%xmm3
  movsd  D162(%rip),%xmm0
  mulsd  %xmm3,%xmm0
  addsd  %xmm2,%xmm0
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,-0x68(%rbp)
  movsd  -0xd8(%rbp),%xmm0
  movsd  D165(%rip),%xmm1
  divsd  %xmm1,%xmm0
  mulsd  -0xe0(%rbp),%xmm0
  movapd %xmm0,%xmm1
  mulsd  -0x90(%rbp),%xmm1
  movsd  -0x88(%rbp),%xmm2
  movsd  D211(%rip),%xmm0
  mulsd  %xmm0,%xmm2
  movsd  D250(%rip),%xmm0
  subsd  %xmm2,%xmm0
  addsd  -0x80(%rbp),%xmm0
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,-0x60(%rbp)
  movsd  -0xd8(%rbp),%xmm0
  mulsd  -0xe8(%rbp),%xmm0
  movsd  %xmm0,-0x58(%rbp)
  movsd  -0xd8(%rbp),%xmm0
  movsd  D21(%rip),%xmm1
  divsd  %xmm1,%xmm0
  movapd %xmm0,%xmm1
  mulsd  -0x98(%rbp),%xmm1
  movsd  -0xd8(%rbp),%xmm0
  divsd  -0xd0(%rbp),%xmm0
  subsd  -0x88(%rbp),%xmm0
  mulsd  %xmm1,%xmm0
  movsd  %xmm0,-0x50(%rbp)
  movsd  -0xd8(%rbp),%xmm0
  movsd  D129(%rip),%xmm1
  divsd  %xmm1,%xmm0
  movapd %xmm0,%xmm2
  mulsd  -0x90(%rbp),%xmm2
  movsd  -0x88(%rbp),%xmm1
  movsd  D205(%rip),%xmm0
  mulsd  %xmm0,%xmm1
  movsd  D190(%rip),%xmm0
  subsd  %xmm1,%xmm0
  movapd %xmm0,%xmm1
  addsd  -0x80(%rbp),%xmm1
  movsd  -0xc8(%rbp),%xmm3
  movsd  D146(%rip),%xmm0
  mulsd  %xmm3,%xmm0
  addsd  %xmm1,%xmm0
  movsd  -0x88(%rbp),%xmm3
  movsd  D211(%rip),%xmm1
  mulsd  %xmm3,%xmm1
  mulsd  -0xc8(%rbp),%xmm1
  subsd  %xmm1,%xmm0
  mulsd  %xmm2,%xmm0
  movsd  %xmm0,-0x48(%rbp)
  movsd  -0x138(%rbp),%xmm0
  subsd  -0x110(%rbp),%xmm0
  movsd  %xmm0,-0x40(%rbp)
  movsd  -0x40(%rbp),%xmm0
  mulsd  %xmm0,%xmm0
  movsd  %xmm0,-0x38(%rbp)
  movsd  -0x38(%rbp),%xmm0
  mulsd  -0x40(%rbp),%xmm0
  movsd  %xmm0,-0x30(%rbp)
  movsd  -0x30(%rbp),%xmm0
  mulsd  -0x40(%rbp),%xmm0
  movsd  %xmm0,-0x28(%rbp)
  movsd  -0x28(%rbp),%xmm0
  mulsd  -0x40(%rbp),%xmm0
  movsd  %xmm0,-0x20(%rbp)
  movsd  -0x20(%rbp),%xmm0
  mulsd  -0x40(%rbp),%xmm0
  movsd  %xmm0,-0x18(%rbp)
  movsd  -0x70(%rbp),%xmm0
  mulsd  -0x38(%rbp),%xmm0
  movapd %xmm0,%xmm1
  addsd  -0x78(%rbp),%xmm1
  movsd  -0x68(%rbp),%xmm0
  mulsd  -0x28(%rbp),%xmm0
  addsd  %xmm0,%xmm1
  movsd  -0x60(%rbp),%xmm0
  mulsd  -0x18(%rbp),%xmm0
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x10(%rbp)
  pxor   %xmm1,%xmm1
  cvtsi2sdl -0x144(%rbp),%xmm1
  movsd  -0x58(%rbp),%xmm0
  mulsd  -0x40(%rbp),%xmm0
  addsd  %xmm0,%xmm1
  movsd  -0x50(%rbp),%xmm0
  mulsd  -0x30(%rbp),%xmm0
  addsd  %xmm0,%xmm1
  movsd  -0x48(%rbp),%xmm0
  mulsd  -0x20(%rbp),%xmm0
  addsd  %xmm1,%xmm0
  movsd  %xmm0,-0x8(%rbp)
  mov    -0x158(%rbp),%rax
  movsd  -0x8(%rbp),%xmm0
  movsd  %xmm0,(%rax)
  mov    -0x160(%rbp),%rax
  movsd  -0x10(%rbp),%xmm0
  movsd  %xmm0,(%rax)
  nop
  leave
  ret
```

tool_calls: name: extract_symbolic_data
arguments: tag: D181
type: byte[8]
name: extract_symbolic_data
arguments: tag: D223
type: f64
name: extract_symbolic_data
arguments: tag: D233
type: f64
name: extract_symbolic_data
arguments: tag: D224
type: f64
name: extract_symbolic_data
arguments: tag: D37
type: byte[8]
name: extract_symbolic_data
arguments: tag: D25
type: byte[8]
name: extract_symbolic_data
arguments: tag: D102
type: f64
name: extract_symbolic_data
arguments: tag: D13
type: f64
name: extract_symbolic_data
arguments: tag: D97
type: f64
name: extract_symbolic_data
arguments: tag: D288
type: f64
name: extract_symbolic_data
arguments: tag: D267
type: f64
name: extract_symbolic_data
arguments: tag: D190
type: f64
name: extract_symbolic_data
arguments: tag: D162
type: f64
name: extract_symbolic_data
arguments: tag: D165
type: f64
name: extract_symbolic_data
arguments: tag: D211
type: f64
name: extract_symbolic_data
arguments: tag: D250
type: f64
name: extract_symbolic_data
arguments: tag: D21
type: f64
name: extract_symbolic_data
arguments: tag: D129
type: f64
name: extract_symbolic_data
arguments: tag: D205
type: f64
name: extract_symbolic_data
arguments: tag: D146
type: f64

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

tool: D223: 6377563.396

tool: D233: 6356256.909

tool: D224: 0.9996012717

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

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

tool: D102: 1

tool: D13: 1.5

tool: D97: 3

tool: D288: 2

tool: D267: 24

tool: D190: 5

tool: D162: 9

tool: D165: 720

tool: D211: 58

tool: D250: 61

tool: D21: 6

tool: D129: 120

tool: D205: 18

tool: D146: 14

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;
}
```