LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/zhou-lab[P]tbmate/htslib/bgzf.c
// Function: inflate_block
static int inflate_block(BGZF* fp, int block_length)
{
    z_stream zs;
    zs.zalloc = NULL;
    zs.zfree = NULL;
    zs.msg = NULL;
    zs.next_in = (Bytef*)fp->compressed_block + 18;
    zs.avail_in = block_length - 16;
    zs.next_out = (Bytef*)fp->uncompressed_block;
    zs.avail_out = BGZF_MAX_BLOCK_SIZE;

    int ret = inflateInit2(&zs, -15);
    if (ret != Z_OK) {
        if (hts_verbose >= 1) {
            fprintf(stderr, "[E::%s] inflateInit2 failed: %s\n",
                    __func__, bgzf_zerr(ret, &zs));
        }
        fp->errcode |= BGZF_ERR_ZLIB;
        return -1;
    }
    if ((ret = inflate(&zs, Z_FINISH)) != Z_STREAM_END) {
        if (hts_verbose >= 1) {
            fprintf(stderr, "[E::%s] inflate failed: %s\n",
                    __func__, bgzf_zerr(ret, ret == Z_DATA_ERROR ? &zs : NULL));
        }
        if ((ret = inflateEnd(&zs)) != Z_OK) {
            if (hts_verbose >= 2) {
                fprintf(stderr, "[E::%s] inflateEnd failed: %s\n",
                        __func__, bgzf_zerr(ret, NULL));
            }
        }
        fp->errcode |= BGZF_ERR_ZLIB;
        return -1;
    }
    if ((ret = inflateEnd(&zs)) != Z_OK) {
        if (hts_verbose >= 1) {
            fprintf(stderr, "[E::%s] inflateEnd failed: %s\n",
                    __func__, bgzf_zerr(ret, NULL));
        }
        fp->errcode |= BGZF_ERR_ZLIB;
        return -1;
    }
    return zs.total_out;
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x78, %rsp
movq %rdi, %rbx
leaq 0x8(%rsp), %rdi
movq $0x0, 0x30(%rdi)
xorps %xmm0, %xmm0
movups %xmm0, 0x40(%rdi)
movq 0x28(%rbx), %rax
addq $0x12, %rax
movq %rax, (%rdi)
addl $-0x10, %esi
movl %esi, 0x8(%rdi)
movq 0x20(%rbx), %rax
movq %rax, 0x18(%rdi)
movl $0x10000, 0x20(%rdi)    # imm = 0x10000
leaq 0x26b03(%rip), %rdx     # 0x4e771
movl $0xfffffff1, %esi       # imm = 0xFFFFFFF1
movl $0x70, %ecx
callq 0x32e0
testl %eax, %eax
je 0x27c9d
leaq 0x37800(%rip), %rcx     # 0x5f488
cmpl $0x0, (%rcx)
jg 0x27d04
orb $0x1, (%rbx)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x78, %rsp
popq %rbx
popq %r14
retq
leaq 0x8(%rsp), %rdi
movl $0x4, %esi
callq 0x3310
cmpl $0x1, %eax
jne 0x27cd4
leaq 0x8(%rsp), %rdi
callq 0x30e0
testl %eax, %eax
je 0x27cfe
leaq 0x377c2(%rip), %rcx     # 0x5f488
cmpl $0x0, (%rcx)
jle 0x27c8d
movl %eax, %edi
callq 0x47f5
jmp 0x27c8d
leaq 0x377ad(%rip), %r14     # 0x5f488
cmpl $0x0, (%r14)
jg 0x27d15
leaq 0x8(%rsp), %rdi
callq 0x30e0
testl %eax, %eax
je 0x27c8d
cmpl $0x2, (%r14)
jl 0x27c8d
movl %eax, %edi
callq 0x47c6
jmp 0x27c8d
movl 0x30(%rsp), %eax
jmp 0x27c95
leaq 0x8(%rsp), %rsi
movl %eax, %edi
callq 0x4763
jmp 0x27c8d
leaq 0x8(%rsp), %rsi
movl %eax, %edi
callq 0x4790
jmp 0x27ce1
// File: /workspace/github_c_makefile_star2_O3/zhou-lab[P]tbmate/htslib/bgzf.c
// Function: bgzf_read
ssize_t bgzf_read(BGZF *fp, void *data, size_t length)
{
    ssize_t bytes_read = 0;
    uint8_t *output = (uint8_t*)data;
    if (length <= 0) return 0;
    assert(fp->is_write == 0);
    while (bytes_read < length) {
        int copy_length, available = fp->block_length - fp->block_offset;
        uint8_t *buffer;
        if (available <= 0) {
            int ret = bgzf_read_block(fp);
            if (ret != 0) {
                if (hts_verbose >= 2) {
                    fprintf(stderr, "[E::%s] bgzf_read_block error %d after %zd of %zu bytes\n", __func__, ret, bytes_read, length);
                }
                fp->errcode |= BGZF_ERR_ZLIB;
                return -1;
            }
            available = fp->block_length - fp->block_offset;
            if (available <= 0) break;
        }
        copy_length = length - bytes_read < available? length - bytes_read : available;
        buffer = (uint8_t*)fp->uncompressed_block;
        memcpy(output, buffer + fp->block_offset, copy_length);
        fp->block_offset += copy_length;
        output += copy_length;
        bytes_read += copy_length;
    }
    if (fp->block_offset == fp->block_length) {
        fp->block_address = htell(fp->fp);
        fp->block_offset = fp->block_length = 0;
    }
    fp->uncompressed_address += bytes_read;
    return bytes_read;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
testq %rdx, %rdx
je 0x280af
movq %rdi, %rbx
testb $0x3, 0x2(%rdi)
jne 0x28132
movq %rdx, %r15
movq %rsi, %r12
movl 0xc(%rbx), %eax
xorl %r14d, %r14d
movq %r15, %rbp
movl 0x8(%rbx), %ecx
subq %r14, %rbp
jbe 0x280bc
subl %eax, %ecx
jg 0x28075
movq %rbx, %rdi
callq 0x275cb
testl %eax, %eax
jne 0x280e1
movl 0x8(%rbx), %ecx
movl 0xc(%rbx), %eax
subl %eax, %ecx
jle 0x280a8
movl %ecx, %r13d
cmpq %r13, %rbp
cmovbq %rbp, %r13
movslq %eax, %rsi
addq 0x20(%rbx), %rsi
movq %r12, %rdi
movq %r13, %rdx
callq 0x3850
movl 0xc(%rbx), %eax
addl %r13d, %eax
movl %eax, 0xc(%rbx)
addq %r13, %r12
addq %r13, %r14
xorl %ecx, %ecx
testl %ecx, %ecx
je 0x28050
jmp 0x280b4
movl $0x3, %ecx
jmp 0x280a2
xorl %r14d, %r14d
jmp 0x280f7
cmpl $0x3, %ecx
jne 0x280f0
movl 0x8(%rbx), %ecx
cmpl %ecx, %eax
jne 0x280db
movq 0x38(%rbx), %rax
movq 0x28(%rax), %rcx
addq 0x8(%rax), %rcx
subq (%rax), %rcx
movq %rcx, 0x10(%rbx)
movq $0x0, 0x8(%rbx)
addq %r14, 0x18(%rbx)
jmp 0x280f7
leaq 0x373a0(%rip), %rcx     # 0x5f488
cmpl $0x2, (%rcx)
jge 0x28109
orb $0x1, (%rbx)
movq $-0x1, %r14
movq %r14, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x36ed8(%rip), %rcx     # 0x5efe8
movq (%rcx), %rdi
leaq 0x27e90(%rip), %rsi     # 0x4ffaa
leaq 0x27ec2(%rip), %rdx     # 0x4ffe3
movl %eax, %ecx
movq %r14, %r8
movq %r15, %r9
xorl %eax, %eax
callq 0x37e0
jmp 0x280ed
leaq 0x27e35(%rip), %rdi     # 0x4ff6e
leaq 0x27cf5(%rip), %rsi     # 0x4fe35
leaq 0x27e39(%rip), %rcx     # 0x4ff80
movl $0x2b2, %edx            # imm = 0x2B2
callq 0x3180
// File: /workspace/github_c_makefile_star2_O3/zhou-lab[P]tbmate/htslib/bgzf.c
// Function: bgzf_flush
int bgzf_flush(BGZF *fp)
{
    if (!fp->is_write) return 0;
#ifdef BGZF_MT
    if (fp->mt) {
        if (fp->block_offset) mt_queue(fp); // guaranteed that assertion does not fail
        return mt_flush_queue(fp);
    }
#endif
    while (fp->block_offset > 0) {
        int block_length;
        if ( fp->idx_build_otf )
        {
            bgzf_index_add_block(fp);
            fp->idx->ublock_addr += fp->block_offset;
        }
        block_length = deflate_block(fp, fp->block_offset);
        if (block_length < 0) {
            if (hts_verbose >= 3) fprintf(stderr, "[E::%s] deflate_block error %d\n", __func__, block_length);
            return -1;
        }
        if (hwrite(fp->fp, fp->compressed_block, block_length) != block_length) {
            if (hts_verbose >= 1) fprintf(stderr, "[E::%s] hwrite error (wrong size)\n", __func__);
            fp->errcode |= BGZF_ERR_IO; // possibly truncated file
            return -1;
        }
        fp->block_address += block_length;
    }
    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
xorl %edx, %edx
testb $0x3, 0x2(%rdi)
je 0x28475
movq %rdi, %r14
cmpq $0x0, 0x40(%rdi)
movl 0xc(%rdi), %esi
je 0x28424
testl %esi, %esi
je 0x28392
movq %r14, %rdi
callq 0x2848d
movq %r14, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x284f7
cmpl $0x0, 0x50(%r14)
je 0x283c3
movq %r14, %rdi
callq 0x27d23
movslq 0xc(%r14), %rsi
movq 0x48(%r14), %rax
addq %rsi, 0x10(%rax)
movq %r14, %rdi
callq 0x2872d
testl %eax, %eax
js 0x2842c
movq 0x28(%r14), %r13
movq 0x38(%r14), %rbp
movl %eax, %r15d
movq 0x8(%rbp), %rdi
movq 0x18(%rbp), %rbx
subq %rdi, %rbx
cmpq %r15, %rbx
movq %r15, %r12
cmovbq %rbx, %r12
movq %r13, %rsi
movq %r12, %rdx
callq 0x3850
addq %r12, 0x8(%rbp)
cmpq %r15, %rbx
jae 0x28417
movq %rbp, %rdi
movq %r13, %rsi
movq %r15, %rdx
movq %r12, %rcx
callq 0x2ba7d
movq %rax, %r12
cmpq %r15, %r12
jne 0x28460
addq %r15, 0x10(%r14)
movl 0xc(%r14), %esi
testl %esi, %esi
jg 0x283a8
xorl %edx, %edx
jmp 0x28475
leaq 0x37055(%rip), %rcx     # 0x5f488
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
cmpl $0x3, (%rcx)
jl 0x28475
movq 0x36ba4(%rip), %rcx     # 0x5efe8
movq (%rcx), %rdi
leaq 0x27b9f(%rip), %rsi     # 0x4ffed
leaq 0x27bb8(%rip), %rdx     # 0x5000d
movl %eax, %ecx
xorl %eax, %eax
callq 0x37e0
jmp 0x28470
leaq 0x37021(%rip), %rax     # 0x5f488
cmpl $0x0, (%rax)
jg 0x28486
orb $0x4, (%r14)
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movl %edx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x4824
jmp 0x2846c
// File: /workspace/github_c_makefile_star2_O3/zhou-lab[P]tbmate/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 )
    {
        if (hts_verbose >= 3) {
            fprintf(stderr, "[E::%s] compression error %d\n", __func__, ret);
        }
        fp->errcode |= BGZF_ERR_ZLIB;
        return -1;
    }
    fp->block_offset = 0;
    return comp_size;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq $0x10000, (%rsp)        # imm = 0x10000
movl (%rdi), %r8d
movq 0x28(%rdi), %rdi
movq 0x20(%rbx), %rdx
testl %r8d, %r8d
js 0x28776
movslq %esi, %rcx
shll $0x3, %r8d
sarl $0x17, %r8d
movq %rsp, %rsi
callq 0x273f6
testl %eax, %eax
je 0x287bc
leaq 0x36d1e(%rip), %rax     # 0x5f488
cmpl $0x3, (%rax)
jl 0x287b2
callq 0x4869
jmp 0x287b2
movq 0x58(%rbx), %r14
xorl %eax, %eax
testl %esi, %esi
sete %al
shll $0x2, %eax
movq %rdx, (%r14)
movl %esi, 0x8(%r14)
movq %rdi, 0x18(%r14)
movl $0x10000, 0x20(%r14)    # imm = 0x10000
movq %r14, %rdi
movl %eax, %esi
callq 0x31f0
cmpl $-0x2, %eax
jne 0x287c2
leaq 0x36cdb(%rip), %rax     # 0x5f488
cmpl $0x0, (%rax)
jg 0x287dd
orb $0x1, (%rbx)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x287d5
movq (%rsp), %rax
jmp 0x287ce
movl 0x20(%r14), %ecx
movl $0x10000, %eax          # imm = 0x10000
subq %rcx, %rax
movl $0x0, 0xc(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
callq 0x4843
jmp 0x28763
// File: /workspace/github_c_makefile_star2_O3/zhou-lab[P]tbmate/htslib/bgzf.c
// Function: worker_aux
static int worker_aux(worker_t *w)
{
    int i, stop = 0;
    // wait for condition: to process or all done
    pthread_mutex_lock(&w->mt->lock);
    while (!w->toproc && !w->mt->done)
        pthread_cond_wait(&w->mt->cv, &w->mt->lock);
    if (w->mt->done) stop = 1;
    w->toproc = 0;
    pthread_mutex_unlock(&w->mt->lock);
    if (stop) return 1; // to quit the thread
    w->errcode = 0;
    for (i = w->i; i < w->mt->curr; i += w->mt->n_threads) {
        size_t clen = BGZF_MAX_BLOCK_SIZE;
        int ret = bgzf_compress(w->buf, &clen, w->mt->blk[i], w->mt->len[i], w->compress_level);
        if (ret != 0) {
            if (hts_verbose >= 2) fprintf(stderr, "[E::%s] bgzf_compress error %d\n", __func__, ret);
            w->errcode |= BGZF_ERR_ZLIB; // Report error
            // We're not going to do any more, so set remaining lengths to 0
            for (; i < w->mt->curr; i += w->mt->n_threads) w->mt->len[i] = 0;
            break; // Give up
        } else {
            memcpy(w->mt->blk[i], w->buf, clen);
            w->mt->len[i] = clen;
        }
    }
    __sync_fetch_and_add(&w->mt->proc_cnt, 1);
    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq (%rdi), %rdi
addq $0x38, %rdi
callq 0x37a0
cmpl $0x0, 0x18(%rbx)
jne 0x29a78
movq (%rbx), %rsi
cmpl $0x0, 0xc(%rsi)
jne 0x29a78
leaq 0x60(%rsi), %rdi
addq $0x38, %rsi
callq 0x3670
jmp 0x29a5a
movq (%rbx), %rdi
movl 0xc(%rdi), %ebp
movl $0x0, 0x18(%rbx)
addq $0x38, %rdi
callq 0x3840
movl $0x1, %eax
testl %ebp, %ebp
jne 0x29b4d
movl $0x0, 0x14(%rbx)
movl 0x10(%rbx), %r12d
movq (%rbx), %rax
cmpl 0x8(%rax), %r12d
jge 0x29b47
movq 0x20(%rax), %rcx
movq %rsp, %r14
movq $0x10000, (%rsp)        # imm = 0x10000
movq 0x8(%rbx), %rdi
movq 0x18(%rax), %rax
movslq %r12d, %r13
movq (%rax,%r13,8), %rdx
movslq (%rcx,%r13,4), %rcx
movl 0x1c(%rbx), %r8d
movq %r14, %rsi
callq 0x273f6
testl %eax, %eax
jne 0x29b16
movq (%rbx), %rax
movq 0x8(%rbx), %rsi
movq 0x18(%rax), %rax
movq (%rax,%r13,8), %rdi
movq (%rsp), %r15
movq %r15, %rdx
callq 0x3850
movq (%rbx), %rax
movq 0x20(%rax), %rcx
movl %r15d, (%rcx,%r13,4)
addl (%rax), %r12d
cmpl 0x8(%rax), %r12d
jl 0x29aba
jmp 0x29b47
leaq 0x3596b(%rip), %rax     # 0x5f488
cmpl $0x2, (%rax)
jge 0x29b5c
orb $0x1, 0x14(%rbx)
movq (%rbx), %rax
cmpl 0x8(%rax), %r12d
jge 0x29b47
movq 0x20(%rax), %rcx
movslq %r12d, %r12
movl $0x0, (%rcx,%r12,4)
addl (%rax), %r12d
cmpl 0x8(%rax), %r12d
jl 0x29b33
lock
incl 0x10(%rax)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x4a77
jmp 0x29b22
nop
// File: /workspace/github_c_makefile_star2_O3/zhou-lab[P]tbmate/htslib/hfile.c
// Function: hfile_exit
static void hfile_exit()
{
    pthread_mutex_lock(&plugins_lock);

    kh_destroy(scheme_string, schemes);

    while (plugins != NULL) {
        struct hFILE_plugin_list *p = plugins;
        if (p->plugin.destroy) p->plugin.destroy();
#ifdef ENABLE_PLUGINS
        if (p->plugin.obj) close_plugin(p->plugin.obj);
#endif
        plugins = p->next;
        free(p);
    }

    pthread_mutex_unlock(&plugins_lock);
    pthread_mutex_destroy(&plugins_lock);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
leaq 0x32cd6(%rip), %rdi     # 0x5f578
callq 0x37a0
movq 0x32cc2(%rip), %rbx     # 0x5f570
testq %rbx, %rbx
je 0x2c8d6
movq 0x18(%rbx), %rdi
callq 0x3370
movq 0x10(%rbx), %rdi
callq 0x3370
movq 0x20(%rbx), %rdi
callq 0x3370
movq %rbx, %rdi
callq 0x3370
movq 0x32cc3(%rip), %rbx     # 0x5f5a0
testq %rbx, %rbx
je 0x2c908
movq 0x18(%rbx), %rax
testq %rax, %rax
je 0x2c8ed
callq *%rax
movq 0x20(%rbx), %r14
movq %r14, 0x32ca8(%rip)     # 0x5f5a0
movq %rbx, %rdi
callq 0x3370
movq %r14, %rbx
testq %r14, %r14
jne 0x2c8e2
leaq 0x32c69(%rip), %rbx     # 0x5f578
movq %rbx, %rdi
callq 0x3840
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x37f0
nop
// File: /workspace/github_c_makefile_star2_O3/zhou-lab[P]tbmate/htslib/hfile_net.c
// Function: hfile_plugin_init_net
int hfile_plugin_init_net(struct hFILE_plugin *self)
{
    static const struct hFILE_scheme_handler handler =
        { hopen_net, hfile_always_remote, "knetfile", 0 };

    self->name = "knetfile";
    hfile_add_scheme_handler("http", &handler);
    hfile_add_scheme_handler("ftp",  &handler);
    return 0;
}

// Assembly:
pushq %rbx
leaq 0x23f86(%rip), %rax     # 0x5092c
movq %rax, 0x10(%rdi)
leaq 0x2400d(%rip), %rdi     # 0x509be
leaq 0x322c0(%rip), %rbx     # 0x5ec78
movq %rbx, %rsi
callq 0x2bd31
leaq 0x23ffc(%rip), %rdi     # 0x509c3
movq %rbx, %rsi
callq 0x2bd31
xorl %eax, %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/zhou-lab[P]tbmate/htslib/sam.c
// Function: bam_plp_destroy
void bam_plp_destroy(bam_plp_t iter)
{
    lbnode_t *p, *pnext;
    if ( iter->overlaps ) kh_destroy(olap_hash, iter->overlaps);
    for (p = iter->head; p != NULL; p = pnext) {
        pnext = p->next;
        mp_free(iter->mp, p);
    }
    mp_destroy(iter->mp);
    if (iter->b) bam_destroy1(iter->b);
    free(iter->plp);
    free(iter);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movq %rdi, %rbx
movq 0x60(%rdi), %r14
testq %r14, %r14
je 0x3381b
movq 0x18(%r14), %rdi
callq 0x3370
movq 0x10(%r14), %rdi
callq 0x3370
movq 0x20(%r14), %rdi
callq 0x3370
movq %r14, %rdi
callq 0x3370
movq 0x8(%rbx), %r14
testq %r14, %r14
je 0x3388e
movl $0x100, %ebp            # imm = 0x100
movq 0x50(%r14), %r15
movq (%rbx), %r12
decl (%r12)
movq $0x0, 0x50(%r14)
movl 0x4(%r12), %ecx
cmpl 0x8(%r12), %ecx
jne 0x33872
leal (%rcx,%rcx), %eax
testl %ecx, %ecx
cmovel %ebp, %eax
movl %eax, 0x8(%r12)
movq 0x10(%r12), %rdi
movslq %eax, %rsi
shlq $0x3, %rsi
callq 0x37b0
movq %rax, 0x10(%r12)
movl 0x4(%r12), %ecx
jmp 0x33877
movq 0x10(%r12), %rax
leal 0x1(%rcx), %edx
movl %edx, 0x4(%r12)
movslq %ecx, %rcx
movq %r14, (%rax,%rcx,8)
movq %r15, %r14
testq %r15, %r15
jne 0x33829
movq (%rbx), %r14
cmpl $0x0, 0x4(%r14)
jle 0x338c5
xorl %r15d, %r15d
movq 0x10(%r14), %rax
movq (%rax,%r15,8), %rax
movq 0x28(%rax), %rdi
callq 0x3370
movq 0x10(%r14), %rax
movq (%rax,%r15,8), %rdi
callq 0x3370
incq %r15
movslq 0x4(%r14), %rax
cmpq %rax, %r15
jl 0x3389b
movq 0x10(%r14), %rdi
callq 0x3370
movq %r14, %rdi
callq 0x3370
movq 0x48(%rbx), %r14
testq %r14, %r14
je 0x338f0
movq 0x28(%r14), %rdi
callq 0x3370
movq %r14, %rdi
callq 0x3370
movq 0x40(%rbx), %rdi
callq 0x3370
movq %rbx, %rdi
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
jmp 0x3370
// File: /workspace/github_c_makefile_star2_O3/zhou-lab[P]tbmate/htslib/knetfile.c
// Function: knet_read
ssize_t knet_read(knetFile *fp, void *buf, size_t len)
{
	off_t l = 0;
	if (fp->fd == -1) return 0;
	if (fp->type == KNF_TYPE_FTP) {
		if (fp->is_ready == 0) {
			if (!fp->no_reconnect) kftp_reconnect(fp);
			kftp_connect_file(fp);
		}
	} else if (fp->type == KNF_TYPE_HTTP) {
		if (fp->is_ready == 0)
			khttp_connect_file(fp);
	}
	if (fp->type == KNF_TYPE_LOCAL) { // on Windows, the following block is necessary; not on UNIX
		size_t rest = len;
		ssize_t curr;
		while (rest) {
			do {
				curr = read(fp->fd, (void*)((char*)buf + l), rest);
			} while (curr < 0 && EINTR == errno);
			if (curr < 0) return -1;
			if (curr == 0) break;
			l += curr; rest -= curr;
		}
	} else l = my_netread(fp->fd, buf, len);
	fp->offset += l;
	return l;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdi, %rbx
movl 0x4(%rdi), %edi
cmpl $-0x1, %edi
je 0x47dc0
movq %rdx, %r14
movq %rsi, %r15
movl (%rbx), %eax
cmpl $0x3, %eax
je 0x47dc5
cmpl $0x2, %eax
jne 0x47dd5
cmpl $0x0, 0x40(%rbx)
jne 0x47e14
cmpl $0x0, 0x3c(%rbx)
jne 0x47db6
movq %rbx, %rdi
callq 0x474d6
movq %rbx, %rdi
callq 0x47640
jmp 0x47dd3
xorl %r12d, %r12d
jmp 0x47e26
cmpl $0x0, 0x40(%rbx)
jne 0x47e14
movq %rbx, %rdi
callq 0x47990
movl (%rbx), %eax
cmpl $0x1, %eax
jne 0x47e11
xorl %r12d, %r12d
testq %r14, %r14
je 0x47e22
leaq (%r15,%r12), %r13
movl 0x4(%rbx), %edi
movq %r13, %rsi
movq %r14, %rdx
callq 0x3220
testq %rax, %rax
jns 0x47e05
callq 0x35d0
cmpl $0x4, (%rax)
je 0x47de6
jmp 0x47e33
je 0x47e22
addq %rax, %r12
subq %rax, %r14
jne 0x47de2
jmp 0x47e22
movl 0x4(%rbx), %edi
movq %r15, %rsi
movq %r14, %rdx
callq 0x47bc0
movq %rax, %r12
addq %r12, 0x8(%rbx)
movq %r12, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
movq $-0x1, %r12
jmp 0x47e26
// File: /workspace/github_c_makefile_star2_O3/zhou-lab[P]tbmate/htslib/knetfile.c
// Function: knet_seek
off_t knet_seek(knetFile *fp, off_t off, int whence)
{
	if (whence == SEEK_SET && off == fp->offset) return 0;
	if (fp->type == KNF_TYPE_LOCAL) {
		/* Be aware that lseek() returns the offset after seeking, while fseek() returns zero on success. */
		off_t offset = lseek(fp->fd, off, whence);
		if (offset == -1) return -1;
		fp->offset = offset;
		return fp->offset;
	} else if (fp->type == KNF_TYPE_FTP) {
		if (whence == SEEK_CUR) fp->offset += off;
		else if (whence == SEEK_SET) fp->offset = off;
		else if (whence == SEEK_END) fp->offset = fp->file_size + off;
		else return -1;
		fp->is_ready = 0;
		return fp->offset;
	} else if (fp->type == KNF_TYPE_HTTP) {
		if (whence == SEEK_END) { // FIXME: can we allow SEEK_END in future?
			fprintf(stderr, "[knet_seek] SEEK_END is not supported for HTTP. Offset is unchanged.\n");
			errno = ESPIPE;
			return -1;
		}
		if (whence == SEEK_CUR) fp->offset += off;
		else if (whence == SEEK_SET) fp->offset = off;
		else return -1;
		fp->is_ready = 0;
		return fp->offset;
	}
	errno = EINVAL;
	fprintf(stderr,"[knet_seek] %s\n", strerror(errno));
	return -1;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
testl %edx, %edx
jne 0x47e4e
cmpq %rsi, 0x8(%rbx)
jne 0x47e4e
xorl %eax, %eax
jmp 0x47ecc
movl (%rbx), %eax
cmpl $0x3, %eax
je 0x47e73
cmpl $0x2, %eax
je 0x47e8a
cmpl $0x1, %eax
jne 0x47eb9
movl 0x4(%rbx), %edi
callq 0x3530
cmpq $-0x1, %rax
je 0x47ec5
movq %rax, 0x8(%rbx)
jmp 0x47ecc
cmpl $0x1, %edx
je 0x47e8f
cmpl $0x2, %edx
je 0x47ec0
movq $-0x1, %rax
testl %edx, %edx
jne 0x47ecc
jmp 0x47e93
cmpl $0x1, %edx
jne 0x47ea3
addq 0x8(%rbx), %rsi
movq %rsi, 0x8(%rbx)
movl $0x0, 0x40(%rbx)
movq %rsi, %rax
jmp 0x47ecc
testl %edx, %edx
je 0x47e93
movq $-0x1, %rax
cmpl $0x2, %edx
jne 0x47ecc
addq 0x68(%rbx), %rsi
jmp 0x47e93
callq 0x5447
jmp 0x47ec5
callq 0x541a
movq $-0x1, %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/zhou-lab[P]tbmate/htslib/cram/cram_codecs.c
// Function: cram_beta_decode_char
int cram_beta_decode_char(cram_slice *slice, cram_codec *c, cram_block *in, char *out, int *out_size) {
    int i, n;


    if (c->beta.nbits) {
        if (cram_not_enough_bits(in, c->beta.nbits))
            return -1;

	if (out)
	    for (i = 0, n = *out_size; i < n; i++)
		out[i] = get_bits_MSB(in, c->beta.nbits) - c->beta.offset;
	else
	    for (i = 0, n = *out_size; i < n; i++)
		get_bits_MSB(in, c->beta.nbits);
    } else {
	if (out)
	    for (i = 0, n = *out_size; i < n; i++)
		out[i] = -c->beta.offset;
    }

    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %r15
movq %rsi, %r14
movl 0x34(%rsi), %eax
testq %rax, %rax
je 0x48b51
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
testl %eax, %eax
js 0x48b79
movq %rdx, %r12
movslq 0x14(%rdx), %rcx
subq 0x30(%rdx), %rcx
jbe 0x48b79
cmpq $0x10000000, %rcx       # imm = 0x10000000
ja 0x48b22
movslq 0x38(%r12), %rdx
leaq (%rdx,%rcx,8), %rcx
addq $-0x7, %rcx
cmpq %rax, %rcx
jb 0x48b79
movl (%r8), %r13d
xorl %ebx, %ebx
testq %r15, %r15
je 0x48b8a
testl %r13d, %r13d
jle 0x48b79
xorl %ebp, %ebp
movl 0x34(%r14), %esi
movq %r12, %rdi
callq 0x4886c
subl 0x30(%r14), %eax
movb %al, (%r15,%rbp)
incq %rbp
cmpq %rbp, %r13
jne 0x48b33
jmp 0x48b79
xorl %ebx, %ebx
testq %r15, %r15
je 0x48b79
movslq (%r8), %rax
testq %rax, %rax
jle 0x48b79
xorl %ebx, %ebx
xorl %ecx, %ecx
movb 0x30(%r14), %dl
xorl %esi, %esi
subb %dl, %sil
movb %sil, (%r15,%rcx)
incq %rcx
cmpq %rcx, %rax
jne 0x48b64
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
testl %r13d, %r13d
jle 0x48b79
movl 0x34(%r14), %esi
movq %r12, %rdi
callq 0x4886c
decl %r13d
jne 0x48b8f
jmp 0x48b79
// File: /workspace/github_c_makefile_star2_O3/zhou-lab[P]tbmate/htslib/cram/cram_codecs.c
// Function: cram_decoder_init
cram_codec *cram_decoder_init(enum cram_encoding codec,
			      char *data, int size,
			      enum cram_external_type option,
			      int version) {
    if (codec >= E_NULL && codec < E_NUM_CODECS && decode_init[codec]) {
	return decode_init[codec](data, size, option, version);
    } else {
	fprintf(stderr, "Unimplemented codec of type %s\n", cram_encoding2str(codec));
	return NULL;
    }
}

// Assembly:
cmpl $0x9, %edi
ja 0x4b134
movl $0x105, %eax            # imm = 0x105
btq %rdi, %rax
jb 0x4b134
movl %edi, %eax
leaq 0x13b7a(%rip), %r9      # 0x5eca0
movq %rsi, %rdi
movl %edx, %esi
movl %ecx, %edx
movl %r8d, %ecx
jmpq *(%r9,%rax,8)
pushq %rax
callq 0x55b8
xorl %eax, %eax
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O3/zhou-lab[P]tbmate/htslib/cram/cram_codecs.c
// Function: cram_encoder_init
cram_codec *cram_encoder_init(enum cram_encoding codec,
			      cram_stats *st,
			      enum cram_external_type option,
			      void *dat,
			      int version) {
    if (st && !st->nvals)
	return NULL;

    if (encode_init[codec]) {
	cram_codec *r;
	if ((r = encode_init[codec](st, option, dat, version)))
	    r->out = NULL;
	return r;
    } else {
	fprintf(stderr, "Unimplemented codec of type %s\n", cram_encoding2str(codec));
	abort();
    }
}

// Assembly:
pushq %rax
testq %rsi, %rsi
je 0x4b50f
cmpl $0x0, 0x100c(%rsi)
je 0x4b541
movl $0x385, %eax            # imm = 0x385
btq %rdi, %rax
jb 0x4b545
movl %edi, %eax
leaq 0x137cd(%rip), %r9      # 0x5ecf0
movq %rsi, %rdi
movl %edx, %esi
movq %rcx, %rdx
movl %r8d, %ecx
callq *(%r9,%rax,8)
testq %rax, %rax
je 0x4b541
movq $0x0, 0x8(%rax)
jmp 0x4b543
xorl %eax, %eax
popq %rcx
retq
callq 0x55ed
// File: /workspace/github_c_makefile_star2_O3/zhou-lab[P]tbmate/htslib/cram/cram_codecs.c
// Function: cram_byte_array_stop_decode_char
static int cram_byte_array_stop_decode_char(cram_slice *slice, cram_codec *c,
					    cram_block *in, char *out,
					    int *out_size) {
    cram_block *b = NULL;
    char *cp, ch;

    b = cram_get_block_by_id(slice, c->byte_array_stop.content_id);
    if (!b)
        return *out_size?-1:0;

    if (b->idx >= b->uncomp_size)
	return -1;

    cp = (char *)b->data + b->idx;
    if (out) {
	while ((ch = *cp) != (char)c->byte_array_stop.stop) {
	    if (cp - (char *)b->data >= b->uncomp_size)
		return -1;
	    *out++ = ch;
	    cp++;
	}
    } else {
	// Consume input, but produce no output
	while ((ch = *cp) != (char)c->byte_array_stop.stop) {
	    if (cp - (char *)b->data >= b->uncomp_size)
		return -1;
	    cp++;
	}
    }

    *out_size = cp - (char *)(b->data + b->idx);
    b->idx = cp - (char *)b->data + 1;

    return 0;
}

// Assembly:
pushq %rbx
movl 0x34(%rsi), %eax
cmpq $0x400, %rax            # imm = 0x400
setb %r9b
movq 0x18(%rdi), %rdx
testq %rdx, %rdx
setne %r10b
testb %r10b, %r9b
je 0x4b986
movq (%rdx,%rax,8), %rdx
testq %rdx, %rdx
je 0x4b9b9
movslq 0x1c(%rdx), %r10
movslq 0x14(%rdx), %r11
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpl %r11d, %r10d
jge 0x4b9c0
movq 0x20(%rdx), %rdi
leaq (%rdi,%r10), %r9
testq %rcx, %rcx
je 0x4b9c2
movb (%r9), %r11b
cmpb 0x30(%rsi), %r11b
je 0x4b9e2
addq %r10, %rdi
movq %rdi, %r10
subq 0x20(%rdx), %r10
movslq 0x14(%rdx), %rbx
cmpq %rbx, %r10
jge 0x4b9c0
movb %r11b, (%rcx)
incq %rcx
movb 0x1(%r9), %r11b
incq %r9
incq %rdi
cmpb 0x30(%rsi), %r11b
jne 0x4b956
movq 0x20(%rdx), %rdi
movslq 0x1c(%rdx), %r10
jmp 0x4b9e2
movq (%rdi), %rdx
movslq 0x20(%rdx), %r9
testq %r9, %r9
jle 0x4b9b9
movq 0x10(%rdi), %rdi
xorl %r10d, %r10d
movq (%rdi,%r10,8), %rdx
testq %rdx, %rdx
je 0x4b9b1
cmpl $0x4, 0x8(%rdx)
jne 0x4b9b1
cmpl %eax, 0xc(%rdx)
je 0x4b923
incq %r10
cmpq %r10, %r9
jne 0x4b999
xorl %eax, %eax
cmpl (%r8), %eax
sbbl %eax, %eax
popq %rbx
retq
movb 0x30(%rsi), %cl
cmpb %cl, (%r9)
je 0x4b9e2
movq %r10, %rsi
cmpq %r11, %rsi
jge 0x4b9c0
leaq 0x1(%rsi), %r9
cmpb %cl, 0x1(%rdi,%rsi)
movq %r9, %rsi
jne 0x4b9cd
addq %rdi, %r9
addl %edi, %r10d
movl %r9d, %eax
subl %r10d, %eax
movl %eax, (%r8)
subl %edi, %r9d
incl %r9d
movl %r9d, 0x1c(%rdx)
xorl %eax, %eax
jmp 0x4b9c0
// File: /workspace/github_c_makefile_star2_O3/baskerville[P]bspwm/src/bspwm.c
// Function: sig_handler
void sig_handler(int sig)
{
	if (sig == SIGCHLD) {
		signal(sig, sig_handler);
		while (waitpid(-1, 0, WNOHANG) > 0)
			;
	} else if (sig == SIGINT || sig == SIGHUP || sig == SIGTERM) {
		running = false;
	}
}

// Assembly:
leal -0x1(%rdi), %eax
cmpl $0x2, %eax
jb 0x5a8c
cmpl $0xf, %edi
je 0x5a8c
cmpl $0x11, %edi
jne 0x5a93
pushq %rax
leaq -0x1a(%rip), %rsi       # 0x5a4e
movl $0x11, %edi
callq 0x4070
movl $0xffffffff, %edi       # imm = 0xFFFFFFFF
xorl %esi, %esi
movl $0x1, %edx
callq 0x4750
testl %eax, %eax
jg 0x5a72
addq $0x8, %rsp
retq
movb $0x0, 0x23c3d(%rip)     # 0x296d0
retq
// File: /workspace/github_c_makefile_star2_O3/baskerville[P]bspwm/src/bspwm.c
// Function: cleanup
void cleanup(void)
{
	mon = NULL;

	while (mon_head != NULL) {
		remove_monitor(mon_head);
	}
	while (rule_head != NULL) {
		remove_rule(rule_head);
	}
	while (subscribe_head != NULL) {
		remove_subscriber(subscribe_head);
	}
	while (pending_rule_head != NULL) {
		remove_pending_rule(pending_rule_head);
	}

	empty_history();
}

// Assembly:
pushq %rax
movq $0x0, 0x23c70(%rip) # 0x29710
movq 0x23c61(%rip), %rdi     # 0x29708
testq %rdi, %rdi
je 0x5ab8
callq 0x72d2
jmp 0x5aa0
callq 0x1cb04
movq 0x23c79(%rip), %rdi     # 0x29738
testq %rdi, %rdi
jne 0x5ab3
jmp 0x5acb
callq 0x1e374
movq 0x23c86(%rip), %rdi     # 0x29758
testq %rdi, %rdi
jne 0x5ac6
jmp 0x5ade
callq 0x1cd1a
movq 0x23bf3(%rip), %rdi     # 0x296d8
testq %rdi, %rdi
jne 0x5ad9
popq %rax
jmp 0xd809
// File: /workspace/github_c_makefile_star2_O3/baskerville[P]bspwm/src/bspwm.c
// Function: init
void init(void)
{
	clients_count = 0;
	mon = mon_head = mon_tail = pri_mon = NULL;
	history_head = history_tail = history_needle = NULL;
	rule_head = rule_tail = NULL;
	stack_head = stack_tail = NULL;
	subscribe_head = subscribe_tail = NULL;
	pending_rule_head = pending_rule_tail = NULL;
	auto_raise = sticky_still = hide_sticky = record_history = true;
	randr_base = 0;
	exit_status = 0;
	restart = false;
}

// Assembly:
xorl %eax, %eax
movl %eax, 0x23bfc(%rip)     # 0x296f4
movq %rax, 0x23bf9(%rip)     # 0x296f8
movq %rax, 0x23bfa(%rip)     # 0x29700
movq %rax, 0x23bfb(%rip)     # 0x29708
movq %rax, 0x23bfc(%rip)     # 0x29710
movq %rax, 0x23bfd(%rip)     # 0x29718
movq %rax, 0x23bfe(%rip)     # 0x29720
movq %rax, 0x23bff(%rip)     # 0x29728
movq %rax, 0x23c00(%rip)     # 0x29730
movq %rax, 0x23c01(%rip)     # 0x29738
movq %rax, 0x23c02(%rip)     # 0x29740
movq %rax, 0x23c03(%rip)     # 0x29748
movq %rax, 0x23c04(%rip)     # 0x29750
movq %rax, 0x23c05(%rip)     # 0x29758
movq %rax, 0x23c06(%rip)     # 0x29760
movq %rax, 0x23b77(%rip)     # 0x296d8
movb $0x1, %cl
movb %cl, 0x23bff(%rip)      # 0x29768
movb %cl, 0x23bfa(%rip)      # 0x29769
movb %cl, 0x23bf5(%rip)      # 0x2976a
movb %cl, 0x23bf0(%rip)      # 0x2976b
leaq 0x2428e(%rip), %rcx     # 0x29e10
movb %al, (%rcx)
movl %eax, 0x23b66(%rip)     # 0x296f0
movb %al, 0x23b50(%rip)      # 0x296e0
retq
// File: /workspace/github_c_makefile_star2_O3/baskerville[P]bspwm/src/bspwm.c
// Function: register_events
void register_events(void)
{
	uint32_t values[] = {ROOT_EVENT_MASK};
	xcb_generic_error_t *e = xcb_request_check(dpy, xcb_change_window_attributes_checked(dpy, root, XCB_CW_EVENT_MASK, values));
	if (e != NULL) {
		free(e);
		xcb_ewmh_connection_wipe(ewmh);
		free(ewmh);
		xcb_disconnect(dpy);
		err("Another window manager is already running.\n");
	}
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
leaq 0x4(%rsp), %rcx
movl $0x3a0004, (%rcx)       # imm = 0x3A0004
movq 0x23b21(%rip), %rbx     # 0x296c8
movl 0x23bcb(%rip), %esi     # 0x29778
movq %rbx, %rdi
movl $0x800, %edx            # imm = 0x800
callq 0x4640
movq %rbx, %rdi
movl %eax, %esi
callq 0x4900
testq %rax, %rax
je 0x5c0f
movq %rax, %rdi
callq 0x4460
leaq 0x24258(%rip), %rbx     # 0x29e30
movq (%rbx), %r14
movq 0x8(%r14), %rdi
callq 0x4460
movq 0x18(%r14), %rdi
callq 0x4460
movq (%rbx), %rdi
callq 0x4460
movq 0x23acc(%rip), %rdi     # 0x296c8
callq 0x4980
leaq 0x195c0(%rip), %rdi     # 0x1f1c8
xorl %eax, %eax
callq 0x5c6c
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/baskerville[P]bspwm/src/geometry.c
// Function: boundary_distance
uint32_t boundary_distance(xcb_rectangle_t r1, xcb_rectangle_t r2, direction_t dir)
{
	xcb_point_t r1_max = {r1.x + r1.width - 1, r1.y + r1.height - 1};
	xcb_point_t r2_max = {r2.x + r2.width - 1, r2.y + r2.height - 1};
	switch (dir) {
		case DIR_NORTH:
			return r2_max.y > r1.y ? r2_max.y - r1.y : r1.y - r2_max.y;
			break;
		case DIR_WEST:
			return r2_max.x > r1.x ? r2_max.x - r1.x : r1.x - r2_max.x;
			break;
		case DIR_SOUTH:
			return r2.y < r1_max.y ? r1_max.y - r2.y : r2.y - r1_max.y;
			break;
		case DIR_EAST:
			return r2.x < r1_max.x ? r1_max.x - r2.x : r2.x - r1_max.x;
			break;
		default:
			return UINT32_MAX;
	}
}

// Assembly:
cmpl $0x3, %edx
ja 0x61e0
movl %edi, %eax
sarl $0x10, %eax
movl %esi, %ecx
sarl $0x10, %ecx
movl %edx, %edx
leaq 0x1921f(%rip), %r8      # 0x1f3a8
movslq (%r8,%rdx,4), %rdx
addq %r8, %rdx
jmpq *%rdx
shrq $0x30, %rsi
addl %esi, %ecx
decl %ecx
movswl %cx, %ecx
subl %eax, %ecx
jmp 0x61d8
shrq $0x30, %rdi
addl %edi, %eax
decl %eax
cwtl
subl %eax, %ecx
movl %ecx, %eax
negl %eax
cmovsl %ecx, %eax
retq
movswl %si, %ecx
movq %rdi, %rax
shrq $0x20, %rax
addl %edi, %eax
decl %eax
cwtl
jmp 0x61d6
movswl %di, %eax
movq %rsi, %rcx
shrq $0x20, %rcx
addl %esi, %ecx
decl %ecx
movswl %cx, %ecx
subl %eax, %ecx
movl %ecx, %eax
negl %eax
cmovsl %ecx, %eax
retq
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
retq
// File: /workspace/github_c_makefile_star2_O3/baskerville[P]bspwm/src/geometry.c
// Function: rect_cmp
int rect_cmp(xcb_rectangle_t r1, xcb_rectangle_t r2)
{
	if (r1.y >= (r2.y + r2.height)) {
		return 1;
	} else if (r2.y >= (r1.y + r1.height)) {
		return -1;
	} else {
		if (r1.x >= (r2.x + r2.width)) {
			return 1;
		} else if (r2.x >= (r1.x + r1.width)) {
			return -1;
		} else {
			return area(r2) - area(r1);
		}
	}
}

// Assembly:
movq %rsi, %rcx
shrq $0x30, %rcx
movl %edi, %r8d
sarl $0x10, %r8d
movl %esi, %r9d
sarl $0x10, %r9d
leal (%r9,%rcx), %edx
movl $0x1, %eax
cmpl %r8d, %edx
jle 0x6381
movq %rdi, %rdx
shrq $0x30, %rdx
addl %edx, %r8d
cmpl %r9d, %r8d
jle 0x6382
movq %rsi, %r10
shrq $0x20, %r10
movswl %di, %r8d
movswl %si, %r9d
movzwl %r10w, %esi
leal (%rsi,%r9), %r10d
cmpl %r8d, %r10d
jle 0x6381
shrq $0x20, %rdi
movzwl %di, %edi
addl %edi, %r8d
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpl %r9d, %r8d
jle 0x6381
imull %ecx, %esi
imull %edx, %edi
subl %edi, %esi
movl %esi, %eax
retq
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
retq
// File: /workspace/github_c_makefile_star2_O3/baskerville[P]bspwm/src/settings.c
// Function: run_config
void run_config(int run_level)
{
	if (fork() == 0) {
		if (dpy != NULL) {
			close(xcb_get_file_descriptor(dpy));
		}
		setsid();
		char arg1[2];
		snprintf(arg1, 2, "%i", run_level);
		execl(config_path, config_path, arg1, (char *) NULL);
		err("Couldn't execute the configuration file.\n");
	}
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %edi, %ebx
callq 0x49b0
testl %eax, %eax
jne 0x693c
leaq 0x22de6(%rip), %rax     # 0x296c8
movq (%rax), %rdi
testq %rdi, %rdi
je 0x68f6
callq 0x4380
movl %eax, %edi
callq 0x4150
callq 0x4120
leaq 0x1a81d(%rip), %rdx     # 0x2111f
leaq 0x6(%rsp), %r14
movl $0x2, %esi
movq %r14, %rdi
movl %ebx, %ecx
xorl %eax, %eax
callq 0x4110
leaq 0x22ca1(%rip), %rdi     # 0x295c0
movq %rdi, %rsi
movq %r14, %rdx
xorl %ecx, %ecx
xorl %eax, %eax
callq 0x4230
leaq 0x18ac3(%rip), %rdi     # 0x1f3f8
xorl %eax, %eax
callq 0x5c6c
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/baskerville[P]bspwm/src/monitor.c
// Function: make_monitor
monitor_t *make_monitor(const char *name, xcb_rectangle_t *rect, uint32_t id)
{
	monitor_t *m = calloc(1, sizeof(monitor_t));
	if (id == XCB_NONE) {
		m->id = xcb_generate_id(dpy);
	}
	m->randr_id = XCB_NONE;
	snprintf(m->name, sizeof(m->name), "%s", name == NULL ? DEFAULT_MON_NAME : name);
	m->padding = padding;
	m->border_width = border_width;
	m->window_gap = window_gap;
	m->root = XCB_NONE;
	m->prev = m->next = NULL;
	m->desk = m->desk_head = m->desk_tail = NULL;
	m->wired = true;
	m->sticky_count = 0;
	if (rect != NULL) {
		update_root(m, rect);
	} else {
		m->rectangle = (xcb_rectangle_t) {0, 0, screen_width, screen_height};
	}
	return m;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ebp
movq %rsi, %r14
movq %rdi, %r15
movl $0x1, %edi
movl $0x80, %esi
callq 0x48b0
movq %rax, %rbx
testl %ebp, %ebp
jne 0x6ac3
leaq 0x22c10(%rip), %rax     # 0x296c8
movq (%rax), %rdi
callq 0x4920
movl %eax, 0x20(%rbx)
testq %r15, %r15
leaq 0x18973(%rip), %rcx     # 0x1f440
cmovneq %r15, %rcx
leaq 0x1856f(%rip), %rdx     # 0x1f047
xorl %ebp, %ebp
movl $0x20, %esi
movq %rbx, %rdi
xorl %eax, %eax
callq 0x4110
leaq 0x232b0(%rip), %rax     # 0x29da0
movups (%rax), %xmm0
movups %xmm0, 0x30(%rbx)
leaq 0x232c6(%rip), %rax     # 0x29dc4
movl (%rax), %eax
movl %eax, 0x48(%rbx)
leaq 0x232b6(%rip), %rax     # 0x29dc0
movl (%rax), %eax
movl %eax, 0x44(%rbx)
movl %ebp, 0x28(%rbx)
xorps %xmm0, %xmm0
movups %xmm0, 0x68(%rbx)
movups %xmm0, 0x58(%rbx)
movq $0x0, 0x78(%rbx)
movb $0x1, 0x2c(%rbx)
movl %ebp, 0x40(%rbx)
testq %r14, %r14
je 0x6b3e
movq %rbx, %rdi
movq %r14, %rsi
callq 0x6b6f
jmp 0x6b61
leaq 0x22c37(%rip), %rax     # 0x2977c
movzwl (%rax), %eax
leaq 0x22c31(%rip), %rcx     # 0x29780
movzwl (%rcx), %ecx
movl $0x0, 0x4c(%rbx)
movw %ax, 0x50(%rbx)
movw %cx, 0x52(%rbx)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/baskerville[P]bspwm/src/monitor.c
// Function: reorder_monitor
void reorder_monitor(monitor_t *m)
{
	if (m == NULL) {
		return;
	}
	monitor_t *prev = m->prev;
	while (prev != NULL && rect_cmp(m->rectangle, prev->rectangle) < 0) {
		swap_monitors(m, prev);
		prev = m->prev;
	}
	monitor_t *next = m->next;
	while (next != NULL && rect_cmp(m->rectangle, next->rectangle) > 0) {
		swap_monitors(m, next);
		next = m->next;
	}
}

// Assembly:
testq %rdi, %rdi
je 0x6f29
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x70(%rbx), %r14
testq %r14, %r14
je 0x6f19
movq 0x4c(%rbx), %rdi
movq 0x4c(%r14), %rsi
callq 0x6315
testl %eax, %eax
jns 0x6f19
movq %rbx, %rdi
movq %r14, %rsi
callq 0x6f2a
jmp 0x6ed6
movq 0x4c(%rbx), %rdi
movq 0x4c(%r14), %rsi
callq 0x6315
testl %eax, %eax
jle 0x6f22
movq %rbx, %rdi
movq %r14, %rsi
callq 0x6f2a
movq 0x78(%rbx), %r14
testq %r14, %r14
jne 0x6efd
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/baskerville[P]bspwm/src/monitor.c
// Function: swap_monitors
bool swap_monitors(monitor_t *m1, monitor_t *m2)
{
	if (m1 == NULL || m2 == NULL || m1 == m2) {
		return false;
	}

	put_status(SBSC_MASK_MONITOR_SWAP, "monitor_swap 0x%08X 0x%08X\n", m1->id, m2->id);

	if (mon_head == m1) {
		mon_head = m2;
	} else if (mon_head == m2) {
		mon_head = m1;
	}
	if (mon_tail == m1) {
		mon_tail = m2;
	} else if (mon_tail == m2) {
		mon_tail = m1;
	}

	monitor_t *p1 = m1->prev;
	monitor_t *n1 = m1->next;
	monitor_t *p2 = m2->prev;
	monitor_t *n2 = m2->next;

	if (p1 != NULL && p1 != m2) {
		p1->next = m2;
	}
	if (n1 != NULL && n1 != m2) {
		n1->prev = m2;
	}
	if (p2 != NULL && p2 != m1) {
		p2->next = m1;
	}
	if (n2 != NULL && n2 != m1) {
		n2->prev = m1;
	}

	m1->prev = p2 == m1 ? m2 : p2;
	m1->next = n2 == m1 ? m2 : n2;
	m2->prev = p1 == m2 ? m1 : p1;
	m2->next = n1 == m2 ? m1 : n1;

	ewmh_update_wm_desktops();
	ewmh_update_desktop_names();
	ewmh_update_desktop_viewport();
	ewmh_update_current_desktop();

	put_status(SBSC_MASK_REPORT);
	return true;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
testq %rdi, %rdi
setne %al
testq %rsi, %rsi
setne %cl
andb %al, %cl
cmpq %rsi, %rdi
setne %bl
andb %cl, %bl
cmpb $0x1, %bl
jne 0x705f
movq %rsi, %r14
movq %rdi, %r15
movl 0x20(%rdi), %edx
movl 0x20(%rsi), %ecx
leaq 0x18563(%rip), %rsi     # 0x1f4c4
movl $0x10, %edi
xorl %eax, %eax
callq 0x1e6b8
leaq 0x22794(%rip), %rax     # 0x29708
movq (%rax), %rdx
movq %r14, %rcx
cmpq %r15, %rdx
je 0x6f87
movq %r15, %rcx
cmpq %r14, %rdx
jne 0x6f8a
movq %rcx, (%rax)
leaq 0x2276f(%rip), %rax     # 0x29700
movq (%rax), %rdx
movq %r14, %rcx
cmpq %r15, %rdx
je 0x6fa4
movq %r15, %rcx
cmpq %r14, %rdx
jne 0x6fa7
movq %rcx, (%rax)
movq 0x70(%r15), %rcx
movq 0x78(%r15), %rax
movq 0x70(%r14), %rdx
movq 0x78(%r14), %rsi
testq %rcx, %rcx
sete %dil
cmpq %r14, %rcx
sete %r8b
orb %dil, %r8b
jne 0x6fce
movq %r14, 0x78(%rcx)
testq %rax, %rax
sete %dil
cmpq %r14, %rax
sete %r8b
orb %dil, %r8b
jne 0x6fe5
movq %r14, 0x70(%rax)
testq %rdx, %rdx
sete %dil
cmpq %r15, %rdx
sete %r8b
orb %dil, %r8b
jne 0x6ffc
movq %r15, 0x78(%rdx)
testq %rsi, %rsi
sete %dil
cmpq %r15, %rsi
sete %r8b
orb %dil, %r8b
jne 0x7013
movq %r15, 0x70(%rsi)
cmpq %r15, %rdx
cmoveq %r14, %rdx
cmpq %r15, %rsi
cmoveq %r14, %rsi
cmpq %r14, %rcx
cmoveq %r15, %rcx
cmpq %r14, %rax
movq %rdx, 0x70(%r15)
movq %rsi, 0x78(%r15)
movq %rcx, 0x70(%r14)
cmoveq %r15, %rax
movq %rax, 0x78(%r14)
callq 0x1dc3b
callq 0x1dcd6
callq 0x1dd9c
callq 0x1db67
movl $0x1, %edi
xorl %eax, %eax
callq 0x1e6b8
movl %ebx, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/baskerville[P]bspwm/src/monitor.c
// Function: rename_monitor
void rename_monitor(monitor_t *m, const char *name)
{
	put_status(SBSC_MASK_MONITOR_RENAME, "monitor_rename 0x%08X %s %s\n", m->id, m->name, name);

	snprintf(m->name, sizeof(m->name), "%s", name);
	xcb_icccm_set_wm_name(dpy, m->root, XCB_ATOM_STRING, 8, strlen(m->name), m->name);

	put_status(SBSC_MASK_REPORT);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rsi, %r14
movq %rdi, %rbx
movl 0x20(%rdi), %edx
leaq 0x183f2(%rip), %rsi     # 0x1f46d
movl $0x4, %edi
movq %rbx, %rcx
movq %r14, %r8
xorl %eax, %eax
callq 0x1e6b8
leaq 0x17fb3(%rip), %rdx     # 0x1f047
movl $0x20, %esi
movq %rbx, %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x4110
leaq 0x2261b(%rip), %rax     # 0x296c8
movq (%rax), %r14
movl 0x28(%rbx), %ebp
movq %rbx, %rdi
callq 0x4470
movq %r14, %rdi
movl %ebp, %esi
movl $0x1f, %edx
movl $0x8, %ecx
movl %eax, %r8d
movq %rbx, %r9
callq 0x4180
movl $0x1, %edi
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
jmp 0x1e6b8
// File: /workspace/github_c_makefile_star2_O3/baskerville[P]bspwm/src/monitor.c
// Function: embrace_client
void embrace_client(monitor_t *m, client_t *c)
{
	if ((c->floating_rectangle.x + c->floating_rectangle.width) <= m->rectangle.x) {
		c->floating_rectangle.x = m->rectangle.x;
	} else if (c->floating_rectangle.x >= (m->rectangle.x + m->rectangle.width)) {
		c->floating_rectangle.x = (m->rectangle.x + m->rectangle.width) - c->floating_rectangle.width;
	}
	if ((c->floating_rectangle.y + c->floating_rectangle.height) <= m->rectangle.y) {
		c->floating_rectangle.y = m->rectangle.y;
	} else if (c->floating_rectangle.y >= (m->rectangle.y + m->rectangle.height)) {
		c->floating_rectangle.y = (m->rectangle.y + m->rectangle.height) - c->floating_rectangle.height;
	}
}

// Assembly:
movswl 0x318(%rsi), %edx
movzwl 0x31c(%rsi), %eax
leal (%rax,%rdx), %r9d
movzwl 0x4c(%rdi), %ecx
movswl %cx, %r8d
cmpl %r8d, %r9d
jle 0x714b
movzwl 0x50(%rdi), %ecx
addl %r8d, %ecx
cmpl %edx, %ecx
jg 0x7152
subl %eax, %ecx
movw %cx, 0x318(%rsi)
movswl 0x31a(%rsi), %edx
movzwl 0x31e(%rsi), %eax
leal (%rax,%rdx), %r9d
movzwl 0x4e(%rdi), %ecx
movswl %cx, %r8d
cmpl %r8d, %r9d
jle 0x717e
movzwl 0x52(%rdi), %ecx
addl %r8d, %ecx
cmpl %edx, %ecx
jg 0x7185
subl %eax, %ecx
movw %cx, 0x31a(%rsi)
retq
// File: /workspace/github_c_makefile_star2_O3/baskerville[P]bspwm/src/monitor.c
// Function: add_monitor
void add_monitor(monitor_t *m)
{
	xcb_rectangle_t r = m->rectangle;

	if (mon == NULL) {
		mon = m;
		mon_head = m;
		mon_tail = m;
	} else {
		monitor_t *a = mon_head;
		while (a != NULL && rect_cmp(m->rectangle, a->rectangle) > 0) {
			a = a->next;
		}
		if (a != NULL) {
			monitor_t *b = a->prev;
			if (b != NULL) {
				b->next = m;
			} else {
				mon_head = m;
			}
			m->prev = b;
			m->next = a;
			a->prev = m;
		} else {
			mon_tail->next = m;
			m->prev = mon_tail;
			mon_tail = m;
		}
	}

	put_status(SBSC_MASK_MONITOR_ADD, "monitor_add 0x%08X %s %ux%u+%i+%i\n", m->id, m->name, r.width, r.height, r.x, r.y);

	put_status(SBSC_MASK_REPORT);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movswl 0x4c(%rdi), %r12d
movswl 0x4e(%rdi), %r11d
movzwl 0x50(%rdi), %ebp
movzwl 0x52(%rdi), %r14d
leaq 0x22562(%rip), %rax     # 0x29710
cmpq $0x0, (%rax)
je 0x71f7
movq %r11, (%rsp)
leaq 0x22549(%rip), %r15     # 0x29708
movq (%r15), %r13
testq %r13, %r13
je 0x71de
movq 0x4c(%rbx), %rdi
movq 0x4c(%r13), %rsi
callq 0x6315
testl %eax, %eax
jle 0x720d
movq 0x78(%r13), %r13
jmp 0x71c2
leaq 0x2251b(%rip), %r13     # 0x29700
movq (%r13), %rax
movq %rbx, 0x78(%rax)
movq %rax, 0x70(%rbx)
movq (%rsp), %r11
jmp 0x722d
movq %rbx, (%rax)
leaq 0x22507(%rip), %rax     # 0x29708
movq %rbx, (%rax)
leaq 0x224f5(%rip), %r13     # 0x29700
jmp 0x722d
movq 0x70(%r13), %rax
testq %rax, %rax
je 0x721a
leaq 0x78(%rax), %r15
movq (%rsp), %r11
movq %rbx, (%r15)
movq %rax, 0x70(%rbx)
movq %r13, 0x78(%rbx)
addq $0x70, %r13
movq %rbx, (%r13)
movl 0x20(%rbx), %edx
leaq 0x1824f(%rip), %rsi     # 0x1f48a
movl $0x2, %edi
movq %rbx, %rcx
movl %ebp, %r8d
movl %r14d, %r9d
xorl %eax, %eax
pushq %r11
pushq %r12
callq 0x1e6b8
addq $0x10, %rsp
movl $0x1, %edi
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x1e6b8
// File: /workspace/github_c_makefile_star2_O3/baskerville[P]bspwm/src/monitor.c
// Function: remove_monitor
void remove_monitor(monitor_t *m)
{
	put_status(SBSC_MASK_MONITOR_REMOVE, "monitor_remove 0x%08X\n", m->id);

	while (m->desk_head != NULL) {
		remove_desktop(m, m->desk_head);
	}

	monitor_t *last_mon = mon;

	unlink_monitor(m);
	xcb_destroy_window(dpy, m->root);
	free(m);

	if (mon != last_mon) {
		focus_node(NULL, NULL, NULL);
	}

	put_status(SBSC_MASK_REPORT);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movl 0x20(%rdi), %edx
leaq 0x181c9(%rip), %rsi     # 0x1f4ad
movl $0x8, %edi
xorl %eax, %eax
callq 0x1e6b8
movq 0x60(%rbx), %rsi
testq %rsi, %rsi
je 0x7303
movq %rbx, %rdi
callq 0x82cc
jmp 0x72f0
leaq 0x22406(%rip), %r14     # 0x29710
movq (%r14), %r15
movq %rbx, %rdi
callq 0x7272
leaq 0x223ac(%rip), %rax     # 0x296c8
movq (%rax), %rdi
movl 0x28(%rbx), %esi
callq 0x4130
movq %rbx, %rdi
callq 0x4460
cmpq %r15, (%r14)
je 0x733f
xorl %edi, %edi
xorl %esi, %esi
xorl %edx, %edx
callq 0xa308
movl $0x1, %edi
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
jmp 0x1e6b8
// File: /workspace/github_c_makefile_star2_O3/baskerville[P]bspwm/src/monitor.c
// Function: merge_monitors
void merge_monitors(monitor_t *ms, monitor_t *md)
{
	if (ms == NULL || md == NULL || ms == md) {
		return;
	}

	desktop_t *d = ms->desk_head;
	while (d != NULL) {
		desktop_t *next = d->next;
		transfer_desktop(ms, md, d, false);
		d = next;
	}
}

// Assembly:
cmpq %rsi, %rdi
je 0x7391
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %r14
testq %rdi, %rdi
je 0x738c
movq %rsi, %rbx
testq %rsi, %rsi
je 0x738c
movq 0x60(%r14), %rdx
testq %rdx, %rdx
je 0x738c
movq 0x48(%rdx), %r15
movq %r14, %rdi
movq %rbx, %rsi
xorl %ecx, %ecx
callq 0x7e58
movq %r15, %rdx
testq %r15, %r15
jne 0x7373
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/baskerville[P]bspwm/src/monitor.c
// Function: closest_monitor
monitor_t *closest_monitor(monitor_t *m, cycle_dir_t dir, monitor_select_t *sel)
{
	monitor_t *f = (dir == CYCLE_PREV ? m->prev : m->next);

	if (f == NULL) {
		f = (dir == CYCLE_PREV ? mon_tail : mon_head);
	}

	while (f != m) {
		coordinates_t loc = {f, NULL, NULL};
		if (monitor_matches(&loc, &loc, sel)) {
			return f;
		}
		f = (dir == CYCLE_PREV ? f->prev : f->next);
		if (f == NULL) {
			f = (dir == CYCLE_PREV ? mon_tail : mon_head);
		}
	}

	return NULL;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdx, %rbx
movl %esi, %ebp
movq %rdi, %r15
xorl %eax, %eax
cmpl $0x1, %esi
setne %al
movq 0x70(%rdi,%rax,8), %r14
jne 0x73c0
leaq 0x22342(%rip), %rcx     # 0x29700
jmp 0x73c7
leaq 0x22341(%rip), %rcx     # 0x29708
testq %r14, %r14
jne 0x73cf
movq (%rcx), %r14
cmpq %r15, %r14
je 0x7424
leaq 0x70(,%rax,8), %r13
movq %rsp, %r12
movq %r14, (%rsp)
leaq 0x8(%rsp), %rax
xorps %xmm0, %xmm0
movups %xmm0, (%rax)
movq %r12, %rdi
movq %r12, %rsi
movq %rbx, %rdx
callq 0x18f6e
testb %al, %al
jne 0x7427
leaq 0x22301(%rip), %rax     # 0x29708
cmpl $0x1, %ebp
jne 0x7413
leaq 0x222ed(%rip), %rax     # 0x29700
movq (%r14,%r13), %r14
testq %r14, %r14
jne 0x741f
movq (%rax), %r14
cmpq %r15, %r14
jne 0x73df
xorl %r14d, %r14d
movq %r14, %rax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/baskerville[P]bspwm/src/monitor.c
// Function: monitor_from_point
monitor_t *monitor_from_point(xcb_point_t pt)
{
	for (monitor_t *m = mon_head; m != NULL; m = m->next) {
		if (is_inside_monitor(m, pt)) {
			return m;
		}
	}
	return NULL;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
leaq 0x222b8(%rip), %rax     # 0x29708
movq (%rax), %rbx
testq %rbx, %rbx
je 0x7472
movl %edi, %ebp
movq 0x4c(%rbx), %rsi
movl %ebp, %edi
callq 0x60d4
testb %al, %al
jne 0x7474
movq 0x78(%rbx), %rbx
testq %rbx, %rbx
jne 0x745a
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq