LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O0/samtools[P]htslib/bgzf.c
// Function: bgzf_peek
int bgzf_peek(BGZF *fp) {
    int available = fp->block_length - fp->block_offset;
    if (available <= 0) {
        if (bgzf_read_block(fp) < 0) {
            hts_log_error("Read block operation failed with error %d", fp->errcode);
            fp->errcode = BGZF_ERR_ZLIB;
            return -2;
        }
    }
    available = fp->block_length - fp->block_offset;
    if (available)
        return ((unsigned char *)fp->uncompressed_block)[fp->block_offset];

    return -1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movl 0x8(%rax), %eax
movq -0x10(%rbp), %rcx
subl 0x10(%rcx), %eax
movl %eax, -0x14(%rbp)
cmpl $0x0, -0x14(%rbp)
jg 0xe933
movq -0x10(%rbp), %rdi
callq 0xceb0
cmpl $0x0, %eax
jge 0xe931
movq -0x10(%rbp), %rax
movl (%rax), %ecx
andl $0xffff, %ecx           # imm = 0xFFFF
movl $0x1, %edi
leaq 0xe0586(%rip), %rsi     # 0xeee8f
leaq 0xe0589(%rip), %rdx     # 0xeee99
movb $0x0, %al
callq 0x1b030
movq -0x10(%rbp), %rax
movl (%rax), %ecx
andl $0xffff0000, %ecx       # imm = 0xFFFF0000
orl $0x1, %ecx
movl %ecx, (%rax)
movl $0xfffffffe, -0x4(%rbp) # imm = 0xFFFFFFFE
jmp 0xe96a
jmp 0xe933
movq -0x10(%rbp), %rax
movl 0x8(%rax), %eax
movq -0x10(%rbp), %rcx
subl 0x10(%rcx), %eax
movl %eax, -0x14(%rbp)
cmpl $0x0, -0x14(%rbp)
je 0xe963
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
movq -0x10(%rbp), %rcx
movslq 0x10(%rcx), %rcx
movzbl (%rax,%rcx), %eax
movl %eax, -0x4(%rbp)
jmp 0xe96a
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/samtools[P]htslib/bgzf.c
// Function: bgzf_mt
int bgzf_mt(BGZF *fp, int n_threads, int n_sub_blks)
{
    // No gain from multi-threading when not compressed
    if (!fp->is_compressed || fp->is_gzip)
        return 0;

    if (n_threads < 1) return -1;
    hts_tpool *p = hts_tpool_init(n_threads);
    if (!p)
        return -1;

    if (bgzf_thread_pool(fp, p, 0) != 0) {
        hts_tpool_destroy(p);
        return -1;
    }

    fp->mt->own_pool = 1;

    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movl %edx, -0x18(%rbp)
movq -0x10(%rbp), %rax
movl (%rax), %eax
shrl $0x1e, %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0xf7a1
movq -0x10(%rbp), %rax
movl (%rax), %eax
shrl $0x1f, %eax
cmpl $0x0, %eax
je 0xf7aa
movl $0x0, -0x4(%rbp)
jmp 0xf811
cmpl $0x1, -0x14(%rbp)
jge 0xf7b9
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xf811
movl -0x14(%rbp), %edi
callq 0x4daa0
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0xf7d5
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xf811
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rsi
xorl %edx, %edx
callq 0xec20
cmpl $0x0, %eax
je 0xf7fb
movq -0x20(%rbp), %rdi
callq 0x4e970
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xf811
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rax
movl $0x1, 0x14(%rax)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/samtools[P]htslib/bgzf.c
// Function: mt_flush_queue
static int mt_flush_queue(BGZF *fp)
{
    mtaux_t *mt = fp->mt;

    // Drain the encoder jobs.
    // We cannot use hts_tpool_flush here as it can cause deadlock if
    // the queue is full up of decoder tasks.  The best solution would
    // be to have one input queue per type of job, but we don't right now.
    //hts_tpool_flush(mt->pool);
    pthread_mutex_lock(&mt->job_pool_m);
    int shutdown = 0;
    while (mt->jobs_pending != 0) {
        if ((shutdown = hts_tpool_process_is_shutdown(mt->out_queue)))
            break;
        pthread_mutex_unlock(&mt->job_pool_m);
        hts_usleep(10000); // FIXME: replace by condition variable
        pthread_mutex_lock(&mt->job_pool_m);
    }
    pthread_mutex_unlock(&mt->job_pool_m);

    if (shutdown)
        return -1;

    // Wait on bgzf_mt_writer to drain the queue
    if (hts_tpool_process_flush(mt->out_queue) != 0)
        return -1;

    return (fp->errcode == 0)? 0 : -1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq 0x48(%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
addq $0x30, %rdi
callq 0x4730
movl $0x0, -0x1c(%rbp)
movq -0x18(%rbp), %rax
cmpl $0x0, 0x58(%rax)
je 0xfc63
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rdi
callq 0x4d3d0
movl %eax, -0x1c(%rbp)
cmpl $0x0, %eax
je 0xfc3d
jmp 0xfc63
movq -0x18(%rbp), %rdi
addq $0x30, %rdi
callq 0x4330
movl $0x2710, %edi           # imm = 0x2710
callq 0x13580
movq -0x18(%rbp), %rdi
addq $0x30, %rdi
callq 0x4730
jmp 0xfc1c
movq -0x18(%rbp), %rdi
addq $0x30, %rdi
callq 0x4330
cmpl $0x0, -0x1c(%rbp)
je 0xfc7f
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xfcb6
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rdi
callq 0x4e740
cmpl $0x0, %eax
je 0xfc9a
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xfcb6
movq -0x10(%rbp), %rax
movl (%rax), %edx
andl $0xffff, %edx           # imm = 0xFFFF
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
xorl %ecx, %ecx
cmpl $0x0, %edx
cmovel %ecx, %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/samtools[P]htslib/bgzf.c
// Function: deflate_block
static int deflate_block(BGZF *fp, int block_length)
{
    size_t comp_size = BGZF_MAX_BLOCK_SIZE;
    int ret;
    if ( !fp->is_gzip )
        ret = bgzf_compress(fp->compressed_block, &comp_size, fp->uncompressed_block, block_length, fp->compress_level);
    else
        ret = bgzf_gzip_compress(fp, fp->compressed_block, &comp_size, fp->uncompressed_block, block_length, fp->compress_level);

    if ( ret != 0 )
    {
        hts_log_debug("Compression error %d", ret);
        fp->errcode |= BGZF_ERR_ZLIB;
        return -1;
    }
    fp->block_offset = 0;
    return comp_size;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq $0x10000, -0x20(%rbp)   # imm = 0x10000
movq -0x10(%rbp), %rax
movl (%rax), %eax
shrl $0x1f, %eax
cmpl $0x0, %eax
jne 0xfd16
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rdi
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rdx
movslq -0x14(%rbp), %rcx
movq -0x10(%rbp), %rax
movl (%rax), %r8d
shll $0x3, %r8d
sarl $0x17, %r8d
leaq -0x20(%rbp), %rsi
callq 0xc9a0
movl %eax, -0x24(%rbp)
jmp 0xfd49
movq -0x10(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rsi
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rcx
movslq -0x14(%rbp), %r8
movq -0x10(%rbp), %rax
movl (%rax), %r9d
shll $0x3, %r9d
sarl $0x17, %r9d
leaq -0x20(%rbp), %rdx
callq 0x135d0
movl %eax, -0x24(%rbp)
cmpl $0x0, -0x24(%rbp)
je 0xfd96
movl -0x24(%rbp), %ecx
movl $0x5, %edi
leaq 0xdf86c(%rip), %rsi     # 0xef5ca
leaq 0xdf873(%rip), %rdx     # 0xef5d8
movb $0x0, %al
callq 0x1b030
movq -0x10(%rbp), %rax
movl (%rax), %edx
andl $0xffff, %edx           # imm = 0xFFFF
orl $0x1, %edx
movl (%rax), %ecx
andl $0xffff, %edx           # imm = 0xFFFF
andl $0xffff0000, %ecx       # imm = 0xFFFF0000
orl %edx, %ecx
movl %ecx, (%rax)
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0xfda8
movq -0x10(%rbp), %rax
movl $0x0, 0x10(%rax)
movq -0x20(%rbp), %rax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/samtools[P]htslib/./htslib/hfile.h
// Function: hwrite
static inline ssize_t HTS_RESULT_USED
hwrite(hFILE *fp, const void *buffer, size_t nbytes)
{
    HTSLIB_EXPORT
    extern ssize_t hwrite2(hFILE *, const void *, size_t, size_t);
    HTSLIB_EXPORT
    extern int hfile_set_blksize(hFILE *fp, size_t bufsiz);

    if (!fp->mobile) {
        size_t n = fp->limit - fp->begin;
        if (n < nbytes) {
            hfile_set_blksize(fp, fp->limit - fp->buffer + nbytes);
            fp->end = fp->limit;
        }
    }

    size_t n = fp->limit - fp->begin;
    if (nbytes >= n && fp->begin == fp->buffer) {
        // Go straight to hwrite2 if the buffer is empty and the request
        // won't fit.
        return hwrite2(fp, buffer, nbytes, 0);
    }

    if (n > nbytes) n = nbytes;
    memcpy(fp->begin, buffer, n);
    fp->begin += n;
    return (n==nbytes)? (ssize_t) n : hwrite2(fp, buffer, nbytes, n);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x10(%rbp), %rax
movb 0x30(%rax), %al
shrb %al
andb $0x1, %al
movzbl %al, %eax
cmpl $0x0, %eax
jne 0xfe39
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x10(%rbp), %rcx
movq 0x8(%rcx), %rcx
subq %rcx, %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
cmpq -0x20(%rbp), %rax
jae 0xfe37
movq -0x10(%rbp), %rdi
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rsi
movq -0x10(%rbp), %rax
movq (%rax), %rax
subq %rax, %rsi
addq -0x20(%rbp), %rsi
callq 0x13b00
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x10(%rax)
jmp 0xfe39
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rax
movq -0x10(%rbp), %rcx
movq 0x8(%rcx), %rcx
subq %rcx, %rax
movq %rax, -0x30(%rbp)
movq -0x20(%rbp), %rax
cmpq -0x30(%rbp), %rax
jb 0xfe86
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movq -0x10(%rbp), %rcx
cmpq (%rcx), %rax
jne 0xfe86
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
xorl %eax, %eax
movl %eax, %ecx
callq 0x14530
movq %rax, -0x8(%rbp)
jmp 0xfef2
movq -0x30(%rbp), %rax
cmpq -0x20(%rbp), %rax
jbe 0xfe98
movq -0x20(%rbp), %rax
movq %rax, -0x30(%rbp)
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x18(%rbp), %rsi
movq -0x30(%rbp), %rdx
callq 0x43b0
movq -0x30(%rbp), %rcx
movq -0x10(%rbp), %rax
addq 0x8(%rax), %rcx
movq %rcx, 0x8(%rax)
movq -0x30(%rbp), %rax
cmpq -0x20(%rbp), %rax
jne 0xfed1
movq -0x30(%rbp), %rax
movq %rax, -0x38(%rbp)
jmp 0xfeea
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
movq -0x20(%rbp), %rdx
movq -0x30(%rbp), %rcx
callq 0x14530
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x40, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/samtools[P]htslib/bgzf.c
// Function: lazy_flush
static int lazy_flush(BGZF *fp)
{
    if (fp->mt)
        return fp->block_offset ? mt_queue(fp) : 0;
    else
        return bgzf_flush(fp);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x48(%rax)
je 0xff8e
movq -0x10(%rbp), %rax
cmpl $0x0, 0x10(%rax)
je 0xff7f
movq -0x10(%rbp), %rdi
callq 0xfa10
movl %eax, -0x14(%rbp)
jmp 0xff86
xorl %eax, %eax
movl %eax, -0x14(%rbp)
jmp 0xff86
movl -0x14(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0xff9a
movq -0x10(%rbp), %rdi
callq 0xf820
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/samtools[P]htslib/bgzf.c
// Function: bgzf_close_mt
static void bgzf_close_mt(BGZF *fp) {
    if (fp->mt) {
        if (!fp->mt->free_block)
            fp->uncompressed_block = NULL;
        if (mt_destroy(fp->mt) < 0)
            fp->errcode = BGZF_ERR_IO;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
cmpq $0x0, 0x48(%rax)
je 0x10687
movq -0x8(%rbp), %rax
movq 0x48(%rax), %rax
cmpq $0x0, 0x60(%rax)
jne 0x10662
movq -0x8(%rbp), %rax
movq $0x0, 0x28(%rax)
movq -0x8(%rbp), %rax
movq 0x48(%rax), %rdi
callq 0xd9c0
cmpl $0x0, %eax
jge 0x10685
movq -0x8(%rbp), %rax
movl (%rax), %ecx
andl $0xffff0000, %ecx       # imm = 0xFFFF0000
orl $0x4, %ecx
movl %ecx, (%rax)
jmp 0x10687
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/samtools[P]htslib/bgzf.c
// Function: bgzf_index_destroy
void bgzf_index_destroy(BGZF *fp)
{
    if ( !fp->idx ) return;
    free(fp->idx->offs);
    free(fp->idx);
    fp->idx = NULL;
    fp->idx_build_otf = 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
cmpq $0x0, 0x50(%rax)
jne 0x106a9
jmp 0x106de
movq -0x8(%rbp), %rax
movq 0x50(%rax), %rax
movq 0x8(%rax), %rdi
callq 0x45a0
movq -0x8(%rbp), %rax
movq 0x50(%rax), %rdi
callq 0x45a0
movq -0x8(%rbp), %rax
movq $0x0, 0x50(%rax)
movq -0x8(%rbp), %rax
movl $0x0, 0x58(%rax)
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/samtools[P]htslib/bgzf.c
// Function: free_cache
static void free_cache(BGZF *fp)
{
    khint_t k;
    if (fp->is_write) return;
    khash_t(cache) *h = fp->cache->h;
    for (k = kh_begin(h); k < kh_end(h); ++k)
        if (kh_exist(h, k)) free(kh_val(h, k).block);
    kh_destroy(cache, h);
    free(fp->cache);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movl (%rax), %eax
shrl $0x11, %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x10712
jmp 0x10796
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rax
movq (%rax), %rax
movq %rax, -0x18(%rbp)
movl $0x0, -0xc(%rbp)
movl -0xc(%rbp), %eax
movq -0x18(%rbp), %rcx
cmpl (%rcx), %eax
jae 0x10780
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rax
movl -0xc(%rbp), %ecx
shrl $0x4, %ecx
movl %ecx, %ecx
movl (%rax,%rcx,4), %eax
movl -0xc(%rbp), %ecx
andl $0xf, %ecx
shll %ecx
shrl %cl, %eax
andl $0x3, %eax
cmpl $0x0, %eax
jne 0x10773
movq -0x18(%rbp), %rax
movq 0x20(%rax), %rax
movl -0xc(%rbp), %ecx
imulq $0x18, %rcx, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rdi
callq 0x45a0
jmp 0x10775
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x10728
movq -0x18(%rbp), %rdi
callq 0x136f0
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rdi
callq 0x45a0
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/samtools[P]htslib/bgzf.c
// Function: bgzf_check_EOF_common
static int bgzf_check_EOF_common(BGZF *fp)
{
    uint8_t buf[28];
    off_t offset = htell(fp->fp);
    if (hseek(fp->fp, -28, SEEK_END) < 0) {
        if (errno == ESPIPE) { hclearerr(fp->fp); return 2; }
#ifdef _WIN32
        if (errno == EINVAL) { hclearerr(fp->fp); return 2; }
#else
        // Assume that EINVAL was due to the file being less than 28 bytes
        // long, rather than being a random error return from an hfile backend.
        // This should be reported as "no EOF block" rather than an error.
        if (errno == EINVAL) { hclearerr(fp->fp); return 0; }
#endif
        return -1;
    }
    if ( hread(fp->fp, buf, 28) != 28 ) return -1;
    if ( hseek(fp->fp, offset, SEEK_SET) < 0 ) return -1;
    return (memcmp("\037\213\010\4\0\0\0\0\0\377\6\0\102\103\2\0\033\0\3\0\0\0\0\0\0\0\0\0", buf, 28) == 0)? 1 : 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq 0x40(%rax), %rdi
callq 0xebf0
movq %rax, -0x38(%rbp)
movq -0x10(%rbp), %rax
movq 0x40(%rax), %rdi
movq $-0x1c, %rsi
movl $0x2, %edx
callq 0x146a0
cmpq $0x0, %rax
jge 0x10a08
callq 0x4050
cmpl $0x1d, (%rax)
jne 0x109df
movq -0x10(%rbp), %rax
movq 0x40(%rax), %rdi
callq 0x13740
movl $0x2, -0x4(%rbp)
jmp 0x10a76
callq 0x4050
cmpl $0x16, (%rax)
jne 0x109ff
movq -0x10(%rbp), %rax
movq 0x40(%rax), %rdi
callq 0x13740
movl $0x0, -0x4(%rbp)
jmp 0x10a76
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x10a76
movq -0x10(%rbp), %rax
movq 0x40(%rax), %rdi
leaq -0x30(%rbp), %rsi
movl $0x1c, %edx
callq 0xde00
cmpq $0x1c, %rax
je 0x10a2d
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x10a76
movq -0x10(%rbp), %rax
movq 0x40(%rax), %rdi
movq -0x38(%rbp), %rsi
xorl %edx, %edx
callq 0x146a0
cmpq $0x0, %rax
jge 0x10a4f
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x10a76
leaq -0x30(%rbp), %rsi
leaq 0xde10e(%rip), %rdi     # 0xeeb68
movl $0x1c, %edx
callq 0x41c0
movl %eax, %edx
xorl %eax, %eax
movl $0x1, %ecx
cmpl $0x0, %edx
cmovel %ecx, %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/samtools[P]htslib/bgzf.c
// Function: bgzf_seek
int64_t bgzf_seek(BGZF* fp, int64_t pos, int where)
{
    if (fp->is_write || where != SEEK_SET || fp->is_gzip) {
        fp->errcode |= BGZF_ERR_MISUSE;
        return -1;
    }

    // This is a flag to indicate we've jumped elsewhere in the stream, to act
    // as a hint to any other code which is wrapping up bgzf for its own
    // purposes.  We may not be able to tell when seek happens as it can be
    // done on our behalf, eg by the iterator.
    //
    // This is never cleared here.  Any tool that needs to handle it is also
    // responsible for clearing it.
    fp->seeked = pos;

    return bgzf_seek_common(fp, pos >> 16, pos & 0xFFFF);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movl %edx, -0x1c(%rbp)
movq -0x10(%rbp), %rax
movl (%rax), %eax
shrl $0x11, %eax
andl $0x1, %eax
cmpl $0x0, %eax
jne 0x10ab8
cmpl $0x0, -0x1c(%rbp)
jne 0x10ab8
movq -0x10(%rbp), %rax
movl (%rax), %eax
shrl $0x1f, %eax
cmpl $0x0, %eax
je 0x10ae3
movq -0x10(%rbp), %rax
movl (%rax), %edx
andl $0xffff, %edx           # imm = 0xFFFF
orl $0x8, %edx
movl (%rax), %ecx
andl $0xffff, %edx           # imm = 0xFFFF
andl $0xffff0000, %ecx       # imm = 0xFFFF0000
orl %edx, %ecx
movl %ecx, (%rax)
movq $-0x1, -0x8(%rbp)
jmp 0x10b10
movq -0x18(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x68(%rax)
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
sarq $0x10, %rsi
movq -0x18(%rbp), %rax
andq $0xffff, %rax           # imm = 0xFFFF
movl %eax, %edx
callq 0x10b20
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/samtools[P]htslib/bgzf.c
// Function: bgzf_is_bgzf
int bgzf_is_bgzf(const char *fn)
{
    uint8_t buf[16];
    int n;
    hFILE *fp;
    if ((fp = hopen(fn, "r")) == 0) return 0;
    n = hread(fp, buf, 16);
    if (hclose(fp) < 0) return 0;
    if (n != 16) return 0;
    return check_header(buf) == 0? 1 : 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
leaq 0xe1d8a(%rip), %rsi     # 0xf2af1
movb $0x0, %al
callq 0x158b0
movq %rax, -0x30(%rbp)
cmpq $0x0, %rax
jne 0x10d81
movl $0x0, -0x4(%rbp)
jmp 0x10dd7
movq -0x30(%rbp), %rdi
leaq -0x20(%rbp), %rsi
movl $0x10, %edx
callq 0xde00
movl %eax, -0x24(%rbp)
movq -0x30(%rbp), %rdi
callq 0x14920
cmpl $0x0, %eax
jge 0x10dad
movl $0x0, -0x4(%rbp)
jmp 0x10dd7
cmpl $0x10, -0x24(%rbp)
je 0x10dbc
movl $0x0, -0x4(%rbp)
jmp 0x10dd7
leaq -0x20(%rbp), %rdi
callq 0xe270
movl %eax, %edx
xorl %eax, %eax
movl $0x1, %ecx
cmpl $0x0, %edx
cmovel %ecx, %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x30, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/samtools[P]htslib/bgzf.c
// Function: bgzf_getc
int bgzf_getc(BGZF *fp)
{
    if (fp->block_offset+1 < fp->block_length) {
        fp->uncompressed_address++;
        return ((unsigned char*)fp->uncompressed_block)[fp->block_offset++];
    }

    int c;
    if (fp->block_offset >= fp->block_length) {
        if (bgzf_read_block(fp) != 0) return -2; /* error */
        if (fp->block_length == 0) return -1; /* end-of-file */
    }
    c = ((unsigned char*)fp->uncompressed_block)[fp->block_offset++];
    if (fp->block_offset == fp->block_length) {
        fp->block_address = bgzf_htell(fp);
        fp->block_offset = 0;
        fp->block_length = 0;
    }
    fp->uncompressed_address++;
    return c;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movl 0x10(%rax), %eax
addl $0x1, %eax
movq -0x10(%rbp), %rcx
cmpl 0x8(%rcx), %eax
jge 0x10e85
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x20(%rax)
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
movq -0x10(%rbp), %rdx
movl 0x10(%rdx), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, 0x10(%rdx)
movslq %ecx, %rcx
movzbl (%rax,%rcx), %eax
movl %eax, -0x4(%rbp)
jmp 0x10f35
movq -0x10(%rbp), %rax
movl 0x10(%rax), %eax
movq -0x10(%rbp), %rcx
cmpl 0x8(%rcx), %eax
jl 0x10ec4
movq -0x10(%rbp), %rdi
callq 0xceb0
cmpl $0x0, %eax
je 0x10eaf
movl $0xfffffffe, -0x4(%rbp) # imm = 0xFFFFFFFE
jmp 0x10f35
movq -0x10(%rbp), %rax
cmpl $0x0, 0x8(%rax)
jne 0x10ec2
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x10f35
jmp 0x10ec4
movq -0x10(%rbp), %rax
movq 0x28(%rax), %rax
movq -0x10(%rbp), %rdx
movl 0x10(%rdx), %ecx
movl %ecx, %esi
addl $0x1, %esi
movl %esi, 0x10(%rdx)
movslq %ecx, %rcx
movzbl (%rax,%rcx), %eax
movl %eax, -0x14(%rbp)
movq -0x10(%rbp), %rax
movl 0x10(%rax), %eax
movq -0x10(%rbp), %rcx
cmpl 0x8(%rcx), %eax
jne 0x10f1f
movq -0x10(%rbp), %rdi
callq 0xdd80
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x10(%rbp), %rax
movl $0x0, 0x10(%rax)
movq -0x10(%rbp), %rax
movl $0x0, 0x8(%rax)
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x20(%rax)
movl -0x14(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/samtools[P]htslib/bgzf.c
// Function: bgzf_index_build_init
int bgzf_index_build_init(BGZF *fp)
{
    bgzf_index_destroy(fp);
    fp->idx = (bgzidx_t*) calloc(1,sizeof(bgzidx_t));
    if ( !fp->idx ) return -1;
    fp->idx_build_otf = 1;  // build index on the fly
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
callq 0x10690
movl $0x1, %edi
movl $0x18, %esi
callq 0x42f0
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x50(%rax)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x50(%rax)
jne 0x11243
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x11255
movq -0x10(%rbp), %rax
movl $0x1, 0x58(%rax)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x10, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/samtools[P]htslib/bgzf.c
// Function: bgzf_index_dump_hfile
int bgzf_index_dump_hfile(BGZF *fp, struct hFILE *idx, const char *name)
{
    // Note that the index contains one extra record when indexing files opened
    // for reading. The terminating record is not present when opened for writing.
    // This is not a bug.

    int i;

    if (!fp->idx) {
        hts_log_error("Called for BGZF handle with no index");
        errno = EINVAL;
        return -1;
    }

    if (bgzf_flush(fp) != 0) return -1;

    // discard the entry marking the end of the file
    if (fp->mt && fp->idx)
        fp->idx->noffs--;

    if (hwrite_uint64(fp->idx->noffs - 1, idx) < 0) goto fail;
    for (i=1; i<fp->idx->noffs; i++)
    {
        if (hwrite_uint64(fp->idx->offs[i].caddr, idx) < 0) goto fail;
        if (hwrite_uint64(fp->idx->offs[i].uaddr, idx) < 0) goto fail;
    }
    return 0;

 fail:
    hts_log_error("Error writing to %s : %s", name ? name : "index", strerror(errno));
    return -1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x40, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x50(%rax)
jne 0x112b0
movl $0x1, %edi
leaq 0xddd40(%rip), %rsi     # 0xeefcb
leaq 0xddd4f(%rip), %rdx     # 0xeefe1
movb $0x0, %al
callq 0x1b030
callq 0x4050
movl $0x16, (%rax)
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x113ed
movq -0x10(%rbp), %rdi
callq 0xf820
cmpl $0x0, %eax
je 0x112ca
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x113ed
movq -0x10(%rbp), %rax
cmpq $0x0, 0x48(%rax)
je 0x112ef
movq -0x10(%rbp), %rax
cmpq $0x0, 0x50(%rax)
je 0x112ef
movq -0x10(%rbp), %rax
movq 0x50(%rax), %rax
movl (%rax), %ecx
addl $-0x1, %ecx
movl %ecx, (%rax)
movq -0x10(%rbp), %rax
movq 0x50(%rax), %rax
movl (%rax), %eax
subl $0x1, %eax
movslq %eax, %rdi
movq -0x18(%rbp), %rsi
callq 0x11400
cmpl $0x0, %eax
jge 0x11312
jmp 0x11393
movl $0x1, -0x24(%rbp)
movl -0x24(%rbp), %eax
movq -0x10(%rbp), %rcx
movq 0x50(%rcx), %rcx
cmpl (%rcx), %eax
jge 0x1138a
movq -0x10(%rbp), %rax
movq 0x50(%rax), %rax
movq 0x8(%rax), %rax
movslq -0x24(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rdi
movq -0x18(%rbp), %rsi
callq 0x11400
cmpl $0x0, %eax
jge 0x11353
jmp 0x11393
movq -0x10(%rbp), %rax
movq 0x50(%rax), %rax
movq 0x8(%rax), %rax
movslq -0x24(%rbp), %rcx
shlq $0x4, %rcx
addq %rcx, %rax
movq (%rax), %rdi
movq -0x18(%rbp), %rsi
callq 0x11400
cmpl $0x0, %eax
jge 0x1137d
jmp 0x11393
jmp 0x1137f
movl -0x24(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x24(%rbp)
jmp 0x11319
movl $0x0, -0x4(%rbp)
jmp 0x113ed
cmpq $0x0, -0x20(%rbp)
je 0x113a4
movq -0x20(%rbp), %rax
movq %rax, -0x30(%rbp)
jmp 0x113b1
leaq 0xe1590(%rip), %rax     # 0xf293b
movq %rax, -0x30(%rbp)
jmp 0x113b1
movq -0x30(%rbp), %rax
movq %rax, -0x38(%rbp)
callq 0x4050
movl (%rax), %edi
callq 0x4130
movq -0x38(%rbp), %rcx
movq %rax, %r8
movl $0x1, %edi
leaq 0xddbf3(%rip), %rsi     # 0xeefcb
leaq 0xddc27(%rip), %rdx     # 0xef006
movb $0x0, %al
callq 0x1b030
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
movl -0x4(%rbp), %eax
addq $0x40, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/samtools[P]htslib/bgzf.c
// Function: bgzf_index_dump
int bgzf_index_dump(BGZF *fp, const char *bname, const char *suffix)
{
    const char *name = bname, *msg = NULL;
    char *tmp = NULL;
    hFILE *idx = NULL;

    if (!fp->idx) {
        hts_log_error("Called for BGZF handle with no index");
        errno = EINVAL;
        return -1;
    }

    if ( suffix )
    {
        tmp = get_name_suffix(bname, suffix);
        if ( !tmp ) return -1;
        name = tmp;
    }

    idx = hopen(name, "wb");
    if ( !idx ) {
        msg = "Error opening";
        goto fail;
    }

    if (bgzf_index_dump_hfile(fp, idx, name) != 0) goto fail;

    if (hclose(idx) < 0)
    {
        idx = NULL;
        msg = "Error on closing";
        goto fail;
    }

    free(tmp);
    return 0;

 fail:
    if (msg != NULL) {
        hts_log_error("%s %s : %s", msg, name, strerror(errno));
    }
    if (idx) hclose_abruptly(idx);
    free(tmp);
    return -1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x28(%rbp)
movq $0x0, -0x30(%rbp)
movq $0x0, -0x38(%rbp)
movq $0x0, -0x40(%rbp)
movq -0x10(%rbp), %rax
cmpq $0x0, 0x50(%rax)
jne 0x114d0
movl $0x1, %edi
leaq 0xddb74(%rip), %rsi     # 0xef01f
leaq 0xddb2f(%rip), %rdx     # 0xeefe1
movb $0x0, %al
callq 0x1b030
callq 0x4050
movl $0x16, (%rax)
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x115e2
cmpq $0x0, -0x20(%rbp)
je 0x11503
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x115f0
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x38(%rbp)
jne 0x114fb
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x115e2
movq -0x38(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rdi
leaq 0xddb21(%rip), %rsi     # 0xef02f
movb $0x0, %al
callq 0x158b0
movq %rax, -0x40(%rbp)
cmpq $0x0, -0x40(%rbp)
jne 0x1152d
leaq 0xddb0b(%rip), %rax     # 0xef032
movq %rax, -0x30(%rbp)
jmp 0x1157a
movq -0x10(%rbp), %rdi
movq -0x40(%rbp), %rsi
movq -0x28(%rbp), %rdx
callq 0x11260
cmpl $0x0, %eax
je 0x11545
jmp 0x1157a
movq -0x40(%rbp), %rdi
callq 0x14920
cmpl $0x0, %eax
jge 0x11568
movq $0x0, -0x40(%rbp)
leaq 0xddade(%rip), %rax     # 0xef040
movq %rax, -0x30(%rbp)
jmp 0x1157a
movq -0x38(%rbp), %rdi
callq 0x45a0
movl $0x0, -0x4(%rbp)
jmp 0x115e2
cmpq $0x0, -0x30(%rbp)
je 0x115c2
movq -0x30(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0x48(%rbp)
callq 0x4050
movl (%rax), %edi
callq 0x4130
movq -0x50(%rbp), %rcx
movq -0x48(%rbp), %r8
movq %rax, %r9
movl $0x1, %edi
leaq 0xdda6b(%rip), %rsi     # 0xef01f
leaq 0xdda96(%rip), %rdx     # 0xef051
movb $0x0, %al
callq 0x1b030
cmpq $0x0, -0x40(%rbp)
je 0x115d2
movq -0x40(%rbp), %rdi
callq 0x149d0
movq -0x38(%rbp), %rdi
callq 0x45a0
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
movl -0x4(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/samtools[P]htslib/bgzf.c
// Function: get_name_suffix
static char * get_name_suffix(const char *bname, const char *suffix)
{
    size_t len = strlen(bname) + strlen(suffix) + 1;
    char *buff = malloc(len);
    if (!buff) return NULL;
    snprintf(buff, len, "%s%s", bname, suffix);
    return buff;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq -0x10(%rbp), %rdi
callq 0x41b0
movq %rax, -0x30(%rbp)
movq -0x18(%rbp), %rdi
callq 0x41b0
movq %rax, %rcx
movq -0x30(%rbp), %rax
addq %rcx, %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
movq -0x20(%rbp), %rdi
callq 0x4650
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
jne 0x11646
movq $0x0, -0x8(%rbp)
jmp 0x1166c
movq -0x28(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x10(%rbp), %rcx
movq -0x18(%rbp), %r8
leaq 0xdeaeb(%rip), %rdx     # 0xf0148
movb $0x0, %al
callq 0x47e0
movq -0x28(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/samtools[P]htslib/bgzf.c
// Function: bgzf_index_load
int bgzf_index_load(BGZF *fp, const char *bname, const char *suffix)
{
    const char *name = bname, *msg = NULL;
    char *tmp = NULL;
    hFILE *idx = NULL;
    if ( suffix )
    {
        tmp = get_name_suffix(bname, suffix);
        if ( !tmp ) return -1;
        name = tmp;
    }

    idx = hopen(name, "rb");
    if ( !idx ) {
        msg = "Error opening";
        goto fail;
    }

    if (bgzf_index_load_hfile(fp, idx, name) != 0) goto fail;

    if (hclose(idx) != 0) {
        idx = NULL;
        msg = "Error closing";
        goto fail;
    }

    free(tmp);
    return 0;

 fail:
    if (msg != NULL) {
        hts_log_error("%s %s : %s", msg, name, strerror(errno));
    }
    if (idx) hclose_abruptly(idx);
    free(tmp);
    return -1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x28(%rbp)
movq $0x0, -0x30(%rbp)
movq $0x0, -0x38(%rbp)
movq $0x0, -0x40(%rbp)
cmpq $0x0, -0x20(%rbp)
je 0x11937
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x115f0
movq %rax, -0x38(%rbp)
cmpq $0x0, -0x38(%rbp)
jne 0x1192f
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x11a16
movq -0x38(%rbp), %rax
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rdi
leaq 0xdd746(%rip), %rsi     # 0xef088
movb $0x0, %al
callq 0x158b0
movq %rax, -0x40(%rbp)
cmpq $0x0, -0x40(%rbp)
jne 0x11961
leaq 0xdd6d7(%rip), %rax     # 0xef032
movq %rax, -0x30(%rbp)
jmp 0x119ae
movq -0x10(%rbp), %rdi
movq -0x40(%rbp), %rsi
movq -0x28(%rbp), %rdx
callq 0x11680
cmpl $0x0, %eax
je 0x11979
jmp 0x119ae
movq -0x40(%rbp), %rdi
callq 0x14920
cmpl $0x0, %eax
je 0x1199c
movq $0x0, -0x40(%rbp)
leaq 0xdd6f5(%rip), %rax     # 0xef08b
movq %rax, -0x30(%rbp)
jmp 0x119ae
movq -0x38(%rbp), %rdi
callq 0x45a0
movl $0x0, -0x4(%rbp)
jmp 0x11a16
cmpq $0x0, -0x30(%rbp)
je 0x119f6
movq -0x30(%rbp), %rax
movq %rax, -0x50(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0x48(%rbp)
callq 0x4050
movl (%rax), %edi
callq 0x4130
movq -0x50(%rbp), %rcx
movq -0x48(%rbp), %r8
movq %rax, %r9
movl $0x1, %edi
leaq 0xdd6b1(%rip), %rsi     # 0xef099
leaq 0xdd662(%rip), %rdx     # 0xef051
movb $0x0, %al
callq 0x1b030
cmpq $0x0, -0x40(%rbp)
je 0x11a06
movq -0x40(%rbp), %rdi
callq 0x149d0
movq -0x38(%rbp), %rdi
callq 0x45a0
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
movl -0x4(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/samtools[P]htslib/bgzf.c
// Function: razf_info
static void razf_info(hFILE *hfp, const char *filename)
{
    uint64_t usize, csize;
    off_t sizes_pos;

    if (filename == NULL || strcmp(filename, "-") == 0) filename = "FILE";

    // RAZF files end with USIZE,CSIZE stored as big-endian uint64_t
    if ((sizes_pos = hseek(hfp, -16, SEEK_END)) < 0) goto no_sizes;
    if (hread(hfp, &usize, 8) != 8 || hread(hfp, &csize, 8) != 8) goto no_sizes;
    if (!ed_is_big()) ed_swap_8p(&usize), ed_swap_8p(&csize);
    if (csize >= sizes_pos) goto no_sizes; // Very basic validity check

    hts_log_error(
"To decompress this file, use the following commands:\n"
"    truncate -s %" PRIu64 " %s\n"
"    gunzip %s\n"
"The resulting uncompressed file should be %" PRIu64 " bytes in length.\n"
"If you do not have a truncate command, skip that step (though gunzip will\n"
"likely produce a \"trailing garbage ignored\" message, which can be ignored).",
                  csize, filename, filename, usize);
    return;

no_sizes:
    hts_log_error(
"To decompress this file, use the following command:\n"
"    gunzip %s\n"
"This will likely produce a \"trailing garbage ignored\" message, which can\n"
"usually be safely ignored.", filename);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
je 0x11e5c
movq -0x10(%rbp), %rdi
leaq 0xe05a3(%rip), %rsi     # 0xf23f5
callq 0x4690
cmpl $0x0, %eax
jne 0x11e67
leaq 0xdd2c7(%rip), %rax     # 0xef12a
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rdi
movq $-0x10, %rsi
movl $0x2, %edx
callq 0x146a0
movq %rax, -0x28(%rbp)
cmpq $0x0, %rax
jge 0x11e8b
jmp 0x11f15
movq -0x8(%rbp), %rdi
leaq -0x18(%rbp), %rsi
movl $0x8, %edx
callq 0xde00
cmpq $0x8, %rax
jne 0x11ebb
movq -0x8(%rbp), %rdi
leaq -0x20(%rbp), %rsi
movl $0x8, %edx
callq 0xde00
cmpq $0x8, %rax
je 0x11ebd
jmp 0x11f15
callq 0xc710
cmpl $0x0, %eax
jne 0x11ed9
leaq -0x18(%rbp), %rdi
callq 0x11f60
leaq -0x20(%rbp), %rdi
callq 0x11f60
movq -0x20(%rbp), %rax
cmpq -0x28(%rbp), %rax
jb 0x11ee5
jmp 0x11f15
movq -0x20(%rbp), %rcx
movq -0x10(%rbp), %r8
movq -0x10(%rbp), %r9
movq -0x18(%rbp), %rax
movl $0x1, %edi
leaq 0xdd22e(%rip), %rsi     # 0xef12f
leaq 0xdd231(%rip), %rdx     # 0xef139
movq %rax, (%rsp)
movb $0x0, %al
callq 0x1b030
jmp 0x11f33
movq -0x10(%rbp), %rcx
movl $0x1, %edi
leaq 0xdd20a(%rip), %rsi     # 0xef12f
leaq 0xdd33c(%rip), %rdx     # 0xef268
movb $0x0, %al
callq 0x1b030
addq $0x30, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/samtools[P]htslib/bgzf.c
// Function: mode2level
static int mode2level(const char *mode)
{
    int i, compress_level = -1;
    for (i = 0; mode[i]; ++i)
        if (mode[i] >= '0' && mode[i] <= '9') break;
    if (mode[i]) compress_level = (int)mode[i] - '0';
    if (strchr(mode, 'u')) compress_level = -2;
    return compress_level;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movl $0xffffffff, -0x10(%rbp) # imm = 0xFFFFFFFF
movl $0x0, -0xc(%rbp)
movq -0x8(%rbp), %rax
movslq -0xc(%rbp), %rcx
cmpb $0x0, (%rax,%rcx)
je 0x12069
movq -0x8(%rbp), %rax
movslq -0xc(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x30, %eax
jl 0x1205c
movq -0x8(%rbp), %rax
movslq -0xc(%rbp), %rcx
movsbl (%rax,%rcx), %eax
cmpl $0x39, %eax
jg 0x1205c
jmp 0x12069
jmp 0x1205e
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x1202a
movq -0x8(%rbp), %rax
movslq -0xc(%rbp), %rcx
cmpb $0x0, (%rax,%rcx)
je 0x12089
movq -0x8(%rbp), %rax
movslq -0xc(%rbp), %rcx
movsbl (%rax,%rcx), %eax
subl $0x30, %eax
movl %eax, -0x10(%rbp)
movq -0x8(%rbp), %rdi
movl $0x75, %esi
callq 0x4170
cmpq $0x0, %rax
je 0x120a4
movl $0xfffffffe, -0x10(%rbp) # imm = 0xFFFFFFFE
movl -0x10(%rbp), %eax
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/samtools[P]htslib/bgzf.c
// Function: bgzf_decode_func
static void *bgzf_decode_func(void *arg) {
    bgzf_job *j = (bgzf_job *)arg;

    j->uncomp_len = BGZF_MAX_BLOCK_SIZE;
    uint32_t crc = le_to_u32((uint8_t *)j->comp_data + j->comp_len-8);
    int ret = bgzf_uncompress(j->uncomp_data, &j->uncomp_len,
                              j->comp_data+18, j->comp_len-18, crc);
    if (ret != 0)
        j->errcode |= BGZF_ERR_ZLIB;

    return arg;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq $0x10000, 0x20010(%rax) # imm = 0x10000
movq -0x10(%rbp), %rdi
addq $0x8, %rdi
movq -0x10(%rbp), %rax
addq 0x10008(%rax), %rdi
addq $-0x8, %rdi
callq 0x12200
movl %eax, -0x14(%rbp)
movq -0x10(%rbp), %rdi
addq $0x10010, %rdi          # imm = 0x10010
movq -0x10(%rbp), %rsi
addq $0x20010, %rsi          # imm = 0x20010
movq -0x10(%rbp), %rdx
addq $0x8, %rdx
addq $0x12, %rdx
movq -0x10(%rbp), %rax
movq 0x10008(%rax), %rcx
subq $0x12, %rcx
movl -0x14(%rbp), %r8d
callq 0x12210
movl %eax, -0x18(%rbp)
cmpl $0x0, -0x18(%rbp)
je 0x131e8
movq -0x10(%rbp), %rax
movl 0x20018(%rax), %ecx
orl $0x1, %ecx
movl %ecx, 0x20018(%rax)
movq -0x8(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/samtools[P]htslib/bgzf.c
// Function: job_cleanup
static void job_cleanup(void *arg) {
    bgzf_job *j = (bgzf_job *)arg;
    mtaux_t *mt = j->fp->mt;
    pthread_mutex_lock(&mt->job_pool_m);
    pool_free(mt->job_pool, j);
    pthread_mutex_unlock(&mt->job_pool_m);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq 0x48(%rax), %rax
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
addq $0x30, %rdi
callq 0x4730
movq -0x18(%rbp), %rax
movq (%rax), %rdi
movq -0x10(%rbp), %rsi
callq 0x822f0
movq -0x18(%rbp), %rdi
addq $0x30, %rdi
callq 0x4330
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/samtools[P]htslib/bgzf.c
// Function: bgzf_mt_seek
static void bgzf_mt_seek(BGZF *fp) {
    mtaux_t *mt = fp->mt;

    hts_tpool_process_reset(mt->out_queue, 0);
    pthread_mutex_lock(&mt->job_pool_m);
    mt->errcode = 0;

    if (hseek(fp->fp, mt->block_address, SEEK_SET) < 0)
        mt->errcode = errno;

    pthread_mutex_unlock(&mt->job_pool_m);
    mt->command = SEEK_DONE;
    pthread_cond_signal(&mt->command_c);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq 0x48(%rax), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rdi
xorl %esi, %esi
callq 0x4d720
movq -0x10(%rbp), %rdi
addq $0x30, %rdi
callq 0x4730
movq -0x10(%rbp), %rax
movl $0x0, 0x6c(%rax)
movq -0x8(%rbp), %rax
movq 0x40(%rax), %rdi
movq -0x10(%rbp), %rax
movq 0x70(%rax), %rsi
xorl %edx, %edx
callq 0x146a0
cmpq $0x0, %rax
jge 0x132ca
callq 0x4050
movl (%rax), %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x6c(%rax)
movq -0x10(%rbp), %rdi
addq $0x30, %rdi
callq 0x4330
movq -0x10(%rbp), %rax
movl $0x2, 0xd8(%rax)
movq -0x10(%rbp), %rdi
addq $0xa8, %rdi
callq 0x4040
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/samtools[P]htslib/bgzf.c
// Function: bgzf_mt_eof
static void bgzf_mt_eof(BGZF *fp) {
    mtaux_t *mt = fp->mt;

    pthread_mutex_lock(&mt->job_pool_m);
    mt->eof = bgzf_check_EOF_common(fp);
    pthread_mutex_unlock(&mt->job_pool_m);
    mt->command = HAS_EOF_DONE;
    pthread_cond_signal(&mt->command_c);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq 0x48(%rax), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rdi
addq $0x30, %rdi
callq 0x4730
movq -0x8(%rbp), %rdi
callq 0x10980
movl %eax, %ecx
movq -0x10(%rbp), %rax
movl %ecx, 0x78(%rax)
movq -0x10(%rbp), %rdi
addq $0x30, %rdi
callq 0x4330
movq -0x10(%rbp), %rax
movl $0x4, 0xd8(%rax)
movq -0x10(%rbp), %rdi
addq $0xa8, %rdi
callq 0x4040
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/samtools[P]htslib/bgzf.c
// Function: bgzf_encode_level0_func
static void *bgzf_encode_level0_func(void *arg) {
    bgzf_job *j = (bgzf_job *)arg;
    uint32_t crc;
    j->comp_len = j->uncomp_len + BLOCK_HEADER_LENGTH + BLOCK_FOOTER_LENGTH + 5;

    // Data will have already been copied in to
    // j->comp_data + BLOCK_HEADER_LENGTH + 5

    // Add preamble
    memcpy(j->comp_data, g_magic, BLOCK_HEADER_LENGTH);
    u16_to_le(j->comp_len-1, j->comp_data + 16);

    // Deflate uncompressed data header
    j->comp_data[BLOCK_HEADER_LENGTH] = 1; // BFINAL=1, BTYPE=00; see RFC1951
    u16_to_le(j->uncomp_len, j->comp_data + BLOCK_HEADER_LENGTH + 1);
    u16_to_le(~j->uncomp_len, j->comp_data + BLOCK_HEADER_LENGTH + 3);

    // Trailer (CRC, uncompressed length)
    crc = hts_crc32(0, j->comp_data + BLOCK_HEADER_LENGTH + 5, j->uncomp_len);
    u32_to_le(crc, j->comp_data +  j->comp_len - 8);
    u32_to_le(j->uncomp_len, j->comp_data + j->comp_len - 4);

    return arg;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq 0x20010(%rax), %rcx
addq $0x12, %rcx
addq $0x8, %rcx
addq $0x5, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x10008(%rax)
movq -0x10(%rbp), %rax
movq 0xdb78f(%rip), %rcx     # 0xeeb50
movq %rcx, 0x8(%rax)
movq 0xdb78c(%rip), %rcx     # 0xeeb58
movq %rcx, 0x10(%rax)
movw 0xdb789(%rip), %cx      # 0xeeb60
movw %cx, 0x18(%rax)
movq -0x10(%rbp), %rax
movq 0x10008(%rax), %rax
subq $0x1, %rax
movq -0x10(%rbp), %rsi
addq $0x8, %rsi
addq $0x10, %rsi
movzwl %ax, %edi
callq 0xcd20
movq -0x10(%rbp), %rax
movb $0x1, 0x1a(%rax)
movq -0x10(%rbp), %rax
movq 0x20010(%rax), %rax
movq -0x10(%rbp), %rsi
addq $0x8, %rsi
addq $0x12, %rsi
addq $0x1, %rsi
movzwl %ax, %edi
callq 0xcd20
movq -0x10(%rbp), %rax
movq 0x20010(%rax), %rax
xorq $-0x1, %rax
movq -0x10(%rbp), %rsi
addq $0x8, %rsi
addq $0x12, %rsi
addq $0x3, %rsi
movzwl %ax, %edi
callq 0xcd20
movq -0x10(%rbp), %rsi
addq $0x8, %rsi
addq $0x12, %rsi
addq $0x5, %rsi
movq -0x10(%rbp), %rax
movq 0x20010(%rax), %rdx
xorl %edi, %edi
callq 0xc970
movl %eax, -0x14(%rbp)
movl -0x14(%rbp), %edi
movq -0x10(%rbp), %rsi
addq $0x8, %rsi
movq -0x10(%rbp), %rax
addq 0x10008(%rax), %rsi
addq $-0x8, %rsi
callq 0x13560
movq -0x10(%rbp), %rax
movq 0x20010(%rax), %rax
movl %eax, %edi
movq -0x10(%rbp), %rsi
addq $0x8, %rsi
movq -0x10(%rbp), %rax
addq 0x10008(%rax), %rsi
addq $-0x4, %rsi
callq 0x13560
movq -0x8(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/samtools[P]htslib/bgzf.c
// Function: bgzf_encode_func
static void *bgzf_encode_func(void *arg) {
    bgzf_job *j = (bgzf_job *)arg;

    j->comp_len = BGZF_MAX_BLOCK_SIZE;
    int ret = bgzf_compress(j->comp_data, &j->comp_len,
                            j->uncomp_data, j->uncomp_len,
                            j->fp->compress_level);
    if (ret != 0)
        j->errcode |= BGZF_ERR_ZLIB;

    return arg;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq $0x10000, 0x10008(%rax) # imm = 0x10000
movq -0x10(%rbp), %rdi
addq $0x8, %rdi
movq -0x10(%rbp), %rsi
addq $0x10008, %rsi          # imm = 0x10008
movq -0x10(%rbp), %rdx
addq $0x10010, %rdx          # imm = 0x10010
movq -0x10(%rbp), %rax
movq 0x20010(%rax), %rcx
movq -0x10(%rbp), %rax
movq (%rax), %rax
movl (%rax), %r8d
shll $0x3, %r8d
sarl $0x17, %r8d
callq 0xc9a0
movl %eax, -0x14(%rbp)
cmpl $0x0, -0x14(%rbp)
je 0x1354f
movq -0x10(%rbp), %rax
movl 0x20018(%rax), %ecx
orl $0x1, %ecx
movl %ecx, 0x20018(%rax)
movq -0x8(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/samtools[P]htslib/bgzf.c
// Function: bgzf_gzip_compress
static int bgzf_gzip_compress(BGZF *fp, void *_dst, size_t *dlen, const void *src, size_t slen, int level)
{
    uint8_t *dst = (uint8_t*)_dst;
    z_stream *zs = fp->gz_stream;
    int flush = slen ? Z_PARTIAL_FLUSH : Z_FINISH;
    zs->next_in   = (Bytef*)src;
    zs->avail_in  = slen;
    zs->next_out  = dst;
    zs->avail_out = *dlen;
    int ret = deflate(zs, flush);
    if (ret == Z_STREAM_ERROR) {
        hts_log_error("Deflate operation failed: %s", bgzf_zerr(ret, NULL));
        return -1;
    }
    if (zs->avail_in != 0) {
        hts_log_error("Deflate block too large for output buffer");
        return -1;
    }
    *dlen = *dlen - zs->avail_out;
    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq %r8, -0x30(%rbp)
movl %r9d, -0x34(%rbp)
movq -0x18(%rbp), %rax
movq %rax, -0x40(%rbp)
movq -0x10(%rbp), %rax
movq 0x60(%rax), %rax
movq %rax, -0x48(%rbp)
movq -0x30(%rbp), %rdx
movl $0x4, %eax
movl $0x1, %ecx
cmpq $0x0, %rdx
cmovnel %ecx, %eax
movl %eax, -0x4c(%rbp)
movq -0x28(%rbp), %rcx
movq -0x48(%rbp), %rax
movq %rcx, (%rax)
movq -0x30(%rbp), %rax
movl %eax, %ecx
movq -0x48(%rbp), %rax
movl %ecx, 0x8(%rax)
movq -0x40(%rbp), %rcx
movq -0x48(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x20(%rbp), %rax
movq (%rax), %rax
movl %eax, %ecx
movq -0x48(%rbp), %rax
movl %ecx, 0x20(%rax)
movq -0x48(%rbp), %rdi
movl -0x4c(%rbp), %esi
callq 0x41e0
movl %eax, -0x50(%rbp)
cmpl $-0x2, -0x50(%rbp)
jne 0x13697
movl -0x50(%rbp), %edi
xorl %eax, %eax
movl %eax, %esi
callq 0xcd40
movq %rax, %rcx
movl $0x1, %edi
leaq 0xdbf6d(%rip), %rsi     # 0xef5ed
leaq 0xdb533(%rip), %rdx     # 0xeebba
movb $0x0, %al
callq 0x1b030
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x136e3
movq -0x48(%rbp), %rax
cmpl $0x0, 0x8(%rax)
je 0x136c4
movl $0x1, %edi
leaq 0xdbf40(%rip), %rsi     # 0xef5ed
leaq 0xdbf4c(%rip), %rdx     # 0xef600
movb $0x0, %al
callq 0x1b030
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x136e3
movq -0x20(%rbp), %rax
movq (%rax), %rcx
movq -0x48(%rbp), %rax
movl 0x20(%rax), %eax
subq %rax, %rcx
movq -0x20(%rbp), %rax
movq %rcx, (%rax)
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/samtools[P]htslib/hfile.c
// Function: hfile_init
HTSLIB_EXPORT
hFILE *hfile_init(size_t struct_size, const char *mode, size_t capacity)
{
    hFILE *fp = (hFILE *) malloc(struct_size);
    if (fp == NULL) goto error;

    const int maxcap = 128*1024;

    if (capacity == 0) capacity = maxcap;
    // FIXME For now, clamp input buffer sizes so mpileup doesn't eat memory
    if (strchr(mode, 'r') && capacity > maxcap) capacity = maxcap;

#ifdef HAVE_POSIX_MEMALIGN
    fp->buffer = NULL;
    if (posix_memalign((void **)&fp->buffer, 256, capacity) < 0)
        goto error;
#else
    fp->buffer = (char *) malloc(capacity);
    if (fp->buffer == NULL) goto error;
#endif

    fp->begin = fp->end = fp->buffer;
    fp->limit = &fp->buffer[capacity];

    fp->offset = 0;
    fp->at_eof = 0;
    fp->mobile = 1;
    fp->readonly = (strchr(mode, 'r') && ! strchr(mode, '+'));
    fp->preserve = 0;
    fp->has_errno = 0;
    return fp;

error:
    hfile_destroy(fp);
    return NULL;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq -0x10(%rbp), %rdi
callq 0x4650
movq %rax, -0x28(%rbp)
cmpq $0x0, -0x28(%rbp)
jne 0x1382d
jmp 0x1395b
movl $0x20000, -0x2c(%rbp)   # imm = 0x20000
cmpq $0x0, -0x20(%rbp)
jne 0x13843
movq $0x20000, -0x20(%rbp)   # imm = 0x20000
movq -0x18(%rbp), %rdi
movl $0x72, %esi
callq 0x4170
cmpq $0x0, %rax
je 0x13869
cmpq $0x20000, -0x20(%rbp)   # imm = 0x20000
jbe 0x13869
movq $0x20000, -0x20(%rbp)   # imm = 0x20000
movq -0x20(%rbp), %rdi
callq 0x4650
movq %rax, %rcx
movq -0x28(%rbp), %rax
movq %rcx, (%rax)
movq -0x28(%rbp), %rax
cmpq $0x0, (%rax)
jne 0x1388b
jmp 0x1395b
movq -0x28(%rbp), %rax
movq (%rax), %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x28(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x28(%rbp), %rax
movq (%rax), %rcx
addq -0x20(%rbp), %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x18(%rax)
movq -0x28(%rbp), %rax
movq $0x0, 0x28(%rax)
movq -0x28(%rbp), %rax
movb 0x30(%rax), %cl
andb $-0x2, %cl
orb $0x0, %cl
movb %cl, 0x30(%rax)
movq -0x28(%rbp), %rax
movb 0x30(%rax), %cl
andb $-0x3, %cl
orb $0x2, %cl
movb %cl, 0x30(%rax)
movq -0x18(%rbp), %rdi
movl $0x72, %esi
callq 0x4170
movq %rax, %rcx
xorl %eax, %eax
cmpq $0x0, %rcx
movb %al, -0x2d(%rbp)
je 0x13917
movq -0x18(%rbp), %rdi
movl $0x2b, %esi
callq 0x4170
cmpq $0x0, %rax
setne %al
xorb $-0x1, %al
movb %al, -0x2d(%rbp)
movb -0x2d(%rbp), %al
andb $0x1, %al
movzbl %al, %ecx
movq -0x28(%rbp), %rax
movb %cl, %dl
movb 0x30(%rax), %cl
andb $0x1, %dl
shlb $0x2, %dl
andb $-0x5, %cl
orb %dl, %cl
movb %cl, 0x30(%rax)
movq -0x28(%rbp), %rax
movb 0x30(%rax), %cl
andb $-0x9, %cl
orb $0x0, %cl
movb %cl, 0x30(%rax)
movq -0x28(%rbp), %rax
movl $0x0, 0x34(%rax)
movq -0x28(%rbp), %rax
movq %rax, -0x8(%rbp)
jmp 0x1396c
movq -0x28(%rbp), %rdi
callq 0x13980
movq $0x0, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)