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

  int64_t value;
  int64_t maxValue;

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

  if (!IS_MANUFACTURER_PGN(value))
  {
    pgn = searchForPgn(value);
    if (pgn != NULL)
    {
      s = pgn->description;
    }
  }

  if (value >= maxValue - 2)
  {
    printEmpty(fieldName, value - maxValue);
  }
  else if (s != NULL)
  {
    if (showJsonValue)
    {
      mprintf("%" PRId64 ",\"name\":\"%s\"}", value, s);
    }
    else if (showJson)
    {
      mprintf("%" PRId64, value);
    }
    else
    {
      mprintf("%" PRId64 " (%s)", value, s);
    }
  }
  else
  {
    if (showJsonValue)
    {
      mprintf("%" PRId64, value);
      if (showJsonEmpty)
      {
        mprintf(",\"name\":null");
      }
      mprintf("}");
    }
    else
    {
      mprintf("%" PRId64, value);
    }
  }

  return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %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 -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
movq -0x28(%rbp), %rcx
movq -0x30(%rbp), %r8
movq -0x38(%rbp), %rax
movq (%rax), %r9
leaq -0x50(%rbp), %r10
leaq -0x58(%rbp), %rax
movq %r10, (%rsp)
movq %rax, 0x8(%rsp)
callq 0x1b770
testb $0x1, %al
jne 0x1c44e
movb $0x1, -0x1(%rbp)
jmp 0x1c591
cmpq $0xff00, -0x50(%rbp)    # imm = 0xFF00
jl 0x1c462
cmpq $0xffff, -0x50(%rbp)    # imm = 0xFFFF
jle 0x1c4a3
cmpq $0x1ef00, -0x50(%rbp)   # imm = 0x1EF00
jge 0x1c4a3
cmpq $0x1ff00, -0x50(%rbp)   # imm = 0x1FF00
jl 0x1c480
cmpq $0x1ffff, -0x50(%rbp)   # imm = 0x1FFFF
jle 0x1c4a3
movq -0x50(%rbp), %rax
movl %eax, %edi
callq 0xd490
movq %rax, -0x48(%rbp)
cmpq $0x0, -0x48(%rbp)
je 0x1c4a1
movq -0x48(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x40(%rbp)
jmp 0x1c4a3
movq -0x50(%rbp), %rax
movq -0x58(%rbp), %rcx
subq $0x2, %rcx
cmpq %rcx, %rax
jl 0x1c4ca
movq -0x18(%rbp), %rdi
movq -0x50(%rbp), %rsi
subq -0x58(%rbp), %rsi
callq 0x1b5f0
jmp 0x1c58d
cmpq $0x0, -0x40(%rbp)
je 0x1c52f
leaq 0x7519c(%rip), %rax     # 0x91674
testb $0x1, (%rax)
je 0x1c4f5
movq -0x50(%rbp), %rsi
movq -0x40(%rbp), %rdx
leaq 0x14916(%rip), %rdi     # 0x30e02
movb $0x0, %al
callq 0x1ade0
jmp 0x1c52d
leaq 0x75176(%rip), %rax     # 0x91672
testb $0x1, (%rax)
je 0x1c515
movq -0x50(%rbp), %rsi
leaq 0x1470d(%rip), %rdi     # 0x30c19
movb $0x0, %al
callq 0x1ade0
jmp 0x1c52b
movq -0x50(%rbp), %rsi
movq -0x40(%rbp), %rdx
leaq 0x1487c(%rip), %rdi     # 0x30da0
movb $0x0, %al
callq 0x1ade0
jmp 0x1c52d
jmp 0x1c58b
leaq 0x7513e(%rip), %rax     # 0x91674
testb $0x1, (%rax)
je 0x1c577
movq -0x50(%rbp), %rsi
leaq 0x146d3(%rip), %rdi     # 0x30c19
movb $0x0, %al
callq 0x1ade0
leaq 0x7511f(%rip), %rax     # 0x91673
testb $0x1, (%rax)
je 0x1c567
leaq 0x147d1(%rip), %rdi     # 0x30d31
movb $0x0, %al
callq 0x1ade0
leaq 0x148a3(%rip), %rdi     # 0x30e11
movb $0x0, %al
callq 0x1ade0
jmp 0x1c589
movq -0x50(%rbp), %rsi
leaq 0x14697(%rip), %rdi     # 0x30c19
movb $0x0, %al
callq 0x1ade0
jmp 0x1c58b
jmp 0x1c58d
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x70, %rsp
popq %rbp
retq
nopl (%rax)