LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O2/mohamedamjad[P]UBLOXlib/src/gnuplot_i.c
// Function: gnuplot_plot_once
void gnuplot_plot_once(
  char    *   title,
  char    *   style,
  char    *   label_x,
  char    *   label_y,
  double  *   x,
  double  *   y,
  int         n
)
{
  gnuplot_ctrl    *   handle ;

  if (x==NULL || n<1) return ;

  if ((handle = gnuplot_init()) == NULL) return ;
  if (style!=NULL) {
      gnuplot_setstyle(handle, style);
  } else {
      gnuplot_setstyle(handle, "lines");
  }
  if (label_x!=NULL) {
      gnuplot_set_xlabel(handle, label_x);
  } else {
      gnuplot_set_xlabel(handle, "X");
  }
  if (label_y!=NULL) {
      gnuplot_set_ylabel(handle, label_y);
  } else {
      gnuplot_set_ylabel(handle, "Y");
  }
  if (y==NULL) {
      gnuplot_plot_x(handle, x, n, title);
  } else {
      gnuplot_plot_xy(handle, x, y, n, title);
  }
  printf("press ENTER to continue\n");
  while (getchar()!='\n') {}
  gnuplot_close(handle);
  return ;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %r9, -0x40(%rbp)
movq %rcx, -0x38(%rbp)
movq %rdi, -0x30(%rbp)
movl 0x10(%rbp), %r13d
testq %r8, %r8
sete %al
testl %r13d, %r13d
setle %cl
orb %al, %cl
jne 0x22e1
movq %r8, %r15
movq %rdx, %r12
movq %rsi, %r14
callq 0x1c18
testq %rax, %rax
je 0x22e1
movq %rax, %rbx
testq %r14, %r14
leaq 0xf74(%rip), %rsi       # 0x31fc
cmovneq %r14, %rsi
movq %rax, %rdi
callq 0x1cd2
testq %r12, %r12
leaq 0x135f(%rip), %rsi      # 0x35fd
cmovneq %r12, %rsi
movq %rbx, %rdi
callq 0x1ee6
movq -0x38(%rbp), %rax
testq %rax, %rax
leaq 0x115f(%rip), %rsi      # 0x3417
cmovneq %rax, %rsi
movq %rbx, %rdi
callq 0x1efc
movq -0x40(%rbp), %rdx
movq %rbx, %rdi
movq %r15, %rsi
testq %rdx, %rdx
je 0x22f0
movl %r13d, %ecx
movq -0x30(%rbp), %r8
callq 0x2148
jmp 0x22fc
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl %r13d, %edx
movq -0x30(%rbp), %rcx
callq 0x1f65
leaq 0x13be(%rip), %rdi      # 0x36c1
callq 0x1080
callq 0x1120
cmpl $0xa, %eax
jne 0x2308
movq %rbx, %rdi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x1dd4
// File: /workspace/github_c_makefile_star2_O2/mohamedamjad[P]UBLOXlib/src/gnuplot_i.c
// Function: gnuplot_plot_slope
void gnuplot_plot_slope(
    gnuplot_ctrl    *   handle,
    double              a,
    double              b,
    char            *   title
)
{
    char const *    cmd    = (handle->nplots > 0) ? "replot" : "plot";
    title                  = (title == NULL)      ? "(none)" : title;

    gnuplot_cmd(handle, "%s %.18e * x + %.18e title \"%s\" with %s",
                  cmd, a, b, title, handle->pstyle) ;

    handle->nplots++ ;
    return ;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rdi, %rbx
cmpl $0x0, 0x8(%rdi)
leaq 0xf1b(%rip), %rax       # 0x3257
leaq 0x121e(%rip), %rdx      # 0x3561
cmovgq %rax, %rdx
testq %rsi, %rsi
leaq 0x1222(%rip), %rcx      # 0x3573
cmovneq %rsi, %rcx
leaq 0xc(%rdi), %r8
leaq 0x121a(%rip), %rsi      # 0x357a
movb $0x2, %al
callq 0x1e50
incl 0x8(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/mohamedamjad[P]UBLOXlib/src/gnuplot_i.c
// Function: gnuplot_plot_equation
void gnuplot_plot_equation(
    gnuplot_ctrl    *   h,
    char            *   equation,
    char            *   title
)
{
    char const *    cmd    = (h->nplots > 0) ? "replot" : "plot";
    title                  = (title == NULL)      ? "(none)" : title;

    gnuplot_cmd(h, "%s %s title \"%s\" with %s",
                  cmd, equation, title, h->pstyle) ;
    h->nplots++ ;
    return ;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rsi, %rcx
movq %rdi, %rbx
cmpl $0x0, 0x8(%rdi)
leaq 0xecf(%rip), %rsi       # 0x3257
leaq 0x11d2(%rip), %rax      # 0x3561
cmovgq %rsi, %rax
testq %rdx, %rdx
leaq 0x11d6(%rip), %r8       # 0x3573
cmovneq %rdx, %r8
leaq 0xc(%rdi), %r9
leaq 0x11f6(%rip), %rsi      # 0x35a2
movq %rax, %rdx
xorl %eax, %eax
callq 0x1e50
incl 0x8(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/mohamedamjad[P]UBLOXlib/src/gnuplot_i.c
// Function: gnuplot_write_x_csv
int gnuplot_write_x_csv(
    char const * fileName,
    double const * d,
    int n,
    char const * title)
{
    int     i;
    FILE*   fileHandle;

    if (fileName==NULL || d==NULL || (n<1))
    {
        return -1;
    }

    fileHandle = fopen(fileName, "w");

    if (fileHandle == NULL)
    {
        return -1;
    }

    // Write Comment.
    if (title != NULL)
    {
        fprintf(fileHandle, "# %s\n", title) ;
    }

    /* Write data to this file  */
    for (i=0 ; i<n; i++)
    {
        fprintf(fileHandle, "%d, %.18e\n", i, d[i]) ;
    }

    fclose(fileHandle) ;

    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rcx, %r12
testq %rdi, %rdi
sete %al
testq %rsi, %rsi
sete %cl
orb %al, %cl
testl %edx, %edx
setle %al
orb %cl, %al
pushq $-0x1
popq %r13
jne 0x2457
movl %edx, %r15d
movq %rsi, %rbx
leaq 0x1052(%rip), %rsi      # 0x344b
callq 0x11a0
testq %rax, %rax
je 0x2457
movq %rax, %r14
testq %r12, %r12
je 0x241f
leaq 0x11a9(%rip), %rsi      # 0x35bb
movq %r14, %rdi
movq %r12, %rdx
xorl %eax, %eax
callq 0x1130
movl %r15d, %r13d
xorl %r15d, %r15d
leaq 0x1195(%rip), %r12      # 0x35c1
cmpq %r15, %r13
je 0x244c
movsd (%rbx,%r15,8), %xmm0
movq %r14, %rdi
movq %r12, %rsi
movl %r15d, %edx
movb $0x1, %al
callq 0x1130
incq %r15
jmp 0x242c
movq %r14, %rdi
callq 0x10a0
xorl %r13d, %r13d
movl %r13d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/mohamedamjad[P]UBLOXlib/src/gnuplot_i.c
// Function: gnuplot_write_xy_csv
int gnuplot_write_xy_csv(
    char const *        fileName,
    double const    *   x,
    double const    *   y,
    int                 n,
    char const      *   title)
{
    int     i ;
    FILE*   fileHandle;

    if (fileName==NULL || x==NULL || y==NULL || (n<1))
    {
        return -1;
    }

    fileHandle = fopen(fileName, "w");

    if (fileHandle == NULL)
    {
        return -1;
    }

    // Write Comment.
    if (title != NULL)
    {
        fprintf(fileHandle, "# %s\n", title) ;
    }

    /* Write data to this file  */
    for (i=0 ; i<n; i++)
    {
        fprintf(fileHandle, "%.18e, %.18e\n", x[i], y[i]) ;
    }

    fclose(fileHandle) ;

    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %ecx, %r12d
movq %rdx, %rbx
testq %rdi, %rdi
sete %al
testq %rsi, %rsi
sete %cl
orb %al, %cl
testq %rdx, %rdx
sete %al
testl %r12d, %r12d
setle %dl
orb %al, %dl
orb %cl, %dl
pushq $-0x1
popq %r13
jne 0x250e
movq %rsi, %r14
movq %r8, -0x30(%rbp)
leaq 0xf9c(%rip), %rsi       # 0x344b
callq 0x11a0
testq %rax, %rax
je 0x250e
movq %rax, %r15
movq -0x30(%rbp), %rdx
testq %rdx, %rdx
je 0x24d6
leaq 0x10ef(%rip), %rsi      # 0x35bb
movq %r15, %rdi
xorl %eax, %eax
callq 0x1130
movl %r12d, %r13d
xorl %r12d, %r12d
cmpq %r12, %r13
je 0x2503
movsd (%r14,%r12,8), %xmm0
movsd (%rbx,%r12,8), %xmm1
movq %r15, %rdi
leaq 0x10d5(%rip), %rsi      # 0x35cc
movb $0x2, %al
callq 0x1130
incq %r12
jmp 0x24dc
movq %r15, %rdi
callq 0x10a0
xorl %r13d, %r13d
movl %r13d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/mohamedamjad[P]UBLOXlib/src/gnuplot_i.c
// Function: gnuplot_write_multi_csv
int gnuplot_write_multi_csv(
    char const *        fileName,
    double const    **  xListPtr,
    int                 n,
    int                 numColumns,
    char const      *   title)
{
    int     i;
    int     j;
    FILE*   fileHandle;

    if (fileName==NULL || xListPtr==NULL || (n<1) || numColumns <1)
    {
        return -1;
    }

    for (j=0;j<numColumns;j++)
    {
        if (xListPtr[j] == NULL)
        {
            return -1;
        }
    }

    fileHandle = fopen(fileName, "w");

    if (fileHandle == NULL)
    {
        return -1;
    }

    // Write Comment.
    if (title != NULL)
    {
        fprintf(fileHandle, "# %s\n", title) ;
    }

    /* Write data to this file  */
    for (i=0 ; i<n; i++)
    {
        fprintf(fileHandle, "%d, %.18e", i, xListPtr[0][i]) ;
        for (j=1;j<numColumns;j++)
        {
            fprintf(fileHandle, ", %.18e", xListPtr[j][i]) ;
        }
        fprintf(fileHandle, "\n");
    }

    fclose(fileHandle) ;

    return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %edx, %r15d
movq %rsi, %rbx
testq %rdi, %rdi
sete %al
testq %rsi, %rsi
sete %dl
orb %al, %dl
testl %r15d, %r15d
setle %al
testl %ecx, %ecx
setle %sil
orb %al, %sil
orb %dl, %sil
pushq $-0x1
popq %r13
jne 0x261f
movl %ecx, %r12d
xorl %eax, %eax
cmpq %rax, %r12
je 0x2578
cmpq $0x0, (%rbx,%rax,8)
leaq 0x1(%rax), %rax
jne 0x2563
jmp 0x261f
movq %r8, -0x30(%rbp)
leaq 0xec8(%rip), %rsi       # 0x344b
callq 0x11a0
testq %rax, %rax
je 0x261f
movq %rax, %r14
movq -0x30(%rbp), %rdx
testq %rdx, %rdx
je 0x25ae
leaq 0x1017(%rip), %rsi      # 0x35bb
movq %r14, %rdi
xorl %eax, %eax
callq 0x1130
movl %r15d, %eax
movq %rax, -0x30(%rbp)
xorl %r15d, %r15d
cmpq -0x30(%rbp), %r15
je 0x2614
movq (%rbx), %rax
movsd (%rax,%r15,8), %xmm0
movq %r14, %rdi
leaq 0x1009(%rip), %rsi      # 0x35da
movl %r15d, %edx
movb $0x1, %al
callq 0x1130
pushq $0x1
popq %r13
cmpq %r12, %r13
jae 0x2604
movq (%rbx,%r13,8), %rax
movsd (%rax,%r15,8), %xmm0
movq %r14, %rdi
leaq 0xfe4(%rip), %rsi       # 0x35dc
movb $0x1, %al
callq 0x1130
incq %r13
jmp 0x25df
pushq $0xa
popq %rdi
movq %r14, %rsi
callq 0x1100
incq %r15
jmp 0x25b8
movq %r14, %rdi
callq 0x10a0
xorl %r13d, %r13d
movl %r13d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/vcf.c
// Function: bcf_hdr_add_sample_len
static int bcf_hdr_add_sample_len(bcf_hdr_t *h, const char *s, size_t len)
{
    const char *ss = s;
    while ( *ss && isspace_c(*ss) && ss - s < len) ss++;
    if ( !*ss || ss - s == len)
    {
        hts_log_error("Empty sample name: trailing spaces/tabs in the header line?");
        return -1;
    }

    vdict_t *d = (vdict_t*)h->dict[BCF_DT_SAMPLE];
    int ret;
    char *sdup = malloc(len + 1);
    if (!sdup) return -1;
    memcpy(sdup, s, len);
    sdup[len] = 0;

    // Ensure space is available in h->samples
    size_t n = kh_size(d);
    char **new_samples = realloc(h->samples, sizeof(char*) * (n + 1));
    if (!new_samples) {
        free(sdup);
        return -1;
    }
    h->samples = new_samples;

    int k = kh_put(vdict, d, sdup, &ret);
    if (ret < 0) {
        free(sdup);
        return -1;
    }
    if (ret) { // absent
        kh_val(d, k) = bcf_idinfo_def;
        kh_val(d, k).id = n;
    } else {
        hts_log_error("Duplicated sample name '%s'", sdup);
        free(sdup);
        return -1;
    }
    h->samples[n] = sdup;
    h->dirty = 1;
    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %r12
movq %rsi, %r13
movq %rdi, %rbx
xorl %r14d, %r14d
movb (%r13,%r14), %al
testb %al, %al
je 0x2256a
movsbl %al, %edi
callq 0x2340a
leaq 0x1(%r14), %rcx
cmpq %r12, %r14
jae 0x22560
movq %rcx, %r14
testl %eax, %eax
jne 0x2253f
leaq 0x1(%r12), %rdi
cmpq %rcx, %rdi
jne 0x22596
leaq 0x64c28(%rip), %rsi     # 0x87199
leaq 0x64c38(%rip), %rdx     # 0x871b0
pushq $0x1
popq %rdi
xorl %eax, %eax
callq 0x8132
pushq $-0x1
popq %rbp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x38(%rbx), %r15
callq 0x46a0
pushq $-0x1
popq %rbp
testq %rax, %rax
je 0x22585
movq %rax, %r14
movq %rax, %rdi
movq %r13, %rsi
movq %r12, %rdx
callq 0x43c0
movb $0x0, (%r14,%r12)
movl 0x4(%r15), %r13d
movq 0x40(%rbx), %rdi
leaq 0x8(,%r13,8), %rsi
callq 0x4860
testq %rax, %rax
je 0x2266c
movq %rax, 0x40(%rbx)
leaq 0x4(%rsp), %r12
movq %r15, %rdi
movq %r14, %rsi
movq %r12, %rdx
callq 0x2e007
cmpl $0x0, (%r12)
js 0x2266c
je 0x22651
movq 0x20(%r15), %rcx
cltq
imulq $0x38, %rax, %rax
movups 0x636c4(%rip), %xmm0    # 0x85cd0
movups %xmm0, 0x20(%rcx,%rax)
movups 0x636a8(%rip), %xmm0    # 0x85cc0
movups %xmm0, 0x10(%rcx,%rax)
movups 0x6368c(%rip), %xmm0    # 0x85cb0
movups %xmm0, (%rcx,%rax)
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movq %rdx, 0x30(%rcx,%rax)
movq 0x20(%r15), %rcx
movl %r13d, 0x30(%rcx,%rax)
movq 0x40(%rbx), %rax
movq %r14, (%rax,%r13,8)
movl $0x1, 0x54(%rbx)
xorl %ebp, %ebp
jmp 0x22585
leaq 0x64b41(%rip), %rsi     # 0x87199
leaq 0x64b8d(%rip), %rdx     # 0x871ec
pushq $0x1
popq %rdi
movq %r14, %rcx
xorl %eax, %eax
callq 0x8132
movq %r14, %rdi
callq 0x45c0
jmp 0x22585
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/vcf.c
// Function: bcf_hdr_parse_sample_line
int HTS_RESULT_USED bcf_hdr_parse_sample_line(bcf_hdr_t *hdr, const char *str)
{
    const char *mandatory = "#CHROM\tPOS\tID\tREF\tALT\tQUAL\tFILTER\tINFO";
    if ( strncmp(str,mandatory,strlen(mandatory)) )
    {
        hts_log_error("Could not parse the \"#CHROM..\" line, either the fields are incorrect or spaces are present instead of tabs:\n\t%s",str);
        return -1;
    }

    const char *beg = str + strlen(mandatory), *end;
    if ( !*beg || *beg=='\n' ) return 0;
    if ( strncmp(beg,"\tFORMAT\t",8) )
    {
        hts_log_error("Could not parse the \"#CHROM..\" line, either FORMAT is missing or spaces are present instead of tabs:\n\t%s",str);
        return -1;
    }
    beg += 8;

    int ret = 0;
    while ( *beg )
    {
        end = beg;
        while ( *end && *end!='\t' && *end!='\n' ) end++;
        if ( bcf_hdr_add_sample_len(hdr, beg, end-beg) < 0 ) ret = -1;
        if ( !*end || *end=='\n' || ret<0 ) break;
        beg = end + 1;
    }
    return ret;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x63b0f(%rip), %rsi     # 0x861a0
pushq $0x26
popq %rdx
movq %rbx, %rdi
callq 0x4200
testl %eax, %eax
je 0x226d1
leaq 0x63b20(%rip), %rsi     # 0x861c7
leaq 0x63b33(%rip), %rdx     # 0x861e1
pushq $0x1
popq %rdi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x8132
pushq $-0x1
popq %r15
movl %r15d, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movzbl 0x26(%rbx), %eax
xorl %r15d, %r15d
testl %eax, %eax
je 0x226bf
cmpl $0xa, %eax
je 0x226bf
leaq 0x26(%rbx), %rdi
leaq 0x63b65(%rip), %rsi     # 0x86251
pushq $0x8
popq %rdx
callq 0x4200
testl %eax, %eax
je 0x22708
leaq 0x63ac8(%rip), %rsi     # 0x861c7
leaq 0x63b54(%rip), %rdx     # 0x8625a
jmp 0x226ae
addq $0x2e, %rbx
xorl %r15d, %r15d
movl $0x601, %r12d           # imm = 0x601
pushq $-0x1
popq %rbp
movb (%rbx), %al
testb %al, %al
je 0x226bf
leaq 0x1(%rbx), %r13
xorl %edx, %edx
cmpb $0xa, %al
ja 0x22731
movzbl %al, %eax
btl %eax, %r12d
jb 0x2273d
movb (%r13), %al
incq %r13
incq %rdx
jmp 0x22724
movq %r14, %rdi
movq %rbx, %rsi
callq 0x22528
testl %eax, %eax
js 0x22766
movzbl -0x1(%r13), %eax
cmpl $0xa, %eax
je 0x226bf
movq %r13, %rbx
testl %eax, %eax
jne 0x22718
jmp 0x226bf
movl %ebp, %r15d
jmp 0x226bf
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/vcf.c
// Function: bcf_hdr_sync
int bcf_hdr_sync(bcf_hdr_t *h)
{
    int i;
    for (i = 0; i < 3; i++)
    {
        vdict_t *d = (vdict_t*)h->dict[i];
        khint_t k;
        if ( h->n[i] < kh_size(d) )
        {
            bcf_idpair_t *new_idpair;
            // this should be true only for i=2, BCF_DT_SAMPLE
            new_idpair = (bcf_idpair_t*) realloc(h->id[i], kh_size(d)*sizeof(bcf_idpair_t));
            if (!new_idpair) return -1;
            h->n[i] = kh_size(d);
            h->id[i] = new_idpair;
        }
        for (k=kh_begin(d); k<kh_end(d); k++)
        {
            if (!kh_exist(d,k)) continue;
            h->id[i][kh_val(d,k).id].key = kh_key(d,k);
            h->id[i][kh_val(d,k).id].val = &kh_val(d,k);
        }
    }

    // Invalidate key length cache
    bcf_hdr_aux_t *aux = get_hdr_aux(h);
    if (aux && aux->key_len) {
        free(aux->key_len);
        aux->key_len = NULL;
    }

    h->dirty = 0;
    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
xorl %r14d, %r14d
pushq $-0x1
popq %rbp
cmpq $0x3, %r14
je 0x22825
movq 0x28(%rbx,%r14,8), %r15
movl 0x4(%r15), %esi
cmpl %esi, (%rbx,%r14,4)
jae 0x227bb
movq 0x10(%rbx,%r14,8), %rdi
shlq $0x4, %rsi
callq 0x4860
testq %rax, %rax
je 0x22847
movl 0x4(%r15), %ecx
movl %ecx, (%rbx,%r14,4)
movq %rax, 0x10(%rbx,%r14,8)
movl (%r15), %eax
xorl %edx, %edx
xorl %esi, %esi
xorl %edi, %edi
cmpq %rdi, %rax
je 0x2281d
movq 0x10(%r15), %rcx
movl %edi, %r8d
shrl $0x4, %r8d
movl (%rcx,%r8,4), %r8d
movl %esi, %ecx
andb $0x1e, %cl
shrl %cl, %r8d
testb $0x3, %r8b
jne 0x22811
movq 0x18(%r15), %rcx
movq 0x20(%r15), %r8
movq (%rcx,%rdi,8), %rcx
movq 0x10(%rbx,%r14,8), %r9
movslq 0x30(%r8,%rdx), %r10
addq %rdx, %r8
shlq $0x4, %r10
movq %rcx, (%r9,%r10)
movq 0x10(%rbx,%r14,8), %rcx
movq %r8, 0x8(%rcx,%r10)
incq %rdi
addl $0x2, %esi
addq $0x38, %rdx
jmp 0x227c4
incq %r14
jmp 0x2277e
movq 0x28(%rbx), %r14
testq %r14, %r14
je 0x22841
movq 0x30(%r14), %rdi
testq %rdi, %rdi
je 0x22841
callq 0x45c0
andq $0x0, 0x30(%r14)
andl $0x0, 0x54(%rbx)
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/vcf.c
// Function: bcf_hrec_destroy
void bcf_hrec_destroy(bcf_hrec_t *hrec)
{
    if (!hrec) return;
    free(hrec->key);
    if ( hrec->value ) free(hrec->value);
    int i;
    for (i=0; i<hrec->nkeys; i++)
    {
        free(hrec->keys[i]);
        free(hrec->vals[i]);
    }
    free(hrec->keys);
    free(hrec->vals);
    free(hrec);
}

// Assembly:
testq %rdi, %rdi
je 0x228ba
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x8(%rdi), %rdi
callq 0x45c0
movq 0x10(%rbx), %rdi
callq 0x45c0
xorl %r14d, %r14d
movslq 0x18(%rbx), %rax
movq 0x20(%rbx), %rdi
cmpq %rax, %r14
jge 0x2289d
movq (%rdi,%r14,8), %rdi
callq 0x45c0
movq 0x28(%rbx), %rax
movq (%rax,%r14,8), %rdi
callq 0x45c0
incq %r14
jmp 0x22875
callq 0x45c0
movq 0x28(%rbx), %rdi
callq 0x45c0
movq %rbx, %rdi
addq $0x8, %rsp
popq %rbx
popq %r14
jmp 0x45c0
retq
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/vcf.c
// Function: bcf_hrec_debug
void bcf_hrec_debug(FILE *fp, bcf_hrec_t *hrec)
{
    fprintf(fp, "key=[%s] value=[%s]", hrec->key, hrec->value?hrec->value:"");
    int i;
    for (i=0; i<hrec->nkeys; i++)
        fprintf(fp, "\t[%s]=[%s]", hrec->keys[i],hrec->vals[i]);
    fprintf(fp, "\n");
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %r14
movq %rdi, %rbx
movq 0x8(%rsi), %rdx
movq 0x10(%rsi), %rax
testq %rax, %rax
leaq 0x5ff8e(%rip), %rcx     # 0x82a26
cmovneq %rax, %rcx
leaq 0x6382d(%rip), %rsi     # 0x862d0
xorl %eax, %eax
callq 0x4720
leaq 0x63833(%rip), %r15     # 0x862e4
xorl %r12d, %r12d
movslq 0x18(%r14), %rax
cmpq %rax, %r12
jge 0x22adf
movq 0x20(%r14), %rax
movq 0x28(%r14), %rcx
movq (%rax,%r12,8), %rdx
movq (%rcx,%r12,8), %rcx
movq %rbx, %rdi
movq %r15, %rsi
xorl %eax, %eax
callq 0x4720
incq %r12
jmp 0x22ab4
pushq $0xa
popq %rdi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x4650
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/vcf.c
// Function: bcf_header_debug
void bcf_header_debug(bcf_hdr_t *hdr)
{
    int i, j;
    for (i=0; i<hdr->nhrec; i++)
    {
        if ( !hdr->hrec[i]->value )
        {
            fprintf(stderr, "##%s=<", hdr->hrec[i]->key);
            fprintf(stderr,"%s=%s", hdr->hrec[i]->keys[0], hdr->hrec[i]->vals[0]);
            for (j=1; j<hdr->hrec[i]->nkeys; j++)
                fprintf(stderr,",%s=%s", hdr->hrec[i]->keys[j], hdr->hrec[i]->vals[j]);
            fprintf(stderr,">\n");
        }
        else
            fprintf(stderr,"##%s=%s\n", hdr->hrec[i]->key,hdr->hrec[i]->value);
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x8c4d6(%rip), %rbp     # 0xaefe0
leaq 0x637de(%rip), %r12     # 0x862ef
leaq 0x637de(%rip), %r13     # 0x862f6
leaq 0x637e1(%rip), %r15     # 0x86300
xorl %r14d, %r14d
movslq 0x50(%rbx), %rax
cmpq %rax, %r14
jge 0x22beb
movq 0x48(%rbx), %rax
movq (%rax,%r14,8), %rax
movq 0x8(%rax), %rdx
movq 0x10(%rax), %rcx
movq (%rbp), %rdi
testq %rcx, %rcx
jne 0x22bb8
movq %r12, %r15
movq %r12, %rsi
xorl %eax, %eax
callq 0x4720
movq (%rbp), %rdi
movq 0x48(%rbx), %rax
movq (%rax,%r14,8), %rax
movq 0x20(%rax), %rcx
movq 0x28(%rax), %rax
movq (%rcx), %rdx
movq (%rax), %rcx
leaq 0x6391e(%rip), %rsi     # 0x86494
xorl %eax, %eax
callq 0x4720
pushq $0x1
popq %r12
movq 0x48(%rbx), %rax
movq (%rax,%r14,8), %rcx
movslq 0x18(%rcx), %rdx
movq (%rbp), %rax
cmpq %rdx, %r12
jge 0x22bc4
movq 0x20(%rcx), %rdx
movq 0x28(%rcx), %rcx
movq (%rdx,%r12,8), %rdx
movq (%rcx,%r12,8), %rcx
movq %rax, %rdi
movq %r13, %rsi
xorl %eax, %eax
callq 0x4720
incq %r12
jmp 0x22b81
movq %r15, %rsi
xorl %eax, %eax
callq 0x4720
jmp 0x22be3
leaq 0x63732(%rip), %rdi     # 0x862fd
pushq $0x2
popq %rsi
pushq $0x1
popq %rdx
movq %rax, %rcx
callq 0x49b0
movq %r15, %r12
leaq 0x6371d(%rip), %r15     # 0x86300
incq %r14
jmp 0x22b22
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/vcf.c
// Function: bcf_hrec_add_key
int bcf_hrec_add_key(bcf_hrec_t *hrec, const char *str, size_t len)
{
    char **tmp;
    size_t n = hrec->nkeys + 1;
    assert(len > 0 && len < SIZE_MAX);
    tmp = realloc(hrec->keys, sizeof(char*)*n);
    if (!tmp) return -1;
    hrec->keys = tmp;
    tmp = realloc(hrec->vals, sizeof(char*)*n);
    if (!tmp) return -1;
    hrec->vals = tmp;

    hrec->keys[hrec->nkeys] = (char*) malloc((len+1)*sizeof(char));
    if (!hrec->keys[hrec->nkeys]) return -1;
    memcpy(hrec->keys[hrec->nkeys],str,len);
    hrec->keys[hrec->nkeys][len] = 0;
    hrec->vals[hrec->nkeys] = NULL;
    hrec->nkeys = n;
    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
leaq -0x1(%rdx), %rax
cmpq $-0x2, %rax
jae 0x22cba
movq %rdx, %r14
movq %rsi, %r15
movq %rdi, %rbx
movslq 0x18(%rdi), %r13
incq %r13
movq 0x20(%rdi), %rdi
leaq (,%r13,8), %r12
movq %r12, %rsi
callq 0x4860
pushq $-0x1
popq %rbp
testq %rax, %rax
je 0x22ca9
movq %rax, 0x20(%rbx)
movq 0x28(%rbx), %rdi
movq %r12, %rsi
callq 0x4860
testq %rax, %rax
je 0x22ca9
movq %rax, 0x28(%rbx)
leaq 0x1(%r14), %rdi
callq 0x46a0
movq 0x20(%rbx), %rcx
movslq 0x18(%rbx), %rdx
movq %rax, (%rcx,%rdx,8)
movq 0x20(%rbx), %rax
movq (%rax,%rdx,8), %rdi
testq %rdi, %rdi
je 0x22ca9
movq %r15, %rsi
movq %r14, %rdx
callq 0x43c0
movq 0x20(%rbx), %rax
movslq 0x18(%rbx), %rcx
movq (%rax,%rcx,8), %rax
movb $0x0, (%rax,%r14)
movq 0x28(%rbx), %rax
movslq 0x18(%rbx), %rcx
andq $0x0, (%rax,%rcx,8)
movl %r13d, 0x18(%rbx)
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x63648(%rip), %rdi     # 0x86309
leaq 0x6365b(%rip), %rsi     # 0x86323
leaq 0x6365a(%rip), %rcx     # 0x86329
movl $0x1a2, %edx            # imm = 0x1A2
callq 0x42e0
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/vcf.c
// Function: bcf_hrec_set_val
int bcf_hrec_set_val(bcf_hrec_t *hrec, int i, const char *str, size_t len, int is_quoted)
{
    if ( hrec->vals[i] ) {
        free(hrec->vals[i]);
        hrec->vals[i] = NULL;
    }
    if ( !str ) return 0;
    if ( is_quoted )
    {
        if (len >= SIZE_MAX - 3) {
            errno = ENOMEM;
            return -1;
        }
        hrec->vals[i] = (char*) malloc((len+3)*sizeof(char));
        if (!hrec->vals[i]) return -1;
        hrec->vals[i][0] = '"';
        memcpy(&hrec->vals[i][1],str,len);
        hrec->vals[i][len+1] = '"';
        hrec->vals[i][len+2] = 0;
    }
    else
    {
        if (len == SIZE_MAX) {
            errno = ENOMEM;
            return -1;
        }
        hrec->vals[i] = (char*) malloc((len+1)*sizeof(char));
        if (!hrec->vals[i]) return -1;
        memcpy(hrec->vals[i],str,len);
        hrec->vals[i][len] = 0;
    }
    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl %r8d, %ebp
movq %rcx, %r14
movq %rdx, %r12
movq %rdi, %r15
movq 0x28(%rdi), %rax
movslq %esi, %r13
movq (%rax,%r13,8), %rdi
testq %rdi, %rdi
je 0x22d0e
callq 0x45c0
movq 0x28(%r15), %rax
andq $0x0, (%rax,%r13,8)
xorl %ebx, %ebx
testq %r12, %r12
je 0x22dce
testl %ebp, %ebp
je 0x22d82
cmpq $-0x4, %r14
jae 0x22dc0
leaq 0x3(%r14), %rdi
callq 0x46a0
movq 0x28(%r15), %rcx
movq %rax, (%rcx,%r13,8)
movq 0x28(%r15), %rax
movq (%rax,%r13,8), %rax
testq %rax, %rax
je 0x22dcb
movb $0x22, %bpl
movb %bpl, (%rax)
movq 0x28(%r15), %rax
movq (%rax,%r13,8), %rdi
incq %rdi
movq %r12, %rsi
movq %r14, %rdx
callq 0x43c0
movq 0x28(%r15), %rax
movq (%rax,%r13,8), %rax
movb %bpl, 0x1(%rax,%r14)
movq 0x28(%r15), %rax
movq (%rax,%r13,8), %rax
movb $0x0, 0x2(%rax,%r14)
jmp 0x22dce
cmpq $-0x1, %r14
je 0x22dc0
leaq 0x1(%r14), %rdi
callq 0x46a0
movq 0x28(%r15), %rcx
movq %rax, (%rcx,%r13,8)
movq 0x28(%r15), %rax
movq (%rax,%r13,8), %rdi
testq %rdi, %rdi
je 0x22dcb
movq %r12, %rsi
movq %r14, %rdx
callq 0x43c0
movq 0x28(%r15), %rax
movq (%rax,%r13,8), %rax
movb $0x0, (%rax,%r14)
jmp 0x22dce
callq 0x4050
movl $0xc, (%rax)
pushq $-0x1
popq %rbx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/vcf.c
// Function: hrec_add_idx
int hrec_add_idx(bcf_hrec_t *hrec, int idx)
{
    int n = hrec->nkeys + 1;
    char **tmp = (char**) realloc(hrec->keys, sizeof(char*)*n);
    if (!tmp) return -1;
    hrec->keys = tmp;

    tmp = (char**) realloc(hrec->vals, sizeof(char*)*n);
    if (!tmp) return -1;
    hrec->vals = tmp;

    hrec->keys[hrec->nkeys] = strdup("IDX");
    if (!hrec->keys[hrec->nkeys]) return -1;

    kstring_t str = {0,0,0};
    if (kputw(idx, &str) < 0) {
        free(hrec->keys[hrec->nkeys]);
        return -1;
    }
    hrec->vals[hrec->nkeys] = str.s;
    hrec->nkeys = n;
    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x20, %rsp
movl %esi, %ebp
movq %rdi, %rbx
movslq 0x18(%rdi), %r12
movq 0x20(%rdi), %rdi
leaq 0x8(,%r12,8), %r15
movq %r15, %rsi
callq 0x4860
pushq $-0x1
popq %r14
testq %rax, %rax
je 0x22e9c
movq %rax, 0x20(%rbx)
movq 0x28(%rbx), %rdi
movq %r15, %rsi
callq 0x4860
testq %rax, %rax
je 0x22e9c
movq %rax, 0x28(%rbx)
leaq 0x5fc95(%rip), %rdi     # 0x82aca
callq 0x4930
movq 0x20(%rbx), %rcx
movslq 0x18(%rbx), %rdx
movq %rax, (%rcx,%rdx,8)
movq 0x20(%rbx), %rax
cmpq $0x0, (%rax,%rdx,8)
je 0x22e9c
xorps %xmm0, %xmm0
movq %rsp, %rsi
movaps %xmm0, (%rsi)
andq $0x0, 0x10(%rsi)
movl %ebp, %edi
callq 0x22eac
testl %eax, %eax
js 0x22e87
incq %r12
movq 0x10(%rsp), %rax
movq 0x28(%rbx), %rcx
movslq 0x18(%rbx), %rdx
movq %rax, (%rcx,%rdx,8)
movl %r12d, 0x18(%rbx)
xorl %r14d, %r14d
jmp 0x22e9c
movq 0x20(%rbx), %rax
movslq 0x18(%rbx), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x45c0
pushq $-0x1
popq %r14
movl %r14d, %eax
addq $0x20, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/vcf.c
// Function: bcf_hdr_update_hrec
int bcf_hdr_update_hrec(bcf_hdr_t *hdr, bcf_hrec_t *hrec, const bcf_hrec_t *tmp)
{
    assert( hrec->type==BCF_HL_GEN );
    int ret;
    khint_t k;
    bcf_hdr_aux_t *aux = get_hdr_aux(hdr);
    for (k=kh_begin(aux->gen); k<kh_end(aux->gen); k++)
    {
        if ( !kh_exist(aux->gen,k) ) continue;
        if ( hrec!=(bcf_hrec_t*)kh_val(aux->gen,k) ) continue;
        break;
    }
    assert( k<kh_end(aux->gen) );   // something went wrong, should never happen
    free((char*)kh_key(aux->gen,k));
    kh_del(hdict,aux->gen,k);
    kstring_t str = {0,0,0};
    if ( ksprintf(&str, "##%s=%s", tmp->key,tmp->value) < 0 )
    {
        free(str.s);
        return -1;
    }
    k = kh_put(hdict, aux->gen, str.s, &ret);
    if ( ret<0 )
    {
        free(str.s);
        return -1;
    }
    free(hrec->value);
    hrec->value = strdup(tmp->value);
    if ( !hrec->value ) return -1;
    kh_val(aux->gen,k) = hrec;

    if (!strcmp(hrec->key,"fileformat")) {
        //update version
        get_hdr_aux(hdr)->version = bcf_get_version(NULL, hrec->value);
    }
    return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
cmpl $0x5, (%rsi)
jne 0x2357f
movq %rdx, %r15
movq %rsi, %r14
movq %rdi, %rbx
movq 0x28(%rdi), %r13
movq 0x28(%r13), %rax
movl (%rax), %edx
xorl %esi, %esi
xorl %r12d, %r12d
cmpq %r12, %rdx
je 0x23560
movq 0x10(%rax), %rcx
movl %r12d, %edi
shrl $0x4, %edi
movl (%rcx,%rdi,4), %edi
movl %esi, %ecx
andb $0x1e, %cl
shrl %cl, %edi
testb $0x3, %dil
jne 0x2347f
movq 0x20(%rax), %rcx
cmpq %r14, (%rcx,%r12,8)
je 0x23487
incq %r12
addl $0x2, %esi
jmp 0x23452
movq 0x18(%rax), %rax
movq (%rax,%r12,8), %rdi
callq 0x45c0
movq 0x28(%r13), %rdi
movl %r12d, %esi
callq 0x2359e
leaq 0x10(%rsp), %rdi
andq $0x0, 0x10(%rdi)
xorps %xmm0, %xmm0
movaps %xmm0, (%rdi)
movq 0x8(%r15), %rdx
movq 0x10(%r15), %rcx
leaq 0x62fd3(%rip), %rsi     # 0x86492
xorl %eax, %eax
callq 0x69048
testl %eax, %eax
js 0x23540
movq 0x28(%r13), %rdi
movq 0x20(%rsp), %rsi
leaq 0xc(%rsp), %r12
movq %r12, %rdx
callq 0x235cf
cmpl $0x0, (%r12)
js 0x23540
movl %eax, %ebp
movq 0x10(%r14), %rdi
callq 0x45c0
movq 0x10(%r15), %rdi
callq 0x4930
movq %rax, 0x10(%r14)
testq %rax, %rax
je 0x2354a
movq 0x28(%r13), %rax
movq 0x20(%rax), %rax
movl %ebp, %ecx
movq %r14, (%rax,%rcx,8)
movq 0x8(%r14), %rdi
leaq 0x62f7d(%rip), %rsi     # 0x8649a
callq 0x46e0
xorl %r15d, %r15d
testl %eax, %eax
jne 0x2354e
movq 0x10(%r14), %rsi
xorl %r15d, %r15d
xorl %edi, %edi
callq 0x237b5
movq 0x28(%rbx), %rcx
movl %eax, 0x38(%rcx)
jmp 0x2354e
movq 0x20(%rsp), %rdi
callq 0x45c0
pushq $-0x1
popq %r15
movl %r15d, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x62f18(%rip), %rdi     # 0x8647f
leaq 0x62db5(%rip), %rsi     # 0x86323
leaq 0x62ec3(%rip), %rcx     # 0x86438
movl $0x429, %edx            # imm = 0x429
callq 0x42e0
leaq 0x62e9b(%rip), %rdi     # 0x86421
leaq 0x62d96(%rip), %rsi     # 0x86323
leaq 0x62ea4(%rip), %rcx     # 0x86438
movl $0x41f, %edx            # imm = 0x41F
callq 0x42e0
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/vcf.c
// Function: bcf_get_version
static int bcf_get_version(const bcf_hdr_t *hdr, const char *verstr)
{
    const char *version = NULL, vcf[] = "VCFv";
    char *major = NULL, *minor = NULL;
    int ver = -1;
    long tmp = 0;
    bcf_hdr_aux_t *aux = NULL;

    if (!hdr && !verstr) {  //invalid input
        goto fail;
    }

    if (hdr) {
        if ((aux = get_hdr_aux(hdr)) && aux->version != 0) {    //use cached version
            return aux->version;
        }
        //get from header
        version = bcf_hdr_get_version(hdr);
    } else {
        //get from version string
        version = verstr;
    }
    if (!(major = strstr(version, vcf))) {  //bad format
        goto fail;
    }
    major += sizeof(vcf) - 1;
    if (!(minor = strchr(major, '.'))) {    //bad format
        goto fail;
    }
    tmp = strtol(major, NULL, 10);
    if ((!tmp && errno == EINVAL) ||
        ((tmp == LONG_MIN || tmp == LONG_MAX) && errno == ERANGE)) {    //failed
        goto fail;
    }
    ver = tmp * 100 * 10000;
    tmp = strtol(++minor, NULL, 10);
    if ((!tmp && errno == EINVAL) ||
        ((tmp == LONG_MIN || tmp == LONG_MAX) && errno == ERANGE)) {    //failed
        goto fail;
    }
    ver += tmp * 1000;
    return ver;

fail:
    hts_log_warning("Couldn't get VCF version, considering as %d.%d",
        VCF_MAJOR_VER(VCF_DEF), VCF_MINOR_VER(VCF_DEF));
    return VCF_DEF;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rax
orq %rsi, %rax
je 0x238b1
testq %rdi, %rdi
je 0x237e7
movq 0x28(%rdi), %rax
testq %rax, %rax
je 0x237df
movl 0x38(%rax), %ebx
testl %ebx, %ebx
jne 0x238d5
callq 0x24f9e
movq %rax, %rsi
leaq 0x63a1a(%rip), %rax     # 0x87208
movq %rsi, %rdi
movq %rax, %rsi
callq 0x40d0
testq %rax, %rax
je 0x238b1
movq %rax, %rbx
addq $0x4, %rbx
pushq $0x2e
popq %rsi
movq %rbx, %rdi
callq 0x4180
testq %rax, %rax
je 0x238b1
movq %rax, %r14
movabsq $-0x7fffffffffffffff, %r15 # imm = 0x8000000000000001
pushq $0xa
popq %rdx
movq %rbx, %rdi
xorl %esi, %esi
callq 0x46f0
movq %rax, %rbx
testq %rax, %rax
je 0x23855
leaq (%rbx,%r15), %rax
cmpq $0x1, %rax
ja 0x2385f
callq 0x4050
cmpl $0x22, (%rax)
jne 0x2385f
jmp 0x238b1
callq 0x4050
cmpl $0x16, (%rax)
je 0x238b1
incq %r14
pushq $0xa
popq %rdx
movq %r14, %rdi
xorl %esi, %esi
callq 0x46f0
movq %rax, %r14
testq %rax, %rax
je 0x238a7
addq %r14, %r15
cmpq $0x1, %r15
ja 0x2388a
callq 0x4050
cmpl $0x22, (%rax)
je 0x238b1
imull $0x3e8, %r14d, %eax     # imm = 0x3E8
movabsq $0xf424000000000, %rcx  # imm = 0xF424000000000
imulq %rcx, %rbx
shrq $0x20, %rbx
addl %eax, %ebx
jmp 0x238d5
callq 0x4050
cmpl $0x16, (%rax)
jne 0x2388a
leaq 0x63955(%rip), %rsi     # 0x8720d
leaq 0x6395e(%rip), %rdx     # 0x8721d
pushq $0x3
popq %rdi
pushq $0x4
popq %rcx
pushq $0x2
popq %r8
xorl %eax, %eax
callq 0x8132
movl $0x3d10d0, %ebx         # imm = 0x3D10D0
movl %ebx, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/vcf.c
// Function: bcf_hdr_unregister_hrec
static void bcf_hdr_unregister_hrec(bcf_hdr_t *hdr, bcf_hrec_t *hrec)
{
    if (hrec->type == BCF_HL_FLT ||
        hrec->type == BCF_HL_INFO ||
        hrec->type == BCF_HL_FMT ||
        hrec->type == BCF_HL_CTG) {
        int id = bcf_hrec_find_key(hrec, "ID");
        if (id < 0 || !hrec->vals[id])
            return;
        vdict_t *dict = (hrec->type == BCF_HL_CTG
                         ? (vdict_t*)hdr->dict[BCF_DT_CTG]
                         : (vdict_t*)hdr->dict[BCF_DT_ID]);
        khint_t k = kh_get(vdict, dict, hrec->vals[id]);
        if (k != kh_end(dict))
            kh_val(dict, k).hrec[hrec->type==BCF_HL_CTG ? 0 : hrec->type] = NULL;
    }
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movl (%rsi), %ebp
cmpl $0x3, %ebp
ja 0x244f8
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x60829(%rip), %rsi     # 0x84cd5
movq %r14, %rdi
callq 0x22ef9
testl %eax, %eax
js 0x244f8
movq 0x28(%r14), %rcx
movl %eax, %eax
movq (%rcx,%rax,8), %rsi
testq %rsi, %rsi
je 0x244f8
xorl %eax, %eax
cmpl $0x3, %ebp
sete %al
movq 0x28(%rbx,%rax,8), %rbx
movq %rbx, %rdi
callq 0x246ef
cmpl (%rbx), %eax
je 0x244f8
xorl %ecx, %ecx
cmpl $0x3, %ebp
cmovnel %ebp, %ecx
movl %eax, %eax
imulq $0x38, %rax, %rax
addq 0x20(%rbx), %rax
andq $0x0, 0x18(%rax,%rcx,8)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/vcf.c
// Function: bcf_hdr_check_sanity
void bcf_hdr_check_sanity(bcf_hdr_t *hdr)
{
    static int PL_warned = 0, GL_warned = 0;

    if ( !PL_warned )
    {
        int id = bcf_hdr_id2int(hdr, BCF_DT_ID, "PL");
        if ( bcf_hdr_idinfo_exists(hdr,BCF_HL_FMT,id) && bcf_hdr_id2length(hdr,BCF_HL_FMT,id)!=BCF_VL_G )
        {
            hts_log_warning("PL should be declared as Number=G");
            PL_warned = 1;
        }
    }
    if ( !GL_warned )
    {
        int id = bcf_hdr_id2int(hdr, BCF_DT_ID, "GL");
        if ( bcf_hdr_idinfo_exists(hdr,BCF_HL_FMT,id) && bcf_hdr_id2length(hdr,BCF_HL_FMT,id)!=BCF_VL_G )
        {
            hts_log_warning("GL should be declared as Number=G");
            GL_warned = 1;
        }
    }
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
cmpb $0x0, 0x8b645(%rip)     # 0xafe00
jne 0x24827
leaq 0x61cfb(%rip), %rdx     # 0x864bf
movq %rbx, %rdi
xorl %esi, %esi
callq 0x2489c
testl %eax, %eax
js 0x24827
cmpl (%rbx), %eax
jge 0x24827
movq 0x10(%rbx), %rcx
movl %eax, %eax
shlq $0x4, %rax
movq 0x8(%rcx,%rax), %rax
testq %rax, %rax
je 0x24827
movl 0x10(%rax), %eax
movl %eax, %ecx
notl %ecx
testb $0xf, %cl
sete %cl
andl $0xf00, %eax            # imm = 0xF00
cmpl $0x300, %eax            # imm = 0x300
sete %al
orb %cl, %al
jne 0x24827
leaq 0x61cb3(%rip), %rsi     # 0x864c2
leaq 0x61cc1(%rip), %rdx     # 0x864d7
pushq $0x3
popq %rdi
xorl %eax, %eax
callq 0x8132
movb $0x1, 0x8b5d9(%rip)     # 0xafe00
cmpb $0x0, 0x8b5d6(%rip)     # 0xafe04
jne 0x2489a
leaq 0x61cc2(%rip), %rdx     # 0x864f9
movq %rbx, %rdi
xorl %esi, %esi
callq 0x2489c
testl %eax, %eax
js 0x2489a
cmpl (%rbx), %eax
jge 0x2489a
movq 0x10(%rbx), %rcx
movl %eax, %eax
shlq $0x4, %rax
movq 0x8(%rcx,%rax), %rax
testq %rax, %rax
je 0x2489a
movl 0x10(%rax), %eax
movl %eax, %ecx
notl %ecx
testb $0xf, %cl
sete %cl
andl $0xf00, %eax            # imm = 0xF00
cmpl $0x300, %eax            # imm = 0x300
sete %al
orb %cl, %al
jne 0x2489a
leaq 0x61c40(%rip), %rsi     # 0x864c2
leaq 0x61c73(%rip), %rdx     # 0x864fc
pushq $0x3
popq %rdi
xorl %eax, %eax
callq 0x8132
movb $0x1, 0x8b56a(%rip)     # 0xafe04
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/vcf.c
// Function: bcf_hdr_id2int
int bcf_hdr_id2int(const bcf_hdr_t *h, int which, const char *id)
{
    khint_t k;
    vdict_t *d = (vdict_t*)h->dict[which];
    k = kh_get(vdict, d, id);
    return k == kh_end(d)? -1 : kh_val(d, k).id;
}

// Assembly:
pushq %rbx
movslq %esi, %rax
movq 0x28(%rdi,%rax,8), %rbx
movq %rbx, %rdi
movq %rdx, %rsi
callq 0x246ef
cmpl (%rbx), %eax
jne 0x248b9
pushq $-0x1
popq %rax
jmp 0x248c7
movq 0x20(%rbx), %rcx
movl %eax, %eax
imulq $0x38, %rax, %rax
movl 0x30(%rcx,%rax), %eax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/vcf.c
// Function: bcf_hdr_remove_from_hdict
static void bcf_hdr_remove_from_hdict(bcf_hdr_t *hdr, bcf_hrec_t *hrec)
{
    kstring_t str = KS_INITIALIZE;
    bcf_hdr_aux_t *aux = get_hdr_aux(hdr);
    khint_t k;
    int id;

    switch (hrec->type) {
    case BCF_HL_GEN:
        if (ksprintf(&str, "##%s=%s", hrec->key,hrec->value) < 0)
            str.l = 0;
        break;
    case BCF_HL_STR:
        id = bcf_hrec_find_key(hrec, "ID");
        if (id < 0)
            return;
        if (!hrec->vals[id] ||
            ksprintf(&str, "##%s=<ID=%s>", hrec->key, hrec->vals[id]) < 0)
            str.l = 0;
        break;
    default:
        return;
    }
    if (str.l) {
        k = kh_get(hdict, aux->gen, str.s);
    } else {
        // Couldn't get a string for some reason, so try the hard way...
        for (k = kh_begin(aux->gen); k < kh_end(aux->gen); k++) {
            if (kh_exist(aux->gen, k) && kh_val(aux->gen, k) == hrec)
                break;
        }
    }
    if (k != kh_end(aux->gen) && kh_val(aux->gen, k) == hrec) {
        kh_val(aux->gen, k) = NULL;
        free((char *) kh_key(aux->gen, k));
        kh_key(aux->gen, k) = NULL;
        kh_del(hdict, aux->gen, k);
    }
    free(str.s);
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rsi, %rbx
xorps %xmm0, %xmm0
andq $0x0, 0x10(%rsp)
movaps %xmm0, (%rsp)
movq 0x28(%rdi), %r12
movl (%rsi), %eax
cmpl $0x4, %eax
je 0x24d7c
cmpl $0x5, %eax
jne 0x24e2c
movq 0x8(%rbx), %rdx
movq 0x10(%rbx), %rcx
leaq 0x61718(%rip), %rsi     # 0x86492
jmp 0x24db1
leaq 0x5ff52(%rip), %rsi     # 0x84cd5
movq %rbx, %rdi
callq 0x22ef9
testl %eax, %eax
js 0x24e2c
movq 0x28(%rbx), %rcx
movl %eax, %eax
movq (%rcx,%rax,8), %rcx
testq %rcx, %rcx
je 0x24e38
movq 0x8(%rbx), %rdx
leaq 0x616f4(%rip), %rsi     # 0x864a5
movq %rsp, %rdi
xorl %eax, %eax
callq 0x69048
testl %eax, %eax
js 0x24e38
cmpq $0x0, (%rsp)
je 0x24e3d
movq 0x28(%r12), %r15
movq 0x10(%rsp), %rsi
movq %r15, %rdi
callq 0x243d3
movl %eax, %r14d
movl (%r15), %eax
cmpl %eax, %r14d
je 0x24e22
movq 0x20(%r15), %rax
movl %r14d, %r15d
cmpq %rbx, (%rax,%r15,8)
jne 0x24e22
andq $0x0, (%rax,%r15,8)
movq 0x28(%r12), %rax
movq 0x18(%rax), %rax
movq (%rax,%r15,8), %rdi
callq 0x45c0
movq 0x28(%r12), %rax
movq 0x18(%rax), %rax
andq $0x0, (%rax,%r15,8)
movq 0x28(%r12), %rdi
movl %r14d, %esi
callq 0x2359e
movq 0x10(%rsp), %rdi
callq 0x45c0
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq
andq $0x0, (%rsp)
movq 0x28(%r12), %r15
movl (%r15), %eax
xorl %edx, %edx
xorl %r14d, %r14d
cmpq %r14, %rax
je 0x24e22
movq 0x10(%r15), %rcx
movl %r14d, %esi
shrl $0x4, %esi
movl (%rcx,%rsi,4), %esi
movl %edx, %ecx
andb $0x1e, %cl
shrl %cl, %esi
testb $0x3, %sil
jne 0x24e77
movq 0x20(%r15), %rcx
cmpq %rbx, (%rcx,%r14,8)
je 0x24dde
incq %r14
addl $0x2, %edx
jmp 0x24e4a
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/vcf.c
// Function: bcf_hdr_printf
int bcf_hdr_printf(bcf_hdr_t *hdr, const char *fmt, ...)
{
    char tmp[256], *line = tmp;
    va_list ap;
    va_start(ap, fmt);
    int n = vsnprintf(line, sizeof(tmp), fmt, ap);
    va_end(ap);

    if (n >= sizeof(tmp)) {
        n++; // For trailing NUL
        line = (char*)malloc(n);
        if (!line)
            return -1;

        va_start(ap, fmt);
        vsnprintf(line, n, fmt, ap);
        va_end(ap);
    }

    int ret = bcf_hdr_append(hdr, line);

    if (line != tmp) free(line);
    return ret;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x1d8, %rsp            # imm = 0x1D8
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x20(%rsp), %rbp
movq %rdx, 0x10(%rbp)
movq %rcx, 0x18(%rbp)
movq %r8, 0x20(%rbp)
movq %r9, 0x28(%rbp)
testb %al, %al
je 0x24ee6
movaps %xmm0, 0x50(%rsp)
movaps %xmm1, 0x60(%rsp)
movaps %xmm2, 0x70(%rsp)
movaps %xmm3, 0x80(%rsp)
movaps %xmm4, 0x90(%rsp)
movaps %xmm5, 0xa0(%rsp)
movaps %xmm6, 0xb0(%rsp)
movaps %xmm7, 0xc0(%rsp)
movq %rsp, %rcx
movq %rbp, 0x10(%rcx)
leaq 0x210(%rsp), %rax
movq %rax, 0x8(%rcx)
movabsq $0x3000000010, %rax     # imm = 0x3000000010
movq %rax, (%rcx)
leaq 0xd0(%rsp), %r15
movl $0x100, %esi            # imm = 0x100
movq %r15, %rdi
movq %r14, %rdx
callq 0x42c0
movq %r15, %r12
cmpl $0x100, %eax            # imm = 0x100
jb 0x24f6b
incl %eax
movslq %eax, %r13
movq %r13, %rdi
callq 0x46a0
testq %rax, %rax
je 0x24f87
movq %rax, %r12
movq %rsp, %rcx
movq %rbp, 0x10(%rcx)
leaq 0x210(%rsp), %rax
movq %rax, 0x8(%rcx)
movabsq $0x3000000010, %rax     # imm = 0x3000000010
movq %rax, (%rcx)
movq %r12, %rdi
movq %r13, %rsi
movq %r14, %rdx
callq 0x42c0
movq %rbx, %rdi
movq %r12, %rsi
callq 0x24ae2
movl %eax, %ebx
cmpq %r15, %r12
je 0x24f8a
movq %r12, %rdi
callq 0x45c0
jmp 0x24f8a
pushq $-0x1
popq %rbx
movl %ebx, %eax
addq $0x1d8, %rsp            # imm = 0x1D8
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/vcf.c
// Function: bcf_hdr_get_version
const char *bcf_hdr_get_version(const bcf_hdr_t *hdr)
{
    bcf_hrec_t *hrec = bcf_hdr_get_hrec(hdr, BCF_HL_GEN, "fileformat", NULL, NULL);
    if ( !hrec )
    {
        hts_log_warning("No version string found, assuming VCFv4.2");
        return "VCFv4.2";
    }
    return hrec->value;
}

// Assembly:
pushq %rax
leaq 0x614f4(%rip), %rdx     # 0x8649a
pushq $0x5
popq %rsi
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x244fd
testq %rax, %rax
je 0x24fbe
movq 0x10(%rax), %rax
jmp 0x24fdd
leaq 0x6167b(%rip), %rsi     # 0x86640
leaq 0x61688(%rip), %rdx     # 0x86654
pushq $0x3
popq %rdi
xorl %eax, %eax
callq 0x8132
leaq 0x61699(%rip), %rax     # 0x86676
popq %rcx
retq
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/vcf.c
// Function: bcf_hdr_set_version
int bcf_hdr_set_version(bcf_hdr_t *hdr, const char *version)
{
    bcf_hrec_t *hrec = bcf_hdr_get_hrec(hdr, BCF_HL_GEN, "fileformat", NULL, NULL);
    if ( !hrec )
    {
        int len;
        kstring_t str = {0,0,0};
        if ( ksprintf(&str,"##fileformat=%s", version) < 0 ) return -1;
        hrec = bcf_hdr_parse_line(hdr, str.s, &len);
        free(str.s);

        get_hdr_aux(hdr)->version = bcf_get_version(NULL, hrec->value);
    }
    else
    {
        bcf_hrec_t *tmp = bcf_hrec_dup(hrec);
        if ( !tmp ) return -1;
        free(tmp->value);
        tmp->value = strdup(version);
        if ( !tmp->value ) return -1;
        bcf_hdr_update_hrec(hdr, hrec, tmp);
        bcf_hrec_destroy(tmp);
    }
    hdr->dirty = 1;
    //TODO rlen may change, deal with it
    return 0; // FIXME: check for errs in this function (return < 0 if so)
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x30, %rsp
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x614a2(%rip), %rdx     # 0x8649a
pushq $0x5
popq %rsi
xorl %ecx, %ecx
xorl %r8d, %r8d
callq 0x244fd
testq %rax, %rax
je 0x25057
movq %rax, %r15
movq %rax, %rdi
callq 0x228bb
pushq $-0x1
popq %rbp
testq %rax, %rax
je 0x250b8
movq %rax, %r12
movq 0x10(%rax), %rdi
callq 0x45c0
movq %r14, %rdi
callq 0x4930
movq %rax, 0x10(%r12)
testq %rax, %rax
je 0x250b8
movq %rbx, %rdi
movq %r15, %rsi
movq %r12, %rdx
callq 0x23423
movq %r12, %rdi
callq 0x22854
jmp 0x250aa
xorps %xmm0, %xmm0
leaq 0x10(%rsp), %rdi
movaps %xmm0, (%rdi)
andq $0x0, 0x10(%rdi)
leaq 0x61610(%rip), %rsi     # 0x8667e
movq %r14, %rdx
xorl %eax, %eax
callq 0x69048
testl %eax, %eax
js 0x250b5
movq 0x20(%rsp), %rsi
leaq 0xc(%rsp), %rdx
callq 0x22f44
movq %rax, %r14
movq 0x20(%rsp), %rdi
callq 0x45c0
movq 0x10(%r14), %rsi
xorl %edi, %edi
callq 0x237b5
movq 0x28(%rbx), %rcx
movl %eax, 0x38(%rcx)
movl $0x1, 0x54(%rbx)
xorl %ebp, %ebp
jmp 0x250b8
pushq $-0x1
popq %rbp
movl %ebp, %eax
addq $0x30, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O2/samtools[P]htslib/vcf.c
// Function: bcf_hdr_init
bcf_hdr_t *bcf_hdr_init(const char *mode)
{
    int i;
    bcf_hdr_t *h;
    h = (bcf_hdr_t*)calloc(1, sizeof(bcf_hdr_t));
    if (!h) return NULL;
    for (i = 0; i < 3; ++i) {
        if ((h->dict[i] = kh_init(vdict)) == NULL) goto fail;
        // Supersize the hash to make collisions very unlikely
        static int dsize[3] = {16384,16384,2048}; // info, contig, format
        if (kh_resize(vdict, h->dict[i], dsize[i]) < 0) goto fail;
    }

    bcf_hdr_aux_t *aux = (bcf_hdr_aux_t*)calloc(1,sizeof(bcf_hdr_aux_t));
    if ( !aux ) goto fail;
    if ( (aux->gen = kh_init(hdict))==NULL ) { free(aux); goto fail; }
    aux->key_len = NULL;
    aux->dict = *((vdict_t*)h->dict[0]);
    aux->version = 0;
    free(h->dict[0]);
    h->dict[0] = aux;

    if ( strchr(mode,'w') )
    {
        bcf_hdr_append(h, "##fileformat=VCFv4.2");
        // The filter PASS must appear first in the dictionary
        bcf_hdr_append(h, "##FILTER=<ID=PASS,Description=\"All filters passed\">");
        aux->version = VCF_DEF;
    }
    return h;

 fail:
    for (i = 0; i < 3; ++i)
        kh_destroy(vdict, h->dict[i]);
    free(h);
    return NULL;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r14
pushq $0x1
popq %rdi
movl $0xa8, %esi
callq 0x42f0
testq %rax, %rax
je 0x251d3
movq %rax, %rbx
xorl %r15d, %r15d
leaq 0x60ba7(%rip), %r12     # 0x85c9c
cmpq $0xc, %r15
je 0x25127
callq 0x251e4
movq %rax, 0x28(%rbx,%r15,2)
testq %rax, %rax
je 0x251b3
movl (%r15,%r12), %esi
movq %rax, %rdi
callq 0x251ef
addq $0x4, %r15
testl %eax, %eax
jns 0x250f5
jmp 0x251b3
pushq $0x1
popq %rdi
pushq $0x40
popq %rsi
callq 0x42f0
testq %rax, %rax
je 0x251b3
movq %rax, %r15
pushq $0x1
popq %rdi
pushq $0x28
popq %rsi
callq 0x42f0
movq %rax, 0x28(%r15)
testq %rax, %rax
je 0x251ab
movq 0x28(%rbx), %rdi
movq 0x20(%rdi), %rax
movq %rax, 0x20(%r15)
movups (%rdi), %xmm0
movups 0x10(%rdi), %xmm1
movups %xmm1, 0x10(%r15)
movups %xmm0, (%r15)
callq 0x45c0
movq %r15, 0x28(%rbx)
pushq $0x77
popq %rsi
movq %r14, %rdi
callq 0x4180
testq %rax, %rax
je 0x251d5
leaq 0x61504(%rip), %rsi     # 0x8668e
movq %rbx, %rdi
callq 0x24ae2
leaq 0x613d8(%rip), %rsi     # 0x86571
movq %rbx, %rdi
callq 0x24ae2
movl $0x3d10d0, 0x38(%r15)   # imm = 0x3D10D0
jmp 0x251d5
movq %r15, %rdi
callq 0x45c0
pushq $0x5
popq %r14
cmpq $0x8, %r14
je 0x251cb
movq (%rbx,%r14,8), %rdi
callq 0x25526
incq %r14
jmp 0x251b7
movq %rbx, %rdi
callq 0x45c0
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
retq