LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O0/canboat[P]canboat/n2kd/main.c
// Function: tcpServer
static void tcpServer(uint16_t port, StreamType st)
{
  struct sockaddr_in serverAddr;
  int                sockAddrSize = sizeof(serverAddr);
  int                r;
  int                on = 1;
  SOCKET             s;
  bool               udp = (st == SERVER_NMEA0183_DATAGRAM);

  s = socket(PF_INET, udp ? SOCK_DGRAM : SOCK_STREAM, 0);
  if (s == INVALID_SOCKET)
  {
    die("Unable to open server socket");
  }
  memset((char *) &serverAddr, 0, sockAddrSize);
  serverAddr.sin_family      = AF_INET;
  serverAddr.sin_port        = htons(port);
  serverAddr.sin_addr.s_addr = htonl(INADDR_ANY);

  setsockopt(s, SOL_SOCKET, SO_REUSEADDR, (char *) &on, (socklen_t) sizeof(on));

  r = bind(s, (struct sockaddr *) &serverAddr, sockAddrSize);
  if (r == INVALID_SOCKET)
  {
    die("Unable to bind server socket");
  }

  if (!udp)
  {
    r = listen(s, 10);
    if (r == INVALID_SOCKET)
    {
      die("Unable to listen to server socket");
    }
  }
  else
  {
    setsockopt(s, SOL_SOCKET, SO_BROADCAST, (char *) &on, (socklen_t) sizeof(on));
  }

  setFdUsed(s, st);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movw %di, %ax
movw %ax, -0x2(%rbp)
movl %esi, -0x8(%rbp)
movl $0x10, -0x1c(%rbp)
movl $0x1, -0x24(%rbp)
cmpl $0xc, -0x8(%rbp)
sete %al
andb $0x1, %al
movb %al, -0x29(%rbp)
movb -0x29(%rbp), %cl
movl $0x1, %esi
movl $0x2, %eax
testb $0x1, %cl
cmovnel %eax, %esi
movl $0x2, %edi
xorl %edx, %edx
callq 0x23c0
movl %eax, -0x28(%rbp)
cmpl $-0x1, -0x28(%rbp)
jne 0x4cf0
leaq 0x8139(%rip), %rdi      # 0xce24
callq 0x9d00
movslq -0x1c(%rbp), %rdx
leaq -0x18(%rbp), %rdi
xorl %esi, %esi
callq 0x2190
movw $0x2, -0x18(%rbp)
movzwl -0x2(%rbp), %edi
callq 0x2100
movw %ax, -0x16(%rbp)
xorl %edi, %edi
callq 0x2180
movl %eax, -0x14(%rbp)
movl -0x28(%rbp), %edi
movl $0x1, %esi
movl $0x2, %edx
leaq -0x24(%rbp), %rcx
movl $0x4, %r8d
callq 0x20b0
movl -0x28(%rbp), %edi
movl -0x1c(%rbp), %edx
leaq -0x18(%rbp), %rsi
callq 0x2290
movl %eax, -0x20(%rbp)
cmpl $-0x1, -0x20(%rbp)
jne 0x4d5c
leaq 0x80ea(%rip), %rdi      # 0xce41
callq 0x9d00
testb $0x1, -0x29(%rbp)
jne 0x4d86
movl -0x28(%rbp), %edi
movl $0xa, %esi
callq 0x2270
movl %eax, -0x20(%rbp)
cmpl $-0x1, -0x20(%rbp)
jne 0x4d84
leaq 0x80df(%rip), %rdi      # 0xce5e
callq 0x9d00
jmp 0x4da2
movl -0x28(%rbp), %edi
movl $0x1, %esi
movl $0x6, %edx
leaq -0x24(%rbp), %rcx
movl $0x4, %r8d
callq 0x20b0
movl -0x28(%rbp), %edi
movl -0x8(%rbp), %esi
callq 0x2c50
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/canboat[P]canboat/n2kd/main.c
// Function: writeAndClose
static void writeAndClose(int idx, char *data, size_t len)
{
  int r;

#ifdef O_NONBLOCK
  int flags = fcntl(stream[idx].fd, F_GETFL, 0);
  fcntl(stream[idx].fd, F_SETFL, flags & ~O_NONBLOCK);
#else
  int ioctlOptionValue = 0;
  ioctl(stream[idx].fd, FIONBIO, &ioctlOptionValue);
#endif

  while (len > 0)
  {
    r = write(stream[idx].fd, data, len);
    if (r <= 0)
    {
      break;
    }
    len -= r;
    data += r;
  }
  closeStream(idx);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movl %edi, -0x4(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movslq -0x4(%rbp), %rcx
leaq 0xb922(%rip), %rax      # 0x115a0
imulq $0x8038, %rcx, %rcx     # imm = 0x8038
addq %rcx, %rax
movl (%rax), %edi
movl $0x3, %esi
xorl %edx, %edx
movb $0x0, %al
callq 0x20c0
movl %eax, -0x20(%rbp)
movslq -0x4(%rbp), %rcx
leaq 0xb8fa(%rip), %rax      # 0x115a0
imulq $0x8038, %rcx, %rcx     # imm = 0x8038
addq %rcx, %rax
movl (%rax), %edi
movl -0x20(%rbp), %edx
andl $0xfffff7ff, %edx       # imm = 0xFFFFF7FF
movl $0x4, %esi
movb $0x0, %al
callq 0x20c0
cmpq $0x0, -0x18(%rbp)
jbe 0x5d1f
movslq -0x4(%rbp), %rcx
leaq 0xb8c7(%rip), %rax      # 0x115a0
imulq $0x8038, %rcx, %rcx     # imm = 0x8038
addq %rcx, %rax
movl (%rax), %edi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x20d0
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x1c(%rbp)
jg 0x5cfd
jmp 0x5d1f
movslq -0x1c(%rbp), %rcx
movq -0x18(%rbp), %rax
subq %rcx, %rax
movq %rax, -0x18(%rbp)
movl -0x1c(%rbp), %ecx
movq -0x10(%rbp), %rax
movslq %ecx, %rcx
addq %rcx, %rax
movq %rax, -0x10(%rbp)
jmp 0x5cc7
movl -0x4(%rbp), %edi
callq 0x3a30
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/canboat[P]canboat/n2kd/gps_ais.c
// Function: nmea0183VTG
extern void nmea0183VTG(StringBuffer *msg183, int src, const char *msg)
{
  double sog;
  double cog;

  if (getJSONNumber(msg, "SOG", &sog, U_VELOCITY) && getJSONNumber(msg, "COG", &cog, U_ANGLE))
  {
    nmea0183CreateMessage(msg183, src, "VTG,%.1f,T,,M,%.2f,N,%.2f,K", cog, SPEED_M_S_TO_KNOTS(sog), SPEED_M_S_TO_KMH(sog));
    g_sog        = sog;
    g_cog        = cog;
    g_sog_cog_ts = getNow();
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x18(%rbp), %rdi
leaq 0x73be(%rip), %rsi      # 0xd10c
leaq -0x20(%rbp), %rdx
movl $0x2, %ecx
callq 0x9750
testb $0x1, %al
jne 0x5d62
jmp 0x5dd8
movq -0x18(%rbp), %rdi
leaq 0x73a3(%rip), %rsi      # 0xd110
leaq -0x28(%rbp), %rdx
xorl %ecx, %ecx
callq 0x9750
testb $0x1, %al
jne 0x5d7e
jmp 0x5dd8
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
movsd -0x28(%rbp), %xmm0
movsd 0x72b6(%rip), %xmm1     # 0xd048
mulsd -0x20(%rbp), %xmm1
movsd 0x72a1(%rip), %xmm2     # 0xd040
mulsd -0x20(%rbp), %xmm2
leaq 0x7369(%rip), %rdx      # 0xd114
movb $0x3, %al
callq 0x89b0
movsd -0x20(%rbp), %xmm0
movsd %xmm0, 0x20a7621(%rip)  # 0x20ad3e0
movsd -0x28(%rbp), %xmm0
movsd %xmm0, 0x20a761c(%rip)  # 0x20ad3e8
callq 0x9820
movq %rax, 0x20a7618(%rip)   # 0x20ad3f0
addq $0x30, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/canboat[P]canboat/n2kd/gps_ais.c
// Function: nmea0183GSA
extern void nmea0183GSA(StringBuffer *msg183, int src, const char *msg)
{
  char modeString[OTHER_LENGTH] = "";
  char pdopString[OTHER_LENGTH] = "";
  char hdopString[OTHER_LENGTH] = "";
  char vdopString[OTHER_LENGTH] = "";

  getJSONValue(msg, "Actual Mode", modeString, sizeof(modeString));
  getJSONValue(msg, "PDOP", pdopString, sizeof(pdopString));
  getJSONValue(msg, "HDOP", hdopString, sizeof(hdopString));
  getJSONValue(msg, "VDOP", vdopString, sizeof(vdopString));

  modeString[1] = 0; // Abbreviate string, or still empty if not in N2K PGN

  nmea0183CreateMessage(msg183, src, "GSA,M,%s,,,,,,,,,,,,,%s,%s,%s", modeString, pdopString, hdopString, vdopString);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
leaq -0x30(%rbp), %rdi
xorl %esi, %esi
movl $0x14, %edx
callq 0x2190
leaq -0x50(%rbp), %rdi
xorl %esi, %esi
movl $0x14, %edx
callq 0x2190
leaq -0x70(%rbp), %rdi
xorl %esi, %esi
movl $0x14, %edx
callq 0x2190
leaq -0x90(%rbp), %rdi
xorl %esi, %esi
movl $0x14, %edx
callq 0x2190
movq -0x18(%rbp), %rdi
leaq -0x30(%rbp), %rdx
leaq 0x72e8(%rip), %rsi      # 0xd130
movl $0x14, %ecx
callq 0xa660
movq -0x18(%rbp), %rdi
leaq -0x50(%rbp), %rdx
leaq 0x72db(%rip), %rsi      # 0xd13c
movl $0x14, %ecx
callq 0xa660
movq -0x18(%rbp), %rdi
leaq -0x70(%rbp), %rdx
leaq 0x72c7(%rip), %rsi      # 0xd141
movl $0x14, %ecx
callq 0xa660
movq -0x18(%rbp), %rdi
leaq -0x90(%rbp), %rdx
leaq 0x72b0(%rip), %rsi      # 0xd146
movl $0x14, %ecx
callq 0xa660
movb $0x0, -0x2f(%rbp)
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
leaq -0x30(%rbp), %rcx
leaq -0x50(%rbp), %r8
leaq -0x70(%rbp), %r9
leaq -0x90(%rbp), %rax
leaq 0x7286(%rip), %rdx      # 0xd14b
movq %rax, (%rsp)
movb $0x0, %al
callq 0x89b0
addq $0xa0, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/canboat[P]canboat/n2kd/gps_ais.c
// Function: convert2kCoordinateToNMEA0183
static double convert2kCoordinateToNMEA0183(const char *coordinateString, const char *hemispheres, char *hemisphere)
{
  double coordinate = strtod(coordinateString, 0);
  double degrees;
  double result;

  if (coordinate < 0)
  {
    *hemisphere = hemispheres[1];
    coordinate  = coordinate * -1.;
  }
  else
  {
    *hemisphere = hemispheres[0];
  }

  degrees = floor(coordinate);
  result  = degrees * 100 + (coordinate - degrees) * 60;
  return result;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x2090
movsd %xmm0, -0x20(%rbp)
xorps %xmm0, %xmm0
ucomisd -0x20(%rbp), %xmm0
jbe 0x6201
movq -0x10(%rbp), %rax
movb 0x1(%rax), %cl
movq -0x18(%rbp), %rax
movb %cl, (%rax)
movsd 0x6e5b(%rip), %xmm0     # 0xd050
mulsd -0x20(%rbp), %xmm0
movsd %xmm0, -0x20(%rbp)
jmp 0x620d
movq -0x10(%rbp), %rax
movb (%rax), %cl
movq -0x18(%rbp), %rax
movb %cl, (%rax)
movsd -0x20(%rbp), %xmm0
callq 0x2300
movsd %xmm0, -0x28(%rbp)
movsd -0x28(%rbp), %xmm0
movsd -0x20(%rbp), %xmm1
subsd -0x28(%rbp), %xmm1
movsd 0x6e2d(%rip), %xmm2     # 0xd060
mulsd %xmm2, %xmm1
movsd 0x6e19(%rip), %xmm2     # 0xd058
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movsd %xmm0, -0x30(%rbp)
movsd -0x30(%rbp), %xmm0
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/canboat[P]canboat/n2kd/gps_ais.c
// Function: removeChar
static void removeChar(char *str, char garbage)
{
  char *src, *dst;

  for (src = dst = str; *src; src++)
  {
    *dst = *src;
    if (*dst != garbage)
    {
      dst++;
    }
  }
  *dst = 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movb %sil, %al
movq %rdi, -0x8(%rbp)
movb %al, -0x9(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x20(%rbp)
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
cmpb $0x0, (%rax)
je 0x62ba
movq -0x18(%rbp), %rax
movb (%rax), %cl
movq -0x20(%rbp), %rax
movb %cl, (%rax)
movq -0x20(%rbp), %rax
movsbl (%rax), %eax
movsbl -0x9(%rbp), %ecx
cmpl %ecx, %eax
je 0x62aa
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0x62ac
movq -0x18(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x18(%rbp)
jmp 0x627a
movq -0x20(%rbp), %rax
movb $0x0, (%rax)
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/canboat[P]canboat/n2kd/gps_ais.c
// Function: aisETA
long int aisETA(const char *msg)
{
  char         jstr[11];
  unsigned int month = 0, day = 0, hour = 24, minute = 60;

  // Get ais values from json (sscanf not used as it fails for som values)
  if (getJSONValue(msg, "ETA Date", jstr, sizeof(jstr)))
  {
    month = 10 * ((unsigned char) jstr[5] - '0') + ((unsigned char) jstr[6] - '0');
    day   = 10 * ((unsigned char) jstr[8] - '0') + ((unsigned char) jstr[9] - '0');
    if (month > 12)
      month = 0;
    if (day > 31)
      day = 0;
  }

  if (getJSONValue(msg, "ETA Time", jstr, sizeof(jstr)))
  {
    hour   = 10 * ((unsigned char) jstr[0] - '0') + ((unsigned char) jstr[1] - '0');
    minute = 10 * ((unsigned char) jstr[3] - '0') + ((unsigned char) jstr[4] - '0');
    if (hour > 24)
      hour = 24;
    if (minute > 60)
      minute = 60;
  }

  // Pack into ais integer
  return (month << 16) + (day << 11) + (hour << 6) + minute;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movl $0x0, -0x18(%rbp)
movl $0x0, -0x1c(%rbp)
movl $0x18, -0x20(%rbp)
movl $0x3c, -0x24(%rbp)
movq -0x8(%rbp), %rdi
leaq -0x13(%rbp), %rdx
leaq 0x6efc(%rip), %rsi      # 0xd203
movl $0xb, %ecx
callq 0xa660
testb $0x1, %al
jne 0x6317
jmp 0x635f
movzbl -0xe(%rbp), %eax
subl $0x30, %eax
imull $0xa, %eax, %eax
movzbl -0xd(%rbp), %ecx
subl $0x30, %ecx
addl %ecx, %eax
movl %eax, -0x18(%rbp)
movzbl -0xb(%rbp), %eax
subl $0x30, %eax
imull $0xa, %eax, %eax
movzbl -0xa(%rbp), %ecx
subl $0x30, %ecx
addl %ecx, %eax
movl %eax, -0x1c(%rbp)
cmpl $0xc, -0x18(%rbp)
jbe 0x6350
movl $0x0, -0x18(%rbp)
cmpl $0x1f, -0x1c(%rbp)
jbe 0x635d
movl $0x0, -0x1c(%rbp)
jmp 0x635f
movq -0x8(%rbp), %rdi
leaq -0x13(%rbp), %rdx
leaq 0x6e9e(%rip), %rsi      # 0xd20c
movl $0xb, %ecx
callq 0xa660
testb $0x1, %al
jne 0x637e
jmp 0x63c6
movzbl -0x13(%rbp), %eax
subl $0x30, %eax
imull $0xa, %eax, %eax
movzbl -0x12(%rbp), %ecx
subl $0x30, %ecx
addl %ecx, %eax
movl %eax, -0x20(%rbp)
movzbl -0x10(%rbp), %eax
subl $0x30, %eax
imull $0xa, %eax, %eax
movzbl -0xf(%rbp), %ecx
subl $0x30, %ecx
addl %ecx, %eax
movl %eax, -0x24(%rbp)
cmpl $0x18, -0x20(%rbp)
jbe 0x63b7
movl $0x18, -0x20(%rbp)
cmpl $0x3c, -0x24(%rbp)
jbe 0x63c4
movl $0x3c, -0x24(%rbp)
jmp 0x63c6
movl -0x18(%rbp), %eax
shll $0x10, %eax
movl -0x1c(%rbp), %ecx
shll $0xb, %ecx
addl %ecx, %eax
movl -0x20(%rbp), %ecx
shll $0x6, %ecx
addl %ecx, %eax
addl -0x24(%rbp), %eax
movl %eax, %eax
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/canboat[P]canboat/n2kd/gps_ais.c
// Function: aisAtoNName
char *aisAtoNName(const char *msg, bool extended, int *len)
{
  // The name splits in two parts, name and name extension.
  static char jsonString[35];
  int         i;

  // The extended name part is of variable length. Since the len byte has
  // been dropped, we have to rely on NULL termination of the string in
  // the extended part. First 20 chars ordinary name
  for (i = 20; i < 35; i++)
  {
    jsonString[i] = '\0';
  }

  if (!getJSONValue(msg, "AtoN Name", jsonString, sizeof(jsonString)))
    jsonString[0] = '\0';
  jsonString[34] = '\0';

  if (extended)
  {
    char *eName = (char *) jsonString + 20;
    for (i = 0; i <= 14; i++)
    {
      if (*(eName + i) == '\0')
        break;
    }
    // Each ais char is 6 bit. The length shall be padded to a multiple of 8 bits
    i *= 6;
    if (i % 8)
      i += 8 - i % 8;
    *len = i;
    return eName;
  }
  else
  {
    jsonString[20] = '\0';
  }
  return jsonString;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movb %sil, %al
movq %rdi, -0x10(%rbp)
andb $0x1, %al
movb %al, -0x11(%rbp)
movq %rdx, -0x20(%rbp)
movl $0x14, -0x24(%rbp)
cmpl $0x23, -0x24(%rbp)
jge 0x642f
movslq -0x24(%rbp), %rcx
leaq 0x20a6fe0(%rip), %rax   # 0x20ad400
movb $0x0, (%rax,%rcx)
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x640f
movq -0x10(%rbp), %rdi
leaq 0x6ddb(%rip), %rsi      # 0xd215
leaq 0x20a6fbf(%rip), %rdx   # 0x20ad400
movl $0x23, %ecx
callq 0xa660
testb $0x1, %al
jne 0x6456
movb $0x0, 0x20a6faa(%rip)   # 0x20ad400
movb $0x0, 0x20a6fc5(%rip)   # 0x20ad422
testb $0x1, -0x11(%rbp)
je 0x64e1
leaq 0x20a6f96(%rip), %rax   # 0x20ad400
addq $0x14, %rax
movq %rax, -0x30(%rbp)
movl $0x0, -0x24(%rbp)
cmpl $0xe, -0x24(%rbp)
jg 0x649f
movq -0x30(%rbp), %rax
movslq -0x24(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x0, %eax
jne 0x6492
jmp 0x649f
jmp 0x6494
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x6479
imull $0x6, -0x24(%rbp), %eax
movl %eax, -0x24(%rbp)
movl -0x24(%rbp), %eax
movl $0x8, %ecx
cltd
idivl %ecx
cmpl $0x0, %edx
je 0x64ce
movl -0x24(%rbp), %eax
movl $0x8, %ecx
cltd
idivl %ecx
movl $0x8, %eax
subl %edx, %eax
addl -0x24(%rbp), %eax
movl %eax, -0x24(%rbp)
movl -0x24(%rbp), %ecx
movq -0x20(%rbp), %rax
movl %ecx, (%rax)
movq -0x30(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x64f3
movb $0x0, 0x20a6f2c(%rip)   # 0x20ad414
leaq 0x20a6f11(%rip), %rax   # 0x20ad400
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/canboat[P]canboat/n2kd/gps_ais.c
// Function: aisEnum
static int aisEnum(const char *msg, const char *fieldName)
{
  int64_t n;

  if (getJSONInt64(msg, fieldName, &n))
  {
    logDebug("getJSONInt64(msg, '%s') = %" PRId64 "\n", fieldName, n);
    return (int) n;
  }
  logDebug("getJSONInt64(msg, '%s') = no result -> -1\n", fieldName);
  return -1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
leaq -0x20(%rbp), %rdx
callq 0xad20
testb $0x1, %al
jne 0x79b7
jmp 0x79d6
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
leaq 0x5a78(%rip), %rdi      # 0xd43e
movb $0x0, %al
callq 0x9ae0
movq -0x20(%rbp), %rax
movl %eax, -0x4(%rbp)
jmp 0x79ef
movq -0x18(%rbp), %rsi
leaq 0x5a7c(%rip), %rdi      # 0xd45d
movb $0x0, %al
callq 0x9ae0
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/canboat[P]canboat/n2kd/gps_ais.c
// Function: addAisInt
static int addAisInt(long int value, int len, aisVector *payload)
{
  int           i, k;
  unsigned char nibble;

  // Break if overflow, does not treat signed positive value properly
  if (value >= (long int) (1 << len) || value < -(long int) (1 << (len - 1)))
  {
    return 0;
  }

  // AIS uses big endian. Thus most significant bits shall be stored first.
  while (len > 0)
  {
    i = payload->pos / 8;
    k = 8 - payload->pos % 8;
    payload->bitVector[i] &= ~(unsigned char) ((1 << k) - 1);
    if (len >= k)
    {
      nibble = ((1 << k) - 1) & (value >> (len - k));
      payload->pos += k;
    }
    else
    {
      nibble = ((1 << k) - 1) & (value << (k - len));
      payload->pos += len;
    }
    payload->bitVector[i] |= nibble;
    len -= k;
  }
  return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x10(%rbp), %rax
movl -0x14(%rbp), %ecx
movl $0x1, %edx
shll %cl, %edx
movl %edx, %ecx
movslq %ecx, %rcx
cmpq %rcx, %rax
jge 0x7a47
movq -0x10(%rbp), %rax
movl -0x14(%rbp), %ecx
subl $0x1, %ecx
movl $0x1, %edx
shll %cl, %edx
movl %edx, %ecx
movslq %ecx, %rdx
xorl %ecx, %ecx
subq %rdx, %rcx
cmpq %rcx, %rax
jge 0x7a53
movl $0x0, -0x4(%rbp)
jmp 0x7b5e
jmp 0x7a55
cmpl $0x0, -0x14(%rbp)
jle 0x7b57
movq -0x20(%rbp), %rax
movl 0xe4(%rax), %eax
movl $0x8, %ecx
cltd
idivl %ecx
movl %eax, -0x24(%rbp)
movq -0x20(%rbp), %rax
movl 0xe4(%rax), %eax
movl $0x8, %ecx
cltd
idivl %ecx
movl $0x8, %eax
subl %edx, %eax
movl %eax, -0x28(%rbp)
movl -0x28(%rbp), %ecx
movl $0x1, %eax
shll %cl, %eax
subl $0x1, %eax
movzbl %al, %esi
xorl $-0x1, %esi
movq -0x20(%rbp), %rax
movslq -0x24(%rbp), %rcx
movsbl (%rax,%rcx), %edx
andl %esi, %edx
movb %dl, (%rax,%rcx)
movl -0x14(%rbp), %eax
cmpl -0x28(%rbp), %eax
jl 0x7af8
movl -0x28(%rbp), %ecx
movl $0x1, %eax
shll %cl, %eax
subl $0x1, %eax
cltq
movq -0x10(%rbp), %rdx
movl -0x14(%rbp), %ecx
subl -0x28(%rbp), %ecx
movl %ecx, %ecx
sarq %cl, %rdx
movq %rdx, %rcx
andq %rcx, %rax
movb %al, -0x29(%rbp)
movl -0x28(%rbp), %ecx
movq -0x20(%rbp), %rax
addl 0xe4(%rax), %ecx
movl %ecx, 0xe4(%rax)
jmp 0x7b32
movl -0x28(%rbp), %ecx
movl $0x1, %eax
shll %cl, %eax
subl $0x1, %eax
cltq
movq -0x10(%rbp), %rdx
movl -0x28(%rbp), %ecx
subl -0x14(%rbp), %ecx
movl %ecx, %ecx
shlq %cl, %rdx
movq %rdx, %rcx
andq %rcx, %rax
movb %al, -0x29(%rbp)
movl -0x14(%rbp), %ecx
movq -0x20(%rbp), %rax
addl 0xe4(%rax), %ecx
movl %ecx, 0xe4(%rax)
movzbl -0x29(%rbp), %esi
movq -0x20(%rbp), %rax
movslq -0x24(%rbp), %rcx
movsbl (%rax,%rcx), %edx
orl %esi, %edx
movb %dl, (%rax,%rcx)
movl -0x28(%rbp), %ecx
movl -0x14(%rbp), %eax
subl %ecx, %eax
movl %eax, -0x14(%rbp)
jmp 0x7a55
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/canboat[P]canboat/n2kd/gps_ais.c
// Function: aisDate
static long int aisDate(const char *msg)
{
  char         jstr[11];
  unsigned int year = 0, month = 0, day = 0;

  // Get ais values from json (sscanf not used as it fails for som values)
  if (getJSONValue(msg, "Position Date", jstr, sizeof(jstr)))
  {
    sscanf(jstr, "%d%*c%d%*c%d", &year, &month, &day);
    if (year > 9999)
      year = 0;
    if (month > 12)
      month = 0;
    if (day > 31)
      day = 0;
  }

  // Pack into ais integer
  return (year << 9) + (month << 5) + day;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movl $0x0, -0x18(%rbp)
movl $0x0, -0x1c(%rbp)
movl $0x0, -0x20(%rbp)
movq -0x8(%rbp), %rdi
leaq -0x13(%rbp), %rdx
leaq 0x554c(%rip), %rsi      # 0xd5ac
movl $0xb, %ecx
callq 0xa660
testb $0x1, %al
jne 0x8070
jmp 0x80ba
leaq -0x13(%rbp), %rdi
leaq 0x553f(%rip), %rsi      # 0xd5ba
leaq -0x18(%rbp), %rdx
leaq -0x1c(%rbp), %rcx
leaq -0x20(%rbp), %r8
movb $0x0, %al
callq 0x2260
cmpl $0x270f, -0x18(%rbp)    # imm = 0x270F
jbe 0x809e
movl $0x0, -0x18(%rbp)
cmpl $0xc, -0x1c(%rbp)
jbe 0x80ab
movl $0x0, -0x1c(%rbp)
cmpl $0x1f, -0x20(%rbp)
jbe 0x80b8
movl $0x0, -0x20(%rbp)
jmp 0x80ba
movl -0x18(%rbp), %eax
shll $0x9, %eax
movl -0x1c(%rbp), %ecx
shll $0x5, %ecx
addl %ecx, %eax
addl -0x20(%rbp), %eax
movl %eax, %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/canboat[P]canboat/n2kd/gps_ais.c
// Function: aisTime
static long int aisTime(const char *msg)
{
  char         jstr[9];
  unsigned int hour = 24, minute = 60, second = 60;

  // Get ais values from json (sscanf not used as it fails for som values)
  if (getJSONValue(msg, "Position Time", jstr, sizeof(jstr)))
  {
    hour   = 10 * ((unsigned char) jstr[0] - '0') + ((unsigned char) jstr[1] - '0');
    minute = 10 * ((unsigned char) jstr[3] - '0') + ((unsigned char) jstr[4] - '0');
    second = 10 * ((unsigned char) jstr[6] - '0') + ((unsigned char) jstr[7] - '0');
    if (hour > 24)
      hour = 24;
    if (minute > 60)
      minute = 60;
    if (second > 60)
      second = 60;
  }

  // Pack into ais integer
  return (hour << 12) + (minute << 6) + second;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movl $0x18, -0x18(%rbp)
movl $0x3c, -0x1c(%rbp)
movl $0x3c, -0x20(%rbp)
movq -0x8(%rbp), %rdi
leaq -0x11(%rbp), %rdx
leaq 0x54b7(%rip), %rsi      # 0xd5c7
movl $0x9, %ecx
callq 0xa660
testb $0x1, %al
jne 0x8120
jmp 0x818b
movzbl -0x11(%rbp), %eax
subl $0x30, %eax
imull $0xa, %eax, %eax
movzbl -0x10(%rbp), %ecx
subl $0x30, %ecx
addl %ecx, %eax
movl %eax, -0x18(%rbp)
movzbl -0xe(%rbp), %eax
subl $0x30, %eax
imull $0xa, %eax, %eax
movzbl -0xd(%rbp), %ecx
subl $0x30, %ecx
addl %ecx, %eax
movl %eax, -0x1c(%rbp)
movzbl -0xb(%rbp), %eax
subl $0x30, %eax
imull $0xa, %eax, %eax
movzbl -0xa(%rbp), %ecx
subl $0x30, %ecx
addl %ecx, %eax
movl %eax, -0x20(%rbp)
cmpl $0x18, -0x18(%rbp)
jbe 0x816f
movl $0x18, -0x18(%rbp)
cmpl $0x3c, -0x1c(%rbp)
jbe 0x817c
movl $0x3c, -0x1c(%rbp)
cmpl $0x3c, -0x20(%rbp)
jbe 0x8189
movl $0x3c, -0x20(%rbp)
jmp 0x818b
movl -0x18(%rbp), %eax
shll $0xc, %eax
movl -0x1c(%rbp), %ecx
shll $0x6, %ecx
addl %ecx, %eax
addl -0x20(%rbp), %eax
movl %eax, %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/canboat[P]canboat/n2kd/gps_ais.c
// Function: addAisLongString
static int addAisLongString(const char *msg, const char *fieldName, int maxSize, bool padd, aisVector *payload)
{
  char *jsonString;
  int   len;

  jsonString = (char *) calloc(maxSize + 1, sizeof(char));
  if (jsonString == NULL)
  {
    return 0;
  }

  if (!getJSONValue(msg, fieldName, jsonString, maxSize))
  {
    free(jsonString);
    return 0;
  }

  for (len = 0; len <= maxSize; len++)
  {
    if (*(jsonString + len) == '\0')
    {
      break;
    }
  }

  len *= 6;
  if (padd)
  {
    if (len % 8)
    {
      len += 8 - (len % 8); // Add padd bits
    }
  }

  addAisString(jsonString, len, payload);
  free(jsonString);
  return len;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movb %cl, %al
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
andb $0x1, %al
movb %al, -0x1d(%rbp)
movq %r8, -0x28(%rbp)
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movslq %eax, %rdi
movl $0x1, %esi
callq 0x21e0
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
jne 0x85c8
movl $0x0, -0x4(%rbp)
jmp 0x867b
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x30(%rbp), %rdx
movslq -0x1c(%rbp), %rcx
callq 0xa660
testb $0x1, %al
jne 0x85f6
movq -0x30(%rbp), %rdi
callq 0x2030
movl $0x0, -0x4(%rbp)
jmp 0x867b
movl $0x0, -0x34(%rbp)
movl -0x34(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jg 0x8625
movq -0x30(%rbp), %rax
movslq -0x34(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x0, %eax
jne 0x8618
jmp 0x8625
jmp 0x861a
movl -0x34(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x34(%rbp)
jmp 0x85fd
imull $0x6, -0x34(%rbp), %eax
movl %eax, -0x34(%rbp)
testb $0x1, -0x1d(%rbp)
je 0x865c
movl -0x34(%rbp), %eax
movl $0x8, %ecx
cltd
idivl %ecx
cmpl $0x0, %edx
je 0x865a
movl -0x34(%rbp), %eax
movl $0x8, %ecx
cltd
idivl %ecx
movl $0x8, %eax
subl %edx, %eax
addl -0x34(%rbp), %eax
movl %eax, -0x34(%rbp)
jmp 0x865c
movq -0x30(%rbp), %rdi
movl -0x34(%rbp), %esi
movq -0x28(%rbp), %rdx
callq 0x81b0
movq -0x30(%rbp), %rdi
callq 0x2030
movl -0x34(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/canboat[P]canboat/n2kd/gps_ais.c
// Function: nextPayloadChar
static char nextPayloadChar(aisVector *bitVec, int *opos, unsigned char *padding)
{
  unsigned char i;
  int           start = *opos / 8;

  if (*opos >= bitVec->pos)
  {
    return '\0';
  }

  if (bitVec->pos - *opos < 6)
  {
    *padding = 6 - (bitVec->pos - *opos);
  }

  i = (bitVec->bitVector[start] << (*opos % 8));
  i = i >> 2;
  if ((8 - *opos % 8) + *padding < 6)
  {
    i |= (unsigned char) bitVec->bitVector[start + 1] >> (10 - (*opos % 8));
  }
  i &= 0xff << *padding;
  // Make shure *opos does not exceede bitVec->pos
  *opos += 6 - *padding;

  // Ascii encode the 6-bit value before return
  if (i < 40)
  {
    return (char) (i + 48);
  }
  else
  {
    return (char) (i + 56);
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x18(%rbp), %rax
movl (%rax), %eax
movl $0x8, %ecx
cltd
idivl %ecx
movl %eax, -0x28(%rbp)
movq -0x18(%rbp), %rax
movl (%rax), %eax
movq -0x10(%rbp), %rcx
cmpl 0xe4(%rcx), %eax
jl 0x889c
movb $0x0, -0x1(%rbp)
jmp 0x89ab
movq -0x10(%rbp), %rax
movl 0xe4(%rax), %eax
movq -0x18(%rbp), %rcx
subl (%rcx), %eax
cmpl $0x6, %eax
jge 0x88d0
movq -0x10(%rbp), %rax
movl 0xe4(%rax), %ecx
movq -0x18(%rbp), %rax
subl (%rax), %ecx
movl $0x6, %eax
subl %ecx, %eax
movb %al, %cl
movq -0x20(%rbp), %rax
movb %cl, (%rax)
movq -0x10(%rbp), %rax
movslq -0x28(%rbp), %rcx
movsbl (%rax,%rcx), %eax
movl %eax, -0x2c(%rbp)
movq -0x18(%rbp), %rax
movl (%rax), %eax
movl $0x8, %ecx
cltd
idivl %ecx
movl -0x2c(%rbp), %eax
movl %edx, %ecx
shll %cl, %eax
movb %al, -0x21(%rbp)
movzbl -0x21(%rbp), %eax
sarl $0x2, %eax
movb %al, -0x21(%rbp)
movq -0x18(%rbp), %rax
movl (%rax), %eax
movl $0x8, %ecx
cltd
idivl %ecx
movl $0x8, %eax
subl %edx, %eax
movq -0x20(%rbp), %rcx
movzbl (%rcx), %ecx
addl %ecx, %eax
cmpl $0x6, %eax
jge 0x895d
movq -0x10(%rbp), %rax
movl -0x28(%rbp), %ecx
addl $0x1, %ecx
movslq %ecx, %rcx
movzbl (%rax,%rcx), %eax
movl %eax, -0x30(%rbp)
movq -0x18(%rbp), %rax
movl (%rax), %eax
movl $0x8, %ecx
cltd
idivl %ecx
movl -0x30(%rbp), %eax
movl $0xa, %ecx
subl %edx, %ecx
sarl %cl, %eax
movl %eax, %ecx
movzbl -0x21(%rbp), %eax
orl %ecx, %eax
movb %al, -0x21(%rbp)
movq -0x20(%rbp), %rax
movzbl (%rax), %ecx
movl $0xff, %eax
shll %cl, %eax
movl %eax, %ecx
movzbl -0x21(%rbp), %eax
andl %ecx, %eax
movb %al, -0x21(%rbp)
movq -0x20(%rbp), %rax
movzbl (%rax), %eax
movl $0x6, %ecx
subl %eax, %ecx
movq -0x18(%rbp), %rax
addl (%rax), %ecx
movl %ecx, (%rax)
movzbl -0x21(%rbp), %eax
cmpl $0x28, %eax
jge 0x89a1
movzbl -0x21(%rbp), %eax
addl $0x30, %eax
movb %al, -0x1(%rbp)
jmp 0x89ab
movzbl -0x21(%rbp), %eax
addl $0x38, %eax
movb %al, -0x1(%rbp)
movb -0x1(%rbp), %al
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/canboat[P]canboat/n2kd/nmea0183.c
// Function: matchFilter
static bool matchFilter(int n, char *filter)
{
  bool negativeMatch = false;
  int  f;

  while (filter[0])
  {
    if (filter[0] == '!')
    {
      filter++;
      negativeMatch = true;
    }
    f = (int) strtol(filter, &filter, 10);
    logDebug("Src [%ld] == [%ld]?\n", n, f);

    if (n == f)
    {
      logDebug("Src [%ld] matches [%ld]\n", n, f);
      if (negativeMatch)
      {
        return false;
      }
      return true;
    }
    while (filter[0] && filter[0] != ',')
    {
      filter++;
    }
    if (filter[0] == ',')
    {
      filter++;
    }
  }
  return negativeMatch;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movb $0x0, -0x11(%rbp)
movq -0x10(%rbp), %rax
cmpb $0x0, (%rax)
je 0x914a
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x21, %eax
jne 0x909c
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
movb $0x1, -0x11(%rbp)
movq -0x10(%rbp), %rdi
leaq -0x10(%rbp), %rsi
movl $0xa, %edx
callq 0x2210
movl %eax, -0x18(%rbp)
movl -0x8(%rbp), %esi
movl -0x18(%rbp), %edx
leaq 0x45ff(%rip), %rdi      # 0xd6bd
movb $0x0, %al
callq 0x9ae0
movl -0x8(%rbp), %eax
cmpl -0x18(%rbp), %eax
jne 0x90f3
movl -0x8(%rbp), %esi
movl -0x18(%rbp), %edx
leaq 0x45f8(%rip), %rdi      # 0xd6d2
movb $0x0, %al
callq 0x9ae0
testb $0x1, -0x11(%rbp)
je 0x90ed
movb $0x0, -0x1(%rbp)
jmp 0x9152
movb $0x1, -0x1(%rbp)
jmp 0x9152
jmp 0x90f5
movq -0x10(%rbp), %rax
movsbl (%rax), %ecx
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0x19(%rbp)
je 0x9116
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2c, %eax
setne %al
movb %al, -0x19(%rbp)
movb -0x19(%rbp), %al
testb $0x1, %al
jne 0x911f
jmp 0x912d
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
jmp 0x90f5
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2c, %eax
jne 0x9145
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
jmp 0x9073
movb -0x11(%rbp), %al
andb $0x1, %al
movb %al, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/canboat[P]canboat/n2kd/nmea0183.c
// Function: nmea0183VesselHeading
static void nmea0183VesselHeading(StringBuffer *msg183, int src, const char *msg)
{
  double  heading;
  double  deviation;
  double  variation;
  int64_t reference;

  if (getJSONNumber(msg, "Heading", &heading, U_ANGLE) && getJSONInt64(msg, "Reference", &reference))
  {
    if (getJSONNumber(msg, "Deviation", &deviation, U_ANGLE) && getJSONNumber(msg, "Variation", &variation, U_ANGLE)
        && reference == 1)
    {
      /* Enough info for HDG message */

      nmea0183CreateMessage(msg183,
                            src,
                            "HDG,%.1f,%.1f,%c,%.1f,%c",
                            heading,
                            fabs(deviation),
                            ((deviation < 0.0) ? 'W' : 'E'),
                            fabs(variation),
                            ((variation < 0.0) ? 'W' : 'E'));
    }
    else if (reference == 0)
    {
      nmea0183CreateMessage(msg183, src, "HDT,%.1f,T", heading);
    }
    else if (reference == 1)
    {
      nmea0183CreateMessage(msg183, src, "HDM,%.1f,M", heading);
    }
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x18(%rbp), %rdi
leaq 0x4255(%rip), %rsi      # 0xd3d3
leaq -0x20(%rbp), %rdx
xorl %ecx, %ecx
callq 0x9750
testb $0x1, %al
jne 0x9192
jmp 0x92ab
movq -0x18(%rbp), %rdi
leaq 0x454e(%rip), %rsi      # 0xd6eb
leaq -0x38(%rbp), %rdx
callq 0xad20
testb $0x1, %al
jne 0x91af
jmp 0x92ab
movq -0x18(%rbp), %rdi
leaq 0x453b(%rip), %rsi      # 0xd6f5
leaq -0x28(%rbp), %rdx
xorl %ecx, %ecx
callq 0x9750
testb $0x1, %al
jne 0x91ce
jmp 0x9261
movq -0x18(%rbp), %rdi
leaq 0x4526(%rip), %rsi      # 0xd6ff
leaq -0x30(%rbp), %rdx
xorl %ecx, %ecx
callq 0x9750
testb $0x1, %al
jne 0x91ea
jmp 0x9261
cmpq $0x1, -0x38(%rbp)
jne 0x9261
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
movsd -0x20(%rbp), %xmm0
movsd -0x28(%rbp), %xmm1
movaps 0x43f7(%rip), %xmm2     # 0xd600
pand %xmm2, %xmm1
movsd -0x28(%rbp), %xmm3
xorps %xmm2, %xmm2
movl $0x45, %ecx
movl $0x57, %eax
ucomisd %xmm3, %xmm2
cmoval %eax, %ecx
movsd -0x30(%rbp), %xmm2
movaps 0x43ce(%rip), %xmm3     # 0xd600
pand %xmm3, %xmm2
movsd -0x30(%rbp), %xmm4
xorps %xmm3, %xmm3
movl $0x45, %r8d
movl $0x57, %eax
ucomisd %xmm4, %xmm3
cmoval %eax, %r8d
leaq 0x44b1(%rip), %rdx      # 0xd709
movb $0x3, %al
callq 0x89b0
jmp 0x92a9
cmpq $0x0, -0x38(%rbp)
jne 0x9284
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
movsd -0x20(%rbp), %xmm0
leaq 0x44a7(%rip), %rdx      # 0xd722
movb $0x1, %al
callq 0x89b0
jmp 0x92a7
cmpq $0x1, -0x38(%rbp)
jne 0x92a5
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
movsd -0x20(%rbp), %xmm0
leaq 0x448f(%rip), %rdx      # 0xd72d
movb $0x1, %al
callq 0x89b0
jmp 0x92a7
jmp 0x92a9
jmp 0x92ab
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/canboat[P]canboat/n2kd/nmea0183.c
// Function: nmea0183WindData
static void nmea0183WindData(StringBuffer *msg183, int src, const char *msg)
{
  double  speed;
  double  angle;
  int64_t reference;

  if (getJSONNumber(msg, "Wind Speed", &speed, U_VELOCITY) && getJSONNumber(msg, "Wind Angle", &angle, U_ANGLE)
      && getJSONInt64(msg, "Reference", &reference))
  {
    if (reference == 3)
    {
      nmea0183CreateMessage(msg183, src, "MWV,%.1f,T,%.1f,K,A", angle, SPEED_M_S_TO_KMH(speed));
    }
    else if (reference == 2)
    {
      nmea0183CreateMessage(msg183, src, "MWV,%.1f,R,%.1f,K,A", angle, SPEED_M_S_TO_KMH(speed));
    }
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x18(%rbp), %rdi
leaq 0x445a(%rip), %rsi      # 0xd738
leaq -0x20(%rbp), %rdx
movl $0x2, %ecx
callq 0x9750
testb $0x1, %al
jne 0x92f5
jmp 0x938d
movq -0x18(%rbp), %rdi
leaq 0x4443(%rip), %rsi      # 0xd743
leaq -0x28(%rbp), %rdx
xorl %ecx, %ecx
callq 0x9750
testb $0x1, %al
jne 0x9311
jmp 0x938d
movq -0x18(%rbp), %rdi
leaq 0x43cf(%rip), %rsi      # 0xd6eb
leaq -0x30(%rbp), %rdx
callq 0xad20
testb $0x1, %al
jne 0x932b
jmp 0x938d
cmpq $0x3, -0x30(%rbp)
jne 0x935b
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
movsd -0x28(%rbp), %xmm0
movsd 0x3cfa(%rip), %xmm1     # 0xd040
mulsd -0x20(%rbp), %xmm1
leaq 0x43fc(%rip), %rdx      # 0xd74e
movb $0x2, %al
callq 0x89b0
jmp 0x938b
cmpq $0x2, -0x30(%rbp)
jne 0x9389
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
movsd -0x28(%rbp), %xmm0
movsd 0x3cca(%rip), %xmm1     # 0xd040
mulsd -0x20(%rbp), %xmm1
leaq 0x43e0(%rip), %rdx      # 0xd762
movb $0x2, %al
callq 0x89b0
jmp 0x938b
jmp 0x938d
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/canboat[P]canboat/n2kd/nmea0183.c
// Function: nmea0183WaterDepth
static void nmea0183WaterDepth(StringBuffer *msg183, int src, const char *msg)
{
  double depth;
  double offset;

  if (getJSONNumber(msg, "Depth", &depth, U_DISTANCE))
  {
    if (getJSONNumber(msg, "Offset", &offset, U_DISTANCE))
    {
      nmea0183CreateMessage(msg183, src, "DPT,%.1f,%.1f", depth, offset);
    }
    else
    {
      nmea0183CreateMessage(msg183, src, "DPT,%.1f,", depth);
    }
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x18(%rbp), %rdi
leaq 0x43b8(%rip), %rsi      # 0xd776
leaq -0x20(%rbp), %rdx
movl $0x3, %ecx
callq 0x9750
testb $0x1, %al
jne 0x93d2
jmp 0x942e
movq -0x18(%rbp), %rdi
leaq 0x439f(%rip), %rsi      # 0xd77c
leaq -0x28(%rbp), %rdx
movl $0x3, %ecx
callq 0x9750
testb $0x1, %al
jne 0x93f1
jmp 0x9412
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
movsd -0x20(%rbp), %xmm0
movsd -0x28(%rbp), %xmm1
leaq 0x437a(%rip), %rdx      # 0xd783
movb $0x2, %al
callq 0x89b0
jmp 0x942c
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
movsd -0x20(%rbp), %xmm0
leaq 0x436c(%rip), %rdx      # 0xd791
movb $0x1, %al
callq 0x89b0
jmp 0x942e
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/canboat[P]canboat/n2kd/nmea0183.c
// Function: nmea0183SystemTime
static void nmea0183SystemTime(StringBuffer *msg183, int src, const char *msg)
{
  char         dateString[20];
  char         timeString[20];
  char         second[10];
  unsigned int year, month, day, hour, minute;

  if (getJSONValue(msg, "Date", dateString, sizeof(dateString)) && getJSONValue(msg, "Time", timeString, sizeof(timeString))
      && sscanf(dateString, "%u.%u.%u", &year, &month, &day) == 3 && sscanf(timeString, "%u:%u:%9s", &hour, &minute, second) == 3)
  {
    nmea0183CreateMessage(msg183, src, "ZDA,%02u%02u%s,%u,%u,%04u,,", hour, minute, second, day, month, year);
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x90, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x18(%rbp), %rdi
leaq -0x30(%rbp), %rdx
leaq 0x3b72(%rip), %rsi      # 0xd207
movl $0x14, %ecx
callq 0xa660
testb $0x1, %al
jne 0x96a8
jmp 0x9745
movq -0x18(%rbp), %rdi
leaq -0x50(%rbp), %rdx
leaq 0x3b59(%rip), %rsi      # 0xd210
movl $0x14, %ecx
callq 0xa660
testb $0x1, %al
jne 0x96c7
jmp 0x9745
leaq -0x30(%rbp), %rdi
leaq 0x4153(%rip), %rsi      # 0xd825
leaq -0x60(%rbp), %rdx
leaq -0x64(%rbp), %rcx
leaq -0x68(%rbp), %r8
movb $0x0, %al
callq 0x2260
cmpl $0x3, %eax
jne 0x9745
leaq -0x50(%rbp), %rdi
leaq -0x5a(%rbp), %r8
leaq 0x4135(%rip), %rsi      # 0xd82e
leaq -0x6c(%rbp), %rdx
leaq -0x70(%rbp), %rcx
movb $0x0, %al
callq 0x2260
cmpl $0x3, %eax
jne 0x9745
movq -0x8(%rbp), %rdi
movl -0xc(%rbp), %esi
movl -0x6c(%rbp), %ecx
movl -0x70(%rbp), %r8d
leaq -0x5a(%rbp), %r9
movl -0x68(%rbp), %r11d
movl -0x64(%rbp), %r10d
movl -0x60(%rbp), %eax
leaq 0x4107(%rip), %rdx      # 0xd838
movl %r11d, (%rsp)
movl %r10d, 0x8(%rsp)
movl %eax, 0x10(%rsp)
movb $0x0, %al
callq 0x89b0
addq $0x90, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/canboat[P]canboat/n2kd/nmea0183.c
// Function: getJSONNumber
bool getJSONNumber(const char *message, const char *fieldName, double *value, Unit unit)
{
  char valueStr[16];

  // List of conversion values for each unit. When analyser produces SI convert it to 'human standard'.
  static const double UNIT_CONVERSION[U_MAX][2] = {{1, RadianToDegree}, {1, RadianToDegree}, {1, 1}, {1, 1}, {1, 1}, {1, 1}};
  static const double UNIT_OFFSET[U_MAX][2]     = {{0, 0}, {0, 0}, {0, 0}, {0, 0}, {0, -273.15}, {0, 0}};

  if (getJSONValue(message, fieldName, valueStr, sizeof valueStr))
  {
    *value = strtod(valueStr, 0) * UNIT_CONVERSION[unit][unitSI] + UNIT_OFFSET[unit][unitSI];
    return true;
  }
  *value = nan("");
  return false;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movl %ecx, -0x24(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
leaq -0x40(%rbp), %rdx
movl $0x10, %ecx
callq 0xa660
testb $0x1, %al
jne 0x9783
jmp 0x97f4
leaq -0x40(%rbp), %rdi
xorl %eax, %eax
movl %eax, %esi
callq 0x2090
movl -0x24(%rbp), %eax
movl %eax, %ecx
leaq 0x40c4(%rip), %rax      # 0xd860
shlq $0x4, %rcx
addq %rcx, %rax
leaq 0x7c3e(%rip), %rcx      # 0x113e8
movb (%rcx), %cl
andb $0x1, %cl
movzbl %cl, %ecx
movsd (%rax,%rcx,8), %xmm2
movl -0x24(%rbp), %eax
movl %eax, %ecx
leaq 0x40fd(%rip), %rax      # 0xd8c0
shlq $0x4, %rcx
addq %rcx, %rax
leaq 0x7c17(%rip), %rcx      # 0x113e8
movb (%rcx), %cl
andb $0x1, %cl
movzbl %cl, %ecx
movsd (%rax,%rcx,8), %xmm1
mulsd %xmm2, %xmm0
addsd %xmm1, %xmm0
movq -0x20(%rbp), %rax
movsd %xmm0, (%rax)
movb $0x1, -0x1(%rbp)
jmp 0x980c
leaq 0x3014(%rip), %rdi      # 0xc80f
callq 0x2340
movq -0x20(%rbp), %rax
movsd %xmm0, (%rax)
movb $0x0, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x40, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/openshmem-org[P]openshmem-examples/c/bcast2.c
// Function: main
int
main(void)
{
    int i;
    long *target;
    static long source[8] = { 1, 2, 3, 4, 5, 6, 7, 8 };
    int nlong = 8;
    int me, npes;

    shmem_init();
    me = shmem_my_pe();
    npes = shmem_n_pes();

    target = (long *) shmem_malloc(8 * sizeof(*target));

    for (i = 0; i < SHMEM_BCAST_SYNC_SIZE; i += 1) {
        pSync[i] = SHMEM_SYNC_VALUE;
    }
    shmem_barrier_all();

    shmem_broadcast64(target, source, nlong, 0, 0, 0, npes, pSync);

    if (me != 0) {
        int i;
        for (i = 0; i < 8; i++) {
            printf("%d: target[%d] = %ld\n", me, i, target[i]);
        }
    }

    shmem_free(target);

    shmem_finalize();

    return 0;
}

// Assembly:
subq $0x38, %rsp
movl $0x0, 0x34(%rsp)
movl $0x8, 0x24(%rsp)
callq 0x1090
callq 0x1060
movl %eax, 0x20(%rsp)
callq 0x1040
movl %eax, 0x1c(%rsp)
movl $0x40, %edi
callq 0x1070
movq %rax, 0x28(%rsp)
movl $0x0, 0x30(%rsp)
cmpl $0x2, 0x30(%rsp)
jge 0x122a
movslq 0x30(%rsp), %rcx
leaq 0x2eab(%rip), %rax      # 0x40c0
movq $-0x1, (%rax,%rcx,8)
movl 0x30(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x30(%rsp)
jmp 0x1202
callq 0x1080
movq 0x28(%rsp), %rdi
movslq 0x24(%rsp), %rdx
movl 0x1c(%rsp), %r10d
leaq 0x2e2b(%rip), %rsi      # 0x4070
xorl %r9d, %r9d
leaq 0x2e71(%rip), %rax      # 0x40c0
movl %r9d, %ecx
movl %r9d, %r8d
movl %r10d, (%rsp)
movq %rax, 0x8(%rsp)
callq 0x10b0
cmpl $0x0, 0x20(%rsp)
je 0x12ac
movl $0x0, 0x18(%rsp)
cmpl $0x8, 0x18(%rsp)
jge 0x12aa
movl 0x20(%rsp), %esi
movl 0x18(%rsp), %edx
movq 0x28(%rsp), %rax
movslq 0x18(%rsp), %rcx
movq (%rax,%rcx,8), %rcx
leaq 0xd6e(%rip), %rdi       # 0x2004
movb $0x0, %al
callq 0x1030
movl 0x18(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x18(%rsp)
jmp 0x1272
jmp 0x12ac
movq 0x28(%rsp), %rdi
callq 0x10a0
callq 0x1050
xorl %eax, %eax
addq $0x38, %rsp
retq
// File: /workspace/github_c_makefile_star2_O0/dasJ[P]sd-zfs/src/mount.initrd_zfs.c
// Function: handleBootfs
int handleBootfs(char **pool) {
	char *rpool = NULL;
	int ret = 1;

	// Handle rpool
	if (strncmp(*pool, "ZFS=AUTO:", strlen("ZFS=AUTO:")) == 0) {
		rpool = malloc((strlen(*pool) - strlen("ZFS=AUTO:") + 1) * sizeof(char));
		strcpy(rpool, &((*pool)[strlen("ZFS=AUTO:")]));
	}

	ret = zfs_get_bootfs(rpool, pool);
	free(rpool);
	return ret;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq $0x0, -0x10(%rbp)
movl $0x1, -0x14(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rdi
leaq 0xa294b(%rip), %rsi     # 0x4a4004
movl $0x9, %edx
callq 0x401080
cmpl $0x0, %eax
jne 0x401700
movq -0x8(%rbp), %rax
movq (%rax), %rdi
callq 0x4010e0
movq %rax, %rdi
subq $0x9, %rdi
addq $0x1, %rdi
shlq $0x0, %rdi
callq 0x421210
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rax
movq (%rax), %rsi
addq $0x9, %rsi
callq 0x401020
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rsi
callq 0x402680
movl %eax, -0x14(%rbp)
movq -0x10(%rbp), %rdi
callq 0x421550
movl -0x14(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/dasJ[P]sd-zfs/src/zfs-util.c
// Function: zfs_destroy_recursively
int zfs_destroy_recursively(char *dataset) {
	char *lines = NULL;
	char *token;

	// Execute command
	char *cmdline[] = { ZFS_CMD, "list", "-tfilesystem", "-Hro", "name", "-Sname", dataset, NULL };
	executeZfs(1, &lines, cmdline);
	if (lines == NULL) {
		return 0;
	}
	// Destoy all datasets
	token = strtok(lines, "\n");
	do {
		if (zfs_destroy(token) != 0) {
			fprintf(stderr, "Not destroying any more datasets\n");
			free(lines);
			return -2;
		}
	} while ((token = strtok(NULL, "\n")) != NULL);

	free(lines);
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x10(%rbp)
movq $0x0, -0x18(%rbp)
leaq 0xa1dff(%rip), %rax     # 0x4a420a
movq %rax, -0x60(%rbp)
leaq 0xa4983(%rip), %rax     # 0x4a6d99
movq %rax, -0x58(%rbp)
leaq 0xa1e0b(%rip), %rax     # 0x4a422c
movq %rax, -0x50(%rbp)
leaq 0xa1e0d(%rip), %rax     # 0x4a4239
movq %rax, -0x48(%rbp)
leaq 0xa1e09(%rip), %rax     # 0x4a4240
movq %rax, -0x40(%rbp)
leaq 0xa1dfc(%rip), %rax     # 0x4a423e
movq %rax, -0x38(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x30(%rbp)
movq $0x0, -0x28(%rbp)
leaq -0x60(%rbp), %rdx
movl $0x1, %edi
leaq -0x18(%rbp), %rsi
callq 0x402330
cmpq $0x0, -0x18(%rbp)
jne 0x402478
movl $0x0, -0x4(%rbp)
jmp 0x4024f0
movq -0x18(%rbp), %rdi
leaq 0xa2427(%rip), %rsi     # 0x4a48aa
callq 0x424430
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
callq 0x402500
cmpl $0x0, %eax
je 0x4024c4
movq $0x4d4708, %rax         # imm = 0x4D4708
movq (%rax), %rdi
leaq 0xa1d9a(%rip), %rsi     # 0x4a4245
movb $0x0, %al
callq 0x40cd50
movq -0x18(%rbp), %rdi
callq 0x421550
movl $0xfffffffe, -0x4(%rbp) # imm = 0xFFFFFFFE
jmp 0x4024f0
jmp 0x4024c6
xorl %eax, %eax
movl %eax, %edi
leaq 0xa23d9(%rip), %rsi     # 0x4a48aa
callq 0x424430
movq %rax, -0x20(%rbp)
cmpq $0x0, %rax
jne 0x40248c
movq -0x18(%rbp), %rdi
callq 0x421550
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x60, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/dasJ[P]sd-zfs/src/zfs-util.c
// Function: zfs_destroy
int zfs_destroy(char *dataset) {
	int status;
	char *cmdline[] = { ZFS_CMD, "destroy", dataset, NULL };

	status = executeZfs(0, NULL, cmdline);
	if (status != 0) {
		fprintf(stderr, "ZFS returned error %d\n", status);
	}
	return status;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
leaq 0xa1cf7(%rip), %rax     # 0x4a420a
movq %rax, -0x30(%rbp)
leaq 0xa1d49(%rip), %rax     # 0x4a4267
movq %rax, -0x28(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x20(%rbp)
movq $0x0, -0x18(%rbp)
leaq -0x30(%rbp), %rdx
xorl %edi, %edi
xorl %eax, %eax
movl %eax, %esi
callq 0x402330
movl %eax, -0xc(%rbp)
cmpl $0x0, -0xc(%rbp)
je 0x402565
movq $0x4d4708, %rax         # imm = 0x4D4708
movq (%rax), %rdi
movl -0xc(%rbp), %edx
leaq 0xa1d11(%rip), %rsi     # 0x4a426f
movb $0x0, %al
callq 0x40cd50
movl -0xc(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/dasJ[P]sd-zfs/src/zfs-util.c
// Function: zfs_snapshot_exists
int zfs_snapshot_exists(char *dataset, char *snapshot) {
	int status;
	char *toCheck;

	toCheck = malloc((strlen(dataset) + strlen(snapshot) + 2) * sizeof(char));
	strcpy(toCheck, dataset);
	strcat(toCheck, "@");
	strcat(toCheck, snapshot);
	
	status = zfs_ds_exists(toCheck);
	free(toCheck);
	return status;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
callq 0x4010e0
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rdi
callq 0x4010e0
movq -0x28(%rbp), %rdi
addq %rax, %rdi
addq $0x2, %rdi
shlq $0x0, %rdi
callq 0x421210
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
movq -0x8(%rbp), %rsi
callq 0x401020
movq -0x20(%rbp), %rdi
leaq 0xa1a86(%rip), %rsi     # 0x4a404c
callq 0x401058
movq -0x20(%rbp), %rdi
movq -0x10(%rbp), %rsi
callq 0x401058
movq -0x20(%rbp), %rdi
callq 0x402600
movl %eax, -0x14(%rbp)
movq -0x20(%rbp), %rdi
callq 0x421550
movl -0x14(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/dasJ[P]sd-zfs/src/zfs-util.c
// Function: zfs_ds_exists
int zfs_ds_exists(char *dataset) {
	int status;
	char *cmdline[] = { ZFS_CMD, "get", "-H", "type", dataset, NULL };

	status = executeZfs(0, NULL, cmdline);

	if (status == 0) {
		return 0;
	} else {
		return 1;
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
leaq 0xa1bf7(%rip), %rax     # 0x4a420a
movq %rax, -0x50(%rbp)
leaq 0xa1c68(%rip), %rax     # 0x4a4286
movq %rax, -0x48(%rbp)
leaq 0xa1c61(%rip), %rax     # 0x4a428a
movq %rax, -0x40(%rbp)
leaq 0xa310c(%rip), %rax     # 0x4a5740
movq %rax, -0x38(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x30(%rbp)
movq $0x0, -0x28(%rbp)
leaq -0x50(%rbp), %rdx
xorl %edi, %edi
xorl %eax, %eax
movl %eax, %esi
callq 0x402330
movl %eax, -0x14(%rbp)
cmpl $0x0, -0x14(%rbp)
jne 0x402669
movl $0x0, -0x4(%rbp)
jmp 0x402670
movl $0x1, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax)