// File: /workspace/github_cpp_makefile_star2_O2/tomfunkhouser[P]gaps/apps/prp2prp/prp2prp.cpp
// Function: ReadProperties(gaps::R3Mesh*, char const*)
static R3MeshPropertySet *
ReadProperties(R3Mesh *mesh, const char *filename)
{
  // Start statistics
  RNTime start_time;
  start_time.Read();

  // Allocate properties
  R3MeshPropertySet *properties = new R3MeshPropertySet(mesh);
  if (!properties) {
    RNFail("Unable to allocate properties for %s\n", filename);
    return NULL;
  }

  // Read properties from file
  if (!properties->Read(filename)) {
    delete properties;
    return NULL;
  }

  // Print statistics
  if (print_verbose) {
    printf("Read properties from %s ...\n", filename);
    printf("  Time = %.2f seconds\n", start_time.Elapsed());
    printf("  # Properties = %d\n", properties->NProperties());
    printf("  # Vertices = %d\n", properties->Mesh()->NVertices());
    fflush(stdout);
  }

  // Print more statistics
  if (print_debug) {
    printf("\n");
    for (int i = 0; i < properties->NProperties(); i++) {
      R3MeshProperty *property = properties->Property(i);
      printf("  Property %d %s\n", i, property->Name());
      printf("    Minimum = %g\n", property->Minimum());
      printf("    Maximum = %g\n", property->Maximum());
      printf("    Median = %g\n", property->Median());
      printf("    Mean = %g\n", property->Mean());
      printf("    # Minima = %d\n", property->LocalMinimumCount());
      printf("    # Maxima = %d\n", property->LocalMaximumCount());
      printf("    L1Norm = %g\n", property->L1Norm());
      printf("    L2Norm = %g\n", property->L2Norm());
      printf("\n");
    }
  }

  // Return property set
  return properties;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %r14
movq %rdi, %r15
leaq 0x8(%rsp), %rbx
movq %rbx, %rdi
callq 0x4e41e
movq %rbx, %rdi
callq 0x10c00
pushq $0x18
popq %rdi
callq 0xd3a0
movq %rax, %rbx
movq %rax, %rdi
movq %r15, %rsi
callq 0x10c10
movq %rbx, %rdi
movq %r14, %rsi
callq 0x10e92
testl %eax, %eax
je 0xffc5
cmpb $0x1, 0x69c6f(%rip)     # 0x79ac8
jne 0xfeb8
leaq 0x412ba(%rip), %rdi     # 0x5111c
movq %r14, %rsi
xorl %eax, %eax
callq 0xd070
leaq 0x8(%rsp), %rdi
callq 0x4e458
leaq 0x41255(%rip), %rdi     # 0x510d2
movb $0x1, %al
callq 0xd070
movl 0x14(%rbx), %esi
leaq 0x412ab(%rip), %rdi     # 0x51139
xorl %eax, %eax
callq 0xd070
movq (%rbx), %rax
movl 0x14(%rax), %esi
leaq 0x41267(%rip), %rdi     # 0x51109
xorl %eax, %eax
callq 0xd070
movq 0x690e8(%rip), %rax     # 0x78f98
movq (%rax), %rdi
callq 0xd460
cmpb $0x1, 0x69c0d(%rip)     # 0x79acc
jne 0xffda
pushq $0xa
popq %rdi
callq 0xd520
leaq 0x412e3(%rip), %r15     # 0x511b7
leaq 0x412ef(%rip), %r12     # 0x511ca
leaq 0x412f9(%rip), %r13     # 0x511db
xorl %ebp, %ebp
movslq 0x14(%rbx), %rax
cmpq %rax, %rbp
jge 0xffda
movq 0x8(%rbx), %rax
movq (%rax,%rbp,8), %r14
leaq 0x8(%r14), %rdx
leaq 0x4124a(%rip), %rdi     # 0x5114e
movl %ebp, %esi
xorl %eax, %eax
callq 0xd070
movq %r14, %rdi
callq 0x12b8c
leaq 0x41244(%rip), %rdi     # 0x51160
movb $0x1, %al
callq 0xd070
movq %r14, %rdi
callq 0x12c0c
leaq 0x41240(%rip), %rdi     # 0x51172
movb $0x1, %al
callq 0xd070
movq %r14, %rdi
callq 0x13000
leaq 0x4123c(%rip), %rdi     # 0x51184
movb $0x1, %al
callq 0xd070
movq %r14, %rdi
callq 0x12afe
leaq 0x41237(%rip), %rdi     # 0x51195
movb $0x1, %al
callq 0xd070
movq %r14, %rdi
callq 0x13030
leaq 0x41230(%rip), %rdi     # 0x511a4
movl %eax, %esi
xorl %eax, %eax
callq 0xd070
movq %r14, %rdi
callq 0x1305e
movq %r15, %rdi
movl %eax, %esi
xorl %eax, %eax
callq 0xd070
movq %r14, %rdi
callq 0x130d6
movq %r12, %rdi
movb $0x1, %al
callq 0xd070
movq %r14, %rdi
callq 0x13134
movq %r13, %rdi
movb $0x1, %al
callq 0xd070
pushq $0xa
popq %rdi
callq 0xd520
incq %rbp
jmp 0xfee4
movq %rbx, %rdi
callq 0x10cb2
pushq $0x18
popq %rsi
movq %rbx, %rdi
callq 0xd3b0
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq %rax, %r14
pushq $0x18
popq %rsi
movq %rbx, %rdi
callq 0xd3b0
movq %r14, %rdi
callq 0xd680