user: 请将以下的汇编代码转换成C语言代码:

```asm
<SARParseLongitudeDMS>:
  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     L127
  movl   $0x0,(%rsi)
L127:
  test   %r14,%r14
  je     L229
  movsbl (%r14),%edi
  test   %dil,%dil
  je     L229
  mov    %r14,%rbx
  xor    %ebp,%ebp
  xor    %r12d,%r12d
  xor    %r15d,%r15d
  mov    $0x1,%r13d
  nopl   0x0(%rax)
L5:
  cmp    $0x20,%dil
  je     L69
  cmp    $0x9,%dil
  je     L69
  call   <toupper@plt>
  movsbl (%rbx),%edi
  cmp    $0x27,%al
  cmove  %r13d,%r12d
  call   <toupper@plt>
  cmp    $0x57,%al
  cmove  %r13d,%ebp
  movsbl 0x1(%rbx),%edi
  add    $0x1,%rbx
  add    $0x1,%r15d
  test   %dil,%dil
  jne    L5
L100:
  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     L2
L266:
  lea    0x10(%rsp),%r12
  mov    $0x27,%esi
  mov    %r12,%rdi
  call   <strchr@plt>
  mov    %rax,%rbx
  test   %rax,%rax
  je     L38
  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     L134
  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     L135
  movb   $0x0,(%rax)
  mov    %r12,%rdi
  call   <atoi@plt>
L62:
  cmpq   $0x0,0x8(%rsp)
  je     L128
  pxor   %xmm0,%xmm0
  movss  D11(%rip),%xmm2
  pxor   %xmm1,%xmm1
  cvtsi2ss %eax,%xmm0
  cvtsi2ss %r14d,%xmm1
  divss  %xmm2,%xmm0
  divss  %xmm2,%xmm1
  divss  D26(%rip),%xmm0
  test   %r13d,%r13d
  jle    L72
  and    $0x1,%ebp
  je     L72
  neg    %r13d
  pxor   %xmm2,%xmm2
  cvtsi2ss %r13d,%xmm2
L45:
  subss  %xmm1,%xmm2
  mov    0x8(%rsp),%rax
  subss  %xmm0,%xmm2
  movss  %xmm2,(%rax)
L128:
  xor    %r12d,%r12d
L150:
  mov    0x68(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L14
  add    $0x78,%rsp
  mov    %r12d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L69:
  test   %r15d,%r15d
  jne    L100
  movslq %r15d,%rcx
  movb   $0x0,0x10(%rsp)
  movb   $0x0,0x10(%rsp,%rcx,1)
  test   %r12d,%r12d
  jne    L266
L2:
  mov    0x8(%rsp),%rbx
  test   %rbx,%rbx
  je     L128
  lea    0x10(%rsp),%rdi
  call   <atof@plt>
  test   %ebp,%ebp
  je     L8
  comiss D3(%rip),%xmm0
  jbe    L8
  xorps  D13(%rip),%xmm0
  movss  %xmm0,(%rbx)
  jmp    L150
  nopl   (%rax)
L8:
  mov    0x8(%rsp),%rax
  movss  %xmm0,(%rax)
  jmp    L150
L134:
  mov    %r12,%rdi
  call   <atoi@plt>
  mov    %eax,%r14d
  xor    %eax,%eax
  jmp    L62
L72:
  pxor   %xmm2,%xmm2
  cvtsi2ss %r13d,%xmm2
  test   %r13d,%r13d
  js     L45
  addss  %xmm2,%xmm1
  mov    0x8(%rsp),%rax
  xor    %r12d,%r12d
  addss  %xmm0,%xmm1
  movss  %xmm1,(%rax)
  jmp    L150
  nopl   0x0(%rax,%rax,1)
L38:
  mov    %r12,%rdi
  xor    %r14d,%r14d
  call   <atoi@plt>
  mov    %eax,%r13d
  xor    %eax,%eax
  jmp    L62
L135:
  mov    %r12,%rdi
  call   <atoi@plt>
  jmp    L62
L229:
  mov    $0xffffffff,%r12d
  jmp    L150
L14:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: retrieve_data
arguments: label: D11
type: byte[4]
name: retrieve_data
arguments: label: D26
type: byte[4]
name: retrieve_data
arguments: label: D3
type: byte[4]
name: retrieve_data
arguments: label: D13
type: byte[16]

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

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

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

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

assistant: ```c
int SARParseLongitudeDMS(const char *string, float *dms) {
  const char *sp;
  int in_len, is_traditional = 0, is_west = 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) == 'W')
      is_west = 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_west && (d > 0))
        *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_west && (d > 0.0f))
        *dms = -d;
      else
        *dms = d;
    }
  }
  return (0);
}
```