LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O1/xiongxu[P]bam2bedGraph2/samtools-0.1.19/bgzf.c
// Function: bgzf_open
BGZF *bgzf_open(const char *path, const char *mode)
{
	BGZF *fp = 0;
	assert(compressBound(BGZF_BLOCK_SIZE) < BGZF_MAX_BLOCK_SIZE);
	if (strchr(mode, 'r') || strchr(mode, 'R')) {
		_bgzf_file_t fpr;
		if ((fpr = _bgzf_open(path, "r")) == 0) return 0;
		fp = bgzf_read_init();
		fp->fp = fpr;
	} else if (strchr(mode, 'w') || strchr(mode, 'W')) {
		FILE *fpw;
		if ((fpw = fopen(path, "w")) == 0) return 0;
		fp = bgzf_write_init(mode2level(mode));
		fp->fp = fpw;
	}
	return fp;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
movl $0xff00, %edi           # imm = 0xFF00
callq 0x3400
cmpq $0x10000, %rax          # imm = 0x10000
jae 0x17268
movq %rbx, %rdi
movl $0x72, %esi
callq 0x3200
testq %rax, %rax
jne 0x171dc
movq %rbx, %rdi
movl $0x52, %esi
callq 0x3200
testq %rax, %rax
je 0x1720f
leaq 0x4623(%rip), %rsi      # 0x1b806
movq %r14, %rdi
callq 0x156b5
movq %rax, %rbx
testq %rax, %rax
je 0x171fe
callq 0x18401
movq %rbx, 0x30(%rax)
jmp 0x17200
xorl %eax, %eax
testq %rbx, %rbx
jne 0x17207
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
movq %rbx, %rdi
movl $0x77, %esi
callq 0x3200
testq %rax, %rax
jne 0x17233
movq %rbx, %rdi
movl $0x57, %esi
callq 0x3200
testq %rax, %rax
je 0x17205
leaq 0x3df2(%rip), %rsi      # 0x1b02c
movq %r14, %rdi
callq 0x3340
movq %rax, %r14
testq %rax, %rax
je 0x1725f
movq %rbx, %rdi
callq 0x17309
movl %eax, %edi
callq 0x17287
movq %r14, 0x30(%rax)
jmp 0x17261
xorl %eax, %eax
testq %r14, %r14
jne 0x17207
jmp 0x17205
leaq 0x4db1(%rip), %rdi      # 0x1c020
leaq 0x4ddf(%rip), %rsi      # 0x1c055
leaq 0x4ddf(%rip), %rcx      # 0x1c05c
movl $0x8e, %edx
callq 0x3230
// File: /workspace/github_c_makefile_star2_O1/xiongxu[P]bam2bedGraph2/samtools-0.1.19/bgzf.c
// Function: bgzf_write_init
static BGZF *bgzf_write_init(int compress_level) // compress_level==-1 for the default level
{
	BGZF *fp;
	fp = calloc(1, sizeof(BGZF));
	fp->is_write = 1;
	fp->uncompressed_block = malloc(BGZF_MAX_BLOCK_SIZE);
	fp->compressed_block = malloc(BGZF_MAX_BLOCK_SIZE);
	fp->compress_level = compress_level < 0? Z_DEFAULT_COMPRESSION : compress_level; // Z_DEFAULT_COMPRESSION==-1
	if (fp->compress_level > 9) fp->compress_level = Z_DEFAULT_COMPRESSION;
	return fp;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %rbx
pushq %rax
movl %edi, %ebp
movl $0x1, %edi
movl $0x40, %esi
callq 0x32e0
movq %rax, %rbx
movl $0xfffcffff, %r14d      # imm = 0xFFFCFFFF
andl (%rax), %r14d
leal 0x10000(%r14), %r15d
movl %r15d, (%rax)
movl $0x10000, %edi          # imm = 0x10000
callq 0x33e0
movq %rax, 0x18(%rbx)
movl $0x10000, %edi          # imm = 0x10000
callq 0x33e0
movq %rax, 0x20(%rbx)
testl %ebp, %ebp
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmovnsl %ebp, %eax
shll $0x12, %eax
andl $0x1ffff, %r15d         # imm = 0x1FFFF
orl %eax, %r15d
orl $0xfffd0000, %r14d      # imm = 0xFFFD0000
cmpl $0x240001, %eax         # imm = 0x240001
cmovll %r15d, %r14d
movl %r14d, (%rbx)
movq %rbx, %rax
addq $0x8, %rsp
popq %rbx
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/xiongxu[P]bam2bedGraph2/samtools-0.1.19/bgzf.c
// Function: mode2level
static int mode2level(const char *__restrict mode)
{
	int i, compress_level = -1;
	for (i = 0; mode[i]; ++i)
		if (mode[i] >= '0' && mode[i] <= '9') break;
	if (mode[i]) compress_level = (int)mode[i] - '0';
	if (strchr(mode, 'u')) compress_level = 0;
	return compress_level;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq %rdi, %rcx
movzbl (%rcx), %eax
testl %eax, %eax
je 0x17321
leal -0x30(%rax), %edx
incq %rcx
cmpb $0x9, %dl
ja 0x1730f
leal -0x30(%rax), %ecx
xorl %ebp, %ebp
cmpl $0x1, %eax
movl $0x0, %ebx
sbbl %ebx, %ebx
orl %ecx, %ebx
movl $0x75, %esi
callq 0x3200
testq %rax, %rax
cmovnel %ebp, %ebx
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/xiongxu[P]bam2bedGraph2/samtools-0.1.19/bgzf.c
// Function: bgzf_dopen
BGZF *bgzf_dopen(int fd, const char *mode)
{
	BGZF *fp = 0;
	assert(compressBound(BGZF_BLOCK_SIZE) < BGZF_MAX_BLOCK_SIZE);
	if (strchr(mode, 'r') || strchr(mode, 'R')) {
		_bgzf_file_t fpr;
		if ((fpr = _bgzf_dopen(fd, "r")) == 0) return 0;
		fp = bgzf_read_init();
		fp->fp = fpr;
	} else if (strchr(mode, 'w') || strchr(mode, 'W')) {
		FILE *fpw;
		if ((fpw = fdopen(fd, "w")) == 0) return 0;
		fp = bgzf_write_init(mode2level(mode));
		fp->fp = fpw;
	}
	return fp;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
movq %rsi, %rbx
movl %edi, %ebp
movl $0xff00, %edi           # imm = 0xFF00
callq 0x3400
cmpq $0x10000, %rax          # imm = 0x10000
jae 0x17415
movq %rbx, %rdi
movl $0x72, %esi
callq 0x3200
testq %rax, %rax
jne 0x1738e
movq %rbx, %rdi
movl $0x52, %esi
callq 0x3200
testq %rax, %rax
je 0x173bd
leaq 0x4471(%rip), %rsi      # 0x1b806
movl %ebp, %edi
callq 0x1580d
movq %rax, %rbx
testq %rax, %rax
je 0x173af
callq 0x18401
movq %rbx, 0x30(%rax)
jmp 0x173b1
xorl %eax, %eax
testq %rbx, %rbx
jne 0x173b8
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
retq
movq %rbx, %rdi
movl $0x77, %esi
callq 0x3200
testq %rax, %rax
jne 0x173e1
movq %rbx, %rdi
movl $0x57, %esi
callq 0x3200
testq %rax, %rax
je 0x173b6
leaq 0x3c44(%rip), %rsi      # 0x1b02c
movl %ebp, %edi
callq 0x3440
movq %rax, %r14
testq %rax, %rax
je 0x1740c
movq %rbx, %rdi
callq 0x17309
movl %eax, %edi
callq 0x17287
movq %r14, 0x30(%rax)
jmp 0x1740e
xorl %eax, %eax
testq %r14, %r14
jne 0x173b8
jmp 0x173b6
leaq 0x4c04(%rip), %rdi      # 0x1c020
leaq 0x4c32(%rip), %rsi      # 0x1c055
leaq 0x4c5e(%rip), %rcx      # 0x1c088
movl $0xa0, %edx
callq 0x3230
// File: /workspace/github_c_makefile_star2_O1/xiongxu[P]bam2bedGraph2/samtools-0.1.19/bgzf.c
// Function: bgzf_read
ssize_t bgzf_read(BGZF *fp, void *data, ssize_t length)
{
	ssize_t bytes_read = 0;
	uint8_t *output = data;
	if (length <= 0) return 0;
	assert(fp->is_write == 0);
	while (bytes_read < length) {
		int copy_length, available = fp->block_length - fp->block_offset;
		uint8_t *buffer;
		if (available <= 0) {
			if (bgzf_read_block(fp) != 0) return -1;
			available = fp->block_length - fp->block_offset;
			if (available <= 0) break;
		}
		copy_length = length - bytes_read < available? length - bytes_read : available;
		buffer = fp->uncompressed_block;
		memcpy(output, buffer + fp->block_offset, copy_length);
		fp->block_offset += copy_length;
		output += copy_length;
		bytes_read += copy_length;
	}
	if (fp->block_offset == fp->block_length) {
		fp->block_address = _bgzf_tell((_bgzf_file_t)fp->fp);
		fp->block_offset = fp->block_length = 0;
	}
	return bytes_read;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
testq %rdx, %rdx
jle 0x179a1
movq %rdi, %r14
testb $0x3, 0x2(%rdi)
jne 0x179b9
movq %rdx, %r15
movq %rsi, %r12
xorl %ebx, %ebx
movq %r15, %r13
subq %rbx, %r13
jle 0x17981
movl 0x8(%r14), %eax
subl 0xc(%r14), %eax
jle 0x17954
movl %eax, %eax
cmpq %rax, %r13
cmovlq %r13, %rax
movslq 0xc(%r14), %rsi
addq 0x18(%r14), %rsi
movslq %eax, %r13
movq %r12, %rdi
movq %r13, %rdx
callq 0x3370
addl %r13d, 0xc(%r14)
addq %r13, %r12
addq %r13, %rbx
xorl %ecx, %ecx
jmp 0x17965
movq %r14, %rdi
callq 0x17434
movl $0x1, %ecx
testl %eax, %eax
je 0x1796b
testl %ecx, %ecx
je 0x17915
jmp 0x1797c
movl 0x8(%r14), %eax
subl 0xc(%r14), %eax
jg 0x17927
movl $0x3, %ecx
jmp 0x17965
cmpl $0x3, %ecx
jne 0x179a5
movl 0xc(%r14), %eax
cmpl 0x8(%r14), %eax
jne 0x179ac
movq 0x30(%r14), %rax
movq 0x8(%rax), %rax
movq %rax, 0x10(%r14)
movq $0x0, 0x8(%r14)
jmp 0x179ac
xorl %ebx, %ebx
jmp 0x179ac
movq $-0x1, %rbx
movq %rbx, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
leaq 0x46ec(%rip), %rdi      # 0x1c0ac
leaq 0x468e(%rip), %rsi      # 0x1c055
leaq 0x46f0(%rip), %rcx      # 0x1c0be
movl $0x15b, %edx            # imm = 0x15B
callq 0x3230
// File: /workspace/github_c_makefile_star2_O1/xiongxu[P]bam2bedGraph2/samtools-0.1.19/bgzf.c
// Function: bgzf_mt
int bgzf_mt(BGZF *fp, int n_threads, int n_sub_blks)
{
	int i;
	mtaux_t *mt;
	pthread_attr_t attr;
	if (!fp->is_write || fp->mt || n_threads <= 1) return -1;
	mt = calloc(1, sizeof(mtaux_t));
	mt->n_threads = n_threads;
	mt->n_blks = n_threads * n_sub_blks;
	mt->len = calloc(mt->n_blks, sizeof(int));
	mt->blk = calloc(mt->n_blks, sizeof(void*));
	for (i = 0; i < mt->n_blks; ++i)
		mt->blk[i] = malloc(BGZF_MAX_BLOCK_SIZE);
	mt->tid = calloc(mt->n_threads, sizeof(pthread_t)); // tid[0] is not used, as the worker 0 is launched by the master
	mt->w = calloc(mt->n_threads, sizeof(worker_t));
	for (i = 0; i < mt->n_threads; ++i) {
		mt->w[i].i = i;
		mt->w[i].mt = mt;
		mt->w[i].fp = fp;
		mt->w[i].buf = malloc(BGZF_MAX_BLOCK_SIZE);
	}
	pthread_attr_init(&attr);
	pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_JOINABLE);
	pthread_mutex_init(&mt->lock, 0);
	pthread_cond_init(&mt->cv, 0);
	for (i = 1; i < mt->n_threads; ++i) // worker 0 is effectively launched by the master thread
		pthread_create(&mt->tid[i], &attr, mt_worker, &mt->w[i]);
	fp->mt = mt;
	return 0;
}

// Assembly:
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
testb $0x3, 0x2(%rdi)
je 0x17b6e
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movl %esi, %ebp
cmpl $0x2, %esi
jl 0x17b60
movq %rdi, %r13
cmpq $0x0, 0x38(%rdi)
jne 0x17b60
movl %edx, %r12d
movl $0x1, %edi
movl $0x90, %esi
callq 0x32e0
movq %rax, %r14
movl %ebp, (%rax)
imull %ebp, %r12d
movl %r12d, 0x4(%rax)
movslq %r12d, %r15
movl $0x4, %esi
movq %r15, %rdi
callq 0x32e0
movq %rax, 0x20(%r14)
movl $0x8, %esi
movq %r15, %rdi
callq 0x32e0
movq %rax, 0x18(%r14)
testl %r15d, %r15d
jle 0x17a77
movl %r12d, %ebx
xorl %r15d, %r15d
movl $0x10000, %edi          # imm = 0x10000
callq 0x33e0
movq 0x18(%r14), %rcx
movq %rax, (%rcx,%r15,8)
incq %r15
cmpq %r15, %rbx
jne 0x17a5d
movl %ebp, %r15d
movl $0x8, %esi
movq %r15, %rdi
callq 0x32e0
movq %rax, 0x30(%r14)
movl $0x28, %esi
movq %r15, %rdi
callq 0x32e0
movq %rax, 0x28(%r14)
testl %ebp, %ebp
jle 0x17ad2
movq %rax, %r12
addq $0x18, %r12
xorl %ebx, %ebx
movl %ebx, (%r12)
movq %r14, -0x10(%r12)
movq %r13, -0x18(%r12)
movl $0x10000, %edi          # imm = 0x10000
callq 0x33e0
movq %rax, -0x8(%r12)
incq %rbx
addq $0x28, %r12
cmpq %rbx, %r15
jne 0x17aa9
movq %r13, 0x8(%rsp)
leaq 0x10(%rsp), %r12
movq %r12, %rdi
callq 0x32c0
movq %r12, %rdi
xorl %esi, %esi
callq 0x33c0
leaq 0x38(%r14), %rdi
xorl %esi, %esi
callq 0x35b0
movq %r14, %rdi
addq $0x60, %rdi
xorl %esi, %esi
callq 0x33b0
cmpl $0x2, (%r14)
jl 0x17b55
movl $0x1, %ebp
movl $0x28, %r15d
movl $0x8, %ebx
leaq 0x4b(%rip), %r12        # 0x17b6f
leaq 0x10(%rsp), %r13
movq 0x30(%r14), %rdi
addq %rbx, %rdi
movq 0x28(%r14), %rcx
addq %r15, %rcx
movq %r13, %rsi
movq %r12, %rdx
callq 0x3450
incq %rbp
movslq (%r14), %rax
addq $0x28, %r15
addq $0x8, %rbx
cmpq %rax, %rbp
jl 0x17b29
movq 0x8(%rsp), %rax
movq %r14, 0x38(%rax)
xorl %eax, %eax
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/xiongxu[P]bam2bedGraph2/samtools-0.1.19/bgzf.c
// Function: bgzf_flush
int bgzf_flush(BGZF *fp)
{
	if (!fp->is_write) return 0;
	if (fp->mt) return mt_flush(fp);
	while (fp->block_offset > 0) {
		int block_length;
		block_length = deflate_block(fp, fp->block_offset);
		if (block_length < 0) return -1;
		if (fwrite(fp->compressed_block, 1, block_length, fp->fp) != block_length) {
			fp->errcode |= BGZF_ERR_IO; // possibly truncated file
			return -1;
		}
		fp->block_address += block_length;
	}
	return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
xorl %ebx, %ebx
testb $0x3, 0x2(%rdi)
je 0x17be4
movq %rdi, %r14
cmpq $0x0, 0x38(%rdi)
je 0x17bd1
movq %r14, %rdi
callq 0x17bec
jmp 0x17be4
movq %r14, %rdi
callq 0x17cde
testl %eax, %eax
js 0x17bdf
movl %eax, %r15d
movq 0x20(%r14), %rdi
movq 0x30(%r14), %rcx
movl $0x1, %esi
movq %r15, %rdx
callq 0x3540
cmpq %r15, %rax
jne 0x17bdb
addq %r15, 0x10(%r14)
movl 0xc(%r14), %esi
testl %esi, %esi
jg 0x17ba4
jmp 0x17be4
orb $0x4, (%r14)
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
movl %ebx, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/xiongxu[P]bam2bedGraph2/samtools-0.1.19/bgzf.c
// Function: mt_flush
static int mt_flush(BGZF *fp)
{
	int i;
	mtaux_t *mt = (mtaux_t*)fp->mt;
	if (fp->block_offset) mt_queue(fp); // guaranteed that assertion does not fail
	// signal all the workers to compress
	pthread_mutex_lock(&mt->lock);
	for (i = 0; i < mt->n_threads; ++i) mt->w[i].toproc = 1;
	mt->proc_cnt = 0;
	pthread_cond_broadcast(&mt->cv);
	pthread_mutex_unlock(&mt->lock);
	// worker 0 is doing things here
	worker_aux(&mt->w[0]);
	// wait for all the threads to complete
	while (mt->proc_cnt < mt->n_threads);
	// dump data to disk
	for (i = 0; i < mt->n_threads; ++i) fp->errcode |= mt->w[i].errcode;
	for (i = 0; i < mt->curr; ++i)
		if (fwrite(mt->blk[i], 1, mt->len[i], fp->fp) != mt->len[i])
			fp->errcode |= BGZF_ERR_IO;
	mt->curr = 0;
	return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movq 0x38(%rdi), %r15
cmpl $0x0, 0xc(%rdi)
je 0x17c06
movq %rbx, %rdi
callq 0x188cc
leaq 0x38(%r15), %r14
movq %r14, %rdi
callq 0x35e0
movslq (%r15), %rcx
testq %rcx, %rcx
jle 0x17c39
movq 0x28(%r15), %rax
shlq $0x3, %rcx
leaq (%rcx,%rcx,4), %rcx
xorl %edx, %edx
movl $0x1, 0x20(%rax,%rdx)
addq $0x28, %rdx
cmpq %rdx, %rcx
jne 0x17c28
movl $0x0, 0x10(%r15)
leaq 0x60(%r15), %rdi
callq 0x30f0
movq %r14, %rdi
callq 0x33d0
movq 0x28(%r15), %rdi
callq 0x186e7
movl (%r15), %eax
movl 0x10(%r15), %ecx
cmpl %eax, %ecx
jl 0x17c5e
cmpl $0x0, (%r15)
jle 0x17c8c
movl $0x1c, %eax
xorl %ecx, %ecx
movq 0x28(%r15), %rdx
movzwl (%rdx,%rax), %edx
orl %edx, (%rbx)
incq %rcx
movslq (%r15), %rdx
addq $0x28, %rax
cmpq %rdx, %rcx
jl 0x17c73
cmpl $0x0, 0x8(%r15)
jle 0x17cd0
xorl %r14d, %r14d
movq 0x18(%r15), %rax
movq 0x20(%r15), %rcx
movq (%rax,%r14,8), %rdi
movslq (%rcx,%r14,4), %rdx
movq 0x30(%rbx), %rcx
movl $0x1, %esi
callq 0x3540
movq 0x20(%r15), %rcx
movslq (%rcx,%r14,4), %rcx
cmpq %rcx, %rax
je 0x17cc4
orb $0x4, (%rbx)
incq %r14
movslq 0x8(%r15), %rax
cmpq %rax, %r14
jl 0x17c96
movl $0x0, 0x8(%r15)
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/xiongxu[P]bam2bedGraph2/samtools-0.1.19/bgzf.c
// Function: deflate_block
static int deflate_block(BGZF *fp, int block_length)
{
	int comp_size = BGZF_MAX_BLOCK_SIZE;
	if (bgzf_compress(fp->compressed_block, &comp_size, fp->uncompressed_block, block_length, fp->compress_level) != 0) {
		fp->errcode |= BGZF_ERR_ZLIB;
		return -1;
	}
	fp->block_offset = 0;
	return comp_size;
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movl %esi, %ecx
movq %rdi, %rbx
leaq 0xc(%rsp), %rsi
movl $0x10000, (%rsi)        # imm = 0x10000
movq 0x20(%rdi), %rdi
movq 0x18(%rbx), %rdx
movl (%rbx), %r8d
sarl $0x12, %r8d
callq 0x187e1
testl %eax, %eax
je 0x17d15
orb $0x1, (%rbx)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x17d20
movl $0x0, 0xc(%rbx)
movl 0xc(%rsp), %eax
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/xiongxu[P]bam2bedGraph2/samtools-0.1.19/bgzf.c
// Function: mt_lazy_flush
static int mt_lazy_flush(BGZF *fp)
{
	mtaux_t *mt = (mtaux_t*)fp->mt;
	if (fp->block_offset) mt_queue(fp);
	if (mt->curr == mt->n_blks)
		return mt_flush(fp);
	return -1;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq %rdi, %rbx
movq 0x38(%rdi), %r14
cmpl $0x0, 0xc(%rdi)
je 0x17d60
movq %rbx, %rdi
callq 0x188cc
movl 0x8(%r14), %ecx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpl 0x4(%r14), %ecx
jne 0x17d79
movq %rbx, %rdi
callq 0x17bec
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O1/xiongxu[P]bam2bedGraph2/samtools-0.1.19/bgzf.c
// Function: bgzf_write
ssize_t bgzf_write(BGZF *fp, const void *data, ssize_t length)
{
	const uint8_t *input = data;
	int block_length = BGZF_BLOCK_SIZE, bytes_written = 0;
	assert(fp->is_write);
	if (fp->mt) return mt_write(fp, data, length);
	while (bytes_written < length) {
		uint8_t* buffer = fp->uncompressed_block;
		int copy_length = block_length - fp->block_offset < length - bytes_written? block_length - fp->block_offset : length - bytes_written;
		memcpy(buffer + fp->block_offset, input, copy_length);
		fp->block_offset += copy_length;
		input += copy_length;
		bytes_written += copy_length;
		if (fp->block_offset == block_length && bgzf_flush(fp)) break;
	}
	return bytes_written;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
testb $0x3, 0x2(%rdi)
je 0x17e6f
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
cmpq $0x0, 0x38(%rdi)
je 0x17dfb
testq %rbx, %rbx
je 0x17e62
movq %rbx, %r13
movslq 0xc(%r15), %rdi
movl $0xff00, %eax           # imm = 0xFF00
subq %rdi, %rax
cmpq %rax, %r13
movl %r13d, %ecx
cmovgl %eax, %ecx
addq 0x18(%r15), %rdi
movslq %ecx, %r12
movq %r14, %rsi
movq %r12, %rdx
callq 0x3370
movl 0xc(%r15), %eax
addl %r12d, %eax
movl %eax, 0xc(%r15)
cmpl $0xff00, %eax           # imm = 0xFF00
jne 0x17df1
movq %r15, %rdi
callq 0x17d47
addq %r12, %r14
subq %r12, %r13
jne 0x17db0
jmp 0x17e62
xorl %r13d, %r13d
testq %rbx, %rbx
jle 0x17e60
xorl %eax, %eax
movslq 0xc(%r15), %rdi
movl $0xff00, %ecx           # imm = 0xFF00
subq %rdi, %rcx
movq %rbx, %rdx
subq %rax, %rdx
cmpq %rcx, %rdx
cmovgl %ecx, %edx
addq 0x18(%r15), %rdi
movslq %edx, %r12
movq %r14, %rsi
movq %r12, %rdx
callq 0x3370
addl %r12d, %r13d
movl 0xc(%r15), %eax
addl %r12d, %eax
movl %eax, 0xc(%r15)
addq %r12, %r14
cmpl $0xff00, %eax           # imm = 0xFF00
jne 0x17e53
movq %r15, %rdi
callq 0x17b83
testl %eax, %eax
jne 0x17e5b
movslq %r13d, %rax
cmpq %rbx, %rax
jl 0x17e05
movslq %r13d, %rbx
jmp 0x17e62
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
leaq 0x4273(%rip), %rdi      # 0x1c0e9
leaq 0x41d8(%rip), %rsi      # 0x1c055
leaq 0x4272(%rip), %rcx      # 0x1c0f6
movl $0x22c, %edx            # imm = 0x22C
callq 0x3230
// File: /workspace/github_c_makefile_star2_O1/xiongxu[P]bam2bedGraph2/samtools-0.1.19/bgzf.c
// Function: bgzf_close
int bgzf_close(BGZF* fp)
{
	int ret, count, block_length;
	if (fp == 0) return -1;
	if (fp->is_write) {
		if (bgzf_flush(fp) != 0) return -1;
		fp->compress_level = -1;
		block_length = deflate_block(fp, 0); // write an empty block
		count = fwrite(fp->compressed_block, 1, block_length, fp->fp);
		if (fflush(fp->fp) != 0) {
			fp->errcode |= BGZF_ERR_IO;
			return -1;
		}
		if (fp->mt) mt_destroy(fp->mt);
	}
	ret = fp->is_write? fclose(fp->fp) : _bgzf_close(fp->fp);
	if (ret != 0) return -1;
	free(fp->uncompressed_block);
	free(fp->compressed_block);
	free_cache(fp);
	free(fp);
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movl $0xffffffff, %ebp       # imm = 0xFFFFFFFF
testq %rdi, %rdi
je 0x1809f
movq %rdi, %rbx
testb $0x3, 0x2(%rdi)
je 0x17fed
movq %rbx, %rdi
callq 0x17b83
testl %eax, %eax
jne 0x1809f
orl $0xfffc0000, (%rbx)     # imm = 0xFFFC0000
movq %rbx, %rdi
xorl %esi, %esi
callq 0x17cde
movslq %eax, %rdx
movq 0x20(%rbx), %rdi
movq 0x30(%rbx), %rcx
movl $0x1, %esi
callq 0x3540
movq 0x30(%rbx), %rdi
callq 0x33f0
testl %eax, %eax
je 0x17efe
orb $0x4, (%rbx)
jmp 0x1809f
movq 0x38(%rbx), %r14
testq %r14, %r14
je 0x17fed
leaq 0x38(%r14), %r15
movq %r15, %rdi
callq 0x35e0
movl $0x1, 0xc(%r14)
movl $0x0, 0x10(%r14)
leaq 0x60(%r14), %rdi
movq %rdi, (%rsp)
callq 0x30f0
movq %r15, %rdi
callq 0x33d0
cmpl $0x2, (%r14)
jl 0x17f62
movl $0x1, %r12d
movq 0x30(%r14), %rax
movq (%rax,%r12,8), %rdi
xorl %esi, %esi
callq 0x3580
incq %r12
movslq (%r14), %rax
cmpq %rax, %r12
jl 0x17f48
cmpl $0x0, 0x4(%r14)
jle 0x17f85
xorl %r12d, %r12d
movq 0x18(%r14), %rax
movq (%rax,%r12,8), %rdi
callq 0x3060
incq %r12
movslq 0x4(%r14), %rax
cmpq %rax, %r12
jl 0x17f6c
cmpl $0x0, (%r14)
jle 0x17fb0
movl $0x10, %r13d
xorl %r12d, %r12d
movq 0x28(%r14), %rax
movq (%rax,%r13), %rdi
callq 0x3060
incq %r12
movslq (%r14), %rax
addq $0x28, %r13
cmpq %rax, %r12
jl 0x17f94
movq 0x18(%r14), %rdi
callq 0x3060
movq 0x20(%r14), %rdi
callq 0x3060
movq 0x28(%r14), %rdi
callq 0x3060
movq 0x30(%r14), %rdi
callq 0x3060
movq (%rsp), %rdi
callq 0x3480
movq %r15, %rdi
callq 0x3220
movq %r14, %rdi
callq 0x3060
testb $0x3, 0x2(%rbx)
movq 0x30(%rbx), %rdi
je 0x17ffe
callq 0x31c0
jmp 0x18003
callq 0x157a8
testl %eax, %eax
jne 0x1809f
movq 0x18(%rbx), %rdi
callq 0x3060
movq 0x20(%rbx), %rdi
callq 0x3060
testb $0x3, 0x2(%rbx)
jne 0x18095
movq 0x28(%rbx), %r14
cmpl $0x0, (%r14)
je 0x18072
movl $0x4, %r15d
xorl %r12d, %r12d
xorl %r13d, %r13d
movq 0x10(%r14), %rax
movl %r13d, %ecx
shrl $0x4, %ecx
movl (%rax,%rcx,4), %eax
movl %r12d, %ecx
andb $0x1e, %cl
shrl %cl, %eax
testb $0x3, %al
jne 0x1805f
movq 0x20(%r14), %rax
movq (%rax,%r15,2), %rdi
callq 0x3060
incq %r13
movl (%r14), %eax
addq $0xc, %r15
addl $0x2, %r12d
cmpq %rax, %r13
jb 0x18039
movq 0x18(%r14), %rdi
callq 0x3060
movq 0x10(%r14), %rdi
callq 0x3060
movq 0x20(%r14), %rdi
callq 0x3060
movq %r14, %rdi
callq 0x3060
movq %rbx, %rdi
callq 0x3060
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/xiongxu[P]bam2bedGraph2/samtools-0.1.19/bgzf.c
// Function: bgzf_check_EOF
int bgzf_check_EOF(BGZF *fp)
{
	static uint8_t magic[28] = "\037\213\010\4\0\0\0\0\0\377\6\0\102\103\2\0\033\0\3\0\0\0\0\0\0\0\0\0";
	uint8_t buf[28];
	off_t offset;
	offset = _bgzf_tell((_bgzf_file_t)fp->fp);
	if (_bgzf_seek(fp->fp, -28, SEEK_END) < 0) return 0;
	_bgzf_read(fp->fp, buf, 28);
	_bgzf_seek(fp->fp, offset, SEEK_SET);
	return (memcmp(magic, buf, 28) == 0)? 1 : 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x20, %rsp
movq %rdi, %r14
movq 0x30(%rdi), %rdi
movq 0x8(%rdi), %rbx
movq $-0x1c, %rsi
movl $0x2, %edx
callq 0x158e6
testq %rax, %rax
js 0x18139
movq 0x30(%r14), %rdi
movq %rsp, %r15
movl $0x1c, %edx
movq %r15, %rsi
callq 0x1582a
movq 0x30(%r14), %rdi
movq %rbx, %rsi
xorl %edx, %edx
callq 0x158e6
movdqa 0xa923(%rip), %xmm0     # 0x22a30
movdqu 0xa927(%rip), %xmm1     # 0x22a3c
movdqu 0xc(%r15), %xmm2
pcmpeqb %xmm1, %xmm2
pcmpeqb (%r15), %xmm0
pand %xmm2, %xmm0
pmovmskb %xmm0, %ecx
xorl %eax, %eax
cmpl $0xffff, %ecx           # imm = 0xFFFF
sete %al
jmp 0x1813b
xorl %eax, %eax
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/xiongxu[P]bam2bedGraph2/samtools-0.1.19/bgzf.c
// Function: bgzf_seek
int64_t bgzf_seek(BGZF* fp, int64_t pos, int where)
{
	int block_offset;
	int64_t block_address;

	if (fp->is_write || where != SEEK_SET) {
		fp->errcode |= BGZF_ERR_MISUSE;
		return -1;
	}
	block_offset = pos & 0xFFFF;
	block_address = pos >> 16;
	if (_bgzf_seek(fp->fp, block_address, SEEK_SET) < 0) {
		fp->errcode |= BGZF_ERR_IO;
		return -1;
	}
	fp->block_length = 0;  // indicates current block has not been loaded
	fp->block_address = block_address;
	fp->block_offset = block_offset;
	return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
movq %rdi, %rbx
movl (%rdi), %eax
movl %eax, %ecx
andl $0x30000, %ecx          # imm = 0x30000
orl %edx, %ecx
je 0x18169
orl $0x8, %eax
movl %eax, (%rbx)
movq $-0x1, %rax
jmp 0x1819a
movq %rsi, %r14
movq %rsi, %r15
sarq $0x10, %r15
movq 0x30(%rbx), %rdi
movq %r15, %rsi
xorl %edx, %edx
callq 0x158e6
testq %rax, %rax
js 0x181a0
movzwl %r14w, %eax
movl $0x0, 0x8(%rbx)
movq %r15, 0x10(%rbx)
movl %eax, 0xc(%rbx)
xorl %eax, %eax
popq %rbx
popq %r14
popq %r15
retq
orb $0x4, (%rbx)
jmp 0x18160
// File: /workspace/github_c_makefile_star2_O1/xiongxu[P]bam2bedGraph2/samtools-0.1.19/bgzf.c
// Function: bgzf_is_bgzf
int bgzf_is_bgzf(const char *fn)
{
	uint8_t buf[16];
	int n;
	_bgzf_file_t fp;
	if ((fp = _bgzf_open(fn, "r")) == 0) return 0;
	n = _bgzf_read(fp, buf, 16);
	_bgzf_close(fp);
	if (n != 16) return 0;
	return memcmp(g_magic, buf, 16) == 0? 1 : 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x10, %rsp
leaq 0x3651(%rip), %rsi      # 0x1b806
callq 0x156b5
xorl %ebx, %ebx
testq %rax, %rax
je 0x18200
movq %rax, %r14
movq %rsp, %rsi
movl $0x10, %edx
movq %rax, %rdi
callq 0x1582a
movq %rax, %r15
movq %r14, %rdi
callq 0x157a8
cmpl $0x10, %r15d
jne 0x18200
movdqa (%rsp), %xmm0
pcmpeqb 0x3e1e(%rip), %xmm0     # 0x1c010
pmovmskb %xmm0, %eax
xorl %ebx, %ebx
cmpl $0xffff, %eax           # imm = 0xFFFF
sete %bl
movl %ebx, %eax
addq $0x10, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/xiongxu[P]bam2bedGraph2/samtools-0.1.19/bgzf.c
// Function: bgzf_getc
int bgzf_getc(BGZF *fp)
{
	int c;
	if (fp->block_offset >= fp->block_length) {
		if (bgzf_read_block(fp) != 0) return -2; /* error */
		if (fp->block_length == 0) return -1; /* end-of-file */
	}
	c = ((unsigned char*)fp->uncompressed_block)[fp->block_offset++];
    if (fp->block_offset == fp->block_length) {
        fp->block_address = _bgzf_tell((_bgzf_file_t)fp->fp);
        fp->block_offset = 0;
        fp->block_length = 0;
    }
	return c;
}

// Assembly:
pushq %rbx
movq %rdi, %rbx
movl 0xc(%rdi), %eax
cmpl 0x8(%rdi), %eax
jge 0x18245
movq 0x18(%rbx), %rax
movslq 0xc(%rbx), %rcx
leal 0x1(%rcx), %edx
movl %edx, 0xc(%rbx)
movzbl (%rax,%rcx), %eax
cmpl 0x8(%rbx), %edx
jne 0x18258
movq 0x30(%rbx), %rcx
movq 0x8(%rcx), %rcx
movq %rcx, 0x10(%rbx)
movq $0x0, 0x8(%rbx)
jmp 0x18258
movq %rbx, %rdi
callq 0x17434
movl %eax, %ecx
movl $0xfffffffe, %eax       # imm = 0xFFFFFFFE
testl %ecx, %ecx
je 0x1825a
popq %rbx
retq
cmpl $0x0, 0x8(%rbx)
jne 0x18218
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x18258
// File: /workspace/github_c_makefile_star2_O1/xiongxu[P]bam2bedGraph2/samtools-0.1.19/bgzf.c
// Function: bgzf_getline
int bgzf_getline(BGZF *fp, int delim, kstring_t *str)
{
	int l, state = 0;
	unsigned char *buf = (unsigned char*)fp->uncompressed_block;
	str->l = 0;
	do {
		if (fp->block_offset >= fp->block_length) {
			if (bgzf_read_block(fp) != 0) { state = -2; break; }
			if (fp->block_length == 0) { state = -1; break; }
		}
		for (l = fp->block_offset; l < fp->block_length && buf[l] != delim; ++l);
		if (l < fp->block_length) state = 1;
		l -= fp->block_offset;
		if (str->l + l + 1 >= str->m) {
			str->m = str->l + l + 2;
			kroundup32(str->m);
			str->s = (char*)realloc(str->s, str->m);
		}
		memcpy(str->s + str->l, buf + fp->block_offset, l);
		str->l += l;
		fp->block_offset += l + 1;
		if (fp->block_offset >= fp->block_length) {
			fp->block_address = _bgzf_tell((_bgzf_file_t)fp->fp);
			fp->block_offset = 0;
			fp->block_length = 0;
		} 
	} while (state == 0);
	if (str->l == 0 && state < 0) return state;
	str->s[str->l] = 0;
	return str->l;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rdx, %rbx
movl %esi, %ebp
movq %rdi, %r14
movq 0x18(%rdi), %r12
movq $0x0, (%rdx)
leaq 0x1(%r12), %rax
movq %rax, (%rsp)
movl 0xc(%r14), %eax
cmpl 0x8(%r14), %eax
jl 0x182b5
movq %r14, %rdi
callq 0x17434
movb $0x1, %cl
testl %eax, %eax
jne 0x183cd
cmpl $0x0, 0x8(%r14)
je 0x183d4
movl 0x8(%r14), %ecx
movl 0xc(%r14), %eax
cmpl %ecx, %eax
setl %r13b
jge 0x1830f
movslq %eax, %rsi
movzbl (%r12,%rsi), %edi
movl %eax, %edx
cmpl %ebp, %edi
je 0x18322
movslq %ecx, %rdi
movq (%rsp), %rdx
leaq (%rdx,%rsi), %r8
movl $0x1, %r9d
subl %ecx, %r9d
addq %rax, %r9
xorl %edx, %edx
movl %r9d, %r10d
addl %edx, %r10d
je 0x18313
movzbl (%r8,%rdx), %r10d
incq %rdx
cmpl %ebp, %r10d
jne 0x182ec
addq %rdx, %rsi
cmpq %rdi, %rsi
setl %r13b
addl %eax, %edx
jmp 0x18322
movl %eax, %edx
jmp 0x18322
addq %rsi, %rdx
incq %rdx
cmpq %rdi, %rdx
setl %r13b
movl %ecx, %edx
subl %eax, %edx
movq (%rbx), %rax
movslq %edx, %r15
addq %r15, %rax
incq %rax
cmpq 0x8(%rbx), %rax
jb 0x1837b
movq %rax, %rcx
shrq %rcx
orq %rax, %rcx
movq %rcx, %rax
shrq $0x2, %rax
orq %rcx, %rax
movq %rax, %rcx
shrq $0x4, %rcx
orq %rax, %rcx
movq %rcx, %rax
shrq $0x8, %rax
orq %rcx, %rax
movq %rax, %rsi
shrq $0x10, %rsi
orq %rax, %rsi
incq %rsi
movq %rsi, 0x8(%rbx)
movq 0x10(%rbx), %rdi
callq 0x3430
movq %rax, 0x10(%rbx)
movq 0x10(%rbx), %rdi
addq (%rbx), %rdi
movslq 0xc(%r14), %rsi
addq %r12, %rsi
movq %r15, %rdx
callq 0x3370
addq %r15, (%rbx)
movl 0xc(%r14), %eax
addl %r15d, %eax
incl %eax
movl %eax, 0xc(%r14)
cmpl 0x8(%r14), %eax
jl 0x183bb
movq 0x30(%r14), %rax
movq 0x8(%rax), %rax
movq %rax, 0x10(%r14)
movq $0x0, 0x8(%r14)
testb %r13b, %r13b
je 0x1828e
movl $0x1, %eax
xorl %ecx, %ecx
jmp 0x183d9
movl $0xfffffffe, %eax       # imm = 0xFFFFFFFE
jmp 0x183d9
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
movq (%rbx), %rdx
testq %rdx, %rdx
sete %sil
testb %sil, %cl
jne 0x183f2
movq 0x10(%rbx), %rax
movb $0x0, (%rax,%rdx)
movl (%rbx), %eax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/xiongxu[P]bam2bedGraph2/samtools-0.1.19/bgzf.c
// Function: bgzf_read_init
static BGZF *bgzf_read_init()
{
	BGZF *fp;
	fp = calloc(1, sizeof(BGZF));
	fp->is_write = 0;
	fp->uncompressed_block = malloc(BGZF_MAX_BLOCK_SIZE);
	fp->compressed_block = malloc(BGZF_MAX_BLOCK_SIZE);
#ifdef BGZF_CACHE
	fp->cache = kh_init(cache);
#endif
	return fp;
}

// Assembly:
pushq %rbx
movl $0x1, %edi
movl $0x40, %esi
callq 0x32e0
movq %rax, %rbx
andb $-0x4, 0x2(%rax)
movl $0x10000, %edi          # imm = 0x10000
callq 0x33e0
movq %rax, 0x18(%rbx)
movl $0x10000, %edi          # imm = 0x10000
callq 0x33e0
movq %rax, 0x20(%rbx)
movl $0x1, %edi
movl $0x28, %esi
callq 0x32e0
movq %rax, 0x28(%rbx)
movq %rbx, %rax
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O1/xiongxu[P]bam2bedGraph2/samtools-0.1.19/bgzf.c
// Function: worker_aux
static int worker_aux(worker_t *w)
{
	int i, tmp, stop = 0;
	// wait for condition: to process or all done
	pthread_mutex_lock(&w->mt->lock);
	while (!w->toproc && !w->mt->done)
		pthread_cond_wait(&w->mt->cv, &w->mt->lock);
	if (w->mt->done) stop = 1;
	w->toproc = 0;
	pthread_mutex_unlock(&w->mt->lock);
	if (stop) return 1; // to quit the thread
	w->errcode = 0;
	for (i = w->i; i < w->mt->curr; i += w->mt->n_threads) {
		int clen = BGZF_MAX_BLOCK_SIZE;
		if (bgzf_compress(w->buf, &clen, w->mt->blk[i], w->mt->len[i], w->fp->compress_level) != 0)
			w->errcode |= BGZF_ERR_ZLIB;
		memcpy(w->mt->blk[i], w->buf, clen);
		w->mt->len[i] = clen;
	}
	tmp = __sync_fetch_and_add(&w->mt->proc_cnt, 1);
	return 0;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x10, %rsp
movq %rdi, %rbx
movq 0x8(%rdi), %rdi
addq $0x38, %rdi
callq 0x35e0
cmpl $0x0, 0x20(%rbx)
jne 0x18722
movq 0x8(%rbx), %rsi
cmpl $0x0, 0xc(%rsi)
jne 0x18722
leaq 0x60(%rsi), %rdi
addq $0x38, %rsi
callq 0x31b0
jmp 0x18703
movq 0x8(%rbx), %rdi
movl 0xc(%rdi), %ebp
movl $0x0, 0x20(%rbx)
addq $0x38, %rdi
callq 0x33d0
movl $0x1, %eax
testl %ebp, %ebp
jne 0x187d4
movl $0x0, 0x1c(%rbx)
movl 0x18(%rbx), %ecx
movq 0x8(%rbx), %rax
cmpl 0x8(%rax), %ecx
jge 0x187ce
leaq 0xc(%rsp), %r14
movl $0x10000, 0xc(%rsp)     # imm = 0x10000
movq (%rbx), %rsi
movq 0x10(%rbx), %rdi
movslq %ecx, %r12
movq 0x18(%rax), %rcx
movq 0x20(%rax), %rax
movq (%rcx,%r12,8), %rdx
movl (%rax,%r12,4), %ecx
movl (%rsi), %r8d
sarl $0x12, %r8d
movq %r14, %rsi
callq 0x187e1
testl %eax, %eax
je 0x18797
orb $0x1, 0x1c(%rbx)
movq 0x8(%rbx), %rax
movq 0x10(%rbx), %rsi
movq 0x18(%rax), %rax
movq (%rax,%r12,8), %rdi
movslq 0xc(%rsp), %r15
movq %r15, %rdx
callq 0x3370
movq 0x8(%rbx), %rax
movq 0x20(%rax), %rcx
movl %r15d, (%rcx,%r12,4)
movl (%rax), %ecx
addl %r12d, %ecx
movq 0x8(%rbx), %rax
cmpl 0x8(%rax), %ecx
jl 0x1875e
lock
incl 0x10(%rax)
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/xiongxu[P]bam2bedGraph2/samtools-0.1.19/bgzf.c
// Function: bgzf_compress
static int bgzf_compress(void *_dst, int *dlen, void *src, int slen, int level)
{
	uint32_t crc;
	z_stream zs;
	uint8_t *dst = (uint8_t*)_dst;

	// compress the body
	zs.zalloc = NULL; zs.zfree = NULL;
	zs.next_in  = src;
	zs.avail_in = slen;
	zs.next_out = dst + BLOCK_HEADER_LENGTH;
	zs.avail_out = *dlen - BLOCK_HEADER_LENGTH - BLOCK_FOOTER_LENGTH;
	if (deflateInit2(&zs, level, Z_DEFLATED, -15, 8, Z_DEFAULT_STRATEGY) != Z_OK) return -1; // -15 to disable zlib header/footer
	if (deflate(&zs, Z_FINISH) != Z_STREAM_END) return -1;
	if (deflateEnd(&zs) != Z_OK) return -1;
	*dlen = zs.total_out + BLOCK_HEADER_LENGTH + BLOCK_FOOTER_LENGTH;
	// write the header
	memcpy(dst, g_magic, BLOCK_HEADER_LENGTH); // the last two bytes are a place holder for the length of the block
	packInt16(&dst[16], *dlen - 1); // write the compressed length; -1 to fit 2 bytes
	// write the footer
	crc = crc32(crc32(0L, NULL, 0L), src, slen);
	packInt32((uint8_t*)&dst[*dlen - 8], crc);
	packInt32((uint8_t*)&dst[*dlen - 4], slen);
	return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x70, %rsp
movl %ecx, %ebx
movq %rdx, %r12
movq %rsi, %r15
movq %rdi, %r14
xorps %xmm0, %xmm0
movq %rsp, %rdi
movups %xmm0, 0x40(%rdi)
movq %rdx, (%rdi)
movl %ecx, 0x8(%rdi)
leaq 0x12(%r14), %rax
movq %rax, 0x18(%rdi)
movl (%rsi), %eax
addl $-0x1a, %eax
movl %eax, 0x20(%rdi)
leaq 0x2f5f(%rip), %rax      # 0x1b77f
movl %r8d, %esi
movl $0x8, %edx
movl $0xfffffff1, %ecx       # imm = 0xFFFFFFF1
movl $0x8, %r8d
xorl %r9d, %r9d
pushq $0x70
pushq %rax
callq 0x3290
addq $0x10, %rsp
movl $0xffffffff, %r13d      # imm = 0xFFFFFFFF
testl %eax, %eax
jne 0x188bb
movq %rsp, %rdi
movl $0x4, %esi
callq 0x3250
cmpl $0x1, %eax
jne 0x188bb
movq %rsp, %rdi
callq 0x3420
testl %eax, %eax
jne 0x188bb
movl 0x28(%rsp), %eax
addl $0x1a, %eax
movl %eax, (%r15)
movaps 0x38e5(%rip), %xmm0     # 0x1c160
movups %xmm0, (%r14)
movw $0x0, 0x10(%r14)
movl (%r15), %eax
decl %eax
movw %ax, 0x10(%r14)
xorl %r13d, %r13d
xorl %edi, %edi
xorl %esi, %esi
xorl %edx, %edx
callq 0x3180
movq %rax, %rdi
movq %r12, %rsi
movl %ebx, %edx
callq 0x3180
movslq (%r15), %rcx
movl %eax, -0x8(%r14,%rcx)
movslq (%r15), %rax
movl %ebx, -0x4(%r14,%rax)
movl %r13d, %eax
addq $0x70, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/xiongxu[P]bam2bedGraph2/samtools-0.1.19/bgzf.c
// Function: mt_queue
static void mt_queue(BGZF *fp)
{
	mtaux_t *mt = (mtaux_t*)fp->mt;
	assert(mt->curr < mt->n_blks); // guaranteed by the caller
	memcpy(mt->blk[mt->curr], fp->uncompressed_block, fp->block_offset);
	mt->len[mt->curr] = fp->block_offset;
	fp->block_offset = 0;
	++mt->curr;
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
movq 0x38(%rdi), %r14
movslq 0x8(%r14), %rax
cmpl 0x4(%r14), %eax
jge 0x18917
movq %rdi, %rbx
movq 0x18(%r14), %rcx
movq (%rcx,%rax,8), %rdi
movq 0x18(%rbx), %rsi
movslq 0xc(%rbx), %rdx
callq 0x3370
movl 0xc(%rbx), %eax
movq 0x20(%r14), %rcx
movslq 0x8(%r14), %rdx
movl %eax, (%rcx,%rdx,4)
movl $0x0, 0xc(%rbx)
incl 0x8(%r14)
addq $0x8, %rsp
popq %rbx
popq %r14
retq
leaq 0x380a(%rip), %rdi      # 0x1c128
leaq 0x3730(%rip), %rsi      # 0x1c055
leaq 0x3812(%rip), %rcx      # 0x1c13e
movl $0x1d7, %edx            # imm = 0x1D7
callq 0x3230
nop
// File: /workspace/github_c_makefile_star2_O1/xiongxu[P]bam2bedGraph2/samtools-0.1.19/kstring.c
// Function: ksprintf
int ksprintf(kstring_t *s, const char *fmt, ...)
{
	va_list ap;
	int l;
	va_start(ap, fmt);
	l = vsnprintf(s->s + s->l, s->m - s->l, fmt, ap); // This line does not work with glibc 2.0. See `man snprintf'.
	va_end(ap);
	if (l + 1 > s->m - s->l) {
		s->m = s->l + l + 2;
		kroundup32(s->m);
		s->s = (char*)realloc(s->s, s->m);
		va_start(ap, fmt);
		l = vsnprintf(s->s + s->l, s->m - s->l, fmt, ap);
	}
	va_end(ap);
	s->l += l;
	return l;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0xd0, %rsp
movq %rsi, %r14
movq %rdi, %rbx
leaq 0x20(%rsp), %r15
movq %rdx, 0x10(%r15)
movq %rcx, 0x18(%r15)
movq %r8, 0x20(%r15)
movq %r9, 0x28(%r15)
testb %al, %al
je 0x1899e
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 %r15, 0x10(%rcx)
leaq 0x100(%rsp), %r12
movq %r12, 0x8(%rcx)
movabsq $0x3000000010, %r13     # imm = 0x3000000010
movq %r13, (%rcx)
movq (%rdi), %rax
movq 0x8(%rdi), %rsi
movq 0x10(%rdi), %rdi
addq %rax, %rdi
subq %rax, %rsi
movq %r14, %rdx
callq 0x3150
leal 0x1(%rax), %ecx
movslq %ecx, %rdx
movq (%rbx), %rcx
movq 0x8(%rbx), %rsi
subq %rcx, %rsi
cmpq %rdx, %rsi
jae 0x18a60
cltq
addq %rcx, %rax
incq %rax
movq %rax, %rcx
shrq %rcx
orq %rax, %rcx
movq %rcx, %rax
shrq $0x2, %rax
orq %rcx, %rax
movq %rax, %rcx
shrq $0x4, %rcx
orq %rax, %rcx
movq %rcx, %rax
shrq $0x8, %rax
orq %rcx, %rax
movq %rax, %rsi
shrq $0x10, %rsi
orq %rax, %rsi
incq %rsi
movq %rsi, 0x8(%rbx)
movq 0x10(%rbx), %rdi
callq 0x3430
movq %rax, 0x10(%rbx)
movq %rsp, %rcx
movq %r13, (%rcx)
movq %r12, 0x8(%rcx)
movq %r15, 0x10(%rcx)
movq (%rbx), %rax
movq 0x8(%rbx), %rsi
movq 0x10(%rbx), %rdi
addq %rax, %rdi
subq %rax, %rsi
movq %r14, %rdx
callq 0x3150
cltq
addq %rax, (%rbx)
addq $0xd0, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O1/xiongxu[P]bam2bedGraph2/samtools-0.1.19/kstring.c
// Function: kstrtok
char *kstrtok(const char *str, const char *sep, ks_tokaux_t *aux)
{
	const char *p, *start;
	if (sep) { // set up the table
		if (str == 0 && (aux->tab[0]&1)) return 0; // no need to set up if we have finished
		aux->finished = 0;
		if (sep[1]) {
			aux->sep = -1;
			aux->tab[0] = aux->tab[1] = aux->tab[2] = aux->tab[3] = 0;
			for (p = sep; *p; ++p) aux->tab[*p>>6] |= 1ull<<(*p&0x3f);
		} else aux->sep = sep[0];
	}
	if (aux->finished) return 0;
	else if (str) aux->p = str - 1, aux->finished = 0;
	if (aux->sep < 0) {
		for (p = start = aux->p + 1; *p; ++p)
			if (aux->tab[*p>>6]>>(*p&0x3f)&1) break;
	} else {
		for (p = start = aux->p + 1; *p; ++p)
			if (*p == aux->sep) break;
	}
	aux->p = p; // end of token
	if (*p == 0) aux->finished = 1; // no more tokens
	return (char*)start;
}

// Assembly:
testq %rsi, %rsi
je 0x18ad2
testq %rdi, %rdi
jne 0x18a85
testb $0x1, (%rdx)
jne 0x18ad8
movl $0x0, 0x24(%rdx)
cmpb $0x0, 0x1(%rsi)
je 0x18acc
movl $0xffffffff, 0x20(%rdx) # imm = 0xFFFFFFFF
xorps %xmm0, %xmm0
movups %xmm0, (%rdx)
movups %xmm0, 0x10(%rdx)
movb (%rsi), %al
testb %al, %al
je 0x18ad2
incq %rsi
movsbl %al, %ecx
movl $0x1, %eax
shlq %cl, %rax
sarl $0x6, %ecx
movslq %ecx, %rcx
orq %rax, (%rdx,%rcx,8)
movb (%rsi), %al
incq %rsi
testb %al, %al
jne 0x18aac
jmp 0x18ad2
movsbl (%rsi), %eax
movl %eax, 0x20(%rdx)
cmpl $0x0, 0x24(%rdx)
je 0x18adb
xorl %eax, %eax
retq
testq %rdi, %rdi
je 0x18aee
decq %rdi
movq %rdi, 0x28(%rdx)
movl $0x0, 0x24(%rdx)
movl 0x20(%rdx), %esi
movq 0x28(%rdx), %rcx
leaq 0x1(%rcx), %rax
testl %esi, %esi
js 0x18b0e
movsbl 0x1(%rcx), %edi
incq %rcx
testl %edi, %edi
je 0x18b40
cmpl %edi, %esi
jne 0x18afd
jmp 0x18b40
movb (%rax), %sil
movq %rax, %rcx
testb %sil, %sil
je 0x18b40
movq %rax, %rcx
movsbl %sil, %esi
movzbl %sil, %edi
sarl $0x6, %esi
movslq %esi, %rsi
movq (%rdx,%rsi,8), %rsi
btq %rdi, %rsi
jb 0x18b40
movb 0x1(%rcx), %sil
incq %rcx
testb %sil, %sil
jne 0x18b1c
movq %rcx, 0x28(%rdx)
cmpb $0x0, (%rcx)
je 0x18b4a
retq
movl $0x1, 0x24(%rdx)
retq
// File: /workspace/github_c_makefile_star2_O1/mjosaarinen[P]brutus/crypto_aead/shellaes128v1d5n64/ref/aes.c
// Function: aesKeySetupEnc
void aesKeySetupEnc(u32 rk[], const u8 key[]) {
   	int i = 0;
	u32 temp;

	rk[0] = GETU32(key     );
	rk[1] = GETU32(key +  4);
	rk[2] = GETU32(key +  8);
	rk[3] = GETU32(key + 12);

    for (i=0; i<10; ++i) {
		temp  = rk[3];
		rk[4] = rk[0] ^
			(Te4[(temp >> 16) & 0xff] & 0xff000000) ^
			(Te4[(temp >>  8) & 0xff] & 0x00ff0000) ^
			(Te4[(temp      ) & 0xff] & 0x0000ff00) ^
			(Te4[(temp >> 24)       ] & 0x000000ff) ^
			rcon[i];
		rk[5] = rk[1] ^ rk[4];
		rk[6] = rk[2] ^ rk[5];
		rk[7] = rk[3] ^ rk[6];

		rk += 4;
	}
}

// Assembly:
movl (%rsi), %eax
movbel %eax, (%rdi)
movl 0x4(%rsi), %eax
movbel %eax, 0x4(%rdi)
movl 0x8(%rsi), %eax
movbel %eax, 0x8(%rdi)
movl 0xc(%rsi), %eax
movbel %eax, 0xc(%rdi)
xorl %eax, %eax
leaq 0x4c9d(%rip), %rcx      # 0x7000
movl $0xff, %edx
leaq 0x5091(%rip), %rsi      # 0x7400
movl 0xc(%rdi,%rax,4), %r8d
movl %r8d, %r9d
shrl $0xe, %r9d
andl $0x3fc, %r9d            # imm = 0x3FC
movzbl 0x3(%r9,%rcx), %r9d
shll $0x18, %r9d
xorl (%rdi,%rax,4), %r9d
movl %r8d, %r10d
shrl $0x8, %r10d
andl %edx, %r10d
movzbl 0x2(%rcx,%r10,4), %r10d
shll $0x10, %r10d
movl %r8d, %r11d
andl %edx, %r11d
movzbl 0x1(%rcx,%r11,4), %r11d
shll $0x8, %r11d
xorl %r10d, %r11d
movl %r8d, %r10d
shrl $0x18, %r10d
movzbl (%rcx,%r10,4), %r10d
xorl %r11d, %r10d
xorl %r9d, %r10d
xorl (%rax,%rsi), %r10d
movl %r10d, 0x10(%rdi,%rax,4)
xorl 0x4(%rdi,%rax,4), %r10d
movl %r10d, 0x14(%rdi,%rax,4)
xorl 0x8(%rdi,%rax,4), %r10d
movl %r10d, 0x18(%rdi,%rax,4)
xorl %r8d, %r10d
movl %r10d, 0x1c(%rdi,%rax,4)
addq $0x4, %rax
cmpq $0x28, %rax
jne 0x236f
retq
// File: /workspace/github_c_makefile_star2_O1/mjosaarinen[P]brutus/crypto_aead/shellaes128v1d5n64/ref/shellaes.c
// Function: printf_byte_string
void printf_byte_string(const u8 b[], unsigned long long int blen){
    unsigned long long int i;

    for(i=0; i<blen; ++i){
        printf("%3x", b[i]);

        if(i%16==15&&i!=0){
            printf("\n");
        }
    }
    printf("\n");
}

// Assembly:
testq %rsi, %rsi
je 0x3772
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x8abe(%rip), %r15      # 0xc1f8
xorl %r12d, %r12d
movzbl (%r14,%r12), %esi
movq %r15, %rdi
xorl %eax, %eax
callq 0x2050
movl %r12d, %eax
notl %eax
testb $0xf, %al
jne 0x375f
movl $0xa, %edi
callq 0x20c0
incq %r12
cmpq %r12, %rbx
jne 0x373d
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
movl $0xa, %edi
jmp 0x20c0
// File: /workspace/github_c_makefile_star2_O1/mjosaarinen[P]brutus/crypto_aead/shellaes128v1d5n64/ref/shellaes.c
// Function: checksum_state_string
void checksum_state_string(const u8 byte1[], u8 checksum[], unsigned long long int blen){
    memset(checksum, 0x00, 16);

    while(blen!=0){
        xor_byte_string(byte1, checksum, 16);
        byte1+=16;
        blen-=16;
    }
}

// Assembly:
vxorps %xmm0, %xmm0, %xmm0
vmovups %xmm0, (%rsi)
testq %rdx, %rdx
je 0x37ba
xorl %eax, %eax
movb (%rdi,%rax), %cl
xorb %cl, (%rsi,%rax)
incq %rax
cmpq $0x10, %rax
jne 0x37a1
addq $0x10, %rdi
addq $-0x10, %rdx
jne 0x379f
retq
// File: /workspace/github_c_makefile_star2_O1/mjosaarinen[P]brutus/crypto_aead/shellaes128v1d5n64/ref/shellaes.c
// Function: KeySetupEnc
void KeySetupEnc(u32 mk[], u32 sk[], u8 L[], u8 Lprime[], u8 keyprime[], const u32 rk[], const u8 key[]){

    u8 pt[16];
    u8 ct[16];

    int i;


    /* generate Keyprime for CENC*/
    for(i=0; i<16; ++i){
        keyprime[i]=key[i]^0xF0;
    }

    /* produce L for masks of AES*/
    memset(pt, 0x00, 16);
    aesEncrypt(rk, pt, L);

    /*produce the subkeys for auxiliary permutations*/
    for(i=1; i<=3*d; ++i){
        pt[15]=i;
        aesEncrypt(rk, pt, ct);

        sk[0]=GETU32(ct);
        sk[1]=GETU32(ct+4);
        sk[2]=GETU32(ct+8);
        sk[3]=GETU32(ct+12);

        sk=sk+4;
    }

    /*produce the mask keys for auxiliary permutations*/
    for(i=3*d+1; i<=4*d; ++i){
        pt[15]=i;

        aesEncrypt(rk, pt, ct);

        mk[0]=GETU32(ct);
        mk[1]=GETU32(ct+4);
        mk[2]=GETU32(ct+8);
        mk[3]=GETU32(ct+12);

        mk=mk+4;
    }

    /*produce Lprime for XEX layer*/

    memset(pt, 0xFF, 16);
    aesEncrypt(rk, pt, Lprime);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x28, %rsp
movq %r9, %r14
movq %rcx, 0x20(%rsp)
movq %rsi, %r12
movq %rdi, %r15
movq 0x60(%rsp), %rax
xorl %ecx, %ecx
movb (%rax,%rcx), %sil
xorb $-0x10, %sil
movb %sil, (%r8,%rcx)
incq %rcx
cmpq $0x10, %rcx
jne 0x3ceb
vpxor %xmm0, %xmm0, %xmm0
leaq 0x10(%rsp), %rsi
vmovdqa %xmm0, (%rsi)
movq %r14, %rdi
callq 0x21e0
movb $0x1, %bl
xorl %r13d, %r13d
movq %rsp, %rbp
movb %bl, 0x1f(%rsp)
movq %r14, %rdi
leaq 0x10(%rsp), %rsi
movq %rbp, %rdx
callq 0x21e0
movl (%rsp), %eax
movbel %eax, (%r12,%r13)
movl 0x4(%rsp), %eax
movbel %eax, 0x4(%r12,%r13)
movl 0x8(%rsp), %eax
movbel %eax, 0x8(%r12,%r13)
movl 0xc(%rsp), %eax
movbel %eax, 0xc(%r12,%r13)
addq $0x10, %r13
incb %bl
cmpl $0xf0, %r13d
jne 0x3d1d
movb $0x10, %bpl
xorl %ebx, %ebx
leaq 0x10(%rsp), %r12
movq %rsp, %r13
movb %bpl, 0x1f(%rsp)
movq %r14, %rdi
movq %r12, %rsi
movq %r13, %rdx
callq 0x21e0
movl (%rsp), %eax
movbel %eax, (%r15,%rbx)
movl 0x4(%rsp), %eax
movbel %eax, 0x4(%r15,%rbx)
movl 0x8(%rsp), %eax
movbel %eax, 0x8(%r15,%rbx)
movl 0xc(%rsp), %eax
movbel %eax, 0xc(%r15,%rbx)
addq $0x10, %rbx
incb %bpl
cmpl $0x50, %ebx
jne 0x3d77
vpcmpeqd %xmm0, %xmm0, %xmm0
leaq 0x10(%rsp), %rsi
vmovdqa %xmm0, (%rsi)
movq %r14, %rdi
movq 0x20(%rsp), %rdx
callq 0x21e0
addq $0x28, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/mjosaarinen[P]brutus/crypto_aead/shellaes128v1d5n64/ref/shellaes.c
// Function: XEXLayerEnc
void XEXLayerEnc(const u32 rk[], const u8 Lprime[], const u8 Z[], u8 C[], unsigned long long int ctlen){

    u8 mask[16];
    u8 temp[16];
    u8 ct[16];

    memcpy(mask, Lprime, 16);

    while(ctlen!=0){
        double_mask(mask);

        memcpy(temp, Z, 16);

        xor_byte_string(mask, temp, 16);
        aesEncrypt(rk, temp, ct);
        xor_byte_string(mask, ct, 16);
        memcpy(C, ct, 16);

        C+=16;
        Z+=16;
        ctlen-=16;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
vmovups (%rsi), %xmm0
vmovaps %xmm0, (%rsp)
testq %r8, %r8
je 0x4760
movq %r8, %rbx
movq %rcx, %r14
movq %rdx, %r15
movq %rdi, %r12
leaq 0x20(%rsp), %r13
leaq 0x10(%rsp), %rbp
movl $0xf, %ecx
movb (%rsp), %al
xorl %edx, %edx
movb (%rsp,%rcx), %sil
leal (%rsi,%rsi), %edi
orb %dl, %dil
movb %dil, (%rsp,%rcx)
shrb $0x7, %sil
movl %esi, %edx
addq $-0x1, %rcx
jb 0x46ea
testb %al, %al
jns 0x470d
xorb $-0x79, 0xf(%rsp)
vmovups (%r15), %xmm0
vmovaps %xmm0, 0x20(%rsp)
vmovaps (%rsp), %xmm1
vmovaps %xmm1, 0x30(%rsp)
vxorps %xmm1, %xmm0, %xmm0
vmovaps %xmm0, 0x20(%rsp)
movq %r12, %rdi
movq %r13, %rsi
movq %rbp, %rdx
callq 0x21e0
vmovaps 0x30(%rsp), %xmm0
vxorps 0x10(%rsp), %xmm0, %xmm0
vmovaps %xmm0, 0x10(%rsp)
vmovups %xmm0, (%r14)
addq $0x10, %r14
addq $0x10, %r15
addq $-0x10, %rbx
jne 0x46e0
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/mjosaarinen[P]brutus/crypto_aead/shellaes128v1d5n64/ref/shellaes.c
// Function: XEXLayerDec
void XEXLayerDec(const u32 irk[], const u8 Lprime[], const u8 C[], u8 Z[], unsigned long long int ctlen){

    u8 mask[16];
    u8 temp[16];
    u8 pt[16];

    memcpy(mask, Lprime, 16);

    while(ctlen!=0){
        double_mask(mask);

        memcpy(temp, C, 16);
        xor_byte_string(mask, temp, 16);
        aesDecrypt(irk, temp, pt);
        xor_byte_string(mask, pt, 16);

        memcpy(Z, pt, 16);

        C+=16;
        Z+=16;
        ctlen-=16;
    }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
vmovups (%rsi), %xmm0
vmovaps %xmm0, (%rsp)
testq %r8, %r8
je 0x4825
movq %r8, %rbx
movq %rcx, %r14
movq %rdx, %r15
movq %rdi, %r12
leaq 0x20(%rsp), %r13
leaq 0x10(%rsp), %rbp
movl $0xf, %ecx
movb (%rsp), %al
xorl %edx, %edx
movb (%rsp,%rcx), %sil
leal (%rsi,%rsi), %edi
orb %dl, %dil
movb %dil, (%rsp,%rcx)
shrb $0x7, %sil
movl %esi, %edx
addq $-0x1, %rcx
jb 0x47af
testb %al, %al
jns 0x47d2
xorb $-0x79, 0xf(%rsp)
vmovups (%r15), %xmm0
vmovaps %xmm0, 0x20(%rsp)
vmovaps (%rsp), %xmm1
vmovaps %xmm1, 0x30(%rsp)
vxorps %xmm1, %xmm0, %xmm0
vmovaps %xmm0, 0x20(%rsp)
movq %r12, %rdi
movq %r13, %rsi
movq %rbp, %rdx
callq 0x20b0
vmovaps 0x30(%rsp), %xmm0
vxorps 0x10(%rsp), %xmm0, %xmm0
vmovaps %xmm0, 0x10(%rsp)
vmovups %xmm0, (%r14)
addq $0x10, %r15
addq $0x10, %r14
addq $-0x10, %rbx
jne 0x47a5
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O1/mjosaarinen[P]brutus/crypto_aead/shellaes128v1d5n64/ref/shellaes.c
// Function: tagVef
int tagVef(const u32 rk[], const u8 checksum[], const u8 Lprime[], const u8 U[], const u8 F[], const u8 T[], unsigned long long int ptlen){

    u8 tempT[16];
    int flag=1;
    int i;

    tagGen(rk, checksum, Lprime, U, F, tempT, ptlen);

    for(i=0; i<16; ++i){
        if(tempT[i]!=T[i]){
            flag=0;
        }
    }
    return flag;
}

// Assembly:
pushq %rbx
subq $0x20, %rsp
movq %r9, %rbx
movq 0x30(%rsp), %rax
movq %rax, (%rsp)
leaq 0x10(%rsp), %r9
callq 0x2080
kxorw %k0, %k0, %k0
xorl %eax, %eax
vmovq 0x10(%rsp,%rax), %xmm0
vmovq (%rbx,%rax), %xmm1
vpcmpneqb %xmm1, %xmm0, %k1
korb %k1, %k0, %k0
addq $0x8, %rax
cmpq $0x10, %rax
jne 0x4a4e
xorl %eax, %eax
kortestb %k0, %k0
sete %al
addq $0x20, %rsp
popq %rbx
retq