// File: /workspace/github_cpp_makefile_star2_O1/jkingan[P]ladyheather/heathui.cpp
// Function: edit_user_view(char*)
int edit_user_view(char *s)
{
DATA_SIZE val;

   // process the new plot view time setting
   val = 0.0;
   strcpy(out, s);
   strupr(out);
   if(strstr(out, "A")) {   // view ALL data
      view_all_data = 1;
      need_view_auto = 0;
   }
   else if(strstr(out, "T")) {   // view ALL data, auto scroll
      view_all_data = 2;
//    need_view_auto = 0;
   }
   else {                   // view a subset of the data
      view_all_data = 0;
      need_view_auto = 0;
      val = (DATA_SIZE) atof(out);
      if(val < 0.0) {
         val = (DATA_SIZE) 0.0 - val;
      }
      else if(val == 0.0) {
         user_view = 0L;
         view_interval = 1L;
         return 0;
      }
   }
   val *= nav_rate;

   if(queue_interval == 0) ;
   else if(strstr(out, "W")) {
      view_interval = (long) ((((val * (DATA_SIZE) (24.0*60.0*60.0)*7.0) / (DATA_SIZE) queue_interval) / PLOT_WIDTH) + (DATA_SIZE) 0.5);
   }
   else if(strstr(out, "D")) {
      view_interval = (long) ((((val * (DATA_SIZE) (24.0*60.0*60.0)) / (DATA_SIZE) queue_interval) / PLOT_WIDTH) + (DATA_SIZE) 0.5);
   }
   else if(strstr(out, "H")) {
      view_interval = (long) ((((val * (DATA_SIZE) (60.0*60.0)) / (DATA_SIZE) queue_interval) / PLOT_WIDTH) + (DATA_SIZE) 0.5);
   }
   else if(strstr(out, "M")) {
      view_interval = (long) ((((val * (DATA_SIZE) 60.0) / (DATA_SIZE) queue_interval) / PLOT_WIDTH) + (DATA_SIZE) 0.5);
   }
   else if(strstr(out, "S")) {
      view_interval = (long) (((val / (DATA_SIZE) queue_interval) / PLOT_WIDTH) + (DATA_SIZE) 0.5);
   }
   else if(strstr(out, "T")) {
      view_all(1);
      return 0;
   }
   else if(strstr(out, "A")) {
      view_all(1);
      return 0;
   }
   else if(queue_interval) {  // interval set in minutes per division
      val /= (DATA_SIZE) queue_interval;
      val *= (DATA_SIZE) 60.0;                   // seconds/division
      val /= (DATA_SIZE) HORIZ_MAJOR;
      view_interval = (long) val;
   }

   if(view_interval <= 1L) view_interval = 1L;
   user_view = view_interval;
   new_user_view = 1;

   return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rsi
leaq 0x30ce45(%rip), %rbx    # 0x33c220
movq %rbx, %rdi
callq 0x9340
movq %rbx, %rdi
callq 0x9899
movq %rbx, %rdi
movl $0x41, %esi
callq 0x9100
movq %rax, %rbx
testq %rax, %rax
je 0x2f419
leaq 0x1ebfbe(%rip), %rax    # 0x21b3c5
movb $0x1, (%rax)
leaq 0x1ebfaf(%rip), %rax    # 0x21b3c0
movl $0x0, (%rax)
jmp 0x2f43d
leaq 0x30ce00(%rip), %rdi    # 0x33c220
movl $0x54, %esi
callq 0x9100
testq %rax, %rax
je 0x2f4bc
leaq 0x1ebf8b(%rip), %rax    # 0x21b3c5
movb $0x2, (%rax)
xorpd %xmm1, %xmm1
leaq 0x1ebf50(%rip), %rax    # 0x21b398
movq (%rax), %r14
testq %r14, %r14
je 0x2f5a4
leaq 0x1ebefd(%rip), %rax    # 0x21b358
mulsd (%rax), %xmm1
movsd %xmm1, -0x18(%rbp)
leaq 0x30cdb5(%rip), %rdi    # 0x33c220
movl $0x57, %esi
callq 0x9100
testq %rax, %rax
je 0x2f494
movsd -0x18(%rbp), %xmm2
mulsd 0xd9b91(%rip), %xmm2    # 0x109018
mulsd 0xdc471(%rip), %xmm2    # 0x10b900
jmp 0x2f56f
leaq 0x30cd85(%rip), %rdi    # 0x33c220
movl $0x44, %esi
callq 0x9100
testq %rax, %rax
je 0x2f4f2
movsd -0x18(%rbp), %xmm2
mulsd 0xd9b61(%rip), %xmm2    # 0x109018
jmp 0x2f56f
leaq 0x1ebf02(%rip), %rax    # 0x21b3c5
movb $0x0, (%rax)
leaq 0x1ebef3(%rip), %rax    # 0x21b3c0
movl $0x0, (%rax)
leaq 0x30cd46(%rip), %rdi    # 0x33c220
callq 0x9470
xorpd %xmm1, %xmm1
ucomisd %xmm0, %xmm1
jbe 0x2f517
subsd %xmm0, %xmm1
jmp 0x2f441
leaq 0x30cd27(%rip), %rdi    # 0x33c220
movl $0x48, %esi
callq 0x9100
testq %rax, %rax
je 0x2f548
movsd -0x18(%rbp), %xmm2
mulsd 0xd9afb(%rip), %xmm2    # 0x109010
jmp 0x2f56f
ucomisd %xmm1, %xmm0
jne 0x2f5da
jp 0x2f5da
leaq 0x1ebe8a(%rip), %rax    # 0x21b3b8
movq $0x0, (%rax)
leaq 0x1ebe64(%rip), %rax    # 0x21b3a0
movq $0x1, (%rax)
jmp 0x2f5cf
leaq 0x30ccd1(%rip), %rdi    # 0x33c220
movl $0x4d, %esi
callq 0x9100
testq %rax, %rax
je 0x2f5e3
movsd -0x18(%rbp), %xmm2
mulsd 0xd9a99(%rip), %xmm2    # 0x109008
xorps %xmm0, %xmm0
cvtsi2sd %r14, %xmm0
leaq 0x1e9306(%rip), %rax    # 0x218884
xorps %xmm1, %xmm1
cvtsi2sdl (%rax), %xmm1
divsd %xmm0, %xmm2
divsd %xmm1, %xmm2
addsd 0xd9ad3(%rip), %xmm2    # 0x109068
cvttsd2si %xmm2, %rax
leaq 0x1ebdff(%rip), %rcx    # 0x21b3a0
movq %rax, (%rcx)
leaq 0x1ebdf5(%rip), %rax    # 0x21b3a0
cmpq $0x1, (%rax)
jg 0x2f5b8
movq $0x1, (%rax)
movq (%rax), %rax
leaq 0x1ebdf6(%rip), %rcx    # 0x21b3b8
movq %rax, (%rcx)
leaq 0x1ebdf8(%rip), %rax    # 0x21b3c4
movb $0x1, (%rax)
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %rbp
retq
movapd %xmm0, %xmm1
jmp 0x2f441
leaq 0x30cc36(%rip), %rdi    # 0x33c220
movl $0x53, %esi
callq 0x9100
testq %rax, %rax
je 0x2f619
xorps %xmm0, %xmm0
cvtsi2sd %r14, %xmm0
leaq 0x1e927c(%rip), %rax    # 0x218884
xorps %xmm1, %xmm1
cvtsi2sdl (%rax), %xmm1
movsd -0x18(%rbp), %xmm2
jmp 0x2f585
leaq 0x30cc00(%rip), %rdi    # 0x33c220
movl $0x54, %esi
callq 0x9100
testq %rax, %rax
jne 0x2f634
testq %rbx, %rbx
je 0x2f640
movl $0x1, %edi
callq 0x2f340
jmp 0x2f5cf
xorps %xmm0, %xmm0
cvtsi2sd %r14, %xmm0
movsd -0x18(%rbp), %xmm2
divsd %xmm0, %xmm2
mulsd 0xd99af(%rip), %xmm2    # 0x109008
leaq 0x1e9214(%rip), %rax    # 0x218874
xorps %xmm0, %xmm0
cvtsi2sdl (%rax), %xmm0
divsd %xmm0, %xmm2
jmp 0x2f595