// File: /workspace/github_cpp_makefile_star2_O3/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 0x53f90
movq %rbx, %rdi
xorl %esi, %esi
callq 0xc5d0
movl $0x18, %edi
callq 0xc390
movq %rax, %rbx
movq %rax, %rdi
movq %r15, %rsi
callq 0x1040c
movq %rbx, %rdi
movq %r14, %rsi
callq 0x106e2
testl %eax, %eax
je 0xf797
cmpb $0x1, 0x6d498(%rip)     # 0x7cab8
jne 0xf67f
leaq 0x47af3(%rip), %rdi     # 0x5711c
movq %r14, %rsi
xorl %eax, %eax
callq 0xc070
leaq 0x8(%rsp), %rdi
callq 0x53ff2
leaq 0x47a8e(%rip), %rdi     # 0x570d2
movb $0x1, %al
callq 0xc070
movl 0x14(%rbx), %esi
leaq 0x47ae4(%rip), %rdi     # 0x57139
xorl %eax, %eax
callq 0xc070
movq (%rbx), %rax
movl 0x14(%rax), %esi
leaq 0x47aa0(%rip), %rdi     # 0x57109
xorl %eax, %eax
callq 0xc070
movq 0x6c911(%rip), %rax     # 0x7bf88
movq (%rax), %rdi
callq 0xc440
cmpb $0x1, 0x6d436(%rip)     # 0x7cabc
jne 0xf7ae
movl $0xa, %edi
callq 0xc4f0
cmpl $0x0, 0x14(%rbx)
jle 0xf7ae
leaq 0x47b10(%rip), %r15     # 0x571b7
leaq 0x47b1c(%rip), %r12     # 0x571ca
leaq 0x47b26(%rip), %r13     # 0x571db
xorl %ebp, %ebp
movq 0x8(%rbx), %rax
movq (%rax,%rbp,8), %r14
leaq 0x8(%r14), %rdx
leaq 0x47a84(%rip), %rdi     # 0x5714e
movl %ebp, %esi
xorl %eax, %eax
callq 0xc070
movq %r14, %rdi
callq 0x12594
leaq 0x47a7e(%rip), %rdi     # 0x57160
movb $0x1, %al
callq 0xc070
movq %r14, %rdi
callq 0x12616
leaq 0x47a7a(%rip), %rdi     # 0x57172
movb $0x1, %al
callq 0xc070
movq %r14, %rdi
callq 0x12a3c
leaq 0x47a76(%rip), %rdi     # 0x57184
movb $0x1, %al
callq 0xc070
movq %r14, %rdi
callq 0x12506
leaq 0x47a71(%rip), %rdi     # 0x57195
movb $0x1, %al
callq 0xc070
movq %r14, %rdi
callq 0x12a6c
leaq 0x47a6a(%rip), %rdi     # 0x571a4
movl %eax, %esi
xorl %eax, %eax
callq 0xc070
movq %r14, %rdi
callq 0x12ab6
movq %r15, %rdi
movl %eax, %esi
xorl %eax, %eax
callq 0xc070
movq %r14, %rdi
callq 0x12b4c
movq %r12, %rdi
movb $0x1, %al
callq 0xc070
movq %r14, %rdi
callq 0x12bac
movq %r13, %rdi
movb $0x1, %al
callq 0xc070
movl $0xa, %edi
callq 0xc4f0
incq %rbp
movslq 0x14(%rbx), %rax
cmpq %rax, %rbp
jl 0xf6b7
jmp 0xf7ae
movq %rbx, %rdi
callq 0x104c0
movl $0x18, %esi
movq %rbx, %rdi
callq 0xc3a0
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
movl $0x18, %esi
movq %rbx, %rdi
callq 0xc3a0
movq %r14, %rdi
callq 0xc650