LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/phluid61[P]hsf/src/boolean.c
// Function: SH_Boolean__to_s
sh_char_t*
SH_Boolean__to_s(SH_Boolean* obj, int* err) {
	sh_char_t* str = (sh_char_t*)malloc(sizeof(sh_char_t) * 3);

	__cascade(err, (sh_char_t*)0);

	if ((sh_char_t*)0 == str) {
		__raise(err, SH_E_MALLOC_ERROR);
		return (sh_char_t*)0;
	}

	str[0] = SH_CHAR_C('?');
	str[1] = SH_Boolean__true(obj, err) ? SH_CHAR_C('1') : SH_CHAR_C('0');
	str[2] = SH_CHAR_C(0);

	__clear(err);
	return str;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movl $0x3, %edi
callq 0x1040
testq %rbx, %rbx
je 0x11f2
cmpl $0x0, (%rbx)
je 0x11f2
xorl %eax, %eax
jmp 0x122f
testq %rax, %rax
je 0x1221
movb $0x3f, (%rax)
testq %rbx, %rbx
je 0x120c
movb $0x30, %dl
cmpl $0x0, (%rbx)
jne 0x1216
movl $0x0, (%rbx)
cmpb $0x0, (%r14)
sete %dl
xorb $0x31, %dl
xorl %ecx, %ecx
movb %dl, 0x1(%rax)
movb $0x0, 0x2(%rax)
jmp 0x1228
movl $0x80000001, %ecx       # imm = 0x80000001
xorl %eax, %eax
testq %rbx, %rbx
je 0x122f
movl %ecx, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/Tarsnap[P]libcperciva/tests/crypto_entropy/main.c
// Function: main
int
main(int argc, char * argv[])
{
	uint8_t buf[32];
	size_t i;

	WARNP_INIT;

	(void)argc;
	(void)argv;

	/* Get entropy enough times to trigger a reseed. */
	for (i = 0; i < RESEED_INTERVAL + 1; i++) {
		if (crypto_entropy_read(buf, 32)) {
			warn0("crypto_entropy_read(): internal error.");
			goto err0;
		}
	}

	/* Print final random value. */
	for (i = 0; i < 32; i++) {
		printf("%02x", buf[i]);
	}
	printf("\n");

	/* Success! */
	exit(0);

err0:
	/* Failure! */
	exit(1);
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x28, %rsp
movq (%rsi), %rdi
testq %rdi, %rdi
je 0x13e0
callq 0x1b90
movl $0x101, %r14d           # imm = 0x101
movq %rsp, %rbx
movl $0x20, %esi
movq %rbx, %rdi
callq 0x1458
testl %eax, %eax
jne 0x1432
decq %r14
jne 0x13e9
leaq 0x3c25(%rip), %rbx      # 0x502b
xorl %r14d, %r14d
movzbl (%rsp,%r14), %esi
movq %rbx, %rdi
xorl %eax, %eax
callq 0x1090
incq %r14
cmpq $0x20, %r14
jne 0x1409
movl $0xa, %edi
callq 0x1040
xorl %edi, %edi
callq 0x1170
leaq 0x3bcb(%rip), %rdi      # 0x5004
xorl %eax, %eax
callq 0x1d2f
callq 0x1070
movl $0x0, (%rax)
movl $0x1, %edi
callq 0x1170
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O1/xiongxu[P]bam2bedGraph2/samtools-0.1.19/misc/md5.c
// Function: MD5Update
void MD5Update(ctx, buf, len)
    struct MD5Context *ctx; unsigned char *buf; unsigned len;
{
    uint32_t t;

    /* Update bitcount */

    t = ctx->bits[0];
    if ((ctx->bits[0] = t + ((uint32_t) len << 3)) < t)
	ctx->bits[1]++; 	/* Carry from low to high */
    ctx->bits[1] += len >> 29;

    t = (t >> 3) & 0x3f;	/* Bytes already in shsInfo->data */

    /* Handle any leading odd-sized chunks */

    if (t) {
	unsigned char *p = (unsigned char *) ctx->in + t;

	t = 64 - t;
	if (len < t) {
	    memcpy(p, buf, len);
	    return;
	}
	memcpy(p, buf, t);
	byteReverse(ctx->in, 16);
	MD5Transform(ctx->buf, (uint32_t *) ctx->in);
	buf += t;
	len -= t;
    }
    /* Process data in 64-byte chunks */

    while (len >= 64) {
	memcpy(ctx->in, buf, 64);
	byteReverse(ctx->in, 16);
	MD5Transform(ctx->buf, (uint32_t *) ctx->in);
	buf += 64;
	len -= 64;
    }

    /* Handle any remaining bytes of data. */

    memcpy(ctx->in, buf, len);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %r15d
movq %rsi, %rbx
movq %rdi, %r14
movl 0x10(%rdi), %eax
leal (,%r15,8), %ecx
addl %eax, %ecx
movl %ecx, 0x10(%rdi)
jae 0x1299
incl 0x14(%r14)
movl %r15d, %ecx
shrl $0x1d, %ecx
addl %ecx, 0x14(%r14)
shrl $0x3, %eax
andl $0x3f, %eax
je 0x130e
leaq (%r14,%rax), %rdi
addq $0x18, %rdi
movl $0x40, %ebp
subl %eax, %ebp
movl %r15d, %r12d
subl %ebp, %r12d
jae 0x12d2
movl %r15d, %edx
movq %rbx, %rsi
callq 0x10c0
movl %r15d, %r12d
jmp 0x12f7
leaq 0x18(%r14), %rax
movq %rax, (%rsp)
movl %ebp, %r13d
movq %rbx, %rsi
movq %r13, %rdx
callq 0x10c0
movq %r14, %rdi
movq (%rsp), %rsi
callq 0x1377
addq %r13, %rbx
cmpl %ebp, %r15d
movl %r12d, %r15d
jae 0x130e
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
cmpl $0x40, %r15d
jb 0x1357
leaq 0x18(%r14), %r12
movups (%rbx), %xmm0
movups 0x10(%rbx), %xmm1
movups 0x20(%rbx), %xmm2
movups 0x30(%rbx), %xmm3
movups %xmm3, 0x30(%r12)
movups %xmm2, 0x20(%r12)
movups %xmm1, 0x10(%r12)
movups %xmm0, (%r12)
movq %r14, %rdi
movq %r12, %rsi
callq 0x1377
addq $0x40, %rbx
addl $-0x40, %r15d
cmpl $0x3f, %r15d
ja 0x1318
addq $0x18, %r14
movl %r15d, %edx
movq %r14, %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x10c0
// File: /workspace/github_c_makefile_star2_O1/xiongxu[P]bam2bedGraph2/samtools-0.1.19/misc/md5fa.c
// Function: main
int main(int argc, char *argv[])
{
	int i;
	if (argc == 1) md5_one("-");
	else for (i = 1; i < argc; ++i) md5_one(argv[i]);
	return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
cmpl $0x1, %edi
jne 0x1b74
leaq 0x14b3(%rip), %rdi      # 0x3020
callq 0x1b9b
jmp 0x1b93
jle 0x1b93
movq %rsi, %rbx
movl %edi, %r14d
movl $0x1, %r15d
movq (%rbx,%r15,8), %rdi
callq 0x1b9b
incq %r15
cmpq %r15, %r14
jne 0x1b82
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/test/pileup_mod.c
// Function: process_pileup
void process_pileup(sam_hdr_t *h, const bam_pileup1_t *p,
                    int tid, int pos, int n) {
    kstring_t s = {0,0};
    printf("%s\t%d\t", sam_hdr_tid2name(h, tid), pos);
    int i;
    for (i = 0; i < n; i++, p++) {
        if (p->is_del) {
            putchar('*');
            continue;
        }

        uint8_t *seq = bam_get_seq(p->b);
        uint8_t *qual = bam_get_qual(p->b);
        unsigned char c = seq_nt16_str[bam_seqi(seq, p->qpos)];
        putchar(c);
        kputc(MIN('~','!'+qual[p->qpos]), &s);
    }
    putchar('\t');
    puts(s.l ? s.s : "");

    free(s.s);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %r8d, %ebx
movl %ecx, %ebp
movq %rsi, %r14
movl %edx, %esi
callq 0xbecd
leaq 0x8b20b(%rip), %rdi     # 0x91028
xorl %r15d, %r15d
movq %rax, %rsi
movl %ebp, %edx
xorl %eax, %eax
callq 0x4060
testl %ebx, %ebx
jle 0x5f32
movq $0x0, (%rsp)
xorl %r13d, %r13d
xorl %ebp, %ebp
testb $0x1, 0x14(%r14)
jne 0x5eda
movq (%r14), %rcx
movl 0x14(%rcx), %edx
movl 0x18(%rcx), %eax
shll $0x2, %edx
addq 0x38(%rcx), %rdx
movzwl 0x12(%rcx), %esi
addq %rdx, %rsi
incl %eax
sarl %eax
movl 0x8(%r14), %ecx
movl %ecx, %edx
sarl %edx
movslq %edx, %rdx
movzbl (%rdx,%rsi), %edx
shll $0x2, %ecx
notb %cl
andb $0x4, %cl
shrl %cl, %edx
movslq %eax, %r15
addq %rsi, %r15
andl $0xf, %edx
leaq 0x8c020(%rip), %rax     # 0x91eb0
movzbl (%rax,%rdx), %edi
callq 0x46d0
movslq 0x8(%r14), %rax
movb (%rax,%r15), %r15b
leaq 0x2(%rbp), %rax
cmpq %rax, %r13
jae 0x5ee6
movq %rax, %rcx
shrq $0x3e, %rcx
movq %rax, %rdx
shrq %rdx
testq %rcx, %rcx
movl $0x0, %r12d
cmoveq %rdx, %r12
addq %rax, %r12
movq (%rsp), %rdi
movq %r12, %rsi
callq 0x4870
testq %rax, %rax
jne 0x5eed
jmp 0x5f12
movl $0x2a, %edi
callq 0x46d0
jmp 0x5f12
movq %r13, %r12
movq (%rsp), %rax
leal 0x21(%r15), %ecx
cmpb $0x5e, %r15b
movzbl %cl, %ecx
movl $0x7e, %edx
cmovael %edx, %ecx
movb %cl, (%rax,%rbp)
movb $0x0, 0x1(%rax,%rbp)
incq %rbp
movq %r12, %r13
movq %rax, (%rsp)
addq $0x28, %r14
decl %ebx
jne 0x5e41
testq %rbp, %rbp
leaq 0x8c2a5(%rip), %rbx     # 0x921cd
movq (%rsp), %r15
cmovneq %r15, %rbx
jmp 0x5f39
leaq 0x8c294(%rip), %rbx     # 0x921cd
movl $0x9, %edi
callq 0x46d0
movq %rbx, %rdi
callq 0x47f0
movq %r15, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x45d0
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/test/pileup_mod.c
// Function: pileup_cd_create
int pileup_cd_create(void *data, const bam1_t *b, bam_pileup_cd *cd) {
    hts_base_mod_state *m = hts_base_mod_state_alloc();
    if (bam_parse_basemod(b, m) < 0) {
        hts_base_mod_state_free(m);
        return -1;
    }
    cd->p = m;
    return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdx, %rbx
movq %rsi, %r15
callq 0x2f888
movq %rax, %r14
movq %r15, %rdi
movq %rax, %rsi
callq 0x2ff8a
testl %eax, %eax
js 0x5f8a
movq %r14, (%rbx)
xorl %eax, %eax
jmp 0x5f97
movq %r14, %rdi
callq 0x2f897
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/test/pileup_mod.c
// Function: main
int main(int argc, char **argv) {
    int compact = 0;
    while (argc > 1 && strcmp(argv[1], "-c") == 0) {
        compact++;
        argc--;
        argv++;
    }

    samFile *in = sam_open(argc > 1 ? argv[1] : "-", "r");
    bam1_t *b = bam_init1();
    sam_hdr_t *h = sam_hdr_read(in);

    // Pileup iterator with constructor/destructor to parse base mod tags
    plp_dat dat = {
        .fp = in,
        .h = h,
    };
    bam_plp_t iter = bam_plp_init(readaln, &dat);
    bam_plp_constructor(iter, pileup_cd_create);
    bam_plp_destructor(iter, pileup_cd_destroy);

    const bam_pileup1_t *p;
    int tid, pos, n = 0;
    while ((p = bam_plp_auto(iter, &tid, &pos, &n)) != 0) {
        switch (compact) {
        case 0:
            process_mod_pileup1(h, p, tid, pos, n);
            break;
        case 1:
            process_mod_pileup2(h, p, tid, pos, n);
            break;
        default:
            process_pileup(h, p, tid, pos, n);
            break;
        }
    }
    bam_plp_destroy(iter);

    sam_close(in);
    bam_destroy1(b);
    sam_hdr_destroy(h);

    return n != 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
leaq 0x8ac43(%rip), %r13     # 0x91039
cmpl $0x2, %edi
jl 0x6428
movq %rsi, %r14
movl %edi, %ebx
decl %ebx
xorl %ebp, %ebp
leaq 0x8ac57(%rip), %r12     # 0x91062
movq 0x8(%r14,%rbp,8), %r15
movq %r15, %rdi
movq %r12, %rsi
callq 0x46e0
testl %eax, %eax
jne 0x642f
incq %rbp
cmpl %ebp, %ebx
jne 0x640b
jmp 0x642a
xorl %ebx, %ebx
movq %r13, %r15
jmp 0x6431
movl %ebp, %ebx
leaq 0x8e5d9(%rip), %rsi     # 0x94a11
movq %r15, %rdi
callq 0x10ce3
movq %rax, %r14
callq 0x1ddc7
movq %rax, 0x18(%rsp)
movq %r14, %rdi
callq 0x20b7d
movq %rax, %r12
leaq 0x28(%rsp), %rsi
movq %r14, 0x20(%rsp)
movq %r14, (%rsi)
movq %rax, 0x8(%rsi)
leaq 0xd9(%rip), %rdi        # 0x6549
callq 0x2b156
movq %rax, %r13
leaq -0x51e(%rip), %rsi      # 0x5f61
movq %rax, %rdi
callq 0x2b3d9
leaq -0x4f1(%rip), %rsi      # 0x5f9d
movq %r13, %rdi
callq 0x2b3de
leaq 0xc(%rsp), %rcx
movl $0x0, (%rcx)
leaq 0x14(%rsp), %rsi
leaq 0x10(%rsp), %rdx
movq %r13, %rdi
callq 0x2cfea
testq %rax, %rax
je 0x650c
leaq 0x14(%rsp), %rbp
leaq 0x10(%rsp), %r15
leaq 0xc(%rsp), %r14
movl 0x14(%rsp), %edx
movl 0x10(%rsp), %ecx
movl 0xc(%rsp), %r8d
movq %r12, %rdi
movq %rax, %rsi
cmpl $0x1, %ebx
je 0x64ea
testl %ebx, %ebx
jne 0x64f1
callq 0x5faa
jmp 0x64f6
callq 0x61e4
jmp 0x64f6
callq 0x5dfc
movq %r13, %rdi
movq %rbp, %rsi
movq %r15, %rdx
movq %r14, %rcx
callq 0x2cfea
testq %rax, %rax
jne 0x64c7
movq %r13, %rdi
callq 0x2b246
movq 0x20(%rsp), %rdi
callq 0x11f4d
movq 0x18(%rsp), %rdi
callq 0x1dea4
movq %r12, %rdi
callq 0x1d446
xorl %eax, %eax
cmpl $0x0, 0xc(%rsp)
setne %al
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/ohkimur[P]the-c-programming-language-2nd-edition-solutions/chapter_4/exercise_4_13/reverse.c
// Function: main
int main(void)
{
  char str[MAXLEN] = "This is just a string";

  printf("%s\n", str);
  reverse(str);
  printf("%s\n", str);

  return 0;
}

// Assembly:
pushq %rbx
subq $0x70, %rsp
leaq 0xec8(%rip), %rsi       # 0x2010
movq %rsp, %rbx
movl $0xc, %ecx
movq %rbx, %rdi
rep  movsq (%rsi), %es:(%rdi)
movl $0x0, 0x60(%rbx)
movq %rbx, %rdi
callq 0x1030
movq %rbx, %rdi
callq 0x117d
movq %rbx, %rdi
callq 0x1030
xorl %eax, %eax
addq $0x70, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/ohkimur[P]the-c-programming-language-2nd-edition-solutions/chapter_4/exercise_4_13/reverse.c
// Function: reverse
void reverse(char str[])
{
  static int i = 0;
  static int j = 0;

  if (str[i] != '\0')
  {
    char c = str[i++];
    reverse(str);

    str[j++] = c;
  }

  // if whole reverse process is complete, reset the static variables to make this function reusable
  if (str[j] == '\0')
  {
    i = 0;
    j = 0;
  }
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
movslq 0x2eaa(%rip), %rax      # 0x4034
movb (%rdi,%rax), %bpl
testb %bpl, %bpl
je 0x11b7
incl %eax
movl %eax, 0x2e99(%rip)      # 0x4034
movq %rbx, %rdi
callq 0x117d
movslq 0x2e8e(%rip), %rax      # 0x4038
leal 0x1(%rax), %ecx
movl %ecx, 0x2e85(%rip)      # 0x4038
movb %bpl, (%rbx,%rax)
movslq 0x2e7a(%rip), %rax      # 0x4038
cmpb $0x0, (%rbx,%rax)
jne 0x11d2
xorl %eax, %eax
movl %eax, 0x2e68(%rip)      # 0x4034
movl %eax, 0x2e66(%rip)      # 0x4038
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/test/test-bcf-sr.c
// Function: usage
void HTS_NORETURN usage(int exit_code)
{
    fprintf(stderr, "Usage: test-bcf-sr [OPTIONS] vcf-list.txt\n");
    fprintf(stderr, "       test-bcf-sr [OPTIONS] --args file1.bcf [...]\n");
    fprintf(stderr, "Options:\n");
    fprintf(stderr, "       --args                   pass filenames directly in argument list\n");
    fprintf(stderr, "       --no-index               allow streaming\n");
    fprintf(stderr, "   -o, --output <file>          output file (stdout if not set)\n");
    fprintf(stderr, "   -O, --output-fmt <fmt>       fmt: vcf,bcf,summary\n");
    fprintf(stderr, "   -p, --pair <logic[+ref]>     logic: snps,indels,both,snps+ref,indels+ref,both+ref,exact,some,all\n");
    fprintf(stderr, "   -r, --regions <reg_list>     comma-separated list of regions\n");
    fprintf(stderr, "   -t, --targets <reg_list>     comma-separated list of targets\n");
    fprintf(stderr, "   -u, --usefptr                use hfile pointer interface on reader addition\n");
    fprintf(stderr, "\n");
    exit(exit_code);
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %edi, %ebx
movq 0xd2015(%rip), %r14     # 0xd7fd8
movq (%r14), %rcx
leaq 0xab06f(%rip), %rdi     # 0xb103c
movl $0x2a, %esi
movl $0x1, %edx
callq 0x49d0
movq (%r14), %rcx
leaq 0xab081(%rip), %rdi     # 0xb1067
movl $0x34, %esi
movl $0x1, %edx
callq 0x49d0
movq (%r14), %rcx
leaq 0xab09d(%rip), %rdi     # 0xb109c
movl $0x9, %esi
movl $0x1, %edx
callq 0x49d0
movq (%r14), %rcx
leaq 0xab08e(%rip), %rdi     # 0xb10a6
movl $0x49, %esi
movl $0x1, %edx
callq 0x49d0
movq (%r14), %rcx
leaq 0xab0bf(%rip), %rdi     # 0xb10f0
movl $0x30, %esi
movl $0x1, %edx
callq 0x49d0
movq (%r14), %rcx
leaq 0xab0d7(%rip), %rdi     # 0xb1121
movl $0x40, %esi
movl $0x1, %edx
callq 0x49d0
movq (%r14), %rcx
leaq 0xab0ff(%rip), %rdi     # 0xb1162
movl $0x35, %esi
movl $0x1, %edx
callq 0x49d0
movq (%r14), %rcx
leaq 0xab11c(%rip), %rdi     # 0xb1198
movl $0x64, %esi
movl $0x1, %edx
callq 0x49d0
movq (%r14), %rcx
leaq 0xab168(%rip), %rdi     # 0xb11fd
movl $0x40, %esi
movl $0x1, %edx
callq 0x49d0
movq (%r14), %rcx
leaq 0xab190(%rip), %rdi     # 0xb123e
movl $0x40, %esi
movl $0x1, %edx
callq 0x49d0
movq (%r14), %rcx
leaq 0xab1b8(%rip), %rdi     # 0xb127f
movl $0x4f, %esi
movl $0x1, %edx
callq 0x49d0
movq (%r14), %rsi
movl $0xa, %edi
callq 0x4660
movl %ebx, %edi
callq 0x4600
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/test/test-bcf-sr.c
// Function: write_vcf_bcf_format
void write_vcf_bcf_format(bcf_srs_t *sr, bcf_hdr_t *hdr, vcfFile *vcf_out,
                          const char *fmt_type)
{
    int i, n;
    if (bcf_hdr_write(vcf_out, hdr) != 0)
        error("Couldn't write %s header\n", fmt_type);

    while ((n = bcf_sr_next_line(sr)) > 0) {
        for (i=0; i<sr->nreaders; i++)
        {
            if ( !bcf_sr_has_line(sr,i) ) continue;
            bcf1_t *rec = bcf_sr_get_line(sr, i);
            if (!rec) error("bcf_sr_get_line() unexpectedly returned NULL\n");
            if (vcf_write(vcf_out, hdr, rec) < 0)
                error("vcf_write() failed\n");
        }
    }
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rcx, %r12
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
movq %rdx, %rdi
callq 0x35c90
testl %eax, %eax
jne 0x633a
movq %r15, %rdi
callq 0x2b4fe
testl %eax, %eax
jle 0x6319
cmpl $0x0, 0x30(%r15)
jle 0x62c1
movl $0xc, %r12d
xorl %r13d, %r13d
movq 0x18(%r15), %rax
cmpl $0x0, (%rax,%r13,4)
je 0x6307
movq 0x28(%r15), %rax
movq (%rax,%r12,4), %rax
movq (%rax), %rdx
testq %rdx, %rdx
je 0x6323
movq %rbx, %rdi
movq %r14, %rsi
callq 0x382c2
testl %eax, %eax
js 0x632c
incq %r13
movslq 0x30(%r15), %rax
addq $0x18, %r12
cmpq %rax, %r13
jl 0x62dd
jmp 0x62c1
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
leaq 0xaafa5(%rip), %rdi     # 0xb12cf
jmp 0x6333
leaq 0xaafe8(%rip), %rdi     # 0xb131b
xorl %eax, %eax
callq 0x5f1c
leaq 0xaafc0(%rip), %rdi     # 0xb1301
movq %r12, %rsi
xorl %eax, %eax
callq 0x5f1c
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/synced_bcf_reader.c
// Function: bcf_sr_set_regions
int bcf_sr_set_regions(bcf_srs_t *readers, const char *regions, int is_file)
{
    if ( readers->nreaders || readers->regions )
    {
        if ( readers->regions ) bcf_sr_regions_destroy(readers->regions);
        readers->regions = bcf_sr_regions_init(regions,is_file,0,1,-2);
        bcf_sr_seek_start(readers);
        return 0;
    }

    readers->regions = bcf_sr_regions_init(regions,is_file,0,1,-2);
    if ( !readers->regions ) return -1;
    readers->explicit_regs = 1;
    readers->require_index = REQUIRE_IDX_;
    readers->regions->overlap = BCF_SR_AUX(readers)->regions_overlap;
    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %edx, %ebp
movq %rsi, %r15
movq %rdi, %r14
cmpl $0x0, 0x30(%rdi)
jne 0x29d94
cmpq $0x0, 0x48(%r14)
je 0x29e20
movq 0x48(%r14), %rdi
testq %rdi, %rdi
je 0x29da2
callq 0x29e6c
xorl %ebx, %ebx
movq %r15, %rdi
movl %ebp, %esi
xorl %edx, %edx
movl $0x1, %ecx
movl $0xfffffffe, %r8d       # imm = 0xFFFFFFFE
callq 0x29f6b
movq %rax, 0x48(%r14)
movslq 0x98(%rax), %rdx
testq %rdx, %rdx
jle 0x29ded
movq 0x80(%rax), %rcx
shlq $0x3, %rdx
leaq (%rdx,%rdx,2), %rdx
xorl %esi, %esi
movl $0xffffffff, 0x10(%rcx,%rsi) # imm = 0xFFFFFFFF
addq $0x18, %rsi
cmpq %rsi, %rdx
jne 0x29ddc
movl $0x0, 0x9c(%rax)
pcmpeqd %xmm0, %xmm0
movdqu %xmm0, 0xa0(%rax)
movl $0xffffffff, 0xb0(%rax) # imm = 0xFFFFFFFF
movdqu %xmm0, 0xb8(%rax)
movl %ebx, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
xorl %ebx, %ebx
movl $0x1, %r12d
movq %r15, %rdi
movl %ebp, %esi
xorl %edx, %edx
movl $0x1, %ecx
movl $0xfffffffe, %r8d       # imm = 0xFFFFFFFE
callq 0x29f6b
movq %rax, 0x48(%r14)
testq %rax, %rax
je 0x29e65
movl %r12d, 0x38(%r14)
movl %r12d, 0x10(%r14)
movq 0x88(%r14), %rcx
movl 0x1d8(%rcx), %ecx
movl %ecx, 0xc8(%rax)
jmp 0x29e15
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
jmp 0x29e15
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/synced_bcf_reader.c
// Function: bcf_sr_regions_destroy
void bcf_sr_regions_destroy(bcf_sr_regions_t *reg)
{
    int i;
    free(reg->fname);
    if ( reg->itr ) tbx_itr_destroy(reg->itr);
    if ( reg->tbx ) tbx_destroy(reg->tbx);
    if ( reg->file ) hts_close(reg->file);
    if ( reg->als ) free(reg->als);
    if ( reg->als_str.s ) free(reg->als_str.s);
    free(reg->line.s);
    if ( reg->regs )
    {
         // free only in-memory names, tbx names are const
        for (i=0; i<reg->nseqs; i++)
        {
            free(reg->seq_names[i]);
            free(reg->regs[i].regs);
        }
    }
    free(reg->regs);
    free(reg->seq_names);
    khash_str2int_destroy(reg->seq_hash);
    free(reg);
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq 0x30(%rdi), %rdi
callq 0x45d0
movq 0x8(%rbx), %rdi
testq %rdi, %rdi
je 0x29e8b
callq 0xe50f
movq (%rbx), %rdi
testq %rdi, %rdi
je 0x29e98
callq 0x2e836
movq 0x28(%rbx), %rdi
testq %rdi, %rdi
je 0x29ea6
callq 0xb1a1
movq 0x40(%rbx), %rdi
testq %rdi, %rdi
je 0x29eb4
callq 0x45d0
movq 0x58(%rbx), %rdi
testq %rdi, %rdi
je 0x29ec2
callq 0x45d0
movq 0x20(%rbx), %rdi
callq 0x45d0
cmpq $0x0, 0x80(%rbx)
je 0x29f17
cmpl $0x0, 0x98(%rbx)
jle 0x29f17
xorl %r14d, %r14d
xorl %r15d, %r15d
movq 0x90(%rbx), %rax
movq (%rax,%r15,8), %rdi
callq 0x45d0
movq 0x80(%rbx), %rax
movq (%rax,%r14), %rdi
callq 0x45d0
incq %r15
movslq 0x98(%rbx), %rax
addq $0x18, %r14
cmpq %rax, %r15
jl 0x29ee4
movq 0x80(%rbx), %rdi
callq 0x45d0
movq 0x90(%rbx), %rdi
callq 0x45d0
movq 0x88(%rbx), %r14
testq %r14, %r14
je 0x29f5e
movq 0x18(%r14), %rdi
callq 0x45d0
movq 0x10(%r14), %rdi
callq 0x45d0
movq 0x20(%r14), %rdi
callq 0x45d0
movq %r14, %rdi
callq 0x45d0
movq %rbx, %rdi
popq %rbx
popq %r14
popq %r15
jmp 0x45d0
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/synced_bcf_reader.c
// Function: bcf_sr_set_targets
int bcf_sr_set_targets(bcf_srs_t *readers, const char *targets, int is_file, int alleles)
{
    if ( readers->nreaders || readers->targets )
    {
        hts_log_error("Must call bcf_sr_set_targets() before bcf_sr_add_reader()");
        return -1;
    }
    if ( targets[0]=='^' )
    {
        readers->targets_exclude = 1;
        targets++;
    }
    readers->targets = bcf_sr_regions_init(targets,is_file,0,1,-2);
    if ( !readers->targets ) return -1;
    readers->targets_als = alleles;
    readers->targets->overlap = BCF_SR_AUX(readers)->targets_overlap;
    return 0;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
cmpl $0x0, 0x30(%rdi)
jne 0x2a685
movq %rdi, %r14
cmpq $0x0, 0x50(%rdi)
je 0x2a6ab
leaq 0x8a685(%rip), %rsi     # 0xb4d11
leaq 0x8a691(%rip), %rdx     # 0xb4d24
movl $0x1, %edi
xorl %eax, %eax
callq 0x9e34
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
movl %ecx, %ebx
cmpb $0x5e, (%rsi)
jne 0x2a6bd
movl $0x1, 0x5c(%r14)
incq %rsi
xorl %ebp, %ebp
movq %rsi, %rdi
movl %edx, %esi
xorl %edx, %edx
movl $0x1, %ecx
movl $0xfffffffe, %r8d       # imm = 0xFFFFFFFE
callq 0x29f6b
movq %rax, 0x50(%r14)
testq %rax, %rax
je 0x2a69f
movl %ebx, 0x58(%r14)
movq 0x88(%r14), %rcx
movl 0x1dc(%rcx), %ecx
movl %ecx, 0xc8(%rax)
jmp 0x2a6a4
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/synced_bcf_reader.c
// Function: bcf_sr_set_threads
int bcf_sr_set_threads(bcf_srs_t *files, int n_threads)
{
    if (!(files->n_threads = n_threads))
        return 0;

    files->p = calloc(1, sizeof(*files->p));
    if (!files->p) {
        files->errnum = no_memory;
        return -1;
    }
    if (!(files->p->pool = hts_tpool_init(n_threads)))
        return -1;

    return 0;
}

// Assembly:
movl %esi, 0x7c(%rdi)
testl %esi, %esi
je 0x2a740
pushq %rbp
pushq %rbx
pushq %rax
movl %esi, %ebp
movq %rdi, %rbx
movl $0x1, %edi
movl $0x10, %esi
callq 0x42f0
movq %rax, 0x80(%rbx)
testq %rax, %rax
je 0x2a743
movl %ebp, %edi
callq 0x305ca
movq %rax, %rcx
movq 0x80(%rbx), %rax
movq %rcx, (%rax)
xorl %eax, %eax
cmpq $0x1, %rcx
sbbl %eax, %eax
jmp 0x2a74f
xorl %eax, %eax
retq
movl $0x7, 0x20(%rbx)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/synced_bcf_reader.c
// Function: bcf_sr_destroy_threads
void bcf_sr_destroy_threads(bcf_srs_t *files) {
    if (!files->p)
        return;

    if (files->p->pool)
        hts_tpool_destroy(files->p->pool);
    free(files->p);
}

// Assembly:
movq 0x80(%rdi), %rax
testq %rax, %rax
je 0x2a780
pushq %rbx
movq %rdi, %rbx
movq (%rax), %rdi
testq %rdi, %rdi
je 0x2a773
callq 0x31038
movq 0x80(%rbx), %rdi
popq %rbx
jmp 0x45d0
retq
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/synced_bcf_reader.c
// Function: bcf_sr_add_reader
int bcf_sr_add_reader(bcf_srs_t *files, const char *fname)
{
    char fmode[5];
    int ret = 0;
    const char *idxname = NULL;

    strcpy(fmode, "r");
    vcf_open_mode(fmode+1, fname, NULL);
    htsFile* file_ptr = hts_open(fname, fmode);
    if ( ! file_ptr ) {
        files->errnum = open_failed;
        return 0;
    }
    //get idx name and pass to add_hreader
    idxname = strstr(fname, HTS_IDX_DELIM);
    idxname += idxname ? sizeof(HTS_IDX_DELIM) - 1 : 0;
    if (!(ret = bcf_sr_add_hreader(files, file_ptr, 1, idxname))) {
        hts_close(file_ptr);    //failed, close the file
    }
    return ret;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r12
movq %rdi, %rbx
leaq 0x3(%rsp), %rdi
movw $0x72, -0x1(%rdi)
xorl %r14d, %r14d
xorl %edx, %edx
callq 0x3e513
leaq 0x2(%rsp), %rsi
movq %r12, %rdi
callq 0x9f37
testq %rax, %rax
je 0x2a7f8
movq %rax, %r15
leaq 0x86cc6(%rip), %rsi     # 0xb1486
movq %r12, %rdi
callq 0x40d0
testq %rax, %rax
movl $0x7, %ecx
cmoveq %rax, %rcx
addq %rax, %rcx
movq %rbx, %rdi
movq %r15, %rsi
movl $0x1, %edx
callq 0x2a80e
movl %eax, %r14d
testl %eax, %eax
jne 0x2a7ff
movq %r15, %rdi
callq 0xb1a1
jmp 0x2a7ff
movl $0x0, 0x20(%rbx)
movl %r14d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/synced_bcf_reader.c
// Function: regions_sort_and_merge
void _regions_sort_and_merge(bcf_sr_regions_t *reg)
{
    if ( !reg ) return;

    int i;
    for (i=0; i<reg->nseqs; i++)
    {
        qsort(reg->regs[i].regs, reg->regs[i].nregs, sizeof(*reg->regs[i].regs), regions_cmp);
        regions_merge(&reg->regs[i]);
    }
}

// Assembly:
testq %rdi, %rdi
je 0x2b21e
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpl $0x0, 0x98(%rdi)
jle 0x2b213
xorl %r15d, %r15d
leaq 0x2756(%rip), %r14      # 0x2d8bb
movq 0x80(%rbx), %rax
leaq (,%r15,8), %rcx
leaq (%rcx,%rcx,2), %r12
movq (%rax,%r12), %rdi
movslq 0x8(%rax,%r12), %rsi
movl $0x10, %edx
movq %r14, %rcx
callq 0x49b0
movq 0x80(%rbx), %rax
movl 0x8(%rax,%r12), %ecx
testl %ecx, %ecx
jle 0x2b200
addq %r12, %rax
xorl %esi, %esi
leal 0x1(%rsi), %edx
cmpl %ecx, %edx
jge 0x2b1fa
movq (%rax), %rdi
movslq %esi, %rdx
movq %rdx, %r8
shlq $0x4, %r8
leaq (%rdi,%r8), %rsi
addq $0x8, %rsi
incq %rdx
addq %r8, %rdi
addq $0x18, %rdi
movq (%rsi), %r8
cmpq -0x8(%rdi), %r8
jl 0x2b1fa
movq (%rdi), %r9
cmpq %r9, %r8
jge 0x2b1dd
movq %r9, (%rsi)
movq $0x1, -0x8(%rdi)
movq $0x0, (%rdi)
incq %rdx
addq $0x10, %rdi
cmpq %rdx, %rcx
jne 0x2b1c9
movl %ecx, %edx
movl %edx, %esi
cmpl %ecx, %edx
jl 0x2b1a3
incq %r15
movslq 0x98(%rbx), %rax
cmpq %rax, %r15
jl 0x2b165
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/synced_bcf_reader.c
// Function: bcf_sr_init
bcf_srs_t *bcf_sr_init(void)
{
    bcf_srs_t *files = (bcf_srs_t*) calloc(1,sizeof(bcf_srs_t));
    files->aux = (aux_t*) calloc(1,sizeof(aux_t));
    bcf_sr_sort_init(&BCF_SR_AUX(files)->sort);
    bcf_sr_set_opt(files,BCF_SR_REGIONS_OVERLAP,1);
    bcf_sr_set_opt(files,BCF_SR_TARGETS_OVERLAP,0);
    return files;
}

// Assembly:
pushq %rbx
movl $0x1, %edi
movl $0x90, %esi
callq 0x42f0
movq %rax, %rbx
movl $0x1, %edi
movl $0x1e8, %esi            # imm = 0x1E8
callq 0x42f0
movq %rax, 0x88(%rbx)
movq %rax, %rdi
callq 0x93c07
movq %rbx, %rdi
movl $0x3, %esi
movl $0x1, %edx
xorl %eax, %eax
callq 0x29bb5
movq %rbx, %rdi
movl $0x4, %esi
xorl %edx, %edx
xorl %eax, %eax
callq 0x29bb5
movq %rbx, %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/synced_bcf_reader.c
// Function: bcf_sr_destroy
void bcf_sr_destroy(bcf_srs_t *files)
{
    int i;
    int *autoclose = BCF_SR_AUX(files)->closefile;

    for (i=0; i<files->nreaders; i++)
        bcf_sr_destroy1(&files->readers[i], autoclose[i]);
    free(files->has_line);
    free(files->readers);
    for (i=0; i<files->n_smpl; i++) free(files->samples[i]);
    free(files->samples);
    if (files->targets) bcf_sr_regions_destroy(files->targets);
    if (files->regions) bcf_sr_regions_destroy(files->regions);
    if (files->tmps.m) free(files->tmps.s);
    if (files->n_threads) bcf_sr_destroy_threads(files);
    bcf_sr_sort_destroy(&BCF_SR_AUX(files)->sort);
    free(autoclose);
    free(files->aux);
    free(files);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x88(%rdi), %rax
movq 0x1e0(%rax), %r14
cmpl $0x0, 0x30(%rdi)
jle 0x2b2bf
xorl %r15d, %r15d
xorl %r12d, %r12d
movq 0x28(%rbx), %rdi
addq %r15, %rdi
movl (%r14,%r12,4), %esi
callq 0x2b369
incq %r12
movslq 0x30(%rbx), %rax
addq $0x60, %r15
cmpq %rax, %r12
jl 0x2b29f
movq 0x18(%rbx), %rdi
callq 0x45d0
movq 0x28(%rbx), %rdi
callq 0x45d0
cmpl $0x0, 0x78(%rbx)
jle 0x2b2f3
xorl %r15d, %r15d
movq 0x40(%rbx), %rax
movq (%rax,%r15,8), %rdi
callq 0x45d0
incq %r15
movslq 0x78(%rbx), %rax
cmpq %rax, %r15
jl 0x2b2da
movq 0x40(%rbx), %rdi
callq 0x45d0
movq 0x50(%rbx), %rdi
testq %rdi, %rdi
je 0x2b30a
callq 0x29e6c
movq 0x48(%rbx), %rdi
testq %rdi, %rdi
je 0x2b318
callq 0x29e6c
cmpq $0x0, 0x68(%rbx)
je 0x2b328
movq 0x70(%rbx), %rdi
callq 0x45d0
cmpl $0x0, 0x7c(%rbx)
je 0x2b336
movq %rbx, %rdi
callq 0x2a756
movq 0x88(%rbx), %rdi
callq 0x93c33
movq %r14, %rdi
callq 0x45d0
movq 0x88(%rbx), %rdi
callq 0x45d0
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x45d0
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/synced_bcf_reader.c
// Function: bcf_sr_destroy1
static void bcf_sr_destroy1(bcf_sr_t *reader, int closefile)
{
    free(reader->fname);
    if ( reader->tbx_idx ) tbx_destroy(reader->tbx_idx);
    if ( reader->bcf_idx ) hts_idx_destroy(reader->bcf_idx);
    bcf_hdr_destroy(reader->header);
    if (closefile) {
        hts_close(reader->file);
    }
    if ( reader->itr ) tbx_itr_destroy(reader->itr);
    int j;
    for (j=0; j<reader->mbuffer; j++)
        bcf_destroy1(reader->buffer[j]);
    free(reader->buffer);
    free(reader->samples);
    free(reader->filter_ids);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl %esi, %ebp
movq %rdi, %rbx
movq 0x28(%rdi), %rdi
callq 0x45d0
movq 0x8(%rbx), %rdi
testq %rdi, %rdi
je 0x2b389
callq 0x2e836
movq 0x10(%rbx), %rdi
testq %rdi, %rdi
je 0x2b397
callq 0xb31a
movq 0x18(%rbx), %rdi
callq 0x34eb2
testl %ebp, %ebp
je 0x2b3ac
movq (%rbx), %rdi
callq 0xb1a1
movq 0x20(%rbx), %rdi
testq %rdi, %rdi
je 0x2b3ba
callq 0xe50f
cmpl $0x0, 0x3c(%rbx)
jle 0x2b3dc
xorl %r14d, %r14d
movq 0x30(%rbx), %rax
movq (%rax,%r14,8), %rdi
callq 0x361f2
incq %r14
movslq 0x3c(%rbx), %rax
cmpq %rax, %r14
jl 0x2b3c3
movq 0x30(%rbx), %rdi
callq 0x45d0
movq 0x50(%rbx), %rdi
callq 0x45d0
movq 0x48(%rbx), %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x45d0
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/synced_bcf_reader.c
// Function: bcf_sr_remove_reader
void bcf_sr_remove_reader(bcf_srs_t *files, int i)
{
    assert( !files->samples );  // not ready for this yet
    int *autoclose = BCF_SR_AUX(files)->closefile;

    bcf_sr_sort_remove_reader(files, &BCF_SR_AUX(files)->sort, i);
    bcf_sr_destroy1(&files->readers[i], autoclose[i]);
    if ( i+1 < files->nreaders )
    {
        memmove(&files->readers[i], &files->readers[i+1], (files->nreaders-i-1)*sizeof(bcf_sr_t));
        memmove(&files->has_line[i], &files->has_line[i+1], (files->nreaders-i-1)*sizeof(int));
        memmove(&autoclose[i], &autoclose[i+1], (files->nreaders-i-1)*sizeof(int));
    }
    files->nreaders--;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
cmpq $0x0, 0x40(%rdi)
jne 0x2b4df
movl %esi, %ebp
movq %rdi, %rbx
movq 0x88(%rdi), %rsi
movq 0x1e0(%rsi), %r12
movl %ebp, %edx
callq 0x93b81
movslq %ebp, %r13
leaq (,%r13,2), %r15
addq %r13, %r15
shlq $0x5, %r15
movq 0x28(%rbx), %rdi
addq %r15, %rdi
movl (%r12,%r13,4), %esi
callq 0x2b369
leal 0x1(%r13), %ecx
movl 0x30(%rbx), %eax
cmpl %eax, %ecx
jge 0x2b4cd
leaq (%r12,%r13,4), %rdx
movq %rdx, (%rsp)
movq 0x28(%rbx), %rdx
addq %rdx, %r15
movslq %ecx, %rbp
leaq (,%rbp,2), %rsi
addq %rbp, %rsi
shlq $0x5, %rsi
addq %rdx, %rsi
movl %r13d, %r14d
notl %r14d
addl %r14d, %eax
cltq
shlq $0x5, %rax
leaq (%rax,%rax,2), %rdx
movq %r15, %rdi
callq 0x4860
movq 0x18(%rbx), %rax
leaq (%rax,%r13,4), %rdi
leaq (%rax,%rbp,4), %rsi
movl 0x30(%rbx), %eax
addl %r14d, %eax
movslq %eax, %rdx
shlq $0x2, %rdx
callq 0x4860
leaq (%r12,%rbp,4), %rsi
addl 0x30(%rbx), %r14d
movslq %r14d, %rdx
shlq $0x2, %rdx
movq (%rsp), %rdi
callq 0x4860
decl 0x30(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x89a7d(%rip), %rdi     # 0xb4f63
leaq 0x89a86(%rip), %rsi     # 0xb4f73
leaq 0x89a93(%rip), %rcx     # 0xb4f87
movl $0x1f6, %edx            # imm = 0x1F6
callq 0x42e0
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/synced_bcf_reader.c
// Function: reader_seek
static int _reader_seek(bcf_sr_t *reader, const char *seq, hts_pos_t start, hts_pos_t end)
{
    if ( end>=MAX_CSI_COOR )
    {
        hts_log_error("The coordinate is out of csi index limit: %"PRIhts_pos, end+1);
        exit(1);
    }
    if ( reader->itr )
    {
        hts_itr_destroy(reader->itr);
        reader->itr = NULL;
    }
    reader->nbuffer = 0;
    if ( reader->tbx_idx )
    {
        int tid = tbx_name2id(reader->tbx_idx, seq);
        if ( tid==-1 ) return -1;    // the sequence not present in this file
        reader->itr = tbx_itr_queryi(reader->tbx_idx,tid,start,end+1);
    }
    else
    {
        int tid = bcf_hdr_name2id(reader->header, seq);
        if ( tid==-1 ) return -1;    // the sequence not present in this file
        reader->itr = bcf_itr_queryi(reader->bcf_idx,tid,start,end+1);
    }
    if (!reader->itr) {
        hts_log_error("Could not seek: %s:%"PRIhts_pos"-%"PRIhts_pos, seq, start + 1, end + 1);
        abort();
    }
    return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %rbx
movabsq $0xfffffffffff, %rax    # imm = 0xFFFFFFFFFFF
cmpq %rax, %rcx
jge 0x2c6f5
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %r12
movq 0x20(%rdi), %rdi
testq %rdi, %rdi
je 0x2c63c
callq 0xe50f
movq $0x0, 0x20(%r12)
movl $0x0, 0x38(%r12)
movq 0x8(%r12), %rdi
testq %rdi, %rdi
je 0x2c676
movq %r15, %rsi
callq 0x2d8e8
cmpl $-0x1, %eax
je 0x2c6e4
movq 0x8(%r12), %rcx
movq 0x18(%rcx), %rdi
leaq 0x1(%rbx), %rcx
leaq 0x1af7(%rip), %r8       # 0x2e16b
jmp 0x2c69d
movq 0x18(%r12), %rdi
movl $0x1, %esi
movq %r15, %rdx
callq 0x33da1
cmpl $-0x1, %eax
je 0x2c6e4
movq 0x10(%r12), %rdi
leaq 0x1(%rbx), %rcx
leaq 0xace8(%rip), %r8       # 0x37385
movl %eax, %esi
movq %r14, %rdx
callq 0xd955
movq %rax, %rcx
movq %rax, 0x20(%r12)
xorl %eax, %eax
testq %rcx, %rcx
jne 0x2c6e9
incq %r14
incq %rbx
leaq 0x88b8b(%rip), %rsi     # 0xb524e
leaq 0x88bbf(%rip), %rdx     # 0xb5289
movl $0x1, %edi
movq %r15, %rcx
movq %r14, %r8
movq %rbx, %r9
xorl %eax, %eax
callq 0x9e34
callq 0x4260
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
incq %rbx
leaq 0x88b4f(%rip), %rsi     # 0xb524e
leaq 0x88b55(%rip), %rdx     # 0xb525b
movl $0x1, %edi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x9e34
movl $0x1, %edi
callq 0x4600
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/synced_bcf_reader.c
// Function: bcf_sr_regions_seek
int bcf_sr_regions_seek(bcf_sr_regions_t *reg, const char *seq)
{
    reg->iseq = reg->start = reg->end = -1;
    if ( khash_str2int_get(reg->seq_hash, seq, &reg->iseq) < 0 ) return -1;  // sequence seq not in regions

    // using in-memory regions
    if ( reg->regs )
    {
        reg->regs[reg->iseq].creg = -1;
        return 0;
    }

    // reading regions from tabix
    if ( reg->itr ) tbx_itr_destroy(reg->itr);
    reg->itr = tbx_itr_querys(reg->tbx, seq);
    if ( reg->itr ) return 0;

    return -1;
}

// Assembly:
pcmpeqd %xmm0, %xmm0
movdqu %xmm0, 0x9c(%rdi)
movl $0xffffffff, 0xac(%rdi) # imm = 0xFFFFFFFF
movq 0x88(%rdi), %rdx
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
testq %rdx, %rdx
je 0x2ceee
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %rdi, %rbx
movl (%rdx), %eax
testl %eax, %eax
je 0x2cdbb
movq %rax, 0x8(%rsp)
leal -0x1(%rax), %edi
movb (%rsi), %cl
testb %cl, %cl
movq %rbx, 0x10(%rsp)
je 0x2cdc3
leaq 0x1(%rsi), %rax
movl $0x811c9dc5, %r13d      # imm = 0x811C9DC5
movzbl %cl, %ecx
xorl %r13d, %ecx
imull $0x1000193, %ecx, %r13d # imm = 0x1000193
movb (%rax), %cl
incq %rax
testb %cl, %cl
jne 0x2cda3
jmp 0x2cdc9
xorl %r14d, %r14d
jmp 0x2ce64
movl $0x811c9dc5, %r13d      # imm = 0x811C9DC5
andl %edi, %r13d
movq 0x10(%rdx), %r8
movl $0x1, %r12d
movl %r13d, %r14d
movq %rdx, 0x20(%rsp)
movl %edi, 0x4(%rsp)
movq %r8, 0x18(%rsp)
movl %r14d, %eax
shrl $0x4, %eax
movl (%r8,%rax,4), %ebp
leal (%r14,%r14), %r15d
andl $0x1e, %r15d
movl %ebp, %eax
movl %r15d, %ecx
shrl %cl, %eax
testb $0x2, %al
jne 0x2ce48
testb $0x1, %al
jne 0x2ce30
movq 0x18(%rdx), %rax
movl %r14d, %ecx
movq (%rax,%rcx,8), %rdi
movq %rsi, %rbx
callq 0x46f0
movq 0x18(%rsp), %r8
movl 0x4(%rsp), %edi
movq 0x20(%rsp), %rdx
movq %rbx, %rsi
testl %eax, %eax
je 0x2ce48
addl %r12d, %r14d
andl %edi, %r14d
incl %r12d
cmpl %r13d, %r14d
jne 0x2cde7
movq 0x8(%rsp), %rax
movl %eax, %r14d
jmp 0x2ce5a
movl %r15d, %ecx
shrl %cl, %ebp
testb $0x3, %bpl
movq 0x8(%rsp), %rax
cmovnel %eax, %r14d
movq 0x10(%rsp), %rbx
movl $0xffffffff, %ecx       # imm = 0xFFFFFFFF
cmpl %eax, %r14d
je 0x2cee0
movq 0x20(%rdx), %rax
movl %r14d, %ecx
movl (%rax,%rcx,4), %eax
movl %eax, 0x9c(%rbx)
movq 0x80(%rbx), %rax
testq %rax, %rax
je 0x2ce9f
addq $0x9c, %rbx
movslq (%rbx), %rcx
leaq (%rcx,%rcx,2), %rcx
movl $0xffffffff, 0x10(%rax,%rcx,8) # imm = 0xFFFFFFFF
xorl %ecx, %ecx
jmp 0x2cee0
movq 0x8(%rbx), %rdi
testq %rdi, %rdi
je 0x2ceb3
movq %rsi, %r14
callq 0xe50f
movq %r14, %rsi
movq (%rbx), %rcx
movq 0x18(%rcx), %rdi
leaq 0xa27(%rip), %rdx       # 0x2d8e8
leaq -0x1f573(%rip), %r8     # 0xd955
leaq 0x129c(%rip), %r9       # 0x2e16b
callq 0x103ed
movq %rax, 0x8(%rbx)
xorl %ecx, %ecx
cmpq $0x1, %rax
sbbl %ecx, %ecx
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
movl %ecx, %eax
retq
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/synced_bcf_reader.c
// Function: set_variant_boundaries
static void _set_variant_boundaries(bcf1_t *rec, hts_pos_t *beg, hts_pos_t *end)
{
    hts_pos_t off;
    if ( rec->n_allele )
    {
        off = rec->rlen;
        bcf_unpack(rec, BCF_UN_STR);
        int i;
        for (i=1; i<rec->n_allele; i++)
        {
            // Make symbolic alleles start at POS, although this is not strictly true for
            // <DEL>,<INS> where POS should be the position BEFORE the deletion/insertion.
            // However, since arbitrary symbolic alleles can be defined by the user, we
            // will simplify the interpretation of --targets-overlap and --region-overlap.
            int j = 0;
            char *ref = rec->d.allele[0];
            char *alt = rec->d.allele[i];
            while ( ref[j] && alt[j] && ref[j]==alt[j] ) j++;
            if ( off > j ) off = j;
            if ( !off ) break;
        }
    }
    else
        off = 0;

    *beg = rec->pos + off;
    *end = rec->pos + rec->rlen - 1;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movq %rsi, %r15
movq %rdi, %r14
cmpw $0x0, 0x1a(%rdi)
je 0x2d3c0
movq 0x8(%r14), %r12
movq %r14, %rdi
movl $0x1, %esi
callq 0x3e6b9
movl 0x18(%r14), %edi
cmpl $0x20000, %edi          # imm = 0x20000
jb 0x2d3c3
shrl $0x10, %edi
movq 0x88(%r14), %rax
movq (%rax), %rcx
movb (%rcx), %dl
cmpl $0x3, %edi
movl $0x2, %esi
cmovael %edi, %esi
movl $0x1, %edi
testb %dl, %dl
je 0x2d3a7
movq (%rax,%rdi,8), %r9
xorl %r8d, %r8d
movl %edx, %r10d
cmpb (%r9,%r8), %r10b
jne 0x2d3aa
movb 0x1(%rcx,%r8), %r10b
incq %r8
testb %r10b, %r10b
jne 0x2d392
jmp 0x2d3aa
xorl %r8d, %r8d
cmpq %r8, %r12
cmovgeq %r8, %r12
testq %r12, %r12
je 0x2d3c3
incq %rdi
cmpq %rsi, %rdi
jne 0x2d384
jmp 0x2d3c3
xorl %r12d, %r12d
addq (%r14), %r12
movq %r12, (%r15)
movq (%r14), %rax
movq 0x8(%r14), %rcx
addq %rcx, %rax
decq %rax
movq %rax, (%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/synced_bcf_reader.c
// Function: regions_cmp
static int regions_cmp(const void *aptr, const void *bptr)
{
    region1_t *a = (region1_t*)aptr;
    region1_t *b = (region1_t*)bptr;
    if ( a->start < b->start ) return -1;
    if ( a->start > b->start ) return 1;
    if ( a->end < b->end ) return -1;
    if ( a->end > b->end ) return 1;
    return 0;
}

// Assembly:
movq (%rsi), %rcx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpq %rcx, (%rdi)
jl 0x2d8e4
movl $0x1, %eax
jg 0x2d8e4
movq 0x8(%rsi), %rcx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpq %rcx, 0x8(%rdi)
jl 0x2d8e4
setg %al
movzbl %al, %eax
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/bcf_sr_sort.c
// Function: bcf_sr_sort_set_active
int bcf_sr_sort_set_active(sr_sort_t *srt, int idx)
{
    hts_expand(int,idx+1,srt->mactive,srt->active);
    srt->nactive = 1;
    srt->active[srt->nactive - 1] = idx;
    return 0; // FIXME: check for errs in this function
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebx
movq %rdi, %r14
movslq 0x1c8(%rdi), %rsi
cmpl %ebx, %esi
jg 0x91647
leal 0x1(%rbx), %eax
testl %ebx, %ebx
movl $0x1, %ecx
cmovnsl %eax, %ecx
movslq %ecx, %rdi
leaq 0x1d0(%r14), %r9
leaq 0x2e10e(%rip), %rax     # 0xbf738
movq %rax, (%rsp)
movl $0x4, %edx
movl $0x4, %ecx
xorl %r8d, %r8d
callq 0x11efc
movl %eax, 0x1c8(%r14)
movl $0x1, 0x1c4(%r14)
movq 0x1d0(%r14), %rax
movl %ebx, (%rax)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/bcf_sr_sort.c
// Function: bcf_sr_sort_add_active
int bcf_sr_sort_add_active(sr_sort_t *srt, int idx)
{
    hts_expand(int,idx+1,srt->mactive,srt->active);
    srt->nactive++;
    srt->active[srt->nactive - 1] = idx;
    return 0; // FIXME: check for errs in this function
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movl %esi, %ebx
movq %rdi, %r14
movslq 0x1c8(%rdi), %rsi
cmpl %ebx, %esi
jg 0x916b4
leal 0x1(%rbx), %eax
testl %ebx, %ebx
movl $0x1, %ecx
cmovnsl %eax, %ecx
movslq %ecx, %rdi
leaq 0x1d0(%r14), %r9
leaq 0x2e0b8(%rip), %rax     # 0xbf74f
movq %rax, (%rsp)
movl $0x4, %edx
movl $0x4, %ecx
xorl %r8d, %r8d
callq 0x11efc
movl %eax, 0x1c8(%r14)
movslq 0x1c4(%r14), %rax
leal 0x1(%rax), %ecx
movl %ecx, 0x1c4(%r14)
movq 0x1d0(%r14), %rcx
movl %ebx, (%rcx,%rax,4)
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/bcf_sr_sort.c
// Function: bcf_sr_sort_remove_reader
void bcf_sr_sort_remove_reader(bcf_srs_t *readers, sr_sort_t *srt, int i)
{
    //vcf_buf is allocated only in bcf_sr_sort_next
    //So, a call to bcf_sr_add_reader() followed immediately by bcf_sr_remove_reader()
    //would cause the program to crash in this segment
    if (srt->vcf_buf)
    {
        free(srt->vcf_buf[i].rec);
        if ( i+1 < srt->nsr )
            memmove(&srt->vcf_buf[i], &srt->vcf_buf[i+1], (srt->nsr - i - 1)*sizeof(vcf_buf_t));
        memset(srt->vcf_buf + srt->nsr - 1, 0, sizeof(vcf_buf_t));
    }
}

// Assembly:
movq 0x150(%rsi), %rax
testq %rax, %rax
je 0x93c06
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edx, %ebp
movq %rsi, %rbx
movslq %edx, %r15
movq %r15, %r14
shlq $0x4, %r14
movq 0x8(%rax,%r14), %rdi
callq 0x45d0
incl %r15d
movl 0x1b8(%rbx), %eax
cmpl %eax, %r15d
jge 0x93be2
movq 0x150(%rbx), %rcx
addq %rcx, %r14
movslq %r15d, %rsi
shlq $0x4, %rsi
addq %rcx, %rsi
notl %ebp
addl %ebp, %eax
movslq %eax, %rdx
shlq $0x4, %rdx
movq %r14, %rdi
callq 0x4860
movq 0x150(%rbx), %rax
movslq 0x1b8(%rbx), %rcx
shlq $0x4, %rcx
xorps %xmm0, %xmm0
movups %xmm0, -0x10(%rax,%rcx)
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/samtools[P]htslib/bcf_sr_sort.c
// Function: remove_vset
static void remove_vset(sr_sort_t *srt, int jvset)
{
    if ( jvset+1 < srt->nvset )
    {
        varset_t tmp = srt->vset[jvset];
        memmove(&srt->vset[jvset], &srt->vset[jvset+1], sizeof(varset_t)*(srt->nvset - jvset - 1));
        srt->vset[srt->nvset-1] = tmp;

        int *jmat = srt->pmat + jvset*srt->ngrp;
        memmove(jmat, &jmat[srt->ngrp],sizeof(int)*(srt->nvset - jvset - 1)*srt->ngrp);

        memmove(&srt->cnt[jvset], &srt->cnt[jvset+1], sizeof(int)*(srt->nvset - jvset - 1));
    }
    srt->nvset--;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x28, %rsp
movl %esi, %r14d
movq %rdi, %rbx
leal 0x1(%r14), %ecx
movl 0x110(%rdi), %eax
cmpl %eax, %ecx
jge 0x94641
movq 0x148(%rbx), %rdx
movslq %r14d, %r15
movq %r15, %rsi
shlq $0x5, %rsi
leaq (%rdx,%rsi), %rdi
movups (%rdx,%rsi), %xmm0
movups 0x10(%rdx,%rsi), %xmm1
movaps %xmm1, 0x10(%rsp)
movaps %xmm0, (%rsp)
movslq %ecx, %r12
movq %r12, %rsi
shlq $0x5, %rsi
addq %rdx, %rsi
notl %r14d
addl %r14d, %eax
movslq %eax, %rdx
shlq $0x5, %rdx
callq 0x4860
movq 0x148(%rbx), %rax
movslq 0x110(%rbx), %rcx
shlq $0x5, %rcx
movaps (%rsp), %xmm0
movaps 0x10(%rsp), %xmm1
movups %xmm1, -0x10(%rax,%rcx)
movups %xmm0, -0x20(%rax,%rcx)
movslq 0x128(%rbx), %rax
movq %rax, %rdi
imulq %r15, %rdi
shlq $0x2, %rdi
addq 0x120(%rbx), %rdi
leaq (%rdi,%rax,4), %rsi
movl 0x110(%rbx), %ecx
addl %r14d, %ecx
movslq %ecx, %rdx
imulq %rax, %rdx
shlq $0x2, %rdx
callq 0x4860
movq 0x138(%rbx), %rax
leaq (%rax,%r15,4), %rdi
leaq (%rax,%r12,4), %rsi
addl 0x110(%rbx), %r14d
movslq %r14d, %rdx
shlq $0x2, %rdx
callq 0x4860
decl 0x110(%rbx)
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
nop
// File: /workspace/github_c_makefile_star2_O1/ryuichiueda[P]glueutils/src/juz.c
// Function: usage
void usage(void){
	fputs("juz: repeatedly chain the same command in a pipeline\n", stderr);
	fputs("usage: juz <num> <command> [args]\n", stderr);
	fputs("\nCopyright (C) 2021 Ryuichi Ueda\n", stderr);
	fputs("Released under the MIT License.\n", stderr);
	fputs("https://github.com/ryuichiueda/glueutils\n", stderr);
}

// Assembly:
pushq %rbx
movq 0x2ef0(%rip), %rbx      # 0x3ff8
movq (%rbx), %rsi
leaq 0xef2(%rip), %rdi       # 0x2004
callq 0x1060
movq (%rbx), %rsi
leaq 0xf19(%rip), %rdi       # 0x203a
callq 0x1060
movq (%rbx), %rsi
leaq 0xf2d(%rip), %rdi       # 0x205d
callq 0x1060
movq (%rbx), %rsi
leaq 0xf40(%rip), %rdi       # 0x207f
callq 0x1060
movq (%rbx), %rsi
leaq 0xf52(%rip), %rdi       # 0x20a0
popq %rbx
jmp 0x1060
// File: /workspace/github_c_makefile_star2_O1/ryuichiueda[P]glueutils/src/juz.c
// Function: dup_and_close
void dup_and_close(int old, int new)
{
	try_close(new);
	if(dup2(old, new) == -1){
		printf("Error: %s\n", strerror(errno));
		exit(1);
	}
	try_close(old);
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movl %esi, %ebp
movl %edi, %ebx
movl %esi, %edi
callq 0x127c
movl %ebx, %edi
movl %ebp, %esi
callq 0x1040
cmpl $-0x1, %eax
je 0x12d9
movl %ebx, %edi
addq $0x8, %rsp
popq %rbx
popq %rbp
jmp 0x127c
callq 0x1030
movl (%rax), %edi
callq 0x10d0
leaq 0xdde(%rip), %rdi       # 0x20ca
movq %rax, %rsi
xorl %eax, %eax
callq 0x1050
movl $0x1, %edi
callq 0x10c0