// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/apps/msh2prp/msh2prp.cpp
// Function: main
static int 
ParseArgs(int argc, char **argv)
{
  // Parse arguments
  argc--; argv++;
  while (argc > 0) {
    if ((*argv)[0] == '-') {
      if (!strcmp(*argv, "-v")) print_verbose = 1;
      else if (!strcmp(*argv, "-debug")) print_debug = 1;
      else if (!strcmp(*argv, "-basic")) { compute_basic_properties = 1; }
      else if (!strcmp(*argv, "-coordinate")) { compute_coordinate_properties = 1; }
      else if (!strcmp(*argv, "-curvature")) { compute_curvature_properties = 1; }
      else if (!strcmp(*argv, "-volume")) { compute_volume_properties = 1; }
      else if (!strcmp(*argv, "-boundary")) { compute_boundary_properties = 1; }
      else if (!strcmp(*argv, "-laplacian")) { compute_laplacian_properties = 1; }
      else if (!strcmp(*argv, "-dijkstra")) { compute_dijkstra_distance_properties = 1; }
      else if (!strcmp(*argv, "-dijkstra_statistics")) { compute_dijkstra_distance_properties = 1; }
      else if (!strcmp(*argv, "-dijkstra_histogram")) { compute_dijkstra_histogram_properties = 1; }
      else if (!strcmp(*argv, "-raytrace")) { compute_raytrace_properties = 1; }
      else if (!strcmp(*argv, "-solidtexture")) { compute_solidtexture_properties = 1; }
      else if (!strcmp(*argv, "-output_mesh")) { argv++; argc--; output_mesh_name = *argv; }
      else if (!strcmp(*argv, "-map")) { argv++; argc--; input_map_name = *argv; }
      else if (!strcmp(*argv, "-mturk_semantic_segmentation")) {
        argv++; argc--; input_mturk_segmentation_name = *argv; 
        argv++; argc--; input_mturk_annotation_name = *argv;         
        argv++; argc--; input_mturk_label_mapping_name = *argv;         
      }
      else if (!strcmp(*argv, "-all")) { 
        compute_basic_properties = 1;
        compute_coordinate_properties = 1;
        compute_curvature_properties = 1;
        compute_volume_properties = 1;
        compute_boundary_properties = 1;
        // compute_laplacian_properties = 1;
        compute_dijkstra_distance_properties = 1;
        compute_dijkstra_histogram_properties = 1;
        compute_raytrace_properties = 1;
      }
      else { 
        RNFail("Invalid program argument: %s", *argv); 
        exit(1); 
      }
      argv++; argc--;
    }
    else {
      if (!input_mesh_name) input_mesh_name = *argv;
      else if (!output_properties_name) output_properties_name = *argv;
      else { RNFail("Invalid program argument: %s", *argv); exit(1); }
      argv++; argc--;
    }
  }

  // Check input filename
  if (!input_mesh_name || !output_properties_name) {
    RNFail("Usage: msh2prp meshfile propertiesfile [options]\n");
    return 0;
  }

  // Return OK status 
  return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
cmpl $0x2, %edi
jl 0x13405
movq %rsi, %rbp
movl %edi, %r13d
movq 0xffc11(%rip), %rax     # 0x112d40
movq %rax, (%rsp)
movq 0xffbfe(%rip), %r15     # 0x112d38
leaq 0x8(%rbp), %r14
leal -0x1(%r13), %ebx
movq 0x8(%rbp), %r12
cmpb $0x2d, (%r12)
jne 0x1330c
movq %r12, %rdi
leaq 0xb0fea(%rip), %rsi     # 0xc4145
callq 0x107d0
testl %eax, %eax
je 0x13329
movq %r12, %rdi
leaq 0xb0fd6(%rip), %rsi     # 0xc4148
callq 0x107d0
testl %eax, %eax
je 0x1337b
movq %r12, %rdi
leaq 0xb0fc6(%rip), %rsi     # 0xc414f
callq 0x107d0
testl %eax, %eax
je 0x1333e
movq %r12, %rdi
leaq 0xb0fb6(%rip), %rsi     # 0xc4156
callq 0x107d0
testl %eax, %eax
je 0x13347
movq %r12, %rdi
leaq 0xb0fab(%rip), %rsi     # 0xc4162
callq 0x107d0
testl %eax, %eax
je 0x13350
movq %r12, %rdi
leaq 0xb0f9f(%rip), %rsi     # 0xc416d
callq 0x107d0
testl %eax, %eax
je 0x13359
movq %r12, %rdi
leaq 0xb0f90(%rip), %rsi     # 0xc4175
callq 0x107d0
testl %eax, %eax
je 0x13362
movq %r12, %rdi
leaq 0xb0f83(%rip), %rsi     # 0xc417f
callq 0x107d0
testl %eax, %eax
je 0x13374
movq %r12, %rdi
leaq 0xb0f77(%rip), %rsi     # 0xc418a
callq 0x107d0
testl %eax, %eax
je 0x1336b
movq %r12, %rdi
leaq 0xb0f6a(%rip), %rsi     # 0xc4194
callq 0x107d0
testl %eax, %eax
je 0x1336b
movq %r12, %rdi
leaq 0xb0f68(%rip), %rsi     # 0xc41a9
callq 0x107d0
testl %eax, %eax
je 0x1338c
movq %r12, %rdi
leaq 0xb0f65(%rip), %rsi     # 0xc41bd
callq 0x107d0
testl %eax, %eax
je 0x13395
movq %r12, %rdi
leaq 0xb0f58(%rip), %rsi     # 0xc41c7
callq 0x107d0
testl %eax, %eax
je 0x1339e
movq %r12, %rdi
leaq 0xb0f4f(%rip), %rsi     # 0xc41d5
callq 0x107d0
testl %eax, %eax
je 0x133a7
movq %r12, %rdi
leaq 0xb0f45(%rip), %rsi     # 0xc41e2
callq 0x107d0
testl %eax, %eax
je 0x133bc
movq %r12, %rdi
leaq 0xb0f33(%rip), %rsi     # 0xc41e7
callq 0x107d0
testl %eax, %eax
je 0x133d1
movq %r12, %rdi
leaq 0xb0f39(%rip), %rsi     # 0xc4204
callq 0x107d0
testl %eax, %eax
jne 0x1368b
movb $0x1, %al
movb %al, 0xffa74(%rip)      # 0x112d54
movb %al, 0xffa72(%rip)      # 0x112d58
movb %al, 0xffa70(%rip)      # 0x112d5c
movb %al, 0xffa6e(%rip)      # 0x112d60
movb %al, 0xffa6c(%rip)      # 0x112d64
movb %al, 0xffa6e(%rip)      # 0x112d6c
movb %al, 0xffa6c(%rip)      # 0x112d70
movb %al, 0xffa6a(%rip)      # 0x112d74
jmp 0x1337b
testq %r15, %r15
je 0x13332
cmpq $0x0, (%rsp)
jne 0x1368b
movq %r12, 0xffa1d(%rip)     # 0x112d40
movq %r12, (%rsp)
jmp 0x1337b
movb $0x1, 0xffa20(%rip)     # 0x112d50
jmp 0x1337b
movq %r12, 0xff9ff(%rip)     # 0x112d38
movq %r12, %r15
jmp 0x1337b
movb $0x1, 0xffa0f(%rip)     # 0x112d54
jmp 0x1337b
movb $0x1, 0xffa0a(%rip)     # 0x112d58
jmp 0x1337b
movb $0x1, 0xffa05(%rip)     # 0x112d5c
jmp 0x1337b
movb $0x1, 0xffa00(%rip)     # 0x112d60
jmp 0x1337b
movb $0x1, 0xff9fb(%rip)     # 0x112d64
jmp 0x1337b
movb $0x1, 0xff9fa(%rip)     # 0x112d6c
jmp 0x1337b
movb $0x1, 0xff9ed(%rip)     # 0x112d68
movq %r14, %rbp
movl %ebx, %r13d
cmpl $0x1, %ebx
jg 0x1313a
jmp 0x13405
movb $0x1, 0xff9dd(%rip)     # 0x112d70
jmp 0x1337b
movb $0x1, 0xff9d8(%rip)     # 0x112d74
jmp 0x1337b
movb $0x1, 0xff9d3(%rip)     # 0x112d78
jmp 0x1337b
addl $-0x2, %r13d
movq 0x10(%rbp), %rax
addq $0x10, %rbp
movq %rax, 0xff98e(%rip)     # 0x112d48
jmp 0x133fa
addl $-0x2, %r13d
movq 0x10(%rbp), %rax
addq $0x10, %rbp
movq %rax, 0xff9b1(%rip)     # 0x112d80
jmp 0x133fa
movq 0x10(%rbp), %rax
movq %rax, 0xff9ac(%rip)     # 0x112d88
movq 0x18(%rbp), %rax
movq %rax, 0xff9a9(%rip)     # 0x112d90
addl $-0x4, %r13d
movq 0x20(%rbp), %rax
addq $0x20, %rbp
movq %rax, 0xff99e(%rip)     # 0x112d98
movl %r13d, %ebx
movq %rbp, %r14
jmp 0x1337b
cmpq $0x0, 0xff92b(%rip)     # 0x112d38
je 0x136b0
cmpq $0x0, 0xff925(%rip)     # 0x112d40
je 0x136b0
movq 0xff910(%rip), %r14     # 0x112d38
leaq 0x8(%rsp), %rbx
movq %rbx, %rdi
callq 0x7db60
movq %rbx, %rdi
xorl %esi, %esi
callq 0x10930
movl $0x138, %edi            # imm = 0x138
callq 0x10550
movq %rax, %rbx
movq %rax, %rdi
callq 0x1f890
movq (%rbx), %rax
movq %rbx, %rdi
movq %r14, %rsi
callq *0x180(%rax)
testl %eax, %eax
je 0x134e1
cmpb $0x1, 0xff8e2(%rip)     # 0x112d50
jne 0x134f4
leaq 0xb0dfa(%rip), %rdi     # 0xc4275
movq %r14, %rsi
xorl %eax, %eax
callq 0x10080
leaq 0x8(%rsp), %rdi
callq 0x7dbc2
leaq 0xb0df6(%rip), %rdi     # 0xc428c
movb $0x1, %al
callq 0x10080
movl 0x34(%rbx), %esi
leaq 0xb0dfc(%rip), %rdi     # 0xc42a3
xorl %eax, %eax
callq 0x10080
movl 0x24(%rbx), %esi
leaq 0xb0dfb(%rip), %rdi     # 0xc42b3
xorl %eax, %eax
callq 0x10080
movl 0x14(%rbx), %esi
leaq 0xb0dfa(%rip), %rdi     # 0xc42c3
xorl %eax, %eax
callq 0x10080
movq 0xfea89(%rip), %rax     # 0x111f60
movq (%rax), %rdi
callq 0x10690
jmp 0x134f4
leaq 0xb0d70(%rip), %rdi     # 0xc4258
xorl %ebx, %ebx
movq %r14, %rsi
xorl %eax, %eax
callq 0x8052e
testq %rbx, %rbx
je 0x136a6
movq %rbx, %rdi
callq 0x136d8
testq %rax, %rax
je 0x136a6
movq %rax, %r14
movq 0xff828(%rip), %r15     # 0x112d40
leaq 0x8(%rsp), %r12
movq %r12, %rdi
callq 0x7db60
movq %r12, %rdi
xorl %esi, %esi
callq 0x10930
movq %r14, %rdi
movq %r15, %rsi
callq 0x1b716
movl %eax, %ebp
testl %eax, %eax
je 0x135a9
cmpb $0x1, 0xff809(%rip)     # 0x112d50
jne 0x135ba
leaq 0xb1167(%rip), %rdi     # 0xc46b7
movq %r15, %rsi
xorl %eax, %eax
callq 0x10080
leaq 0x8(%rsp), %rdi
callq 0x7dbc2
leaq 0xb0d21(%rip), %rdi     # 0xc428c
movb $0x1, %al
callq 0x10080
movl 0x14(%r14), %esi
leaq 0xb0d78(%rip), %rdi     # 0xc42f5
xorl %eax, %eax
callq 0x10080
movq (%r14), %rax
movl 0x14(%rax), %esi
leaq 0xb0d32(%rip), %rdi     # 0xc42c3
xorl %eax, %eax
callq 0x10080
movq 0xfe9c1(%rip), %rax     # 0x111f60
movq (%rax), %rdi
callq 0x10690
jmp 0x135ba
leaq 0xb10e5(%rip), %rdi     # 0xc4695
movq %r15, %rsi
xorl %eax, %eax
callq 0x8052e
testl %ebp, %ebp
je 0x136a6
movq 0xff77f(%rip), %r14     # 0x112d48
testq %r14, %r14
je 0x1367a
leaq 0x8(%rsp), %r15
movq %r15, %rdi
callq 0x7db60
movq %r15, %rdi
xorl %esi, %esi
callq 0x10930
movq (%rbx), %rax
movq %rbx, %rdi
movq %r14, %rsi
callq *0x1d0(%rax)
testl %eax, %eax
je 0x136a6
movl %eax, %ebp
cmpb $0x1, 0xff747(%rip)     # 0x112d50
jne 0x13676
leaq 0xb10c1(%rip), %rdi     # 0xc46d3
movq %r14, %rsi
xorl %eax, %eax
callq 0x10080
leaq 0x8(%rsp), %rdi
callq 0x7dbc2
leaq 0xb0c5f(%rip), %rdi     # 0xc428c
movb $0x1, %al
callq 0x10080
movl 0x34(%rbx), %esi
leaq 0xb0c65(%rip), %rdi     # 0xc42a3
xorl %eax, %eax
callq 0x10080
movl 0x24(%rbx), %esi
leaq 0xb0c64(%rip), %rdi     # 0xc42b3
xorl %eax, %eax
callq 0x10080
movl 0x14(%rbx), %esi
leaq 0xb0c63(%rip), %rdi     # 0xc42c3
xorl %eax, %eax
callq 0x10080
movq 0xfe8f2(%rip), %rax     # 0x111f60
movq (%rax), %rdi
callq 0x10690
testl %ebp, %ebp
je 0x136a6
xorl %eax, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xb0b77(%rip), %rdi     # 0xc4209
movq %r12, %rsi
xorl %eax, %eax
callq 0x8052e
movl $0x1, %edi
callq 0x106c0
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
callq 0x106c0
leaq 0xb0b6f(%rip), %rdi     # 0xc4226
xorl %eax, %eax
callq 0x8052e
jmp 0x1369c
movq %rax, %r14
movl $0x138, %esi            # imm = 0x138
movq %rbx, %rdi
callq 0x10560
movq %r14, %rdi
callq 0x109f0