// File: /workspace/github_c_makefile_star2_O0/canboat[P]canboat/analyzer/../common/parse.c
// Function: parseRawFormatAirmar
int parseRawFormatAirmar(char *msg, RawMessage *m, bool showJson)
{
  unsigned int prio, pgn, dst, src, len, i;
  char        *p;
  unsigned int id;

  p = findOccurrence(msg, ' ', 1);
  if (p < msg + 4 || p >= msg + sizeof(m->timestamp))
  {
    return 1;
  }

  memcpy(m->timestamp, msg, p - msg - 1);
  m->timestamp[p - msg - 1] = 0;
  p += 3;

  /* Moronic Windows does not support %hh<type> so we use intermediate variables */
  pgn = strtoul(p, &p, 10);
  if (*p == ' ')
  {
    id = strtoul(++p, &p, 16);
  }
  if (*p != ' ')
  {
    logError("Error reading message, scanned %zu bytes from %s", p - msg, msg);
    if (!showJson)
      fprintf(stdout, "%s", msg);
    return 2;
  }

  getISO11783BitsFromCanId(id, &prio, &pgn, &src, &dst);

  p++;
  len = strlen(p) / 2;
  for (i = 0; i < len; i++)
  {
    if (scanHex(&p, &m->data[i]))
    {
      logError("Error reading message, scanned %zu bytes from %s/%s, index %u", p - msg, msg, p, i);
      if (!showJson)
        fprintf(stdout, "%s", msg);
      return 2;
    }
    if (i < len)
    {
      if (*p != ',' && *p != ' ')
      {
        logError("Error reading message, scanned %zu bytes from %s", p - msg, msg);
        if (!showJson)
          fprintf(stdout, "%s", msg);
        return 2;
      }
      p++;
    }
  }

  return setParsedValues(m, prio, pgn, dst, src, len);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movb %dl, %al
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
andb $0x1, %al
movb %al, -0x19(%rbp)
movq -0x10(%rbp), %rdi
movl $0x20, %esi
movl $0x1, %edx
callq 0x216c0
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rax
movq -0x10(%rbp), %rcx
addq $0x4, %rcx
cmpq %rcx, %rax
jb 0x21ac0
movq -0x40(%rbp), %rax
movq -0x10(%rbp), %rcx
addq $0x3c, %rcx
cmpq %rcx, %rax
jb 0x21acc
movl $0x1, -0x4(%rbp)
jmp 0x21cf6
movq -0x18(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x40(%rbp), %rdx
movq -0x10(%rbp), %rax
subq %rax, %rdx
subq $0x1, %rdx
callq 0xd1d0
movq -0x18(%rbp), %rax
movq -0x40(%rbp), %rcx
movq -0x10(%rbp), %rdx
subq %rdx, %rcx
subq $0x1, %rcx
movb $0x0, (%rax,%rcx)
movq -0x40(%rbp), %rax
addq $0x3, %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rdi
leaq -0x40(%rbp), %rsi
movl $0xa, %edx
callq 0xd2a0
movl %eax, -0x24(%rbp)
movq -0x40(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x20, %eax
jne 0x21b49
movq -0x40(%rbp), %rdi
addq $0x1, %rdi
movq %rdi, -0x40(%rbp)
leaq -0x40(%rbp), %rsi
movl $0x10, %edx
callq 0xd2a0
movl %eax, -0x44(%rbp)
movq -0x40(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x20, %eax
je 0x21ba0
movq -0x40(%rbp), %rsi
movq -0x10(%rbp), %rax
subq %rax, %rsi
movq -0x10(%rbp), %rdx
leaq 0x143f9(%rip), %rdi     # 0x35f64
movb $0x0, %al
callq 0x1f720
testb $0x1, -0x19(%rbp)
jne 0x21b94
movq 0x1a459(%rip), %rax     # 0x3bfd8
movq (%rax), %rdi
movq -0x10(%rbp), %rdx
leaq 0x1447f(%rip), %rsi     # 0x3600c
movb $0x0, %al
callq 0xd1b0
movl $0x2, -0x4(%rbp)
jmp 0x21cf6
movl -0x44(%rbp), %edi
leaq -0x20(%rbp), %rsi
leaq -0x24(%rbp), %rdx
leaq -0x2c(%rbp), %rcx
leaq -0x28(%rbp), %r8
callq 0x209b0
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rdi
callq 0xd0d0
shrq %rax
movl %eax, -0x30(%rbp)
movl $0x0, -0x34(%rbp)
movl -0x34(%rbp), %eax
cmpl -0x30(%rbp), %eax
jae 0x21cd9
movq -0x18(%rbp), %rsi
addq $0x47, %rsi
movl -0x34(%rbp), %eax
addq %rax, %rsi
leaq -0x40(%rbp), %rdi
callq 0x20e30
cmpl $0x0, %eax
je 0x21c55
movq -0x40(%rbp), %rsi
movq -0x10(%rbp), %rax
subq %rax, %rsi
movq -0x10(%rbp), %rdx
movq -0x40(%rbp), %rcx
movl -0x34(%rbp), %r8d
leaq 0x14306(%rip), %rdi     # 0x35f26
movb $0x0, %al
callq 0x1f720
testb $0x1, -0x19(%rbp)
jne 0x21c49
movq 0x1a3a4(%rip), %rax     # 0x3bfd8
movq (%rax), %rdi
movq -0x10(%rbp), %rdx
leaq 0x143ca(%rip), %rsi     # 0x3600c
movb $0x0, %al
callq 0xd1b0
movl $0x2, -0x4(%rbp)
jmp 0x21cf6
movl -0x34(%rbp), %eax
cmpl -0x30(%rbp), %eax
jae 0x21cc9
movq -0x40(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2c, %eax
je 0x21cbd
movq -0x40(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x20, %eax
je 0x21cbd
movq -0x40(%rbp), %rsi
movq -0x10(%rbp), %rax
subq %rax, %rsi
movq -0x10(%rbp), %rdx
leaq 0x142d9(%rip), %rdi     # 0x35f64
movb $0x0, %al
callq 0x1f720
testb $0x1, -0x19(%rbp)
jne 0x21cb4
movq 0x1a339(%rip), %rax     # 0x3bfd8
movq (%rax), %rdi
movq -0x10(%rbp), %rdx
leaq 0x1435f(%rip), %rsi     # 0x3600c
movb $0x0, %al
callq 0xd1b0
movl $0x2, -0x4(%rbp)
jmp 0x21cf6
movq -0x40(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x40(%rbp)
jmp 0x21ccb
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x21bda
movq -0x18(%rbp), %rdi
movl -0x20(%rbp), %esi
movl -0x24(%rbp), %edx
movl -0x28(%rbp), %ecx
movl -0x2c(%rbp), %r8d
movl -0x30(%rbp), %r9d
callq 0x21780
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq
nop