// File: /workspace/github_c_makefile_star2_O0/canboat[P]canboat/analyzer/print.c
// Function: fieldPrintKeyValue
extern bool fieldPrintKeyValue(const Field   *field,
                               const char    *fieldName,
                               const uint8_t *data,
                               size_t         dataLen,
                               size_t         startBit,
                               size_t        *bits)
{
  bool r = false;

  if (g_length != 0)
  {
    *bits = ((size_t) g_length) * 8;
  }
  else
  {
    *bits = field->size;
  }
  logDebug("fieldPrintKeyValue('%s') bits=%zu\n", fieldName, *bits);

  if (dataLen >= ((startBit + *bits) >> 3))
  {
    if (g_ftf != NULL)
    {
      const Field *f = g_ftf;

      logDebug("fieldPrintKeyValue('%s') is actually a '%s' field bits=%u\n", fieldName, f->ft->name, f->size);

      if (*bits == 0)
      {
        *bits = f->size;
      }
      if (*bits == 0 && f->ft && f->ft->name && strcmp(f->ft->name, "LOOKUP") == 0)
      {
        *bits = f->lookup.size;
      }

      r = (f->ft->pf)(f, fieldName, data, dataLen, startBit, bits);
    }
    else
    {
      r = fieldPrintBinary(field, fieldName, data, dataLen, startBit, bits);
    }
  }
  else
  {
    logError("PGN %u key-value has insufficient bytes for field %s\n", field->pgn ? field->pgn->pgn : 0, fieldName);
  }

  g_ftf    = NULL;
  g_length = 0;

  return r;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movq %r9, -0x30(%rbp)
movb $0x0, -0x31(%rbp)
cmpq $0x0, 0x75e4c(%rip)     # 0x937d8
je 0x1d9a2
movq 0x75e43(%rip), %rcx     # 0x937d8
shlq $0x3, %rcx
movq -0x30(%rbp), %rax
movq %rcx, (%rax)
jmp 0x1d9b2
movq -0x8(%rbp), %rax
movl 0x10(%rax), %eax
movl %eax, %ecx
movq -0x30(%rbp), %rax
movq %rcx, (%rax)
movq -0x10(%rbp), %rsi
movq -0x30(%rbp), %rax
movq (%rax), %rdx
leaq 0x13703(%rip), %rdi     # 0x310c7
movb $0x0, %al
callq 0x1f670
movq -0x20(%rbp), %rax
movq -0x28(%rbp), %rcx
movq -0x30(%rbp), %rdx
addq (%rdx), %rcx
shrq $0x3, %rcx
cmpq %rcx, %rax
jb 0x1daef
cmpq $0x0, 0x75de1(%rip)     # 0x937d0
je 0x1dacb
movq 0x75dd4(%rip), %rax     # 0x937d0
movq %rax, -0x40(%rbp)
movq -0x10(%rbp), %rsi
movq -0x40(%rbp), %rax
movq 0x88(%rax), %rax
movq (%rax), %rdx
movq -0x40(%rbp), %rax
movl 0x10(%rax), %ecx
leaq 0x136ca(%rip), %rdi     # 0x310ea
movb $0x0, %al
callq 0x1f670
movq -0x30(%rbp), %rax
cmpq $0x0, (%rax)
jne 0x1da41
movq -0x40(%rbp), %rax
movl 0x10(%rax), %eax
movl %eax, %ecx
movq -0x30(%rbp), %rax
movq %rcx, (%rax)
movq -0x30(%rbp), %rax
cmpq $0x0, (%rax)
jne 0x1da9b
movq -0x40(%rbp), %rax
cmpq $0x0, 0x88(%rax)
je 0x1da9b
movq -0x40(%rbp), %rax
movq 0x88(%rax), %rax
cmpq $0x0, (%rax)
je 0x1da9b
movq -0x40(%rbp), %rax
movq 0x88(%rax), %rax
movq (%rax), %rdi
leaq 0x10de8(%rip), %rsi     # 0x2e867
callq 0xd190
cmpl $0x0, %eax
jne 0x1da9b
movq -0x40(%rbp), %rax
movq 0x80(%rax), %rcx
movq -0x30(%rbp), %rax
movq %rcx, (%rax)
movq -0x40(%rbp), %rax
movq 0x88(%rax), %rax
movq 0x78(%rax), %rax
movq -0x40(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
movq -0x28(%rbp), %r8
movq -0x30(%rbp), %r9
callq *%rax
andb $0x1, %al
movb %al, -0x31(%rbp)
jmp 0x1daed
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
movq -0x20(%rbp), %rcx
movq -0x28(%rbp), %r8
movq -0x30(%rbp), %r9
callq 0x1c640
andb $0x1, %al
movb %al, -0x31(%rbp)
jmp 0x1db2c
movq -0x8(%rbp), %rax
cmpq $0x0, 0x90(%rax)
je 0x1db10
movq -0x8(%rbp), %rax
movq 0x90(%rax), %rax
movl 0x8(%rax), %eax
movl %eax, -0x44(%rbp)
jmp 0x1db17
xorl %eax, %eax
movl %eax, -0x44(%rbp)
jmp 0x1db17
movl -0x44(%rbp), %esi
movq -0x10(%rbp), %rdx
leaq 0x13600(%rip), %rdi     # 0x31125
movb $0x0, %al
callq 0x1f720
movq $0x0, 0x75c99(%rip) # 0x937d0
movq $0x0, 0x75c96(%rip) # 0x937d8
movb -0x31(%rbp), %al
andb $0x1, %al
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax)