// File: jkingan[P]ladyheather/heathui.cpp
// Function: deg_min_sec(char*)
double deg_min_sec(char *s)
{
double val;
unsigned i, j, len;
double sign;

   if(s == 0) return 0.0;

   strcpy(out, s);

   val = 0.0;
   sign = (1.0);

   j = 0;
   len = strlen(out);
   for(i=0; i<len; i++) {
      if(out[i] == '-') sign *= (-1.0);

      if(toupper(out[i]) == 'D') { // degrees
         out[i] = 0;
         val += fabs(atof(&out[j]) * 60.0*60.0);
         j = i+1;
      }
      else if(toupper(out[i]) == 'M') { // minutes
         out[i] = 0;
         val += fabs(atof(&out[j]) * 60.0);
         j = i+1;
      }
      else if(toupper(out[i]) == 'S') { // seconds
         out[i] = 0;
         val += fabs(atof(&out[j]) * 1.0);
         j = i+1;
      }
   }

   return (val / 3600.0 * sign);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0x451c0
xorps %xmm0, %xmm0
movsd %xmm0, -0x8(%rbp)
jmp 0x453a9
movq -0x10(%rbp), %rsi
leaq 0x356235(%rip), %rdi    # 0x39b400
callq 0x9350
xorps %xmm0, %xmm0
movsd %xmm0, -0x18(%rbp)
movsd 0x129e88(%rip), %xmm0   # 0x16f068
movsd %xmm0, -0x30(%rbp)
movl $0x0, -0x20(%rbp)
leaq 0x35620d(%rip), %rdi    # 0x39b400
callq 0x9120
movl %eax, -0x24(%rbp)
movl $0x0, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
cmpl -0x24(%rbp), %eax
jae 0x4538e
movl -0x1c(%rbp), %eax
movl %eax, %ecx
leaq 0x3561e6(%rip), %rax    # 0x39b400
movsbl (%rax,%rcx), %eax
cmpl $0x2d, %eax
jne 0x45235
movsd 0x129eed(%rip), %xmm0   # 0x16f118
mulsd -0x30(%rbp), %xmm0
movsd %xmm0, -0x30(%rbp)
movl -0x1c(%rbp), %eax
movl %eax, %ecx
leaq 0x3561bf(%rip), %rax    # 0x39b400
movsbl (%rax,%rcx), %edi
callq 0x96e0
cmpl $0x44, %eax
jne 0x452ac
movl -0x1c(%rbp), %eax
movl %eax, %ecx
leaq 0x3561a5(%rip), %rax    # 0x39b400
movb $0x0, (%rax,%rcx)
movl -0x20(%rbp), %eax
leaq 0x356197(%rip), %rdi    # 0x39b400
addq %rax, %rdi
callq 0x9480
movsd 0x129d9f(%rip), %xmm1   # 0x16f018
mulsd %xmm1, %xmm0
movsd 0x129d93(%rip), %xmm1   # 0x16f018
mulsd %xmm1, %xmm0
movaps 0x12a000(%rip), %xmm1   # 0x16f290
pand %xmm1, %xmm0
addsd -0x18(%rbp), %xmm0
movsd %xmm0, -0x18(%rbp)
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x4537e
movl -0x1c(%rbp), %eax
movl %eax, %ecx
leaq 0x356148(%rip), %rax    # 0x39b400
movsbl (%rax,%rcx), %edi
callq 0x96e0
cmpl $0x4d, %eax
jne 0x45314
movl -0x1c(%rbp), %eax
movl %eax, %ecx
leaq 0x35612e(%rip), %rax    # 0x39b400
movb $0x0, (%rax,%rcx)
movl -0x20(%rbp), %eax
leaq 0x356120(%rip), %rdi    # 0x39b400
addq %rax, %rdi
callq 0x9480
movsd 0x129d28(%rip), %xmm1   # 0x16f018
mulsd %xmm1, %xmm0
movaps 0x129f95(%rip), %xmm1   # 0x16f290
pand %xmm1, %xmm0
addsd -0x18(%rbp), %xmm0
movsd %xmm0, -0x18(%rbp)
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x4537c
movl -0x1c(%rbp), %eax
movl %eax, %ecx
leaq 0x3560e0(%rip), %rax    # 0x39b400
movsbl (%rax,%rcx), %edi
callq 0x96e0
cmpl $0x53, %eax
jne 0x4537a
movl -0x1c(%rbp), %eax
movl %eax, %ecx
leaq 0x3560c6(%rip), %rax    # 0x39b400
movb $0x0, (%rax,%rcx)
movl -0x20(%rbp), %eax
leaq 0x3560b8(%rip), %rdi    # 0x39b400
addq %rax, %rdi
callq 0x9480
movsd 0x129d10(%rip), %xmm1   # 0x16f068
mulsd %xmm1, %xmm0
movaps 0x129f2d(%rip), %xmm1   # 0x16f290
pand %xmm1, %xmm0
addsd -0x18(%rbp), %xmm0
movsd %xmm0, -0x18(%rbp)
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x20(%rbp)
jmp 0x4537c
jmp 0x4537e
jmp 0x45380
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x45202
movsd -0x18(%rbp), %xmm0
movsd 0x129c75(%rip), %xmm1   # 0x16f010
divsd %xmm1, %xmm0
mulsd -0x30(%rbp), %xmm0
movsd %xmm0, -0x8(%rbp)
movsd -0x8(%rbp), %xmm0
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)