LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/Tarsnap[P]kivaloo/mux/dispatch.c
// Function: callback_gotrequests
static int
callback_gotrequests(void * cookie, int status)
{
	struct sock_active * S = cookie;
	struct dispatch_state * dstate = S->dstate;
	struct wire_packet P;
	struct forwardee * F;

	/* We're not waiting for a packet to be available any more. */
	S->read_cookie = NULL;

	/* If the wait failed, the connection is dying. */
	if (status)
		goto fail;

	/* Handle packets until there are no more or we encounter an error. */
	do {
		/* Grab a packet. */
		if (wire_readpacket_peek(S->readq, &P))
			goto fail;

		/* Exit the loop if no packet is available. */
		if (P.buf == NULL)
			break;

		/* Bake a cookie. */
		if ((F = mpool_forwardee_malloc()) == NULL)
			goto err0;
		F->ID = P.ID;
		F->conn = S;

		/* Send the request to the target. */
		if (wire_requestqueue_add(dstate->Q, P.buf, P.len,
		    callback_gotresponse, F))
			goto err1;

		/* We have an additional outstanding request. */
		S->nrequests++;

		/* Consume the packet. */
		wire_readpacket_consume(S->readq, &P);
	} while (1);

	/* Wait for more packets to arrive. */
	if (readreq(S))
		goto err0;

	/* Success! */
	return (0);

fail:
	/* If we have no requests in progress, drop the connection. */
	if (S->nrequests == 0) {
		if (dropconn(S))
			goto err0;
	}

	/* Return success; the connection will be reaped later. */
	return (0);

err1:
	free(F);
err0:
	/* Failure! */
	return (-1);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rdi, %rbx
movq (%rdi), %r13
movq $0x0, 0x30(%rdi)
testl %esi, %esi
jne 0x37df
movq 0x20(%rbx), %rdi
movq %rsp, %rsi
callq 0x8c44
testl %eax, %eax
je 0x380a
xorl %ebp, %ebp
cmpq $0x0, 0x38(%rbx)
jne 0x37f9
movq %rbx, %rdi
callq 0x3c5e
testl %eax, %eax
je 0x37f9
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0xee(%rip), %r14        # 0x38ff
movq %rsp, %r15
cmpq $0x0, 0x10(%rsp)
je 0x38db
incq 0xd9f1(%rip)            # 0x11218
movq 0xd9d2(%rip), %rax      # 0x11200
testq %rax, %rax
je 0x384c
movq 0xd9d6(%rip), %rcx      # 0x11210
leaq -0x1(%rax), %rdx
movq %rdx, 0xd9bb(%rip)      # 0x11200
movq -0x8(%rcx,%rax,8), %r12
jmp 0x387f
incq 0xd9cd(%rip)            # 0x11220
cmpl $0x0, 0xd9ce(%rip)      # 0x11228
jne 0x3872
movq 0xd9d5(%rip), %rdi      # 0x11238
callq 0xa9d0
movl $0x1, 0xd9b6(%rip)      # 0x11228
movl $0x10, %edi
callq 0x2270
movq %rax, %r12
testq %r12, %r12
je 0x37f4
movq (%rsp), %rax
movq %rax, 0x8(%r12)
movq %rbx, (%r12)
movq 0x28(%r13), %rdi
movq 0x8(%rsp), %rdx
movq 0x10(%rsp), %rsi
movq %r14, %rcx
movq %r12, %r8
callq 0x9829
testl %eax, %eax
jne 0x38f2
incq 0x38(%rbx)
movq 0x20(%rbx), %rdi
movq %r15, %rsi
callq 0x9101
movq 0x20(%rbx), %rdi
movq %r15, %rsi
callq 0x8c44
testl %eax, %eax
je 0x3814
jmp 0x37df
movq %rbx, %rdi
callq 0x372c
testl %eax, %eax
jne 0x37f4
xorl %ebp, %ebp
jmp 0x37f9
movq %r12, %rdi
callq 0x2040
jmp 0x37f4
// File: /workspace/github_c_makefile_star2_O3/Tarsnap[P]kivaloo/mux/dispatch.c
// Function: dropconn
static int
dropconn(struct sock_active * S)
{
	struct dispatch_state * dstate = S->dstate;

	/* Sanity check. */
	assert(S->read_cookie == NULL);
	assert(S->nrequests == 0);

	/* Detach from the dispatcher. */
	if (S->prev == NULL)
		dstate->sock_active = S->next;
	else
		S->prev->next = S->next;
	if (S->next != NULL)
		S->next->prev = S->prev;
	if (dstate->nsock_active-- == dstate->nsock_active_max) {
		if (accept_start(dstate))
			goto err2;
	}

	/* Free the buffered reader. */
	netbuf_read_free(S->readq);

	/* Free the buffered writer. */
	netbuf_write_free(S->writeq);

	/* Close the socket. */
	while (close(S->s)) {
		if (errno == EINTR)
			continue;
		warnp("close");
		goto err1;
	}

	/* Free the connection state. */
	free(S);

	/* Success! */
	return (0);

err2:
	netbuf_read_free(S->readq);
	netbuf_write_free(S->writeq);
	if (close(S->s))
		warnp("close");
err1:
	free(S);

	/* Failure! */
	return (-1);
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
cmpq $0x0, 0x30(%rdi)
jne 0x3d82
movq %rdi, %rbx
cmpq $0x0, 0x38(%rdi)
jne 0x3da1
movq (%rbx), %rdi
movq 0x8(%rbx), %rax
movq 0x10(%rbx), %rcx
leaq 0x8(%rcx), %rdx
leaq 0x10(%rdi), %rsi
testq %rcx, %rcx
cmoveq %rsi, %rdx
movq %rax, (%rdx)
testq %rax, %rax
je 0x3ca1
movq %rcx, 0x10(%rax)
movq 0x18(%rdi), %rax
leaq -0x1(%rax), %rcx
movq %rcx, 0x18(%rdi)
cmpq 0x20(%rdi), %rax
jne 0x3d0b
callq 0x33c2
testl %eax, %eax
je 0x3d0b
movq 0x20(%rbx), %rdi
callq 0x591e
movq 0x28(%rbx), %rdi
callq 0x5ce7
movl 0x18(%rbx), %edi
callq 0x21c0
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
testl %eax, %eax
je 0x3d63
callq 0x20a0
cmpl $0x0, (%rax)
je 0x3d72
movq %rax, %r14
leaq 0x7f41(%rip), %rdi      # 0xbc3c
xorl %eax, %eax
callq 0x8a00
movl $0x0, (%r14)
jmp 0x3d63
movq 0x20(%rbx), %rdi
callq 0x591e
movq 0x28(%rbx), %rdi
callq 0x5ce7
movl 0x18(%rbx), %edi
callq 0x21c0
testl %eax, %eax
je 0x3d4c
callq 0x20a0
movq %rax, %r14
movl (%rax), %eax
cmpl $0x4, %eax
je 0x3d1d
leaq 0x7efd(%rip), %rdi      # 0xbc3c
testl %eax, %eax
jne 0x3d50
xorl %eax, %eax
callq 0x8b1f
jmp 0x3d5e
xorl %ebp, %ebp
jmp 0x3d63
xorl %eax, %eax
callq 0x8a00
movl $0x0, (%r14)
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movq %rbx, %rdi
callq 0x2040
movl %ebp, %eax
popq %rbx
popq %r14
popq %rbp
retq
leaq 0x7ec3(%rip), %rdi      # 0xbc3c
xorl %eax, %eax
callq 0x8b1f
jmp 0x3d63
leaq 0x75db(%rip), %rdi      # 0xb364
leaq 0x74c0(%rip), %rsi      # 0xb250
leaq 0x7686(%rip), %rcx      # 0xb41d
movl $0x195, %edx            # imm = 0x195
callq 0x21a0
leaq 0x7698(%rip), %rdi      # 0xb440
leaq 0x74a1(%rip), %rsi      # 0xb250
leaq 0x7667(%rip), %rcx      # 0xb41d
movl $0x196, %edx            # imm = 0x196
callq 0x21a0
// File: /workspace/github_c_makefile_star2_O3/carlitosmarin[P]Sistema-Ficheros-SOII/escribir.c
// Function: main
int main (int argc, char **argv) {
	if (argc != 4) {
		printf("Número de parametros incorrectos\n");
		return -1;
	}

	char *camino = argv[2];
    if(camino[strlen(camino)-1] == '/'){
        printf("ERROR: ( %s ) no es un fichero.\n",camino);
        return -1;
    }

	bmount(argv[1]);
	int offset = atoi(argv[3]);

    int bytes = 0;
    char buffer[1000];
    strcpy (buffer, "blablablablablablablablablablabla...\n");

    int nin = 0; //= reservar_inodo ('f', 6);

    int n = strlen(buffer);
    int m = 70;
    int i, offsetActual;
    int er;

   	for(i = 0, offsetActual = offset ; i < m; i++, offsetActual += n){
   		er = mi_write(camino,&buffer,offsetActual,n);
    	if(er < 0) {
            bumount();
    		return 0;
    	}
        bytes += er;
	}

	bumount();
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x3f0, %rsp            # imm = 0x3F0
cmpl $0x4, %edi
jne 0x3d49
movq %rsi, %r14
movq 0x10(%rsi), %rbx
movq %rbx, %rdi
callq 0x1080
cmpb $0x2f, -0x1(%rbx,%rax)
jne 0x3d5c
leaq 0x7eb(%rip), %rdi       # 0x4528
movq %rbx, %rsi
xorl %eax, %eax
callq 0x1090
jmp 0x3d55
leaq 0x81f(%rip), %rdi       # 0x456f
callq 0x1060
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
jmp 0x3dce
movq 0x8(%r14), %rdi
callq 0x128c
movq 0x18(%r14), %rdi
callq 0x1150
movl %eax, %ebp
movups 0x7e2(%rip), %xmm0      # 0x4559
movq %rsp, %r14
movaps %xmm0, 0x10(%r14)
movups 0x7c3(%rip), %xmm0      # 0x4549
movaps %xmm0, (%r14)
movabsq $0xa2e2e2e616c62, %rax  # imm = 0xA2E2E2E616C62
movq %rax, 0x1e(%r14)
movq %r14, %rdi
callq 0x1080
movq %rax, %r15
movl $0x46, %r12d
movq %rbx, %rdi
movq %r14, %rsi
movl %ebp, %edx
movl %r15d, %ecx
callq 0x3b8a
testl %eax, %eax
js 0x3dc5
addl %r15d, %ebp
decl %r12d
jne 0x3da9
xorl %ebx, %ebx
xorl %eax, %eax
callq 0x12ca
movl %ebx, %eax
addq $0x3f0, %rsp            # imm = 0x3F0
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/USArmyResearchLab[P]ARL_OpenSHMEM/src/autogen/shmem_int_atomic_compare_swap.c
// Function: shmem_int_atomic_compare_swap
int shmem_int_atomic_compare_swap( int* ptr, int cond, int val, int pe)
{
	int* remote_ptr = (int*)shmem_ptr((void*)ptr, pe ); 
	long* x = (long*)shmem_ptr((void*)&__shmem.lock_atomic_int, pe);
	__set_spin_lock(x);
	int r = *remote_ptr;
	if (r == cond) *remote_ptr = val;
	__clear_spin_lock(x);
	return r;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
movl %ecx, %ebp
movl %edx, %ebx
movl %esi, %r12d
movl %ecx, %esi
callq 0x1c18
movq %rax, %r14
leaq 0x31d0(%rip), %rdi      # 0x61f0
addq $0x10, %rdi
movl %ebp, %esi
callq 0x1c18
movq %rax, %r15
movq %rax, %rdi
callq 0x32f3
movl (%r14), %ebp
cmpl %r12d, %ebp
jne 0x3041
movl %ebx, (%r14)
movq %r15, %rdi
callq 0x32e4
movl %ebp, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/mohamedamjad[P]UBLOXlib/src/gnuplot_i.c
// Function: gnuplot_close
void gnuplot_close(gnuplot_ctrl * handle)
{
    int     i ;

    if (pclose(handle->gnucmd) == -1) {
        fprintf(stderr, "problem closing communication to gnuplot\n") ;
        return ;
    }
    if (handle->ntmp) {
        for (i=0 ; i<handle->ntmp ; i++) {
            remove(handle->tmp_filename_tbl[i]) ;
            free(handle->tmp_filename_tbl[i]);
            handle->tmp_filename_tbl[i] = NULL;

        }
    }
    free(handle) ;
    return ;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq (%rdi), %rdi
callq 0x10d0
cmpl $-0x1, %eax
je 0x203e
cmpl $0x0, 0x230(%rbx)
jle 0x2032
xorl %r14d, %r14d
movq 0x30(%rbx,%r14,8), %rdi
callq 0x1060
movq 0x30(%rbx,%r14,8), %rdi
callq 0x1040
movq $0x0, 0x30(%rbx,%r14,8)
incq %r14
movslq 0x230(%rbx), %rax
cmpq %rax, %r14
jl 0x2006
movq %rbx, %rdi
popq %rbx
popq %r14
popq %rbp
jmp 0x1040
callq 0x12db
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/mohamedamjad[P]UBLOXlib/src/gnuplot_i.c
// Function: gnuplot_resetplot
void gnuplot_resetplot(gnuplot_ctrl * h)
{
    int     i ;
    if (h->ntmp) {
        for (i=0 ; i<h->ntmp ; i++) {
            remove(h->tmp_filename_tbl[i]) ;
            free(h->tmp_filename_tbl[i]);
            h->tmp_filename_tbl[i] = NULL;

        }
    }
    h->ntmp = 0 ;
    h->nplots = 0 ;
    return ;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r14
pushq %rbx
movq %rdi, %rbx
cmpl $0x0, 0x230(%rdi)
jle 0x214c
xorl %r14d, %r14d
movq 0x30(%rbx,%r14,8), %rdi
callq 0x1060
movq 0x30(%rbx,%r14,8), %rdi
callq 0x1040
movq $0x0, 0x30(%rbx,%r14,8)
incq %r14
movslq 0x230(%rbx), %rax
cmpq %rax, %r14
jl 0x2120
xorl %eax, %eax
movl %eax, 0x230(%rbx)
movl %eax, 0x8(%rbx)
popq %rbx
popq %r14
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/mohamedamjad[P]UBLOXlib/src/gnuplot_i.c
// Function: gnuplot_plot_x
void gnuplot_plot_x(
    gnuplot_ctrl    *   handle,
    double          *   d,
    int                 n,
    char            *   title
)
{
    int     i ;
    FILE*   tmpfd ;
    char const * tmpfname;

    if (handle==NULL || d==NULL || (n<1)) return ;

    /* Open temporary file for output   */
    tmpfname = gnuplot_tmpfile(handle);
    tmpfd = fopen(tmpfname, "w");

    if (tmpfd == NULL) {
        fprintf(stderr,"cannot create temporary file: exiting plot") ;
        return ;
    }

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

    gnuplot_plot_atmpfile(handle,tmpfname,title);
    return ;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movq %rcx, %r14
testq %rdi, %rdi
sete %al
testq %rsi, %rsi
sete %cl
orb %al, %cl
testl %edx, %edx
setle %al
orb %cl, %al
jne 0x2237
movl %edx, %r13d
movq %rsi, %r12
movq %rdi, %rbx
callq 0x224d
leaq 0x12ab(%rip), %rsi      # 0x344b
movq %rax, -0x40(%rbp)
movq %rax, %rdi
callq 0x11b0
testq %rax, %rax
je 0x2246
movq %rax, %r15
movq %r14, -0x30(%rbp)
movq %rbx, -0x38(%rbp)
movl %r13d, %r14d
xorl %ebx, %ebx
leaq 0x13f9(%rip), %r13      # 0x35c5
movsd (%r12,%rbx,8), %xmm0
movq %r15, %rdi
movq %r13, %rsi
movb $0x1, %al
callq 0x1140
incq %rbx
cmpq %rbx, %r14
jne 0x21cc
movq %r15, %rdi
callq 0x10a0
movq -0x38(%rbp), %rbx
cmpl $0x0, 0x8(%rbx)
leaq 0x1059(%rip), %rax      # 0x3257
leaq 0x135c(%rip), %rdx      # 0x3561
cmovgq %rax, %rdx
movq -0x30(%rbp), %rax
testq %rax, %rax
leaq 0x135c(%rip), %r8       # 0x3573
cmovneq %rax, %r8
leaq 0xc(%rbx), %r9
leaq 0x1480(%rip), %rsi      # 0x36a6
movq %rbx, %rdi
movq -0x40(%rbp), %rcx
xorl %eax, %eax
callq 0x2048
incl 0x8(%rbx)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x130a
jmp 0x2237
// File: /workspace/github_c_makefile_star2_O3/mohamedamjad[P]UBLOXlib/src/gnuplot_i.c
// Function: gnuplot_plot_atmpfile
void gnuplot_plot_atmpfile(gnuplot_ctrl * handle, char const* tmp_filename, char const* title)
{
    char const *    cmd    = (handle->nplots > 0) ? "replot" : "plot";
    title                  = (title == NULL)      ? "(none)" : title;
    gnuplot_cmd(handle, "%s \"%s\" title \"%s\" with %s", cmd, tmp_filename,
                  title, handle->pstyle) ;
    handle->nplots++ ;
    return ;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %rbx
pushq %rax
movq %rsi, %rcx
movq %rdi, %rbx
cmpl $0x0, 0x8(%rdi)
leaq 0xf5c(%rip), %rsi       # 0x3257
leaq 0x125f(%rip), %rax      # 0x3561
cmovgq %rsi, %rax
testq %rdx, %rdx
leaq 0x1263(%rip), %r8       # 0x3573
cmovneq %rdx, %r8
leaq 0xc(%rdi), %r9
leaq 0x1387(%rip), %rsi      # 0x36a6
movq %rax, %rdx
xorl %eax, %eax
callq 0x2048
incl 0x8(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/mohamedamjad[P]UBLOXlib/src/gnuplot_i.c
// Function: gnuplot_plot_xy
void gnuplot_plot_xy(
    gnuplot_ctrl    *   handle,
    double          *   x,
    double          *   y,
    int                 n,
    char            *   title
)
{
    int     i ;
    FILE*   tmpfd ;
    char const * tmpfname;

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

    /* Open temporary file for output   */
    tmpfname = gnuplot_tmpfile(handle);
    tmpfd = fopen(tmpfname, "w");

    if (tmpfd == NULL) {
        fprintf(stderr,"cannot create temporary file: exiting plot") ;
        return ;
    }

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

    gnuplot_plot_atmpfile(handle,tmpfname,title);
    return ;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %ecx, %r13d
movq %rdx, %r15
testq %rdi, %rdi
sete %al
testq %rsi, %rsi
sete %cl
orb %al, %cl
testq %rdx, %rdx
sete %al
testl %r13d, %r13d
setle %dl
orb %al, %dl
orb %cl, %dl
jne 0x241b
movq %rsi, %r12
movq %rdi, %rbx
movq %r8, -0x40(%rbp)
callq 0x224d
leaq 0x10c7(%rip), %rsi      # 0x344b
movq %rax, -0x38(%rbp)
movq %rax, %rdi
callq 0x11b0
testq %rax, %rax
je 0x242a
movq %rax, %r14
movq %rbx, -0x30(%rbp)
movl %r13d, %ebx
xorl %r13d, %r13d
movsd (%r12,%r13,8), %xmm0
movsd (%r15,%r13,8), %xmm1
movq %r14, %rdi
leaq 0x11aa(%rip), %rsi      # 0x3566
movb $0x2, %al
callq 0x1140
incq %r13
cmpq %r13, %rbx
jne 0x23a6
movq %r14, %rdi
callq 0x10a0
movq -0x30(%rbp), %rbx
cmpl $0x0, 0x8(%rbx)
leaq 0xe75(%rip), %rax       # 0x3257
leaq 0x1178(%rip), %rdx      # 0x3561
cmovgq %rax, %rdx
movq -0x40(%rbp), %rax
testq %rax, %rax
leaq 0x1178(%rip), %r8       # 0x3573
cmovneq %rax, %r8
leaq 0xc(%rbx), %r9
leaq 0x129c(%rip), %rsi      # 0x36a6
movq %rbx, %rdi
movq -0x38(%rbp), %rcx
xorl %eax, %eax
callq 0x2048
incl 0x8(%rbx)
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
callq 0x135b
jmp 0x241b
// File: /workspace/github_c_makefile_star2_O3/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 0x24f1
movq %r8, %r15
movq %rdx, %r12
movq %rsi, %r14
callq 0x1e78
testq %rax, %rax
je 0x24f1
movq %rax, %rbx
testq %r14, %r14
leaq 0xd76(%rip), %rsi       # 0x31fc
cmovneq %r14, %rsi
movq %rax, %rdi
callq 0x1f03
testq %r12, %r12
leaq 0x1161(%rip), %rdx      # 0x35fd
cmovneq %r12, %rdx
leaq 0x1074(%rip), %rsi      # 0x351b
movq %rbx, %rdi
xorl %eax, %eax
callq 0x2048
movq -0x38(%rbp), %rax
testq %rax, %rax
leaq 0xf58(%rip), %rdx       # 0x3417
cmovneq %rax, %rdx
leaq 0x1061(%rip), %rsi      # 0x352b
movq %rbx, %rdi
xorl %eax, %eax
callq 0x2048
movq -0x40(%rbp), %rdx
movq %rbx, %rdi
movq %r15, %rsi
testq %rdx, %rdx
je 0x2500
movl %r13d, %ecx
movq -0x30(%rbp), %r8
callq 0x2333
jmp 0x250c
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl %r13d, %edx
movq -0x30(%rbp), %rcx
callq 0x215c
leaq 0x11ae(%rip), %rdi      # 0x36c1
callq 0x1080
callq 0x1130
cmpl $0xa, %eax
jne 0x2518
movq %rbx, %rdi
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x1fe3
// File: /workspace/github_c_makefile_star2_O3/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 0xd0b(%rip), %rax       # 0x3257
leaq 0x100e(%rip), %rdx      # 0x3561
cmovgq %rax, %rdx
testq %rsi, %rsi
leaq 0x1012(%rip), %rcx      # 0x3573
cmovneq %rsi, %rcx
leaq 0xc(%rdi), %r8
leaq 0x100a(%rip), %rsi      # 0x357a
movb $0x2, %al
callq 0x2048
incl 0x8(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0xcbf(%rip), %rsi       # 0x3257
leaq 0xfc2(%rip), %rax       # 0x3561
cmovgq %rsi, %rax
testq %rdx, %rdx
leaq 0xfc6(%rip), %r8        # 0x3573
cmovneq %rdx, %r8
leaq 0xc(%rdi), %r9
leaq 0xfe6(%rip), %rsi       # 0x35a2
movq %rax, %rdx
xorl %eax, %eax
callq 0x2048
incl 0x8(%rbx)
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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
movl $0xffffffff, %r13d      # imm = 0xFFFFFFFF
jne 0x2667
movl %edx, %r15d
movq %rsi, %rbx
leaq 0xe40(%rip), %rsi       # 0x344b
callq 0x11b0
testq %rax, %rax
je 0x2667
movq %rax, %r14
testq %r12, %r12
je 0x2631
leaq 0xf97(%rip), %rsi       # 0x35bb
movq %r14, %rdi
movq %r12, %rdx
xorl %eax, %eax
callq 0x1140
movl %r15d, %r13d
xorl %r15d, %r15d
leaq 0xf83(%rip), %r12       # 0x35c1
movsd (%rbx,%r15,8), %xmm0
movq %r14, %rdi
movq %r12, %rsi
movl %r15d, %edx
movb $0x1, %al
callq 0x1140
incq %r15
cmpq %r15, %r13
jne 0x263e
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_O3/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
movl $0xffffffff, %r13d      # imm = 0xFFFFFFFF
jne 0x271e
movq %rsi, %r14
movq %r8, -0x30(%rbp)
leaq 0xd8a(%rip), %rsi       # 0x344b
callq 0x11b0
testq %rax, %rax
je 0x271e
movq %rax, %r15
movq -0x30(%rbp), %rdx
testq %rdx, %rdx
je 0x26e8
leaq 0xedd(%rip), %rsi       # 0x35bb
movq %r15, %rdi
xorl %eax, %eax
callq 0x1140
movl %r12d, %r13d
xorl %r12d, %r12d
movsd (%r14,%r12,8), %xmm0
movsd (%rbx,%r12,8), %xmm1
movq %r15, %rdi
leaq 0xec8(%rip), %rsi       # 0x35cc
movb $0x2, %al
callq 0x1140
incq %r12
cmpq %r12, %r13
jne 0x26ee
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_O3/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
subq $0x28, %rsp
movl %edx, %ebx
movq %rsi, %r12
testq %rdi, %rdi
sete %al
testq %rsi, %rsi
sete %sil
orb %al, %sil
testl %edx, %edx
setle %al
testl %ecx, %ecx
setle %dl
orb %al, %dl
orb %sil, %dl
movl $0xffffffff, %r13d      # imm = 0xFFFFFFFF
jne 0x2852
movl %ecx, %r14d
xorl %eax, %eax
cmpq $0x0, (%r12,%rax,8)
je 0x2852
incq %rax
cmpq %rax, %r14
jne 0x2776
movq %r8, -0x30(%rbp)
movl %ecx, -0x34(%rbp)
leaq 0xcb4(%rip), %rsi       # 0x344b
callq 0x11b0
testq %rax, %rax
je 0x2852
movq %rax, %r15
movq %r14, -0x48(%rbp)
movq -0x30(%rbp), %rdx
testq %rdx, %rdx
je 0x27c6
leaq 0xdff(%rip), %rsi       # 0x35bb
movq %r15, %rdi
xorl %eax, %eax
callq 0x1140
movl %ebx, %eax
movq %rax, -0x30(%rbp)
xorl %ebx, %ebx
movq %r12, -0x40(%rbp)
movq (%r12), %rax
movsd (%rax,%rbx,8), %xmm0
movq %r15, %rdi
leaq 0xdf5(%rip), %rsi       # 0x35da
movl %ebx, %edx
movb $0x1, %al
callq 0x1140
cmpl $0x2, -0x34(%rbp)
leaq 0xde3(%rip), %r12       # 0x35dc
movq %r15, %r14
movq -0x48(%rbp), %r15
jl 0x282a
movl $0x1, %r13d
movq -0x40(%rbp), %rax
movq (%rax,%r13,8), %rax
movsd (%rax,%rbx,8), %xmm0
movq %r14, %rdi
movq %r12, %rsi
movb $0x1, %al
callq 0x1140
incq %r13
cmpq %r13, %r15
jne 0x2808
movl $0xa, %edi
movq %r14, %rsi
callq 0x1110
incq %rbx
cmpq -0x30(%rbp), %rbx
movq -0x40(%rbp), %r12
movq %r14, %r15
jne 0x27d2
movq %r15, %rdi
callq 0x10a0
xorl %r13d, %r13d
movl %r13d, %eax
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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
movb (%rsi), %bpl
testb %bpl, %bpl
je 0x2a983
movq %rdx, %r15
movq %rsi, %r13
movq %rdi, %rbx
callq 0x4510
movq (%rax), %rcx
xorl %eax, %eax
cmpq %r15, %rax
jae 0x2a97e
movzbl %bpl, %edx
movzwl (%rcx,%rdx,2), %edx
andl $0x2000, %edx           # imm = 0x2000
je 0x2a97e
movb 0x1(%r13,%rax), %bpl
incq %rax
testb %bpl, %bpl
jne 0x2a95a
jmp 0x2a983
cmpq %rax, %r15
jne 0x2a9b3
leaq 0x81ab3(%rip), %rsi     # 0xac43d
leaq 0x81ac3(%rip), %rdx     # 0xac454
movl $0x1, %edi
xorl %eax, %eax
callq 0x942d
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x38(%rbx), %r12
leaq 0x1(%r15), %rdi
callq 0x46a0
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
testq %rax, %rax
je 0x2a9a2
movq %rax, %r14
movq %rax, %rdi
movq %r13, %rsi
movq %r15, %rdx
callq 0x43c0
movb $0x0, (%r14,%r15)
movl 0x4(%r12), %r13d
movq 0x40(%rbx), %rdi
leaq 0x8(,%r13,8), %rsi
callq 0x4860
testq %rax, %rax
je 0x2aa93
movq %rax, 0x40(%rbx)
leaq 0x4(%rsp), %r15
movq %r12, %rdi
movq %r14, %rsi
movq %r15, %rdx
callq 0x3da10
cmpl $0x0, (%r15)
js 0x2aa93
je 0x2aa76
movq 0x20(%r12), %rcx
cltq
imulq $0x38, %rax, %rax
movups 0x80558(%rip), %xmm0    # 0xaaf88
movups %xmm0, 0x20(%rcx,%rax)
movups 0x8053c(%rip), %xmm0    # 0xaaf78
movups %xmm0, 0x10(%rcx,%rax)
movups 0x80520(%rip), %xmm0    # 0xaaf68
movups %xmm0, (%rcx,%rax)
movl $0xffffffff, %edx       # imm = 0xFFFFFFFF
movq %rdx, 0x30(%rcx,%rax)
movq 0x20(%r12), %rcx
movl %r13d, 0x30(%rcx,%rax)
movq 0x40(%rbx), %rax
movq %r14, (%rax,%r13,8)
movl $0x1, 0x54(%rbx)
xorl %ebp, %ebp
jmp 0x2a9a2
leaq 0x819c0(%rip), %rsi     # 0xac43d
leaq 0x81a0c(%rip), %rdx     # 0xac490
movl $0x1, %edi
movq %r14, %rcx
xorl %eax, %eax
callq 0x942d
movq %r14, %rdi
callq 0x45c0
jmp 0x2a9a2
// File: /workspace/github_c_makefile_star2_O3/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 %r12
pushq %rbx
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x8099b(%rip), %rsi     # 0xab450
movl $0x26, %edx
movq %rbx, %rdi
callq 0x4200
testl %eax, %eax
je 0x2aaf3
leaq 0x809aa(%rip), %rsi     # 0xab477
leaq 0x809bd(%rip), %rdx     # 0xab491
movl $0x1, %edi
movq %rbx, %rcx
xorl %eax, %eax
callq 0x942d
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
movl %ebp, %eax
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
movzbl 0x26(%rbx), %eax
xorl %ebp, %ebp
testl %eax, %eax
je 0x2aae8
cmpl $0xa, %eax
je 0x2aae8
leaq 0x26(%rbx), %rdi
leaq 0x809f4(%rip), %rsi     # 0xab501
movl $0x8, %edx
callq 0x4200
testl %eax, %eax
je 0x2ab2b
leaq 0x80955(%rip), %rsi     # 0xab477
leaq 0x809e1(%rip), %rdx     # 0xab50a
jmp 0x2aad4
movb 0x2e(%rbx), %al
testb %al, %al
je 0x2aae8
addq $0x2e, %rbx
movl $0x601, %r15d           # imm = 0x601
xorl %ebp, %ebp
leaq 0x1(%rbx), %r12
xorl %edx, %edx
cmpb $0xa, %al
ja 0x2ab51
movzbl %al, %eax
btl %eax, %r15d
jb 0x2ab5d
movb (%r12), %al
incq %r12
incq %rdx
jmp 0x2ab44
movq %r14, %rdi
movq %rbx, %rsi
callq 0x2a934
testl %eax, %eax
js 0x2aae3
movzbl -0x1(%r12), %eax
testl %eax, %eax
je 0x2aae8
cmpl $0xa, %eax
je 0x2aae8
movb (%r12), %al
movq %r12, %rbx
testb %al, %al
jne 0x2ab3e
jmp 0x2aae8
// File: /workspace/github_c_makefile_star2_O3/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 %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
xorl %r14d, %r14d
movq 0x28(%rbx,%r14,8), %r15
movl 0x4(%r15), %esi
cmpl %esi, (%rbx,%r14,4)
jae 0x2abd5
movq 0x10(%rbx,%r14,8), %rdi
shlq $0x4, %rsi
callq 0x4860
testq %rax, %rax
je 0x2ac77
movl 0x4(%r15), %ecx
movl %ecx, (%rbx,%r14,4)
movq %rax, 0x10(%rbx,%r14,8)
movl (%r15), %eax
testq %rax, %rax
je 0x2ac40
movq 0x10(%r15), %rdx
movl $0x30, %esi
xorl %edi, %edi
xorl %r8d, %r8d
movl %r8d, %ecx
shrl $0x4, %ecx
movl (%rdx,%rcx,4), %r9d
movl %edi, %ecx
andb $0x1e, %cl
shrl %cl, %r9d
testb $0x3, %r9b
jne 0x2ac31
movq 0x18(%r15), %rcx
movq 0x20(%r15), %r9
movq (%rcx,%r8,8), %rcx
movq 0x10(%rbx,%r14,8), %r10
addq %rsi, %r9
addq $-0x30, %r9
movslq 0x30(%r9), %r11
shlq $0x4, %r11
movq %rcx, (%r10,%r11)
movq 0x10(%rbx,%r14,8), %rcx
movq %r9, 0x8(%rcx,%r11)
incq %r8
addq $0x38, %rsi
addl $0x2, %edi
cmpq %r8, %rax
jne 0x2abeb
incq %r14
cmpq $0x3, %r14
jne 0x2aba2
movq 0x28(%rbx), %r14
testq %r14, %r14
je 0x2ac6c
movq 0x30(%r14), %rdi
testq %rdi, %rdi
je 0x2ac6c
callq 0x45c0
movq $0x0, 0x30(%r14)
movl $0x0, 0x54(%rbx)
xorl %eax, %eax
jmp 0x2ac7c
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x2acf5
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x8(%rdi), %rdi
callq 0x45c0
movq 0x10(%rbx), %rdi
testq %rdi, %rdi
je 0x2aca5
callq 0x45c0
cmpl $0x0, 0x18(%rbx)
jle 0x2acd4
xorl %r14d, %r14d
movq 0x20(%rbx), %rax
movq (%rax,%r14,8), %rdi
callq 0x45c0
movq 0x28(%rbx), %rax
movq (%rax,%r14,8), %rdi
callq 0x45c0
incq %r14
movslq 0x18(%rbx), %rax
cmpq %rax, %r14
jl 0x2acae
movq 0x20(%rbx), %rdi
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_O3/samtools[P]htslib/vcf.c
// Function: bcf_hrec_dup
bcf_hrec_t *bcf_hrec_dup(bcf_hrec_t *hrec)
{
    int save_errno;
    bcf_hrec_t *out = (bcf_hrec_t*) calloc(1,sizeof(bcf_hrec_t));
    if (!out) return NULL;

    out->type = hrec->type;
    if ( hrec->key ) {
        out->key = strdup(hrec->key);
        if (!out->key) goto fail;
    }
    if ( hrec->value ) {
        out->value = strdup(hrec->value);
        if (!out->value) goto fail;
    }
    out->nkeys = hrec->nkeys;
    out->keys = (char**) malloc(sizeof(char*)*hrec->nkeys);
    if (!out->keys) goto fail;
    out->vals = (char**) malloc(sizeof(char*)*hrec->nkeys);
    if (!out->vals) goto fail;
    int i, j = 0;
    for (i=0; i<hrec->nkeys; i++)
    {
        if ( hrec->keys[i] && !strcmp("IDX",hrec->keys[i]) ) continue;
        if ( hrec->keys[i] ) {
            out->keys[j] = strdup(hrec->keys[i]);
            if (!out->keys[j]) goto fail;
        }
        if ( hrec->vals[i] ) {
            out->vals[j] = strdup(hrec->vals[i]);
            if (!out->vals[j]) goto fail;
        }
        j++;
    }
    if ( i!=j ) out->nkeys -= i-j;   // IDX was omitted
    return out;

 fail:
    save_errno = errno;
    hts_log_error("%s", strerror(errno));
    bcf_hrec_destroy(out);
    errno = save_errno;
    return NULL;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdi, %r14
movl $0x1, %edi
movl $0x30, %esi
callq 0x42f0
testq %rax, %rax
je 0x2ae56
movq %rax, %rbx
movl (%r14), %eax
movl %eax, (%rbx)
movq 0x8(%r14), %rdi
testq %rdi, %rdi
je 0x2ad3f
callq 0x4930
movq %rax, 0x8(%rbx)
testq %rax, %rax
je 0x2ae1d
movq 0x10(%r14), %rdi
testq %rdi, %rdi
je 0x2ad5a
callq 0x4930
movq %rax, 0x10(%rbx)
testq %rax, %rax
je 0x2ae1d
movslq 0x18(%r14), %rax
movl %eax, 0x18(%rbx)
movq %rax, (%rsp)
leaq (,%rax,8), %r12
movq %r12, %rdi
callq 0x46a0
movq %rax, 0x20(%rbx)
testq %rax, %rax
je 0x2ae1d
movq %rax, %r15
movq %r12, %rdi
callq 0x46a0
movq %rax, 0x28(%rbx)
testq %rax, %rax
je 0x2ae1d
cmpl $0x0, (%rsp)
jle 0x2ae58
xorl %ebp, %ebp
xorl %r12d, %r12d
movq 0x20(%r14), %rax
movq (%rax,%rbp,8), %r13
testq %r13, %r13
je 0x2ade3
leaq 0x7ccc6(%rip), %rdi     # 0xa7a83
movq %r13, %rsi
callq 0x46e0
testl %eax, %eax
je 0x2ae08
movq %r13, %rdi
callq 0x4930
movslq %r12d, %rcx
movq %rax, (%r15,%rcx,8)
movq 0x20(%rbx), %r15
cmpq $0x0, (%r15,%rcx,8)
je 0x2ae1d
movq 0x28(%r14), %rax
movq (%rax,%rbp,8), %rdi
testq %rdi, %rdi
je 0x2ae05
callq 0x4930
movq 0x28(%rbx), %rcx
movslq %r12d, %rdx
movq %rax, (%rcx,%rdx,8)
testq %rax, %rax
je 0x2ae1d
incl %r12d
incq %rbp
cmpq %rbp, (%rsp)
jne 0x2ada9
cmpl %r12d, (%rsp)
je 0x2ae58
movl %r12d, 0x18(%rbx)
jmp 0x2ae58
callq 0x4050
movq %rax, %r14
movl (%rax), %ebp
movl %ebp, %edi
callq 0x4140
leaq 0x8073e(%rip), %rsi     # 0xab573
leaq 0x80734(%rip), %rdx     # 0xab570
movl $0x1, %edi
movq %rax, %rcx
xorl %eax, %eax
callq 0x942d
movq %rbx, %rdi
callq 0x2ac82
movl %ebp, (%r14)
xorl %ebx, %ebx
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x7cb63(%rip), %rcx     # 0xa79ed
cmovneq %rax, %rcx
leaq 0x806eb(%rip), %rsi     # 0xab580
xorl %eax, %eax
callq 0x4720
cmpl $0x0, 0x18(%r14)
jle 0x2aed6
leaq 0x806ea(%rip), %r15     # 0xab594
xorl %r12d, %r12d
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
movslq 0x18(%r14), %rax
cmpq %rax, %r12
jl 0x2aead
movl $0xa, %edi
movq %rbx, %rsi
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
jmp 0x4650
// File: /workspace/github_c_makefile_star2_O3/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:
cmpl $0x0, 0x50(%rdi)
jle 0x2af5c
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
movq %rdi, %rbx
leaq 0x48(%rdi), %r14
movq 0xa20d5(%rip), %r13     # 0xccfe0
leaq 0x8069e(%rip), %r15     # 0xab5b0
xorl %r12d, %r12d
movq (%r14), %rax
movq (%rax,%r12,8), %rax
movq 0x8(%rax), %rdx
movq 0x10(%rax), %rcx
movq (%r13), %rdi
testq %rcx, %rcx
jne 0x2af3d
movq %rdx, %rsi
movq %r14, %rdx
movq %r12, %rcx
callq 0x4a69
jmp 0x2af47
movq %r15, %rsi
xorl %eax, %eax
callq 0x4720
incq %r12
movslq 0x50(%rbx), %rax
cmpq %rax, %r12
jl 0x2af15
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x2b022
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
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
testq %rax, %rax
je 0x2b011
movq %rax, 0x20(%rbx)
movq 0x28(%rbx), %rdi
movq %r12, %rsi
callq 0x4860
testq %rax, %rax
je 0x2b011
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 0x2b011
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
movq $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 0x80590(%rip), %rdi     # 0xab5b9
leaq 0x805a3(%rip), %rsi     # 0xab5d3
leaq 0x805a2(%rip), %rcx     # 0xab5d9
movl $0x1a2, %edx            # imm = 0x1A2
callq 0x42e0
// File: /workspace/github_c_makefile_star2_O3/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 0x2b079
callq 0x45c0
movq 0x28(%r15), %rax
movq $0x0, (%rax,%r13,8)
xorl %ebx, %ebx
testq %r12, %r12
je 0x2b13b
testl %ebp, %ebp
je 0x2b0ed
cmpq $-0x4, %r14
jae 0x2b12b
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 0x2b136
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 0x2b13b
cmpq $-0x1, %r14
je 0x2b12b
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 0x2b136
movq %r12, %rsi
movq %r14, %rdx
callq 0x43c0
movq 0x28(%r15), %rax
movq (%rax,%r13,8), %rax
movb $0x0, (%rax,%r14)
jmp 0x2b13b
callq 0x4050
movl $0xc, (%rax)
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
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_O3/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 %r13
pushq %r12
pushq %rbx
subq $0x18, %rsp
movl %esi, %r14d
movq %rdi, %rbx
movslq 0x18(%rdi), %r12
movq 0x20(%rdi), %rdi
leaq 0x8(,%r12,8), %r15
movq %r15, %rsi
callq 0x4860
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
testq %rax, %rax
je 0x2b31a
movq %rax, 0x20(%rbx)
movq 0x28(%rbx), %rdi
movq %r15, %rsi
callq 0x4860
testq %rax, %rax
je 0x2b31a
movq %rax, 0x28(%rbx)
leaq 0x7c8d9(%rip), %rdi     # 0xa7a83
callq 0x4930
movq 0x20(%rbx), %rcx
movslq 0x18(%rbx), %rdx
movq %rax, (%rcx,%rdx,8)
movq 0x20(%rbx), %rax
movq (%rax,%rdx,8), %rax
testq %rax, %rax
je 0x2b31a
movq %rax, 0x10(%rsp)
xorl %r13d, %r13d
testl %r14d, %r14d
js 0x2b1df
xorl %esi, %esi
xorl %eax, %eax
jmp 0x2b203
movl $0x4, %edi
callq 0x46a0
testq %rax, %rax
je 0x2b310
negl %r14d
movb $0x2d, (%rax)
movl $0x1, %r13d
movl $0x4, %esi
cmpl $0x9, %r14d
ja 0x2b239
leal 0x2(%r13), %ecx
cmpl %ecx, %esi
jae 0x2b226
leaq 0x3(%r13), %rsi
movq %rax, %rdi
callq 0x4860
testq %rax, %rax
je 0x2b310
orb $0x30, %r14b
addq %rax, %r13
incq %r13
movb %r14b, -0x1(%r13)
jmp 0x2b2f4
bsrl %r14d, %ecx
xorl $0x1f, %ecx
shll $0x2, %ecx
leaq 0x7fd56(%rip), %rdx     # 0xaafa0
movl (%rcx,%rdx), %edi
leaq 0x7fdcc(%rip), %rdx     # 0xab020
xorl %r15d, %r15d
cmpl %r14d, (%rcx,%rdx)
seta %r15b
movl %edi, %r10d
subl %r15d, %r10d
leaq (%r10,%r13), %rcx
addq $0x2, %rcx
cmpq %rcx, %rsi
jae 0x2b29a
movq %rcx, %rsi
shrq %rsi
addq %rcx, %rsi
movq %rdi, (%rsp)
movq %rax, %rdi
movq %r10, 0x8(%rsp)
callq 0x4860
movq (%rsp), %rdi
movq 0x8(%rsp), %r10
testq %rax, %rax
je 0x2b310
negl %r15d
leaq (%rax,%r13), %rcx
leal (%rdi,%r15), %edx
addl $-0x2, %edx
leaq 0x7d6a1(%rip), %rsi     # 0xa8950
movl %r14d, %edi
movl %r14d, %r8d
imulq $0x51eb851f, %r8, %r14  # imm = 0x51EB851F
shrq $0x25, %r14
imull $0x64, %r14d, %r8d
movl %edi, %r9d
subl %r8d, %r9d
movl %edx, %r8d
movzwl (%rsi,%r9,2), %r9d
movw %r9w, (%rcx,%r8)
addl $-0x2, %edx
cmpl $0x3e7, %edi            # imm = 0x3E7
ja 0x2b2af
cmpl $-0x1, %edx
jne 0x2b2ee
orb $0x30, %r14b
movb %r14b, (%rcx)
addq %r10, %r13
addq %rax, %r13
incq %r12
movb $0x0, (%r13)
movq 0x28(%rbx), %rcx
movslq 0x18(%rbx), %rdx
movq %rax, (%rcx,%rdx,8)
movl %r12d, 0x18(%rbx)
xorl %ebp, %ebp
jmp 0x2b31a
movq 0x10(%rsp), %rdi
callq 0x45c0
movl %ebp, %eax
addq $0x18, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq