// File: /workspace/github_c_makefile_star2_O0/icebert[P]pblat/htslib/bgzf.c
// Function: inflate_gzip_block
static int inflate_gzip_block(BGZF *fp, int cached)
{
    int ret = Z_OK;
    do
    {
        if ( !cached && fp->gz_stream->avail_out!=0 )
        {
            fp->gz_stream->avail_in = hread(fp->fp, fp->compressed_block, BGZF_BLOCK_SIZE);
            if ( fp->gz_stream->avail_in<=0 ) return fp->gz_stream->avail_in;
            if ( fp->gz_stream->avail_in==0 ) break;
            fp->gz_stream->next_in = fp->compressed_block;
        }
        else cached = 0;
        do
        {
            fp->gz_stream->next_out = (Bytef*)fp->uncompressed_block + fp->block_offset;
            fp->gz_stream->avail_out = BGZF_MAX_BLOCK_SIZE - fp->block_offset;
            ret = inflate(fp->gz_stream, Z_NO_FLUSH);
            if ( ret==Z_BUF_ERROR ) continue;   // non-critical error
            if ( ret<0 ) return -1;
            unsigned int have = BGZF_MAX_BLOCK_SIZE - fp->gz_stream->avail_out;
            if ( have ) return have;
        }
        while ( fp->gz_stream->avail_out == 0 );
    }
    while (ret != Z_STREAM_END);
    return BGZF_MAX_BLOCK_SIZE - fp->gz_stream->avail_out;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movl $0x0, -0x18(%rbp)
cmpl $0x0, -0x14(%rbp)
jne 0x9c09a
movq -0x10(%rbp), %rax
movq 0x58(%rax), %rax
cmpl $0x0, 0x20(%rax)
je 0x9c09a
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rdi
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rsi
movl $0xff00, %edx           # imm = 0xFF00
callq 0x9bf30
movl %eax, %ecx
movq -0x10(%rbp), %rax
movq 0x58(%rax), %rax
movl %ecx, 0x8(%rax)
movq -0x10(%rbp), %rax
movq 0x58(%rax), %rax
cmpl $0x0, 0x8(%rax)
ja 0x9c072
movq -0x10(%rbp), %rax
movq 0x58(%rax), %rax
movl 0x8(%rax), %eax
movl %eax, -0x4(%rbp)
jmp 0x9c156
movq -0x10(%rbp), %rax
movq 0x58(%rax), %rax
cmpl $0x0, 0x8(%rax)
jne 0x9c085
jmp 0x9c143
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rcx
movq -0x10(%rbp), %rax
movq 0x58(%rax), %rax
movq %rcx, (%rax)
jmp 0x9c0a1
movl $0x0, -0x14(%rbp)
jmp 0x9c0a3
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rcx
movq -0x10(%rbp), %rax
movslq 0xc(%rax), %rax
addq %rax, %rcx
movq -0x10(%rbp), %rax
movq 0x58(%rax), %rax
movq %rcx, 0x18(%rax)
movq -0x10(%rbp), %rax
movl $0x10000, %ecx          # imm = 0x10000
subl 0xc(%rax), %ecx
movq -0x10(%rbp), %rax
movq 0x58(%rax), %rax
movl %ecx, 0x20(%rax)
movq -0x10(%rbp), %rax
movq 0x58(%rax), %rdi
xorl %esi, %esi
callq 0x6540
movl %eax, -0x18(%rbp)
cmpl $-0x5, -0x18(%rbp)
jne 0x9c0f3
jmp 0x9c125
cmpl $0x0, -0x18(%rbp)
jge 0x9c102
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x9c156
movq -0x10(%rbp), %rax
movq 0x58(%rax), %rcx
movl $0x10000, %eax          # imm = 0x10000
subl 0x20(%rcx), %eax
movl %eax, -0x1c(%rbp)
cmpl $0x0, -0x1c(%rbp)
je 0x9c123
movl -0x1c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x9c156
jmp 0x9c125
movq -0x10(%rbp), %rax
movq 0x58(%rax), %rax
cmpl $0x0, 0x20(%rax)
je 0x9c0a3
jmp 0x9c139
cmpl $0x1, -0x18(%rbp)
jne 0x9c016
movq -0x10(%rbp), %rax
movq 0x58(%rax), %rcx
movl $0x10000, %eax          # imm = 0x10000
subl 0x20(%rcx), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nop