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

```asm
<SARParseLatitudeDMS>:
  endbr64
  push   %r15
  push   %r14
  mov    %rdi,%r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x78,%rsp
  mov    %rsi,0x8(%rsp)
  mov    %fs:0x28,%rax
  mov    %rax,0x68(%rsp)
  xor    %eax,%eax
  test   %rsi,%rsi
  je     L68
  movl   $0x0,(%rsi)
L68:
  test   %r14,%r14
  je     L128
  movsbl (%r14),%edi
  test   %dil,%dil
  je     L128
  mov    %r14,%rbx
  xor    %ebp,%ebp
  xor    %r12d,%r12d
  xor    %r15d,%r15d
  mov    $0x1,%r13d
  nopl   0x0(%rax)
L86:
  cmp    $0x20,%dil
  je     L7
  cmp    $0x9,%dil
  je     L7
  call   <toupper@plt>
  movsbl (%rbx),%edi
  cmp    $0x27,%al
  cmove  %r13d,%r12d
  call   <toupper@plt>
  cmp    $0x53,%al
  cmove  %r13d,%ebp
  movsbl 0x1(%rbx),%edi
  add    $0x1,%rbx
  add    $0x1,%r15d
  test   %dil,%dil
  jne    L86
L32:
  mov    $0x50,%edx
  lea    0x10(%rsp),%rdi
  mov    %r14,%rsi
  cmp    %edx,%r15d
  cmovle %r15d,%edx
  call   <strncpy@plt>
  mov    $0x4f,%eax
  cmp    %eax,%r15d
  cmovg  %eax,%r15d
  movslq %r15d,%rcx
  movb   $0x0,0x10(%rsp,%rcx,1)
  test   %r12d,%r12d
  je     L258
L103:
  lea    0x10(%rsp),%r12
  mov    $0x27,%esi
  mov    %r12,%rdi
  call   <strchr@plt>
  mov    %rax,%rbx
  test   %rax,%rax
  je     L50
  movb   $0x0,(%rax)
  mov    %r12,%rdi
  lea    0x1(%rbx),%r12
  call   <atoi@plt>
  mov    $0x22,%esi
  mov    %r12,%rdi
  mov    %eax,%r13d
  call   <strchr@plt>
  mov    %rax,%rbx
  test   %rax,%rax
  je     L195
  movb   $0x0,(%rax)
  mov    %r12,%rdi
  lea    0x1(%rbx),%r12
  call   <atoi@plt>
  mov    $0x22,%esi
  mov    %r12,%rdi
  mov    %eax,%r14d
  call   <strchr@plt>
  test   %rax,%rax
  je     L233
  movb   $0x0,(%rax)
  mov    %r12,%rdi
  call   <atoi@plt>
L185:
  cmpq   $0x0,0x8(%rsp)
  je     L154
  pxor   %xmm0,%xmm0
  movss  D27(%rip),%xmm3
  pxor   %xmm2,%xmm2
  pxor   %xmm1,%xmm1
  cvtsi2ss %eax,%xmm0
  cvtsi2ss %r14d,%xmm2
  cvtsi2ss %r13d,%xmm1
  divss  %xmm3,%xmm0
  divss  %xmm3,%xmm2
  divss  D30(%rip),%xmm0
  test   %ebp,%ebp
  je     L59
  comiss D46(%rip),%xmm1
  jbe    L59
  neg    %r13d
  pxor   %xmm1,%xmm1
  cvtsi2ss %r13d,%xmm1
L38:
  subss  %xmm2,%xmm1
  mov    0x8(%rsp),%rax
  subss  %xmm0,%xmm1
  movss  %xmm1,(%rax)
L154:
  xor    %r12d,%r12d
L46:
  mov    0x68(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L131
  add    $0x78,%rsp
  mov    %r12d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   (%rax)
L7:
  test   %r15d,%r15d
  jne    L32
  movslq %r15d,%rcx
  movb   $0x0,0x10(%rsp)
  movb   $0x0,0x10(%rsp,%rcx,1)
  test   %r12d,%r12d
  jne    L103
L258:
  mov    0x8(%rsp),%rbx
  test   %rbx,%rbx
  je     L154
  lea    0x10(%rsp),%rdi
  call   <atof@plt>
  test   %ebp,%ebp
  je     L100
  comiss D46(%rip),%xmm0
  jbe    L100
  xorps  D8(%rip),%xmm0
  movss  %xmm0,(%rbx)
  jmp    L46
  nopl   (%rax)
L100:
  mov    0x8(%rsp),%rax
  movss  %xmm0,(%rax)
  jmp    L46
L195:
  mov    %r12,%rdi
  call   <atoi@plt>
  mov    %eax,%r14d
  xor    %eax,%eax
  jmp    L185
  nopl   0x0(%rax,%rax,1)
L59:
  test   %r13d,%r13d
  js     L38
  addss  %xmm2,%xmm1
  mov    0x8(%rsp),%rax
  xor    %r12d,%r12d
  addss  %xmm0,%xmm1
  movss  %xmm1,(%rax)
  jmp    L46
  nopw   0x0(%rax,%rax,1)
L50:
  mov    %r12,%rdi
  xor    %r14d,%r14d
  call   <atoi@plt>
  mov    %eax,%r13d
  xor    %eax,%eax
  jmp    L185
L233:
  mov    %r12,%rdi
  call   <atoi@plt>
  jmp    L185
L128:
  mov    $0xffffffff,%r12d
  jmp    L46
L131:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: disassemble_data
arguments: tag: D27
type_guessed: byte[4]
name: disassemble_data
arguments: tag: D30
type_guessed: byte[4]
name: disassemble_data
arguments: tag: D46
type_guessed: byte[4]
name: disassemble_data
arguments: tag: D8
type_guessed: byte[16]

tool: {"D27": [0x00,0x00,0x70,0x42]}

tool: {"D30": [0x00,0x00,0xc8,0x42]}

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

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

assistant: ```c
int SARParseLatitudeDMS(const char *string, float *dms) {
  const char *sp;
  int in_len, is_traditional = 0, is_south = 0;
  int lstring_len = 80;
  char *sp2, *sp3;
  char lstring[80];
  if (dms != NULL)
    *dms = 0.0f;
  if ((string != NULL) ? (*string == '\0') : 1)
    return (-1);
  sp = string;
  in_len = 0;
  while ((*sp != '\0') && !(((*sp) == ' ') || ((*sp) == '\t'))) {
    if (toupper(*sp) == '\'')
      is_traditional = 1;
    if (toupper(*sp) == 'S')
      is_south = 1;
    sp++;
    in_len++;
  }
  if (in_len > 0)
    strncpy(lstring, string, (((in_len) < (lstring_len)) ? (in_len) : (lstring_len)));
  else
    *lstring = '\0';
  lstring[(((in_len) < (lstring_len - 1)) ? (in_len) : (lstring_len - 1))] = '\0';
  if (is_traditional) {
    int d = 0, m = 0, s = 0;
    sp2 = lstring;
    if (sp2 != NULL) {
      sp3 = strchr(sp2, '\'');
      if (sp3 != NULL) {
        *sp3 = '\0';
        d = (((sp2) != NULL) ? atoi(sp2) : 0);
        sp2 = sp3 + 1;
      } else {
        d = (((sp2) != NULL) ? atoi(sp2) : 0);
        sp2 = NULL;
      }
    }
    if (sp2 != NULL) {
      sp3 = strchr(sp2, '"');
      if (sp3 != NULL) {
        *sp3 = '\0';
        m = (((sp2) != NULL) ? atoi(sp2) : 0);
        sp2 = sp3 + 1;
      } else {
        m = (((sp2) != NULL) ? atoi(sp2) : 0);
        sp2 = NULL;
      }
    }
    if (sp2 != NULL) {
      sp3 = strchr(sp2, '"');
      if (sp3 != NULL) {
        *sp3 = '\0';
        s = (((sp2) != NULL) ? atoi(sp2) : 0);
        sp2 = sp3 + 1;
      } else {
        s = (((sp2) != NULL) ? atoi(sp2) : 0);
        sp2 = NULL;
      }
    }
    if (dms != NULL) {
      if (is_south && (d > 0.0f))
        *dms = (float)-d - ((float)m / 60.0f) - ((float)s / 60.0f / 100.0f);
      else if (d < 0)
        *dms = (float)d - ((float)m / 60.0f) - ((float)s / 60.0f / 100.0f);
      else
        *dms = (float)d + ((float)m / 60.0f) + ((float)s / 60.0f / 100.0f);
    }
  } else {
    sp2 = lstring;
    if (dms != NULL) {
      float d = (float)(((sp2) != NULL) ? atof(sp2) : 0.0f);
      if (is_south && (d > 0.0f))
        *dms = -d;
      else
        *dms = d;
    }
  }
  return (0);
}
```