// File: tomfunkhouser[P]gaps/apps/scninfo/scninfo.cpp
// Function: ParseArgs(int, char**)
static int 
ParseArgs(int argc, char **argv)
{
  // Parse arguments
  argc--; argv++;
  while (argc > 0) {
    if ((*argv)[0] == '-') {
      if (!strcmp(*argv, "-nodes")) print_nodes = 1; 
      else if (!strcmp(*argv, "-nodes")) print_nodes = 1; 
      else if (!strcmp(*argv, "-elements")) print_elements = 1; 
      else if (!strcmp(*argv, "-references")) print_references = 1; 
      else if (!strcmp(*argv, "-lights")) print_lights = 1; 
      else if (!strcmp(*argv, "-brdfs")) print_brdfs = 1; 
      else if (!strcmp(*argv, "-textures")) print_textures = 1; 
      else if (!strcmp(*argv, "-materials")) print_materials = 1; 
      else if (!strcmp(*argv, "-remove_references")) remove_references = 1; 
      else if (!strcmp(*argv, "-remove_hierarchy")) remove_hierarchy = 1; 
      else if (!strcmp(*argv, "-remove_transformations")) remove_transformations = 1;
      else if (!strcmp(*argv, "-categories")) { argc--; argv++; input_categories_name = *argv; }
      else { RNFail("Invalid program argument: %s", *argv); exit(1); }
      argv++; argc--;
    }
    else {
      if (!input_scene_name) input_scene_name = *argv;
      else { RNFail("Invalid program argument: %s", *argv); exit(1); }
      argv++; argc--;
    }
  }

  // Check scene filename
  if (!input_scene_name) {
    RNFail("Usage: scninfo inputscenefile [options]\n");
    return 0;
  }

  // Return OK status 
  return 1;
}

