// File: /workspace/github_cpp_makefile_star2_O2/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 %r12
pushq %rbx
subq $0x60, %rsp
movq %rsi, %rbx
movl %edi, %r14d
cmpl $0x2, %edi
jne 0x26a04
movq 0x8(%rbx), %rax
cmpb $0x2d, (%rax)
jne 0x26a04
leaq 0x9ed74(%rip), %rdi     # 0xc537e
callq 0x21eb0
xorl %edi, %edi
callq 0x21ae0
leal -0x1(%r14), %ebp
leaq 0x8(%rbx), %r12
movq (%r12), %r15
cmpb $0x2d, (%r15)
jne 0x267d6
cmpb $0x76, 0x1(%r15)
jne 0x2663e
cmpb $0x0, 0x2(%r15)
je 0x26814
leaq 0x9ec71(%rip), %rsi     # 0xc52b6
movq %r15, %rdi
callq 0x21d10
testl %eax, %eax
je 0x267f0
leaq 0x9ec61(%rip), %rsi     # 0xc52bd
movq %r15, %rdi
callq 0x21d10
testl %eax, %eax
je 0x26808
leaq 0x9ec54(%rip), %rsi     # 0xc52c7
movq %r15, %rdi
callq 0x21d10
testl %eax, %eax
je 0x2681d
leaq 0x9ec44(%rip), %rsi     # 0xc52ce
movq %r15, %rdi
callq 0x21d10
testl %eax, %eax
je 0x26829
leaq 0x9ec33(%rip), %rsi     # 0xc52d4
movq %r15, %rdi
callq 0x21d10
testl %eax, %eax
je 0x26835
leaq 0x9ec28(%rip), %rsi     # 0xc52e0
movq %r15, %rdi
callq 0x21d10
testl %eax, %eax
je 0x26841
leaq 0x9ec17(%rip), %rsi     # 0xc52e6
movq %r15, %rdi
callq 0x21d10
testl %eax, %eax
je 0x2684d
leaq 0x9ec0b(%rip), %rsi     # 0xc52f1
movq %r15, %rdi
callq 0x21d10
testl %eax, %eax
je 0x26859
leaq 0x9ebfe(%rip), %rsi     # 0xc52fb
movq %r15, %rdi
callq 0x21d10
testl %eax, %eax
je 0x26865
leaq 0x9ebf3(%rip), %rsi     # 0xc5307
movq %r15, %rdi
callq 0x21d10
testl %eax, %eax
je 0x26874
leaq 0x9ebeb(%rip), %rsi     # 0xc5316
movq %r15, %rdi
callq 0x21d10
testl %eax, %eax
je 0x26883
leaq 0x9ebdc(%rip), %rsi     # 0xc531e
movq %r15, %rdi
callq 0x21d10
testl %eax, %eax
je 0x268ae
leaq 0x9ebd1(%rip), %rsi     # 0xc532a
movq %r15, %rdi
callq 0x21d10
testl %eax, %eax
je 0x268ee
leaq 0x9ebc2(%rip), %rsi     # 0xc5332
movq %r15, %rdi
callq 0x21d10
testl %eax, %eax
jne 0x26a3b
movq 0x10(%rbx), %rdi
callq 0x21b70
movsd %xmm0, 0x8(%rsp)
movq 0x18(%rbx), %rdi
callq 0x21b70
movsd %xmm0, (%rsp)
addl $-0x4, %r14d
movq 0x20(%rbx), %rdi
addq $0x20, %rbx
callq 0x21b70
movsd 0x8(%rsp), %xmm1
movsd %xmm1, 0x10d134(%rip)   # 0x1338f0
movsd (%rsp), %xmm1
movsd %xmm1, 0x10d12f(%rip)   # 0x1338f8
movsd %xmm0, 0x10d12f(%rip)   # 0x133900
jmp 0x26a04
leaq 0x10d0a3(%rip), %rdi    # 0x133880
movq %r15, %rsi
callq 0x26d1e
movq %r12, %rbx
movl %ebp, %r14d
jmp 0x26a04
addl $-0x2, %r14d
movq 0x10(%rbx), %rax
addq $0x10, %rbx
movq %rax, 0x10d845(%rip)    # 0x134048
jmp 0x26a04
movl $0x1, 0x10d80a(%rip)    # 0x13401c
jmp 0x267e5
movb $0x1, 0x10d869(%rip)    # 0x134084
jmp 0x267e5
movl $0x1, 0x10d7ed(%rip)    # 0x134014
jmp 0x267e5
movl $0x1, 0x10d7cd(%rip)    # 0x134000
jmp 0x267e5
movl $0x1, 0x10d7d9(%rip)    # 0x134018
jmp 0x267e5
movl $0x1, 0x10d7f9(%rip)    # 0x134044
jmp 0x267e5
movl $0x1, 0x10d7ad(%rip)    # 0x134004
jmp 0x267e5
movl $0x1, 0x10d7a5(%rip)    # 0x134008
jmp 0x267e5
movl $0x1, 0x10d79d(%rip)    # 0x13400c
jmp 0x267e5
movl $0x1, 0x10d792(%rip)    # 0x134010
jmp 0x267e5
movq 0x10(%rbx), %rdi
callq 0x21ee0
movl %eax, 0x108146(%rip)    # 0x12e9d8
addl $-0x3, %r14d
movq 0x18(%rbx), %rdi
addq $0x18, %rbx
callq 0x21ee0
movl %eax, 0x108133(%rip)    # 0x12e9dc
jmp 0x26a04
movq 0x10(%rbx), %rdi
callq 0x21b70
movsd %xmm0, 0x10cfd1(%rip)   # 0x133890
movq 0x18(%rbx), %rdi
callq 0x21b70
movsd %xmm0, 0x10cfc8(%rip)   # 0x133898
addl $-0x4, %r14d
movq 0x20(%rbx), %rdi
addq $0x20, %rbx
callq 0x21b70
movsd %xmm0, 0x10cfb7(%rip)   # 0x1338a0
jmp 0x26a04
movq 0x10(%rbx), %rdi
callq 0x21b70
movsd %xmm0, 0x8(%rsp)
movq 0x18(%rbx), %rdi
callq 0x21b70
movsd %xmm0, (%rsp)
movq 0x20(%rbx), %rdi
callq 0x21b70
movsd %xmm0, 0x38(%rsp)
movq 0x28(%rbx), %rdi
callq 0x21b70
movsd %xmm0, 0x40(%rsp)
movq 0x30(%rbx), %rdi
callq 0x21b70
movsd %xmm0, 0x30(%rsp)
movq 0x38(%rbx), %rdi
callq 0x21b70
movsd %xmm0, 0x28(%rsp)
movq 0x40(%rbx), %rdi
callq 0x21b70
movsd %xmm0, 0x20(%rsp)
movq 0x48(%rbx), %rdi
callq 0x21b70
movsd %xmm0, 0x18(%rsp)
addl $-0xa, %r14d
movq 0x50(%rbx), %rdi
addq $0x50, %rbx
callq 0x21b70
movsd %xmm0, 0x10(%rsp)
leaq 0x48(%rsp), %r15
movq %r15, %rdi
movsd 0x8(%rsp), %xmm0
movsd (%rsp), %xmm1
movsd 0x38(%rsp), %xmm2
callq 0x6b148
leaq 0x10cf07(%rip), %rdi    # 0x1338a8
movq %r15, %rsi
callq 0x6b432
movsd 0x40(%rsp), %xmm0
movsd %xmm0, 0x10cf09(%rip)   # 0x1338c0
movsd 0x30(%rsp), %xmm0
movsd %xmm0, 0x10cf03(%rip)   # 0x1338c8
movsd 0x28(%rsp), %xmm0
movsd %xmm0, 0x10cefd(%rip)   # 0x1338d0
movsd 0x20(%rsp), %xmm0
movsd %xmm0, 0x10cef7(%rip)   # 0x1338d8
movsd 0x18(%rsp), %xmm0
movsd %xmm0, 0x10cef1(%rip)   # 0x1338e0
movsd 0x10(%rsp), %xmm0
movsd %xmm0, 0x10ceeb(%rip)   # 0x1338e8
movb $0x1, 0x10d684(%rip)    # 0x134088
cmpl $0x2, %r14d
jge 0x26616
cmpl $0x0, 0x10ce77(%rip)    # 0x13388c
je 0x26a1c
pushq $0x1
popq %rbx
jmp 0x26a2c
leaq 0x9e934(%rip), %rdi     # 0xc5357
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x7e112
movl %ebx, %eax
addq $0x60, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
leaq 0x9e8f8(%rip), %rdi     # 0xc533a
movq %r15, %rsi
xorl %eax, %eax
callq 0x7e112
pushq $0x1
popq %rdi
callq 0x21ae0