user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<str2dd>:
  endbr64
  push   %r14
  push   %r13
  mov    %rsi,%r13
  push   %r12
  push   %rbp
  mov    %rdx,%rbp
  push   %rbx
  mov    %rdi,%rbx
  sub    $0x10,%rsp
  movsbl (%rdi),%edi
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  call   <toupper@plt>
  cmp    $0x2b,%al
  je     L79
  xor    %r14d,%r14d
  cmp    $0x4e,%al
  je     L79
L350:
  cmp    $0x2d,%al
  je     L84
  cmp    $0x53,%al
  je     L84
L110:
  mov    %rsp,%r12
  mov    %rbx,%rdi
  mov    %r12,%rsi
  call   <parse_dd_or_dms@plt>
  movsd  %xmm0,0x0(%r13)
  call   <isnan@plt>
  test   %rax,%rax
  jne    L136
  mov    (%rsp),%rax
  cmp    %rbx,%rax
  je     L136
  test   %rax,%rax
  je     L136
  movsbl (%rax),%edi
  test   %dil,%dil
  je     L136
  test   %r14d,%r14d
  je     L278
  cmp    $0xffffffff,%r14d
  jne    L351
  jmp    L364
  nopl   0x0(%rax)
L68:
  mov    (%rsp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,(%rsp)
  movsbl 0x1(%rax),%edi
L351:
  call   <isspace@plt>
  test   %rax,%rax
  jne    L68
  mov    (%rsp),%rbx
  movsbl (%rbx),%edi
  test   %dil,%dil
  je     L136
  call   <toupper@plt>
  cmp    $0x2b,%al
  je     L337
  xor    %r13d,%r13d
  cmp    $0x57,%al
  je     L337
L284:
  cmp    $0x2d,%al
  je     L258
  cmp    $0x45,%al
  je     L258
L370:
  mov    %r12,%rsi
  mov    %rbx,%rdi
  call   <parse_dd_or_dms@plt>
  movsd  %xmm0,0x0(%rbp)
  call   <isnan@plt>
  test   %rax,%rax
  jne    L136
  mov    (%rsp),%rdx
  cmp    %rbx,%rdx
  je     L136
  test   %rdx,%rdx
  je     L6
  movzbl (%rdx),%ecx
  mov    $0x1,%eax
  test   %cl,%cl
  je     L318
  test   %r13d,%r13d
  je     L9
  cmp    $0xffffffff,%r13d
  je     L368
L187:
  xor    %eax,%eax
  test   %cl,%cl
  sete   %al
  jmp    L318
  cs nopw 0x0(%rax,%rax,1)
L84:
  add    $0x1,%rbx
  mov    $0xffffffff,%r14d
  jmp    L110
  nop
L79:
  add    $0x1,%rbx
  mov    $0x1,%r14d
  jmp    L350
  nop
L136:
  xor    %eax,%eax
L318:
  mov    0x8(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L76
  add    $0x10,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
  nopl   0x0(%rax,%rax,1)
L278:
  call   <toupper@plt>
  cmp    $0x4e,%al
  je     L68
  mov    (%rsp),%rdx
  cmp    $0x53,%al
  je     L262
  movsbl (%rdx),%edi
  jmp    L351
L262:
  lea    0x1(%rdx),%rax
  mov    %rax,(%rsp)
L364:
  movsd  0x0(%r13),%xmm0
  xorpd  D2(%rip),%xmm0
  movsd  %xmm0,0x0(%r13)
  movsbl (%rax),%edi
  jmp    L351
  nopl   0x0(%rax)
L258:
  add    $0x1,%rbx
  mov    $0xffffffff,%r13d
  jmp    L370
  nop
L337:
  add    $0x1,%rbx
  mov    $0x1,%r13d
  jmp    L284
L9:
  movsbl %cl,%edi
  call   <toupper@plt>
  cmp    $0x57,%al
  je     L369
  mov    (%rsp),%rdx
  cmp    $0x45,%al
  jne    L157
  add    $0x1,%rdx
  mov    %rdx,(%rsp)
L368:
  movsd  0x0(%rbp),%xmm0
  xorpd  D2(%rip),%xmm0
  movsd  %xmm0,0x0(%rbp)
L157:
  movzbl (%rdx),%ecx
  jmp    L187
L6:
  mov    $0x1,%eax
  jmp    L318
L369:
  mov    (%rsp),%rax
  lea    0x1(%rax),%rdx
  mov    %rdx,(%rsp)
  movzbl 0x1(%rax),%ecx
  jmp    L187
L76:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: data_tag: D2
type: byte[16]

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

assistant: ```c
int str2dd(char *s, double *lat, double *lon) {
  char *e;
  int dir = 0;
  char c;
  c = toupper(*s);
  if (c == '+' || c == 'N') {
    s++;
    dir = 1;
  }
  if (c == '-' || c == 'S') {
    s++;
    dir = -1;
  }
  *lat = parse_dd_or_dms(s, &e);
  if (isnan(*lat) || e == NULL || e == s || *e == '\0')
    return 0;
  if (!dir) {
    c = toupper(*e);
    if (c == 'N')
      dir = 1;
    if (c == 'S')
      dir = -1;
    if (dir)
      e++;
  }
  if (dir < 0)
    *lat = -*lat;
  while (isspace(*e))
    e++;
  if (*e == '\0')
    return 0;
  s = e;
  dir = 0;
  c = toupper(*s);
  if (c == '+' || c == 'W') {
    s++;
    dir = 1;
  }
  if (c == '-' || c == 'E') {
    s++;
    dir = -1;
  }
  *lon = parse_dd_or_dms(s, &e);
  if (isnan(*lon) || e == s)
    return 0;
  if (e == NULL || *e == '\0')
    return 1;
  if (dir == 0) {
    c = toupper(*e);
    if (c == 'W')
      dir = 1;
    if (c == 'E')
      dir = -1;
    if (dir != 0)
      e++;
  }
  if (dir < 0)
    *lon = -*lon;
  return (*e == '\0');
}
```