// Assembly:
subq $0x18, %rsp
movl %edi, 0x10(%rsp)
movq %rsi, 0x8(%rsp)
movl 0x10(%rsp), %eax
addl $-0x1, %eax
movl %eax, 0x10(%rsp)
movq 0x8(%rsp), %rax
addq $0x8, %rax
movq %rax, 0x8(%rsp)
cmpl $0x0, 0x10(%rsp)
jle 0x27007
movq 0x8(%rsp), %rax
movq (%rax), %rax
movsbl (%rax), %eax
cmpl $0x2d, %eax
jne 0x26fae
movq 0x8(%rsp), %rax
movq (%rax), %rdi
leaq 0x1652ac(%rip), %rsi    # 0x18c020
callq 0x22e60
cmpl $0x0, %eax
jne 0x26d8d
movl $0x1, 0x1d2d80(%rip)    # 0x1f9b08
jmp 0x26f93
movq 0x8(%rsp), %rax
movq (%rax), %rdi
leaq 0x165284(%rip), %rsi    # 0x18c020
callq 0x22e60
cmpl $0x0, %eax
jne 0x26db5
movl $0x1, 0x1d2d58(%rip)    # 0x1f9b08
jmp 0x26f91
movq 0x8(%rsp), %rax
movq (%rax), %rdi
leaq 0x165263(%rip), %rsi    # 0x18c027
callq 0x22e60
cmpl $0x0, %eax
jne 0x26ddd
movl $0x1, 0x1d2d34(%rip)    # 0x1f9b0c
jmp 0x26f8f
movq 0x8(%rsp), %rax
movq (%rax), %rdi
leaq 0x165245(%rip), %rsi    # 0x18c031
callq 0x22e60
cmpl $0x0, %eax
jne 0x26e05
movl $0x1, 0x1d2d10(%rip)    # 0x1f9b10
jmp 0x26f8d
movq 0x8(%rsp), %rax
movq (%rax), %rdi
leaq 0x165229(%rip), %rsi    # 0x18c03d
callq 0x22e60
cmpl $0x0, %eax
jne 0x26e2d
movl $0x1, 0x1d2cec(%rip)    # 0x1f9b14
jmp 0x26f8b
movq 0x8(%rsp), %rax
movq (%rax), %rdi
leaq 0x165209(%rip), %rsi    # 0x18c045
callq 0x22e60
cmpl $0x0, %eax
jne 0x26e55
movl $0x1, 0x1d2cc8(%rip)    # 0x1f9b18
jmp 0x26f89
movq 0x8(%rsp), %rax
movq (%rax), %rdi
leaq 0x1651e8(%rip), %rsi    # 0x18c04c
callq 0x22e60
cmpl $0x0, %eax
jne 0x26e7d
movl $0x1, 0x1d2ca4(%rip)    # 0x1f9b1c
jmp 0x26f87
movq 0x8(%rsp), %rax
movq (%rax), %rdi
leaq 0x1651ca(%rip), %rsi    # 0x18c056
callq 0x22e60
cmpl $0x0, %eax
jne 0x26ea5
movl $0x1, 0x1d2c80(%rip)    # 0x1f9b20
jmp 0x26f85
movq 0x8(%rsp), %rax
movq (%rax), %rdi
leaq 0x1651ad(%rip), %rsi    # 0x18c061
callq 0x22e60
cmpl $0x0, %eax
jne 0x26ecd
movl $0x1, 0x1d2c5c(%rip)    # 0x1f9b24
jmp 0x26f83
movq 0x8(%rsp), %rax
movq (%rax), %rdi
leaq 0x165198(%rip), %rsi    # 0x18c074
callq 0x22e60
cmpl $0x0, %eax
jne 0x26ef5
movl $0x1, 0x1d2c38(%rip)    # 0x1f9b28
jmp 0x26f81
movq 0x8(%rsp), %rax
movq (%rax), %rdi
leaq 0x165182(%rip), %rsi    # 0x18c086
callq 0x22e60
cmpl $0x0, %eax
jne 0x26f1a
movl $0x1, 0x1d2c14(%rip)    # 0x1f9b2c
jmp 0x26f7f
movq 0x8(%rsp), %rax
movq (%rax), %rdi
leaq 0x165175(%rip), %rsi    # 0x18c09e
callq 0x22e60
cmpl $0x0, %eax
jne 0x26f5d
movl 0x10(%rsp), %eax
addl $-0x1, %eax
movl %eax, 0x10(%rsp)
movq 0x8(%rsp), %rax
addq $0x8, %rax
movq %rax, 0x8(%rsp)
movq 0x8(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x1d2ba5(%rip)    # 0x1f9b00
jmp 0x26f7d
movq 0x8(%rsp), %rax
movq (%rax), %rsi
leaq 0x16513e(%rip), %rdi    # 0x18c0aa
movb $0x0, %al
callq 0xf1970
movl $0x1, %edi
callq 0x22c00
jmp 0x26f7f
jmp 0x26f81
jmp 0x26f83
jmp 0x26f85
jmp 0x26f87
jmp 0x26f89
jmp 0x26f8b
jmp 0x26f8d
jmp 0x26f8f
jmp 0x26f91
jmp 0x26f93
movq 0x8(%rsp), %rax
addq $0x8, %rax
movq %rax, 0x8(%rsp)
movl 0x10(%rsp), %eax
addl $-0x1, %eax
movl %eax, 0x10(%rsp)
jmp 0x27002
cmpq $0x0, 0x1d2b42(%rip)    # 0x1f9af8
jne 0x26fc9
movq 0x8(%rsp), %rax
movq (%rax), %rax
movq %rax, 0x1d2b31(%rip)    # 0x1f9af8
jmp 0x26fe9
movq 0x8(%rsp), %rax
movq (%rax), %rsi
leaq 0x1650d2(%rip), %rdi    # 0x18c0aa
movb $0x0, %al
callq 0xf1970
movl $0x1, %edi
callq 0x22c00
movq 0x8(%rsp), %rax
addq $0x8, %rax
movq %rax, 0x8(%rsp)
movl 0x10(%rsp), %eax
addl $-0x1, %eax
movl %eax, 0x10(%rsp)
jmp 0x26d46
cmpq $0x0, 0x1d2ae9(%rip)    # 0x1f9af8
jne 0x27029
leaq 0x1650af(%rip), %rdi    # 0x18c0c7
movb $0x0, %al
callq 0xf1970
movl $0x0, 0x14(%rsp)
jmp 0x27031
movl $0x1, 0x14(%rsp)
movl 0x14(%rsp), %eax
addq $0x18, %rsp
retq
nopw (%rax,%rax)