// File: tomfunkhouser[P]gaps/apps/sflinfo/sflinfo.cpp
// Function: ParseArgs(int, char**)
static int 
ParseArgs(int argc, char **argv)
{
  // Check number of program arguments
  if (argc < 3) {
    printf("Usage: sflinfo scenefile databasefile [options]\n");
    return 0;
  }

  // File names are first three arguments
  input_scene_name = argv[1];
  input_database_name = argv[2];

  // Parse arguments
  argc -= 3; argv += 3;
  while (argc > 0) {
    if (!strcmp(*argv, "-v")) { print_labels = 1; print_objects = 1; }
    else if (!strcmp(*argv, "-comments")) { print_comments = 1; }
    else if (!strcmp(*argv, "-features")) { print_features = 1; }
    else if (!strcmp(*argv, "-objects")) { print_objects = 1; }
    else if (!strcmp(*argv, "-labels")) { print_labels = 1; }
    else if (!strcmp(*argv, "-label_list")) { print_label_list = 1; }
    else if (!strcmp(*argv, "-properties")) { print_object_properties = print_label_properties = 1; }
    else if (!strcmp(*argv, "-object_properties")) { print_object_properties = 1; }
    else if (!strcmp(*argv, "-label_properties")) { print_label_properties = 1; }
    else if (!strcmp(*argv, "-object_relationships")) { print_object_relationships = 1; }
    else if (!strcmp(*argv, "-label_relationships")) { print_label_relationships = 1; }
    else if (!strcmp(*argv, "-assignments")) { print_label_assignments = 1; }
    else if (!strcmp(*argv, "-assignment_counts")) { print_label_assignment_counts = 1; }
    else if (!strcmp(*argv, "-tree")) { print_tree = 1; }
    else if (!strcmp(*argv, "-nodes")) { print_nodes = 1; }
    else if (!strcmp(*argv, "-database")) { print_database = 1; }
    else if (!strcmp(*argv, "-blocks")) { print_blocks = 1; }
    else if (!strcmp(*argv, "-surfels")) { print_surfels = 1; }
    else if (!strcmp(*argv, "-scans")) { print_scans = 1; }
    else if (!strcmp(*argv, "-images")) { print_images = 1; }
    else if (!strcmp(*argv, "-query")) { argc--; argv++; query_name = *argv; }
    else if (!strcmp(*argv, "-accuracy")) { argc--; argv++; accuracy_arff_name = *argv; }
    else { RNFail("Invalid program argument: %s", *argv); exit(1); }
    argv++; argc--;
  }

  // Return OK status 
  return 1;
}

