// File: /workspace/github_c_makefile_star2_O0/canboat[P]canboat/analyzer/analyzer.c
// Function: showBytesOrBits
static void showBytesOrBits(const uint8_t *data, size_t startBit, size_t bits)
{
  int64_t     value;
  int64_t     maxValue;
  size_t      i;
  size_t      remaining_bits;
  const char *s;
  uint8_t     byte;

  logDebug("showBytesOrBits(%p, %zu, %zu)\n", data, startBit, bits);

  if (showJson)
  {
    size_t location = mlocation();

    if (location == 0 || mchr(location - 1) != '{')
    {
      mprintf(",");
    }
    mprintf("\"bytes\":\"");
  }
  else
  {
    mprintf(" (bytes = \"");
  }
  remaining_bits = bits;
  s              = "";
  for (i = 0; i < (bits + 7) >> 3; i++)
  {
    uint8_t byte = data[i];

    if (i == 0 && startBit != 0)
    {
      byte = byte >> startBit; // Shift off older bits
      if (remaining_bits + startBit < 8)
      {
        byte = byte & ((1 << remaining_bits) - 1);
      }
      byte = byte << startBit; // Shift zeros back in
      remaining_bits -= (8 - startBit);
    }
    else
    {
      if (remaining_bits < 8)
      {
        // only the lower remaining_bits should be used
        byte = byte & ((1 << remaining_bits) - 1);
      }
      remaining_bits -= 8;
    }
    mprintf("%s%2.02X", s, byte);
    s = " ";
  }
  mprintf("\"");

  if (startBit != 0 || ((bits & 7) != 0))
  {
    extractNumber(NULL, data, (bits + 7) >> 3, startBit, bits, &value, &maxValue);
    if (showJson)
    {
      mprintf(",\"bits\":\"");
    }
    else
    {
      mprintf(", bits = \"");
    }

    for (i = bits; i > 0;)
    {
      i--;
      byte = (value >> (i >> 3)) & 0xff;
      mprintf("%c", (byte & (1 << (i & 7))) ? '1' : '0');
    }
    mprintf("\"");
  }

  if (!showJson)
  {
    mprintf(")");
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x60, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x8(%rbp), %rsi
movq -0x10(%rbp), %rdx
movq -0x18(%rbp), %rcx
leaq 0x1bc6a(%rip), %rdi     # 0x2a7b1
movb $0x0, %al
callq 0x22570
testb $0x1, 0x857f3(%rip)     # 0x94348
je 0xeb9a
callq 0x1df10
movq %rax, -0x50(%rbp)
cmpq $0x0, -0x50(%rbp)
je 0xeb7c
movq -0x50(%rbp), %rdi
subq $0x1, %rdi
callq 0x1de00
movsbl %al, %eax
cmpl $0x7b, %eax
je 0xeb8a
leaq 0x2c7dd(%rip), %rdi     # 0x3b360
movb $0x0, %al
callq 0x1dce0
leaq 0x1bc3f(%rip), %rdi     # 0x2a7d0
movb $0x0, %al
callq 0x1dce0
jmp 0xeba8
leaq 0x1bc39(%rip), %rdi     # 0x2a7da
movb $0x0, %al
callq 0x1dce0
movq -0x18(%rbp), %rax
movq %rax, -0x38(%rbp)
leaq 0x1aab2(%rip), %rax     # 0x29669
movq %rax, -0x40(%rbp)
movq $0x0, -0x30(%rbp)
movq -0x30(%rbp), %rax
movq -0x18(%rbp), %rcx
addq $0x7, %rcx
shrq $0x3, %rcx
cmpq %rcx, %rax
jae 0xecad
movq -0x8(%rbp), %rax
movq -0x30(%rbp), %rcx
movb (%rax,%rcx), %al
movb %al, -0x51(%rbp)
cmpq $0x0, -0x30(%rbp)
jne 0xec4f
cmpq $0x0, -0x10(%rbp)
je 0xec4f
movzbl -0x51(%rbp), %eax
movq -0x10(%rbp), %rcx
sarl %cl, %eax
movb %al, -0x51(%rbp)
movq -0x38(%rbp), %rax
addq -0x10(%rbp), %rax
cmpq $0x8, %rax
jae 0xec2c
movzbl -0x51(%rbp), %eax
movq -0x38(%rbp), %rcx
movl $0x1, %edx
shll %cl, %edx
movl %edx, %ecx
subl $0x1, %ecx
andl %ecx, %eax
movb %al, -0x51(%rbp)
movzbl -0x51(%rbp), %eax
movq -0x10(%rbp), %rcx
shll %cl, %eax
movb %al, -0x51(%rbp)
movl $0x8, %ecx
subq -0x10(%rbp), %rcx
movq -0x38(%rbp), %rax
subq %rcx, %rax
movq %rax, -0x38(%rbp)
jmp 0xec7b
cmpq $0x8, -0x38(%rbp)
jae 0xec6f
movzbl -0x51(%rbp), %eax
movq -0x38(%rbp), %rcx
movl $0x1, %edx
shll %cl, %edx
movl %edx, %ecx
subl $0x1, %ecx
andl %ecx, %eax
movb %al, -0x51(%rbp)
movq -0x38(%rbp), %rax
subq $0x8, %rax
movq %rax, -0x38(%rbp)
movq -0x40(%rbp), %rsi
movzbl -0x51(%rbp), %edx
leaq 0x1bb5c(%rip), %rdi     # 0x2a7e6
movb $0x0, %al
callq 0x1dce0
leaq 0x1b2fe(%rip), %rax     # 0x29f96
movq %rax, -0x40(%rbp)
movq -0x30(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x30(%rbp)
jmp 0xebc3
leaq 0x1bb30(%rip), %rdi     # 0x2a7e4
movb $0x0, %al
callq 0x1dce0
cmpq $0x0, -0x10(%rbp)
jne 0xecd4
movq -0x18(%rbp), %rax
andq $0x7, %rax
cmpq $0x0, %rax
je 0xeda6
movq -0x8(%rbp), %rsi
movq -0x18(%rbp), %rdx
addq $0x7, %rdx
shrq $0x3, %rdx
movq -0x10(%rbp), %rcx
movq -0x18(%rbp), %r8
xorl %eax, %eax
movl %eax, %edi
leaq -0x20(%rbp), %r9
leaq -0x28(%rbp), %rax
movq %rax, (%rsp)
callq 0x1e050
testb $0x1, 0x85640(%rip)     # 0x94348
je 0xed1a
leaq 0x1bade(%rip), %rdi     # 0x2a7ef
movb $0x0, %al
callq 0x1dce0
jmp 0xed28
leaq 0x1bad8(%rip), %rdi     # 0x2a7f9
movb $0x0, %al
callq 0x1dce0
movq -0x18(%rbp), %rax
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
jbe 0xed98
movq -0x30(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x30(%rbp)
movq -0x20(%rbp), %rax
movq -0x30(%rbp), %rcx
shrq $0x3, %rcx
sarq %cl, %rax
andq $0xff, %rax
movb %al, -0x41(%rbp)
movzbl -0x41(%rbp), %eax
movl %eax, -0x58(%rbp)
movq -0x30(%rbp), %rax
andq $0x7, %rax
movl %eax, %ecx
movl $0x1, %eax
shll %cl, %eax
movl -0x58(%rbp), %ecx
andl %eax, %ecx
movl $0x30, %esi
movl $0x31, %eax
cmpl $0x0, %ecx
cmovnel %eax, %esi
leaq 0x1ab58(%rip), %rdi     # 0x298e7
movb $0x0, %al
callq 0x1dce0
jmp 0xed30
leaq 0x1ba45(%rip), %rdi     # 0x2a7e4
movb $0x0, %al
callq 0x1dce0
testb $0x1, 0x8559b(%rip)     # 0x94348
jne 0xedbd
leaq 0x29a7b(%rip), %rdi     # 0x38831
movb $0x0, %al
callq 0x1dce0
addq $0x60, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nopl (%rax)