user: Converte this assembly snippet into its equivalent C code:

```asm
<dms_to_degrees>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %rdi,%rbp
  mov    %rsi,%r13
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  movzbl (%rdi),%edx
  cmp    $0x20,%dl
  jne    L179
  mov    $0x1,%eax
L115:
  mov    %eax,%ecx
  add    $0x1,%rax
  movzbl -0x1(%rbp,%rax,1),%edx
  cmp    $0x20,%dl
  je     L115
L97:
  mov    D4(%rip),%r14
  cmp    $0x2d,%dl
  je     L69
L47:
  movslq %ecx,%rcx
  lea    0x0(%rbp,%rcx,1),%rbx
  mov    %rsp,%rsi
  mov    %rbx,%rdi
  call   <strtod@plt>
  movq   %xmm0,%r15
  mov    (%rsp),%rax
  cmp    %rax,%rbx
  je     L143
  sub    %rbp,%rax
  cltq
  lea    0x0(%rbp,%rax,1),%r12
  movzbl (%r12),%edi
  test   %dil,%dil
  je     L129
  lea    0x1(%rbp,%rax,1),%rbx
L104:
  movsbl %dil,%edi
  call   <isdigit@plt>
  test   %eax,%eax
  jne    L129
  mov    %rbx,%r12
  add    $0x1,%rbx
  movzbl -0x1(%rbx),%edi
  test   %dil,%dil
  jne    L104
L129:
  mov    %rsp,%rsi
  mov    %r12,%rdi
  call   <strtod@plt>
  movq   %xmm0,%rbx
  mov    (%rsp),%rax
  cmp    %r12,%rax
  je     L8
  sub    %rbp,%rax
  cltq
  lea    0x0(%rbp,%rax,1),%r12
  movzbl (%r12),%edi
  test   %dil,%dil
  je     L150
  lea    0x1(%rbp,%rax,1),%rbp
L12:
  movsbl %dil,%edi
  call   <isdigit@plt>
  test   %eax,%eax
  jne    L150
  mov    %rbp,%r12
  add    $0x1,%rbp
  movzbl -0x1(%rbp),%edi
  test   %dil,%dil
  jne    L12
L150:
  mov    %rsp,%rsi
  mov    %r12,%rdi
  call   <strtod@plt>
  cmp    %r12,(%rsp)
  je     L130
  movq   %rbx,%xmm1
  divsd  D17(%rip),%xmm1
  movq   %r15,%xmm2
  addsd  %xmm2,%xmm1
  divsd  D11(%rip),%xmm0
  addsd  %xmm1,%xmm0
  movq   %r14,%xmm3
  mulsd  %xmm3,%xmm0
  movsd  %xmm0,0x0(%r13)
  mov    $0x0,%eax
L35:
  mov    0x8(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L160
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L179:
  mov    $0x0,%ecx
  jmp    L97
L69:
  add    $0x1,%ecx
  mov    D35(%rip),%r14
  jmp    L47
L8:
  movq   %r14,%xmm0
  movq   %r15,%xmm4
  mulsd  %xmm4,%xmm0
  movsd  %xmm0,0x0(%r13)
  mov    $0x0,%eax
  jmp    L35
L130:
  movq   %rbx,%xmm0
  divsd  D17(%rip),%xmm0
  movq   %r15,%xmm5
  addsd  %xmm5,%xmm0
  movq   %r14,%xmm6
  mulsd  %xmm6,%xmm0
  movsd  %xmm0,0x0(%r13)
  mov    $0x0,%eax
  jmp    L35
L143:
  mov    $0xffffffff,%eax
  jmp    L35
L160:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: extract_symbolic_data
arguments: label: D4
type_infered: f64
name: extract_symbolic_data
arguments: label: D17
type_infered: f64
name: extract_symbolic_data
arguments: label: D11
type_infered: f64
name: extract_symbolic_data
arguments: label: D35
type_infered: f32[2]

tool: D4: 1

tool: D17: 60

tool: D11: 3600

tool: {"D35": [0.0,-1.875]}

assistant: ```c
int dms_to_degrees(char *decs, double *dec) {
  char *endp;
  double d = 0.0, m = 0.0, s = 0.0;
  int i;
  double sign = 1.0;
  for (i = 0; decs[i] == ' ' && decs[i] != 0; i++)
    ;
  if (decs[i] == '-') {
    sign = -1.0;
    i++;
  }
  d = strtod(decs + i, &endp);
  if (endp == decs + i) {
    return -1;
  }
  for (i = endp - decs; decs[i] && !isdigit(decs[i]); i++)
    ;
  m = strtod(decs + i, &endp);
  if (endp == decs + i) {
    *dec = d * sign;
    return 0;
  }
  for (i = endp - decs; decs[i] && !isdigit(decs[i]); i++)
    ;
  s = strtod(decs + i, &endp);
  if (endp == decs + i) {
    *dec = (d + m / 60.0) * sign;
    return 0;
  }
  *dec = (d + m / 60.0 + s / 3600.0) * sign;
  return 0;
}
```