// File: /workspace/github_c_makefile_star2_O2/deplinenoise[P]tundra/src/Driver.cpp
// Function: t2::DriverShowTargets(t2::Driver*)
void DriverShowTargets(Driver* self)
{
  const DagData* dag = self->m_DagData;

  printf("%-20s %-20s %-20s\n", "Config", "Variant", "SubVariant");
  printf("----------------------------------------------------------------\n");

  for (const BuildTupleData& tuple : dag->m_BuildTuples)
  {
    const char* config_name = dag->m_ConfigNames[tuple.m_ConfigIndex];
    const char* variant_name = dag->m_VariantNames[tuple.m_VariantIndex];
    const char* subvariant_name = dag->m_SubVariantNames[tuple.m_SubVariantIndex];
    printf("%-20s %-20s %-20s\n", config_name, variant_name, subvariant_name);
  }

  printf("\nNamed nodes and aliases:\n");
  printf("----------------------------------------------------------------\n");

  for (const BuildTupleData& tuple : dag->m_BuildTuples)
  {
    int32_t count = tuple.m_NamedNodes.GetCount();
    const char** temp = (const char**)alloca(sizeof(const char*) * count);
    for (int i = 0; i < count; ++i)
    {
      temp[i] = tuple.m_NamedNodes[i].m_Name.Get();
    }
    std::sort(temp, temp + count, [](const char *a, const char *b) { return strcmp(a, b) < 0; });

    for (int i = 0; i < count; ++i)
    {
      printf(" - %s\n", temp[i]);
    }
    // Currently the named nodes are the same for all build tuples.
    // We just need one.
    break;
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq 0xa0(%rdi), %rbx
leaq 0xbc15(%rip), %rdi      # 0x1458b
leaq 0xbc21(%rip), %rsi      # 0x1459e
leaq 0xbc24(%rip), %rdx      # 0x145a8
leaq 0xbc1a(%rip), %rcx      # 0x145a5
xorl %eax, %eax
callq 0x3060
leaq 0xc08d(%rip), %rdi      # 0x14a26
callq 0x3540
leaq 0x40(%rbx), %rax
movq %rax, -0x30(%rbp)
movslq 0x40(%rbx), %rax
testq %rax, %rax
leaq 0x40(%rax,%rbx), %r12
cmoveq %rax, %r12
movslq 0x3c(%rbx), %rax
leaq 0x1c(%rbx), %r13
leaq 0x28(%rbx), %r15
movq %rbx, -0x38(%rbp)
addq $0x34, %rbx
imulq $0x24, %rax, %r14
testq %r14, %r14
je 0x8a5e
movslq (%r13), %rax
leaq (%rax,%r13), %rcx
testq %rax, %rax
cmoveq %rax, %rcx
movslq (%r12), %rax
leaq (%rcx,%rax,4), %rsi
movslq (%rsi), %rax
addq %rax, %rsi
testq %rax, %rax
cmoveq %rax, %rsi
movslq (%r15), %rax
leaq (%rax,%r15), %rcx
testq %rax, %rax
cmoveq %rax, %rcx
movslq 0x4(%r12), %rax
leaq (%rcx,%rax,4), %rdx
movslq (%rdx), %rax
addq %rax, %rdx
testq %rax, %rax
cmoveq %rax, %rdx
movslq (%rbx), %rax
leaq (%rax,%rbx), %rcx
testq %rax, %rax
cmoveq %rax, %rcx
movslq 0x8(%r12), %rax
leaq (%rcx,%rax,4), %rcx
movslq (%rcx), %rax
addq %rax, %rcx
testq %rax, %rax
cmoveq %rax, %rcx
leaq 0xbb41(%rip), %rdi      # 0x1458b
xorl %eax, %eax
callq 0x3060
addq $0x24, %r12
addq $-0x24, %r14
jmp 0x89ce
leaq 0xbfa7(%rip), %rdi      # 0x14a0c
callq 0x3540
leaq 0xbfb5(%rip), %rdi      # 0x14a26
callq 0x3540
movq -0x38(%rbp), %rax
cmpl $0x0, 0x3c(%rax)
je 0x8b7c
movq -0x30(%rbp), %rdi
movslq (%rdi), %rax
addq %rax, %rdi
testq %rax, %rax
cmoveq %rax, %rdi
movslq 0x1c(%rdi), %r12
leaq 0xf(,%r12,8), %rax
andq $-0x10, %rax
movq %rsp, %rbx
subq %rax, %rbx
movq %rbx, %rsp
addq $0x20, %rdi
xorl %eax, %eax
testl %r12d, %r12d
movl $0x0, %r15d
cmovgl %r12d, %r15d
leaq (,%r15,8), %rcx
cmpq %rax, %rcx
je 0x8af7
movslq (%rdi), %rdx
leaq (%rdx,%rdi), %rsi
testq %rdx, %rdx
cmoveq %rdx, %rsi
movslq (%rsi,%rax), %rdx
addq %rax, %rsi
addq %rdx, %rsi
testq %rdx, %rdx
cmoveq %rdx, %rsi
movq %rsi, (%rbx,%rax)
addq $0x8, %rax
jmp 0x8ac9
testl %r12d, %r12d
je 0x8b5a
leaq (%rbx,%r12,8), %r14
bsrq %r12, %rdx
xorl $0x3f, %edx
addl %edx, %edx
xorq $0x7e, %rdx
movq %rbx, %rdi
movq %r14, %rsi
callq 0xaa99
cmpl $0x11, %r12d
jl 0x8b4f
leaq 0x80(%rbx), %r14
movq %rbx, %rdi
movq %r14, %rsi
callq 0xad2a
leaq -0x80(,%r12,8), %r12
testq %r12, %r12
je 0x8b5a
movq %r14, %rdi
callq 0xad93
addq $0x8, %r14
addq $-0x8, %r12
jmp 0x8b38
movq %rbx, %rdi
movq %r14, %rsi
callq 0xad2a
leaq 0xba4f(%rip), %r14      # 0x145b0
xorl %r12d, %r12d
cmpq %r12, %r15
je 0x8b7c
movq (%rbx,%r12,8), %rsi
movq %r14, %rdi
xorl %eax, %eax
callq 0x3060
incq %r12
jmp 0x8b64
leaq -0x28(%rbp), %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq