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

```asm
<geoMag>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  mov    %rcx,%r13
  push   %r12
  mov    %rsi,%r12
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  mov    %rdx,%rbx
  sub    $0xc8,%rsp
  mov    0x100(%rsp),%rax
  mov    0x138(%rsp),%r11
  mov    %r8,(%rsp)
  lea    0x90(%rsp),%r14
  mov    0x110(%rsp),%r8
  mov    0x140(%rsp),%r10
  mov    %r9,0x8(%rsp)
  mov    %rax,0x10(%rsp)
  mov    0x108(%rsp),%r9
  mov    0x120(%rsp),%rax
  mov    0x128(%rsp),%rdx
  mov    %r8,0x80(%rsp)
  mov    0x130(%rsp),%rsi
  mov    %r9,0x88(%rsp)
  mov    %r11,0x78(%rsp)
  mov    0x118(%rsp),%r15
  mov    %r10,0x70(%rsp)
  mov    %rdx,0x20(%rsp)
  mov    %rsi,0x28(%rsp)
  mov    %rax,0x18(%rsp)
  movsd  %xmm0,0x58(%rsp)
  movsd  %xmm1,0x50(%rsp)
  movsd  %xmm2,0x38(%rsp)
  movsd  %xmm3,0x30(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0xb8(%rsp)
  xor    %eax,%eax
  call   <geoMagInit@plt>
  movsd  0x30(%rsp),%xmm3
  mov    %r13,%rcx
  movsd  0x38(%rsp),%xmm2
  movsd  0x50(%rsp),%xmm1
  mov    %rbx,%rdx
  mov    %r12,%rsi
  mov    %rbp,%rdi
  movsd  0x58(%rsp),%xmm0
  movsd  %xmm3,0x48(%rsp)
  movsd  %xmm2,0x40(%rsp)
  movsd  %xmm1,0x38(%rsp)
  movsd  %xmm0,0x30(%rsp)
  call   <geomg1@plt>
  movsd  0x48(%rsp),%xmm3
  mov    %r13,%rcx
  addsd  D4(%rip),%xmm3
  movsd  0x38(%rsp),%xmm1
  movsd  0x40(%rsp),%xmm2
  lea    0xb0(%rsp),%rdx
  lea    0xa8(%rsp),%rsi
  movsd  0x30(%rsp),%xmm0
  lea    0xa0(%rsp),%rdi
  lea    0x98(%rsp),%r13
  call   <geomg1@plt>
  movsd  D5(%rip),%xmm0
  mulsd  0x0(%rbp),%xmm0
  mov    %r14,%rsi
  mov    %r13,%rdi
  call   <sincos@plt>
  movsd  D5(%rip),%xmm0
  mov    %r14,%rsi
  mov    %r13,%rdi
  movsd  0x90(%rsp),%xmm6
  mulsd  (%r12),%xmm0
  movsd  0x98(%rsp),%xmm5
  movsd  %xmm6,0x68(%rsp)
  movsd  %xmm5,0x60(%rsp)
  call   <sincos@plt>
  movsd  D5(%rip),%xmm0
  mov    %r14,%rsi
  mov    %r13,%rdi
  movsd  0xa0(%rsp),%xmm2
  movsd  0x90(%rsp),%xmm4
  movsd  0x98(%rsp),%xmm7
  mulsd  %xmm2,%xmm0
  movsd  %xmm4,0x58(%rsp)
  movsd  %xmm7,0x50(%rsp)
  movsd  %xmm2,0x48(%rsp)
  call   <sincos@plt>
  movsd  D5(%rip),%xmm0
  mov    %r14,%rsi
  mov    %r13,%rdi
  movsd  0xa8(%rsp),%xmm3
  movsd  0x90(%rsp),%xmm1
  movsd  0x98(%rsp),%xmm8
  mulsd  %xmm3,%xmm0
  movsd  %xmm1,0x40(%rsp)
  movsd  %xmm8,0x38(%rsp)
  movsd  %xmm3,0x30(%rsp)
  call   <sincos@plt>
  movsd  0x58(%rsp),%xmm4
  movsd  0x68(%rsp),%xmm6
  movsd  0x60(%rsp),%xmm5
  mov    0x88(%rsp),%r9
  mulsd  %xmm4,%xmm6
  mov    0x18(%rsp),%rax
  mov    0x10(%rsp),%rcx
  mulsd  %xmm4,%xmm5
  mov    0x80(%rsp),%r8
  movsd  0x90(%rsp),%xmm0
  mulsd  (%rbx),%xmm6
  movsd  0x50(%rsp),%xmm7
  movsd  0x30(%rsp),%xmm3
  movsd  0x48(%rsp),%xmm2
  movsd  0x40(%rsp),%xmm1
  mov    0x20(%rsp),%rdx
  mulsd  %xmm0,%xmm1
  movsd  %xmm6,(%r9)
  mulsd  (%rbx),%xmm5
  movsd  %xmm5,(%r8)
  mulsd  (%rbx),%xmm7
  movsd  %xmm7,(%r15)
  mulsd  (%rbx),%xmm4
  movsd  %xmm4,(%rax)
  movsd  0xb0(%rsp),%xmm4
  mulsd  %xmm4,%xmm1
  movapd %xmm4,%xmm5
  subsd  (%rbx),%xmm5
  mov    (%rsp),%rbx
  movsd  %xmm5,(%rcx)
  subsd  (%r12),%xmm3
  mov    0x8(%rsp),%rcx
  movsd  D29(%rip),%xmm5
  mulsd  %xmm5,%xmm3
  movsd  %xmm3,(%rcx)
  subsd  0x0(%rbp),%xmm2
  mulsd  %xmm5,%xmm2
  movsd  %xmm2,(%rbx)
  subsd  (%r9),%xmm1
  movsd  %xmm1,(%rdx)
  movsd  0x38(%rsp),%xmm8
  mov    0x28(%rsp),%rsi
  mov    0x78(%rsp),%r11
  mov    0x70(%rsp),%r10
  movapd %xmm8,%xmm1
  mulsd  %xmm0,%xmm1
  mulsd  %xmm4,%xmm0
  mulsd  %xmm4,%xmm1
  subsd  (%r8),%xmm1
  movsd  %xmm1,(%rsi)
  movsd  0x98(%rsp),%xmm1
  mulsd  %xmm4,%xmm1
  subsd  (%r15),%xmm1
  movsd  %xmm1,(%r11)
  subsd  (%rax),%xmm0
  movsd  %xmm0,(%r10)
  mov    0xb8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L4
  add    $0xc8,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L4:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: disassemble_data
arguments: label: D4
type_guessed: f64
name: disassemble_data
arguments: label: D5
type_guessed: byte[8]
name: disassemble_data
arguments: label: D29
type_guessed: f64

tool: D4: 1

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

tool: D29: 60

assistant: ```c
int geoMag(double alt, double glat, double glon, double time, double *dec, double *dip, double *ti, double *gv, double *adec, double *adip, double *ati, double *x, double *y, double *z, double *h, double *ax, double *ay, double *az, double *ah) {
  double time1;
  double dec2, dip2, ti2, rdec, rdip, rdec2, rdip2;
  double x2, y2, z2, h2;
  geoMagInit();
  geomg1(alt, glat, glon, time, dec, dip, ti, gv);
  time1 = time + 1.0;
  geomg1(alt, glat, glon, time1, &dec2, &dip2, &ti2, gv);
  rdec = *dec * (3.14159265358979323846 / 180.0);
  rdip = *dip * (3.14159265358979323846 / 180.0);
  rdec2 = dec2 * (3.14159265358979323846 / 180.0);
  rdip2 = dip2 * (3.14159265358979323846 / 180.0);
  *x = *ti * (cos(rdec) * cos(rdip));
  *y = *ti * (cos(rdip) * sin(rdec));
  *z = *ti * (sin(rdip));
  *h = *ti * (cos(rdip));
  x2 = ti2 * (cos(rdec2) * cos(rdip2));
  y2 = ti2 * (cos(rdip2) * sin(rdec2));
  z2 = ti2 * (sin(rdip2));
  h2 = ti2 * (cos(rdip2));
  *ati = ti2 - *ti;
  *adip = (dip2 - *dip) * (60.0);
  *adec = (dec2 - *dec) * (60.0);
  *ax = x2 - *x;
  *ay = y2 - *y;
  *az = z2 - *z;
  *ah = h2 - *h;
  return (0);
}
```