// File: /workspace/github_c_makefile_star2_O3/7402[P]randwords/main.c
// Function: main
int main(int argc, const char * argv[]) {
    int max_index = word_count() - 1;
    int from_index = 0;
    int to_index = max_index;
    bool error = false;
    bool silent = false;
    int words_per_row = 5;
    int word_count = 35;
    
    for (int index = 1; index < argc && !error; index++) {
        //  -f from
        if (strcmp(argv[index], "-f") == 0 && index + 1 < argc) {
            from_index = atoi(argv[++index]) - 1;
            error = from_index < 0 || from_index > max_index || from_index > to_index;
            
        //  -t to
        } else if (strcmp(argv[index], "-t") == 0 && index + 1 < argc) {
            to_index = atoi(argv[++index]) - 1;
            error = to_index < 0 || to_index > max_index || from_index > to_index;
            
        //  -c words_per_row
        } else if (strcmp(argv[index], "-c") == 0 && index + 1 < argc) {
            words_per_row = atoi(argv[++index]);
            error = words_per_row < 1 || words_per_row > 100;
            
        //  -n number_of_words
        } else if (strcmp(argv[index], "-n") == 0 && index + 1 < argc) {
            word_count = atoi(argv[++index]);
            error = word_count < 0 || word_count > 5000;
            
        //  -v --version       print version
        } else if ((strcmp(argv[index], "--version") == 0) ||
                   (strcmp(argv[index], "-v") == 0)) {
            printf("randwords 0.9.2\n");
            silent = true;

        //  -h --help       print help for randwords
        } else if ((strcmp(argv[index], "--help") == 0) ||
                   (strcmp(argv[index], "-h") == 0)) {
            printf("Generates a series of random words.\n"
                   "Usage:\n"
                   "  randwords [-c <words_per_row] [-n <number_of_words>]\n"
                   "            [-f <from_word_number>] [-t <to_word_number>]\n"
                   "  randwords -h | --help\n"
                   "  randwords -v | --version\n"
                   "  randwords --license\n"
                   "  randwords --man-page\n"
                   "\n"
                   "Options:\n"
                   "  -c <words_per_row>     Number of words per row [default: 5]\n"
                   "  -n <number_of_words>   Number of words to print [default: 35]\n"
                   "  -f <from_word_number>  Include words from list beginning at this number [default: 1]\n"
                   "  -t <to_word_number>    Include words from list up to this number [default: 5000]\n"
                   "  -h --help     Show this screen.\n"
                   "  --version     Show version.\n"
                   "  --license     Show software copyright and license\n"
                   "  --man_page    Show source for man page\n");
            silent = true;
            
        //  --man-page      print source for man page
        } else if (strcmp(argv[index], "--man-page") == 0) {
            man_page_source();
            silent = true;
            
        //  --licence       print copyright and license
        } else if (strcmp(argv[index], "--license") == 0) {
            license();
            silent = true;;
            
        } else {
            error = true;
        }
    }
    
    if (silent) {
        
    } else if (error) {
        fprintf(stderr, "Error: invalid options\n");
        
    } else {
        if (print_words(from_index, to_index, words_per_row, word_count)) {
            printf("error: unable to print\n");
        }
    }
    
    return error ? 1 : 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rsi, 0x10(%rsp)
movl %edi, %r12d
callq 0x1e8e4
movq %rax, 0x20(%rsp)
leal -0x1(%rax), %esi
cmpl $0x2, %r12d
jge 0x1e228
movl $0x23, %ecx
movl $0x5, %edx
xorl %edi, %edi
xorl %ebx, %ebx
jmp 0x1e47f
movl %esi, 0xc(%rsp)
movl $0x0, 0x4(%rsp)
movl $0x5, 0x1c(%rsp)
movl $0x23, 0x18(%rsp)
movl $0x1, %ebx
xorl %r14d, %r14d
movl $0x0, 0x8(%rsp)
movslq %ebx, %rax
movq 0x10(%rsp), %rcx
movq (%rcx,%rax,8), %r13
movb (%r13), %bpl
cmpb $0x2d, %bpl
jne 0x1e2b8
cmpb $0x66, 0x1(%r13)
jne 0x1e2d4
cmpb $0x0, 0x2(%r13)
jne 0x1e2d4
leal 0x1(%rbx), %r15d
cmpl %r12d, %r15d
jge 0x1e2d4
movslq %r15d, %rax
movq 0x10(%rsp), %rcx
movq (%rcx,%rax,8), %rdi
callq 0x1e0c0
leal -0x1(%rax), %edx
testl %eax, %eax
setle %cl
cmpl 0x20(%rsp), %eax
setg %r14b
movl %edx, 0x8(%rsp)
cmpl 0xc(%rsp), %edx
setg %al
orb %cl, %r14b
orb %al, %r14b
jmp 0x1e38b
movq %r13, %rdi
leaq 0xdae(%rip), %rsi       # 0x1f070
callq 0x1e0a0
testl %eax, %eax
jne 0x1e3cf
jmp 0x1e425
cmpb $0x74, 0x1(%r13)
jne 0x1e31e
cmpb $0x0, 0x2(%r13)
jne 0x1e31e
leal 0x1(%rbx), %r15d
cmpl %r12d, %r15d
jge 0x1e31e
movslq %r15d, %rax
movq 0x10(%rsp), %rcx
movq (%rcx,%rax,8), %rdi
callq 0x1e0c0
leal -0x1(%rax), %ecx
movl %ecx, 0xc(%rsp)
testl %eax, %eax
setle %cl
cmpl 0x20(%rsp), %eax
setg %dl
orb %cl, %dl
cmpl %eax, 0x8(%rsp)
setge %r14b
orb %dl, %r14b
jmp 0x1e38b
cmpb $0x63, 0x1(%r13)
jne 0x1e356
cmpb $0x0, 0x2(%r13)
jne 0x1e356
leal 0x1(%rbx), %r15d
cmpl %r12d, %r15d
jge 0x1e356
movslq %r15d, %rax
movq 0x10(%rsp), %rcx
movq (%rcx,%rax,8), %rdi
callq 0x1e0c0
movl %eax, 0x1c(%rsp)
addl $-0x65, %eax
cmpl $-0x64, %eax
setb %r14b
jmp 0x1e38b
cmpb $0x6e, 0x1(%r13)
jne 0x1e393
cmpb $0x0, 0x2(%r13)
jne 0x1e393
leal 0x1(%rbx), %r15d
cmpl %r12d, %r15d
jge 0x1e393
movslq %r15d, %rax
movq 0x10(%rsp), %rcx
movq (%rcx,%rax,8), %rdi
callq 0x1e0c0
movl %eax, 0x18(%rsp)
cmpl $0x1389, %eax           # imm = 0x1389
setae %r14b
movl %r15d, %ebx
jmp 0x1e449
movq %r13, %rdi
leaq 0xcd3(%rip), %rsi       # 0x1f070
callq 0x1e0a0
testl %eax, %eax
je 0x1e425
cmpb $0x2d, %bpl
jne 0x1e3cf
cmpb $0x76, 0x1(%r13)
jne 0x1e3ba
cmpb $0x0, 0x2(%r13)
je 0x1e425
movq %r13, %rdi
leaq 0xcb6(%rip), %rsi       # 0x1f07a
callq 0x1e0a0
testl %eax, %eax
jne 0x1e3e8
jmp 0x1e42e
movq %r13, %rdi
leaq 0xca1(%rip), %rsi       # 0x1f07a
callq 0x1e0a0
testl %eax, %eax
je 0x1e42e
cmpb $0x2d, %bpl
jne 0x1e3f6
cmpb $0x68, 0x1(%r13)
jne 0x1e3f6
cmpb $0x0, 0x2(%r13)
je 0x1e42e
movq %r13, %rdi
leaq 0xc81(%rip), %rsi       # 0x1f081
callq 0x1e0a0
testl %eax, %eax
je 0x1e437
movq %r13, %rdi
leaq 0xc79(%rip), %rsi       # 0x1f08c
callq 0x1e0a0
testl %eax, %eax
jne 0x1e495
leaq 0x15b6(%rip), %rdi      # 0x1f9d9
jmp 0x1e43e
leaq 0xf50(%rip), %rdi       # 0x1f37c
jmp 0x1e43e
leaq 0xc7c(%rip), %rdi       # 0x1f0b1
jmp 0x1e43e
leaq 0xf4e(%rip), %rdi       # 0x1f38c
callq 0x1e050
movb $0x1, %al
movl %eax, 0x4(%rsp)
incl %ebx
cmpl %r12d, %ebx
jge 0x1e45a
testb $0x1, %r14b
je 0x1e254
movl %r14d, %eax
andb $0x1, %al
movzbl %al, %ebx
testb $0x1, 0x4(%rsp)
jne 0x1e484
testb $0x1, %r14b
movl 0xc(%rsp), %esi
movl 0x18(%rsp), %ecx
movl 0x1c(%rsp), %edx
movl 0x8(%rsp), %edi
jne 0x1e4a1
callq 0x1e4db
movl %ebx, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x1, %ebx
testb $0x1, 0x4(%rsp)
jne 0x1e484
movq 0xcb50(%rip), %rax      # 0x2aff8
movq (%rax), %rcx
leaq 0xbe4(%rip), %rdi       # 0x1f096
movl $0x17, %esi
movl $0x1, %edx
callq 0x1e0d0
jmp 0x1e484