// File: /workspace/github_c_makefile_star2_O0/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
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq %r8, -0x30(%rbp)
movq %r9, -0x38(%rbp)
movq $0x0, -0x40(%rbp)
movq $0x0, -0x48(%rbp)
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x28(%rbp), %rdx
movq -0x30(%rbp), %rcx
movq -0x38(%rbp), %rax
movq (%rax), %r8
leaq -0x50(%rbp), %r9
leaq -0x58(%rbp), %rax
movq %rax, (%rsp)
callq 0x1b150
testb $0x1, %al
jne 0x1c225
movb $0x1, -0x1(%rbp)
jmp 0x1c3d4
movq -0x28(%rbp), %rsi
movq -0x20(%rbp), %rdx
movq -0x50(%rbp), %rcx
leaq 0x14b06(%rip), %rdi     # 0x30d3e
movb $0x0, %al
callq 0x1f670
movl $0xee00, %edi           # imm = 0xEE00
callq 0xd490
movq %rax, -0x40(%rbp)
movq -0x50(%rbp), %rsi
movq -0x58(%rbp), %rdx
movq -0x50(%rbp), %rax
movq -0x58(%rbp), %rcx
subq $0x2, %rcx
cmpq %rcx, %rax
seta %al
andb $0x1, %al
movzbl %al, %ecx
leaq 0x14aea(%rip), %rdi     # 0x30d5d
movb $0x0, %al
callq 0x1f670
movq -0x50(%rbp), %rax
movq -0x58(%rbp), %rcx
subq $0x2, %rcx
cmpq %rcx, %rax
jbe 0x1c2a1
movq -0x18(%rbp), %rdi
movq -0x50(%rbp), %rsi
subq -0x58(%rbp), %rsi
callq 0x1b5f0
jmp 0x1c3d0
leaq 0x753ca(%rip), %rax     # 0x91672
testb $0x1, (%rax)
je 0x1c347
movq -0x50(%rbp), %rsi
leaq 0x14b81(%rip), %rdi     # 0x30e3d
movb $0x0, %al
callq 0x1ade0
cmpq $0x0, -0x40(%rbp)
je 0x1c342
leaq 0x753a3(%rip), %rax     # 0x91674
testb $0x1, (%rax)
je 0x1c342
leaq 0x14aa6(%rip), %rdi     # 0x30d83
movb $0x0, %al
callq 0x1ade0
leaq 0x6ce5d(%rip), %rax     # 0x89148
leaq 0xb663(%rip), %rcx      # 0x27955
movq %rcx, (%rax)
movq -0x40(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x30(%rbp), %rax
shrq $0x3, %rax
addq %rax, %rsi
leaq 0x75362(%rip), %rax     # 0x91671
movb (%rax), %cl
leaq 0x7535a(%rip), %rax     # 0x91672
movb (%rax), %al
movl $0x40, %edx
leaq -0x48(%rbp), %r9
andb $0x1, %cl
andb $0x1, %al
movzbl %cl, %ecx
movzbl %al, %r8d
callq 0xe9a0
leaq 0x14a52(%rip), %rdi     # 0x30d8d
movb $0x0, %al
callq 0x1ade0
jmp 0x1c3ce
movq -0x50(%rbp), %rsi
leaq 0x14a3e(%rip), %rdi     # 0x30d90
movb $0x0, %al
callq 0x1ade0
cmpq $0x0, -0x40(%rbp)
je 0x1c3cc
leaq 0x14a2f(%rip), %rdi     # 0x30d96
movb $0x0, %al
callq 0x1ade0
leaq 0x6cdd3(%rip), %rax     # 0x89148
leaq 0xb5d9(%rip), %rcx      # 0x27955
movq %rcx, (%rax)
movq -0x40(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x30(%rbp), %rax
shrq $0x3, %rax
addq %rax, %rsi
leaq 0x752d8(%rip), %rax     # 0x91671
movb (%rax), %cl
leaq 0x752d0(%rip), %rax     # 0x91672
movb (%rax), %al
movl $0x40, %edx
leaq -0x48(%rbp), %r9
andb $0x1, %cl
andb $0x1, %al
movzbl %cl, %ecx
movzbl %al, %r8d
callq 0xe9a0
leaq 0x14a7d(%rip), %rdi     # 0x30e42
movb $0x0, %al
callq 0x1ade0
jmp 0x1c3ce
jmp 0x1c3d0
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x60, %rsp
popq %rbp
retq
nop