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

```asm
<latlon2ul>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %rdi,%r14
  mov    %rsi,(%rsp)
  mov    (%rdi),%rbx
  mov    $0x0,%ebp
  jmp    L77
L69:
  lea    0x0(%rbp,%rbp,4),%edx
  add    $0x1,%rbx
  movsbl -0x1(%rbx),%eax
  lea    -0x30(%rax,%rdx,2),%ebp
L77:
  movzbl (%rbx),%edi
  call   <isdigit@plt>
  test   %rax,%rax
  jne    L69
  jmp    L82
L46:
  add    $0x1,%rbx
L82:
  movzbl (%rbx),%edi
  call   <isspace@plt>
  test   %rax,%rax
  jne    L46
  movzbl (%rbx),%edi
  call   <isdigit@plt>
  mov    $0x0,%r12d
  test   %rax,%rax
  jne    L48
  movl   $0x0,0xc(%rsp)
  mov    $0x0,%r13d
  mov    $0x0,%r12d
  jmp    L215
L190:
  lea    (%r12,%r12,4),%edx
  add    $0x1,%rbx
  movsbl -0x1(%rbx),%eax
  lea    -0x30(%rax,%rdx,2),%r12d
L48:
  movzbl (%rbx),%edi
  call   <isdigit@plt>
  test   %rax,%rax
  jne    L190
  jmp    L148
L346:
  add    $0x1,%rbx
L148:
  movzbl (%rbx),%edi
  call   <isspace@plt>
  test   %rax,%rax
  jne    L346
  movzbl (%rbx),%edi
  call   <isdigit@plt>
  mov    $0x0,%r13d
  test   %rax,%rax
  jne    L105
  movl   $0x0,0xc(%rsp)
  mov    $0x0,%r13d
  jmp    L215
L306:
  lea    0x0(%r13,%r13,4),%edx
  add    $0x1,%rbx
  movsbl -0x1(%rbx),%eax
  lea    -0x30(%rax,%rdx,2),%r13d
L105:
  movzbl (%rbx),%edi
  call   <isdigit@plt>
  test   %rax,%rax
  jne    L306
  movl   $0x0,0xc(%rsp)
  cmpb   $0x2e,(%rbx)
  jne    L29
  movzbl 0x1(%rbx),%edi
  call   <isdigit@plt>
  test   %rax,%rax
  jne    L163
  add    $0x1,%rbx
  movl   $0x0,0xc(%rsp)
  jmp    L29
L163:
  movsbl 0x1(%rbx),%eax
  sub    $0x30,%eax
  imul   $0x64,%eax,%eax
  mov    %eax,0xc(%rsp)
  movzbl 0x2(%rbx),%edi
  call   <isdigit@plt>
  test   %rax,%rax
  jne    L136
  add    $0x2,%rbx
  jmp    L29
L136:
  movsbl 0x2(%rbx),%eax
  lea    -0xf0(%rax,%rax,4),%eax
  mov    0xc(%rsp),%ecx
  lea    (%rcx,%rax,2),%eax
  mov    %eax,0xc(%rsp)
  movzbl 0x3(%rbx),%edi
  call   <isdigit@plt>
  test   %rax,%rax
  jne    L341
  add    $0x3,%rbx
  jmp    L29
L341:
  movsbl 0x3(%rbx),%eax
  mov    0xc(%rsp),%ecx
  lea    -0x30(%rcx,%rax,1),%eax
  mov    %eax,0xc(%rsp)
  lea    0x4(%rbx),%rbx
  jmp    L29
L289:
  add    $0x1,%rbx
L29:
  movzbl (%rbx),%edi
  call   <isspace@plt>
  test   %rax,%rax
  je     L289
  jmp    L296
L156:
  add    $0x1,%rbx
L296:
  movzbl (%rbx),%edi
  call   <isspace@plt>
  test   %rax,%rax
  jne    L156
L215:
  movzbl (%rbx),%eax
  lea    -0x45(%rax),%ecx
  cmp    $0x32,%cl
  ja     L97
  mov    $0x1,%eax
  shl    %cl,%rax
  movabs $0x4400000044000,%rdx
  test   %rdx,%rax
  jne    L17
  mov    $0x0,%r15d
  movabs $0x20100000201,%rdx
  test   %rdx,%rax
  jne    L327
L344:
  mov    $0x1,%eax
  shl    %cl,%rax
  movabs $0x420000004200,%rdx
  test   %rdx,%rax
  jne    L74
  movabs $0x4000100040001,%rdx
  test   %rdx,%rax
  setne  %al
  movzbl %al,%eax
  add    %eax,%eax
L127:
  mov    (%rsp),%rsi
  mov    %eax,(%rsi)
  add    $0x1,%rbx
  jmp    L282
L327:
  imul   $0x3c,%ebp,%eax
  add    %r12d,%eax
  imul   $0x3c,%eax,%eax
  add    %r13d,%eax
  imul   $0x3e8,%eax,%eax
  mov    0xc(%rsp),%esi
  lea    -0x80000000(%rsi,%rax,1),%r15d
  jmp    L344
L17:
  imul   $0x3c,%ebp,%eax
  add    %r12d,%eax
  imul   $0x3c,%eax,%eax
  add    %r13d,%eax
  imul   $0xfffffc18,%eax,%eax
  add    $0x80000000,%eax
  sub    0xc(%rsp),%eax
  mov    %eax,%r15d
  jmp    L344
L97:
  mov    $0x0,%r15d
  mov    $0x0,%eax
  jmp    L127
L74:
  mov    $0x1,%eax
  jmp    L127
L49:
  add    $0x1,%rbx
L282:
  movzbl (%rbx),%edi
  call   <isspace@plt>
  test   %rax,%rax
  je     L49
  jmp    L269
L288:
  add    $0x1,%rbx
L269:
  movzbl (%rbx),%edi
  call   <isspace@plt>
  test   %rax,%rax
  jne    L288
  mov    %rbx,(%r14)
  mov    %r15d,%eax
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

assistant: ```c
u_int32_t latlon2ul(char **latlonstrptr, int *which) {
  char *cp;
  u_int32_t retval;
  int deg = 0, min = 0, secs = 0, secsfrac = 0;
  cp = *latlonstrptr;
  while (isdigit((unsigned char)*cp))
    deg = deg * 10 + (*cp++ - '0');
  while (isspace((unsigned char)*cp))
    cp++;
  if (!(isdigit((unsigned char)*cp)))
    goto fndhemi;
  while (isdigit((unsigned char)*cp))
    min = min * 10 + (*cp++ - '0');
  while (isspace((unsigned char)*cp))
    cp++;
  if (!(isdigit((unsigned char)*cp)))
    goto fndhemi;
  while (isdigit((unsigned char)*cp))
    secs = secs * 10 + (*cp++ - '0');
  if (*cp == '.') {
    cp++;
    if (isdigit((unsigned char)*cp)) {
      secsfrac = (*cp++ - '0') * 100;
      if (isdigit((unsigned char)*cp)) {
        secsfrac += (*cp++ - '0') * 10;
        if (isdigit((unsigned char)*cp)) {
          secsfrac += (*cp++ - '0');
        }
      }
    }
  }
  while (!isspace((unsigned char)*cp))
    cp++;
  while (isspace((unsigned char)*cp))
    cp++;
fndhemi:
  switch (*cp) {
  case 'N':
  case 'n':
  case 'E':
  case 'e':
    retval = ((u_int32_t)1 << 31) + (((((deg * 60) + min) * 60) + secs) * 1000) + secsfrac;
    break;
  case 'S':
  case 's':
  case 'W':
  case 'w':
    retval = ((u_int32_t)1 << 31) - (((((deg * 60) + min) * 60) + secs) * 1000) - secsfrac;
    break;
  default:
    retval = 0;
    break;
  }
  switch (*cp) {
  case 'N':
  case 'n':
  case 'S':
  case 's':
    *which = 1;
    break;
  case 'E':
  case 'e':
  case 'W':
  case 'w':
    *which = 2;
    break;
  default:
    *which = 0;
    break;
  }
  cp++;
  while (!isspace((unsigned char)*cp))
    cp++;
  while (isspace((unsigned char)*cp))
    cp++;
  *latlonstrptr = cp;
  return (retval);
}
```