// File: /workspace/github_c_makefile_star2_O3/madler[P]pigz/pigz.c
// Function: load_read
local void load_read(void *dummy) {
    size_t len;
    ball_t err;                     // error information from throw()

    (void)dummy;

    Trace(("-- launched decompress read thread"));
    try {
        do {
            possess(g.load_state);
            wait_for(g.load_state, NOT_TO_BE, 0);
            if (peek_lock(g.load_state) > 1) {
                release(g.load_state);
                break;
            }
            g.in_len = len = readn(g.ind, g.in_which ? g.in_buf : g.in_buf2,
                                   BUF);
            Trace(("-- decompress read thread read %lu bytes", len));
            twist(g.load_state, TO, 0);
        } while (len == BUF);
    }
    catch (err) {
        THREADABORT(err);
    }
    Trace(("-- exited decompress read thread"));
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xf8, %rsp
movl $0x1, 0xc(%rsp)
xorl %eax, %eax
leaq 0x10(%rsp), %rbx
movq %rax, 0xc8(%rbx)
movl $0x0, 0xd0(%rbx)
movq %rax, 0xd8(%rbx)
callq 0xe8a0
leaq 0x323ac(%rip), %r14     # 0x3d684
movl (%r14), %edi
callq 0x3110
movq %rax, 0xe0(%rbx)
movl (%r14), %edi
movq %rbx, %rsi
callq 0x3610
testl %eax, %eax
jne 0xb45b
leaq 0x10(%rsp), %rdi
callq 0x32f0
testl %eax, %eax
jne 0xb3d5
leaq 0x9fed(%rip), %rbx      # 0x15300
xorl %ebp, %ebp
movl %ebp, %r15d
movl $0x8000, %r14d          # imm = 0x8000
movl $0x9ef, %r12d           # imm = 0x9EF
movq 0x221bd(%rip), %rdi     # 0x2d4e8
movq %rbx, %rsi
movl $0x9e6, %edx            # imm = 0x9E6
callq 0xe2b3
movq 0x221a9(%rip), %rdi     # 0x2d4e8
movl $0x1, %esi
movq %r15, %rdx
movq %rbx, %rcx
movl $0x9e7, %r8d            # imm = 0x9E7
callq 0xe36e
movq 0x2218c(%rip), %rdi     # 0x2d4e8
callq 0xe42e
cmpq $0x2, %rax
jge 0xb3bd
cmpl $0x0, 0x22172(%rip)     # 0x2d4e0
movl 0x11fec(%rip), %edi     # 0x1d360
leaq 0x120d1(%rip), %rsi     # 0x1d44c
leaq 0x1a126(%rip), %rax     # 0x254a8
cmoveq %rax, %rsi
movq %r14, %rdx
callq 0xb21f
movq %rax, %r13
movq %rax, 0x22140(%rip)     # 0x2d4d8
movq 0x22149(%rip), %rdi     # 0x2d4e8
movl %ebp, %edx
movl %ebp, %esi
movq %rbx, %rcx
movq %r12, %r8
callq 0xe311
cmpq $0x8000, %r13           # imm = 0x8000
je 0xb324
jmp 0xb3d5
movq 0x22124(%rip), %rdi     # 0x2d4e8
leaq 0x9f35(%rip), %rsi      # 0x15300
movl $0x9e9, %edx            # imm = 0x9E9
callq 0xe2e2
cmpl $0x0, 0xc(%rsp)
je 0xb402
leaq 0x322a1(%rip), %rax     # 0x3d684
movl (%rax), %edi
movq 0xf0(%rsp), %rsi
callq 0x3610
testl %eax, %eax
jne 0xb47a
movl $0x0, 0xc(%rsp)
movl 0xdc(%rsp), %ebp
testl %ebp, %ebp
jne 0xb41f
addq $0xf8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl 0xe0(%rsp), %r14d
movq 0xe8(%rsp), %rbx
cmpl $0x20, %ebp
je 0xb445
leaq 0x9fd1(%rip), %rdi      # 0x1540c
xorl %eax, %eax
movq %rbx, %rsi
callq 0x479d
testl %r14d, %r14d
je 0xb452
movq %rbx, %rdi
callq 0x3050
movl %ebp, %edi
negl %edi
callq 0x4133
leaq 0x9e6e(%rip), %rdi      # 0x152d0
leaq 0x9e97(%rip), %rsi      # 0x15300
leaq 0xb077(%rip), %rcx      # 0x164e7
movl $0x9e4, %edx            # imm = 0x9E4
callq 0x3220
leaq 0x9e4f(%rip), %rdi      # 0x152d0
leaq 0x9e78(%rip), %rsi      # 0x15300
leaq 0xb058(%rip), %rcx      # 0x164e7
movl $0x9f2, %edx            # imm = 0x9F2
callq 0x3220