// File: /workspace/github_cpp_makefile_star2_O3/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 0x2749e
movq 0x8(%r12), %rax
cmpb $0x2d, (%rax)
jne 0x274a4
leaq 0xb2eec(%rip), %rdi     # 0xda37e
callq 0x21e90
xorl %edi, %edi
callq 0x21ae0
jl 0x278be
leaq 0x11b3b5(%rip), %rbp    # 0x142860
leal -0x1(%r13), %ebx
leaq 0x8(%r12), %r14
movq 0x8(%r12), %r15
cmpb $0x2d, (%r15)
jne 0x2766f
cmpb $0x76, 0x1(%r15)
jne 0x274d5
cmpb $0x0, 0x2(%r15)
je 0x276ad
movq %r15, %rdi
leaq 0xb2dd7(%rip), %rsi     # 0xda2b6
callq 0x21ce0
testl %eax, %eax
je 0x27685
movq %r15, %rdi
leaq 0xb2dc7(%rip), %rsi     # 0xda2bd
callq 0x21ce0
testl %eax, %eax
je 0x276a1
movq %r15, %rdi
leaq 0xb2dba(%rip), %rsi     # 0xda2c7
callq 0x21ce0
testl %eax, %eax
je 0x276b6
movq %r15, %rdi
leaq 0xb2daa(%rip), %rsi     # 0xda2ce
callq 0x21ce0
testl %eax, %eax
je 0x276c2
movq %r15, %rdi
leaq 0xb2d99(%rip), %rsi     # 0xda2d4
callq 0x21ce0
testl %eax, %eax
je 0x276ce
movq %r15, %rdi
leaq 0xb2d8e(%rip), %rsi     # 0xda2e0
callq 0x21ce0
testl %eax, %eax
je 0x276da
movq %r15, %rdi
leaq 0xb2d7d(%rip), %rsi     # 0xda2e6
callq 0x21ce0
testl %eax, %eax
je 0x276e6
movq %r15, %rdi
leaq 0xb2d71(%rip), %rsi     # 0xda2f1
callq 0x21ce0
testl %eax, %eax
je 0x276f2
movq %r15, %rdi
leaq 0xb2d64(%rip), %rsi     # 0xda2fb
callq 0x21ce0
testl %eax, %eax
je 0x276fe
movq %r15, %rdi
leaq 0xb2d59(%rip), %rsi     # 0xda307
callq 0x21ce0
testl %eax, %eax
je 0x2770a
movq %r15, %rdi
leaq 0xb2d51(%rip), %rsi     # 0xda316
callq 0x21ce0
testl %eax, %eax
je 0x27728
movq %r15, %rdi
leaq 0xb2d42(%rip), %rsi     # 0xda31e
callq 0x21ce0
testl %eax, %eax
je 0x27755
movq %r15, %rdi
leaq 0xb2d37(%rip), %rsi     # 0xda32a
callq 0x21ce0
testl %eax, %eax
je 0x27798
movq %r15, %rdi
leaq 0xb2d28(%rip), %rsi     # 0xda332
callq 0x21ce0
testl %eax, %eax
jne 0x278ed
movq 0x10(%r12), %rdi
callq 0x21b70
movsd %xmm0, 0x10(%rsp)
movq 0x18(%r12), %rdi
callq 0x21b70
movsd %xmm0, 0x8(%rsp)
addl $-0x4, %r13d
movq 0x20(%r12), %rdi
addq $0x20, %r12
callq 0x21b70
movsd 0x10(%rsp), %xmm1
movsd %xmm1, 0x11b279(%rip)   # 0x1428d0
movsd 0x8(%rsp), %xmm1
movsd %xmm1, 0x11b273(%rip)   # 0x1428d8
movsd %xmm0, 0x11b273(%rip)   # 0x1428e0
jmp 0x27699
movl 0x11b1f7(%rip), %edx    # 0x14286c
movq %rbp, %rdi
movq %r15, %rsi
callq 0x86eea
jmp 0x27714
addl $-0x2, %r13d
movq 0x10(%r12), %rax
addq $0x10, %r12
movq %rax, 0x11b98f(%rip)    # 0x143028
movq %r12, %r14
movl %r13d, %ebx
jmp 0x27714
movl $0x1, 0x11b951(%rip)    # 0x142ffc
jmp 0x27714
movb $0x1, 0x11b9b0(%rip)    # 0x143064
jmp 0x27714
movl $0x1, 0x11b934(%rip)    # 0x142ff4
jmp 0x27714
movl $0x1, 0x11b914(%rip)    # 0x142fe0
jmp 0x27714
movl $0x1, 0x11b920(%rip)    # 0x142ff8
jmp 0x27714
movl $0x1, 0x11b940(%rip)    # 0x143024
jmp 0x27714
movl $0x1, 0x11b8f4(%rip)    # 0x142fe4
jmp 0x27714
movl $0x1, 0x11b8ec(%rip)    # 0x142fe8
jmp 0x27714
movl $0x1, 0x11b8e4(%rip)    # 0x142fec
jmp 0x27714
movl $0x1, 0x11b8dc(%rip)    # 0x142ff0
movl %ebx, %r13d
movq %r14, %r12
cmpl $0x1, %ebx
jg 0x274ab
jmp 0x278be
movq 0x10(%r12), %rdi
callq 0x21ed0
movl %eax, 0x116280(%rip)    # 0x13d9b8
addl $-0x3, %r13d
movq 0x18(%r12), %rdi
addq $0x18, %r12
callq 0x21ed0
movl %eax, 0x11626c(%rip)    # 0x13d9bc
jmp 0x27699
movq 0x10(%r12), %rdi
callq 0x21b70
movsd %xmm0, 0x11b109(%rip)   # 0x142870
movq 0x18(%r12), %rdi
callq 0x21b70
movsd %xmm0, 0x11b0ff(%rip)   # 0x142878
addl $-0x4, %r13d
movq 0x20(%r12), %rdi
addq $0x20, %r12
callq 0x21b70
movsd %xmm0, 0x11b0ed(%rip)   # 0x142880
jmp 0x27699
movq 0x10(%r12), %rdi
callq 0x21b70
movsd %xmm0, 0x10(%rsp)
movq 0x18(%r12), %rdi
callq 0x21b70
movsd %xmm0, 0x8(%rsp)
movq 0x20(%r12), %rdi
callq 0x21b70
movsd %xmm0, 0x40(%rsp)
movq 0x28(%r12), %rdi
callq 0x21b70
movsd %xmm0, 0x48(%rsp)
movq 0x30(%r12), %rdi
callq 0x21b70
movsd %xmm0, 0x38(%rsp)
movq 0x38(%r12), %rdi
callq 0x21b70
movsd %xmm0, 0x30(%rsp)
movq 0x40(%r12), %rdi
callq 0x21b70
movsd %xmm0, 0x28(%rsp)
movq 0x48(%r12), %rdi
callq 0x21b70
movsd %xmm0, 0x20(%rsp)
addl $-0xa, %r13d
movq 0x50(%r12), %rdi
addq $0x50, %r12
callq 0x21b70
movsd %xmm0, 0x18(%rsp)
leaq 0x50(%rsp), %rbx
movq %rbx, %rdi
movsd 0x10(%rsp), %xmm0
movsd 0x8(%rsp), %xmm1
movsd 0x40(%rsp), %xmm2
callq 0x74c92
leaq 0x11b032(%rip), %rdi    # 0x142888
movq %rbx, %rsi
callq 0x74ffa
movsd 0x48(%rsp), %xmm0
movsd %xmm0, 0x11b034(%rip)   # 0x1428a0
movsd 0x38(%rsp), %xmm0
movsd %xmm0, 0x11b02e(%rip)   # 0x1428a8
movsd 0x30(%rsp), %xmm0
movsd %xmm0, 0x11b028(%rip)   # 0x1428b0
movsd 0x28(%rsp), %xmm0
movsd %xmm0, 0x11b022(%rip)   # 0x1428b8
movsd 0x20(%rsp), %xmm0
movsd %xmm0, 0x11b01c(%rip)   # 0x1428c0
movsd 0x18(%rsp), %xmm0
movsd %xmm0, 0x11b016(%rip)   # 0x1428c8
movb $0x1, 0x11b7af(%rip)    # 0x143068
jmp 0x27699
movl $0x1, %ebx
cmpl $0x0, 0x11afa2(%rip)    # 0x14286c
jne 0x278dc
leaq 0xb2a84(%rip), %rdi     # 0xda357
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x899c6
movl %ebx, %eax
addq $0x68, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xb2a46(%rip), %rdi     # 0xda33a
movq %r15, %rsi
xorl %eax, %eax
callq 0x899c6
movl $0x1, %edi
callq 0x21ae0