// File: /workspace/github_c_makefile_star2_O2/canboat[P]canboat/analyzer/print.c
// Function: fieldPrintName
extern bool fieldPrintName(const Field   *field,
                           const char    *fieldName,
                           const uint8_t *data,
                           size_t         dataLen,
                           size_t         startBit,
                           size_t        *bits)
{
  const Pgn *pgn            = NULL;
  size_t     variableFields = 0;

  uint64_t value;
  uint64_t maxValue;

  if (!extractNumber(field, data, dataLen, startBit, *bits, (int64_t *) &value, (int64_t *) &maxValue))
  {
    return true;
  }

  logDebug("printFieldName %zu @ %p = %" PRIx64 "\n", dataLen, data, value);

  pgn = searchForPgn(60928);

  logDebug("printFieldName v=%" PRIu64 " max=%" PRIu64 " high=%d\n", value, maxValue, (bool) (value > maxValue - 2));

  if (value > maxValue - 2)
  {
    printEmpty(fieldName, value - maxValue);
  }
  else
  {
    if (showJson)
    {
      mprintf("%" PRIu64, value);

      if (pgn != NULL && showJsonValue)
      {
        mprintf(",\"name\":{");
        sep = "";
        printFields(pgn, data + ((startBit) >> 3), BYTES(8), showData, showJson, &variableFields);
        mprintf("}}");
      }
    }
    else
    {
      mprintf("0x%" PRIx64, value);

      if (pgn != NULL)
      {
        mprintf(" name = [");
        sep = "";
        printFields(pgn, data + ((startBit) >> 3), BYTES(8), showData, showJson, &variableFields);
        mprintf("]");
      }
    }
  }

  return true;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %r8, %r14
movq %rcx, %r15
movq %rdx, %rbx
andq $0x0, 0x10(%rsp)
movq (%r9), %r8
leaq 0x18(%rsp), %rax
movq %rax, (%rsp)
leaq 0x20(%rsp), %r9
movq %rdx, %rsi
movq %rcx, %rdx
movq %r14, %rcx
callq 0x193d9
testb %al, %al
je 0x19f19
movq 0x20(%rsp), %r12
leaq 0x12b19(%rip), %rdi     # 0x2c8e6
movq %r15, %rsi
movq %rbx, %rdx
movq %r12, %rcx
xorl %eax, %eax
callq 0x1bd48
movl $0xee00, %edi           # imm = 0xEE00
callq 0xd48c
movq %rax, %r15
movq 0x18(%rsp), %r13
leaq -0x2(%r13), %rbp
xorl %ecx, %ecx
cmpq %rbp, %r12
seta %cl
leaq 0x12b03(%rip), %rdi     # 0x2c905
movq %r12, %rsi
movq %r13, %rdx
xorl %eax, %eax
callq 0x1bd48
cmpq %rbp, %r12
jbe 0x19e24
subq %r13, %r12
movq %r12, %rsi
callq 0x19614
jmp 0x19f19
leaq 0x758c7(%rip), %r13     # 0x8f6f2
cmpb $0x1, (%r13)
jne 0x19ead
leaq 0x12bac(%rip), %rdi     # 0x2c9e5
movq %r12, %rsi
xorl %eax, %eax
callq 0x19194
testq %r15, %r15
je 0x19f19
leaq 0x758a1(%rip), %rax     # 0x8f6f4
cmpb $0x1, (%rax)
jne 0x19f19
leaq 0x12ac8(%rip), %rdi     # 0x2c92b
xorl %eax, %eax
callq 0x19194
leaq 0x852d(%rip), %rax      # 0x2239e
leaq 0x6d2d0(%rip), %rcx     # 0x87148
movq %rax, (%rcx)
shrq $0x3, %r14
addq %r14, %rbx
leaq 0x75868(%rip), %rax     # 0x8f6f1
movzbl (%rax), %ecx
movzbl (%r13), %r8d
pushq $0x40
popq %rdx
leaq 0x10(%rsp), %r9
movq %r15, %rdi
movq %rbx, %rsi
callq 0xedc2
leaq 0x12a8a(%rip), %rdi     # 0x2c935
jmp 0x19f12
leaq 0x12a84(%rip), %rdi     # 0x2c938
movq %r12, %rsi
xorl %eax, %eax
callq 0x19194
testq %r15, %r15
je 0x19f19
leaq 0x12a74(%rip), %rdi     # 0x2c93e
xorl %eax, %eax
callq 0x19194
leaq 0x84c6(%rip), %rax      # 0x2239e
leaq 0x6d269(%rip), %rcx     # 0x87148
movq %rax, (%rcx)
shrq $0x3, %r14
addq %r14, %rbx
leaq 0x75801(%rip), %rax     # 0x8f6f1
movzbl (%rax), %ecx
movzbl (%r13), %r8d
pushq $0x40
popq %rdx
leaq 0x10(%rsp), %r9
movq %r15, %rdi
movq %rbx, %rsi
callq 0xedc2
leaq 0x12ad8(%rip), %rdi     # 0x2c9ea
xorl %eax, %eax
callq 0x19194
movb $0x1, %al
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq