// File: /workspace/github_cpp_makefile_star2_O1/tomfunkhouser[P]gaps/apps/mshview/mshview.cpp
// Function: ParseArgs(int, char**)
int ParseArgs(int argc, char **argv)
{
  // Check number of arguments
  if ((argc == 2) && (*argv[1] == '-')) {
    printf("Usage: meshviewer filename [options]\n");
    exit(0);
  }

  // Parse arguments
  argc--; argv++;
  while (argc > 0) {
    if ((*argv)[0] == '-') {
      if (!strcmp(*argv, "-v")) { print_verbose = 1; }
      else if (!strcmp(*argv, "-image")) { argc--; argv++; image_name = *argv; }
      else if (!strcmp(*argv, "-vertices")) { show_vertices = TRUE; }
      else if (!strcmp(*argv, "-edges")) { show_edges = TRUE; }
      else if (!strcmp(*argv, "-back")) { show_backfacing = TRUE; }
      else if (!strcmp(*argv, "-boundaries")) { show_boundaries = TRUE; }
      else if (!strcmp(*argv, "-axes")) { show_axes = TRUE; }
      else if (!strcmp(*argv, "-materials")) { show_materials = TRUE; }
      else if (!strcmp(*argv, "-segments")) { show_segments = TRUE; }
      else if (!strcmp(*argv, "-categories")) { show_categories = TRUE; }
      else if (!strcmp(*argv, "-vertex_colors")) { show_vertex_colors = TRUE; }
      else if (!strcmp(*argv, "-window")) { 
        argv++; argc--; GLUTwindow_width = atoi(*argv); 
        argv++; argc--; GLUTwindow_height = atoi(*argv); 
      }
      else if (!strcmp(*argv, "-background")) { 
        argv++; argc--; background[0] = atof(*argv); 
        argv++; argc--; background[1] = atof(*argv); 
        argv++; argc--; background[2] = atof(*argv);
      }
      else if (!strcmp(*argv, "-camera")) { 
        RNCoord x, y, z, tx, ty, tz, ux, uy, uz;
        argv++; argc--; x = atof(*argv); 
        argv++; argc--; y = atof(*argv); 
        argv++; argc--; z = atof(*argv); 
        argv++; argc--; tx = atof(*argv); 
        argv++; argc--; ty = atof(*argv); 
        argv++; argc--; tz = atof(*argv); 
        argv++; argc--; ux = atof(*argv); 
        argv++; argc--; uy = atof(*argv); 
        argv++; argc--; uz = atof(*argv); 
        initial_camera_origin = R3Point(x, y, z);
        initial_camera_towards.Reset(tx, ty, tz);
        initial_camera_up.Reset(ux, uy, uz);
        initial_camera = TRUE;
      }
      else if (!strcmp(*argv, "-origin")) {
        RNCoord x, y, z;
        argv++; argc--; x = atof(*argv); 
        argv++; argc--; y = atof(*argv); 
        argv++; argc--; z = atof(*argv);
        initial_world_origin.Reset(x, y, z);
      }
      else { RNFail("Invalid program argument: %s", *argv); exit(1); }
      argv++; argc--;
    }
    else {
      mesh_names.Insert(*argv);
      argv++; argc--;
    }
  }

  // Check mesh filename
  if (mesh_names.IsEmpty()) {
    RNFail("You did not specify a mesh file name.\n");
    return 0;
  }

  // Return OK status 
  return 1;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x68, %rsp
movq %rsi, %r12
movl %edi, %r13d
cmpl $0x2, %edi
jne 0x274ed
movq 0x8(%r12), %rax
cmpb $0x2d, (%rax)
je 0x27948
cmpl $0x2, %r13d
jl 0x27919
leaq 0x11d362(%rip), %rbp    # 0x144860
leal -0x1(%r13), %ebx
leaq 0x8(%r12), %r14
movq 0x8(%r12), %r15
cmpb $0x2d, (%r15)
jne 0x276c7
movq %r15, %rdi
leaq 0xb4d96(%rip), %rsi     # 0xdc2b6
callq 0x21cf0
testl %eax, %eax
je 0x276dd
movq %r15, %rdi
leaq 0xb4d82(%rip), %rsi     # 0xdc2b9
callq 0x21cf0
testl %eax, %eax
je 0x276e9
movq %r15, %rdi
leaq 0xb4d72(%rip), %rsi     # 0xdc2c0
callq 0x21cf0
testl %eax, %eax
je 0x27705
movq %r15, %rdi
leaq 0xb4d65(%rip), %rsi     # 0xdc2ca
callq 0x21cf0
testl %eax, %eax
je 0x27711
movq %r15, %rdi
leaq 0xb4d55(%rip), %rsi     # 0xdc2d1
callq 0x21cf0
testl %eax, %eax
je 0x2771d
movq %r15, %rdi
leaq 0xb4d44(%rip), %rsi     # 0xdc2d7
callq 0x21cf0
testl %eax, %eax
je 0x27729
movq %r15, %rdi
leaq 0xb4d39(%rip), %rsi     # 0xdc2e3
callq 0x21cf0
testl %eax, %eax
je 0x27735
movq %r15, %rdi
leaq 0xb4d28(%rip), %rsi     # 0xdc2e9
callq 0x21cf0
testl %eax, %eax
je 0x27741
movq %r15, %rdi
leaq 0xb4d1c(%rip), %rsi     # 0xdc2f4
callq 0x21cf0
testl %eax, %eax
je 0x2774d
movq %r15, %rdi
leaq 0xb4d0f(%rip), %rsi     # 0xdc2fe
callq 0x21cf0
testl %eax, %eax
je 0x27759
movq %r15, %rdi
leaq 0xb4d04(%rip), %rsi     # 0xdc30a
callq 0x21cf0
testl %eax, %eax
je 0x27765
movq %r15, %rdi
leaq 0xb4cfc(%rip), %rsi     # 0xdc319
callq 0x21cf0
testl %eax, %eax
je 0x27783
movq %r15, %rdi
leaq 0xb4ced(%rip), %rsi     # 0xdc321
callq 0x21cf0
testl %eax, %eax
je 0x277b0
movq %r15, %rdi
leaq 0xb4ce2(%rip), %rsi     # 0xdc32d
callq 0x21cf0
testl %eax, %eax
je 0x277f3
movq %r15, %rdi
leaq 0xb4cd3(%rip), %rsi     # 0xdc335
callq 0x21cf0
testl %eax, %eax
jne 0x2795b
movq 0x10(%r12), %rdi
callq 0x21b80
movsd %xmm0, 0x10(%rsp)
movq 0x18(%r12), %rdi
callq 0x21b80
movsd %xmm0, 0x8(%rsp)
addl $-0x4, %r13d
movq 0x20(%r12), %rdi
addq $0x20, %r12
callq 0x21b80
movsd 0x10(%rsp), %xmm1
movsd %xmm1, 0x11d221(%rip)   # 0x1448d0
movsd 0x8(%rsp), %xmm1
movsd %xmm1, 0x11d21b(%rip)   # 0x1448d8
movsd %xmm0, 0x11d21b(%rip)   # 0x1448e0
jmp 0x276fd
movl 0x11d19f(%rip), %edx    # 0x14486c
movq %rbp, %rdi
movq %r15, %rsi
callq 0x88046
jmp 0x2776f
movb $0x1, 0x11d980(%rip)    # 0x145064
jmp 0x2776f
addl $-0x2, %r13d
movq 0x10(%r12), %rax
addq $0x10, %r12
movq %rax, 0x11d92b(%rip)    # 0x145028
movq %r12, %r14
movl %r13d, %ebx
jmp 0x2776f
movl $0x1, 0x11d8ed(%rip)    # 0x144ffc
jmp 0x2776f
movl $0x1, 0x11d8d9(%rip)    # 0x144ff4
jmp 0x2776f
movl $0x1, 0x11d8b9(%rip)    # 0x144fe0
jmp 0x2776f
movl $0x1, 0x11d8c5(%rip)    # 0x144ff8
jmp 0x2776f
movl $0x1, 0x11d8e5(%rip)    # 0x145024
jmp 0x2776f
movl $0x1, 0x11d899(%rip)    # 0x144fe4
jmp 0x2776f
movl $0x1, 0x11d891(%rip)    # 0x144fe8
jmp 0x2776f
movl $0x1, 0x11d889(%rip)    # 0x144fec
jmp 0x2776f
movl $0x1, 0x11d881(%rip)    # 0x144ff0
movl %ebx, %r13d
movq %r14, %r12
cmpl $0x1, %ebx
jg 0x274fe
jmp 0x27919
movq 0x10(%r12), %rdi
callq 0x21ee0
movl %eax, 0x118225(%rip)    # 0x13f9b8
addl $-0x3, %r13d
movq 0x18(%r12), %rdi
addq $0x18, %r12
callq 0x21ee0
movl %eax, 0x118211(%rip)    # 0x13f9bc
jmp 0x276fd
movq 0x10(%r12), %rdi
callq 0x21b80
movsd %xmm0, 0x11d0ae(%rip)   # 0x144870
movq 0x18(%r12), %rdi
callq 0x21b80
movsd %xmm0, 0x11d0a4(%rip)   # 0x144878
addl $-0x4, %r13d
movq 0x20(%r12), %rdi
addq $0x20, %r12
callq 0x21b80
movsd %xmm0, 0x11d092(%rip)   # 0x144880
jmp 0x276fd
movq 0x10(%r12), %rdi
callq 0x21b80
movsd %xmm0, 0x10(%rsp)
movq 0x18(%r12), %rdi
callq 0x21b80
movsd %xmm0, 0x8(%rsp)
movq 0x20(%r12), %rdi
callq 0x21b80
movsd %xmm0, 0x40(%rsp)
movq 0x28(%r12), %rdi
callq 0x21b80
movsd %xmm0, 0x48(%rsp)
movq 0x30(%r12), %rdi
callq 0x21b80
movsd %xmm0, 0x38(%rsp)
movq 0x38(%r12), %rdi
callq 0x21b80
movsd %xmm0, 0x30(%rsp)
movq 0x40(%r12), %rdi
callq 0x21b80
movsd %xmm0, 0x28(%rsp)
movq 0x48(%r12), %rdi
callq 0x21b80
movsd %xmm0, 0x20(%rsp)
addl $-0xa, %r13d
movq 0x50(%r12), %rdi
addq $0x50, %r12
callq 0x21b80
movsd %xmm0, 0x18(%rsp)
leaq 0x50(%rsp), %rbx
movq %rbx, %rdi
movsd 0x10(%rsp), %xmm0
movsd 0x8(%rsp), %xmm1
movsd 0x40(%rsp), %xmm2
callq 0x75bae
leaq 0x11cfd7(%rip), %rdi    # 0x144888
movq %rbx, %rsi
callq 0x75f1c
movsd 0x48(%rsp), %xmm0
movsd %xmm0, 0x11cfd9(%rip)   # 0x1448a0
movsd 0x38(%rsp), %xmm0
movsd %xmm0, 0x11cfd3(%rip)   # 0x1448a8
movsd 0x30(%rsp), %xmm0
movsd %xmm0, 0x11cfcd(%rip)   # 0x1448b0
movsd 0x28(%rsp), %xmm0
movsd %xmm0, 0x11cfc7(%rip)   # 0x1448b8
movsd 0x20(%rsp), %xmm0
movsd %xmm0, 0x11cfc1(%rip)   # 0x1448c0
movsd 0x18(%rsp), %xmm0
movsd %xmm0, 0x11cfbb(%rip)   # 0x1448c8
movb $0x1, 0x11d754(%rip)    # 0x145068
jmp 0x276fd
movl $0x1, %ebx
cmpl $0x0, 0x11cf47(%rip)    # 0x14486c
jne 0x27937
leaq 0xb4a2c(%rip), %rdi     # 0xdc35a
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x8ae2e
movl %ebx, %eax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xb4a32(%rip), %rdi     # 0xdc381
callq 0x21ea0
xorl %edi, %edi
callq 0x21af0
leaq 0xb49db(%rip), %rdi     # 0xdc33d
movq %r15, %rsi
xorl %eax, %eax
callq 0x8ae2e
movl $0x1, %edi
callq 0x21af0