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

```asm
<getLineCoordinates>:
  endbr64
  push   %r15
  mov    %rsi,%r10
  push   %r14
  push   %r13
  push   %r12
  mov    %rdi,%r12
  push   %rbp
  push   %rbx
  sub    $0x38,%rsp
  movswl (%rdx),%ecx
  mov    %fs:0x28,%rax
  mov    %rax,0x28(%rsp)
  xor    %eax,%eax
  movzwl (%rsi),%eax
  movzwl 0x2(%rsi),%esi
  cmp    %cx,%ax
  je     L167
L81:
  movswl %ax,%edi
  pxor   %xmm0,%xmm0
  mov    D14(%rip),%r11d
  sub    %edi,%ecx
  cvtsi2ss %ecx,%xmm0
  movd   %r11d,%xmm4
  comiss %xmm0,%xmm4
  ja     L7
  movss  %xmm0,0x18(%rsp)
  mov    $0x1,%ecx
L162:
  movswl 0x2(%rdx),%edx
  mov    %cx,0x10(%rsp)
  movswl %si,%ecx
  pxor   %xmm0,%xmm0
  movd   %r11d,%xmm5
  mov    %ax,0x14(%rsp)
  sub    %ecx,%edx
  cvtsi2ss %edx,%xmm0
  comiss %xmm0,%xmm5
  ja     L152
  movss  %xmm0,0x1c(%rsp)
  mov    $0x1,%edx
L74:
  movss  0x18(%rsp),%xmm3
  movss  0x1c(%rsp),%xmm0
  mov    %dx,0x12(%rsp)
  mov    %si,0x16(%rsp)
  comiss %xmm0,%xmm3
  movl   $0x0,0xc(%rsp)
  movq   $0x0,0x20(%rsp)
  ja     L33
  cvttss2si %xmm0,%edx
L158:
  movswl %dx,%edx
  pxor   %xmm1,%xmm1
  lea    0xc(%rsp),%r14
  xor    %r8d,%r8d
  cvtsi2ss %edx,%xmm1
  movss  D40(%rip),%xmm2
  lea    0x20(%rsp),%r13
  lea    0x10(%rsp),%rbp
  lea    0x14(%rsp),%rbx
  divss  %xmm1,%xmm3
  divss  %xmm1,%xmm0
  movss  %xmm3,0x18(%rsp)
  movss  %xmm0,0x1c(%rsp)
  xchg   %ax,%ax
L130:
  movswq %r8w,%rdx
  mov    %r14,%rsi
  movaps %xmm3,%xmm0
  mov    %r13,%rcx
  lea    (%r12,%rdx,4),%r9
  xor    %edx,%edx
L166:
  movswl (%rsi),%edi
  pxor   %xmm1,%xmm1
  ucomiss %xmm2,%xmm0
  cvtsi2ss %edi,%xmm1
  addss  %xmm0,%xmm1
  cvttss2si %xmm1,%r15d
  movss  (%rcx),%xmm1
  mov    %r15w,(%rsi)
  jp     L36
  movd   %xmm0,%edi
  cmove  %r11d,%edi
  movd   %edi,%xmm0
L36:
  addss  %xmm0,%xmm1
  comiss D18(%rip),%xmm1
  mov    %r15d,%edi
  movss  %xmm1,(%rcx)
  jb     L89
  subss  %xmm2,%xmm1
  lea    0x1(%r15),%edi
  mov    %di,(%rsi)
  movss  %xmm1,(%rcx)
L89:
  imul   0x0(%rbp,%rdx,1),%di
  add    $0x2,%rsi
  add    $0x4,%rcx
  add    %edi,%eax
  mov    %ax,(%rbx,%rdx,1)
  mov    %ax,(%r9,%rdx,1)
  add    $0x2,%rdx
  cmp    $0x4,%rdx
  je     L23
  movss  0x18(%rsp,%rdx,2),%xmm0
  movzwl (%r10,%rdx,1),%eax
  jmp    L166
  nopl   0x0(%rax,%rax,1)
L33:
  cvttss2si %xmm3,%edx
  jmp    L158
  nopl   0x0(%rax)
L23:
  cmpw   $0x4e,0x14(%rsp)
  lea    0x1(%r8),%edx
  ja     L70
  cmpw   $0x1c,0x16(%rsp)
  ja     L70
  movzwl (%r10),%eax
  mov    %edx,%r8d
  jmp    L130
  nopl   0x0(%rax,%rax,1)
L70:
  movl   $0xffffffff,(%r9)
L147:
  mov    0x28(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L142
  add    $0x38,%rsp
  mov    %r8d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L152:
  xorps  D16(%rip),%xmm0
  mov    $0xffffffff,%edx
  movss  %xmm0,0x1c(%rsp)
  jmp    L74
  nopw   0x0(%rax,%rax,1)
L7:
  xorps  D16(%rip),%xmm0
  mov    $0xffffffff,%ecx
  movss  %xmm0,0x18(%rsp)
  jmp    L162
  nopw   0x0(%rax,%rax,1)
L167:
  xor    %r8d,%r8d
  cmp    0x2(%rdx),%si
  jne    L81
  jmp    L147
L142:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: unpack_data
arguments: tag: D14
type_guessed: byte[4]
name: unpack_data
arguments: tag: D40
type_guessed: byte[4]
name: unpack_data
arguments: tag: D18
type_guessed: f32
name: unpack_data
arguments: tag: D16
type_guessed: byte[16]

tool: {"D14": [0x00,0x00,0x00,0x00]}

tool: {"D40": [0x00,0x00,0x80,0x3f]}

tool: D18: 0.5

tool: {"D16": [0x00,0x00,0x00,0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00]}

assistant: ```c
short getLineCoordinates(short listOfCoordinates[][2], const short originLoc[2], const short targetLoc[2]) {
  float targetVector[2], error[2];
  short largerTargetComponent, currentVector[2], previousVector[2], quadrantTransform[2], i;
  short currentLoc[2], previousLoc[2];
  short cellNumber = 0;
  if (originLoc[0] == targetLoc[0] && originLoc[1] == targetLoc[1]) {
    return 0;
  }
  for (i = 0; i <= 1; i++) {
    targetVector[i] = targetLoc[i] - originLoc[i];
    if (targetVector[i] < 0) {
      targetVector[i] *= -1;
      quadrantTransform[i] = -1;
    } else {
      quadrantTransform[i] = 1;
    }
    currentVector[i] = previousVector[i] = error[i] = 0;
    currentLoc[i] = originLoc[i];
  }
  largerTargetComponent = (((targetVector[0]) > (targetVector[1])) ? (targetVector[0]) : (targetVector[1]));
  targetVector[0] /= largerTargetComponent;
  targetVector[1] /= largerTargetComponent;
  do {
    for (i = 0; i <= 1; i++) {
      previousLoc[i] = currentLoc[i];
      currentVector[i] += targetVector[i];
      error[i] += (targetVector[i] == 1 ? 0 : targetVector[i]);
      if (error[i] >= 0.5) {
        currentVector[i]++;
        error[i] -= 1;
      }
      currentLoc[i] = quadrantTransform[i] * currentVector[i] + originLoc[i];
      listOfCoordinates[cellNumber][i] = currentLoc[i];
    }
    cellNumber++;
  } while (((currentLoc[0]) >= 0 && (currentLoc[0]) < (100 - 20 - 1) && (currentLoc[1]) >= 0 && (currentLoc[1]) < ((31 + 5) - 5 - 2)));
  cellNumber--;
  listOfCoordinates[cellNumber][0] = listOfCoordinates[cellNumber][1] = -1;
  return cellNumber;
}
```