LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O0/canboat[P]canboat/nmea0183/../common/common.c
// Function: sbReserve
static void sbReserve(StringBuffer *const sb, size_t len)
{
  size_t nextSize;

  if (len < sb->len)
  {
    len = sb->len;
  }

  /* Double the allocation until it is large enough */
  /* Note that we reserve len + 1 bytes (== len + zero terminator) */
  for (nextSize = 32; nextSize < len + 1; nextSize = nextSize * 2)
    ;

  if (sb->data)
  {
    sb->data = realloc(sb->data, nextSize);
  }
  else
  {
    sb->data = malloc(nextSize);
  }

  if (!sb->data)
  {
    logAbort("Out of memory in allocating string buffer\n");
  }
  sbTerminate(sb);
  sb->alloc = nextSize;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq -0x8(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jae 0x2e6a
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x10(%rbp)
movq $0x20, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq -0x10(%rbp), %rcx
addq $0x1, %rcx
cmpq %rcx, %rax
jae 0x2e92
jmp 0x2e85
movq -0x18(%rbp), %rax
shlq %rax
movq %rax, -0x18(%rbp)
jmp 0x2e72
movq -0x8(%rbp), %rax
cmpq $0x0, (%rax)
je 0x2eb8
movq -0x8(%rbp), %rax
movq (%rax), %rdi
movq -0x18(%rbp), %rsi
callq 0x21d0
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, (%rax)
jmp 0x2ecb
movq -0x18(%rbp), %rdi
callq 0x21a0
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, (%rax)
movq -0x8(%rbp), %rax
cmpq $0x0, (%rax)
jne 0x2ee3
leaq 0x2767(%rip), %rdi      # 0x5643
movb $0x0, %al
callq 0x2b70
movq -0x8(%rbp), %rax
cmpq $0x0, (%rax)
je 0x2f00
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq -0x8(%rbp), %rcx
movq 0x8(%rcx), %rcx
movb $0x0, (%rax,%rcx)
movq -0x18(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x10(%rax)
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/canboat[P]canboat/nmea0183/../common/common.c
// Function: sbDelete
void sbDelete(StringBuffer *sb, size_t start, size_t end)
{
  if (end >= sb->len)
  {
    sbTruncate(sb, start);
  }
  else if (start < sb->len && sb->data)
  {
    end = CB_MIN(sb->len, end);
    if (end < sb->len)
    {
      memmove(sb->data + start, sb->data + end, sb->len - end);
    }
    sb->len -= end - start;
    sbTerminate(sb);
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq -0x8(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jb 0x2f94
movq -0x10(%rbp), %rax
movq -0x8(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jae 0x2f5a
movq -0x10(%rbp), %rax
movq %rax, -0x20(%rbp)
jmp 0x2f66
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x8(%rbp), %rax
cmpq $0x0, (%rax)
je 0x2f8f
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq -0x8(%rbp), %rcx
movq 0x8(%rcx), %rcx
movb $0x0, (%rax,%rcx)
jmp 0x304d
movq -0x10(%rbp), %rax
movq -0x8(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jae 0x304b
movq -0x8(%rbp), %rax
cmpq $0x0, (%rax)
je 0x304b
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
cmpq -0x18(%rbp), %rax
jae 0x2fd0
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x28(%rbp)
jmp 0x2fd8
movq -0x18(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq -0x8(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jae 0x3015
movq -0x8(%rbp), %rax
movq (%rax), %rdi
addq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rax
movq (%rax), %rsi
addq -0x18(%rbp), %rsi
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rdx
subq -0x18(%rbp), %rdx
callq 0x21f0
movq -0x18(%rbp), %rdx
subq -0x10(%rbp), %rdx
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rcx
subq %rdx, %rcx
movq %rcx, 0x8(%rax)
movq -0x8(%rbp), %rax
cmpq $0x0, (%rax)
je 0x3049
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq -0x8(%rbp), %rcx
movq 0x8(%rcx), %rcx
movb $0x0, (%rax,%rcx)
jmp 0x304b
jmp 0x304d
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/canboat[P]canboat/nmea0183/../common/common.c
// Function: sbAppendData
void sbAppendData(StringBuffer *sb, const void *data, size_t len)
{
  sbEnsureCapacity(sb, sb->len + len);
  memcpy(sb->data + sb->len, data, len);
  sb->len += len;
  sb->data[sb->len] = 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rsi
addq -0x18(%rbp), %rsi
callq 0x2df0
movq -0x8(%rbp), %rax
movq (%rax), %rdi
movq -0x8(%rbp), %rax
addq 0x8(%rax), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x2180
movq -0x18(%rbp), %rcx
movq -0x8(%rbp), %rax
addq 0x8(%rax), %rcx
movq %rcx, 0x8(%rax)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq -0x8(%rbp), %rcx
movq 0x8(%rcx), %rcx
movb $0x0, (%rax,%rcx)
addq $0x20, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/canboat[P]canboat/nmea0183/../common/common.c
// Function: sbAppendEncodeHex
void sbAppendEncodeHex(StringBuffer *sb, const void *data, size_t len, char separator)
{
  sbEnsureCapacity(sb, sb->len + len * 3);

  for (; len > 0; len--, data++)
  {
    sbAppendFormat(sb, "%c%c", hexDigit(((uint8_t *) data)[0] >> 4), hexDigit(((uint8_t *) data)[0] & 0x0f));
    if (len > 1 && separator != '\0')
    {
      sbAppendData(sb, &separator, 1);
    }
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movb %cl, %al
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movb %al, -0x19(%rbp)
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rsi
imulq $0x3, -0x18(%rbp), %rax
addq %rax, %rsi
callq 0x2df0
cmpq $0x0, -0x18(%rbp)
jbe 0x31d8
movq -0x8(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rax
movzbl (%rax), %eax
sarl $0x4, %eax
movzbl %al, %edi
callq 0x30d0
movsbl %al, %eax
movl %eax, -0x20(%rbp)
movq -0x10(%rbp), %rax
movzbl (%rax), %eax
andl $0xf, %eax
movzbl %al, %edi
callq 0x30d0
movq -0x28(%rbp), %rdi
movl -0x20(%rbp), %edx
movsbl %al, %ecx
leaq 0x2308(%rip), %rsi      # 0x5498
movb $0x0, %al
callq 0x31e0
cmpq $0x1, -0x18(%rbp)
jbe 0x31b9
movsbl -0x19(%rbp), %eax
cmpl $0x0, %eax
je 0x31b9
movq -0x8(%rbp), %rdi
leaq -0x19(%rbp), %rsi
movl $0x1, %edx
callq 0x3060
jmp 0x31bb
movq -0x18(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x18(%rbp)
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
jmp 0x3142
addq $0x30, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/canboat[P]canboat/nmea0183/../common/common.c
// Function: sbAppendDecodeHex
void sbAppendDecodeHex(StringBuffer *sb, const char *data, size_t len)
{
  uint8_t  nibble1;
  uint8_t  nibble2;
  uint8_t *d;

  sbEnsureCapacity(sb, len / 2 + 1 + sbGetLength(sb));
  d = (uint8_t *) sbGet(sb) + sbGetLength(sb);

  while (len >= 2)
  {
    nibble1 = (*data >= 'a') ? (*data - 'a' + 10) : (*data >= 'A' ? (*data - 'A' + 10) : (*data - '0'));
    data++;
    nibble2 = (*data >= 'a') ? (*data - 'a' + 10) : (*data >= 'A' ? (*data - 'A' + 10) : (*data - '0'));
    data++;
    *d++ = nibble1 << 4 | nibble2;
    len -= 2;
  }

  sb->len = d - (uint8_t *) sbGet(sb);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rsi
shrq %rsi
addq $0x1, %rsi
movq -0x8(%rbp), %rax
addq 0x8(%rax), %rsi
callq 0x2df0
movq -0x8(%rbp), %rax
cmpq $0x0, (%rax)
je 0x32c7
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x30(%rbp)
jmp 0x32d4
leaq 0x20a3(%rip), %rax      # 0x5371
movq %rax, -0x30(%rbp)
jmp 0x32d4
movq -0x30(%rbp), %rax
movq -0x8(%rbp), %rcx
addq 0x8(%rcx), %rax
movq %rax, -0x28(%rbp)
cmpq $0x2, -0x18(%rbp)
jb 0x33e2
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x61, %eax
jl 0x330d
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
subl $0x61, %eax
addl $0xa, %eax
movl %eax, -0x34(%rbp)
jmp 0x333e
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x41, %eax
jl 0x332b
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
subl $0x41, %eax
addl $0xa, %eax
movl %eax, -0x38(%rbp)
jmp 0x3338
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
subl $0x30, %eax
movl %eax, -0x38(%rbp)
movl -0x38(%rbp), %eax
movl %eax, -0x34(%rbp)
movl -0x34(%rbp), %eax
movb %al, -0x19(%rbp)
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x61, %eax
jl 0x336e
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
subl $0x61, %eax
addl $0xa, %eax
movl %eax, -0x3c(%rbp)
jmp 0x339f
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x41, %eax
jl 0x338c
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
subl $0x41, %eax
addl $0xa, %eax
movl %eax, -0x40(%rbp)
jmp 0x3399
movq -0x10(%rbp), %rax
movsbl (%rax), %eax
subl $0x30, %eax
movl %eax, -0x40(%rbp)
movl -0x40(%rbp), %eax
movl %eax, -0x3c(%rbp)
movl -0x3c(%rbp), %eax
movb %al, -0x1a(%rbp)
movq -0x10(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x10(%rbp)
movzbl -0x19(%rbp), %eax
shll $0x4, %eax
movzbl -0x1a(%rbp), %ecx
orl %ecx, %eax
movb %al, %cl
movq -0x28(%rbp), %rax
movq %rax, %rdx
addq $0x1, %rdx
movq %rdx, -0x28(%rbp)
movb %cl, (%rax)
movq -0x18(%rbp), %rax
subq $0x2, %rax
movq %rax, -0x18(%rbp)
jmp 0x32e4
movq -0x28(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x8(%rbp), %rax
cmpq $0x0, (%rax)
je 0x3401
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x50(%rbp)
jmp 0x340e
leaq 0x1f69(%rip), %rax      # 0x5371
movq %rax, -0x50(%rbp)
jmp 0x340e
movq -0x48(%rbp), %rcx
movq -0x50(%rbp), %rax
subq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x8(%rax)
addq $0x50, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/canboat[P]canboat/nmea0183/../common/common.c
// Function: sbAppendFormatV
void sbAppendFormatV(StringBuffer *const sb, const char *const format, va_list ap)
{
  int     n;
  size_t  len;
  va_list ap2;

  len = 128;

  while (len < 4 * 1024 * 1024)
  {
    sbEnsureCapacity(sb, sb->len + len);

    va_copy(ap2, ap);
    n = vsnprintf(sb->data + sb->len, len, format, ap2);
    va_end(ap2);
    /*
     * Platform returned not an error, and the number of bytes was less
     * than the size of the buffer -> we're done
     * Note that some implementations (tru64) nicely guarantee zero terminated strings,
     * so we test for len - 1, not len.
     */
    if (n > -1 && (size_t) n < len - 1)
    {
      sb->len += n;
      sbTerminate(sb);
      break;
    }

    /*
     * Otherwise, increase the buffer smartly
     */

    if (n == -1)
    {
      len *= 2;
    }
    else
    {
      len = n + 2;
    }
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq $0x80, -0x28(%rbp)
cmpq $0x400000, -0x28(%rbp)  # imm = 0x400000
jae 0x3586
movq -0x8(%rbp), %rdi
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rsi
addq -0x28(%rbp), %rsi
callq 0x2df0
leaq -0x40(%rbp), %rax
movq -0x18(%rbp), %rcx
movq 0x10(%rcx), %rdx
movq %rdx, 0x10(%rax)
movups (%rcx), %xmm0
movups %xmm0, (%rax)
movq -0x8(%rbp), %rax
movq (%rax), %rdi
movq -0x8(%rbp), %rax
addq 0x8(%rax), %rdi
movq -0x28(%rbp), %rsi
movq -0x10(%rbp), %rdx
leaq -0x40(%rbp), %rcx
callq 0x2080
movl %eax, -0x1c(%rbp)
leaq -0x40(%rbp), %rax
cmpl $-0x1, -0x1c(%rbp)
jle 0x3562
movslq -0x1c(%rbp), %rax
movq -0x28(%rbp), %rcx
subq $0x1, %rcx
cmpq %rcx, %rax
jae 0x3562
movslq -0x1c(%rbp), %rcx
movq -0x8(%rbp), %rax
addq 0x8(%rax), %rcx
movq %rcx, 0x8(%rax)
movq -0x8(%rbp), %rax
cmpq $0x0, (%rax)
je 0x3560
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq -0x8(%rbp), %rcx
movq 0x8(%rcx), %rcx
movb $0x0, (%rax,%rcx)
jmp 0x3586
cmpl $-0x1, -0x1c(%rbp)
jne 0x3575
movq -0x28(%rbp), %rax
shlq %rax
movq %rax, -0x28(%rbp)
jmp 0x3581
movl -0x1c(%rbp), %eax
addl $0x2, %eax
cltq
movq %rax, -0x28(%rbp)
jmp 0x34bc
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/canboat[P]canboat/nmea0183/../common/common.c
// Function: getJSONLookupName
bool getJSONLookupName(const char *message, const char *fieldName, char *value, size_t len)
{
  char buffer[128];

  if (getJSONLookupList(message, fieldName, buffer, sizeof(buffer)))
  {
    logDebug("getJSONLookupList('%s','%s'...) = '%s'\n", message, fieldName, buffer);
    return getJSONValue(buffer, "name", value, len);
  }
  return false;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xb0, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
leaq -0xb0(%rbp), %rdx
movl $0x80, %ecx
callq 0x3ab0
testb $0x1, %al
jne 0x3a5a
jmp 0x3a99
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
leaq -0xb0(%rbp), %rcx
leaq 0x1aea(%rip), %rdi      # 0x555a
movb $0x0, %al
callq 0x2a10
leaq -0xb0(%rbp), %rdi
movq -0x20(%rbp), %rdx
movq -0x28(%rbp), %rcx
leaq 0x1af5(%rip), %rsi      # 0x5582
callq 0x3590
andb $0x1, %al
movb %al, -0x1(%rbp)
jmp 0x3a9d
movb $0x0, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0xb0, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/canboat[P]canboat/nmea0183/../common/common.c
// Function: sbSearchChar
char *sbSearchChar(const StringBuffer *const in, char c)
{
  char  *p = sbGet(in);
  size_t i;

  for (i = 0; i < in->len; i++)
  {
    if (p[i] == c)
    {
      return p + i;
    }
  }
  return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movb %sil, %al
movq %rdi, -0x10(%rbp)
movb %al, -0x11(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x0, (%rax)
je 0x3ce5
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x30(%rbp)
jmp 0x3cf2
leaq 0x1685(%rip), %rax      # 0x5371
movq %rax, -0x30(%rbp)
jmp 0x3cf2
movq -0x30(%rbp), %rax
movq %rax, -0x20(%rbp)
movq $0x0, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq -0x10(%rbp), %rcx
cmpq 0x8(%rcx), %rax
jae 0x3d42
movq -0x20(%rbp), %rax
movq -0x28(%rbp), %rcx
movsbl (%rax,%rcx), %eax
movsbl -0x11(%rbp), %ecx
cmpl %ecx, %eax
jne 0x3d32
movq -0x20(%rbp), %rax
addq -0x28(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x3d4a
jmp 0x3d34
movq -0x28(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x28(%rbp)
jmp 0x3d02
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/canboat[P]canboat/nmea0183/../common/common.c
// Function: getISO11783BitsFromCanId
void getISO11783BitsFromCanId(unsigned int id, unsigned int *prio, unsigned int *pgn, unsigned int *src, unsigned int *dst)
{
  unsigned char PF  = (unsigned char) (id >> 16);
  unsigned char PS  = (unsigned char) (id >> 8);
  unsigned char RDP = (unsigned char) (id >> 24) & 3; // Use R + DP bits

  if (src)
  {
    *src = (unsigned char) id >> 0;
  }
  if (prio)
  {
    *prio = (unsigned char) ((id >> 26) & 0x7);
  }

  if (PF < 240)
  {
    /* PDU1 format, the PS contains the destination address */
    if (dst)
    {
      *dst = PS;
    }
    if (pgn)
    {
      *pgn = (RDP << 16) + (PF << 8);
    }
  }
  else
  {
    /* PDU2 format, the destination is implied global and the PGN is extended */
    if (dst)
    {
      *dst = 0xff;
    }
    if (pgn)
    {
      *pgn = (RDP << 16) + (PF << 8) + PS;
    }
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl %edi, -0x4(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movl -0x4(%rbp), %eax
shrl $0x10, %eax
movb %al, -0x29(%rbp)
movl -0x4(%rbp), %eax
shrl $0x8, %eax
movb %al, -0x2a(%rbp)
movl -0x4(%rbp), %eax
shrl $0x18, %eax
movzbl %al, %eax
andl $0x3, %eax
movb %al, -0x2b(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0x3d9e
movl -0x4(%rbp), %eax
movzbl %al, %ecx
sarl $0x0, %ecx
movq -0x20(%rbp), %rax
movl %ecx, (%rax)
cmpq $0x0, -0x10(%rbp)
je 0x3db7
movl -0x4(%rbp), %eax
shrl $0x1a, %eax
andl $0x7, %eax
movzbl %al, %ecx
movq -0x10(%rbp), %rax
movl %ecx, (%rax)
movzbl -0x29(%rbp), %eax
cmpl $0xf0, %eax
jge 0x3df2
cmpq $0x0, -0x28(%rbp)
je 0x3dd3
movzbl -0x2a(%rbp), %ecx
movq -0x28(%rbp), %rax
movl %ecx, (%rax)
cmpq $0x0, -0x18(%rbp)
je 0x3df0
movzbl -0x2b(%rbp), %ecx
shll $0x10, %ecx
movzbl -0x29(%rbp), %eax
shll $0x8, %eax
addl %eax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, (%rax)
jmp 0x3e28
cmpq $0x0, -0x28(%rbp)
je 0x3e03
movq -0x28(%rbp), %rax
movl $0xff, (%rax)
cmpq $0x0, -0x18(%rbp)
je 0x3e26
movzbl -0x2b(%rbp), %ecx
shll $0x10, %ecx
movzbl -0x29(%rbp), %eax
shll $0x8, %eax
addl %eax, %ecx
movzbl -0x2a(%rbp), %eax
addl %eax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, (%rax)
jmp 0x3e28
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/canboat[P]canboat/nmea0183/../common/common.c
// Function: getCanIdFromISO11783Bits
unsigned int getCanIdFromISO11783Bits(unsigned int prio, unsigned int pgn, unsigned int src, unsigned int dst)
{
  unsigned int canId
      = (src & 0xff) | 0x80000000U; // src bits are the lowest ones of the CAN ID. Also set the highest bit to 1 as n2k uses
  // only extended frames (EFF bit).

  unsigned int PF = (pgn >> 8) & 0xff;

  if (PF < 240)
  { // PDU 1
    canId |= (dst & 0xff) << 8;
    canId |= (pgn << 8);
  }
  else
  { // PDU 2
    canId |= pgn << 8;
  }
  canId |= prio << 26;

  return canId;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movl %edi, -0x4(%rbp)
movl %esi, -0x8(%rbp)
movl %edx, -0xc(%rbp)
movl %ecx, -0x10(%rbp)
movl -0xc(%rbp), %eax
andl $0xff, %eax
orl $0x80000000, %eax       # imm = 0x80000000
movl %eax, -0x14(%rbp)
movl -0x8(%rbp), %eax
shrl $0x8, %eax
andl $0xff, %eax
movl %eax, -0x18(%rbp)
cmpl $0xf0, -0x18(%rbp)
jae 0x3e86
movl -0x10(%rbp), %eax
andl $0xff, %eax
shll $0x8, %eax
orl -0x14(%rbp), %eax
movl %eax, -0x14(%rbp)
movl -0x8(%rbp), %eax
shll $0x8, %eax
orl -0x14(%rbp), %eax
movl %eax, -0x14(%rbp)
jmp 0x3e92
movl -0x8(%rbp), %eax
shll $0x8, %eax
orl -0x14(%rbp), %eax
movl %eax, -0x14(%rbp)
movl -0x4(%rbp), %eax
shll $0x1a, %eax
orl -0x14(%rbp), %eax
movl %eax, -0x14(%rbp)
movl -0x14(%rbp), %eax
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/canboat[P]canboat/nmea0183/../common/common.c
// Function: open_socket_stream
SOCKET open_socket_stream(const char *url)
{
  SOCKET          sockfd = INVALID_SOCKET;
  int             n;
  struct addrinfo hints, *res, *addr;
  char           *host;
  const char     *service;

  resolve_address(url, &host, &service);

  memset(&hints, 0, sizeof(hints));
  hints.ai_family   = AF_UNSPEC;
  hints.ai_socktype = SOCK_STREAM;

  n = getaddrinfo(host, service, &hints, &res);
  if (n != 0)
  {
    logError("Unable to open connection to %s:%s: %s\n", host, service, gai_strerror(n));
  }
  else
  {
    for (addr = res; addr; addr = addr->ai_next)
    {
      sockfd = socket(addr->ai_family, addr->ai_socktype, addr->ai_protocol);
      if (sockfd == INVALID_SOCKET)
      {
        continue;
      }

      if (!connect(sockfd, res->ai_addr, res->ai_addrlen))
      {
        break;
      }
      close(sockfd);
      sockfd = INVALID_SOCKET;
    }
    if (!addr)
    {
      logError("Unable to open connection to %s:%s: %s\n", host, service, strerror(errno));
    }
  }

  freeaddrinfo(res);
  free(host);

  return sockfd;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x80, %rsp
movq %rdi, -0x8(%rbp)
movl $0xffffffff, -0xc(%rbp) # imm = 0xFFFFFFFF
movq -0x8(%rbp), %rdi
leaq -0x58(%rbp), %rsi
leaq -0x60(%rbp), %rdx
callq 0x4020
leaq -0x40(%rbp), %rdi
xorl %esi, %esi
movl $0x30, %edx
callq 0x2130
movl $0x0, -0x3c(%rbp)
movl $0x1, -0x38(%rbp)
movq -0x58(%rbp), %rdi
movq -0x60(%rbp), %rsi
leaq -0x40(%rbp), %rdx
leaq -0x48(%rbp), %rcx
callq 0x2250
movl %eax, -0x10(%rbp)
cmpl $0x0, -0x10(%rbp)
je 0x3f49
movq -0x58(%rbp), %rax
movq %rax, -0x70(%rbp)
movq -0x60(%rbp), %rax
movq %rax, -0x68(%rbp)
movl -0x10(%rbp), %edi
callq 0x20f0
movq -0x70(%rbp), %rsi
movq -0x68(%rbp), %rdx
movq %rax, %rcx
leaq 0x1654(%rip), %rdi      # 0x5591
movb $0x0, %al
callq 0x2ac0
jmp 0x3ff6
movq -0x48(%rbp), %rax
movq %rax, -0x50(%rbp)
cmpq $0x0, -0x50(%rbp)
je 0x3fb8
movq -0x50(%rbp), %rax
movl 0x4(%rax), %edi
movq -0x50(%rbp), %rax
movl 0x8(%rax), %esi
movq -0x50(%rbp), %rax
movl 0xc(%rax), %edx
callq 0x22c0
movl %eax, -0xc(%rbp)
cmpl $-0x1, -0xc(%rbp)
jne 0x3f7d
jmp 0x3faa
movl -0xc(%rbp), %edi
movq -0x48(%rbp), %rax
movq 0x18(%rax), %rsi
movq -0x48(%rbp), %rax
movl 0x10(%rax), %edx
callq 0x2240
cmpl $0x0, %eax
jne 0x3f9b
jmp 0x3fb8
movl -0xc(%rbp), %edi
callq 0x2140
movl $0xffffffff, -0xc(%rbp) # imm = 0xFFFFFFFF
movq -0x50(%rbp), %rax
movq 0x28(%rax), %rax
movq %rax, -0x50(%rbp)
jmp 0x3f51
cmpq $0x0, -0x50(%rbp)
jne 0x3ff4
movq -0x58(%rbp), %rax
movq %rax, -0x80(%rbp)
movq -0x60(%rbp), %rax
movq %rax, -0x78(%rbp)
callq 0x2050
movl (%rax), %edi
callq 0x2260
movq -0x80(%rbp), %rsi
movq -0x78(%rbp), %rdx
movq %rax, %rcx
leaq 0x15a4(%rip), %rdi      # 0x5591
movb $0x0, %al
callq 0x2ac0
jmp 0x3ff6
movq -0x48(%rbp), %rdi
callq 0x22b0
movq -0x58(%rbp), %rdi
callq 0x2030
movl -0xc(%rbp), %eax
addq $0x80, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/canboat[P]canboat/nmea0183/../common/common.c
// Function: resolve_address
static void resolve_address(const char *url, char **host, const char **service)
{
  const char *s;
  size_t      hostlen;

  if (strncmp(url, "tcp:", STRSIZE("tcp:")) == 0)
  {
    url += STRSIZE("tcp:");
  }
  while (*url == '/')
  {
    url++;
  }

  s = strchr(url, ':');
  if (s)
  {
    hostlen = s - url;
    s++;
  }
  else
  {
    hostlen = strlen(url);
  }

  *host = malloc(hostlen + 1);
  if (!*host)
  {
    die("Out of memory");
  }
  memcpy(*host, url, hostlen);
  (*host)[hostlen] = 0;

  if (s)
  {
    *service = s;
  }
  else
  {
    *service = "80";
  }
}

// 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
leaq 0x1676(%rip), %rsi      # 0x56b5
movl $0x4, %edx
callq 0x2070
cmpl $0x0, %eax
jne 0x405a
movq -0x8(%rbp), %rax
addq $0x4, %rax
movq %rax, -0x8(%rbp)
jmp 0x405c
movq -0x8(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2f, %eax
jne 0x4076
movq -0x8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x8(%rbp)
jmp 0x405c
movq -0x8(%rbp), %rdi
movl $0x3a, %esi
callq 0x20c0
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0x40ac
movq -0x20(%rbp), %rax
movq -0x8(%rbp), %rcx
subq %rcx, %rax
movq %rax, -0x28(%rbp)
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0x40b9
movq -0x8(%rbp), %rdi
callq 0x20a0
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rdi
addq $0x1, %rdi
callq 0x21a0
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
movq -0x10(%rbp), %rax
cmpq $0x0, (%rax)
jne 0x40e6
leaq 0x15d9(%rip), %rdi      # 0x56ba
callq 0x2c30
movq -0x10(%rbp), %rax
movq (%rax), %rdi
movq -0x8(%rbp), %rsi
movq -0x28(%rbp), %rdx
callq 0x2180
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq -0x28(%rbp), %rcx
movb $0x0, (%rax,%rcx)
cmpq $0x0, -0x20(%rbp)
je 0x411d
movq -0x20(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
jmp 0x412b
movq -0x18(%rbp), %rax
leaq 0x15a0(%rip), %rcx      # 0x56c8
movq %rcx, (%rax)
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/canboat[P]canboat/nmea0183/../common/common.c
// Function: scanNibble
uint8_t scanNibble(char c)
{
  if (isdigit((unsigned char) c))
  {
    return c - '0';
  }
  if (c >= 'A' && c <= 'F')
  {
    return c - 'A' + 10;
  }
  if (c >= 'a' && c <= 'f')
  {
    return c - 'a' + 10;
  }
  return 16;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movb %dil, %al
movb %al, -0x2(%rbp)
callq 0x2290
movq (%rax), %rax
movzbl -0x2(%rbp), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x800, %eax            # imm = 0x800
cmpl $0x0, %eax
je 0x4177
movsbl -0x2(%rbp), %eax
subl $0x30, %eax
movb %al, -0x1(%rbp)
jmp 0x41bd
movsbl -0x2(%rbp), %eax
cmpl $0x41, %eax
jl 0x4198
movsbl -0x2(%rbp), %eax
cmpl $0x46, %eax
jg 0x4198
movsbl -0x2(%rbp), %eax
subl $0x41, %eax
addl $0xa, %eax
movb %al, -0x1(%rbp)
jmp 0x41bd
movsbl -0x2(%rbp), %eax
cmpl $0x61, %eax
jl 0x41b9
movsbl -0x2(%rbp), %eax
cmpl $0x66, %eax
jg 0x41b9
movsbl -0x2(%rbp), %eax
subl $0x61, %eax
addl $0xa, %eax
movb %al, -0x1(%rbp)
jmp 0x41bd
movb $0x10, -0x1(%rbp)
movb -0x1(%rbp), %al
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/canboat[P]canboat/nmea0183/../common/common.c
// Function: scanHex
int scanHex(char **p, uint8_t *m)
{
  uint8_t hi, lo;

  if (!(*p)[0] || !(*p)[1])
  {
    return 1;
  }

  hi = scanNibble((*p)[0]);
  if (hi > 15)
  {
    return 1;
  }
  lo = scanNibble((*p)[1]);
  if (lo > 15)
  {
    return 1;
  }
  (*p) += 2;
  *m = hi << 4 | lo;
  /* printf("(b=%02X,p=%p) ", *m, *p); */
  return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
cmpb $0x0, (%rax)
je 0x41f9
movq -0x10(%rbp), %rax
movq (%rax), %rax
cmpb $0x0, 0x1(%rax)
jne 0x4202
movl $0x1, -0x4(%rbp)
jmp 0x4275
movq -0x10(%rbp), %rax
movq (%rax), %rax
movsbl (%rax), %edi
callq 0x4140
movb %al, -0x19(%rbp)
movzbl -0x19(%rbp), %eax
cmpl $0xf, %eax
jle 0x4226
movl $0x1, -0x4(%rbp)
jmp 0x4275
movq -0x10(%rbp), %rax
movq (%rax), %rax
movsbl 0x1(%rax), %edi
callq 0x4140
movb %al, -0x1a(%rbp)
movzbl -0x1a(%rbp), %eax
cmpl $0xf, %eax
jle 0x424b
movl $0x1, -0x4(%rbp)
jmp 0x4275
movq -0x10(%rbp), %rax
movq (%rax), %rcx
addq $0x2, %rcx
movq %rcx, (%rax)
movzbl -0x19(%rbp), %eax
shll $0x4, %eax
movzbl -0x1a(%rbp), %ecx
orl %ecx, %eax
movb %al, %cl
movq -0x18(%rbp), %rax
movb %cl, (%rax)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/canboat[P]canboat/nmea0183/../common/common.c
// Function: writeSerial
int writeSerial(SOCKET handle, const uint8_t *data, size_t len)
{
  int     retryCount = 5;
  ssize_t written;

  do
  {
    written = write(handle, data, len);
    if (written != -1)
    {
      data += written;
      len -= written;
    }
    else if (errno == EAGAIN)
    {
      retryCount--;
      usleep(25000);
    }
    else
    {
      break;
    }
  } while (len > 0 && retryCount >= 0);

  if (written == -1)
  {
    logError("Write failed: %s\n", strerror(errno));
    return -1;
  }
  else if (len > 0)
  {
    logError("Write timeout: %s\n", strerror(errno));
    return -1;
  }
  return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl $0x5, -0x1c(%rbp)
movl -0x8(%rbp), %edi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x2090
movq %rax, -0x28(%rbp)
cmpq $-0x1, -0x28(%rbp)
je 0x4672
movq -0x28(%rbp), %rax
addq -0x10(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x28(%rbp), %rcx
movq -0x18(%rbp), %rax
subq %rcx, %rax
movq %rax, -0x18(%rbp)
jmp 0x4695
callq 0x2050
cmpl $0xb, (%rax)
jne 0x4691
movl -0x1c(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x1c(%rbp)
movl $0x61a8, %edi           # imm = 0x61A8
callq 0x22a0
jmp 0x4693
jmp 0x46b4
jmp 0x4695
jmp 0x4697
xorl %eax, %eax
cmpq $0x0, -0x18(%rbp)
movb %al, -0x29(%rbp)
jbe 0x46ad
cmpl $0x0, -0x1c(%rbp)
setge %al
movb %al, -0x29(%rbp)
movb -0x29(%rbp), %al
testb $0x1, %al
jne 0x463a
cmpq $-0x1, -0x28(%rbp)
jne 0x46e1
callq 0x2050
movl (%rax), %edi
callq 0x2260
movq %rax, %rsi
leaq 0xf2a(%rip), %rdi       # 0x55fb
movb $0x0, %al
callq 0x2ac0
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x4717
cmpq $0x0, -0x18(%rbp)
jbe 0x470e
callq 0x2050
movl (%rax), %edi
callq 0x2260
movq %rax, %rsi
leaq 0xf0f(%rip), %rdi       # 0x560d
movb $0x0, %al
callq 0x2ac0
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x4717
jmp 0x4710
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/canboat[P]canboat/nmea0183/../common/common.c
// Function: parseInt
bool parseInt(const char **msg, int *value, int defValue)
{
  char *end;

  *value = strtol(*msg, &end, 10);
  if (end == *msg)
  {
    *value = defValue;
  }
  *msg = end;
  if (*end == ',')
  {
    *msg = end + 1;
  }
  else if (*end != '\0')
  {
    return false;
  }
  return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rdi
leaq -0x28(%rbp), %rsi
movl $0xa, %edx
callq 0x2170
movl %eax, %ecx
movq -0x18(%rbp), %rax
movl %ecx, (%rax)
movq -0x28(%rbp), %rax
movq -0x10(%rbp), %rcx
cmpq (%rcx), %rax
jne 0x4766
movl -0x1c(%rbp), %ecx
movq -0x18(%rbp), %rax
movl %ecx, (%rax)
movq -0x28(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
movq -0x28(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2c, %eax
jne 0x478e
movq -0x28(%rbp), %rcx
addq $0x1, %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
jmp 0x47a2
movq -0x28(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x0, %eax
je 0x47a0
movb $0x0, -0x1(%rbp)
jmp 0x47a6
jmp 0x47a2
movb $0x1, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/canboat[P]canboat/nmea0183/../common/common.c
// Function: parseConst
bool parseConst(const char **msg, const char *str)
{
  if (strncmp(*msg, str, strlen(str)) == 0)
  {
    *msg += strlen(str);
    return true;
  }
  return false;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x28(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0x18(%rbp), %rdi
callq 0x20a0
movq -0x28(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq %rax, %rdx
callq 0x2070
cmpl $0x0, %eax
jne 0x481d
movq -0x18(%rbp), %rdi
callq 0x20a0
movq %rax, %rcx
movq -0x10(%rbp), %rax
addq (%rax), %rcx
movq %rcx, (%rax)
movb $0x1, -0x1(%rbp)
jmp 0x4821
movb $0x0, -0x1(%rbp)
movb -0x1(%rbp), %al
andb $0x1, %al
addq $0x30, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/eric-lo[P]3150/9-File/read_part.c
// Function: main
int main(int argc, char **argv) {
	FILE *fp;
	unsigned char buf[1000];
	struct ptable *ptr;
	int i;

	if(argc != 2) {
		fprintf(stderr, "Usage: %s [disk image]\n", argv[0]);
		exit(1);
	}

	if( (fp = fopen(argv[1], "r")) == NULL ) {
		perror(argv[1]);
		exit(1);
	}

	fseek(fp, PTABLE_START, SEEK_SET);	// skip boot code
	fread(buf, sizeof(struct ptable), 4, fp);

	ptr = (struct ptable *) buf;

	for(i = 0; i < 4; i++) {
		printf("Partition table #%d\n", i + 1);
		printf("------------------\n");

		printf("Bootable\t");
		if(ptr[i].flag == 0x80)
			printf("Yes\n");
		else
			printf("No\n");

		printf("LBA start addr\t%u\n", ptr[i].lba_start_addr);
		printf("type\t\t0x%02x\n", ptr[i].type);
		printf("size\t\t%u\n", ptr[i].size_in_sector);
		printf("\n");
	}
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x410, %rsp            # imm = 0x410
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
cmpl $0x2, -0x8(%rbp)
je 0x11e8
movq 0x2e32(%rip), %rax      # 0x3ff8
movq (%rax), %rdi
movq -0x10(%rbp), %rax
movq (%rax), %rdx
leaq 0xe2d(%rip), %rsi       # 0x2004
movb $0x0, %al
callq 0x1050
movl $0x1, %edi
callq 0x1090
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
leaq 0xe25(%rip), %rsi       # 0x201c
callq 0x1060
movq %rax, -0x18(%rbp)
cmpq $0x0, %rax
jne 0x121d
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x1080
movl $0x1, %edi
callq 0x1090
movq -0x18(%rbp), %rdi
movl $0x1be, %esi            # imm = 0x1BE
xorl %edx, %edx
callq 0x1070
leaq -0x400(%rbp), %rdi
movq -0x18(%rbp), %rcx
movl $0x10, %esi
movl $0x4, %edx
callq 0x1030
leaq -0x400(%rbp), %rax
movq %rax, -0x408(%rbp)
movl $0x0, -0x40c(%rbp)
cmpl $0x4, -0x40c(%rbp)
jge 0x1371
movl -0x40c(%rbp), %esi
addl $0x1, %esi
leaq 0xda2(%rip), %rdi       # 0x201e
movb $0x0, %al
callq 0x1040
leaq 0xda9(%rip), %rdi       # 0x2033
movb $0x0, %al
callq 0x1040
leaq 0xdaf(%rip), %rdi       # 0x2047
movb $0x0, %al
callq 0x1040
movq -0x408(%rbp), %rax
movslq -0x40c(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movzbl (%rax), %eax
cmpl $0x80, %eax
jne 0x12ce
leaq 0xd8c(%rip), %rdi       # 0x2051
movb $0x0, %al
callq 0x1040
jmp 0x12dc
leaq 0xd81(%rip), %rdi       # 0x2056
movb $0x0, %al
callq 0x1040
movq -0x408(%rbp), %rax
movslq -0x40c(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movl 0x8(%rax), %esi
leaq 0xd5f(%rip), %rdi       # 0x205a
movb $0x0, %al
callq 0x1040
movq -0x408(%rbp), %rax
movslq -0x40c(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movzbl 0x4(%rax), %esi
leaq 0xd4b(%rip), %rdi       # 0x206d
movb $0x0, %al
callq 0x1040
movq -0x408(%rbp), %rax
movslq -0x40c(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movl 0xc(%rax), %esi
leaq 0xd33(%rip), %rdi       # 0x207b
movb $0x0, %al
callq 0x1040
leaq 0xcef(%rip), %rdi       # 0x2045
movb $0x0, %al
callq 0x1040
movl -0x40c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x40c(%rbp)
jmp 0x125f
xorl %eax, %eax
addq $0x410, %rsp            # imm = 0x410
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/FastFilter[P]BlockBloomSimulator/src/randomutil.h
// Function: pcg32_random_r
static inline uint32_t pcg32_random_r(pcg32_random_t *rng) {
  uint64_t oldstate = rng->state;
  rng->state = oldstate * 6364136223846793005ULL + rng->inc;
  uint32_t xorshifted = ((oldstate >> 18u) ^ oldstate) >> 27u;
  uint32_t rot = oldstate >> 59u;
  return (xorshifted >> rot) | (xorshifted << ((-rot) & 31));
}

// Assembly:
movq %rdi, -0x8(%rsp)
movq -0x8(%rsp), %rax
movq (%rax), %rax
movq %rax, -0x10(%rsp)
movabsq $0x5851f42d4c957f2d, %rcx # imm = 0x5851F42D4C957F2D
imulq -0x10(%rsp), %rcx
movq -0x8(%rsp), %rax
addq 0x8(%rax), %rcx
movq -0x8(%rsp), %rax
movq %rcx, (%rax)
movq -0x10(%rsp), %rax
shrq $0x12, %rax
xorq -0x10(%rsp), %rax
shrq $0x1b, %rax
movl %eax, -0x14(%rsp)
movq -0x10(%rsp), %rax
shrq $0x3b, %rax
movl %eax, -0x18(%rsp)
movl -0x14(%rsp), %eax
movl -0x18(%rsp), %ecx
shrl %cl, %eax
movl -0x14(%rsp), %edx
xorl %ecx, %ecx
subl -0x18(%rsp), %ecx
andl $0x1f, %ecx
shll %cl, %edx
movl %edx, %ecx
orl %ecx, %eax
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/FastFilter[P]BlockBloomSimulator/src/bitset.h
// Function: bitset_set
static inline void bitset_set(bitset_t *bitset,  size_t i ) {
  size_t shiftedi = i >> 6;
  if (shiftedi >= bitset->arraysize) {
    if( ! bitset_grow(bitset,  shiftedi + 1) ) {
        return;
    }
  }
  bitset->array[shiftedi] |= ((uint64_t)1) << (i % 64);
}

// Assembly:
subq $0x18, %rsp
movq %rdi, 0x10(%rsp)
movq %rsi, 0x8(%rsp)
movq 0x8(%rsp), %rax
shrq $0x6, %rax
movq %rax, (%rsp)
movq (%rsp), %rax
movq 0x10(%rsp), %rcx
cmpq 0x8(%rcx), %rax
jb 0x1594
movq 0x10(%rsp), %rdi
movq (%rsp), %rsi
addq $0x1, %rsi
callq 0x3360
testb $0x1, %al
jne 0x1592
jmp 0x15b9
jmp 0x1594
movq 0x8(%rsp), %rcx
andq $0x3f, %rcx
movl $0x1, %edx
shlq %cl, %rdx
movq 0x10(%rsp), %rax
movq (%rax), %rax
movq (%rsp), %rcx
orq (%rax,%rcx,8), %rdx
movq %rdx, (%rax,%rcx,8)
addq $0x18, %rsp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/FastFilter[P]BlockBloomSimulator/src/bitset.h
// Function: bitset_get
static inline bool bitset_get(const bitset_t *bitset,  size_t i ) {
  size_t shiftedi = i >> 6;
  if (shiftedi >= bitset->arraysize) {
    return false;
  }
  return ( bitset->array[shiftedi] & ( ((uint64_t)1) << (i % 64))) != 0 ;
}

// Assembly:
movq %rdi, -0x10(%rsp)
movq %rsi, -0x18(%rsp)
movq -0x18(%rsp), %rax
shrq $0x6, %rax
movq %rax, -0x20(%rsp)
movq -0x20(%rsp), %rax
movq -0x10(%rsp), %rcx
cmpq 0x8(%rcx), %rax
jb 0x15ef
movb $0x0, -0x1(%rsp)
jmp 0x1624
movq -0x10(%rsp), %rax
movq (%rax), %rax
movq -0x20(%rsp), %rcx
movq (%rax,%rcx,8), %rax
movq -0x18(%rsp), %rcx
andq $0x3f, %rcx
movl $0x1, %edx
shlq %cl, %rdx
movq %rdx, %rcx
andq %rcx, %rax
cmpq $0x0, %rax
setne %al
andb $0x1, %al
movb %al, -0x1(%rsp)
movb -0x1(%rsp), %al
andb $0x1, %al
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/FastFilter[P]BlockBloomSimulator/src/blockmodel.h
// Function: assessBlockSize
void assessBlockSize(size_t HowManyKeys, size_t BlockSizeInBits, bool verbose) {
  for (size_t bitsperkey = 8; bitsperkey <= 16; bitsperkey += 4) {
    size_t bitbudget = bitsperkey * HowManyKeys;
    sim_stats_t beststats;
    size_t bestbitsperbucket = findBestBitsPerKeyPerBlock(
        HowManyKeys, bitbudget, BlockSizeInBits, &beststats, verbose);
    double density = bestbitsperbucket * 1.0 / bitsperkey;

    double theoretical_best_bits = log(1.0/beststats.collision_rate) / log(2.0);
    double inefficiency = (bitsperkey/theoretical_best_bits - 1.0) * 100.0;
    

    printf("bits per key %3zu best bits per bucket = %zu, max density = %0.0f %%, density = %0.0f %%, collision rate = "
           "%0.3f %%, inefficiency = %0.1f %% \n",
           bitsperkey, bestbitsperbucket,density * 100,   beststats.density * 100, beststats.collision_rate * 100, inefficiency);
  }
}

// Assembly:
subq $0x88, %rsp
movb %dl, %al
movq %rdi, 0x80(%rsp)
movq %rsi, 0x78(%rsp)
andb $0x1, %al
movb %al, 0x77(%rsp)
movq $0x8, 0x68(%rsp)
cmpq $0x10, 0x68(%rsp)
ja 0x1a44
movq 0x68(%rsp), %rax
movq 0x80(%rsp), %rcx
imulq %rcx, %rax
movq %rax, 0x60(%rsp)
movq 0x80(%rsp), %rdi
movq 0x60(%rsp), %rsi
movq 0x78(%rsp), %rdx
movzbl 0x77(%rsp), %r8d
andl $0x1, %r8d
leaq 0x50(%rsp), %rcx
callq 0x1630
movq %rax, 0x48(%rsp)
movq 0x48(%rsp), %xmm0
movaps 0x46f1(%rip), %xmm3     # 0x6010
movaps %xmm3, (%rsp)
punpckldq %xmm3, %xmm0    # xmm0 = xmm0[0],xmm3[0],xmm0[1],xmm3[1]
movapd 0x46f1(%rip), %xmm2     # 0x6020
movaps %xmm2, 0x10(%rsp)
subpd %xmm2, %xmm0
movaps %xmm0, %xmm1
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
addsd %xmm1, %xmm0
movq 0x68(%rsp), %xmm1
punpckldq %xmm3, %xmm1    # xmm1 = xmm1[0],xmm3[0],xmm1[1],xmm3[1]
subpd %xmm2, %xmm1
movaps %xmm1, %xmm2
unpckhpd %xmm1, %xmm1            # xmm1 = xmm1[1,1]
addsd %xmm2, %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, 0x40(%rsp)
movsd 0x50(%rsp), %xmm1
movsd 0x46cc(%rip), %xmm0     # 0x6040
divsd %xmm1, %xmm0
callq 0x1080
movsd %xmm0, 0x28(%rsp)
movsd 0x46cd(%rip), %xmm0     # 0x6058
callq 0x1080
movaps (%rsp), %xmm2
movaps 0x10(%rsp), %xmm1
movaps %xmm0, %xmm3
movsd 0x28(%rsp), %xmm0
divsd %xmm3, %xmm0
movsd %xmm0, 0x38(%rsp)
movq 0x68(%rsp), %xmm0
punpckldq %xmm2, %xmm0    # xmm0 = xmm0[0],xmm2[0],xmm0[1],xmm2[1]
subpd %xmm1, %xmm0
movaps %xmm0, %xmm1
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
addsd %xmm1, %xmm0
divsd 0x38(%rsp), %xmm0
movsd 0x466d(%rip), %xmm1     # 0x6040
subsd %xmm1, %xmm0
movsd 0x4671(%rip), %xmm1     # 0x6050
mulsd %xmm1, %xmm0
movsd %xmm0, 0x30(%rsp)
movq 0x68(%rsp), %rsi
movq 0x48(%rsp), %rdx
movsd 0x4655(%rip), %xmm0     # 0x6050
mulsd 0x40(%rsp), %xmm0
movsd 0x4647(%rip), %xmm1     # 0x6050
mulsd 0x58(%rsp), %xmm1
movsd 0x4639(%rip), %xmm2     # 0x6050
mulsd 0x50(%rsp), %xmm2
movsd 0x30(%rsp), %xmm3
leaq 0x4636(%rip), %rdi      # 0x6060
movb $0x4, %al
callq 0x1060
movq 0x68(%rsp), %rax
addq $0x4, %rax
movq %rax, 0x68(%rsp)
jmp 0x18c5
addq $0x88, %rsp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/FastFilter[P]BlockBloomSimulator/src/bloommodel.h
// Function: describeBloom
void describeBloom(size_t bitsperkey) {
  double bestbitsperbucket = bitsperkey * log(2);
  double density = bestbitsperbucket * 1.0 / bitsperkey;

  double bestcollisionrate = pow(2, -bestbitsperbucket);
  printf("bits per key %3zu best bits per bucket = %4.1f, best density = %0.0f %%, collision rate = "
         "%0.3f %% [theory]\n",
         bitsperkey, bestbitsperbucket, density * 100, bestcollisionrate * 100);
}

// Assembly:
subq $0x48, %rsp
movq %rdi, 0x40(%rsp)
movq 0x40(%rsp), %xmm0
movaps 0x45aa(%rip), %xmm1     # 0x6010
movaps %xmm1, (%rsp)
punpckldq %xmm1, %xmm0    # xmm0 = xmm0[0],xmm1[0],xmm0[1],xmm1[1]
movapd 0x45aa(%rip), %xmm1     # 0x6020
movaps %xmm1, 0x10(%rsp)
subpd %xmm1, %xmm0
movaps %xmm0, %xmm1
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
addsd %xmm1, %xmm0
movsd %xmm0, 0x20(%rsp)
movsd 0x45c0(%rip), %xmm0     # 0x6058
callq 0x1080
movaps (%rsp), %xmm3
movaps 0x10(%rsp), %xmm2
movaps %xmm0, %xmm1
movsd 0x20(%rsp), %xmm0
mulsd %xmm1, %xmm0
movsd %xmm0, 0x38(%rsp)
movsd 0x38(%rsp), %xmm0
movq 0x40(%rsp), %xmm1
punpckldq %xmm3, %xmm1    # xmm1 = xmm1[0],xmm3[0],xmm1[1],xmm3[1]
subpd %xmm2, %xmm1
movaps %xmm1, %xmm2
unpckhpd %xmm1, %xmm1            # xmm1 = xmm1[1,1]
addsd %xmm2, %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, 0x30(%rsp)
movsd 0x38(%rsp), %xmm0
movq %xmm0, %rax
movabsq $-0x8000000000000000, %rcx # imm = 0x8000000000000000
xorq %rcx, %rax
movq %rax, %xmm1
movsd 0x4551(%rip), %xmm0     # 0x6058
callq 0x1050
movsd %xmm0, 0x28(%rsp)
movq 0x40(%rsp), %rsi
movsd 0x38(%rsp), %xmm0
movsd 0x452b(%rip), %xmm1     # 0x6050
mulsd 0x30(%rsp), %xmm1
movsd 0x451d(%rip), %xmm2     # 0x6050
mulsd 0x28(%rsp), %xmm2
leaq 0x45af(%rip), %rdi      # 0x60ef
movb $0x3, %al
callq 0x1060
addq $0x48, %rsp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/FastFilter[P]BlockBloomSimulator/src/bloommodel.h
// Function: assessBloomCase
void assessBloomCase(size_t HowManyKeys, bool verbose) {
  for (size_t bitsperkey = 8; bitsperkey <= 16; bitsperkey += 1) {
    size_t bitbudget = bitsperkey * HowManyKeys;
    sim_stats_t beststats;
    size_t bestbitsperbucket = findBestBitsPerKeyPerBlock(
        HowManyKeys, bitbudget, bitbudget, &beststats, verbose);
    double density = bestbitsperbucket * 1.0 / bitsperkey;

    printf("bits per key %3zu best bits per bucket = %4.1f, max density = %0.0f %%, density = %0.0f %%, collision rate = "
           "%0.3f %% [measured]\n",
           bitsperkey, (float)bestbitsperbucket, density * 100, beststats.density * 100, beststats.collision_rate * 100);
    describeBloom(bitsperkey);
  }
}

// Assembly:
subq $0x58, %rsp
movb %sil, %al
movq %rdi, 0x50(%rsp)
andb $0x1, %al
movb %al, 0x4f(%rsp)
movq $0x8, 0x40(%rsp)
cmpq $0x10, 0x40(%rsp)
ja 0x1ca7
movq 0x40(%rsp), %rax
movq 0x50(%rsp), %rcx
imulq %rcx, %rax
movq %rax, 0x38(%rsp)
movq 0x50(%rsp), %rdi
movq 0x38(%rsp), %rdx
movzbl 0x4f(%rsp), %r8d
andl $0x1, %r8d
leaq 0x28(%rsp), %rcx
movq %rdx, %rsi
callq 0x1630
movq %rax, 0x20(%rsp)
movaps 0x4459(%rip), %xmm3     # 0x6010
movq 0x20(%rsp), %xmm0
punpckldq %xmm3, %xmm0    # xmm0 = xmm0[0],xmm3[0],xmm0[1],xmm3[1]
movapd 0x4457(%rip), %xmm2     # 0x6020
subpd %xmm2, %xmm0
movaps %xmm0, %xmm1
unpckhpd %xmm0, %xmm0            # xmm0 = xmm0[1,1]
addsd %xmm1, %xmm0
movq 0x40(%rsp), %xmm1
punpckldq %xmm3, %xmm1    # xmm1 = xmm1[0],xmm3[0],xmm1[1],xmm3[1]
subpd %xmm2, %xmm1
movaps %xmm1, %xmm2
unpckhpd %xmm1, %xmm1            # xmm1 = xmm1[1,1]
addsd %xmm2, %xmm1
divsd %xmm1, %xmm0
movsd %xmm0, 0x18(%rsp)
movq 0x40(%rsp), %rax
movq %rax, 0x8(%rsp)
movq 0x20(%rsp), %rax
movq %rax, %rdx
shrq %rdx
movl %eax, %ecx
andl $0x1, %ecx
orq %rdx, %rcx
cvtsi2ss %rcx, %xmm0
addss %xmm0, %xmm0
cvtsi2ss %rax, %xmm1
movss %xmm1, 0x10(%rsp)
testq %rax, %rax
movss %xmm0, 0x14(%rsp)
js 0x1c43
movss 0x10(%rsp), %xmm0
movss %xmm0, 0x14(%rsp)
movq 0x8(%rsp), %rsi
movss 0x14(%rsp), %xmm0
cvtss2sd %xmm0, %xmm0
movsd 0x43f6(%rip), %xmm1     # 0x6050
mulsd 0x18(%rsp), %xmm1
movsd 0x43e8(%rip), %xmm2     # 0x6050
mulsd 0x30(%rsp), %xmm2
movsd 0x43da(%rip), %xmm3     # 0x6050
mulsd 0x28(%rsp), %xmm3
leaq 0x44d9(%rip), %rdi      # 0x615c
movb $0x4, %al
callq 0x1060
movq 0x40(%rsp), %rdi
callq 0x1a50
movq 0x40(%rsp), %rax
addq $0x1, %rax
movq %rax, 0x40(%rsp)
jmp 0x1b6b
addq $0x58, %rsp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/FastFilter[P]BlockBloomSimulator/src/laneblockmodel.h
// Function: findLaneCollisionRateAndDensity
sim_stats_t findLaneCollisionRateAndDensity(size_t HowManyKeys, size_t bitbudget,
                             size_t BlockSizeInBits, size_t lanesize,
                             bool verbose) {
  model_t m;
  m.NumberOfBlocks = bitbudget / BlockSizeInBits;
  m.BlockSizeInBits = BlockSizeInBits;
  size_t howmanytests = 100000;
  bitset_t *b = bitset_create_with_capacity(bitbudget);
  m.BitsPerKeyPerBlock = m.BlockSizeInBits / lanesize;
  // we take the averge of several attempts
  sim_stats_t s; 
  s.collision_rate = 0;
  s.density = 0;
  size_t attempts = HowManyKeys < 10000000 ? 5 : 1;
  for (int i = 0; i < attempts; i++) {
    sim_stats_t ts = simulate_lane(HowManyKeys, m, howmanytests, b);
    s.density += ts.density;
    s.collision_rate += ts.collision_rate;
  }
  s.collision_rate /= attempts;
  s.density /= attempts;
  bitset_free(b);
  return s;
}

// Assembly:
subq $0x98, %rsp
movb %r8b, %al
movq %rdi, 0x80(%rsp)
movq %rsi, 0x78(%rsp)
movq %rdx, 0x70(%rsp)
movq %rcx, 0x68(%rsp)
andb $0x1, %al
movb %al, 0x67(%rsp)
movq 0x78(%rsp), %rax
xorl %ecx, %ecx
movl %ecx, %edx
divq 0x70(%rsp)
movq %rax, 0x58(%rsp)
movq 0x70(%rsp), %rax
movq %rax, 0x50(%rsp)
movq $0x186a0, 0x40(%rsp)    # imm = 0x186A0
movq 0x78(%rsp), %rdi
callq 0x34a0
movq %rax, 0x38(%rsp)
movq 0x50(%rsp), %rax
xorl %ecx, %ecx
movl %ecx, %edx
divq 0x68(%rsp)
movq %rax, 0x48(%rsp)
xorps %xmm0, %xmm0
movsd %xmm0, 0x88(%rsp)
xorps %xmm0, %xmm0
movsd %xmm0, 0x90(%rsp)
movq 0x80(%rsp), %rdx
movl $0x1, %eax
movl $0x5, %ecx
cmpq $0x989680, %rdx         # imm = 0x989680
cmovbl %ecx, %eax
cltq
movq %rax, 0x30(%rsp)
movl $0x0, 0x2c(%rsp)
movslq 0x2c(%rsp), %rax
cmpq 0x30(%rsp), %rax
jae 0x23b3
movq 0x80(%rsp), %rdi
movq 0x40(%rsp), %rsi
movq 0x38(%rsp), %rdx
leaq 0x48(%rsp), %rax
movq (%rax), %rcx
movq %rcx, (%rsp)
movq 0x8(%rax), %rcx
movq %rcx, 0x8(%rsp)
movq 0x10(%rax), %rax
movq %rax, 0x10(%rsp)
callq 0x1cb0
movsd %xmm0, 0x18(%rsp)
movsd %xmm1, 0x20(%rsp)
movsd 0x20(%rsp), %xmm0
addsd 0x90(%rsp), %xmm0
movsd %xmm0, 0x90(%rsp)
movsd 0x18(%rsp), %xmm0
addsd 0x88(%rsp), %xmm0
movsd %xmm0, 0x88(%rsp)
movl 0x2c(%rsp), %eax
addl $0x1, %eax
movl %eax, 0x2c(%rsp)
jmp 0x2322
movq 0x30(%rsp), %xmm3
movaps 0x3c50(%rip), %xmm2     # 0x6010
punpckldq %xmm2, %xmm3    # xmm3 = xmm3[0],xmm2[0],xmm3[1],xmm2[1]
movapd 0x3c54(%rip), %xmm0     # 0x6020
subpd %xmm0, %xmm3
movaps %xmm3, %xmm1
unpckhpd %xmm3, %xmm3            # xmm3 = xmm3[1,1]
addsd %xmm1, %xmm3
movsd 0x88(%rsp), %xmm1
divsd %xmm3, %xmm1
movsd %xmm1, 0x88(%rsp)
movq 0x30(%rsp), %xmm1
punpckldq %xmm2, %xmm1    # xmm1 = xmm1[0],xmm2[0],xmm1[1],xmm2[1]
subpd %xmm0, %xmm1
movaps %xmm1, %xmm0
unpckhpd %xmm1, %xmm1            # xmm1 = xmm1[1,1]
addsd %xmm0, %xmm1
movsd 0x90(%rsp), %xmm0
divsd %xmm1, %xmm0
movsd %xmm0, 0x90(%rsp)
movq 0x38(%rsp), %rdi
callq 0x3b00
movsd 0x88(%rsp), %xmm0
movsd 0x90(%rsp), %xmm1
addq $0x98, %rsp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/FastFilter[P]BlockBloomSimulator/src/bitset.h
// Function: bitset_set_word
static inline bool bitset_set_word(const bitset_t *bitset,  uint64_t w, size_t i) {
  if (i >= bitset->arraysize) {
    return false;
  }
  bitset->array[i] = w;
  return true;
}

// Assembly:
movq %rdi, -0x10(%rsp)
movq %rsi, -0x18(%rsp)
movq %rdx, -0x20(%rsp)
movq -0x20(%rsp), %rax
movq -0x10(%rsp), %rcx
cmpq 0x8(%rcx), %rax
jb 0x2b56
movb $0x0, -0x1(%rsp)
jmp 0x2b71
movq -0x18(%rsp), %rdx
movq -0x10(%rsp), %rax
movq (%rax), %rax
movq -0x20(%rsp), %rcx
movq %rdx, (%rax,%rcx,8)
movb $0x1, -0x1(%rsp)
movb -0x1(%rsp), %al
andb $0x1, %al
retq
nopl (%rax,%rax)