// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/apps/scninfo/scninfo.cpp
// Function: PrintNodes(gaps::R3Scene*, gaps::R3SceneNode*, int, int)
static int
PrintNodes(R3Scene *scene, R3SceneNode *node, int index, int level)
{
  // Construct indent
  char indent[4096] = { '\0' };
  for (int i = 0; i < level; i++) {
    strcat(indent, "  ");
  }

  // Print node
  const char *name = node->Name();
  R3Box bbox = node->BBox();
  R3Point centroid = node->Centroid();
  R4Matrix m = node->Transformation().Matrix();
  printf("%sNode %s\n", indent, (name) ? name : "Null");
  printf("%s  Parent  = %s\n", indent, (node->Parent()) ? ((node->Parent()->Name()) ? node->Parent()->Name() : "NoName") : "None");
  printf("%s  Parent index = %d\n", indent, node->ParentIndex());
  printf("%s  Scene index = %d\n", indent, node->SceneIndex());
  printf("%s  # Elements = %d\n", indent, node->NElements());
  printf("%s  # References = %d\n", indent, node->NReferences());
  printf("%s  # Facets = %g\n", indent, node->NFacets().Mid());

  // Print properties
  printf("%s  Area = %g\n", indent, node->Area());
  printf("%s  Centroid = %g %g %g\n", indent, centroid[0], centroid[1], centroid[2]);
  printf("%s  BBox = ( %g %g %g ) ( %g %g %g )\n", indent, bbox[0][0], bbox[0][1], bbox[0][2], bbox[1][0], bbox[1][1], bbox[1][2]);

  // Print categories
  if (node->Info("index")) printf("%s  Category index = %s\n", indent, node->Info("index"));
  if (node->Info("model_id")) printf("%s  Category model id = %s\n", indent, node->Info("model_id"));
  if (node->Info("fine_grained_class")) printf("%s  Fine grained class = %s\n", indent, node->Info("fine_grained_class"));
  if (node->Info("coarse_grained_class")) printf("%s  Coarse grained class = %s\n", indent, node->Info("coarse_grained_class"));
  if (node->Info("nyuv2_40class")) printf("%s  NYUv2 40 class = %s\n", indent, node->Info("nyuv2_40class"));

  // Print transformation
  printf("%s  Transformation matrix = \n", indent);
  printf("%s    %12.3g %12.3g %12.3g %12.3g\n", indent, m[0][0], m[0][1], m[0][2], m[0][3]);
  printf("%s    %12.3g %12.3g %12.3g %12.3g\n", indent, m[1][0], m[1][1], m[1][2], m[1][3]);
  printf("%s    %12.3g %12.3g %12.3g %12.3g\n", indent, m[2][0], m[2][1], m[2][2], m[2][3]);
  printf("%s    %12.3g %12.3g %12.3g %12.3g\n", indent, m[3][0], m[3][1], m[3][2], m[3][3]);
  printf("\n");

  // Print elements
  if (print_elements) {
    for (int i = 0; i < node->NElements(); i++) {
      R3SceneElement *element = node->Element(i);
      if (!PrintElement(element, i, level+1)) return 0;
    }
  }

  // Print references
  if (print_references) {
    for (int i = 0; i < node->NReferences(); i++) {
      R3SceneReference *reference = node->Reference(i);
      if (!PrintReference(reference, i, level+1)) return 0;
    }
  }

  // Print children
  for (int i = 0; i < node->NChildren(); i++) {
    R3SceneNode *child = node->Child(i);
    if (!PrintNodes(scene, child, i, level+1)) return 0;
  }

  // Return success
  return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10f0, %rsp           # imm = 0x10F0
movl %esi, %ebx
movq %rdi, %r14
leaq 0xf0(%rsp), %rdi
movl $0x1000, %edx           # imm = 0x1000
xorl %esi, %esi
callq 0x21450
testl %ebx, %ebx
jle 0x25e48
leaq 0xf0(%rsp), %r15
movl %ebx, %ebp
movq %r15, %rdi
callq 0x21350
movw $0x2020, 0xf0(%rsp,%rax) # imm = 0x2020
movb $0x0, 0xf2(%rsp,%rax)
decl %ebp
jne 0x25e2a
movq 0x1a0(%r14), %r15
movq %r14, %rdi
callq 0x3af88
leaq 0x38(%rsp), %rdi
movq %rax, %rsi
callq 0x6c090
leaq 0x20(%rsp), %rdi
movq %r14, %rsi
callq 0x3b146
leaq 0x60(%r14), %rsi
leaq 0x70(%rsp), %rdi
callq 0x7115a
testq %r15, %r15
leaq 0xb5301(%rip), %rdx     # 0xdb18a
cmovneq %r15, %rdx
leaq 0xb52eb(%rip), %rdi     # 0xdb17f
leaq 0xf0(%rsp), %rsi
xorl %eax, %eax
callq 0x21080
movq 0x10(%r14), %rax
testq %rax, %rax
je 0x25ec3
movq 0x1a0(%rax), %rax
testq %rax, %rax
leaq 0xb52e4(%rip), %rdx     # 0xdb1a1
cmovneq %rax, %rdx
jmp 0x25eca
leaq 0xb52de(%rip), %rdx     # 0xdb1a8
leaq 0xb52be(%rip), %rdi     # 0xdb18f
leaq 0xf0(%rsp), %r15
movq %r15, %rsi
xorl %eax, %eax
callq 0x21080
movl 0x18(%r14), %edx
leaq 0xb52bf(%rip), %rdi     # 0xdb1ad
movq %r15, %rsi
xorl %eax, %eax
callq 0x21080
movl 0x8(%r14), %edx
leaq 0xb52c1(%rip), %rdi     # 0xdb1c4
movq %r15, %rsi
xorl %eax, %eax
callq 0x21080
movl 0x3c(%r14), %edx
leaq 0xb52c2(%rip), %rdi     # 0xdb1da
movq %r15, %rsi
xorl %eax, %eax
callq 0x21080
movl 0x4c(%r14), %edx
leaq 0xb52c2(%rip), %rdi     # 0xdb1ef
movq %r15, %rsi
xorl %eax, %eax
callq 0x21080
movq %rsp, %rdi
movq %r14, %rsi
callq 0x3a586
movsd (%rsp), %xmm0
addsd 0x8(%rsp), %xmm0
mulsd 0xb50bb(%rip), %xmm0    # 0xdb010
leaq 0xb52aa(%rip), %rdi     # 0xdb206
leaq 0xf0(%rsp), %rsi
movb $0x1, %al
callq 0x21080
movq %r14, %rdi
callq 0x3a732
leaq 0xb529f(%rip), %rdi     # 0xdb219
leaq 0xf0(%rsp), %r15
movq %r15, %rsi
movb $0x1, %al
callq 0x21080
movsd 0x20(%rsp), %xmm0
movsd 0x28(%rsp), %xmm1
movsd 0x30(%rsp), %xmm2
leaq 0xb5283(%rip), %rdi     # 0xdb228
movq %r15, %rsi
movb $0x3, %al
callq 0x21080
movsd 0x40(%rsp), %xmm0
movsd 0x48(%rsp), %xmm1
movsd 0x50(%rsp), %xmm2
movsd 0x58(%rsp), %xmm3
movsd 0x60(%rsp), %xmm4
movsd 0x68(%rsp), %xmm5
leaq 0xb5267(%rip), %rdi     # 0xdb241
movq %r15, %rsi
movb $0x6, %al
callq 0x21080
leaq 0x10(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0xc43d4(%rip), %rsi     # 0xea3c9
leaq 0xc43d2(%rip), %rdx     # 0xea3ce
movq %rsp, %rdi
callq 0x26c60
movq 0x50(%r14), %rdi
movq %rsp, %rsi
callq 0x26898
movq 0x50(%r14), %rcx
addq $0x8, %rcx
cmpq %rcx, %rax
je 0x26028
cmpq $0x0, 0x40(%rax)
sete %bpl
jmp 0x2602b
movb $0x1, %bpl
movq (%rsp), %rdi
cmpq %r12, %rdi
je 0x26041
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x21890
testb %bpl, %bpl
jne 0x260b0
movq %rsp, %rdi
movq %r12, (%rdi)
leaq 0xc4376(%rip), %rsi     # 0xea3c9
leaq 0xc4374(%rip), %rdx     # 0xea3ce
callq 0x26c60
movq 0x50(%r14), %rdi
movq %rsp, %rsi
callq 0x26898
movq 0x50(%r14), %rcx
addq $0x8, %rcx
cmpq %rcx, %rax
je 0x2607e
movq 0x40(%rax), %r15
jmp 0x26081
xorl %r15d, %r15d
movq (%rsp), %rdi
cmpq %r12, %rdi
je 0x26097
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x21890
leaq 0xb51c9(%rip), %rdi     # 0xdb267
leaq 0xf0(%rsp), %rsi
movq %r15, %rdx
xorl %eax, %eax
callq 0x21080
movq %rsp, %rdi
movq %r12, (%rdi)
leaq 0xb51c3(%rip), %rsi     # 0xdb280
leaq 0xb51c4(%rip), %rdx     # 0xdb288
callq 0x26c60
movq 0x50(%r14), %rdi
movq %rsp, %rsi
callq 0x26898
movq 0x50(%r14), %rcx
addq $0x8, %rcx
cmpq %rcx, %rax
je 0x260ed
cmpq $0x0, 0x40(%rax)
sete %bpl
jmp 0x260f0
movb $0x1, %bpl
movq (%rsp), %rdi
cmpq %r12, %rdi
je 0x26106
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x21890
testb %bpl, %bpl
jne 0x26175
movq %rsp, %rdi
movq %r12, (%rdi)
leaq 0xb5168(%rip), %rsi     # 0xdb280
leaq 0xb5169(%rip), %rdx     # 0xdb288
callq 0x26c60
movq 0x50(%r14), %rdi
movq %rsp, %rsi
callq 0x26898
movq 0x50(%r14), %rcx
addq $0x8, %rcx
cmpq %rcx, %rax
je 0x26143
movq 0x40(%rax), %r15
jmp 0x26146
xorl %r15d, %r15d
movq (%rsp), %rdi
cmpq %r12, %rdi
je 0x2615c
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x21890
leaq 0xb5126(%rip), %rdi     # 0xdb289
leaq 0xf0(%rsp), %rsi
movq %r15, %rdx
xorl %eax, %eax
callq 0x21080
movq %rsp, %rdi
movq %r12, (%rdi)
leaq 0xb5123(%rip), %rsi     # 0xdb2a5
leaq 0xb512e(%rip), %rdx     # 0xdb2b7
callq 0x26c60
movq 0x50(%r14), %rdi
movq %rsp, %rsi
callq 0x26898
movq 0x50(%r14), %rcx
addq $0x8, %rcx
cmpq %rcx, %rax
je 0x261b2
cmpq $0x0, 0x40(%rax)
sete %bpl
jmp 0x261b5
movb $0x1, %bpl
movq (%rsp), %rdi
cmpq %r12, %rdi
je 0x261cb
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x21890
testb %bpl, %bpl
jne 0x2623a
movq %rsp, %rdi
movq %r12, (%rdi)
leaq 0xb50c8(%rip), %rsi     # 0xdb2a5
leaq 0xb50d3(%rip), %rdx     # 0xdb2b7
callq 0x26c60
movq 0x50(%r14), %rdi
movq %rsp, %rsi
callq 0x26898
movq 0x50(%r14), %rcx
addq $0x8, %rcx
cmpq %rcx, %rax
je 0x26208
movq 0x40(%rax), %r15
jmp 0x2620b
xorl %r15d, %r15d
movq (%rsp), %rdi
cmpq %r12, %rdi
je 0x26221
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x21890
leaq 0xb5090(%rip), %rdi     # 0xdb2b8
leaq 0xf0(%rsp), %rsi
movq %r15, %rdx
xorl %eax, %eax
callq 0x21080
movq %rsp, %rdi
movq %r12, (%rdi)
leaq 0xb508e(%rip), %rsi     # 0xdb2d5
leaq 0xb509b(%rip), %rdx     # 0xdb2e9
callq 0x26c60
movq 0x50(%r14), %rdi
movq %rsp, %rsi
callq 0x26898
movq 0x50(%r14), %rcx
addq $0x8, %rcx
cmpq %rcx, %rax
je 0x26277
cmpq $0x0, 0x40(%rax)
sete %bpl
jmp 0x2627a
movb $0x1, %bpl
movq (%rsp), %rdi
cmpq %r12, %rdi
je 0x26290
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x21890
testb %bpl, %bpl
jne 0x262ff
movq %rsp, %rdi
movq %r12, (%rdi)
leaq 0xb5033(%rip), %rsi     # 0xdb2d5
leaq 0xb5040(%rip), %rdx     # 0xdb2e9
callq 0x26c60
movq 0x50(%r14), %rdi
movq %rsp, %rsi
callq 0x26898
movq 0x50(%r14), %rcx
addq $0x8, %rcx
cmpq %rcx, %rax
je 0x262cd
movq 0x40(%rax), %r15
jmp 0x262d0
xorl %r15d, %r15d
movq (%rsp), %rdi
cmpq %r12, %rdi
je 0x262e6
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x21890
leaq 0xb4ffd(%rip), %rdi     # 0xdb2ea
leaq 0xf0(%rsp), %rsi
movq %r15, %rdx
xorl %eax, %eax
callq 0x21080
movq %rsp, %rdi
movq %r12, (%rdi)
leaq 0xb4ffd(%rip), %rsi     # 0xdb309
leaq 0xb5003(%rip), %rdx     # 0xdb316
callq 0x26c60
movq 0x50(%r14), %rdi
movq %rsp, %rsi
callq 0x26898
movq 0x50(%r14), %rcx
addq $0x8, %rcx
cmpq %rcx, %rax
je 0x2633c
cmpq $0x0, 0x40(%rax)
sete %bpl
jmp 0x2633f
movb $0x1, %bpl
movq (%rsp), %rdi
cmpq %r12, %rdi
je 0x26355
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x21890
testb %bpl, %bpl
jne 0x263c4
movq %rsp, %rdi
movq %r12, (%rdi)
leaq 0xb4fa2(%rip), %rsi     # 0xdb309
leaq 0xb4fa8(%rip), %rdx     # 0xdb316
callq 0x26c60
movq 0x50(%r14), %rdi
movq %rsp, %rsi
callq 0x26898
movq 0x50(%r14), %rcx
addq $0x8, %rcx
cmpq %rcx, %rax
je 0x26392
movq 0x40(%rax), %r15
jmp 0x26395
xorl %r15d, %r15d
movq (%rsp), %rdi
cmpq %r12, %rdi
je 0x263ab
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x21890
leaq 0xb4f65(%rip), %rdi     # 0xdb317
leaq 0xf0(%rsp), %rsi
movq %r15, %rdx
xorl %eax, %eax
callq 0x21080
leaq 0xb4f65(%rip), %rdi     # 0xdb330
leaq 0xf0(%rsp), %r15
movq %r15, %rsi
xorl %eax, %eax
callq 0x21080
movsd 0x70(%rsp), %xmm0
movsd 0x78(%rsp), %xmm1
movsd 0x80(%rsp), %xmm2
movsd 0x88(%rsp), %xmm3
leaq 0xb4f4c(%rip), %r12     # 0xdb34e
movq %r12, %rdi
movq %r15, %rsi
movb $0x4, %al
callq 0x21080
movsd 0x90(%rsp), %xmm0
movsd 0x98(%rsp), %xmm1
movsd 0xa0(%rsp), %xmm2
movsd 0xa8(%rsp), %xmm3
movq %r12, %rdi
movq %r15, %rsi
movb $0x4, %al
callq 0x21080
movsd 0xb0(%rsp), %xmm0
movsd 0xb8(%rsp), %xmm1
movsd 0xc0(%rsp), %xmm2
movsd 0xc8(%rsp), %xmm3
movq %r12, %rdi
movq %r15, %rsi
movb $0x4, %al
callq 0x21080
movsd 0xd0(%rsp), %xmm0
movsd 0xd8(%rsp), %xmm1
movsd 0xe0(%rsp), %xmm2
movsd 0xe8(%rsp), %xmm3
movq %r12, %rdi
movq %r15, %rsi
movb $0x4, %al
callq 0x21080
movl $0xa, %edi
callq 0x21cb0
cmpb $0x1, 0x11d329(%rip)    # 0x1437dc
jne 0x264e0
cmpl $0x0, 0x3c(%r14)
jle 0x264e0
leal 0x1(%rbx), %ebp
xorl %r15d, %r15d
movq 0x30(%r14), %rax
movq (%rax,%r15,8), %rdi
movl %r15d, %esi
movl %ebp, %edx
callq 0x265a1
incq %r15
movslq 0x3c(%r14), %rax
cmpq %rax, %r15
jl 0x264c2
cmpb $0x1, 0x11d2f9(%rip)    # 0x1437e0
jne 0x26514
cmpl $0x0, 0x4c(%r14)
jle 0x26514
leal 0x1(%rbx), %ebp
xorl %r15d, %r15d
movq 0x40(%r14), %rax
movq (%rax,%r15,8), %rdi
movl %r15d, %esi
movl %ebp, %edx
callq 0x266f8
incq %r15
movslq 0x4c(%r14), %rax
cmpq %rax, %r15
jl 0x264f6
cmpl $0x0, 0x2c(%r14)
jle 0x2653b
incl %ebx
xorl %r15d, %r15d
movq 0x20(%r14), %rax
movq (%rax,%r15,8), %rdi
movl %ebx, %esi
callq 0x25df4
incq %r15
movslq 0x2c(%r14), %rax
cmpq %rax, %r15
jl 0x26520
leaq 0x38(%rsp), %rdi
callq 0x6cee8
addq $0x10f0, %rsp           # imm = 0x10F0
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
jmp 0x26567
jmp 0x26567
jmp 0x26567
jmp 0x26567
jmp 0x26567
jmp 0x26567
jmp 0x26567
jmp 0x26567
jmp 0x26567
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r12, %rdi
je 0x2658f
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x21890
jmp 0x2658f
jmp 0x2658c
jmp 0x2658c
jmp 0x2658c
jmp 0x2658c
jmp 0x2658c
movq %rax, %rbx
leaq 0x38(%rsp), %rdi
callq 0x6cee8
movq %rbx, %rdi
callq 0x22070