// File: jkingan[P]ladyheather/heathgps.cpp
// Function: parse_tm4_pop(int)
void parse_tm4_pop(int type)
{
int pop_month,pop_day,pop_year;
int pop_hours,pop_minutes,pop_seconds;
double pop_frac;

   log_packet_id("POP/ETT");

   pop_jd = 0.0;

   if(get_msg_field()) {
      tm4_pop_mode = atoi(msg_field);
      have_tm4_pop_mode = 1;
   }

   if(get_msg_field()) {
      tm4_pop_polarity = msg_field[0];
      have_tm4_pop_polarity = 1;
   }

   if(get_msg_field()) {
      sscanf(msg_field, "%02d%02d%04d", &pop_month,&pop_day,&pop_year);
      pop_jd = jdate(pop_year,pop_month,pop_day);
   }
   if(get_msg_field()) {
      sscanf(msg_field, "%02d%02d%02d%lf", &pop_hours,&pop_minutes,&pop_seconds, &pop_frac);
      pop_jd += jtime(pop_hours,pop_minutes,pop_seconds,pop_frac);
      ++have_tm4_pop_jd;
   }


   if(get_msg_field()) {
      tm4_repeat = atoi(msg_field);
      have_tm4_repeat = 1;
   }

   if(type == 74) {  // simultaneous POP/ETT device
      if(get_msg_field()) {
         tm4_width = atoi(msg_field);
         have_tm4_width = 1;
      }
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movl %edi, -0x4(%rbp)
leaq 0xa8ab5(%rip), %rdi     # 0x188ed7
callq 0x7add0
leaq 0x2bad4a(%rip), %rax    # 0x39b178
xorps %xmm0, %xmm0
movsd %xmm0, (%rax)
callq 0xb0bd0
cmpl $0x0, %eax
je 0xe0463
leaq 0x2ba7da(%rip), %rdi    # 0x39ac20
callq 0x95c0
movl %eax, %ecx
leaq 0x2bad04(%rip), %rax    # 0x39b158
movl %ecx, (%rax)
leaq 0x2bacff(%rip), %rax    # 0x39b15c
movl $0x1, (%rax)
callq 0xb0bd0
cmpl $0x0, %eax
je 0xe048d
leaq 0x2ba7ac(%rip), %rax    # 0x39ac20
movsbl (%rax), %ecx
leaq 0x2bace2(%rip), %rax    # 0x39b160
movl %ecx, (%rax)
leaq 0x2bacdd(%rip), %rax    # 0x39b164
movl $0x1, (%rax)
callq 0xb0bd0
cmpl $0x0, %eax
je 0xe04d1
leaq 0x2ba782(%rip), %rdi    # 0x39ac20
leaq 0xa8968(%rip), %rsi     # 0x188e0d
leaq -0x8(%rbp), %rdx
leaq -0xc(%rbp), %rcx
leaq -0x10(%rbp), %r8
movb $0x0, %al
callq 0x9370
movl -0x10(%rbp), %edi
movl -0x8(%rbp), %esi
movl -0xc(%rbp), %edx
callq 0x122140
leaq 0x2bacab(%rip), %rax    # 0x39b178
movsd %xmm0, (%rax)
callq 0xb0bd0
cmpl $0x0, %eax
je 0xe053e
leaq 0x2ba73e(%rip), %rdi    # 0x39ac20
leaq 0xa8971(%rip), %rsi     # 0x188e5a
leaq -0x14(%rbp), %rdx
leaq -0x18(%rbp), %rcx
leaq -0x1c(%rbp), %r8
leaq -0x28(%rbp), %r9
movb $0x0, %al
callq 0x9370
movl -0x14(%rbp), %edi
movl -0x18(%rbp), %esi
movl -0x1c(%rbp), %edx
movsd -0x28(%rbp), %xmm0
callq 0x122210
leaq 0x2bac5e(%rip), %rax    # 0x39b178
addsd (%rax), %xmm0
leaq 0x2bac53(%rip), %rax    # 0x39b178
movsd %xmm0, (%rax)
leaq 0x2bac50(%rip), %rax    # 0x39b180
movl (%rax), %ecx
addl $0x1, %ecx
leaq 0x2bac44(%rip), %rax    # 0x39b180
movl %ecx, (%rax)
callq 0xb0bd0
cmpl $0x0, %eax
je 0xe056c
leaq 0x2ba6d1(%rip), %rdi    # 0x39ac20
callq 0x95c0
movl %eax, %ecx
leaq 0x2babf3(%rip), %rax    # 0x39b150
movl %ecx, (%rax)
leaq 0x2babee(%rip), %rax    # 0x39b154
movl $0x1, (%rax)
cmpl $0x4a, -0x4(%rbp)
jne 0xe05a2
callq 0xb0bd0
cmpl $0x0, %eax
je 0xe05a0
leaq 0x2ba69d(%rip), %rdi    # 0x39ac20
callq 0x95c0
movl %eax, %ecx
leaq 0x2babb7(%rip), %rax    # 0x39b148
movl %ecx, (%rax)
leaq 0x2babb2(%rip), %rax    # 0x39b14c
movl $0x1, (%rax)
jmp 0xe05a2
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax,%rax)