// File: /workspace/github_c_makefile_star2_O1/robertdavidgraham[P]wc2/wc2.c
// Function: parse_file
static struct results
parse_file(FILE *fp, const struct config *cfg)
{
    enum {BUFSIZE=65536};
    struct results results = {0, 0, 0, 0};
    unsigned state = 0; /* state held between chunks */
    unsigned char *buf;

    buf = malloc(BUFSIZE);
    if (buf == NULL)
        abort();

    /* Process a 64k chunk at a time */
    for (;;) {
        size_t count;
        struct results x;

        /* Read the next chunk of data from the file */
        count = fread(buf, 1, BUFSIZE, fp);
        if (count <= 0)
            break;

        /* Do the word-count algorithm */
        if (cfg->is_pointer_arithmetic > 1)
            x = parse_chunk_pp(buf, count, &state);
        else if (cfg->is_pointer_arithmetic)
            x = parse_chunk_p(buf, count, &state);
        else
            x = parse_chunk(buf, count, &state);

        /* Sum the results */
        results.line_count += x.line_count;
        results.word_count += x.word_count;
        results.byte_count += x.byte_count;
        results.char_count += x.char_count;
    }

    free(buf);
    return results;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x248, %rsp            # imm = 0x248
movq %rdx, 0x20(%rsp)
movq %rsi, 0x28(%rsp)
movq %rdi, %rbx
xorps %xmm0, %xmm0
movups %xmm0, 0x10(%rdi)
movups %xmm0, (%rdi)
movl $0x10000, %edi          # imm = 0x10000
callq 0x1110
testq %rax, %rax
je 0x3016
movq %rax, %r12
movq (%rbx), %rax
movq %rax, 0x10(%rsp)
movq 0x8(%rbx), %r14
movq 0x18(%rbx), %rax
movq %rax, 0x8(%rsp)
movq %rbx, 0x18(%rsp)
movq 0x10(%rbx), %rbp
xorl %r15d, %r15d
leaq 0x1323d(%rip), %r13     # 0x160f0
leaq 0x3236(%rip), %rbx      # 0x60f0
movl $0x1, %esi
movl $0x10000, %edx          # imm = 0x10000
movq %r12, %rdi
movq 0x28(%rsp), %rcx
callq 0x1080
testq %rax, %rax
je 0x2fd2
movq 0x20(%rsp), %rcx
movl 0x24(%rcx), %ecx
cmpl $0x2, %ecx
jl 0x2f4e
shll $0x8, %r15d
leaq (,%r15,8), %r15
addq %r13, %r15
xorps %xmm0, %xmm0
movaps %xmm0, 0x40(%rsp)
movaps %xmm0, 0x30(%rsp)
testq %rax, %rax
jle 0x2f2d
leaq (%r12,%rax), %rcx
movq %r12, %rdx
movzbl (%rdx), %esi
incq %rdx
movq (%r15,%rsi,8), %r15
movq %r15, %rsi
subq %r13, %rsi
shrq $0xb, %rsi
incq 0x30(%rsp,%rsi,8)
cmpq %rcx, %rdx
jb 0x2f0f
subq %r13, %r15
shrq $0xb, %r15
movq 0x38(%rsp), %rcx
movq 0x40(%rsp), %rdx
leaq (%rdx,%rcx), %rsi
addq 0x30(%rsp), %rsi
addq 0x48(%rsp), %rsi
jmp 0x2fc2
xorps %xmm0, %xmm0
testl %ecx, %ecx
je 0x2f87
movaps %xmm0, 0x30(%rsp)
testq %rax, %rax
jle 0x2faf
leaq (%r12,%rax), %rcx
movl %r15d, %r15d
movq %r12, %rdx
movzbl (%rdx), %esi
incq %rdx
shlq $0x8, %r15
addq %rbx, %r15
movzbl (%rsi,%r15), %r15d
incl 0x30(%rsp,%r15,4)
cmpq %rcx, %rdx
jb 0x2f69
jmp 0x2faf
movaps %xmm0, 0x30(%rsp)
movl %r15d, %r15d
xorl %ecx, %ecx
movzbl (%r12,%rcx), %edx
shlq $0x8, %r15
addq %rbx, %r15
movzbl (%rdx,%r15), %r15d
incl 0x30(%rsp,%r15,4)
incq %rcx
cmpq %rcx, %rax
jne 0x2f91
movl 0x34(%rsp), %ecx
movl 0x38(%rsp), %edx
leal (%rdx,%rcx), %esi
addl 0x30(%rsp), %esi
addl 0x3c(%rsp), %esi
addq %rcx, 0x10(%rsp)
addq %rdx, %r14
addq %rax, 0x8(%rsp)
addq %rsi, %rbp
testq %rax, %rax
jne 0x2eba
movq 0x18(%rsp), %rbx
movq %r14, 0x8(%rbx)
movq 0x8(%rsp), %rax
movq %rax, 0x18(%rbx)
movq %rbp, 0x10(%rbx)
movq 0x10(%rsp), %rax
movq %rax, (%rbx)
movq %r12, %rdi
callq 0x1030
movq %rbx, %rax
addq $0x248, %rsp            # imm = 0x248
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x1050