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

```asm
<main>:
  endbr64
  push   %r12
  push   %rbp
  lea    D43(%rip),%rbp
  sub    $0x58,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x48(%rsp)
  xor    %eax,%eax
  movl   $0x0,0x44(%rsp)
  lea    0x20(%rsp),%r12
  call   <setpar@plt>
  mov    %rbp,%rsi
  lea    0x34(%rsp),%rdx
  xor    %eax,%eax
  lea    D67(%rip),%rdi
  call   <mstpar@plt>
  mov    %rbp,%rsi
  lea    0x38(%rsp),%rdx
  xor    %eax,%eax
  lea    D143(%rip),%rdi
  call   <mstpar@plt>
  mov    %rbp,%rsi
  lea    0x3c(%rsp),%rdx
  xor    %eax,%eax
  lea    D87(%rip),%rdi
  call   <mstpar@plt>
  mov    %rbp,%rsi
  lea    0x40(%rsp),%rdx
  xor    %eax,%eax
  lea    D21(%rip),%rdi
  call   <mstpar@plt>
  mov    %rbp,%rsi
  lea    0x44(%rsp),%rdx
  xor    %eax,%eax
  lea    D5(%rip),%rdi
  lea    0x28(%rsp),%rbp
  call   <getpar@plt>
  xor    %eax,%eax
  call   <endpar@plt>
  movss  0x3c(%rsp),%xmm6
  movss  0x34(%rsp),%xmm0
  movss  %xmm0,(%rsp)
  addss  %xmm6,%xmm0
  movss  %xmm6,0x4(%rsp)
  cvtss2sd %xmm0,%xmm0
  mulsd  D57(%rip),%xmm0
  mulsd  D109(%rip),%xmm0
  call   <tan@plt>
  mulsd  D10(%rip),%xmm0
  call   <atan@plt>
  mov    %r12,%rsi
  mov    %rbp,%rdi
  call   <sincos@plt>
  movsd  0x28(%rsp),%xmm0
  pxor   %xmm5,%xmm5
  movsd  D116(%rip),%xmm1
  movsd  D138(%rip),%xmm4
  movsd  0x20(%rsp),%xmm2
  mulsd  %xmm0,%xmm1
  movapd %xmm4,%xmm3
  mulsd  %xmm0,%xmm1
  movapd %xmm1,%xmm0
  addsd  %xmm4,%xmm0
  divsd  %xmm0,%xmm3
  ucomisd %xmm3,%xmm5
  ja     L39
  sqrtsd %xmm3,%xmm3
L18:
  mulsd  D165(%rip),%xmm1
  pxor   %xmm7,%xmm7
  mulsd  D76(%rip),%xmm2
  addsd  %xmm4,%xmm1
  mulsd  %xmm3,%xmm2
  ucomisd %xmm1,%xmm5
  cvtsd2ss %xmm2,%xmm7
  movss  %xmm7,0x10(%rsp)
  ja     L49
  sqrtsd %xmm1,%xmm1
  movsd  %xmm1,0x8(%rsp)
L47:
  pxor   %xmm0,%xmm0
  mov    %rbp,%rdi
  mov    %r12,%rsi
  movsd  %xmm3,0x18(%rsp)
  cvtss2sd 0x44(%rsp),%xmm0
  mulsd  D109(%rip),%xmm0
  call   <sincos@plt>
  movsd  0x18(%rsp),%xmm3
  pxor   %xmm0,%xmm0
  movsd  D76(%rip),%xmm2
  mulsd  0x8(%rsp),%xmm2
  movss  0x4(%rsp),%xmm1
  cvtsd2ss 0x20(%rsp),%xmm0
  pxor   %xmm5,%xmm5
  subss  (%rsp),%xmm1
  movss  0x38(%rsp),%xmm4
  cvtsd2ss 0x28(%rsp),%xmm5
  lea    D110(%rip),%rdi
  subss  0x40(%rsp),%xmm4
  mulss  0x10(%rsp),%xmm4
  mov    $0x2,%eax
  mulsd  %xmm3,%xmm2
  mulsd  %xmm3,%xmm2
  mulsd  %xmm3,%xmm2
  movaps %xmm4,%xmm3
  mulss  %xmm5,%xmm3
  cvtsd2ss %xmm2,%xmm2
  mulss  %xmm1,%xmm2
  movaps %xmm0,%xmm1
  mulss  %xmm4,%xmm0
  mulss  %xmm2,%xmm1
  mulss  %xmm2,%xmm5
  subss  %xmm3,%xmm1
  addss  %xmm5,%xmm0
  cvtss2sd %xmm1,%xmm1
  cvtss2sd %xmm0,%xmm0
  call   <printf@plt>
  mov    0x48(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L1
  add    $0x58,%rsp
  xor    %eax,%eax
  pop    %rbp
  pop    %r12
  ret
L39:
  movapd %xmm3,%xmm0
  movsd  %xmm2,0x10(%rsp)
  movsd  %xmm1,0x8(%rsp)
  call   <sqrt@plt>
  mov    D138(%rip),%rax
  movsd  0x10(%rsp),%xmm2
  pxor   %xmm5,%xmm5
  movsd  0x8(%rsp),%xmm1
  movapd %xmm0,%xmm3
  movq   %rax,%xmm4
  jmp    L18
L49:
  movapd %xmm1,%xmm0
  movsd  %xmm3,0x18(%rsp)
  call   <sqrt@plt>
  movsd  0x18(%rsp),%xmm3
  movsd  %xmm0,0x8(%rsp)
  jmp    L47
L1:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: unpack_data
arguments: data_label: D43
type: string
name: unpack_data
arguments: data_label: D67
type: string
name: unpack_data
arguments: data_label: D143
type: string
name: unpack_data
arguments: data_label: D87
type: string
name: unpack_data
arguments: data_label: D21
type: string
name: unpack_data
arguments: data_label: D5
type: string
name: unpack_data
arguments: data_label: D57
type: f64
name: unpack_data
arguments: data_label: D109
type: f64
name: unpack_data
arguments: data_label: D10
type: byte[8]
name: unpack_data
arguments: data_label: D116
type: byte[8]
name: unpack_data
arguments: data_label: D138
type: f64
name: unpack_data
arguments: data_label: D165
type: byte[8]
name: unpack_data
arguments: data_label: D76
type: byte[8]
name: unpack_data
arguments: data_label: D110
type: string

tool: D43: f

tool: D67: elat

tool: D143: elon

tool: D87: mlat

tool: D21: mlon

tool: D5: rotate

tool: D57: 0.5

tool: D109: 0.017453292

tool: {"D10": [0x26,0xa3,0x18,0x9e,0x88,0xe4,0xef,0x3f]}

tool: {"D116": [0x2c,0x65,0x25,0x57,0xe7,0x9a,0x7b,0x3f]}

tool: D138: 1

tool: {"D165": [0xb3,0x92,0xab,0x73,0xcd,0x0d,0x00,0x40]}

tool: {"D76": [0x6d,0xf6,0x02,0x0e,0x73,0xd4,0x5b,0x40]}

tool: D110: %10.4f %10.4f


assistant: ```c
main(ac, av) int ac;
char **av;
{
  float elat, elon, mlat, mlon;
  float kperd_n, kperd_e, xtop, ytop;
  float x0, y0, cosR, sinR;
  double cosA, sinA, e2, den, g2, h2, lat0;
  float rotate = 0.0;
  double rperd = 0.017453292;
  double rad = 6378.139;
  double f = 298.256;
  setpar(ac, av);
  mstpar("elat", "f", &elat);
  mstpar("elon", "f", &elon);
  mstpar("mlat", "f", &mlat);
  mstpar("mlon", "f", &mlon);
  getpar("rotate", "f", &rotate);
  endpar();
  f = 1.0 / f;
  e2 = 2.0 * f - f * f;
  h2 = (1.0 - f) * (1.0 - f);
  g2 = e2 / h2;
  lat0 = atan((1.0 - f) * tan(0.5 * (elat + mlat) * rperd));
  cosA = cos(lat0);
  sinA = sin(lat0);
  den = sqrt(1.0 / (1.0 + g2 * sinA * sinA));
  kperd_e = rperd * rad * cosA * den;
  kperd_n = rperd * rad * (sqrt(1.0 + g2 * sinA * sinA * (2.0 + g2))) * den * den * den;
  cosR = cos(rotate * rperd);
  sinR = sin(rotate * rperd);
  x0 = (elon - mlon) * kperd_e;
  y0 = (mlat - elat) * kperd_n;
  xtop = x0 * cosR + y0 * sinR;
  ytop = -x0 * sinR + y0 * cosR;
  printf("%10.4f %10.4f\n", xtop, ytop);
}
```