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

```asm
<checkQthToCoords>:
  endbr64
  push   %r13
  mov    %rdx,%r13
  push   %r12
  mov    %rsi,%r12
  push   %rbp
  mov    %rdi,%rbp
  push   %rbx
  mov    %r8,%rbx
  sub    $0x48,%rsp
  movsd  %xmm0,0x10(%rsp)
  lea    0x28(%rsp),%rdx
  lea    0x20(%rsp),%r8
  movsd  D68(%rip),%xmm0
  movsd  %xmm1,0x18(%rsp)
  movsd  %xmm2,0x8(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x38(%rsp)
  xor    %eax,%eax
  addq   $0x1,(%rcx)
  lea    0x30(%rsp),%rcx
  movq   $0x0,0x20(%rsp)
  movsd  %xmm0,0x28(%rsp)
  movsd  %xmm0,0x30(%rsp)
  call   <qth_to_coords@plt>
  test   %rax,%rax
  jne    L87
  cmp    %r13,0x20(%rsp)
  jne    L3
  movsd  0x8(%rsp),%xmm1
  mulsd  D128(%rip),%xmm1
  movsd  0x10(%rsp),%xmm4
  movsd  D34(%rip),%xmm2
  movsd  0x28(%rsp),%xmm3
  movapd %xmm4,%xmm0
  addsd  %xmm1,%xmm0
  addsd  %xmm2,%xmm0
  comisd %xmm0,%xmm3
  ja     L24
  subsd  %xmm1,%xmm4
  movapd %xmm4,%xmm0
  subsd  %xmm2,%xmm0
  comisd %xmm3,%xmm0
  ja     L24
  movsd  0x8(%rsp),%xmm5
  movsd  0x18(%rsp),%xmm6
  movsd  0x30(%rsp),%xmm1
  movapd %xmm5,%xmm0
  addsd  %xmm6,%xmm0
  addsd  %xmm2,%xmm0
  comisd %xmm0,%xmm1
  ja     L40
  subsd  %xmm5,%xmm6
  movapd %xmm6,%xmm0
  subsd  %xmm2,%xmm0
  comisd %xmm1,%xmm0
  ja     L40
  addq   $0x1,(%rbx)
  jmp    L72
  nop
L24:
  lea    D84(%rip),%rdi
  mov    %r12,%rdx
  mov    %rbp,%rsi
  xor    %eax,%eax
  movsd  %xmm1,0x8(%rsp)
  call   <printf@plt>
  mov    D34(%rip),%rax
  movsd  0x8(%rsp),%xmm1
  lea    D124(%rip),%rdi
  movsd  0x28(%rsp),%xmm0
  movq   %rax,%xmm2
  mov    $0x3,%eax
  addsd  %xmm1,%xmm2
  movsd  0x10(%rsp),%xmm1
  call   <printf@plt>
L72:
  mov    0x38(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L46
  add    $0x48,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  nopl   0x0(%rax)
L3:
  mov    %r12,%rdx
  mov    %rbp,%rsi
  lea    D84(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    0x20(%rsp),%rsi
  mov    %r13,%rdx
  xor    %eax,%eax
  lea    D23(%rip),%rdi
  call   <printf@plt>
  jmp    L72
  nopl   0x0(%rax)
L87:
  mov    %r12,%rdx
  mov    %rbp,%rsi
  lea    D84(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  lea    D30(%rip),%rdi
  call   <puts@plt>
  jmp    L72
  nopw   0x0(%rax,%rax,1)
L40:
  mov    %r12,%rdx
  mov    %rbp,%rsi
  lea    D84(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    D34(%rip),%rax
  movsd  0x18(%rsp),%xmm1
  lea    D9(%rip),%rdi
  movsd  0x30(%rsp),%xmm0
  movq   %rax,%xmm2
  addsd  0x8(%rsp),%xmm2
  mov    $0x3,%eax
  call   <printf@plt>
  jmp    L72
L46:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: retrieve_data
arguments: data_label: D68
type: byte[8]
name: retrieve_data
arguments: data_label: D128
type: byte[8]
name: retrieve_data
arguments: data_label: D34
type: f64
name: retrieve_data
arguments: data_label: D84
type: string
name: retrieve_data
arguments: data_label: D124
type: string
name: retrieve_data
arguments: data_label: D23
type: string
name: retrieve_data
arguments: data_label: D30
type: string
name: retrieve_data
arguments: data_label: D9
type: string

tool: {"D68": [0x00,0x00,0x00,0x00,0x00,0xc0,0x72,0xc0]}

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

tool: D34: 1e-06

tool: D84: Test failed: qth_to_coords( "%s", %lu, &lat, &lng, &precision):


tool: D124: 	Latitude out of acceptable range: got %f, expected %f +/- %f.


tool: D23: 	Bad precision, got %lu, expected %lu. 


tool: D30: 	Invalid test sample.

tool: D9: 	Longitude out of acceptable range: got %f, expected %f +/- %f.


assistant: ```c
void checkQthToCoords(const char *qth, size_t qthStringSize, size_t expectedPrecisionLvl, double expectedLat, double expectedLng, double acceptedBias, size_t *takenTests, size_t *passedTests) {
  ++(*takenTests);
  size_t precision = 0;
  double lat = -300;
  double lng = -300;
  if (qth_to_coords(qth, qthStringSize, &lat, &lng, &precision) != 0) {
    printf("Test failed: qth_to_coords( \"%s\", %lu, &lat, &lng, &precision):\n", qth, qthStringSize);
    printf("\tInvalid test sample.\n");
    return;
  }
  if (precision != expectedPrecisionLvl) {
    printf("Test failed: qth_to_coords( \"%s\", %lu, &lat, &lng, &precision):\n", qth, qthStringSize);
    printf("\tBad precision, got %lu, expected %lu. \n", precision, expectedPrecisionLvl);
    return;
  }
  if (lat > (expectedLat + (acceptedBias / 2) + 0.000001) || lat < (expectedLat - (acceptedBias / 2) - 0.000001)) {
    printf("Test failed: qth_to_coords( \"%s\", %lu, &lat, &lng, &precision):\n", qth, qthStringSize);
    printf("\tLatitude out of acceptable range: got %f, expected %f +/- %f.\n", lat, expectedLat, (acceptedBias / 2) + 0.000001);
    return;
  }
  if (lng > (expectedLng + acceptedBias + 0.000001) || lng < (expectedLng - acceptedBias - 0.000001)) {
    printf("Test failed: qth_to_coords( \"%s\", %lu, &lat, &lng, &precision):\n", qth, qthStringSize);
    printf("\tLongitude out of acceptable range: got %f, expected %f +/- %f.\n", lng, expectedLng, acceptedBias + 0.000001);
    return;
  }
  ++(*passedTests);
  return;
}
```