// File: /workspace/github_cpp_makefile_star2_O2/jkingan[P]ladyheather/heathgps.cpp
// Function: parse_brandy_j()
void parse_brandy_j()
{
double jd;
int pend;
int i;
int yy,mon,dd;
int hh,mm,ss;

   // leapsecond info
   log_packet_id("leapsecond info");

   yy = mon = dd = 0;
   hh = mm = ss = 0;
   if(get_fixed_field(2)) {
      yy = atoi(msg_field);
      if(yy < 80) yy += 2000;
      else        yy += 1900;
   }
   if(get_fixed_field(2)) mon = atoi(msg_field);
   if(get_fixed_field(2)) dd = atoi(msg_field);
   if(get_fixed_field(2)) hh = atoi(msg_field);
   if(get_fixed_field(2)) mm = atoi(msg_field);
   if(get_fixed_field(2)) ss = atoi(msg_field);
   get_fixed_field(1);  // eat the comma
//sprintf(debug_text3, "leap: %04d/%02d/%02d  %02d:%02d:%02d (%s)", yy,mon,dd, hh,mm,ss, msg_field);

   if(get_msg_field()) {
      pend = atoi(msg_field);  // leap second +/- 1
//sprintf(debug_text, "leap dir:%s  pend:%d", msg_field, pend);
      minor_alarms &= (~MINOR_LEAP_PEND);
      if(pend) {
         minor_alarms |= MINOR_LEAP_PEND;
         if(yy || mon || dd || hh || mm || ss) {
           jd = jdate(yy, mon, dd);  // -1 since moto says 2017/1/1
           jd_leap = jd + jtime(hh,mm,ss,-1.0);
           have_jd_leap = 8;
           calc_jd_leap(8);
         }
      }
      have_leap_info = 54;
   }

   if(get_msg_field()) {  // leap second count
      i = atoi(msg_field);
      if(i) {
         if(!user_set_utc_ofs) utc_offset = i;
         check_utc_ofs(33);
      }
   }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
leaq 0x8fb6f(%rip), %rdi     # 0x10d6da
callq 0x520bf
pushq $0x2
popq %rdi
callq 0x78198
xorl %ebx, %ebx
movl $0x0, %r14d
testl %eax, %eax
je 0x7dba8
leaq 0x2a7eb5(%rip), %rdi    # 0x325a40
callq 0x95e0
movl %eax, %r14d
cmpl $0x4f, %eax
jg 0x7dba1
addl $0x7d0, %r14d           # imm = 0x7D0
jmp 0x7dba8
addl $0x76c, %r14d           # imm = 0x76C
pushq $0x2
popq %rdi
callq 0x78198
testl %eax, %eax
je 0x7dbc2
leaq 0x2a7e85(%rip), %rdi    # 0x325a40
callq 0x95e0
movl %eax, %ebx
pushq $0x2
popq %rdi
callq 0x78198
xorl %r15d, %r15d
movl $0x0, %r12d
testl %eax, %eax
je 0x7dbe6
leaq 0x2a7e62(%rip), %rdi    # 0x325a40
callq 0x95e0
movl %eax, %r12d
movl %ebx, -0x30(%rbp)
pushq $0x2
popq %rdi
callq 0x78198
testl %eax, %eax
je 0x7dc04
leaq 0x2a7e44(%rip), %rdi    # 0x325a40
callq 0x95e0
movl %eax, %r15d
pushq $0x2
popq %rdi
callq 0x78198
xorl %r13d, %r13d
movl $0x0, %ebx
testl %eax, %eax
je 0x7dc26
leaq 0x2a7e21(%rip), %rdi    # 0x325a40
callq 0x95e0
movl %eax, %ebx
pushq $0x2
popq %rdi
callq 0x78198
testl %eax, %eax
je 0x7dc41
leaq 0x2a7e07(%rip), %rdi    # 0x325a40
callq 0x95e0
movl %eax, %r13d
pushq $0x1
popq %rdi
callq 0x78198
callq 0x75767
testl %eax, %eax
je 0x7dcf0
leaq 0x2a7de3(%rip), %rdi    # 0x325a40
callq 0x95e0
leaq 0x27956f(%rip), %rcx    # 0x2f71d8
movl (%rcx), %edx
movl %edx, %esi
andl $0xffffff7f, %esi       # imm = 0xFFFFFF7F
movl %esi, (%rcx)
testl %eax, %eax
je 0x7dce3
orl $0x80, %edx
movl %edx, (%rcx)
movl %r14d, %eax
orl -0x30(%rbp), %eax
movl %r12d, %ecx
orl %r15d, %ecx
orl %eax, %ecx
orl %ebx, %ecx
orl %r13d, %ecx
je 0x7dce3
movl %r14d, %edi
movl -0x30(%rbp), %esi
movl %r12d, %edx
callq 0xc2f07
movsd %xmm0, -0x30(%rbp)
movsd 0x75447(%rip), %xmm0    # 0xf30f8
movl %r15d, %edi
movl %ebx, %esi
movl %r13d, %edx
callq 0xc2faf
addsd -0x30(%rbp), %xmm0
leaq 0x279896(%rip), %rax    # 0x2f7560
movsd %xmm0, (%rax)
leaq 0x279893(%rip), %rax    # 0x2f7568
movl $0x8, (%rax)
pushq $0x8
popq %rdi
callq 0x557cf
leaq 0x2795ae(%rip), %rax    # 0x2f7298
movl $0x36, (%rax)
callq 0x75767
testl %eax, %eax
je 0x7dd34
leaq 0x2a7d40(%rip), %rdi    # 0x325a40
callq 0x95e0
testl %eax, %eax
je 0x7dd34
leaq 0x279a24(%rip), %rcx    # 0x2f7734
cmpl $0x0, (%rcx)
jne 0x7dd1e
leaq 0x279a0c(%rip), %rcx    # 0x2f7728
movl %eax, (%rcx)
pushq $0x21
popq %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x51a91
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq