// File: jkingan[P]ladyheather/heathgps.cpp
// Function: parse_moto_Cj()
void parse_moto_Cj()
{
int c;
int i;

   // Motorola receiver id message:

   // <cr><lf>
   // COPYRIGHT 1991-199X MOTOROLA INC.<cr><lf> 
   // SFTW P/N # XXXXXXXXXXXXXXX<cr><lf> 
   // SOFTWARE VER # XXXXXXXXXXX<cr><lf> 
   // SOFTWARE REV # XXXXXXXXXXX<cr><lf> 
   // SOFTWARE DATE  XXXXXXXXXXX<cr><lf> 
   // MODEL #    XXXXXXXXXXXXXXX<cr><lf> 
   // HDWR P/N # XXXXXXXXXXXXXXX<cr><lf> 
   // SERIAL #   XXXXXXXXXXXXXXX<cr><lf> 
   // MANUFACTUR DATE XXXXXXXXXX<cr><lf> 
   // OPTIONS LIST    XXXXXXXXXX<cr><lf> 

   log_packet_id("receiver id");
   i = 0;
   moto_id_lines = 0;
   moto_id[moto_id_lines][0] = 0;

   while(moto_msg_len > 0) {  // get the lines from the device id message
      c = tsip_byte();

      if(c == 0x00) ;
      else if(c == 0x0D) ;
      else if(c == 0x0A) {
         ++moto_id_lines;
         if(moto_id_lines >= MAX_ID_LINES) break;
         i = 0;
         moto_id[moto_id_lines][0] = 0;
      }
      else if(i <= 128) {
         moto_id[moto_id_lines][i++] = c;
         moto_id[moto_id_lines][i] = 0;
      }
      --moto_msg_len;
   }
   if(1 || moto_id_lines) saw_version |= 0x1000;

   have_info |= ALL_ID_INFO;
   furuno_moto = 0;
   if(moto_id[1][0]) {
      if(strstr(moto_id[1], "Furuno")) furuno_moto = 1;
   }

// show_version_info();

if(debug_file) {
   for(i=0; i<moto_id_lines; i++) fprintf(debug_file, "[%s]\n", &moto_id[i][0]);
}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
leaq 0xb552d(%rip), %rdi     # 0x187e9c
callq 0x7add0
movl $0x0, -0x8(%rbp)
leaq 0x1a579a(%rip), %rax    # 0x27811c
movl $0x0, (%rax)
leaq 0x1a578d(%rip), %rax    # 0x27811c
movslq (%rax), %rcx
leaq 0x1a5177(%rip), %rax    # 0x277b10
imulq $0x81, %rcx, %rcx
addq %rcx, %rax
movb $0x0, (%rax)
cmpl $0x0, 0x2f92fb(%rip)    # 0x3cbca8
jle 0xd2a9e
callq 0x7a510
movzbl %al, %eax
movl %eax, -0x4(%rbp)
cmpl $0x0, -0x4(%rbp)
jne 0xd29c9
jmp 0xd2a8a
cmpl $0xd, -0x4(%rbp)
jne 0xd29d4
jmp 0xd2a88
cmpl $0xa, -0x4(%rbp)
jne 0xd2a27
leaq 0x1a573b(%rip), %rax    # 0x27811c
movl (%rax), %ecx
addl $0x1, %ecx
leaq 0x1a572f(%rip), %rax    # 0x27811c
movl %ecx, (%rax)
leaq 0x1a5726(%rip), %rax    # 0x27811c
cmpl $0xc, (%rax)
jl 0xd2a00
jmp 0xd2a9e
movl $0x0, -0x8(%rbp)
leaq 0x1a570e(%rip), %rax    # 0x27811c
movslq (%rax), %rcx
leaq 0x1a50f8(%rip), %rax    # 0x277b10
imulq $0x81, %rcx, %rcx
addq %rcx, %rax
movb $0x0, (%rax)
jmp 0xd2a86
cmpl $0x80, -0x8(%rbp)
jg 0xd2a84
movl -0x4(%rbp), %eax
movb %al, %dl
leaq 0x1a56e0(%rip), %rax    # 0x27811c
movslq (%rax), %rcx
leaq 0x1a50ca(%rip), %rax    # 0x277b10
imulq $0x81, %rcx, %rcx
addq %rcx, %rax
movl -0x8(%rbp), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, -0x8(%rbp)
movslq %ecx, %rcx
movb %dl, (%rax,%rcx)
leaq 0x1a56b4(%rip), %rax    # 0x27811c
movslq (%rax), %rcx
leaq 0x1a509e(%rip), %rax    # 0x277b10
imulq $0x81, %rcx, %rcx
addq %rcx, %rax
movslq -0x8(%rbp), %rcx
movb $0x0, (%rax,%rcx)
jmp 0xd2a86
jmp 0xd2a88
jmp 0xd2a8a
movl 0x2f9218(%rip), %eax    # 0x3cbca8
addl $-0x1, %eax
movl %eax, 0x2f920f(%rip)    # 0x3cbca8
jmp 0xd29a6
leaq 0x299b43(%rip), %rax    # 0x36c5e8
movl (%rax), %ecx
orl $0x1000, %ecx           # imm = 0x1000
leaq 0x299b34(%rip), %rax    # 0x36c5e8
movl %ecx, (%rax)
leaq 0x29a097(%rip), %rax    # 0x36cb54
movl (%rax), %ecx
orl $0xf, %ecx
leaq 0x29a08b(%rip), %rax    # 0x36cb54
movl %ecx, (%rax)
leaq 0x1a564e(%rip), %rax    # 0x278120
movl $0x0, (%rax)
leaq 0x1a5031(%rip), %rax    # 0x277b10
cmpb $0x0, 0x81(%rax)
je 0xd2b17
leaq 0x1a5021(%rip), %rdi    # 0x277b10
addq $0x81, %rdi
leaq 0xb54b0(%rip), %rsi     # 0x187fad
callq 0x9090
cmpq $0x0, %rax
je 0xd2b15
leaq 0x1a5611(%rip), %rax    # 0x278120
movl $0x1, (%rax)
jmp 0xd2b17
leaq 0x1caa52(%rip), %rax    # 0x29d570
cmpq $0x0, (%rax)
je 0xd2b73
movl $0x0, -0x8(%rbp)
movl -0x8(%rbp), %eax
leaq 0x1a55e7(%rip), %rcx    # 0x27811c
cmpl (%rcx), %eax
jge 0xd2b71
leaq 0x1caa30(%rip), %rax    # 0x29d570
movq (%rax), %rdi
movslq -0x8(%rbp), %rax
leaq 0x1a4fc2(%rip), %rdx    # 0x277b10
imulq $0x81, %rax, %rax
addq %rax, %rdx
leaq 0xb5dc0(%rip), %rsi     # 0x18891f
movb $0x0, %al
callq 0x9550
movl -0x8(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x8(%rbp)
jmp 0xd2b2b
jmp 0xd2b73
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)