// Assembly:
subq $0x18, %rsp
movl %edi, 0x10(%rsp)
movq %rsi, 0x8(%rsp)
cmpl $0x3, 0x10(%rsp)
jge 0x166df
leaq 0x19295d(%rip), %rdi    # 0x1a9028
movb $0x0, %al
callq 0x13070
movl $0x0, 0x14(%rsp)
jmp 0x16b4d
movq 0x8(%rsp), %rax
movq 0x8(%rax), %rax
movq %rax, 0x1ebed9(%rip)    # 0x2025c8
movq 0x8(%rsp), %rax
movq 0x10(%rax), %rax
movq %rax, 0x1ebed1(%rip)    # 0x2025d0
movl 0x10(%rsp), %eax
subl $0x3, %eax
movl %eax, 0x10(%rsp)
movq 0x8(%rsp), %rax
addq $0x18, %rax
movq %rax, 0x8(%rsp)
cmpl $0x0, 0x10(%rsp)
jle 0x16b45
movq 0x8(%rsp), %rax
movq (%rax), %rdi
leaq 0x192927(%rip), %rsi    # 0x1a9059
callq 0x137e0
cmpl $0x0, %eax
jne 0x16755
movl $0x1, 0x1ebe92(%rip)    # 0x2025d8
movl $0x1, 0x1ebe8c(%rip)    # 0x2025dc
jmp 0x16b27
movq 0x8(%rsp), %rax
movq (%rax), %rdi
leaq 0x1928f8(%rip), %rsi    # 0x1a905c
callq 0x137e0
cmpl $0x0, %eax
jne 0x1677d
movl $0x1, 0x1ebe68(%rip)    # 0x2025e0
jmp 0x16b25
movq 0x8(%rsp), %rax
movq (%rax), %rdi
leaq 0x1928da(%rip), %rsi    # 0x1a9066
callq 0x137e0
cmpl $0x0, %eax
jne 0x167a5
movl $0x1, 0x1ebe44(%rip)    # 0x2025e4
jmp 0x16b23
movq 0x8(%rsp), %rax
movq (%rax), %rdi
leaq 0x1928bc(%rip), %rsi    # 0x1a9070
callq 0x137e0
cmpl $0x0, %eax
jne 0x167cd
movl $0x1, 0x1ebe14(%rip)    # 0x2025dc
jmp 0x16b21
movq 0x8(%rsp), %rax
movq (%rax), %rdi
leaq 0x19289d(%rip), %rsi    # 0x1a9079
callq 0x137e0
cmpl $0x0, %eax
jne 0x167f5
movl $0x1, 0x1ebde8(%rip)    # 0x2025d8
jmp 0x16b1f
movq 0x8(%rsp), %rax
movq (%rax), %rdi
leaq 0x19287d(%rip), %rsi    # 0x1a9081
callq 0x137e0
cmpl $0x0, %eax
jne 0x1681d
movl $0x1, 0x1ebdd0(%rip)    # 0x2025e8
jmp 0x16b1d
movq 0x8(%rsp), %rax
movq (%rax), %rdi
leaq 0x192861(%rip), %rsi    # 0x1a908d
callq 0x137e0
cmpl $0x0, %eax
jne 0x1684f
movl $0x1, 0x1ebdac(%rip)    # 0x2025ec
movl $0x1, 0x1ebda6(%rip)    # 0x2025f0
jmp 0x16b1b
movq 0x8(%rsp), %rax
movq (%rax), %rdi
leaq 0x19283b(%rip), %rsi    # 0x1a9099
callq 0x137e0
cmpl $0x0, %eax
jne 0x16877
movl $0x1, 0x1ebd7e(%rip)    # 0x2025f0
jmp 0x16b19
movq 0x8(%rsp), %rax
movq (%rax), %rdi
leaq 0x192826(%rip), %rsi    # 0x1a90ac
callq 0x137e0
cmpl $0x0, %eax
jne 0x1689f
movl $0x1, 0x1ebd52(%rip)    # 0x2025ec
jmp 0x16b17
movq 0x8(%rsp), %rax
movq (%rax), %rdi
leaq 0x192810(%rip), %rsi    # 0x1a90be
callq 0x137e0
cmpl $0x0, %eax
jne 0x168c7
movl $0x1, 0x1ebd32(%rip)    # 0x2025f4
jmp 0x16b15
movq 0x8(%rsp), %rax
movq (%rax), %rdi
leaq 0x1927fe(%rip), %rsi    # 0x1a90d4
callq 0x137e0
cmpl $0x0, %eax
jne 0x168ef
movl $0x1, 0x1ebd0e(%rip)    # 0x2025f8
jmp 0x16b13
movq 0x8(%rsp), %rax
movq (%rax), %rdi
leaq 0x1927eb(%rip), %rsi    # 0x1a90e9
callq 0x137e0
cmpl $0x0, %eax
jne 0x16917
movl $0x1, 0x1ebcea(%rip)    # 0x2025fc
jmp 0x16b11
movq 0x8(%rsp), %rax
movq (%rax), %rdi
leaq 0x1927d0(%rip), %rsi    # 0x1a90f6
callq 0x137e0
cmpl $0x0, %eax
jne 0x1693f
movl $0x1, 0x1ebcc6(%rip)    # 0x202600
jmp 0x16b0f
movq 0x8(%rsp), %rax
movq (%rax), %rdi
leaq 0x1927bb(%rip), %rsi    # 0x1a9109
callq 0x137e0
cmpl $0x0, %eax
jne 0x16967
movl $0x1, 0x1ebca2(%rip)    # 0x202604
jmp 0x16b0d
movq 0x8(%rsp), %rax
movq (%rax), %rdi
leaq 0x192799(%rip), %rsi    # 0x1a910f
callq 0x137e0
cmpl $0x0, %eax
jne 0x1698f
movl $0x1, 0x1ebc7e(%rip)    # 0x202608
jmp 0x16b0b
movq 0x8(%rsp), %rax
movq (%rax), %rdi
leaq 0x192778(%rip), %rsi    # 0x1a9116
callq 0x137e0
cmpl $0x0, %eax
jne 0x169b7
movl $0x1, 0x1ebc5a(%rip)    # 0x20260c
jmp 0x16b09
movq 0x8(%rsp), %rax
movq (%rax), %rdi
leaq 0x19275a(%rip), %rsi    # 0x1a9120
callq 0x137e0
cmpl $0x0, %eax
jne 0x169df
movl $0x1, 0x1ebc36(%rip)    # 0x202610
jmp 0x16b07
movq 0x8(%rsp), %rax
movq (%rax), %rdi
leaq 0x19273a(%rip), %rsi    # 0x1a9128
callq 0x137e0
cmpl $0x0, %eax
jne 0x16a07
movl $0x1, 0x1ebc12(%rip)    # 0x202614
jmp 0x16b05
movq 0x8(%rsp), %rax
movq (%rax), %rdi
leaq 0x19271b(%rip), %rsi    # 0x1a9131
callq 0x137e0
cmpl $0x0, %eax
jne 0x16a2f
movl $0x1, 0x1ebbee(%rip)    # 0x202618
jmp 0x16b03
movq 0x8(%rsp), %rax
movq (%rax), %rdi
leaq 0x1926fa(%rip), %rsi    # 0x1a9138
callq 0x137e0
cmpl $0x0, %eax
jne 0x16a57
movl $0x1, 0x1ebbca(%rip)    # 0x20261c
jmp 0x16b01
movq 0x8(%rsp), %rax
movq (%rax), %rdi
leaq 0x1926da(%rip), %rsi    # 0x1a9140
callq 0x137e0
cmpl $0x0, %eax
jne 0x16a9a
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, 0x1ebb88(%rip)    # 0x202620
jmp 0x16aff
movq 0x8(%rsp), %rax
movq (%rax), %rdi
leaq 0x19269e(%rip), %rsi    # 0x1a9147
callq 0x137e0
cmpl $0x0, %eax
jne 0x16add
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, 0x1ebb4d(%rip)    # 0x202628
jmp 0x16afd
movq 0x8(%rsp), %rax
movq (%rax), %rsi
leaq 0x192665(%rip), %rdi    # 0x1a9151
movb $0x0, %al
callq 0x14b6f0
movl $0x1, %edi
callq 0x136b0
jmp 0x16aff
jmp 0x16b01
jmp 0x16b03
jmp 0x16b05
jmp 0x16b07
jmp 0x16b09
jmp 0x16b0b
jmp 0x16b0d
jmp 0x16b0f
jmp 0x16b11
jmp 0x16b13
jmp 0x16b15
jmp 0x16b17
jmp 0x16b19
jmp 0x16b1b
jmp 0x16b1d
jmp 0x16b1f
jmp 0x16b21
jmp 0x16b23
jmp 0x16b25
jmp 0x16b27
movq 0x8(%rsp), %rax
addq $0x8, %rax
movq %rax, 0x8(%rsp)
movl 0x10(%rsp), %eax
addl $-0x1, %eax
movl %eax, 0x10(%rsp)
jmp 0x16718
movl $0x1, 0x14(%rsp)
movl 0x14(%rsp), %eax
addq $0x18, %rsp
retq
nopw %cs:(%rax,%rax)