// File: /workspace/github_c_makefile_star2_O0/canboat[P]canboat/analyzer/print.c
// Function: fieldPrintDate
extern bool fieldPrintDate(const Field   *field,
                           const char    *fieldName,
                           const uint8_t *data,
                           size_t         dataLen,
                           size_t         startBit,
                           size_t        *bits)
{
  char       buf[sizeof("2008.03.10") + 1];
  time_t     t;
  struct tm *tm;
  uint16_t   d;

  if (!adjustDataLenStart(&data, &dataLen, &startBit))
  {
    return false;
  }

  if (startBit != 0)
  {
    return unhandledStartOffset(fieldName, startBit);
  }
  if (*bits != 16)
  {
    return unhandledBitLength(fieldName, *bits);
  }
  if (dataLen < *bits / 8)
  {
    return true;
  }

  d = data[0] + (data[1] << 8);

  if (d >= 0xfffd)
  {
    printEmpty(fieldName, d - INT64_C(0xffff));
    return true;
  }

  t  = d * 86400;
  tm = gmtime(&t);
  if (!tm)
  {
    logAbort("Unable to convert %u to gmtime\n", (unsigned int) t);
  }
  strftime(buf, sizeof(buf), "%Y.%m.%d", tm);
  if (showJson)
  {
    if (showJsonValue)
    {
      mprintf("%" PRIu16 ",\"name\":\"%s\"}", d, buf);
    }
    else
    {
      mprintf("\"%s\"", buf);
    }
  }
  else
  {
    mprintf("%s", buf);
  }
  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)
leaq -0x20(%rbp), %rdi
leaq -0x28(%rbp), %rsi
leaq -0x30(%rbp), %rdx
callq 0x1b0e0
testb $0x1, %al
jne 0x1d28e
movb $0x0, -0x1(%rbp)
jmp 0x1d3da
cmpq $0x0, -0x30(%rbp)
je 0x1d2ac
movq -0x18(%rbp), %rdi
movq -0x30(%rbp), %rsi
callq 0x1d3f0
andb $0x1, %al
movb %al, -0x1(%rbp)
jmp 0x1d3da
movq -0x38(%rbp), %rax
cmpq $0x10, (%rax)
je 0x1d2d0
movq -0x18(%rbp), %rdi
movq -0x38(%rbp), %rax
movq (%rax), %rsi
callq 0x1d420
andb $0x1, %al
movb %al, -0x1(%rbp)
jmp 0x1d3da
movq -0x28(%rbp), %rax
movq -0x38(%rbp), %rcx
movq (%rcx), %rcx
shrq $0x3, %rcx
cmpq %rcx, %rax
jae 0x1d2ed
movb $0x1, -0x1(%rbp)
jmp 0x1d3da
movq -0x20(%rbp), %rax
movzbl (%rax), %eax
movq -0x20(%rbp), %rcx
movzbl 0x1(%rcx), %ecx
shll $0x8, %ecx
addl %ecx, %eax
movw %ax, -0x5a(%rbp)
movzwl -0x5a(%rbp), %eax
cmpl $0xfffd, %eax           # imm = 0xFFFD
jl 0x1d32f
movq -0x18(%rbp), %rdi
movzwl -0x5a(%rbp), %eax
movl %eax, %esi
subq $0xffff, %rsi           # imm = 0xFFFF
callq 0x1b5f0
movb $0x1, -0x1(%rbp)
jmp 0x1d3da
movzwl -0x5a(%rbp), %eax
imull $0x15180, %eax, %eax    # imm = 0x15180
cltq
movq %rax, -0x50(%rbp)
leaq -0x50(%rbp), %rdi
callq 0xd280
movq %rax, -0x58(%rbp)
cmpq $0x0, -0x58(%rbp)
jne 0x1d367
movq -0x50(%rbp), %rax
movl %eax, %esi
leaq 0x13c17(%rip), %rdi     # 0x30f77
movb $0x0, %al
callq 0x1f7d0
leaq -0x44(%rbp), %rdi
movq -0x58(%rbp), %rcx
movl $0xc, %esi
leaq 0x13c1c(%rip), %rdx     # 0x30f97
callq 0xd260
leaq 0x742eb(%rip), %rax     # 0x91672
testb $0x1, (%rax)
je 0x1d3c4
leaq 0x742e1(%rip), %rax     # 0x91674
testb $0x1, (%rax)
je 0x1d3b0
movzwl -0x5a(%rbp), %esi
leaq -0x44(%rbp), %rdx
leaq 0x13bf9(%rip), %rdi     # 0x30fa0
movb $0x0, %al
callq 0x1ade0
jmp 0x1d3c2
leaq -0x44(%rbp), %rsi
leaq 0x13a5a(%rip), %rdi     # 0x30e15
movb $0x0, %al
callq 0x1ade0
jmp 0x1d3d6
leaq -0x44(%rbp), %rsi
leaq 0x18c3d(%rip), %rdi     # 0x3600c
movb $0x0, %al
callq 0x1ade0
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x60, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)