// File: /workspace/github_cpp_makefile_star2_O3/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 0x25df1
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 0x25dd3
movq 0x1a0(%r14), %r15
movq %r14, %rdi
callq 0x3aa4c
leaq 0x38(%rsp), %rdi
movq %rax, %rsi
callq 0x6b254
leaq 0x20(%rsp), %rdi
movq %r14, %rsi
callq 0x3ac0a
leaq 0x60(%r14), %rsi
leaq 0x70(%rsp), %rdi
callq 0x7023e
testq %r15, %r15
leaq 0xb3358(%rip), %rdx     # 0xd918a
cmovneq %r15, %rdx
leaq 0xb3342(%rip), %rdi     # 0xd917f
leaq 0xf0(%rsp), %rsi
xorl %eax, %eax
callq 0x21080
movq 0x10(%r14), %rax
testq %rax, %rax
je 0x25e6c
movq 0x1a0(%rax), %rax
testq %rax, %rax
leaq 0xb333b(%rip), %rdx     # 0xd91a1
cmovneq %rax, %rdx
jmp 0x25e73
leaq 0xb3335(%rip), %rdx     # 0xd91a8
leaq 0xb3315(%rip), %rdi     # 0xd918f
leaq 0xf0(%rsp), %r15
movq %r15, %rsi
xorl %eax, %eax
callq 0x21080
movl 0x18(%r14), %edx
leaq 0xb3316(%rip), %rdi     # 0xd91ad
movq %r15, %rsi
xorl %eax, %eax
callq 0x21080
movl 0x8(%r14), %edx
leaq 0xb3318(%rip), %rdi     # 0xd91c4
movq %r15, %rsi
xorl %eax, %eax
callq 0x21080
movl 0x3c(%r14), %edx
leaq 0xb3319(%rip), %rdi     # 0xd91da
movq %r15, %rsi
xorl %eax, %eax
callq 0x21080
movl 0x4c(%r14), %edx
leaq 0xb3319(%rip), %rdi     # 0xd91ef
movq %r15, %rsi
xorl %eax, %eax
callq 0x21080
movq %rsp, %rdi
movq %r14, %rsi
callq 0x3a036
movsd (%rsp), %xmm0
addsd 0x8(%rsp), %xmm0
mulsd 0xb3112(%rip), %xmm0    # 0xd9010
leaq 0xb3301(%rip), %rdi     # 0xd9206
leaq 0xf0(%rsp), %rsi
movb $0x1, %al
callq 0x21080
movq %r14, %rdi
callq 0x3a1ea
leaq 0xb32f6(%rip), %rdi     # 0xd9219
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 0xb32da(%rip), %rdi     # 0xd9228
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 0xb32be(%rip), %rdi     # 0xd9241
movq %r15, %rsi
movb $0x6, %al
callq 0x21080
leaq 0x10(%rsp), %r12
movq %r12, -0x10(%r12)
leaq 0xc245b(%rip), %rsi     # 0xe83f9
leaq 0xc2459(%rip), %rdx     # 0xe83fe
movq %rsp, %rdi
callq 0x26bf8
movq 0x50(%r14), %rdi
movq %rsp, %rsi
callq 0x2683a
movq 0x50(%r14), %rcx
addq $0x8, %rcx
cmpq %rcx, %rax
je 0x25fd1
cmpq $0x0, 0x40(%rax)
sete %bpl
jmp 0x25fd4
movb $0x1, %bpl
movq (%rsp), %rdi
cmpq %r12, %rdi
je 0x25fea
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x21890
testb %bpl, %bpl
jne 0x26059
movq %rsp, %rdi
movq %r12, (%rdi)
leaq 0xc23fd(%rip), %rsi     # 0xe83f9
leaq 0xc23fb(%rip), %rdx     # 0xe83fe
callq 0x26bf8
movq 0x50(%r14), %rdi
movq %rsp, %rsi
callq 0x2683a
movq 0x50(%r14), %rcx
addq $0x8, %rcx
cmpq %rcx, %rax
je 0x26027
movq 0x40(%rax), %r15
jmp 0x2602a
xorl %r15d, %r15d
movq (%rsp), %rdi
cmpq %r12, %rdi
je 0x26040
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x21890
leaq 0xb3220(%rip), %rdi     # 0xd9267
leaq 0xf0(%rsp), %rsi
movq %r15, %rdx
xorl %eax, %eax
callq 0x21080
movq %rsp, %rdi
movq %r12, (%rdi)
leaq 0xb321a(%rip), %rsi     # 0xd9280
leaq 0xb321b(%rip), %rdx     # 0xd9288
callq 0x26bf8
movq 0x50(%r14), %rdi
movq %rsp, %rsi
callq 0x2683a
movq 0x50(%r14), %rcx
addq $0x8, %rcx
cmpq %rcx, %rax
je 0x26096
cmpq $0x0, 0x40(%rax)
sete %bpl
jmp 0x26099
movb $0x1, %bpl
movq (%rsp), %rdi
cmpq %r12, %rdi
je 0x260af
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x21890
testb %bpl, %bpl
jne 0x2611e
movq %rsp, %rdi
movq %r12, (%rdi)
leaq 0xb31bf(%rip), %rsi     # 0xd9280
leaq 0xb31c0(%rip), %rdx     # 0xd9288
callq 0x26bf8
movq 0x50(%r14), %rdi
movq %rsp, %rsi
callq 0x2683a
movq 0x50(%r14), %rcx
addq $0x8, %rcx
cmpq %rcx, %rax
je 0x260ec
movq 0x40(%rax), %r15
jmp 0x260ef
xorl %r15d, %r15d
movq (%rsp), %rdi
cmpq %r12, %rdi
je 0x26105
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x21890
leaq 0xb317d(%rip), %rdi     # 0xd9289
leaq 0xf0(%rsp), %rsi
movq %r15, %rdx
xorl %eax, %eax
callq 0x21080
movq %rsp, %rdi
movq %r12, (%rdi)
leaq 0xb317a(%rip), %rsi     # 0xd92a5
leaq 0xb3185(%rip), %rdx     # 0xd92b7
callq 0x26bf8
movq 0x50(%r14), %rdi
movq %rsp, %rsi
callq 0x2683a
movq 0x50(%r14), %rcx
addq $0x8, %rcx
cmpq %rcx, %rax
je 0x2615b
cmpq $0x0, 0x40(%rax)
sete %bpl
jmp 0x2615e
movb $0x1, %bpl
movq (%rsp), %rdi
cmpq %r12, %rdi
je 0x26174
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x21890
testb %bpl, %bpl
jne 0x261e3
movq %rsp, %rdi
movq %r12, (%rdi)
leaq 0xb311f(%rip), %rsi     # 0xd92a5
leaq 0xb312a(%rip), %rdx     # 0xd92b7
callq 0x26bf8
movq 0x50(%r14), %rdi
movq %rsp, %rsi
callq 0x2683a
movq 0x50(%r14), %rcx
addq $0x8, %rcx
cmpq %rcx, %rax
je 0x261b1
movq 0x40(%rax), %r15
jmp 0x261b4
xorl %r15d, %r15d
movq (%rsp), %rdi
cmpq %r12, %rdi
je 0x261ca
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x21890
leaq 0xb30e7(%rip), %rdi     # 0xd92b8
leaq 0xf0(%rsp), %rsi
movq %r15, %rdx
xorl %eax, %eax
callq 0x21080
movq %rsp, %rdi
movq %r12, (%rdi)
leaq 0xb30e5(%rip), %rsi     # 0xd92d5
leaq 0xb30f2(%rip), %rdx     # 0xd92e9
callq 0x26bf8
movq 0x50(%r14), %rdi
movq %rsp, %rsi
callq 0x2683a
movq 0x50(%r14), %rcx
addq $0x8, %rcx
cmpq %rcx, %rax
je 0x26220
cmpq $0x0, 0x40(%rax)
sete %bpl
jmp 0x26223
movb $0x1, %bpl
movq (%rsp), %rdi
cmpq %r12, %rdi
je 0x26239
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x21890
testb %bpl, %bpl
jne 0x262a8
movq %rsp, %rdi
movq %r12, (%rdi)
leaq 0xb308a(%rip), %rsi     # 0xd92d5
leaq 0xb3097(%rip), %rdx     # 0xd92e9
callq 0x26bf8
movq 0x50(%r14), %rdi
movq %rsp, %rsi
callq 0x2683a
movq 0x50(%r14), %rcx
addq $0x8, %rcx
cmpq %rcx, %rax
je 0x26276
movq 0x40(%rax), %r15
jmp 0x26279
xorl %r15d, %r15d
movq (%rsp), %rdi
cmpq %r12, %rdi
je 0x2628f
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x21890
leaq 0xb3054(%rip), %rdi     # 0xd92ea
leaq 0xf0(%rsp), %rsi
movq %r15, %rdx
xorl %eax, %eax
callq 0x21080
movq %rsp, %rdi
movq %r12, (%rdi)
leaq 0xb3054(%rip), %rsi     # 0xd9309
leaq 0xb305a(%rip), %rdx     # 0xd9316
callq 0x26bf8
movq 0x50(%r14), %rdi
movq %rsp, %rsi
callq 0x2683a
movq 0x50(%r14), %rcx
addq $0x8, %rcx
cmpq %rcx, %rax
je 0x262e5
cmpq $0x0, 0x40(%rax)
sete %bpl
jmp 0x262e8
movb $0x1, %bpl
movq (%rsp), %rdi
cmpq %r12, %rdi
je 0x262fe
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x21890
testb %bpl, %bpl
jne 0x2636d
movq %rsp, %rdi
movq %r12, (%rdi)
leaq 0xb2ff9(%rip), %rsi     # 0xd9309
leaq 0xb2fff(%rip), %rdx     # 0xd9316
callq 0x26bf8
movq 0x50(%r14), %rdi
movq %rsp, %rsi
callq 0x2683a
movq 0x50(%r14), %rcx
addq $0x8, %rcx
cmpq %rcx, %rax
je 0x2633b
movq 0x40(%rax), %r15
jmp 0x2633e
xorl %r15d, %r15d
movq (%rsp), %rdi
cmpq %r12, %rdi
je 0x26354
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x21890
leaq 0xb2fbc(%rip), %rdi     # 0xd9317
leaq 0xf0(%rsp), %rsi
movq %r15, %rdx
xorl %eax, %eax
callq 0x21080
leaq 0xb2fbc(%rip), %rdi     # 0xd9330
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 0xb2fa3(%rip), %r12     # 0xd934e
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 0x21ca0
cmpb $0x1, 0x11b380(%rip)    # 0x1417dc
jne 0x26489
cmpl $0x0, 0x3c(%r14)
jle 0x26489
leal 0x1(%rbx), %ebp
xorl %r15d, %r15d
movq 0x30(%r14), %rax
movq (%rax,%r15,8), %rdi
movl %r15d, %esi
movl %ebp, %edx
callq 0x2654a
incq %r15
movslq 0x3c(%r14), %rax
cmpq %rax, %r15
jl 0x2646b
cmpb $0x1, 0x11b350(%rip)    # 0x1417e0
jne 0x264bd
cmpl $0x0, 0x4c(%r14)
jle 0x264bd
leal 0x1(%rbx), %ebp
xorl %r15d, %r15d
movq 0x40(%r14), %rax
movq (%rax,%r15,8), %rdi
movl %r15d, %esi
movl %ebp, %edx
callq 0x266a1
incq %r15
movslq 0x4c(%r14), %rax
cmpq %rax, %r15
jl 0x2649f
cmpl $0x0, 0x2c(%r14)
jle 0x264e4
incl %ebx
xorl %r15d, %r15d
movq 0x20(%r14), %rax
movq (%rax,%r15,8), %rdi
movl %ebx, %esi
callq 0x25d9d
incq %r15
movslq 0x2c(%r14), %rax
cmpq %rax, %r15
jl 0x264c9
leaq 0x38(%rsp), %rdi
callq 0x6c074
addq $0x10f0, %rsp           # imm = 0x10F0
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
jmp 0x26510
jmp 0x26510
jmp 0x26510
jmp 0x26510
jmp 0x26510
jmp 0x26510
jmp 0x26510
jmp 0x26510
jmp 0x26510
movq %rax, %rbx
movq (%rsp), %rdi
cmpq %r12, %rdi
je 0x26538
movq 0x10(%rsp), %rsi
incq %rsi
callq 0x21890
jmp 0x26538
jmp 0x26535
jmp 0x26535
jmp 0x26535
jmp 0x26535
jmp 0x26535
movq %rax, %rbx
leaq 0x38(%rsp), %rdi
callq 0x6c074
movq %rbx, %rdi
callq 0x22060