// File: /workspace/github_c_makefile_star2_O0/madler[P]pigz/pigz.c
// Function: load
local size_t load(void) {
    // if already detected end of file, do nothing
    if (g.in_short) {
        g.in_eof = 1;
        g.in_left = 0;
        return 0;
    }

#ifndef NOTHREAD
    // if first time in or procs == 1, read a buffer to have something to
    // return, otherwise wait for the previous read job to complete
    if (g.procs > 1) {
        // if first time, fire up the read thread, ask for a read
        if (g.in_which == -1) {
            g.in_which = 1;
            g.load_state = new_lock(1);
            g.load_thread = launch(load_read, NULL);
        }

        // wait for the previously requested read to complete
        load_wait();

        // set up input buffer with the data just read
        g.in_next = g.in_which ? g.in_buf : g.in_buf2;
        g.in_left = g.in_len;

        // if not at end of file, alert read thread to load next buffer,
        // alternate between g.in_buf and g.in_buf2
        if (g.in_len == BUF) {
            g.in_which = 1 - g.in_which;
            possess(g.load_state);
            twist(g.load_state, TO, 1);
        }

        // at end of file -- join read thread (already exited), clean up
        else {
            join(g.load_thread);
            free_lock(g.load_state);
            g.in_which = -1;
        }
    }
    else
#endif
    {
        // don't use threads -- simply read a buffer into g.in_buf
        g.in_left = readn(g.ind, g.in_next = g.in_buf, BUF);
    }

    // note end of file
    if (g.in_left < BUF) {
        g.in_short = 1;

        // if we got bupkis, now is the time to mark eof
        if (g.in_left == 0)
            g.in_eof = 1;
    }

    // update the total and return the available bytes
    g.in_tot += g.in_left;
    return g.in_left;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
cmpl $0x0, 0x1eb2d(%rip)     # 0x2b8bc
je 0xcdb3
movl $0x1, 0x1eb1d(%rip)     # 0x2b8b8
movq $0x0, 0x1eb0a(%rip) # 0x2b8b0
movq $0x0, -0x8(%rbp)
jmp 0xcf6b
cmpl $0x1, 0x16a76(%rip)     # 0x23830
jle 0xcee5
cmpl $-0x1, 0x26b49(%rip)    # 0x33910
jne 0xce13
movl $0x1, 0x26b3d(%rip)     # 0x33910
movl $0x1, %edi
leaq 0xf46b(%rip), %rsi      # 0x1c24a
movl $0xa17, %edx            # imm = 0xA17
callq 0x116a0
movq %rax, 0x26b28(%rip)     # 0x33918
leaq 0x249(%rip), %rdi       # 0xd040
xorl %eax, %eax
movl %eax, %esi
leaq 0xf448(%rip), %rdx      # 0x1c24a
movl $0xa18, %ecx            # imm = 0xA18
callq 0x11c90
movq %rax, 0x26b0d(%rip)     # 0x33920
callq 0xc640
movl 0x26af2(%rip), %edx     # 0x33910
leaq 0x1695b(%rip), %rcx     # 0x23780
movq %rcx, %rax
addq $0x8158, %rax           # imm = 0x8158
addq $0xfc, %rcx
cmpl $0x0, %edx
cmovneq %rcx, %rax
movq %rax, 0x1ea65(%rip)     # 0x2b8a8
movq 0x26abe(%rip), %rax     # 0x33908
movq %rax, 0x1ea5f(%rip)     # 0x2b8b0
cmpq $0x8000, 0x26aac(%rip) # imm = 0x8000
jne 0xcea9
movl $0x1, %eax
subl 0x26aa7(%rip), %eax     # 0x33910
movl %eax, 0x26aa1(%rip)     # 0x33910
movq 0x26aa2(%rip), %rdi     # 0x33918
leaq 0xf3cd(%rip), %rsi      # 0x1c24a
movl $0xa26, %edx            # imm = 0xA26
callq 0x11900
movq 0x26a8a(%rip), %rdi     # 0x33918
xorl %esi, %esi
movl $0x1, %edx
leaq 0xf3ae(%rip), %rcx      # 0x1c24a
movl $0xa27, %r8d            # imm = 0xA27
callq 0x119a0
jmp 0xcee3
movq 0x26a70(%rip), %rdi     # 0x33920
leaq 0xf393(%rip), %rsi      # 0x1c24a
movl $0xa2c, %edx            # imm = 0xA2C
callq 0x11ec0
movq 0x26a50(%rip), %rdi     # 0x33918
leaq 0xf37b(%rip), %rsi      # 0x1c24a
movl $0xa2d, %edx            # imm = 0xA2D
callq 0x11c00
movl $0xffffffff, 0x26a2d(%rip) # imm = 0xFFFFFFFF
jmp 0xcf1e
movl 0x168a5(%rip), %edi     # 0x23790
leaq 0x1688e(%rip), %rax     # 0x23780
addq $0xfc, %rax
movq %rax, 0x1e9a9(%rip)     # 0x2b8a8
leaq 0x1687a(%rip), %rsi     # 0x23780
addq $0xfc, %rsi
movl $0x8000, %edx           # imm = 0x8000
callq 0xcf80
movq %rax, 0x1e992(%rip)     # 0x2b8b0
cmpq $0x8000, 0x1e987(%rip) # imm = 0x8000
jae 0xcf4b
movl $0x1, 0x1e987(%rip)     # 0x2b8bc
cmpq $0x0, 0x1e973(%rip)     # 0x2b8b0
jne 0xcf49
movl $0x1, 0x1e96f(%rip)     # 0x2b8b8
jmp 0xcf4b
movq 0x1e95e(%rip), %rax     # 0x2b8b0
addq 0x1e967(%rip), %rax     # 0x2b8c0
movq %rax, 0x1e960(%rip)     # 0x2b8c0
movq 0x1e949(%rip), %rax     # 0x2b8b0
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)