// File: jkingan[P]ladyheather/heather.cpp
// Function: fmt_secs(double)
char *fmt_secs(double val)
{
static char buf[SLEN];
long secs;
char c1,c2;
int nav_flag;

   if(cursor_time_ref & 0x01) {  // time since start of displayed data
      c1 = '[';
      c2 = ']';
   }
   else {                 // time since start of capture
      c1 = '<';
      c2 = '>';
   }

   secs = (int) (val + 0.50);
   nav_flag = (((DATA_SIZE) (int) nav_rate) != nav_rate);

   if(cursor_time_ref & 0x02) {  // always show time as seconds
      if(nav_flag) {
         sprintf(buf, "%c%.1fs%c", c1, val, c2);
      }
      else {
         sprintf(buf, "%c%lds%c", c1, secs, c2);
      }
   }
   else if(nav_flag) {
      sprintf(buf, "%c%.1fs%c", c1, val, c2);
   }
   else if(secs < 60L) {
      sprintf(buf, "%c%lds%c", c1, secs, c2);
   }
   else if(secs < 60L*60L) {
      sprintf(buf, "%c%ldm%lds%c", c1, secs/60L, secs%60L, c2);
   }
   else {
      sprintf(buf, "%c%ldh%ldm%lds%c", c1, (secs/(60L*60L)), (secs/60L)%60L, secs%60L, c2);
   }

   return &buf[0];
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movsd %xmm0, -0x8(%rbp)
movl 0x261ffd(%rip), %eax    # 0x27a480
andl $0x1, %eax
cmpl $0x0, %eax
je 0x18495
movb $0x5b, -0x11(%rbp)
movb $0x5d, -0x12(%rbp)
jmp 0x1849d
movb $0x3c, -0x11(%rbp)
movb $0x3e, -0x12(%rbp)
movsd 0x156beb(%rip), %xmm0   # 0x16f090
addsd -0x8(%rbp), %xmm0
cvttsd2si %xmm0, %eax
cltq
movq %rax, -0x10(%rbp)
cvttsd2si 0x26207c(%rip), %eax # 0x27a538
cvtsi2sd %eax, %xmm0
ucomisd 0x262070(%rip), %xmm0   # 0x27a538
setne %al
setp %cl
orb %cl, %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x18(%rbp)
movl 0x261fa2(%rip), %eax    # 0x27a480
andl $0x2, %eax
cmpl $0x0, %eax
je 0x18537
cmpl $0x0, -0x18(%rbp)
je 0x18510
movsbl -0x11(%rbp), %edx
movsd -0x8(%rbp), %xmm0
movsbl -0x12(%rbp), %ecx
leaq 0x387140(%rip), %rdi    # 0x39f640
leaq 0x157e0b(%rip), %rsi    # 0x170312
movb $0x1, %al
callq 0x9060
jmp 0x18532
movsbl -0x11(%rbp), %edx
movq -0x10(%rbp), %rcx
movsbl -0x12(%rbp), %r8d
leaq 0x38711c(%rip), %rdi    # 0x39f640
leaq 0x157df1(%rip), %rsi    # 0x17031c
movb $0x0, %al
callq 0x9060
jmp 0x1864d
cmpl $0x0, -0x18(%rbp)
je 0x18564
movsbl -0x11(%rbp), %edx
movsd -0x8(%rbp), %xmm0
movsbl -0x12(%rbp), %ecx
leaq 0x3870ef(%rip), %rdi    # 0x39f640
leaq 0x157dba(%rip), %rsi    # 0x170312
movb $0x1, %al
callq 0x9060
jmp 0x1864b
cmpq $0x3c, -0x10(%rbp)
jge 0x18592
movsbl -0x11(%rbp), %edx
movq -0x10(%rbp), %rcx
movsbl -0x12(%rbp), %r8d
leaq 0x3870c1(%rip), %rdi    # 0x39f640
leaq 0x157d96(%rip), %rsi    # 0x17031c
movb $0x0, %al
callq 0x9060
jmp 0x18649
cmpq $0xe10, -0x10(%rbp)     # imm = 0xE10
jge 0x185e4
movsbl -0x11(%rbp), %eax
movl %eax, -0x1c(%rbp)
movq -0x10(%rbp), %rax
movl $0x3c, %ecx
cqto
idivq %rcx
movq %rax, %rcx
movq -0x10(%rbp), %rax
movl $0x3c, %esi
cqto
idivq %rsi
movq %rdx, %r8
movl -0x1c(%rbp), %edx
movsbl -0x12(%rbp), %r9d
leaq 0x38706c(%rip), %rdi    # 0x39f640
leaq 0x157d4a(%rip), %rsi    # 0x170325
movb $0x0, %al
callq 0x9060
jmp 0x18647
movsbl -0x11(%rbp), %eax
movl %eax, -0x20(%rbp)
movq -0x10(%rbp), %rax
movl $0xe10, %ecx            # imm = 0xE10
cqto
idivq %rcx
movq %rax, %rcx
movq -0x10(%rbp), %rax
movl $0x3c, %esi
cqto
idivq %rsi
movl $0x3c, %esi
cqto
idivq %rsi
movq %rdx, %r8
movq -0x10(%rbp), %rax
movl $0x3c, %esi
cqto
idivq %rsi
movq %rdx, %r9
movl -0x20(%rbp), %edx
movsbl -0x12(%rbp), %eax
leaq 0x38700a(%rip), %rdi    # 0x39f640
leaq 0x157cf5(%rip), %rsi    # 0x170332
movl %eax, (%rsp)
movb $0x0, %al
callq 0x9060
jmp 0x18649
jmp 0x1864b
jmp 0x1864d
leaq 0x386fec(%rip), %rax    # 0x39f640
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)