// File: jkingan[P]ladyheather/heathui.cpp
// Function: hms_val(char*)
double hms_val(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]) == 'W') {  // weeks
         out[i] = 0;
         val += fabs(atof(&out[j]) * 7.0*24.0*60.0*60.0);
         j = i+1;
      }
      else if(toupper(out[i]) == 'D') { // days
         out[i] = 0;
         val += fabs(atof(&out[j]) * 24.0*60.0*60.0);
         j = i+1;
      }
      else if(toupper(out[i]) == 'H') { // hours
         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*sign);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0x44ea0
xorps %xmm0, %xmm0
movsd %xmm0, -0x8(%rbp)
jmp 0x45193
movq -0x10(%rbp), %rsi
leaq 0x356555(%rip), %rdi    # 0x39b400
callq 0x9350
xorps %xmm0, %xmm0
movsd %xmm0, -0x18(%rbp)
movsd 0x12a1a8(%rip), %xmm0   # 0x16f068
movsd %xmm0, -0x30(%rbp)
movl $0x0, -0x20(%rbp)
leaq 0x35652d(%rip), %rdi    # 0x39b400
callq 0x9120
movl %eax, -0x24(%rbp)
movl $0x0, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
cmpl -0x24(%rbp), %eax
jae 0x45184
movl -0x1c(%rbp), %eax
movl %eax, %ecx
leaq 0x356506(%rip), %rax    # 0x39b400
movsbl (%rax,%rcx), %eax
cmpl $0x2d, %eax
jne 0x44f15
movsd 0x12a20d(%rip), %xmm0   # 0x16f118
mulsd -0x30(%rbp), %xmm0
movsd %xmm0, -0x30(%rbp)
movl -0x1c(%rbp), %eax
movl %eax, %ecx
leaq 0x3564df(%rip), %rax    # 0x39b400
movsbl (%rax,%rcx), %edi
callq 0x96e0
cmpl $0x57, %eax
jne 0x44fa4
movl -0x1c(%rbp), %eax
movl %eax, %ecx
leaq 0x3564c5(%rip), %rax    # 0x39b400
movb $0x0, (%rax,%rcx)
movl -0x20(%rbp), %eax
leaq 0x3564b7(%rip), %rdi    # 0x39b400
addq %rax, %rdi
callq 0x9480
movsd 0x12c72f(%rip), %xmm1   # 0x171688
mulsd %xmm1, %xmm0
movsd 0x12a0d3(%rip), %xmm1   # 0x16f038
mulsd %xmm1, %xmm0
movsd 0x12a0a7(%rip), %xmm1   # 0x16f018
mulsd %xmm1, %xmm0
movsd 0x12a09b(%rip), %xmm1   # 0x16f018
mulsd %xmm1, %xmm0
movaps 0x12a308(%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 0x45174
movl -0x1c(%rbp), %eax
movl %eax, %ecx
leaq 0x356450(%rip), %rax    # 0x39b400
movsbl (%rax,%rcx), %edi
callq 0x96e0
cmpl $0x44, %eax
jne 0x45027
movl -0x1c(%rbp), %eax
movl %eax, %ecx
leaq 0x356436(%rip), %rax    # 0x39b400
movb $0x0, (%rax,%rcx)
movl -0x20(%rbp), %eax
leaq 0x356428(%rip), %rdi    # 0x39b400
addq %rax, %rdi
callq 0x9480
movsd 0x12a050(%rip), %xmm1   # 0x16f038
mulsd %xmm1, %xmm0
movsd 0x12a024(%rip), %xmm1   # 0x16f018
mulsd %xmm1, %xmm0
movsd 0x12a018(%rip), %xmm1   # 0x16f018
mulsd %xmm1, %xmm0
movaps 0x12a285(%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 0x45172
movl -0x1c(%rbp), %eax
movl %eax, %ecx
leaq 0x3563cd(%rip), %rax    # 0x39b400
movsbl (%rax,%rcx), %edi
callq 0x96e0
cmpl $0x48, %eax
jne 0x4509e
movl -0x1c(%rbp), %eax
movl %eax, %ecx
leaq 0x3563b3(%rip), %rax    # 0x39b400
movb $0x0, (%rax,%rcx)
movl -0x20(%rbp), %eax
leaq 0x3563a5(%rip), %rdi    # 0x39b400
addq %rax, %rdi
callq 0x9480
movsd 0x129fad(%rip), %xmm1   # 0x16f018
mulsd %xmm1, %xmm0
movsd 0x129fa1(%rip), %xmm1   # 0x16f018
mulsd %xmm1, %xmm0
movaps 0x12a20e(%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 0x45170
movl -0x1c(%rbp), %eax
movl %eax, %ecx
leaq 0x356356(%rip), %rax    # 0x39b400
movsbl (%rax,%rcx), %edi
callq 0x96e0
cmpl $0x4d, %eax
jne 0x45106
movl -0x1c(%rbp), %eax
movl %eax, %ecx
leaq 0x35633c(%rip), %rax    # 0x39b400
movb $0x0, (%rax,%rcx)
movl -0x20(%rbp), %eax
leaq 0x35632e(%rip), %rdi    # 0x39b400
addq %rax, %rdi
callq 0x9480
movsd 0x129f36(%rip), %xmm1   # 0x16f018
mulsd %xmm1, %xmm0
movaps 0x12a1a3(%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 0x4516e
movl -0x1c(%rbp), %eax
movl %eax, %ecx
leaq 0x3562ee(%rip), %rax    # 0x39b400
movsbl (%rax,%rcx), %edi
callq 0x96e0
cmpl $0x53, %eax
jne 0x4516c
movl -0x1c(%rbp), %eax
movl %eax, %ecx
leaq 0x3562d4(%rip), %rax    # 0x39b400
movb $0x0, (%rax,%rcx)
movl -0x20(%rbp), %eax
leaq 0x3562c6(%rip), %rdi    # 0x39b400
addq %rax, %rdi
callq 0x9480
movsd 0x129f1e(%rip), %xmm1   # 0x16f068
mulsd %xmm1, %xmm0
movaps 0x12a13b(%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 0x4516e
jmp 0x45170
jmp 0x45172
jmp 0x45174
jmp 0x45176
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
jmp 0x44ee2
movsd -0x18(%rbp), %xmm0
mulsd -0x30(%rbp), %xmm0
movsd %xmm0, -0x8(%rbp)
movsd -0x8(%rbp), %xmm0
addq $0x30, %rsp
popq %rbp
retq
nop