// File: /workspace/github_c_makefile_star2_O2/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)
leaq 0x10(%rsp), %rbx
andq $0x0, 0xc8(%rbx)
andl $0x0, 0xd0(%rbx)
andq $0x0, 0xd8(%rbx)
callq 0xdcdc
leaq 0x3141a(%rip), %r14     # 0x3c674
movl (%r14), %edi
callq 0x3110
movq %rax, 0xe0(%rbx)
movl (%r14), %edi
movq %rbx, %rsi
callq 0x3600
testl %eax, %eax
jne 0xb3db
leaq 0x10(%rsp), %rdi
callq 0x32f0
testl %eax, %eax
jne 0xb355
leaq 0x906b(%rip), %rbx      # 0x14300
xorl %ebp, %ebp
movl %ebp, %r15d
movl $0x8000, %r14d          # imm = 0x8000
movl $0x9ef, %r12d           # imm = 0x9EF
movq 0x2122b(%rip), %rdi     # 0x2c4d8
movq %rbx, %rsi
movl $0x9e6, %edx            # imm = 0x9E6
callq 0xd763
movq 0x21217(%rip), %rdi     # 0x2c4d8
pushq $0x1
popq %rsi
movq %r15, %rdx
movq %rbx, %rcx
movl $0x9e7, %r8d            # imm = 0x9E7
callq 0xd81e
movq 0x211fc(%rip), %rdi     # 0x2c4d8
callq 0xd8de
cmpq $0x2, %rax
jge 0xb33d
cmpl $0x0, 0x211e2(%rip)     # 0x2c4d0
movl 0x1105c(%rip), %edi     # 0x1c350
leaq 0x11141(%rip), %rsi     # 0x1c43c
leaq 0x19196(%rip), %rax     # 0x24498
cmoveq %rax, %rsi
movq %r14, %rdx
callq 0xb1a7
movq %rax, %r13
movq %rax, 0x211b0(%rip)     # 0x2c4c8
movq 0x211b9(%rip), %rdi     # 0x2c4d8
movl %ebp, %edx
movl %ebp, %esi
movq %rbx, %rcx
movq %r12, %r8
callq 0xd7c1
cmpq $0x8000, %r13           # imm = 0x8000
je 0xb2a6
jmp 0xb355
movq 0x21194(%rip), %rdi     # 0x2c4d8
leaq 0x8fb5(%rip), %rsi      # 0x14300
movl $0x9e9, %edx            # imm = 0x9E9
callq 0xd792
cmpl $0x0, 0xc(%rsp)
je 0xb382
leaq 0x31311(%rip), %rax     # 0x3c674
movl (%rax), %edi
movq 0xf0(%rsp), %rsi
callq 0x3600
testl %eax, %eax
jne 0xb3fa
movl $0x0, 0xc(%rsp)
movl 0xdc(%rsp), %ebp
testl %ebp, %ebp
jne 0xb39f
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 0xb3c5
leaq 0x9051(%rip), %rdi      # 0x1440c
xorl %eax, %eax
movq %rbx, %rsi
callq 0x4419
testl %r14d, %r14d
je 0xb3d2
movq %rbx, %rdi
callq 0x3050
movl %ebp, %edi
negl %edi
callq 0x3dc0
leaq 0x8eee(%rip), %rdi      # 0x142d0
leaq 0x8f17(%rip), %rsi      # 0x14300
leaq 0xa0ff(%rip), %rcx      # 0x154ef
movl $0x9e4, %edx            # imm = 0x9E4
callq 0x3220
leaq 0x8ecf(%rip), %rdi      # 0x142d0
leaq 0x8ef8(%rip), %rsi      # 0x14300
leaq 0xa0e0(%rip), %rcx      # 0x154ef
movl $0x9f2, %edx            # imm = 0x9F2
callq 0x3220