// File: /workspace/github_c_makefile_star2_O0/canboat[P]canboat/analyzer/print.c
// Function: fieldPrintLatLon
extern bool fieldPrintLatLon(const Field   *field,
                             const char    *fieldName,
                             const uint8_t *data,
                             size_t         dataLen,
                             size_t         startBit,
                             size_t        *bits)
{
  uint64_t absVal;
  int64_t  value;
  int64_t  maxValue;
  bool     isLongitude = (strstr(fieldName, "ongit") != NULL);
  double   dd;
  double   degrees;
  double   remainder;
  double   minutes;
  double   seconds;

  logDebug("fieldPrintLatLon for '%s' startbit=%zu bits=%zu\n", fieldName, startBit, *bits);

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

  absVal = (value < 0) ? -value : value;
  dd     = (double) value * field->resolution;

  if (showGeo == GEO_DD)
  {
    mprintf("%10.7f", dd);
  }
  else
  {
    if (showJsonValue)
    {
      mprintf("%" PRId64 ",\"name\":", value);
    }
    if (showGeo == GEO_DM)
    {
      dd        = (double) absVal * field->resolution;
      degrees   = floor(dd);
      remainder = dd - degrees;
      minutes   = remainder * 60.;

      mprintf((showJson ? "\"%02u&deg; %6.3f %c\"" : "%02ud %6.3f %c"),
              (uint32_t) degrees,
              minutes,
              (isLongitude ? ((value >= 0) ? 'E' : 'W') : ((value >= 0) ? 'N' : 'S')));
    }
    else
    {
      dd        = (double) absVal * field->resolution;
      degrees   = floor(dd);
      remainder = dd - degrees;
      minutes   = floor(remainder * 60.);
      seconds   = (remainder * 3600.) - 60. * minutes;

      if (seconds >= 59.9995)
      {
        minutes += 1.0;
        seconds = 0.0;
      }
      if (minutes >= 60.0)
      {
        degrees += 1.0;
        minutes = 0.0;
        seconds = 0.0;
      }

      mprintf((showJson ? "\"%02u&deg;%02u&rsquo;%06.3f&rdquo;%c\"" : "%02ud %02u' %06.3f\"%c"),
              (int) degrees,
              (int) minutes,
              seconds,
              (isLongitude ? ((value >= 0) ? 'E' : 'W') : ((value >= 0) ? 'N' : 'S')));
    }
    if (showJsonValue)
    {
      mprintf("}");
    }
  }
  return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xe0, %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 -0x18(%rbp), %rdi
leaq 0x142c6(%rip), %rsi     # 0x30e44
callq 0xd340
cmpq $0x0, %rax
setne %al
andb $0x1, %al
movb %al, -0x51(%rbp)
movq -0x18(%rbp), %rsi
movq -0x30(%rbp), %rdx
movq -0x38(%rbp), %rax
movq (%rax), %rcx
leaq 0x142a5(%rip), %rdi     # 0x30e4a
movb $0x0, %al
callq 0x1f670
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 -0x48(%rbp), %r10
leaq -0x50(%rbp), %rax
movq %r10, (%rsp)
movq %rax, 0x8(%rsp)
callq 0x1b770
testb $0x1, %al
jne 0x1cbea
movb $0x1, -0x1(%rbp)
jmp 0x1cf68
cmpq $0x0, -0x48(%rbp)
jge 0x1cc00
xorl %eax, %eax
subq -0x48(%rbp), %rax
movq %rax, -0x88(%rbp)
jmp 0x1cc0b
movq -0x48(%rbp), %rax
movq %rax, -0x88(%rbp)
movq -0x88(%rbp), %rax
movq %rax, -0x40(%rbp)
cvtsi2sdq -0x48(%rbp), %xmm0
movq -0x10(%rbp), %rax
mulsd 0x30(%rax), %xmm0
movsd %xmm0, -0x60(%rbp)
leaq 0x74a47(%rip), %rax     # 0x91678
cmpl $0x0, (%rax)
jne 0x1cc4e
movsd -0x60(%rbp), %xmm0
leaq 0x14239(%rip), %rdi     # 0x30e7b
movb $0x1, %al
callq 0x1ade0
jmp 0x1cf64
leaq 0x74a1f(%rip), %rax     # 0x91674
testb $0x1, (%rax)
je 0x1cc6c
movq -0x48(%rbp), %rsi
leaq 0x142b4(%rip), %rdi     # 0x30f19
movb $0x0, %al
callq 0x1ade0
leaq 0x74a05(%rip), %rax     # 0x91678
cmpl $0x1, (%rax)
jne 0x1cd90
movaps 0x77cd(%rip), %xmm1     # 0x24450
movq -0x40(%rbp), %xmm0
punpckldq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
movapd 0x77cc(%rip), %xmm1     # 0x24460
subpd %xmm1, %xmm0
movaps %xmm0, %xmm1
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
addsd %xmm1, %xmm0
movq -0x10(%rbp), %rax
movsd 0x30(%rax), %xmm1
mulsd %xmm1, %xmm0
movsd %xmm0, -0x60(%rbp)
movsd -0x60(%rbp), %xmm0
callq 0xd2b0
movsd %xmm0, -0x68(%rbp)
movsd -0x60(%rbp), %xmm0
movsd -0x68(%rbp), %xmm1
subsd %xmm1, %xmm0
movsd %xmm0, -0x70(%rbp)
movsd -0x70(%rbp), %xmm0
movsd 0x13e44(%rip), %xmm1    # 0x30b28
mulsd %xmm1, %xmm0
movsd %xmm0, -0x78(%rbp)
leaq 0x7497e(%rip), %rax     # 0x91672
movb (%rax), %dl
leaq 0x14185(%rip), %rcx     # 0x30e82
leaq 0x14193(%rip), %rax     # 0x30e97
testb $0x1, %dl
cmovneq %rcx, %rax
movq %rax, -0xa0(%rbp)
cvttsd2si -0x68(%rbp), %rax
movl %eax, -0x94(%rbp)
movsd -0x78(%rbp), %xmm0
movsd %xmm0, -0x90(%rbp)
testb $0x1, -0x51(%rbp)
je 0x1cd4e
movq -0x48(%rbp), %rdx
movl $0x57, %eax
movl $0x45, %ecx
cmpq $0x0, %rdx
cmovgel %ecx, %eax
movl %eax, -0xa4(%rbp)
jmp 0x1cd69
movq -0x48(%rbp), %rdx
movl $0x53, %eax
movl $0x4e, %ecx
cmpq $0x0, %rdx
cmovgel %ecx, %eax
movl %eax, -0xa4(%rbp)
movsd -0x90(%rbp), %xmm0
movl -0x94(%rbp), %esi
movq -0xa0(%rbp), %rdi
movl -0xa4(%rbp), %edx
movb $0x1, %al
callq 0x1ade0
jmp 0x1cf48
movaps 0x76b9(%rip), %xmm1     # 0x24450
movq -0x40(%rbp), %xmm0
punpckldq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
movapd 0x76b8(%rip), %xmm1     # 0x24460
subpd %xmm1, %xmm0
movaps %xmm0, %xmm1
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
addsd %xmm1, %xmm0
movq -0x10(%rbp), %rax
mulsd 0x30(%rax), %xmm0
movsd %xmm0, -0x60(%rbp)
movsd -0x60(%rbp), %xmm0
callq 0xd2b0
movsd %xmm0, -0x68(%rbp)
movsd -0x60(%rbp), %xmm0
subsd -0x68(%rbp), %xmm0
movsd %xmm0, -0x70(%rbp)
movsd 0x13d3d(%rip), %xmm0    # 0x30b28
mulsd -0x70(%rbp), %xmm0
callq 0xd2b0
movsd %xmm0, -0x78(%rbp)
movsd -0x70(%rbp), %xmm0
movsd 0x13d21(%rip), %xmm1    # 0x30b28
mulsd -0x78(%rbp), %xmm1
movq %xmm1, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm1
movsd 0x13cf5(%rip), %xmm2    # 0x30b20
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x80(%rbp)
movsd -0x80(%rbp), %xmm0
movsd 0x13cd3(%rip), %xmm1    # 0x30b18
ucomisd %xmm1, %xmm0
jb 0x1ce65
movsd 0x7545(%rip), %xmm0     # 0x24398
addsd -0x78(%rbp), %xmm0
movsd %xmm0, -0x78(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x80(%rbp)
movsd -0x78(%rbp), %xmm0
movsd 0x13cb6(%rip), %xmm1    # 0x30b28
ucomisd %xmm1, %xmm0
jb 0x1ce9a
movsd 0x7518(%rip), %xmm0     # 0x24398
addsd -0x68(%rbp), %xmm0
movsd %xmm0, -0x68(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x78(%rbp)
xorps %xmm0, %xmm0
movsd %xmm0, -0x80(%rbp)
leaq 0x747d1(%rip), %rax     # 0x91672
movb (%rax), %dl
leaq 0x14022(%rip), %rax     # 0x30ecc
leaq 0x13ff5(%rip), %rcx     # 0x30ea6
testb $0x1, %dl
cmovneq %rcx, %rax
movq %rax, -0xc0(%rbp)
cvttsd2si -0x68(%rbp), %eax
movl %eax, -0xb8(%rbp)
cvttsd2si -0x78(%rbp), %eax
movl %eax, -0xb4(%rbp)
movsd -0x80(%rbp), %xmm0
movsd %xmm0, -0xb0(%rbp)
testb $0x1, -0x51(%rbp)
je 0x1cf05
movq -0x48(%rbp), %rdx
movl $0x57, %eax
movl $0x45, %ecx
cmpq $0x0, %rdx
cmovgel %ecx, %eax
movl %eax, -0xc4(%rbp)
jmp 0x1cf20
movq -0x48(%rbp), %rdx
movl $0x53, %eax
movl $0x4e, %ecx
cmpq $0x0, %rdx
cmovgel %ecx, %eax
movl %eax, -0xc4(%rbp)
movsd -0xb0(%rbp), %xmm0
movl -0xb4(%rbp), %edx
movl -0xb8(%rbp), %esi
movq -0xc0(%rbp), %rdi
movl -0xc4(%rbp), %ecx
movb $0x1, %al
callq 0x1ade0
leaq 0x74725(%rip), %rax     # 0x91674
testb $0x1, (%rax)
je 0x1cf62
leaq 0x13eb6(%rip), %rdi     # 0x30e11
movb $0x0, %al
callq 0x1ade0
jmp 0x1cf64
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0xe0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)