// File: /workspace/github_c_makefile_star2_O1/canboat[P]canboat/analyzer/analyzer.c
// Function: main
int main(int argc, char **argv)
{
  int    r;
  char   msg[2000];
  FILE  *file = stdin;
  int    ac   = argc;
  char **av   = argv;

  setProgName(argv[0]);

  for (; ac > 1; ac--, av++)
  {
    if (strcasecmp(av[1], "-version") == 0)
    {
      printf("%s\n", VERSION);
      exit(0);
    }
    else if (strcasecmp(av[1], "-schema-version") == 0)
    {
      printf("%s\n", SCHEMA_VERSION);
      exit(0);
    }
    else if (strcasecmp(av[1], "-camel") == 0)
    {
      showCamel = true;
      camelCase(false);
    }
    else if (strcasecmp(av[1], "-upper-camel") == 0)
    {
      camelCase(true);
    }
    else if (strcasecmp(av[1], "-raw") == 0)
    {
      showRaw = true;
    }
    else if (strcasecmp(av[1], "-debug") == 0)
    {
      showJsonEmpty = true;
      showBytes     = true;
    }
    else if (strcasecmp(av[1], "-debugdata") == 0)
    {
      showJsonEmpty = true;
      showAllBytes  = true;
    }
    else if (strcasecmp(av[1], "-d") == 0)
    {
      setLogLevel(LOGLEVEL_DEBUG);
    }
    else if (strcasecmp(av[1], "-q") == 0)
    {
      setLogLevel(LOGLEVEL_ERROR);
    }
    else if (ac > 2 && strcasecmp(av[1], "-geo") == 0)
    {
      if (strcasecmp(av[2], "dd") == 0)
      {
        showGeo = GEO_DD;
      }
      else if (strcasecmp(av[2], "dm") == 0)
      {
        showGeo = GEO_DM;
      }
      else if (strcasecmp(av[2], "dms") == 0)
      {
        showGeo = GEO_DMS;
      }
      else
      {
        usage(argv, av + 1);
      }
      ac--;
      av++;
    }
    else if (strcasecmp(av[1], "-si") == 0)
    {
      showSI = true;
    }
    else if (strcasecmp(av[1], "-nosi") == 0)
    {
      showSI = false;
    }
    else if (strcasecmp(av[1], "-json") == 0)
    {
      showJson = true;
    }
    else if (strcasecmp(av[1], "-empty") == 0)
    {
      showJsonEmpty = true;
      showJson      = true;
    }
    else if (strcasecmp(av[1], "-nv") == 0)
    {
      showJsonValue = true;
      showJson      = true;
    }
    else if (strcasecmp(av[1], "-data") == 0)
    {
      showData = true;
    }
    else if (ac > 2 && strcasecmp(av[1], "-fixtime") == 0)
    {
      setFixedTimestamp(av[2]);
      if (strstr(av[2], "n2kd") == NULL)
      {
        showVersion = false;
      }
      ac--;
      av++;
    }
    else if (ac > 2 && strcasecmp(av[1], "-src") == 0)
    {
      onlySrc = strtol(av[2], 0, 10);
      ac--;
      av++;
    }
    else if (ac > 2 && strcasecmp(av[1], "-dst") == 0)
    {
      onlyDst = strtol(av[2], 0, 10);
      ac--;
      av++;
    }
#ifndef SKIP_SETSYSTEMCLOCK
    else if (ac > 2 && strcasecmp(av[1], "-clocksrc") == 0)
    {
      clockSrc = strtol(av[2], 0, 10);
      ac--;
      av++;
    }
#endif
    else if (ac > 2 && strcasecmp(av[1], "-file") == 0)
    {
      file = fopen(av[2], "r");
      if (!file)
      {
        logAbort("Cannot open file %s\n", av[2]);
      }
      ac--;
      av++;
    }
    else if (ac > 2 && strcasecmp(av[1], "-format") == 0)
    {
      for (size_t i = 1; i < ARRAY_SIZE(RAW_FORMAT_STR); i++)
      {
        if (strcasecmp(av[2], RAW_FORMAT_STR[i]) == 0)
        {
          format = (enum RawFormats) i;
          if (format != RAWFORMAT_PLAIN && format != RAWFORMAT_PLAIN_OR_FAST && format != RAWFORMAT_PLAIN_MIX_FAST
              && format != RAWFORMAT_YDWG02)
          {
            multiPackets = MULTIPACKETS_COALESCED;
          }
          break;
        }
      }
      if (format == RAWFORMAT_UNKNOWN)
      {
        logAbort("Unknown message format '%s'\n", av[2]);
      }
      ac--;
      av++;
    }

    else
    {
      onlyPgn = strtol(av[1], 0, 10);
      if (onlyPgn > 0)
      {
        logInfo("Only logging PGN %d\n", onlyPgn);
      }
      else
      {
        usage(argv, av + 1);
      }
    }
  }

  if (!showJson)
  {
    logInfo("N2K packet analyzer\n" COPYRIGHT);
  }
  else if (showVersion)
  {
    printf("{\"version\":\"%s\",\"units\":\"%s\",\"showLookupValues\":%s",
           VERSION,
           showSI ? "si" : "std",
           showJsonValue ? "true" : "false");
    if (showCamel)
    {
      printf(",\"showUniqueId\":true");
    }
    printf("}\n");
  }

  fillLookups();
  fillFieldType(true);
  checkPgnList();

  while (fgets(msg, sizeof(msg) - 1, file))
  {
    RawMessage m;

    if (*msg == 0 || *msg == '\r' || *msg == '\n' || *msg == '#')
    {
      if (*msg == '#')
      {
        if (strncmp(msg + 1, "SHOWBUFFERS", STRSIZE("SHOWBUFFERS")) == 0)
        {
          showBuffers();
        }
      }

      continue;
    }

    if (format == RAWFORMAT_UNKNOWN)
    {
      format = detectFormat(msg);
      if (format == RAWFORMAT_GARMIN_CSV1 || format == RAWFORMAT_GARMIN_CSV2)
      {
        // Skip first line containing header line
        continue;
      }
    }

    switch (format)
    {
      case RAWFORMAT_PLAIN_OR_FAST:
        if (getMessageByteCount(msg) <= 8)
        {
          r = parseRawFormatPlain(msg, &m, showJson);
          logDebug("plain_or_fast: plain r=%d\n", r);
        }
        else
        {
          r = parseRawFormatFast(msg, &m, showJson);
          if (r >= 0)
          {
            format       = RAWFORMAT_FAST;
            multiPackets = MULTIPACKETS_COALESCED;
            logDebug("plain_or_fast: fast r=%d\n", r);
          }
        }
        break;

      case RAWFORMAT_PLAIN_MIX_FAST:
        if (getMessageByteCount(msg) <= 8)
        {
          r = parseRawFormatPlain(msg, &m, showJson);
          logDebug("plain_or_fast: plain r=%d\n", r);
        }
        else
        {
          r = parseRawFormatFast(msg, &m, showJson);
          logDebug("plain_or_fast: fast r=%d\n", r);
        }
        break;

      case RAWFORMAT_PLAIN:
        r = parseRawFormatPlain(msg, &m, showJson);
        break;

      case RAWFORMAT_FAST:
        r = parseRawFormatFast(msg, &m, showJson);
        break;

      case RAWFORMAT_AIRMAR:
        r = parseRawFormatAirmar(msg, &m, showJson);
        break;

      case RAWFORMAT_CHETCO:
        r = parseRawFormatChetco(msg, &m, showJson);
        break;

      case RAWFORMAT_GARMIN_CSV1:
      case RAWFORMAT_GARMIN_CSV2:
        r = parseRawFormatGarminCSV(msg, &m, showJson, format == RAWFORMAT_GARMIN_CSV2);
        break;

      case RAWFORMAT_YDWG02:
        r = parseRawFormatYDWG02(msg, &m, showJson);
        break;

      case RAWFORMAT_ACTISENSE_N2K_ASCII:
        r = parseRawFormatActisenseN2KAscii(msg, &m, showJson);
        break;

      default:
        logError("Unknown message format\n");
        exit(1);
    }

    if (r == 0)
    {
      printCanFormat(&m);
      printCanRaw(&m);
    }
    else
    {
      logError("Unknown message error %d: '%s'\n", r, msg);
    }
  }

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x958, %rsp            # imm = 0x958
movq %rsi, %r14
movl %edi, %r15d
movq 0x283c6(%rip), %rax     # 0x35fd0
movq (%rax), %rax
movq %rax, 0x30(%rsp)
movq (%rsi), %rdi
callq 0x19cd6
cmpl $0x2, %r15d
jl 0xe0b3
leaq 0x11688(%rip), %r13     # 0x1f2b3
leaq 0x1169d(%rip), %rbp     # 0x1f2cf
movq %r14, 0x10(%rsp)
movq 0x8(%r14), %rbx
movq %rbx, %rdi
leaq 0x11675(%rip), %rsi     # 0x1f2ba
callq 0xd060
testl %eax, %eax
je 0xeaa8
movq %rbx, %rdi
movq %r13, %rsi
callq 0xd060
testl %eax, %eax
je 0xeab1
movq %rbx, %rdi
movq %rbp, %rsi
callq 0xd060
testl %eax, %eax
je 0xdde6
movq %rbx, %rdi
leaq 0x11647(%rip), %rsi     # 0x1f2c9
callq 0xd060
testl %eax, %eax
je 0xddf1
movq %rbx, %rdi
leaq 0x1163d(%rip), %rsi     # 0x1f2d6
callq 0xd060
testl %eax, %eax
je 0xde1b
movq %rbx, %rdi
leaq 0x1162b(%rip), %rsi     # 0x1f2db
callq 0xd060
testl %eax, %eax
je 0xde24
movq %rbx, %rdi
leaq 0x1161b(%rip), %rsi     # 0x1f2e2
callq 0xd060
testl %eax, %eax
je 0xde34
movq %rbx, %rdi
leaq 0x1160f(%rip), %rsi     # 0x1f2ed
callq 0xd060
testl %eax, %eax
je 0xde44
movq %rbx, %rdi
leaq 0x115fb(%rip), %rsi     # 0x1f2f0
callq 0xd060
testl %eax, %eax
je 0xde4b
leaq 0x8(%r14), %r12
cmpl $0x2, %r15d
je 0xdd23
movq %rbx, %rdi
leaq 0x115dd(%rip), %rsi     # 0x1f2f3
callq 0xd060
testl %eax, %eax
je 0xde69
movq %rbx, %rdi
leaq 0x115d5(%rip), %rsi     # 0x1f302
callq 0xd060
testl %eax, %eax
je 0xde57
movq %rbx, %rdi
leaq 0x115c2(%rip), %rsi     # 0x1f306
callq 0xd060
testl %eax, %eax
je 0xde60
movq %rbx, %rdi
leaq 0x115b1(%rip), %rsi     # 0x1f30c
callq 0xd060
testl %eax, %eax
je 0xdeb0
movq %rbx, %rdi
leaq 0x115a0(%rip), %rsi     # 0x1f312
callq 0xd060
testl %eax, %eax
je 0xdebc
movq %rbx, %rdi
leaq 0x11590(%rip), %rsi     # 0x1f319
callq 0xd060
testl %eax, %eax
je 0xdeca
movq %rbx, %rdi
leaq 0x1157d(%rip), %rsi     # 0x1f31d
callq 0xd060
testl %eax, %eax
je 0xdef0
cmpl $0x2, %r15d
jne 0xdefc
movq %rbx, %rdi
xorl %esi, %esi
movl $0xa, %edx
callq 0xd1f0
movl %eax, 0x7b508(%rip)     # 0x892d4
testl %eax, %eax
jle 0xeadc
leaq 0x115aa(%rip), %rdi     # 0x1f385
movl %eax, %esi
xorl %eax, %eax
callq 0x19984
jmp 0xddfb
movb $0x1, 0x7b4df(%rip)     # 0x892cc
xorl %edi, %edi
jmp 0xddf6
movl $0x1, %edi
callq 0xd9ca
movq %r14, %r12
leal -0x1(%r15), %eax
addq $0x8, %r12
movq %r12, %r14
cmpl $0x2, %r15d
movl %eax, %r15d
jg 0xdc37
jmp 0xe0b3
movb $0x1, 0x7b4a2(%rip)     # 0x892c4
jmp 0xddfb
movb $0x1, %al
movb %al, 0x7b49d(%rip)      # 0x892c9
movb %al, 0x7b494(%rip)      # 0x892c6
jmp 0xddfb
movb $0x1, %al
movb %al, 0x7b48d(%rip)      # 0x892c9
movb %al, 0x7b485(%rip)      # 0x892c7
jmp 0xddfb
movl $0x3, %edi
jmp 0xde50
movl $0x1, %edi
callq 0x19cad
jmp 0xddfb
movb $0x1, 0x7b46d(%rip)     # 0x892cb
jmp 0xddfb
movb $0x0, 0x7b464(%rip)     # 0x892cb
jmp 0xddfb
movq 0x10(%r14), %rbx
movq %rbx, %rdi
leaq 0x11481(%rip), %rsi     # 0x1f2f8
callq 0xd060
testl %eax, %eax
je 0xdec6
movq %rbx, %rdi
leaq 0x11471(%rip), %rsi     # 0x1f2fb
callq 0xd060
testl %eax, %eax
je 0xdedd
movq %rbx, %rdi
leaq 0x11461(%rip), %rsi     # 0x1f2fe
callq 0xd060
movl $0x2, %ecx
testl %eax, %eax
je 0xdee2
jmp 0xeadc
movb $0x1, 0x7b411(%rip)     # 0x892c8
jmp 0xddfb
movb $0x1, %al
movb %al, 0x7b405(%rip)      # 0x892c9
jmp 0xded2
xorl %ecx, %ecx
jmp 0xdee2
movb $0x1, %al
movb %al, 0x7b3f8(%rip)      # 0x892ca
movb %al, 0x7b3f0(%rip)      # 0x892c8
jmp 0xddfb
movl $0x1, %ecx
movl %ecx, 0x7b3e8(%rip)     # 0x892d0
decl %r15d
jmp 0xddfe
movb $0x1, 0x7b3ce(%rip)     # 0x892c5
jmp 0xddfb
movq %rbx, %rdi
leaq 0x1141d(%rip), %rsi     # 0x1f323
callq 0xd060
testl %eax, %eax
je 0xdfbf
movq %rbx, %rdi
leaq 0x11414(%rip), %rsi     # 0x1f331
callq 0xd060
testl %eax, %eax
je 0xdfed
movq %rbx, %rdi
leaq 0x11402(%rip), %rsi     # 0x1f336
callq 0xd060
testl %eax, %eax
je 0xe008
movq %rbx, %rdi
leaq 0x113f0(%rip), %rsi     # 0x1f33b
callq 0xd060
testl %eax, %eax
je 0xe023
movq %rbx, %rdi
leaq 0x113e3(%rip), %rsi     # 0x1f345
callq 0xd060
testl %eax, %eax
je 0xe03e
movq %rbx, %rdi
leaq 0x113e7(%rip), %rsi     # 0x1f360
callq 0xd060
testl %eax, %eax
jne 0xddb7
movq 0x10(%r14), %rax
movq %rax, 0x28(%rsp)
movl $0x1, %ebx
leaq 0x751c5(%rip), %rax     # 0x83160
movq (%rax,%rbx,8), %rsi
movq 0x28(%rsp), %rdi
callq 0xd060
testl %eax, %eax
je 0xe069
incq %rbx
cmpq $0xb, %rbx
jne 0xdf94
jmp 0xe08f
movq 0x10(%r14), %rdi
callq 0x19d1f
movq 0x10(%r14), %rdi
leaq 0x11359(%rip), %rsi     # 0x1f32c
callq 0xd370
testq %rax, %rax
jne 0xdee8
movb $0x0, 0x751d4(%rip)     # 0x831bc
jmp 0xdee8
movq 0x10(%r14), %rdi
xorl %esi, %esi
movl $0xa, %edx
callq 0xd1f0
movl %eax, 0x751c5(%rip)     # 0x831c8
jmp 0xdee8
movq 0x10(%r14), %rdi
xorl %esi, %esi
movl $0xa, %edx
callq 0xd1f0
movl %eax, 0x751ae(%rip)     # 0x831cc
jmp 0xdee8
movq 0x10(%r14), %rdi
xorl %esi, %esi
movl $0xa, %edx
callq 0xd1f0
movl %eax, 0x75197(%rip)     # 0x831d0
jmp 0xdee8
movq 0x10(%r14), %rdi
leaq 0x1c913(%rip), %rsi     # 0x2a95c
callq 0xd2b0
movq %rax, 0x30(%rsp)
testq %rax, %rax
jne 0xdee8
movq 0x10(%r14), %rsi
leaq 0x112e4(%rip), %rdi     # 0x1f34b
jmp 0xe0a7
movl %ebx, 0x7b251(%rip)     # 0x892c0
movl %ebx, %eax
andl $0xd, %eax
cmpl $0x1, %eax
je 0xe08f
cmpq $0x4, %rbx
je 0xe08f
cmpq $0x9, %rbx
je 0xe08f
movl $0x0, 0x75129(%rip)     # 0x831b8
cmpl $0x0, 0x7b22a(%rip)     # 0x892c0
jne 0xdee8
movq 0x10(%r14), %rsi
leaq 0x112c1(%rip), %rdi     # 0x1f368
xorl %eax, %eax
callq 0x19bbb
jmp 0xdee8
cmpb $0x0, 0x7b20e(%rip)     # 0x892c8
je 0xe131
cmpb $0x1, 0x750f9(%rip)     # 0x831bc
jne 0xe13f
leaq 0x11237(%rip), %rax     # 0x1f303
leaq 0x115ca(%rip), %rdx     # 0x1f69d
cmpb $0x0, 0x7b1f1(%rip)     # 0x892cb
cmovneq %rax, %rdx
leaq 0x115d2(%rip), %rax     # 0x1f6b7
leaq 0x115b5(%rip), %rcx     # 0x1f6a1
cmpb $0x0, 0x7b1d7(%rip)     # 0x892ca
cmovneq %rax, %rcx
leaq 0x1156c(%rip), %rdi     # 0x1f66a
leaq 0x111a8(%rip), %rsi     # 0x1f2ad
xorl %eax, %eax
callq 0xd110
cmpb $0x1, 0x7b1b9(%rip)     # 0x892cc
jne 0xe123
leaq 0x1158b(%rip), %rdi     # 0x1f6a7
xorl %eax, %eax
callq 0xd110
leaq 0x1c40c(%rip), %rdi     # 0x2a536
callq 0xd0c0
jmp 0xe13f
leaq 0x11262(%rip), %rdi     # 0x1f39a
xorl %eax, %eax
callq 0x19984
callq 0x16c32
movl $0x1, %edi
callq 0x18e78
callq 0xd826
leaq 0x180(%rsp), %rdi
movl $0x7cf, %esi            # imm = 0x7CF
movq 0x30(%rsp), %rdx
callq 0xd1a0
testq %rax, %rax
je 0xea94
leaq 0x180(%rsp), %r15
leaq 0xf216(%rip), %r12      # 0x1d398
leaq 0x11c9d(%rip), %rbp     # 0x1fe26
leaq 0x11cd0(%rip), %r13     # 0x1fe60
movb 0x180(%rsp), %al
movzbl %al, %ecx
cmpl $0xc, %ecx
jg 0xe1b5
testl %ecx, %ecx
je 0xe8b7
cmpl $0xa, %ecx
je 0xe8b7
jmp 0xe24d
cmpl $0xd, %ecx
je 0xe8b7
cmpl $0x23, %ecx
jne 0xe24d
movq 0x181(%rsp), %rax
movabsq $0x46465542574f4853, %rcx # imm = 0x46465542574F4853
xorq %rcx, %rax
movq 0x184(%rsp), %rcx
movabsq $0x5352454646554257, %rdx # imm = 0x5352454646554257
xorq %rdx, %rcx
orq %rax, %rcx
jne 0xe8b7
leaq 0x7b1f7(%rip), %r14     # 0x893f8
xorl %ebx, %ebx
cmpb $0x1, (%r14)
jne 0xe22b
movl -0x8(%r14), %edx
movq -0xf8(%r14), %rcx
movl -0x10(%r14), %r8d
movl -0xc(%r14), %r9d
movq %rbp, %rdi
movq %rbx, %rsi
xorl %eax, %eax
callq 0x19b28
jmp 0xe238
movq %r13, %rdi
movq %rbx, %rsi
xorl %eax, %eax
callq 0x19a95
incq %rbx
addq $0x100, %r14            # imm = 0x100
cmpq $0x40, %rbx
jne 0xe203
jmp 0xe8b7
cmpl $0x0, 0x7b06c(%rip)     # 0x892c0
jne 0xe499
cmpb $0x24, %al
jne 0xe282
movl 0x180(%rsp), %eax
movl $0x44435024, %ecx       # imm = 0x44435024
xorl %ecx, %eax
movzwl 0x184(%rsp), %ecx
xorl $0x4e49, %ecx           # imm = 0x4E49
orl %eax, %ecx
je 0xe33e
movl $0x6b, %edx
movq %r15, %rdi
leaq 0x118af(%rip), %rsi     # 0x1fb40
callq 0xd250
testl %eax, %eax
je 0xe2fa
movl $0x9c, %edx
movq %r15, %rdi
leaq 0x11939(%rip), %rsi     # 0x1fbe2
callq 0xd250
testl %eax, %eax
je 0xe31c
movq %r15, %rdi
movl $0x20, %esi
callq 0xd100
testq %rax, %rax
je 0xe360
cmpb $0x2d, 0x1(%rax)
je 0xe2d8
cmpb $0x2d, 0x2(%rax)
jne 0xe360
leaq 0x119d6(%rip), %rdi     # 0x1fcb5
xorl %eax, %eax
callq 0x19984
movl $0x0, 0x74ec8(%rip)     # 0x831b8
movl $0x5, %ebx
jmp 0xe487
leaq 0x118aa(%rip), %rdi     # 0x1fbab
xorl %eax, %eax
callq 0x19984
movl $0x0, 0x74ea6(%rip)     # 0x831b8
movl $0x7, %ebx
jmp 0xe487
leaq 0x1195b(%rip), %rdi     # 0x1fc7e
xorl %eax, %eax
callq 0x19984
movl $0x0, 0x74e84(%rip)     # 0x831b8
movl $0x8, %ebx
jmp 0xe487
leaq 0x117c7(%rip), %rdi     # 0x1fb0c
xorl %eax, %eax
callq 0x19984
movl $0x0, 0x74e62(%rip)     # 0x831b8
movl $0x6, %ebx
jmp 0xe487
movq %r15, %rdi
callq 0xec4e
testl %eax, %eax
je 0xe397
cmpl $0x9, %eax
jb 0xe404
leaq 0x1196d(%rip), %rdi     # 0x1fce9
xorl %eax, %eax
callq 0x19984
movl $0x0, 0x74e2b(%rip)     # 0x831b8
movl $0x2, %ebx
jmp 0xe487
movq %r15, %rdi
leaq 0x119c9(%rip), %rsi     # 0x1fd6a
leaq 0x24(%rsp), %rdx
leaq 0x20(%rsp), %rcx
leaq 0x1c(%rsp), %r8
leaq 0x3c(%rsp), %r9
xorl %eax, %eax
leaq 0x54(%rsp), %r10
pushq %r10
leaq 0x17(%rsp), %r10
pushq %r10
callq 0xd240
addq $0x10, %rsp
cmpl $0x6, %eax
jne 0xe419
movzbl 0xf(%rsp), %eax
cmpl $0x54, %eax
je 0xe3e2
cmpl $0x52, %eax
jne 0xe419
leaq 0x11996(%rip), %rdi     # 0x1fd7f
xorl %eax, %eax
callq 0x19984
movl $0x1, 0x74dbe(%rip)     # 0x831b8
movl $0x9, %ebx
jmp 0xe487
leaq 0x11910(%rip), %rdi     # 0x1fd1b
xorl %eax, %eax
callq 0x19984
movl $0x3, %ebx
jmp 0xe487
movq %r15, %rdi
leaq 0x1198f(%rip), %rsi     # 0x1fdb2
leaq 0x24(%rsp), %rdx
leaq 0x20(%rsp), %rcx
leaq 0x1c(%rsp), %r8
leaq 0x3c(%rsp), %r9
xorl %eax, %eax
callq 0xd240
cmpl $0x4, %eax
je 0xe46a
xorl %ebx, %ebx
movq %r15, %rdi
leaq 0x11971(%rip), %rsi     # 0x1fdc0
leaq 0x24(%rsp), %rdx
leaq 0x20(%rsp), %rcx
leaq 0x1c(%rsp), %r8
xorl %eax, %eax
callq 0xd240
cmpl $0x3, %eax
jne 0xe487
leaq 0x1195a(%rip), %rdi     # 0x1fdcb
xorl %eax, %eax
callq 0x19984
movl $0x0, 0x74d36(%rip)     # 0x831b8
movl $0xa, %ebx
movl %ebx, 0x7ae33(%rip)     # 0x892c0
addl $-0x7, %ebx
cmpl $0x2, %ebx
jb 0xe8b7
movl 0x7ae21(%rip), %eax     # 0x892c0
leal -0x1(%rax), %ecx
cmpl $0x9, %ecx
ja 0xeac4
movslq (%r12,%rcx,4), %rcx
addq %r12, %rcx
jmpq *%rcx
movzbl 0x7ae0d(%rip), %edx     # 0x892c8
xorl %ecx, %ecx
cmpl $0x8, %eax
sete %cl
movq %r15, %rdi
leaq 0x58(%rsp), %rsi
callq 0x1b31a
jmp 0xe5dd
movzbl 0x7adec(%rip), %edx     # 0x892c8
movq %r15, %rdi
leaq 0x58(%rsp), %rsi
callq 0x1afa9
jmp 0xe5dd
movzbl 0x7add3(%rip), %edx     # 0x892c8
movq %r15, %rdi
leaq 0x58(%rsp), %rsi
callq 0x1b974
jmp 0xe5dd
movq %r15, %rdi
callq 0xec4e
movzbl 0x7adb2(%rip), %edx     # 0x892c8
cmpl $0x8, %eax
jbe 0xe56c
movq %r15, %rdi
leaq 0x58(%rsp), %rsi
callq 0x1adab
movl %eax, %ebx
testl %eax, %eax
js 0xe5df
movl $0x2, 0x7ad84(%rip)     # 0x892c0
movl $0x0, 0x74c72(%rip)     # 0x831b8
leaq 0x11196(%rip), %rdi     # 0x1f6e3
movl %ebx, %esi
jmp 0xe765
movq %r15, %rdi
callq 0xec4e
movzbl 0x7ad65(%rip), %edx     # 0x892c8
cmpl $0x8, %eax
ja 0xe74d
movq %r15, %rdi
leaq 0x58(%rsp), %rsi
callq 0x1abfc
movl %eax, %ebx
leaq 0x11146(%rip), %rdi     # 0x1f6c8
jmp 0xe763
movzbl 0x7ad3a(%rip), %edx     # 0x892c8
movq %r15, %rdi
leaq 0x58(%rsp), %rsi
callq 0x1abfc
jmp 0xe5dd
movzbl 0x7ad24(%rip), %edx     # 0x892c8
movq %r15, %rdi
leaq 0x58(%rsp), %rsi
callq 0x1adab
jmp 0xe5dd
movzbl 0x7ad0e(%rip), %edx     # 0x892c8
movq %r15, %rdi
leaq 0x58(%rsp), %rsi
callq 0x1b193
jmp 0xe5dd
movzbl 0x7acf8(%rip), %edx     # 0x892c8
movq %r15, %rdi
leaq 0x58(%rsp), %rsi
callq 0x1b64f
movl %eax, %ebx
testl %ebx, %ebx
je 0xe5fb
leaq 0x1112b(%rip), %rdi     # 0x1f715
movl %ebx, %esi
movq %r15, %rdx
xorl %eax, %eax
callq 0x19b28
jmp 0xe8b7
movl 0x74bc7(%rip), %eax     # 0x831c8
testl %eax, %eax
js 0xe615
movzbl 0x9d(%rsp), %ecx
cmpl %ecx, %eax
jne 0xe79a
movl 0x74bb1(%rip), %eax     # 0x831cc
testl %eax, %eax
js 0xe62f
movzbl 0x9c(%rsp), %ecx
cmpl %ecx, %eax
jne 0xe79a
movl 0x7ac9f(%rip), %eax     # 0x892d4
testl %eax, %eax
jle 0xe646
cmpl 0x98(%rsp), %eax
jne 0xe79a
movl 0x98(%rsp), %edi
callq 0xd4cc
cmpl $0x1, 0x74b5f(%rip)     # 0x831b8
sete %cl
testq %rax, %rax
sete %dl
andb %cl, %dl
cmpb $0x1, %dl
jne 0xe675
movl 0x98(%rsp), %edi
callq 0xd56d
cmpl $0x0, 0x74b3c(%rip)     # 0x831b8
je 0xe771
testq %rax, %rax
je 0xe771
cmpl $0x1, 0x10(%rax)
jne 0xe771
cmpb $0x8, 0x9e(%rsp)
ja 0xe771
movl 0x98(%rsp), %eax
movzbl 0x9d(%rsp), %ecx
leaq 0x7ac47(%rip), %r14     # 0x89300
xorl %ebx, %ebx
cmpb $0x1, 0xf8(%r14)
jne 0xe6d7
cmpl %eax, 0xf0(%r14)
jne 0xe6d7
cmpl %ecx, 0xf4(%r14)
je 0xe6f3
incq %rbx
addq $0x100, %r14            # imm = 0x100
cmpq $0x40, %rbx
jne 0xe6bb
movl $0x40, %ebx
leaq 0x7eb0d(%rip), %r14     # 0x8d200
cmpq $0x40, %rbx
jne 0xe907
leaq 0x7abfc(%rip), %r14     # 0x89300
xorl %ebx, %ebx
cmpb $0x1, 0xf8(%r14)
jne 0xe72c
incq %rbx
addq $0x100, %r14            # imm = 0x100
cmpq $0x40, %rbx
jne 0xe706
movl $0x40, %ebx
leaq 0x7ead4(%rip), %r14     # 0x8d200
cmpq $0x40, %rbx
jne 0xe8d7
movl 0x98(%rsp), %esi
leaq 0x11740(%rip), %rdi     # 0x1fe84
xorl %eax, %eax
callq 0x19b28
jmp 0xe79a
movq %r15, %rdi
leaq 0x58(%rsp), %rsi
callq 0x1adab
movl %eax, %ebx
leaq 0x10f80(%rip), %rdi     # 0x1f6e3
movl %eax, %esi
xorl %eax, %eax
callq 0x19a95
jmp 0xe5df
movzbl 0x9e(%rsp), %edx
movzbl 0x7ab45(%rip), %ecx     # 0x892c5
movzbl 0x7ab40(%rip), %r8d     # 0x892c8
leaq 0x58(%rsp), %rdi
leaq 0x9f(%rsp), %rsi
callq 0xecb6
movq 0x2781f(%rip), %rax     # 0x35fc0
movq (%rax), %rbx
movl 0x74a1e(%rip), %eax     # 0x831c8
testl %eax, %eax
js 0xe7be
movzbl 0x9d(%rsp), %ecx
cmpl %ecx, %eax
jne 0xe8b7
movl 0x74a08(%rip), %eax     # 0x831cc
testl %eax, %eax
js 0xe7d8
movzbl 0x9c(%rsp), %ecx
cmpl %ecx, %eax
jne 0xe8b7
movl 0x7aaf6(%rip), %eax     # 0x892d4
testl %eax, %eax
jle 0xe7ef
cmpl 0x98(%rsp), %eax
jne 0xe8b7
cmpb $0x0, 0x7aad2(%rip)     # 0x892c8
je 0xe802
movq 0x277f1(%rip), %rcx     # 0x35ff0
movq (%rcx), %rbx
cmpb $0x1, 0x7aabb(%rip)     # 0x892c4
jne 0xe8b7
testl %eax, %eax
je 0xe820
cmpl 0x98(%rsp), %eax
jne 0xe8b7
movzbl 0x94(%rsp), %ecx
movl 0x98(%rsp), %r8d
movzbl 0x9d(%rsp), %r9d
movzbl 0x9c(%rsp), %r10d
movzbl 0x9e(%rsp), %r11d
movq %rbx, %rdi
leaq 0x115b9(%rip), %rsi     # 0x1fe0e
leaq 0x58(%rsp), %rdx
xorl %eax, %eax
pushq %r11
pushq %r10
callq 0xd1e0
addq $0x10, %rsp
cmpb $0x0, 0x9e(%rsp)
leaq 0x115a8(%rip), %r12     # 0x1fe20
je 0xe8a3
xorl %r14d, %r14d
movzbl 0x9f(%rsp,%r14), %edx
movq %rbx, %rdi
movq %r12, %rsi
xorl %eax, %eax
callq 0xd1e0
incq %r14
movzbl 0x9e(%rsp), %eax
cmpq %rax, %r14
jb 0xe87d
movl $0xa, %edi
movq %rbx, %rsi
callq 0xd1b0
leaq 0xeae1(%rip), %r12      # 0x1d398
movq %r15, %rdi
movl $0x7cf, %esi            # imm = 0x7CF
movq 0x30(%rsp), %rdx
callq 0xd1a0
testq %rax, %rax
jne 0xe190
jmp 0xea94
movb $0x1, 0xf8(%r14)
movzbl 0x9d(%rsp), %eax
movl %eax, 0xf4(%r14)
movl 0x98(%rsp), %eax
movl %eax, 0xf0(%r14)
movl $0x0, 0xe8(%r14)
movzbl 0x9f(%rsp), %eax
xorl %r8d, %r8d
movl %eax, 0x10(%rsp)
movl %eax, %ecx
andl $0x1f, %ecx
movl %ecx, %eax
notl %eax
leal (%rax,%rcx,8), %eax
cmovel %ecx, %eax
movq %rax, 0x28(%rsp)
sete %dil
movl 0xe8(%r14), %eax
movl $0x1, %edx
shll %cl, %edx
movq %rdx, 0x48(%rsp)
movq %rcx, 0x40(%rsp)
btl %ecx, %eax
jae 0xe980
movl 0x98(%rsp), %esi
movzbl 0x9d(%rsp), %edx
movb %dil, 0xe(%rsp)
leaq 0x1154a(%rip), %rdi     # 0x1feb0
xorl %eax, %eax
callq 0x19b28
movb 0xe(%rsp), %dil
xorl %r8d, %r8d
movl $0x0, 0xe8(%r14)
leaq 0xa0(%rsp), %rsi
cmpl $0x0, 0x40(%rsp)
jne 0xe9d8
cmpl $0x0, 0xe8(%r14)
leaq 0xa1(%rsp), %rsi
jne 0xe9d8
movzbl 0xa0(%rsp), %esi
movq %rsi, %rax
movabsq $0x2492492492492493, %rcx # imm = 0x2492492492492493
mulq %rcx
movq %rdx, %rcx
movl $0x2, %eax
shlq %cl, %rax
movq %rsi, (%r14)
decl %eax
movl %eax, 0xec(%r14)
leaq 0xa1(%rsp), %rsi
andl $-0x20, 0x10(%rsp)
movb %dil, %r8b
xorq $0x7, %r8
movq 0x28(%rsp), %rax
leaq (%r14,%rax), %rdi
addq $0x8, %rdi
movq %r8, %rdx
callq 0xd200
movq 0x48(%rsp), %r11
orl 0xe8(%r14), %r11d
movl %r11d, 0xe8(%r14)
movl 0x98(%rsp), %edx
movq (%r14), %rcx
movl 0xec(%r14), %r10d
subq $0x8, %rsp
leaq 0x114bf(%rip), %rdi     # 0x1fee7
movq %rbx, %rsi
movq 0x48(%rsp), %r8
movl 0x18(%rsp), %r9d
xorl %eax, %eax
pushq %r10
pushq %r11
pushq 0x40(%rsp)
callq 0x19a95
addq $0x20, %rsp
movl 0xe8(%r14), %eax
cmpl 0xec(%r14), %eax
jne 0xe79a
leaq 0x8(%r14), %rsi
movl (%r14), %edx
movzbl 0x7a85b(%rip), %ecx     # 0x892c5
movzbl 0x7a856(%rip), %r8d     # 0x892c8
leaq 0x58(%rsp), %rdi
callq 0xecb6
movb $0x0, 0xf8(%r14)
movl $0x0, 0xe8(%r14)
jmp 0xe79a
xorl %eax, %eax
addq $0x958, %rsp            # imm = 0x958
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x107fe(%rip), %rdi     # 0x1f2ad
jmp 0xeab8
leaq 0x1080b(%rip), %rdi     # 0x1f2c3
callq 0xd0c0
xorl %edi, %edi
callq 0xd310
leaq 0x10c32(%rip), %rdi     # 0x1f6fd
xorl %eax, %eax
callq 0x19b28
movl $0x1, %edi
callq 0xd310
movq 0x10(%rsp), %rdi
movq %r12, %rsi
callq 0xeae9