// File: /workspace/github_c_makefile_star2_O0/deplinenoise[P]tundra/src/DagGenerator.cpp
// Function: t2::CompileDag(t2::JsonObjectValue const*, t2::BinaryWriter*, t2::MemAllocHeap*, t2::MemAllocLinear*)
static bool CompileDag(const JsonObjectValue* root, BinaryWriter* writer, MemAllocHeap* heap, MemAllocLinear* scratch)
{
  printf("compiling mmapable DAG data..\n");

  HashTable<CommonStringRecord, kFlagCaseSensitive> shared_strings;
  HashTableInit(&shared_strings, heap);

  BinarySegment         *main_seg      = BinaryWriterAddSegment(writer);
  BinarySegment         *node_guid_seg = BinaryWriterAddSegment(writer);
  BinarySegment         *node_data_seg = BinaryWriterAddSegment(writer);
  BinarySegment         *aux_seg       = BinaryWriterAddSegment(writer);
  BinarySegment         *aux2_seg      = BinaryWriterAddSegment(writer);
  BinarySegment         *str_seg       = BinaryWriterAddSegment(writer);

  const JsonArrayValue  *nodes         = FindArrayValue(root, "Nodes");
  const JsonArrayValue  *passes        = FindArrayValue(root, "Passes");
  const JsonArrayValue  *scanners      = FindArrayValue(root, "Scanners");

  if (EmptyArray(nodes))
  {
    fprintf(stderr, "invalid Nodes data\n");
    return false;
  }

  if (EmptyArray(passes))
  {
    fprintf(stderr, "invalid Passes data\n");
    return false;
  }

  // Write scanners, store pointers
  BinaryLocator* scanner_ptrs = nullptr;

  if (!EmptyArray(scanners))
  {
    scanner_ptrs = (BinaryLocator*) alloca(sizeof(BinaryLocator) * scanners->m_Count);
    for (size_t i = 0, count = scanners->m_Count; i < count; ++i)
    {
      if (!WriteScanner(&scanner_ptrs[i], aux_seg, aux2_seg, str_seg, scanners->m_Values[i]->AsObject(), &shared_strings, scratch))
      {
        fprintf(stderr, "invalid scanner data\n");
        return false;
      }
    }
  }

  // Write magic number
  BinarySegmentWriteUint32(main_seg, DagData::MagicNumber);

  // Compute node guids and index remapping table.
  int32_t      *remap_table = HeapAllocateArray<int32_t>(heap, nodes->m_Count);
  TempNodeGuid *guid_table  = HeapAllocateArray<TempNodeGuid>(heap, nodes->m_Count);

  if (!ComputeNodeGuids(nodes, remap_table, guid_table))
    return false;

  // m_NodeCount
  size_t node_count = nodes->m_Count;
  BinarySegmentWriteInt32(main_seg, int(node_count));

  // Write node guids
  BinarySegmentWritePointer(main_seg, BinarySegmentPosition(node_guid_seg));  // m_NodeGuids
  for (size_t i = 0; i < node_count; ++i)
  {
    BinarySegmentWrite(node_guid_seg, (char*) &guid_table[i].m_Digest, sizeof guid_table[i].m_Digest);
  }

  // Write nodes.
  if (!WriteNodes(nodes, main_seg, node_data_seg, aux_seg, str_seg, scanner_ptrs, heap, &shared_strings, scratch, guid_table, remap_table))
    return false;

  // Write passes
  BinarySegmentWriteInt32(main_seg, (int) passes->m_Count);
  BinarySegmentWritePointer(main_seg, BinarySegmentPosition(aux_seg));
  for (size_t i = 0, count = passes->m_Count; i < count; ++i)
  {
    const char* pass_name = passes->m_Values[i]->GetString();
    if (!pass_name)
      return false;
    WriteStringPtr(aux_seg, str_seg, pass_name);
  }

  // Write configs
  const JsonObjectValue *setup       = FindObjectValue(root, "Setup");
  const JsonArrayValue  *configs     = FindArrayValue(setup, "Configs");
  const JsonArrayValue  *variants    = FindArrayValue(setup, "Variants");
  const JsonArrayValue  *subvariants = FindArrayValue(setup, "SubVariants");
  const JsonArrayValue  *tuples      = FindArrayValue(setup, "BuildTuples");

  if (nullptr == setup || EmptyArray(configs) || EmptyArray(variants) || EmptyArray(subvariants) || EmptyArray(tuples))
  {
    fprintf(stderr, "invalid Setup data\n");
    return false;
  }

  if (!WriteStrHashArray(main_seg, aux_seg, str_seg, configs))
  {
    fprintf(stderr, "invalid Setup.Configs data\n");
    return false;
  }

  if (!WriteStrHashArray(main_seg, aux_seg, str_seg, variants))
  {
    fprintf(stderr, "invalid Setup.Variants data\n");
    return false;
  }

  if (!WriteStrHashArray(main_seg, aux_seg, str_seg, subvariants))
  {
    fprintf(stderr, "invalid Setup.SubVariants data\n");
    return false;
  }

  BinarySegmentWriteInt32(main_seg, (int) tuples->m_Count);
  BinarySegmentWritePointer(main_seg, BinarySegmentPosition(aux_seg));

  for (size_t i = 0, count = tuples->m_Count; i < count; ++i)
  {
    const JsonObjectValue* obj = tuples->m_Values[i]->AsObject();
    if (!obj)
    {
      fprintf(stderr, "invalid Setup.BuildTuples[%d] data\n", (int) i);
      return false;
    }

    int                    config_index     = (int) FindIntValue(obj, "ConfigIndex", -1);
    int                    variant_index    = (int) FindIntValue(obj, "VariantIndex", -1);
    int                    subvariant_index = (int) FindIntValue(obj, "SubVariantIndex", -1);
    const JsonArrayValue  *default_nodes    = FindArrayValue(obj, "DefaultNodes");
    const JsonArrayValue  *always_nodes     = FindArrayValue(obj, "AlwaysNodes");
    const JsonObjectValue *named_nodes      = FindObjectValue(obj, "NamedNodes");

    if (config_index == -1 || variant_index == -1 || subvariant_index == -1 ||
        !default_nodes || !always_nodes)
    {
      fprintf(stderr, "invalid Setup.BuildTuples[%d] data\n", (int) i);
      return false;
    }

    BinarySegmentWriteInt32(aux_seg, config_index);
    BinarySegmentWriteInt32(aux_seg, variant_index);
    BinarySegmentWriteInt32(aux_seg, subvariant_index);

    if (!WriteNodeArray(aux_seg, aux2_seg, default_nodes, remap_table))
    {
      fprintf(stderr, "bad DefaultNodes data\n");
      return false;
    }

    if (!WriteNodeArray(aux_seg, aux2_seg, always_nodes, remap_table))
    {
      fprintf(stderr, "bad AlwaysNodes data\n");
      return false;
    }

    if (named_nodes)
    {
      size_t ncount = named_nodes->m_Count;
      BinarySegmentWriteInt32(aux_seg, (int) ncount);
      BinarySegmentWritePointer(aux_seg, BinarySegmentPosition(aux2_seg));
      for (size_t i = 0; i < ncount; ++i)
      {
        WriteStringPtr(aux2_seg, str_seg, named_nodes->m_Names[i]);
        const JsonNumberValue* node_index = named_nodes->m_Values[i]->AsNumber();
        if (!node_index)
        {
          fprintf(stderr, "named node index must be number\n");
          return false;
        }
        int remapped_index = remap_table[(int) node_index->m_Number];
        BinarySegmentWriteInt32(aux2_seg, remapped_index);
      }
    }
    else
    {
      BinarySegmentWriteInt32(aux_seg, 0);
      BinarySegmentWriteNullPointer(aux_seg);
    }
  }

  const JsonObjectValue* default_tuple = FindObjectValue(setup, "DefaultBuildTuple");
  if (!default_tuple)
  {
    fprintf(stderr, "missing Setup.DefaultBuildTuple\n");
    return false;
  }

  int def_config_index = (int) FindIntValue(default_tuple, "ConfigIndex", -2);
  int def_variant_index = (int) FindIntValue(default_tuple, "VariantIndex", -2);
  int def_subvariant_index = (int) FindIntValue(default_tuple, "SubVariantIndex", -2);

  if (-2 == def_config_index || -2 == def_variant_index || -2 == def_subvariant_index)
  {
    fprintf(stderr, "bad Setup.DefaultBuildTuple data\n");
    return false;
  }

  BinarySegmentWriteInt32(main_seg, def_config_index);
  BinarySegmentWriteInt32(main_seg, def_variant_index);
  BinarySegmentWriteInt32(main_seg, def_subvariant_index);

  if (const JsonArrayValue* file_sigs = FindArrayValue(root, "FileSignatures"))
  {
    size_t count = file_sigs->m_Count;
    BinarySegmentWriteInt32(main_seg, (int) count);
    BinarySegmentWritePointer(main_seg, BinarySegmentPosition(aux_seg));
    for (size_t i = 0; i < count; ++i)
    {
      if (const JsonObjectValue* sig = file_sigs->m_Values[i]->AsObject())
      {
        const char* path = FindStringValue(sig, "File");

        if (!path)
        {
          fprintf(stderr, "bad FileSignatures data (null path in File node)\n");
          return false;
        }

        int64_t timestamp = GetFileInfo(path).m_Timestamp;
        WriteStringPtr(aux_seg, str_seg, path);
        char padding[4] = { 0, 0, 0, 0 };
        BinarySegmentWrite(aux_seg, padding, 4);
        BinarySegmentWriteUint64(aux_seg, uint64_t(timestamp));
      }
      else
      {
        fprintf(stderr, "bad FileSignatures data (FileSignatures must contain objects)\n");
        return false;
      }
    }
  }
  else
  {
    BinarySegmentWriteInt32(main_seg, 0);
    BinarySegmentWriteNullPointer(main_seg);
  }

  if (const JsonArrayValue* glob_sigs = FindArrayValue(root, "GlobSignatures"))
  {
    size_t count = glob_sigs->m_Count;
    BinarySegmentWriteInt32(main_seg, (int) count);
    BinarySegmentWritePointer(main_seg, BinarySegmentPosition(aux_seg));
    for (size_t i = 0; i < count; ++i)
    {
      if (const JsonObjectValue* sig = glob_sigs->m_Values[i]->AsObject())
      {
        const char* path = FindStringValue(sig, "Path");
        if (!path)
        {
          fprintf(stderr, "bad GlobSignatures data\n");
          return false;
        }

        HashDigest digest = CalculateGlobSignatureFor(path, heap, scratch);

        WriteStringPtr(aux_seg, str_seg, path);
        BinarySegmentWrite(aux_seg, (char*) &digest, sizeof digest);
      }
    }
  }
  else
  {
    BinarySegmentWriteInt32(main_seg, 0);
    BinarySegmentWriteNullPointer(main_seg);
  }

  // Emit hashes of file extensions to sign using SHA-1 content digest instead of the normal timestamp signing.
  if (const JsonArrayValue* sha_exts = FindArrayValue(root, "ContentDigestExtensions"))
  {
    BinarySegmentWriteInt32(main_seg, (int) sha_exts->m_Count);
    BinarySegmentWritePointer(main_seg, BinarySegmentPosition(aux_seg));

    for (size_t i = 0, count = sha_exts->m_Count; i < count; ++i)
    {
      const JsonValue* v = sha_exts->m_Values[i];
      if (const JsonStringValue* sv = v->AsString())
      {
        const char* str = sv->m_String;
        if (str[0] != '.')
        {
          fprintf(stderr, "ContentDigestExtensions: Expected extension to start with dot: %s\b", str);
          return false;
        }

        BinarySegmentWriteUint32(aux_seg, Djb2Hash(str));
      }
      else
        return false;
    }
  }
  else
  {
    BinarySegmentWriteInt32(main_seg, 0);
    BinarySegmentWriteNullPointer(main_seg);
  }

  BinarySegmentWriteInt32(main_seg, (int) FindIntValue(root, "MaxExpensiveCount", -1));

  WriteStringPtr(main_seg, str_seg, FindStringValue(root, "StateFileName", ".tundra2.state"));
  WriteStringPtr(main_seg, str_seg, FindStringValue(root, "StateFileNameTmp", ".tundra2.state.tmp"));

  WriteStringPtr(main_seg, str_seg, FindStringValue(root, "ScanCacheFileName", ".tundra2.scancache"));
  WriteStringPtr(main_seg, str_seg, FindStringValue(root, "ScanCacheFileNameTmp", ".tundra2.scancache.tmp"));

  WriteStringPtr(main_seg, str_seg, FindStringValue(root, "DigestCacheFileName", ".tundra2.digestcache"));
  WriteStringPtr(main_seg, str_seg, FindStringValue(root, "DigestCacheFileNameTmp", ".tundra2.digestcache.tmp"));

  HashTableDestroy(&shared_strings);

  HeapFree(heap, guid_table);
  HeapFree(heap, remap_table);

  return true;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
subq $0x380, %rsp            # imm = 0x380
movq %rdi, -0x20(%rbp)
movq %rsi, -0x28(%rbp)
movq %rdx, -0x30(%rbp)
movq %rcx, -0x38(%rbp)
leaq 0x1b312(%rip), %rdi     # 0x240c7
movb $0x0, %al
callq 0x3060
movq -0x30(%rbp), %rsi
leaq -0x68(%rbp), %rdi
callq 0xba70
movq -0x28(%rbp), %rdi
callq 0x21190
movq %rax, -0x70(%rbp)
movq -0x28(%rbp), %rdi
callq 0x21190
movq %rax, -0x78(%rbp)
movq -0x28(%rbp), %rdi
callq 0x21190
movq %rax, -0x80(%rbp)
movq -0x28(%rbp), %rdi
callq 0x21190
movq %rax, -0x88(%rbp)
movq -0x28(%rbp), %rdi
callq 0x21190
movq %rax, -0x90(%rbp)
movq -0x28(%rbp), %rdi
callq 0x21190
movq %rax, -0x98(%rbp)
movq -0x20(%rbp), %rdi
leaq 0x1b3fb(%rip), %rsi     # 0x24226
callq 0x84e0
movq %rax, -0xa0(%rbp)
movq -0x20(%rbp), %rdi
leaq 0x1b2a4(%rip), %rsi     # 0x240e6
callq 0x84e0
movq %rax, -0xa8(%rbp)
movq -0x20(%rbp), %rdi
leaq 0x1b294(%rip), %rsi     # 0x240ed
callq 0x84e0
movq %rax, -0xb0(%rbp)
movq -0xa0(%rbp), %rdi
callq 0xa0a0
testb $0x1, %al
jne 0x8e77
jmp 0x8e98
movq 0x26152(%rip), %rax     # 0x2efd0
movq (%rax), %rdi
leaq 0x1b26e(%rip), %rsi     # 0x240f6
movb $0x0, %al
callq 0x3470
movb $0x0, -0x11(%rbp)
jmp 0xa091
movq -0xa8(%rbp), %rdi
callq 0xa0a0
testb $0x1, %al
jne 0x8eaa
jmp 0x8ecb
movq 0x2611f(%rip), %rax     # 0x2efd0
movq (%rax), %rdi
leaq 0x1b24f(%rip), %rsi     # 0x2410a
movb $0x0, %al
callq 0x3470
movb $0x0, -0x11(%rbp)
jmp 0xa091
movq $0x0, -0xb8(%rbp)
movq -0xb0(%rbp), %rdi
callq 0xa0a0
testb $0x1, %al
jne 0x9013
movq -0xb0(%rbp), %rax
movq 0x8(%rax), %rcx
shlq $0x4, %rcx
movq %rsp, %rax
subq %rcx, %rax
movq %rax, %rsp
movq %rax, -0xb8(%rbp)
movq $0x0, -0xc0(%rbp)
movq -0xb0(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0xc8(%rbp)
movq -0xc0(%rbp), %rax
cmpq -0xc8(%rbp), %rax
jae 0x9011
movq -0xb8(%rbp), %rax
movq -0xc0(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq %rax, -0x2e8(%rbp)
movq -0x88(%rbp), %rax
movq %rax, -0x2e0(%rbp)
movq -0x90(%rbp), %rax
movq %rax, -0x2d8(%rbp)
movq -0x98(%rbp), %rax
movq %rax, -0x2d0(%rbp)
movq -0xb0(%rbp), %rax
movq 0x10(%rax), %rax
movq -0xc0(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0xb850
movq -0x2e8(%rbp), %rdi
movq -0x2e0(%rbp), %rsi
movq -0x2d8(%rbp), %rdx
movq -0x2d0(%rbp), %rcx
movq %rax, %r8
movq -0x38(%rbp), %rax
leaq -0x68(%rbp), %r9
subq $0x10, %rsp
movq %rax, (%rsp)
callq 0xa0d0
addq $0x10, %rsp
testb $0x1, %al
jne 0x8ff8
movq 0x25ff2(%rip), %rax     # 0x2efd0
movq (%rax), %rdi
leaq 0x1b137(%rip), %rsi     # 0x2411f
movb $0x0, %al
callq 0x3470
movb $0x0, -0x11(%rbp)
jmp 0xa091
jmp 0x8ffa
movq -0xc0(%rbp), %rax
addq $0x1, %rax
movq %rax, -0xc0(%rbp)
jmp 0x8f26
jmp 0x9013
movq -0x70(%rbp), %rdi
movl $0x6d992313, %esi       # imm = 0x6D992313
callq 0xbaa0
movq -0x30(%rbp), %rdi
movq -0xa0(%rbp), %rax
movq 0x8(%rax), %rsi
callq 0x6890
movq %rax, -0xd0(%rbp)
movq -0x30(%rbp), %rdi
movq -0xa0(%rbp), %rax
movq 0x8(%rax), %rsi
callq 0xbad0
movq %rax, -0xd8(%rbp)
movq -0xa0(%rbp), %rdi
movq -0xd0(%rbp), %rsi
movq -0xd8(%rbp), %rdx
callq 0x8070
testb $0x1, %al
jne 0x907e
movb $0x0, -0x11(%rbp)
jmp 0xa091
movq -0xa0(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0xe0(%rbp)
movq -0x70(%rbp), %rdi
movq -0xe0(%rbp), %rax
movl %eax, %esi
callq 0xbb00
movq -0x70(%rbp), %rax
movq %rax, -0x2f0(%rbp)
movq -0x78(%rbp), %rdi
callq 0x20e20
movq -0x2f0(%rbp), %rdi
movl %eax, -0xf0(%rbp)
movq %rdx, -0xe8(%rbp)
movl -0xf0(%rbp), %esi
movq -0xe8(%rbp), %rdx
callq 0x20db0
movq $0x0, -0xf8(%rbp)
movq -0xf8(%rbp), %rax
cmpq -0xe0(%rbp), %rax
jae 0x912b
movq -0x78(%rbp), %rdi
movq -0xd8(%rbp), %rsi
imulq $0x14, -0xf8(%rbp), %rax
addq %rax, %rsi
movl $0x10, %edx
callq 0x20d70
movq -0xf8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0xf8(%rbp)
jmp 0x90e7
movq -0xa0(%rbp), %rdi
movq -0x70(%rbp), %rsi
movq -0x80(%rbp), %rdx
movq -0x88(%rbp), %rcx
movq -0x98(%rbp), %r8
movq -0xb8(%rbp), %r9
movq -0x30(%rbp), %r14
movq -0x38(%rbp), %r11
movq -0xd8(%rbp), %r10
movq -0xd0(%rbp), %rax
leaq -0x68(%rbp), %rbx
subq $0x30, %rsp
movq %r14, (%rsp)
movq %rbx, 0x8(%rsp)
movq %r11, 0x10(%rsp)
movq %r10, 0x18(%rsp)
movq %rax, 0x20(%rsp)
callq 0xa520
addq $0x30, %rsp
testb $0x1, %al
jne 0x919b
movb $0x0, -0x11(%rbp)
jmp 0xa091
movq -0x70(%rbp), %rdi
movq -0xa8(%rbp), %rax
movq 0x8(%rax), %rax
movl %eax, %esi
callq 0xbb00
movq -0x70(%rbp), %rax
movq %rax, -0x2f8(%rbp)
movq -0x88(%rbp), %rdi
callq 0x20e20
movq -0x2f8(%rbp), %rdi
movl %eax, -0x108(%rbp)
movq %rdx, -0x100(%rbp)
movl -0x108(%rbp), %esi
movq -0x100(%rbp), %rdx
callq 0x20db0
movq $0x0, -0x110(%rbp)
movq -0xa8(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x118(%rbp)
movq -0x110(%rbp), %rax
cmpq -0x118(%rbp), %rax
jae 0x927e
movq -0xa8(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x110(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0xbb30
movq %rax, -0x120(%rbp)
cmpq $0x0, -0x120(%rbp)
jne 0x9250
movb $0x0, -0x11(%rbp)
jmp 0xa091
movq -0x88(%rbp), %rdi
movq -0x98(%rbp), %rsi
movq -0x120(%rbp), %rdx
callq 0xb020
movq -0x110(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x110(%rbp)
jmp 0x920b
movq -0x20(%rbp), %rdi
leaq 0x1aeac(%rip), %rsi     # 0x24135
callq 0xb090
movq %rax, -0x128(%rbp)
movq -0x128(%rbp), %rdi
leaq 0x1ae98(%rip), %rsi     # 0x2413b
callq 0x84e0
movq %rax, -0x130(%rbp)
movq -0x128(%rbp), %rdi
leaq 0x1ae89(%rip), %rsi     # 0x24146
callq 0x84e0
movq %rax, -0x138(%rbp)
movq -0x128(%rbp), %rdi
leaq 0x1ae6c(%rip), %rsi     # 0x24143
callq 0x84e0
movq %rax, -0x140(%rbp)
movq -0x128(%rbp), %rdi
leaq 0x1ae5e(%rip), %rsi     # 0x2414f
callq 0x84e0
movq %rax, -0x148(%rbp)
xorl %eax, %eax
cmpq -0x128(%rbp), %rax
je 0x934a
movq -0x130(%rbp), %rdi
callq 0xa0a0
testb $0x1, %al
jne 0x934a
movq -0x138(%rbp), %rdi
callq 0xa0a0
testb $0x1, %al
jne 0x934a
movq -0x140(%rbp), %rdi
callq 0xa0a0
testb $0x1, %al
jne 0x934a
movq -0x148(%rbp), %rdi
callq 0xa0a0
testb $0x1, %al
jne 0x934a
jmp 0x936b
movq 0x25c7f(%rip), %rax     # 0x2efd0
movq (%rax), %rdi
leaq 0x1ae00(%rip), %rsi     # 0x2415b
movb $0x0, %al
callq 0x3470
movb $0x0, -0x11(%rbp)
jmp 0xa091
movq -0x70(%rbp), %rdi
movq -0x88(%rbp), %rsi
movq -0x98(%rbp), %rdx
movq -0x130(%rbp), %rcx
callq 0xb0f0
testb $0x1, %al
jne 0x93ae
movq 0x25c3c(%rip), %rax     # 0x2efd0
movq (%rax), %rdi
leaq 0x1add1(%rip), %rsi     # 0x2416f
movb $0x0, %al
callq 0x3470
movb $0x0, -0x11(%rbp)
jmp 0xa091
movq -0x70(%rbp), %rdi
movq -0x88(%rbp), %rsi
movq -0x98(%rbp), %rdx
movq -0x138(%rbp), %rcx
callq 0xb0f0
testb $0x1, %al
jne 0x93f1
movq 0x25bf9(%rip), %rax     # 0x2efd0
movq (%rax), %rdi
leaq 0x1adaa(%rip), %rsi     # 0x2418b
movb $0x0, %al
callq 0x3470
movb $0x0, -0x11(%rbp)
jmp 0xa091
movq -0x70(%rbp), %rdi
movq -0x88(%rbp), %rsi
movq -0x98(%rbp), %rdx
movq -0x140(%rbp), %rcx
callq 0xb0f0
testb $0x1, %al
jne 0x9434
movq 0x25bb6(%rip), %rax     # 0x2efd0
movq (%rax), %rdi
leaq 0x1ad84(%rip), %rsi     # 0x241a8
movb $0x0, %al
callq 0x3470
movb $0x0, -0x11(%rbp)
jmp 0xa091
movq -0x70(%rbp), %rdi
movq -0x148(%rbp), %rax
movq 0x8(%rax), %rax
movl %eax, %esi
callq 0xbb00
movq -0x70(%rbp), %rax
movq %rax, -0x300(%rbp)
movq -0x88(%rbp), %rdi
callq 0x20e20
movq -0x300(%rbp), %rdi
movl %eax, -0x158(%rbp)
movq %rdx, -0x150(%rbp)
movl -0x158(%rbp), %esi
movq -0x150(%rbp), %rdx
callq 0x20db0
movq $0x0, -0x160(%rbp)
movq -0x148(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x168(%rbp)
movq -0x160(%rbp), %rax
cmpq -0x168(%rbp), %rax
jae 0x985e
movq -0x148(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x160(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0xb850
movq %rax, -0x170(%rbp)
cmpq $0x0, -0x170(%rbp)
jne 0x950e
movq 0x25ae5(%rip), %rax     # 0x2efd0
movq (%rax), %rdi
movq -0x160(%rbp), %rax
movl %eax, %edx
leaq 0x1acca(%rip), %rsi     # 0x241c8
movb $0x0, %al
callq 0x3470
movb $0x0, -0x11(%rbp)
jmp 0xa091
movq -0x170(%rbp), %rdi
leaq 0x1acd0(%rip), %rsi     # 0x241ec
movq $-0x1, %rdx
callq 0xb250
movl %eax, -0x174(%rbp)
movq -0x170(%rbp), %rdi
leaq 0x1acbf(%rip), %rsi     # 0x241fb
movq $-0x1, %rdx
callq 0xb250
movl %eax, -0x178(%rbp)
movq -0x170(%rbp), %rdi
leaq 0x1ac9c(%rip), %rsi     # 0x241f8
movq $-0x1, %rdx
callq 0xb250
movl %eax, -0x17c(%rbp)
movq -0x170(%rbp), %rdi
leaq 0x1ac8c(%rip), %rsi     # 0x24208
callq 0x84e0
movq %rax, -0x188(%rbp)
movq -0x170(%rbp), %rdi
leaq 0x1ac7f(%rip), %rsi     # 0x24215
callq 0x84e0
movq %rax, -0x190(%rbp)
movq -0x170(%rbp), %rdi
leaq 0x1ac71(%rip), %rsi     # 0x24221
callq 0xb090
movq %rax, -0x198(%rbp)
cmpl $-0x1, -0x174(%rbp)
je 0x95eb
cmpl $-0x1, -0x178(%rbp)
je 0x95eb
cmpl $-0x1, -0x17c(%rbp)
je 0x95eb
cmpq $0x0, -0x188(%rbp)
je 0x95eb
cmpq $0x0, -0x190(%rbp)
jne 0x9615
movq 0x259de(%rip), %rax     # 0x2efd0
movq (%rax), %rdi
movq -0x160(%rbp), %rax
movl %eax, %edx
leaq 0x1abc3(%rip), %rsi     # 0x241c8
movb $0x0, %al
callq 0x3470
movb $0x0, -0x11(%rbp)
jmp 0xa091
movq -0x88(%rbp), %rdi
movl -0x174(%rbp), %esi
callq 0xbb00
movq -0x88(%rbp), %rdi
movl -0x178(%rbp), %esi
callq 0xbb00
movq -0x88(%rbp), %rdi
movl -0x17c(%rbp), %esi
callq 0xbb00
movq -0x88(%rbp), %rdi
movq -0x90(%rbp), %rsi
movq -0x188(%rbp), %rdx
movq -0xd0(%rbp), %rcx
callq 0xb2c0
testb $0x1, %al
jne 0x9691
movq 0x25959(%rip), %rax     # 0x2efd0
movq (%rax), %rdi
leaq 0x1abab(%rip), %rsi     # 0x2422c
movb $0x0, %al
callq 0x3470
movb $0x0, -0x11(%rbp)
jmp 0xa091
movq -0x88(%rbp), %rdi
movq -0x90(%rbp), %rsi
movq -0x190(%rbp), %rdx
movq -0xd0(%rbp), %rcx
callq 0xb2c0
testb $0x1, %al
jne 0x96d7
movq 0x25913(%rip), %rax     # 0x2efd0
movq (%rax), %rdi
leaq 0x1ab7c(%rip), %rsi     # 0x24243
movb $0x0, %al
callq 0x3470
movb $0x0, -0x11(%rbp)
jmp 0xa091
cmpq $0x0, -0x198(%rbp)
je 0x982b
movq -0x198(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x1a0(%rbp)
movq -0x88(%rbp), %rdi
movq -0x1a0(%rbp), %rax
movl %eax, %esi
callq 0xbb00
movq -0x88(%rbp), %rax
movq %rax, -0x308(%rbp)
movq -0x90(%rbp), %rdi
callq 0x20e20
movq -0x308(%rbp), %rdi
movl %eax, -0x1b0(%rbp)
movq %rdx, -0x1a8(%rbp)
movl -0x1b0(%rbp), %esi
movq -0x1a8(%rbp), %rdx
callq 0x20db0
movq $0x0, -0x1b8(%rbp)
movq -0x1b8(%rbp), %rax
cmpq -0x1a0(%rbp), %rax
jae 0x9829
movq -0x90(%rbp), %rdi
movq -0x98(%rbp), %rsi
movq -0x198(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x1b8(%rbp), %rcx
movq (%rax,%rcx,8), %rdx
callq 0xb020
movq -0x198(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x1b8(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0xbb60
movq %rax, -0x1c0(%rbp)
cmpq $0x0, -0x1c0(%rbp)
jne 0x97e1
movq 0x25809(%rip), %rax     # 0x2efd0
movq (%rax), %rdi
leaq 0x1aa88(%rip), %rsi     # 0x24259
movb $0x0, %al
callq 0x3470
movb $0x0, -0x11(%rbp)
jmp 0xa091
movq -0xd0(%rbp), %rax
movq -0x1c0(%rbp), %rcx
cvttsd2si 0x8(%rcx), %ecx
movslq %ecx, %rcx
movl (%rax,%rcx,4), %eax
movl %eax, -0x1c4(%rbp)
movq -0x90(%rbp), %rdi
movl -0x1c4(%rbp), %esi
callq 0xbb00
movq -0x1b8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x1b8(%rbp)
jmp 0x9757
jmp 0x9845
movq -0x88(%rbp), %rdi
xorl %esi, %esi
callq 0xbb00
movq -0x88(%rbp), %rdi
callq 0xbba0
jmp 0x9847
movq -0x160(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x160(%rbp)
jmp 0x94a4
movq -0x128(%rbp), %rdi
leaq 0x1aa0e(%rip), %rsi     # 0x2427a
callq 0xb090
movq %rax, -0x1d0(%rbp)
cmpq $0x0, -0x1d0(%rbp)
jne 0x98a3
movq 0x25747(%rip), %rax     # 0x2efd0
movq (%rax), %rdi
leaq 0x1a9f9(%rip), %rsi     # 0x2428c
movb $0x0, %al
callq 0x3470
movb $0x0, -0x11(%rbp)
jmp 0xa091
movq -0x1d0(%rbp), %rdi
leaq 0x1a93b(%rip), %rsi     # 0x241ec
movq $-0x2, %rdx
callq 0xb250
movl %eax, -0x1d4(%rbp)
movq -0x1d0(%rbp), %rdi
leaq 0x1a92a(%rip), %rsi     # 0x241fb
movq $-0x2, %rdx
callq 0xb250
movl %eax, -0x1d8(%rbp)
movq -0x1d0(%rbp), %rdi
leaq 0x1a907(%rip), %rsi     # 0x241f8
movq $-0x2, %rdx
callq 0xb250
movl %eax, -0x1dc(%rbp)
movl $0xfffffffe, %eax       # imm = 0xFFFFFFFE
cmpl -0x1d4(%rbp), %eax
je 0x992a
movl $0xfffffffe, %eax       # imm = 0xFFFFFFFE
cmpl -0x1d8(%rbp), %eax
je 0x992a
movl $0xfffffffe, %eax       # imm = 0xFFFFFFFE
cmpl -0x1dc(%rbp), %eax
jne 0x994b
movq 0x2569f(%rip), %rax     # 0x2efd0
movq (%rax), %rdi
leaq 0x1a972(%rip), %rsi     # 0x242ad
movb $0x0, %al
callq 0x3470
movb $0x0, -0x11(%rbp)
jmp 0xa091
movq -0x70(%rbp), %rdi
movl -0x1d4(%rbp), %esi
callq 0xbb00
movq -0x70(%rbp), %rdi
movl -0x1d8(%rbp), %esi
callq 0xbb00
movq -0x70(%rbp), %rdi
movl -0x1dc(%rbp), %esi
callq 0xbb00
movq -0x20(%rbp), %rdi
leaq 0x1a94c(%rip), %rsi     # 0x242cf
callq 0x84e0
movq %rax, -0x1e8(%rbp)
cmpq $0x0, -0x1e8(%rbp)
je 0x9b4d
movq -0x1e8(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x1f0(%rbp)
movq -0x70(%rbp), %rdi
movq -0x1f0(%rbp), %rax
movl %eax, %esi
callq 0xbb00
movq -0x70(%rbp), %rax
movq %rax, -0x310(%rbp)
movq -0x88(%rbp), %rdi
callq 0x20e20
movq -0x310(%rbp), %rdi
movl %eax, -0x200(%rbp)
movq %rdx, -0x1f8(%rbp)
movl -0x200(%rbp), %esi
movq -0x1f8(%rbp), %rdx
callq 0x20db0
movq $0x0, -0x208(%rbp)
movq -0x208(%rbp), %rax
cmpq -0x1f0(%rbp), %rax
jae 0x9b4b
movq -0x1e8(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x208(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0xb850
movq %rax, -0x210(%rbp)
cmpq $0x0, -0x210(%rbp)
je 0x9b11
movq -0x210(%rbp), %rdi
leaq 0x1a883(%rip), %rsi     # 0x242de
xorl %eax, %eax
movl %eax, %edx
callq 0x8460
movq %rax, -0x218(%rbp)
cmpq $0x0, -0x218(%rbp)
jne 0x9a96
movq 0x25554(%rip), %rax     # 0x2efd0
movq (%rax), %rdi
leaq 0x1a85d(%rip), %rsi     # 0x242e3
movb $0x0, %al
callq 0x3470
movb $0x0, -0x11(%rbp)
jmp 0xa091
movq -0x218(%rbp), %rsi
leaq -0x238(%rbp), %rdi
callq 0x16920
movq -0x228(%rbp), %rax
movq %rax, -0x220(%rbp)
movq -0x88(%rbp), %rdi
movq -0x98(%rbp), %rsi
movq -0x218(%rbp), %rdx
callq 0xb020
leaq -0x23c(%rbp), %rdi
xorl %esi, %esi
movl $0x4, %edx
callq 0x31c0
movq -0x88(%rbp), %rdi
leaq -0x23c(%rbp), %rsi
movl $0x4, %edx
callq 0x20d70
movq -0x88(%rbp), %rdi
movq -0x220(%rbp), %rsi
callq 0xbbc0
jmp 0x9b32
movq 0x254b8(%rip), %rax     # 0x2efd0
movq (%rax), %rdi
leaq 0x1a7f3(%rip), %rsi     # 0x24315
movb $0x0, %al
callq 0x3470
movb $0x0, -0x11(%rbp)
jmp 0xa091
jmp 0x9b34
movq -0x208(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x208(%rbp)
jmp 0x9a09
jmp 0x9b61
movq -0x70(%rbp), %rdi
xorl %esi, %esi
callq 0xbb00
movq -0x70(%rbp), %rdi
callq 0xbba0
movq -0x20(%rbp), %rdi
leaq 0x1a7e8(%rip), %rsi     # 0x24354
callq 0x84e0
movq %rax, -0x248(%rbp)
cmpq $0x0, -0x248(%rbp)
je 0x9cee
movq -0x248(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x250(%rbp)
movq -0x70(%rbp), %rdi
movq -0x250(%rbp), %rax
movl %eax, %esi
callq 0xbb00
movq -0x70(%rbp), %rax
movq %rax, -0x318(%rbp)
movq -0x88(%rbp), %rdi
callq 0x20e20
movq -0x318(%rbp), %rdi
movl %eax, -0x260(%rbp)
movq %rdx, -0x258(%rbp)
movl -0x260(%rbp), %esi
movq -0x258(%rbp), %rdx
callq 0x20db0
movq $0x0, -0x268(%rbp)
movq -0x268(%rbp), %rax
cmpq -0x250(%rbp), %rax
jae 0x9cec
movq -0x248(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x268(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0xb850
movq %rax, -0x270(%rbp)
cmpq $0x0, -0x270(%rbp)
je 0x9cd3
movq -0x270(%rbp), %rdi
leaq 0x1a71f(%rip), %rsi     # 0x24363
xorl %eax, %eax
movl %eax, %edx
callq 0x8460
movq %rax, -0x278(%rbp)
cmpq $0x0, -0x278(%rbp)
jne 0x9c7f
movq 0x2536b(%rip), %rax     # 0x2efd0
movq (%rax), %rdi
leaq 0x1a6f9(%rip), %rsi     # 0x24368
movb $0x0, %al
callq 0x3470
movb $0x0, -0x11(%rbp)
jmp 0xa091
movq -0x278(%rbp), %rdi
movq -0x30(%rbp), %rsi
movq -0x38(%rbp), %rdx
callq 0x20390
movq %rax, -0x288(%rbp)
movq %rdx, -0x280(%rbp)
movq -0x88(%rbp), %rdi
movq -0x98(%rbp), %rsi
movq -0x278(%rbp), %rdx
callq 0xb020
movq -0x88(%rbp), %rdi
leaq -0x288(%rbp), %rsi
movl $0x10, %edx
callq 0x20d70
jmp 0x9cd5
movq -0x268(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x268(%rbp)
jmp 0x9bf2
jmp 0x9d02
movq -0x70(%rbp), %rdi
xorl %esi, %esi
callq 0xbb00
movq -0x70(%rbp), %rdi
callq 0xbba0
movq -0x20(%rbp), %rdi
leaq 0x1a674(%rip), %rsi     # 0x24381
callq 0x84e0
movq %rax, -0x290(%rbp)
cmpq $0x0, -0x290(%rbp)
je 0x9e7c
movq -0x70(%rbp), %rdi
movq -0x290(%rbp), %rax
movq 0x8(%rax), %rax
movl %eax, %esi
callq 0xbb00
movq -0x70(%rbp), %rax
movq %rax, -0x320(%rbp)
movq -0x88(%rbp), %rdi
callq 0x20e20
movq -0x320(%rbp), %rdi
movl %eax, -0x2a0(%rbp)
movq %rdx, -0x298(%rbp)
movl -0x2a0(%rbp), %esi
movq -0x298(%rbp), %rdx
callq 0x20db0
movq $0x0, -0x2a8(%rbp)
movq -0x290(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x2b0(%rbp)
movq -0x2a8(%rbp), %rax
cmpq -0x2b0(%rbp), %rax
jae 0x9e7a
movq -0x290(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x2a8(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x2b8(%rbp)
movq -0x2b8(%rbp), %rdi
callq 0xb890
movq %rax, -0x2c0(%rbp)
cmpq $0x0, -0x2c0(%rbp)
je 0x9e58
movq -0x2c0(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x2c8(%rbp)
movq -0x2c8(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x2e, %eax
je 0x9e2e
movq 0x251c3(%rip), %rax     # 0x2efd0
movq (%rax), %rdi
movq -0x2c8(%rbp), %rdx
leaq 0x1a57b(%rip), %rsi     # 0x24399
movb $0x0, %al
callq 0x3470
movb $0x0, -0x11(%rbp)
jmp 0xa091
movq -0x88(%rbp), %rax
movq %rax, -0x328(%rbp)
movq -0x2c8(%rbp), %rdi
callq 0x7860
movq -0x328(%rbp), %rdi
movl %eax, %esi
callq 0xbaa0
jmp 0x9e61
movb $0x0, -0x11(%rbp)
jmp 0xa091
jmp 0x9e63
movq -0x2a8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x2a8(%rbp)
jmp 0x9d97
jmp 0x9e90
movq -0x70(%rbp), %rdi
xorl %esi, %esi
callq 0xbb00
movq -0x70(%rbp), %rdi
callq 0xbba0
movq -0x70(%rbp), %rax
movq %rax, -0x390(%rbp)
movq -0x20(%rbp), %rdi
leaq 0x1a536(%rip), %rsi     # 0x243dc
movq $-0x1, %rdx
callq 0xb250
movq -0x390(%rbp), %rdi
movl %eax, %esi
callq 0xbb00
movq -0x70(%rbp), %rax
movq %rax, -0x388(%rbp)
movq -0x98(%rbp), %rax
movq %rax, -0x380(%rbp)
movq -0x20(%rbp), %rdi
leaq 0x1a50a(%rip), %rsi     # 0x243ee
leaq 0x1a511(%rip), %rdx     # 0x243fc
callq 0x8460
movq -0x388(%rbp), %rdi
movq -0x380(%rbp), %rsi
movq %rax, %rdx
callq 0xb020
movq -0x70(%rbp), %rax
movq %rax, -0x378(%rbp)
movq -0x98(%rbp), %rax
movq %rax, -0x370(%rbp)
movq -0x20(%rbp), %rdi
leaq 0x1a4e1(%rip), %rsi     # 0x2440b
leaq 0x1a4eb(%rip), %rdx     # 0x2441c
callq 0x8460
movq -0x378(%rbp), %rdi
movq -0x370(%rbp), %rsi
movq %rax, %rdx
callq 0xb020
movq -0x70(%rbp), %rax
movq %rax, -0x368(%rbp)
movq -0x98(%rbp), %rax
movq %rax, -0x360(%rbp)
movq -0x20(%rbp), %rdi
leaq 0x1a4bf(%rip), %rsi     # 0x2442f
leaq 0x1a4ca(%rip), %rdx     # 0x24441
callq 0x8460
movq -0x368(%rbp), %rdi
movq -0x360(%rbp), %rsi
movq %rax, %rdx
callq 0xb020
movq -0x70(%rbp), %rax
movq %rax, -0x358(%rbp)
movq -0x98(%rbp), %rax
movq %rax, -0x350(%rbp)
movq -0x20(%rbp), %rdi
leaq 0x1a49e(%rip), %rsi     # 0x24454
leaq 0x1a4ac(%rip), %rdx     # 0x24469
callq 0x8460
movq -0x358(%rbp), %rdi
movq -0x350(%rbp), %rsi
movq %rax, %rdx
callq 0xb020
movq -0x70(%rbp), %rax
movq %rax, -0x348(%rbp)
movq -0x98(%rbp), %rax
movq %rax, -0x340(%rbp)
movq -0x20(%rbp), %rdi
leaq 0x1a484(%rip), %rsi     # 0x24480
leaq 0x1a491(%rip), %rdx     # 0x24494
callq 0x8460
movq -0x348(%rbp), %rdi
movq -0x340(%rbp), %rsi
movq %rax, %rdx
callq 0xb020
movq -0x70(%rbp), %rax
movq %rax, -0x338(%rbp)
movq -0x98(%rbp), %rax
movq %rax, -0x330(%rbp)
movq -0x20(%rbp), %rdi
leaq 0x1a467(%rip), %rsi     # 0x244a9
leaq 0x1a477(%rip), %rdx     # 0x244c0
callq 0x8460
movq -0x338(%rbp), %rdi
movq -0x330(%rbp), %rsi
movq %rax, %rdx
callq 0xb020
leaq -0x68(%rbp), %rdi
callq 0xbbf0
movq -0x30(%rbp), %rdi
movq -0xd8(%rbp), %rsi
callq 0x18960
movq -0x30(%rbp), %rdi
movq -0xd0(%rbp), %rsi
callq 0x18960
movb $0x1, -0x11(%rbp)
movb -0x11(%rbp), %al
andb $0x1, %al
leaq -0x10(%rbp), %rsp
popq %rbx
popq %r14
popq %rbp
retq
nop