// File: /workspace/github_c_makefile_star2_O0/robertdavidgraham[P]wc2/wc2.c
// Function: main
int main(int argc, char *argv[])
{
    int i;
    struct results totals = {0,0,0,0};
    struct config cfg;

    /* Force output to be an atomic line-at-a-time, so that other
     * programs reading the output never see a partial line */
#ifndef _WIN32
    setvbuf(stdout, NULL, _IOLBF, 0);
#endif

    /* Read in the configuration parameters from the command-line */
    cfg = read_command_line(argc, argv);

    /* Compile the ASCII/UTF8 state-machine that we'll use to
     * parse multi-byte characters */
    compile_utf8_statemachine(cfg.is_counting_chars);
    compile_pointers();


    /* Process all the files specified on the command-line */
    for (i=1; i<argc; i++) {
        FILE *fp;
        const char *filename = argv[i];
        struct results results;

        if (argv[i][0] == '-')
            continue;

        fp = fopen(filename, "rb");
        if (fp == NULL) {
            perror(argv[i]);
            continue;
        }

        results = parse_file(fp, &cfg);
        print_results(filename, &results, &cfg);

        totals.line_count += results.line_count;
        totals.word_count += results.word_count;
        totals.byte_count += results.byte_count;
        totals.char_count += results.char_count;

        fclose(fp);
    }

    /* If no files specified, or the "-" file specified, then
     * we need to read in <stdin>. We need to change the mode
     * to "binary", to prevent the library from doing it's own
     * notions of text processing */
    if (cfg.is_stdin) {
        struct results results;
        FILE *fp;

        /* Make sure we read <stdin> in binary mode, because on some
         * platforms (Windows) it defaults to text-mode that will
         * chnage some characters */
        fp = freopen(NULL, "rb", stdin);
        if (fp == NULL) {
            perror("stdin");
            fp = stdin;
        }

        results = parse_file(fp, &cfg);
        print_results(NULL, &results, &cfg);

        totals.line_count += results.line_count;
        totals.word_count += results.word_count;
        totals.byte_count += results.byte_count;
        totals.char_count += results.char_count;
    }

    /* If we read more than one thing, then we also need to print an
     * additional totals line */
    if (cfg.is_printing_totals)
        print_results("total", &totals, &cfg);

#if _WIN32
    {
      FILETIME begin;
      FILETIME end;
      FILETIME kernel;
      FILETIME user;
        if (GetProcessTimes(GetCurrentProcess(), &begin, &end, &kernel, &user)) {
            unsigned long long elapsed = ((unsigned long long)user.dwLowDateTime | (unsigned long long)user.dwHighDateTime<<32ULL)/10000ULL;
            printf("user %lu.%03u\n", (unsigned)(elapsed/1000ULL), (unsigned)(elapsed % 1000));
        }
    }
#endif
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x120, %rsp            # imm = 0x120
movl $0x0, -0x4(%rbp)
movl %edi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
leaq -0x38(%rbp), %rdi
xorl %esi, %esi
movl $0x20, %edx
callq 0x10c0
movq 0x3340(%rip), %rax      # 0x4fd0
movq (%rax), %rdi
xorl %eax, %eax
movl %eax, %ecx
movl $0x1, %edx
movq %rcx, %rsi
callq 0x1140
movl -0x8(%rbp), %esi
movq -0x10(%rbp), %rdx
leaq -0x88(%rbp), %rdi
callq 0x1f30
leaq -0x60(%rbp), %rdi
leaq -0x88(%rbp), %rsi
movl $0x28, %edx
callq 0x1110
movl -0x48(%rbp), %edi
callq 0x2350
callq 0x2520
movl $0x1, -0x14(%rbp)
movl -0x14(%rbp), %eax
cmpl -0x8(%rbp), %eax
jge 0x1e0e
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x98(%rbp)
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movsbl (%rax), %eax
cmpl $0x2d, %eax
jne 0x1d18
jmp 0x1e00
movq -0x98(%rbp), %rdi
leaq 0x13ba(%rip), %rsi      # 0x30e0
callq 0x10f0
movq %rax, -0x90(%rbp)
cmpq $0x0, -0x90(%rbp)
jne 0x1d52
movq -0x10(%rbp), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x1160
jmp 0x1e00
movq -0x90(%rbp), %rsi
leaq -0xd8(%rbp), %rdi
leaq -0x60(%rbp), %rdx
callq 0x2630
movq -0xd8(%rbp), %rax
movq %rax, -0xb8(%rbp)
movq -0xd0(%rbp), %rax
movq %rax, -0xb0(%rbp)
movq -0xc8(%rbp), %rax
movq %rax, -0xa8(%rbp)
movq -0xc0(%rbp), %rax
movq %rax, -0xa0(%rbp)
movq -0x98(%rbp), %rdi
leaq -0xb8(%rbp), %rsi
leaq -0x60(%rbp), %rdx
callq 0x27d0
movq -0xb8(%rbp), %rax
addq -0x38(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0xb0(%rbp), %rax
addq -0x30(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0xa0(%rbp), %rax
addq -0x20(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0xa8(%rbp), %rax
addq -0x28(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x90(%rbp), %rdi
callq 0x1070
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x1ce0
cmpl $0x0, -0x58(%rbp)
je 0x1eff
movq 0x31b9(%rip), %rax      # 0x4fd8
movq (%rax), %rdx
xorl %eax, %eax
movl %eax, %edi
leaq 0x12b3(%rip), %rsi      # 0x30e0
callq 0x1100
movq %rax, -0x100(%rbp)
cmpq $0x0, -0x100(%rbp)
jne 0x1e60
leaq 0x1299(%rip), %rdi      # 0x30e3
callq 0x1160
movq 0x3182(%rip), %rax      # 0x4fd8
movq (%rax), %rax
movq %rax, -0x100(%rbp)
movq -0x100(%rbp), %rsi
leaq -0x120(%rbp), %rdi
leaq -0x60(%rbp), %rdx
callq 0x2630
movq -0x120(%rbp), %rax
movq %rax, -0xf8(%rbp)
movq -0x118(%rbp), %rax
movq %rax, -0xf0(%rbp)
movq -0x110(%rbp), %rax
movq %rax, -0xe8(%rbp)
movq -0x108(%rbp), %rax
movq %rax, -0xe0(%rbp)
xorl %eax, %eax
movl %eax, %edi
leaq -0xf8(%rbp), %rsi
leaq -0x60(%rbp), %rdx
callq 0x27d0
movq -0xf8(%rbp), %rax
addq -0x38(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0xf0(%rbp), %rax
addq -0x30(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0xe0(%rbp), %rax
addq -0x20(%rbp), %rax
movq %rax, -0x20(%rbp)
movq -0xe8(%rbp), %rax
addq -0x28(%rbp), %rax
movq %rax, -0x28(%rbp)
cmpl $0x0, -0x44(%rbp)
je 0x1f19
leaq 0x11dd(%rip), %rdi      # 0x30e9
leaq -0x38(%rbp), %rsi
leaq -0x60(%rbp), %rdx
callq 0x27d0
xorl %eax, %eax
addq $0x120, %rsp            # imm = 0x120
popq %rbp
retq
nopw %cs:(%rax,%rax)