LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O3/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 0x17945
movq %rbx, %rdi
movl $0x72, %esi
callq 0x3200
testq %rax, %rax
jne 0x178d2
movq %rbx, %rdi
movl $0x52, %esi
callq 0x3200
testq %rax, %rax
je 0x178f3
leaq 0x504d(%rip), %rsi      # 0x1c926
movl %ebp, %edi
callq 0x15df7
testq %rax, %rax
je 0x1793e
movq %rax, %r14
callq 0x18c9c
movq %r14, 0x30(%rax)
jmp 0x17940
movq %rbx, %rdi
movl $0x77, %esi
callq 0x3200
testq %rax, %rax
jne 0x17917
movq %rbx, %rdi
movl $0x57, %esi
callq 0x3200
testq %rax, %rax
je 0x1793e
leaq 0x47cc(%rip), %rsi      # 0x1c0ea
movl %ebp, %edi
callq 0x3440
testq %rax, %rax
je 0x1793e
movq %rax, %r14
movq %rbx, %rdi
callq 0x1784d
movl %eax, %edi
callq 0x177eb
jmp 0x178ed
xorl %eax, %eax
popq %rbx
popq %r14
popq %rbp
retq
leaq 0x57f4(%rip), %rdi      # 0x1d140
leaq 0x5822(%rip), %rsi      # 0x1d175
leaq 0x584e(%rip), %rcx      # 0x1d1a8
movl $0xa0, %edx
callq 0x3230
// File: /workspace/github_c_makefile_star2_O3/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 0x1814e
movq %rdi, %r14
testb $0x3, 0x2(%rdi)
jne 0x18166
movq %rdx, %r15
movq %rsi, %r12
movl 0xc(%r14), %eax
xorl %ebx, %ebx
movl 0x8(%r14), %ecx
subl %eax, %ecx
jg 0x180f8
movq %r14, %rdi
callq 0x17964
testl %eax, %eax
jne 0x18152
movl 0x8(%r14), %ecx
movl 0xc(%r14), %eax
subl %eax, %ecx
jle 0x18132
movq %r15, %rdx
subq %rbx, %rdx
movl %ecx, %ecx
cmpq %rcx, %rdx
cmovgeq %rcx, %rdx
movslq %eax, %rsi
addq 0x18(%r14), %rsi
movslq %edx, %r13
movq %r12, %rdi
movq %r13, %rdx
callq 0x3370
movl 0xc(%r14), %eax
addl %r13d, %eax
movl %eax, 0xc(%r14)
addq %r13, %r12
addq %r13, %rbx
cmpq %r15, %rbx
jl 0x180d8
cmpl 0x8(%r14), %eax
jne 0x18159
movq 0x30(%r14), %rax
movq 0x8(%rax), %rax
movq %rax, 0x10(%r14)
movq $0x0, 0x8(%r14)
jmp 0x18159
xorl %ebx, %ebx
jmp 0x18159
movq $-0x1, %rbx
movq %rbx, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
leaq 0x505f(%rip), %rdi      # 0x1d1cc
leaq 0x5001(%rip), %rsi      # 0x1d175
leaq 0x5063(%rip), %rcx      # 0x1d1de
movl $0x15b, %edx            # imm = 0x15B
callq 0x3230
// File: /workspace/github_c_makefile_star2_O3/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 0x18307
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x38, %rsp
movl %esi, %ebp
cmpl $0x2, %esi
jl 0x182f9
movq %rdi, %rbx
cmpq $0x0, 0x38(%rdi)
jne 0x182f9
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, %r13
movl $0x4, %esi
movq %r13, %rdi
callq 0x32e0
movq %rax, 0x20(%r14)
movl $0x8, %esi
movq %r13, %rdi
callq 0x32e0
movq %rax, 0x18(%r14)
testl %r13d, %r13d
jle 0x18223
movq %rax, %r15
movl %r12d, %r12d
xorl %r13d, %r13d
movl $0x10000, %edi          # imm = 0x10000
callq 0x33e0
movq %rax, (%r15,%r13,8)
incq %r13
cmpq %r13, %r12
jne 0x1820d
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, %r12
movq %rax, 0x28(%r14)
addq $0x18, %r12
xorl %r13d, %r13d
movl %r13d, (%r12)
movq %r14, -0x10(%r12)
movq %rbx, -0x18(%r12)
movl $0x10000, %edi          # imm = 0x10000
callq 0x33e0
movq %rax, -0x8(%r12)
incq %r13
addq $0x28, %r12
cmpq %r13, %r15
jne 0x18252
movq %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 0x182f3
movl $0x1, %ebp
movl $0x28, %r15d
movl $0x8, %r12d
movq %rsp, %r13
movq 0x30(%r14), %rdi
addq %r12, %rdi
movq 0x28(%r14), %rcx
addq %r15, %rcx
movq %r13, %rsi
leaq 0x2d(%rip), %rdx        # 0x18308
callq 0x3450
incq %rbp
movslq (%r14), %rax
addq $0x28, %r15
addq $0x8, %r12
cmpq %rax, %rbp
jl 0x182c3
movq %r14, 0x38(%rbx)
xorl %eax, %eax
addq $0x38, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x1837d
movq %rdi, %r14
cmpq $0x0, 0x38(%rdi)
je 0x1836a
movq %r14, %rdi
callq 0x18385
jmp 0x1837d
movq %r14, %rdi
callq 0x18569
testl %eax, %eax
js 0x18378
movl %eax, %r15d
movq 0x20(%r14), %rdi
movq 0x30(%r14), %rcx
movl $0x1, %esi
movq %r15, %rdx
callq 0x3540
cmpq %r15, %rax
jne 0x18374
addq %r15, 0x10(%r14)
movl 0xc(%r14), %esi
testl %esi, %esi
jg 0x1833d
jmp 0x1837d
orb $0x4, (%r14)
movl $0xffffffff, %ebx       # imm = 0xFFFFFFFF
movl %ebx, %eax
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x18dd9
testl %eax, %eax
je 0x185a0
orb $0x1, (%rbx)
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x185ab
movl $0x0, 0xc(%rbx)
movl 0xc(%rsp), %eax
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x185eb
movq %rbx, %rdi
callq 0x18ec4
movl 0x8(%r14), %ecx
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
cmpl 0x4(%r14), %ecx
jne 0x18604
movq %rbx, %rdi
callq 0x18385
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x186fa
movq %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r15
cmpq $0x0, 0x38(%rdi)
je 0x18686
testq %rbx, %rbx
je 0x186eb
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 0x1867c
movq %r15, %rdi
callq 0x185d2
addq %r12, %r14
subq %r12, %r13
jne 0x1863b
jmp 0x186ed
xorl %r13d, %r13d
testq %rbx, %rbx
jle 0x186eb
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 0x186de
movq %r15, %rdi
callq 0x1831c
testl %eax, %eax
jne 0x186e6
movslq %r13d, %rax
cmpq %rbx, %rax
jl 0x18690
movslq %r13d, %rbx
jmp 0x186ed
xorl %ebx, %ebx
movq %rbx, %rax
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
retq
leaq 0x4b08(%rip), %rdi      # 0x1d209
leaq 0x4a6d(%rip), %rsi      # 0x1d175
leaq 0x4b07(%rip), %rcx      # 0x1d216
movl $0x22c, %edx            # imm = 0x22C
callq 0x3230
// File: /workspace/github_c_makefile_star2_O3/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 0x15ed4
testq %rax, %rax
js 0x189cc
movq 0x30(%r14), %rdi
movq %rsp, %r15
movl $0x1c, %edx
movq %r15, %rsi
callq 0x15e14
movq 0x30(%r14), %rdi
movq %rbx, %rsi
xorl %edx, %edx
callq 0x15ed4
movdqa 0xb090(%rip), %xmm0     # 0x23a30
movdqu 0xb094(%rip), %xmm1     # 0x23a3c
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 0x189ce
xorl %eax, %eax
addq $0x20, %rsp
popq %rbx
popq %r14
popq %r15
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x189fc
orl $0x8, %eax
movl %eax, (%rbx)
movq $-0x1, %rax
jmp 0x18a2d
movq %rsi, %r14
movq %rsi, %r15
sarq $0x10, %r15
movq 0x30(%rbx), %rdi
movq %r15, %rsi
xorl %edx, %edx
callq 0x15ed4
testq %rax, %rax
js 0x18a33
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 0x189f3
// File: /workspace/github_c_makefile_star2_O3/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 0x3ede(%rip), %rsi      # 0x1c926
callq 0x15cab
xorl %ebx, %ebx
testq %rax, %rax
je 0x18a93
movq %rax, %r14
movq %rsp, %rsi
movl $0x10, %edx
movq %rax, %rdi
callq 0x15e14
movq %rax, %r15
movq %r14, %rdi
callq 0x15d92
cmpl $0x10, %r15d
jne 0x18a93
movdqa (%rsp), %xmm0
pcmpeqb 0x46ab(%rip), %xmm0     # 0x1d130
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_O3/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 0x8(%rdi), %ecx
movl 0xc(%rdi), %eax
cmpl %ecx, %eax
jge 0x18ad7
movq 0x18(%rbx), %rdx
leal 0x1(%rax), %esi
movl %esi, 0xc(%rbx)
cltq
movzbl (%rdx,%rax), %eax
cmpl %ecx, %esi
jne 0x18aea
movq 0x30(%rbx), %rcx
movq 0x8(%rcx), %rcx
movq %rcx, 0x10(%rbx)
movq $0x0, 0x8(%rbx)
jmp 0x18aea
movq %rbx, %rdi
callq 0x17964
movl %eax, %ecx
movl $0xfffffffe, %eax       # imm = 0xFFFFFFFE
testl %ecx, %ecx
je 0x18aec
popq %rbx
retq
movl 0x8(%rbx), %ecx
testl %ecx, %ecx
je 0x18af8
movl 0xc(%rbx), %eax
jmp 0x18aad
movl $0xffffffff, %eax       # imm = 0xFFFFFFFF
jmp 0x18aea
// File: /workspace/github_c_makefile_star2_O3/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
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_O3/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 0x18d1e
movq 0x8(%rbx), %rsi
cmpl $0x0, 0xc(%rsi)
jne 0x18d1e
leaq 0x60(%rsi), %rdi
addq $0x38, %rsi
callq 0x31b0
jmp 0x18cff
movq 0x8(%rbx), %rdi
movl 0xc(%rdi), %ebp
movl $0x0, 0x20(%rbx)
addq $0x38, %rdi
callq 0x33d0
movl $0x1, %eax
testl %ebp, %ebp
jne 0x18dcc
movl $0x0, 0x1c(%rbx)
movl 0x18(%rbx), %ecx
movq 0x8(%rbx), %rax
cmpl 0x8(%rax), %ecx
jge 0x18dc6
movq 0x20(%rax), %rsi
leaq 0xc(%rsp), %r14
movl $0x10000, 0xc(%rsp)     # imm = 0x10000
movq (%rbx), %r8
movq 0x10(%rbx), %rdi
movq 0x18(%rax), %rax
movslq %ecx, %r12
movq (%rax,%r12,8), %rdx
movl (%rsi,%r12,4), %ecx
movl (%r8), %r8d
sarl $0x12, %r8d
movq %r14, %rsi
callq 0x18dd9
testl %eax, %eax
je 0x18d93
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), %rsi
movl %r15d, (%rsi,%r12,4)
movl (%rax), %ecx
addl %r12d, %ecx
cmpl 0x8(%rax), %ecx
jl 0x18d5e
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_O3/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 0x3a87(%rip), %rax      # 0x1c89f
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 0x18eb3
movq %rsp, %rdi
movl $0x4, %esi
callq 0x3250
cmpl $0x1, %eax
jne 0x18eb3
movq %rsp, %rdi
callq 0x3420
testl %eax, %eax
jne 0x18eb3
movl 0x28(%rsp), %eax
addl $0x1a, %eax
movl %eax, (%r15)
movaps 0x440d(%rip), %xmm0     # 0x1d280
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_O3/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 0x18f0f
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 0x4332(%rip), %rdi      # 0x1d248
leaq 0x4258(%rip), %rsi      # 0x1d175
leaq 0x433a(%rip), %rcx      # 0x1d25e
movl $0x1d7, %edx            # imm = 0x1D7
callq 0x3230
nop
// File: /workspace/github_c_makefile_star2_O3/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 0x190c4
testq %rdi, %rdi
jne 0x1907d
testb $0x1, (%rdx)
jne 0x190ca
movl $0x0, 0x24(%rdx)
cmpb $0x0, 0x1(%rsi)
je 0x190cd
movl $0xffffffff, 0x20(%rdx) # imm = 0xFFFFFFFF
xorps %xmm0, %xmm0
movups %xmm0, (%rdx)
movups %xmm0, 0x10(%rdx)
movb (%rsi), %al
testb %al, %al
je 0x190d3
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 0x190a4
jmp 0x190d3
cmpl $0x0, 0x24(%rdx)
je 0x190d3
xorl %eax, %eax
retq
movsbl (%rsi), %eax
movl %eax, 0x20(%rdx)
testq %rdi, %rdi
je 0x190e6
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 0x19106
movsbl 0x1(%rcx), %edi
incq %rcx
testl %edi, %edi
je 0x19138
cmpl %edi, %esi
jne 0x190f5
jmp 0x19138
movb (%rax), %sil
movq %rax, %rcx
testb %sil, %sil
je 0x19138
movq %rax, %rcx
movsbl %sil, %esi
movzbl %sil, %edi
sarl $0x6, %esi
movslq %esi, %rsi
movq (%rdx,%rsi,8), %rsi
btq %rdi, %rsi
jb 0x19138
movb 0x1(%rcx), %sil
incq %rcx
testb %sil, %sil
jne 0x19114
movq %rcx, 0x28(%rdx)
cmpb $0x0, (%rcx)
je 0x19142
retq
movl $0x1, 0x24(%rdx)
retq
// File: /workspace/github_c_makefile_star2_O3/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), %r8d
movbel %r8d, (%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)
bswapl %r8d
xorl %eax, %eax
leaq 0x4c98(%rip), %rcx      # 0x7000
movl $0xff, %edx
leaq 0x508c(%rip), %rsi      # 0x7400
movl 0xc(%rdi,%rax,4), %r9d
movl %r9d, %r10d
shrl $0xe, %r10d
andl $0x3fc, %r10d           # imm = 0x3FC
movzbl 0x3(%r10,%rcx), %r10d
shll $0x18, %r10d
xorl %r8d, %r10d
movl %r9d, %r8d
shrl $0x8, %r8d
andl %edx, %r8d
movzbl 0x2(%rcx,%r8,4), %r8d
shll $0x10, %r8d
movl %r9d, %r11d
andl %edx, %r11d
movzbl 0x1(%rcx,%r11,4), %r11d
shll $0x8, %r11d
xorl %r8d, %r11d
xorl %r10d, %r11d
movl %r9d, %r8d
shrl $0x18, %r8d
movzbl (%rcx,%r8,4), %r8d
xorl %r11d, %r8d
xorl (%rax,%rsi), %r8d
movl %r8d, 0x10(%rdi,%rax,4)
movl 0x4(%rdi,%rax,4), %r10d
xorl %r8d, %r10d
movl %r10d, 0x14(%rdi,%rax,4)
xorl 0x8(%rdi,%rax,4), %r10d
movl %r10d, 0x18(%rdi,%rax,4)
xorl %r9d, %r10d
movl %r10d, 0x1c(%rdi,%rax,4)
addq $0x4, %rax
cmpq $0x28, %rax
jne 0x2374
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x3776
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r14
leaq 0x8aba(%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 0x3763
movl $0xa, %edi
callq 0x20c0
incq %r12
cmpq %r12, %rbx
jne 0x3741
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r14
popq %r15
movl $0xa, %edi
jmp 0x20c0
// File: /workspace/github_c_makefile_star2_O3/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 0x37be
xorl %eax, %eax
movb (%rdi,%rax), %cl
xorb %cl, (%rsi,%rax)
incq %rax
cmpq $0x10, %rax
jne 0x37a5
addq $0x10, %rdi
addq $-0x10, %rdx
jne 0x37a3
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x46c2
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 0x464c
testb %al, %al
jns 0x466f
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 0x4642
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 0x4787
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 0x4711
testb %al, %al
jns 0x4734
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 0x4707
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O3/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 %r14
pushq %rbx
subq $0x28, %rsp
movq %r9, %rbx
movq 0x40(%rsp), %rax
movq %rax, (%rsp)
leaq 0x10(%rsp), %r14
movq %r14, %r9
callq 0x2080
vmovq (%r14), %xmm0
vmovq (%rbx), %xmm1
vpcmpneqb %xmm1, %xmm0, %k0
vmovq 0x8(%r14), %xmm0
vmovq 0x8(%rbx), %xmm1
vpcmpneqb %xmm1, %xmm0, %k1
xorl %eax, %eax
kortestb %k1, %k0
sete %al
addq $0x28, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/mjosaarinen[P]brutus/crypto_aead/shellaes128v1d5n64/ref/shellaes.c
// Function: shellaesEnc
void shellaesEnc(const u8 key[], const u8 nonce[], const u8 ad[], unsigned long long int adlen, const u8 p[], unsigned long long int ptlen, u8 c[], unsigned long long int ctlen){

    u8 tag[16];


    if(ptlen<16){
        /*plaintext is shorter than one block*/
        shellaesEnc_short(key, nonce, ad, adlen, p, ptlen, c, tag);
    }
    else if (ptlen%16==0){
        /*plaintext is multiple blocks long */
        shellaesEnc_fb(key, nonce, ad, adlen, p, ptlen, c, tag);
    }
    else{
         /*plaintext is longer than one block, and has a length that is not a mutiple of block length */
        shellaesEnc_nfb(key, nonce, ad, adlen, p, ptlen, c, tag);
    }

    /*append the tag to ciphertext*/
    memcpy(c+ptlen, tag, 16);

    /*
    printf("the ciphertext and the tag is \n");
    printf_byte_string(c, ctlen);
    */
}

// Assembly:
pushq %r14
pushq %rbx
subq $0x18, %rsp
movq %r9, %rbx
movq 0x30(%rsp), %r14
movq %rsp, %rax
cmpq $0xf, %r9
ja 0x6cca
movq %rbx, %r9
pushq %rax
pushq %r14
callq 0x2120
jmp 0x6ce4
movq %rbx, %r9
testb $0xf, %bl
je 0x6cdc
pushq %rax
pushq %r14
callq 0x2230
jmp 0x6ce4
pushq %rax
pushq %r14
callq 0x2250
addq $0x10, %rsp
vmovaps (%rsp), %xmm0
vmovups %xmm0, (%r14,%rbx)
addq $0x18, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/mjosaarinen[P]brutus/crypto_aead/shellaes128v1d5n64/ref/shellaes.c
// Function: shellaesDec
int shellaesDec(const u8 key[], const u8 nonce[], const u8 ad[], unsigned long long int adlen, const u8 c[], unsigned long long int ctlen, u8 p[], unsigned long long int ptlen){

    u8 tag[16];
    int flag;

    memcpy(tag, c+ptlen, 16);

    if(ptlen<16){
        /*plaintext is shorter than one block*/
        flag=shellaesDec_short(key, nonce, ad, adlen, c, ptlen, p, tag);
    }
    else if (ptlen%16==0){
        /*plaintext is multiple blocks long */
        flag=shellaesDecVef_fb(key, nonce, ad, adlen, c, ptlen, p, tag);
    }
    else{
        /*plaintext is longer than one block, and has a length that is not a mutiple of block length */
        flag=shellaesDec_nfb(key, nonce, ad, adlen, c, ptlen, p, tag);
    }

    return flag;
}

// Assembly:
subq $0x18, %rsp
movq 0x28(%rsp), %r9
movq 0x20(%rsp), %rax
vmovups (%r8,%r9), %xmm0
vmovaps %xmm0, (%rsp)
movq %rsp, %r10
cmpq $0xf, %r9
ja 0x6d27
pushq %r10
pushq %rax
callq 0x20d0
jmp 0x6d3f
testb $0xf, %r9b
je 0x6d37
pushq %r10
pushq %rax
callq 0x2110
jmp 0x6d3f
pushq %r10
pushq %rax
callq 0x2100
addq $0x10, %rsp
addq $0x18, %rsp
retq
// File: /workspace/github_c_makefile_star2_O3/ZombiesYard[P]MPU6050-DMP-raspberry-pi/main.c
// Function: main
int main() 
{
	//初始化mpu6050的dmp
	ms_open();
	do{
		ms_update();
		printf("yaw = %2.1f\tpitch = %2.1f\troll = %2.1f\ttemperature = %2.1f\tcompass = %2.1f, %2.1f, %2.1f\n",
		 ypr[YAW], ypr[PITCH], ypr[ROLL], temp, compass[0], compass[1], compass[2]);
		delay_ms(5);
	}while(1);

	return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
pushq %rax
callq 0x14f0
leaq 0x8d08(%rip), %r14      # 0xa188
leaq 0x8d0d(%rip), %r15      # 0xa194
leaq 0x8d22(%rip), %r12      # 0xa1b0
leaq 0x4b6f(%rip), %rbx      # 0x6004
callq 0x17f0
xorps %xmm0, %xmm0
cvtss2sd (%r14), %xmm0
xorps %xmm1, %xmm1
cvtss2sd 0x4(%r14), %xmm1
xorps %xmm2, %xmm2
cvtss2sd 0x8(%r14), %xmm2
xorps %xmm3, %xmm3
cvtss2sd (%r15), %xmm3
xorps %xmm4, %xmm4
cvtss2sd (%r12), %xmm4
xorps %xmm5, %xmm5
cvtss2sd 0x4(%r12), %xmm5
xorps %xmm6, %xmm6
cvtss2sd 0x8(%r12), %xmm6
movq %rbx, %rdi
movb $0x7, %al
callq 0x1040
movl $0x1388, %edi           # imm = 0x1388
callq 0x10e0
jmp 0x1495
nop
// File: /workspace/github_c_makefile_star2_O3/ZombiesYard[P]MPU6050-DMP-raspberry-pi/MotionSensor/inv_mpu_lib/inv_mpu.c
// Function: mpu_reg_dump()
uint8_t mpu_reg_dump(void)
{
	uint8_t ii;
	uint8_t data;

	for (ii = 0; ii < st.hw->num_reg; ii++)
	{
		if (ii == st.reg->fifo_r_w || ii == st.reg->mem_r_w)
			continue;
		if (i2c_read(st.hw->addr, ii, 1, &data))
			return 1;
#if defined MPU_DEBUG
		printf_P("%#5x: %#5x\r\r\n", ii, data);
#endif
	}
	return 0;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movq 0x869e(%rip), %rax      # 0xa220
cmpb $0x0, 0x4(%rax)
je 0x1bd1
movq 0x8689(%rip), %rcx      # 0xa218
xorl %ebp, %ebp
leaq 0x7(%rsp), %rbx
cmpb 0xd(%rcx), %bpl
je 0x1bc8
cmpb 0x18(%rcx), %bpl
je 0x1bc8
movzbl (%rax), %edi
movzbl %bpl, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x4e41
cmpb $-0x1, %al
je 0x1bda
movq 0x8657(%rip), %rcx      # 0xa218
movq 0x8658(%rip), %rax      # 0xa220
incb %bpl
cmpb 0x4(%rax), %bpl
jb 0x1b96
xorl %eax, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
movb $0x1, %al
jmp 0x1bd3
// File: /workspace/github_c_makefile_star2_O3/ZombiesYard[P]MPU6050-DMP-raspberry-pi/MotionSensor/inv_mpu_lib/inv_mpu.c
// Function: mpu_set_gyro_fsr(unsigned short)
uint8_t mpu_set_gyro_fsr(uint16_t fsr)
{
	uint8_t data;

	if (!(st.chip_cfg.sensors))
		return 1;

	switch (fsr)
	{
	case 250:
		data = INV_FSR_250DPS << 3;
		break;
	case 500:
		data = INV_FSR_500DPS << 3;
		break;
	case 1000:
		data = INV_FSR_1000DPS << 3;
		break;
	case 2000:
		data = INV_FSR_2000DPS << 3;
		break;
	default:
		return 1;
	}

	if (st.chip_cfg.gyro_fsr == (data >> 3))
		return 0;
	if (i2c_write(st.hw->addr, st.reg->gyro_cfg, 1, &data))
		return 1;
	st.chip_cfg.gyro_fsr = data >> 3;
	return 0;
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movb $0x1, %bl
cmpb $0x0, 0x835c(%rip)      # 0xa232
je 0x1f63
movzwl %di, %eax
cmpl $0x3e7, %eax            # imm = 0x3E7
jg 0x1efd
cmpl $0xfa, %eax
je 0x1f14
cmpl $0x1f4, %eax            # imm = 0x1F4
jne 0x1f63
movb $0x8, 0xf(%rsp)
movb $0x1, %al
jmp 0x1f24
cmpl $0x3e8, %eax            # imm = 0x3E8
je 0x1f1d
cmpl $0x7d0, %eax            # imm = 0x7D0
jne 0x1f63
movb $0x18, 0xf(%rsp)
movb $0x3, %al
jmp 0x1f24
movb $0x0, 0xf(%rsp)
xorl %eax, %eax
jmp 0x1f24
movb $0x10, 0xf(%rsp)
movb $0x2, %al
cmpb %al, 0x8306(%rip)       # 0xa230
je 0x1f61
movq 0x82ed(%rip), %rax      # 0xa220
movzbl (%rax), %edi
movq 0x82db(%rip), %rax      # 0xa218
movzbl 0x6(%rax), %esi
leaq 0xf(%rsp), %rcx
movl $0x1, %edx
callq 0x50a2
testl %eax, %eax
jne 0x1f63
movb 0xf(%rsp), %al
shrb $0x3, %al
movb %al, 0x82cf(%rip)       # 0xa230
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/ZombiesYard[P]MPU6050-DMP-raspberry-pi/MotionSensor/inv_mpu_lib/inv_mpu.c
// Function: mpu_set_accel_fsr(unsigned char)
uint8_t mpu_set_accel_fsr(uint8_t fsr)
{
	uint8_t data;

	if (!(st.chip_cfg.sensors))
		return 1;

	switch (fsr)
	{
	case 2:
		data = INV_FSR_2G << 3;
		break;
	case 4:
		data = INV_FSR_4G << 3;
		break;
	case 8:
		data = INV_FSR_8G << 3;
		break;
	case 16:
		data = INV_FSR_16G << 3;
		break;
	default:
		return 1;
	}

	if (st.chip_cfg.accel_fsr == (data >> 3))
		return 0;
	if (i2c_write(st.hw->addr, st.reg->accel_cfg, 1, &data))
		return 1;
	st.chip_cfg.accel_fsr = data >> 3;
	return 0;
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movb $0x1, %bl
cmpb $0x0, 0x82b9(%rip)      # 0xa232
je 0x1ffa
movzbl %dil, %eax
addl $-0x2, %eax
rorl %eax
cmpl $0x7, %eax
ja 0x1ffa
leaq 0x4540(%rip), %rcx      # 0x64d0
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movb $0x0, 0xf(%rsp)
xorl %eax, %eax
jmp 0x1fbb
movb $0x10, 0xf(%rsp)
movb $0x2, %al
jmp 0x1fbb
movb $0x8, 0xf(%rsp)
movb $0x1, %al
jmp 0x1fbb
movb $0x18, 0xf(%rsp)
movb $0x3, %al
cmpb %al, 0x8270(%rip)       # 0xa231
je 0x1ff8
movq 0x8256(%rip), %rax      # 0xa220
movzbl (%rax), %edi
movq 0x8244(%rip), %rax      # 0xa218
movzbl 0x7(%rax), %esi
leaq 0xf(%rsp), %rcx
movl $0x1, %edx
callq 0x50a2
testl %eax, %eax
jne 0x1ffa
movb 0xf(%rsp), %al
shrb $0x3, %al
movb %al, 0x8239(%rip)       # 0xa231
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/ZombiesYard[P]MPU6050-DMP-raspberry-pi/MotionSensor/inv_mpu_lib/inv_mpu.c
// Function: mpu_set_lpf(unsigned short)
uint8_t mpu_set_lpf(uint16_t lpf)
{
	uint8_t data;

	if (!(st.chip_cfg.sensors))
		return 1;

	if (lpf >= 188)
		data = INV_FILTER_188HZ;
	else if (lpf >= 98)
		data = INV_FILTER_98HZ;
	else if (lpf >= 42)
		data = INV_FILTER_42HZ;
	else if (lpf >= 20)
		data = INV_FILTER_20HZ;
	else if (lpf >= 10)
		data = INV_FILTER_10HZ;
	else
		data = INV_FILTER_5HZ;

	if (st.chip_cfg.lpf == data)
		return 0;
	if (i2c_write(st.hw->addr, st.reg->lpf, 1, &data))
		return 1;
	st.chip_cfg.lpf = data;
	return 0;
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movb $0x1, %bl
cmpb $0x0, 0x8222(%rip)      # 0xa232
je 0x20a8
movzwl %di, %eax
cmpl $0xbc, %eax
jb 0x2029
movb $0x1, 0xf(%rsp)
movb $0x1, %al
jmp 0x206c
cmpw $0x62, %di
jb 0x2038
movb $0x2, 0xf(%rsp)
movb $0x2, %al
jmp 0x206c
cmpw $0x2a, %di
jb 0x2047
movb $0x3, 0xf(%rsp)
movb $0x3, %al
jmp 0x206c
cmpw $0x14, %di
jb 0x2056
movb $0x4, 0xf(%rsp)
movb $0x4, %al
jmp 0x206c
cmpw $0xa, %di
jb 0x2065
movb $0x5, 0xf(%rsp)
movb $0x5, %al
jmp 0x206c
movb $0x6, 0xf(%rsp)
movb $0x6, %al
cmpb %al, 0x81c1(%rip)       # 0xa233
je 0x20a6
movq 0x81a5(%rip), %rax      # 0xa220
movzbl (%rax), %edi
movq 0x8193(%rip), %rax      # 0xa218
movzbl 0x2(%rax), %esi
leaq 0xf(%rsp), %rcx
movl $0x1, %edx
callq 0x50a2
testl %eax, %eax
jne 0x20a8
movb 0xf(%rsp), %al
movb %al, 0x818d(%rip)       # 0xa233
xorl %ebx, %ebx
movl %ebx, %eax
addq $0x10, %rsp
popq %rbx
retq
// File: /workspace/github_c_makefile_star2_O3/ZombiesYard[P]MPU6050-DMP-raspberry-pi/MotionSensor/inv_mpu_lib/inv_mpu.c
// Function: mpu_set_sample_rate(unsigned short)
uint8_t mpu_set_sample_rate(uint16_t rate)
{
	uint8_t data;

	if (!(st.chip_cfg.sensors))
		return 1;

	if (st.chip_cfg.dmp_on)
		return 1;
	else
	{
		if (st.chip_cfg.lp_accel_mode)
		{
			if (rate && (rate <= 40))
			{
				/* Just stay in low-power accel mode. */
				mpu_lp_accel_mode(rate);
				return 0;
			}
			/* Requested rate exceeds the allowed frequencies in LP accel mode,
			 * switch back to full-power mode.
			 */
			mpu_lp_accel_mode(0);
		}
		if (rate < 4)
			rate = 4;
		else if (rate > 1000)
			rate = 1000;

		data = 1000 / rate - 1;
		if (i2c_write(st.hw->addr, st.reg->rate_div, 1, &data))
			return 1;

		st.chip_cfg.sample_rate = 1000 / (1 + data);

#ifdef AK89xx_SECONDARY
		mpu_set_compass_sample_rate(min(st.chip_cfg.compass_sample_rate, MAX_COMPASS_SAMPLE_RATE));
#endif

		/* Automatically set LPF to 1/2 sampling rate. */
		mpu_set_lpf(st.chip_cfg.sample_rate >> 1);
		return 0;
	}
}

// Assembly:
pushq %r14
pushq %rbx
pushq %rax
cmpb $0x0, 0x8177(%rip)      # 0xa232
movb $0x1, %bl
je 0x216f
cmpb $0x0, 0x8182(%rip)      # 0xa24c
jne 0x216f
movl %edi, %r14d
cmpb $0x0, 0x8162(%rip)      # 0xa23c
je 0x20fa
leal -0x1(%r14), %eax
cmpw $0x27, %ax
ja 0x20f3
movzbl %r14b, %edi
callq 0x2422
xorl %ebx, %ebx
jmp 0x216f
xorl %edi, %edi
callq 0x2422
movzwl %r14w, %eax
movl $0x3e8, %ecx            # imm = 0x3E8
cmpl %ecx, %eax
cmovael %ecx, %r14d
cmpw $0x5, %r14w
movl $0x4, %ecx
cmovael %r14d, %ecx
movw $0x3e8, %ax             # imm = 0x3E8
xorl %edx, %edx
divw %cx
decb %al
leaq 0x7(%rsp), %rcx
movb %al, (%rcx)
movq 0x80f0(%rip), %rax      # 0xa220
movzbl (%rax), %edi
movq 0x80de(%rip), %rax      # 0xa218
movzbl 0x1(%rax), %esi
movl $0x1, %edx
callq 0x50a2
testl %eax, %eax
jne 0x216f
movzbl 0x7(%rsp), %ecx
incl %ecx
xorl %ebx, %ebx
movw $0x3e8, %ax             # imm = 0x3E8
xorl %edx, %edx
divw %cx
movzwl %ax, %edi
movw %di, 0x80ce(%rip)       # 0xa236
shrl %edi
callq 0x2002
movl %ebx, %eax
addq $0x8, %rsp
popq %rbx
popq %r14
retq
// File: /workspace/github_c_makefile_star2_O3/ZombiesYard[P]MPU6050-DMP-raspberry-pi/MotionSensor/inv_mpu_lib/inv_mpu.c
// Function: mpu_configure_fifo(unsigned char)
uint8_t mpu_configure_fifo(uint8_t sensors)
{
	uint8_t prev;
	int result = 0;

	/* Compass data isn't going into the FIFO. Stop trying. */
	sensors &= ~INV_XYZ_COMPASS;

	if (st.chip_cfg.dmp_on)
		return 0;
	else
	{
		if (!(st.chip_cfg.sensors))
			return 1;
		prev = st.chip_cfg.fifo_enable;
		st.chip_cfg.fifo_enable = sensors & st.chip_cfg.sensors;
		if (st.chip_cfg.fifo_enable != sensors)
			/* You're not getting what you asked for. Some sensors are
			 * asleep.
			 */
			result = -1;
		else
			result = 0;
		if (sensors || st.chip_cfg.lp_accel_mode)
			set_int_enable(1);
		else
			set_int_enable(0);
		if (sensors)
		{
			if (mpu_reset_fifo())
			{
				st.chip_cfg.fifo_enable = prev;
				return 1;
			}
		}
	}

	return result;
}

// Assembly:
pushq %rbp
pushq %r14
pushq %rbx
cmpb $0x0, 0x80c8(%rip)      # 0xa24c
je 0x218f
xorl %ebx, %ebx
movl %ebx, %eax
popq %rbx
popq %r14
popq %rbp
retq
movb 0x809d(%rip), %al       # 0xa232
movb $0x1, %bl
testb %al, %al
je 0x2188
movl %edi, %ebp
andb $-0x2, %bpl
movb 0x8090(%rip), %r14b     # 0xa238
andb %bpl, %al
movb %al, 0x8087(%rip)       # 0xa238
cmpb %bpl, %al
setne %bl
negb %bl
movb 0x807d(%rip), %al       # 0xa23c
orb %bpl, %al
je 0x21e7
movl $0x1, %edi
callq 0x2bb3
testb %bpl, %bpl
je 0x2188
callq 0x2845
testb %al, %al
je 0x2188
movb %r14b, 0x8055(%rip)     # 0xa238
movb $0x1, %bl
jmp 0x2188
xorl %edi, %edi
callq 0x2bb3
jmp 0x2188
// File: /workspace/github_c_makefile_star2_O3/ZombiesYard[P]MPU6050-DMP-raspberry-pi/MotionSensor/inv_mpu_lib/inv_mpu.c
// Function: mpu_set_bypass(unsigned char)
uint8_t mpu_set_bypass(uint8_t bypass_on)
{
	uint8_t tmp;

	if (st.chip_cfg.bypass_mode == bypass_on)
		return 0;

	if (bypass_on)
	{
		if (i2c_read(st.hw->addr, st.reg->user_ctrl, 1, &tmp))
			return 1;
		tmp &= ~BIT_AUX_IF_EN;
		if (i2c_write(st.hw->addr, st.reg->user_ctrl, 1, &tmp))
			return 1;
		delay_ms(3);
		tmp = BIT_BYPASS_EN;
		if (st.chip_cfg.active_low_int)
			tmp |= BIT_ACTL;
		if (st.chip_cfg.latched_int)
			tmp |= BIT_LATCH_EN | BIT_ANY_RD_CLR;
		if (i2c_write(st.hw->addr, st.reg->int_pin_cfg, 1, &tmp))
			return 1;
	}
	else
	{
		/* Enable I2C master mode if compass is being used. */
		if (i2c_read(st.hw->addr, st.reg->user_ctrl, 1, &tmp))
			return 1;
		if (st.chip_cfg.sensors & INV_XYZ_COMPASS)
			tmp |= BIT_AUX_IF_EN;
		else
			tmp &= ~BIT_AUX_IF_EN;
		if (i2c_write(st.hw->addr, st.reg->user_ctrl, 1, &tmp))
			return 1;
		delay_ms(3);
		if (st.chip_cfg.active_low_int)
			tmp = BIT_ACTL;
		else
			tmp = 0;
		if (st.chip_cfg.latched_int)
			tmp |= BIT_LATCH_EN | BIT_ANY_RD_CLR;
		if (i2c_write(st.hw->addr, st.reg->int_pin_cfg, 1, &tmp))
			return 1;
	}
	st.chip_cfg.bypass_mode = bypass_on;
	return 0;
}

// Assembly:
pushq %rbp
pushq %rbx
pushq %rax
movl %edi, %ebx
cmpb %bl, 0x803f(%rip)       # 0xa23a
jne 0x2208
xorl %ebp, %ebp
movl %ebp, %eax
addq $0x8, %rsp
popq %rbx
popq %rbp
retq
movq 0x8011(%rip), %rax      # 0xa220
movzbl (%rax), %edi
movq 0x7fff(%rip), %rax      # 0xa218
movzbl 0x4(%rax), %esi
leaq 0x7(%rsp), %rcx
movl $0x1, %edx
callq 0x4e41
movb $0x1, %bpl
testb %bl, %bl
je 0x2295
cmpb $-0x1, %al
je 0x21ff
leaq 0x7(%rsp), %rcx
andb $-0x21, (%rcx)
movq 0x7fda(%rip), %rax      # 0xa220
movzbl (%rax), %edi
movq 0x7fc8(%rip), %rax      # 0xa218
movzbl 0x4(%rax), %esi
movl $0x1, %edx
callq 0x50a2
testl %eax, %eax
jne 0x21ff
movl $0xbb8, %edi            # imm = 0xBB8
callq 0x10e0
cmpb $0x0, 0x7fd7(%rip)      # 0xa24a
movl $0x2, %ecx
movl $0x82, %eax
cmovel %ecx, %eax
movb %al, 0x7(%rsp)
cmpb $0x0, 0x7fc0(%rip)      # 0xa24b
je 0x2307
orb $0x30, %al
movb %al, 0x7(%rsp)
jmp 0x2307
cmpb $-0x1, %al
je 0x21ff
movb 0x7f8f(%rip), %al       # 0xa232
leaq 0x7(%rsp), %rcx
movb (%rcx), %dl
andb $-0x21, %dl
shlb $0x5, %al
andb $0x20, %al
orb %dl, %al
movb %al, (%rcx)
movq 0x7f63(%rip), %rax      # 0xa220
movzbl (%rax), %edi
movq 0x7f51(%rip), %rax      # 0xa218
movzbl 0x4(%rax), %esi
movl $0x1, %edx
callq 0x50a2
testl %eax, %eax
jne 0x21ff
movl $0xbb8, %edi            # imm = 0xBB8
callq 0x10e0
cmpb $0x0, 0x7f5c(%rip)      # 0xa24a
setne %al
shlb $0x7, %al
movb %al, 0x7(%rsp)
cmpb $0x0, 0x7f4c(%rip)      # 0xa24b
je 0x2307
orb $0x30, %al
movb %al, 0x7(%rsp)
movq 0x7f12(%rip), %rax      # 0xa220
movzbl (%rax), %edi
movq 0x7f00(%rip), %rax      # 0xa218
movzbl 0x17(%rax), %esi
leaq 0x7(%rsp), %rcx
movl $0x1, %edx
callq 0x50a2
testl %eax, %eax
jne 0x21ff
movb %bl, 0x7f01(%rip)       # 0xa23a
jmp 0x21fd
// File: /workspace/github_c_makefile_star2_O3/ZombiesYard[P]MPU6050-DMP-raspberry-pi/MotionSensor/inv_mpu_lib/inv_mpu.c
// Function: mpu_set_int_latched(unsigned char)
uint8_t mpu_set_int_latched(uint8_t enable)
{
	uint8_t tmp;
	if (st.chip_cfg.latched_int == enable)
		return 0;

	if (enable)
		tmp = BIT_LATCH_EN | BIT_ANY_RD_CLR;
	else
		tmp = 0;
	if (st.chip_cfg.bypass_mode)
		tmp |= BIT_BYPASS_EN;
	if (st.chip_cfg.active_low_int)
		tmp |= BIT_ACTL;
	if (i2c_write(st.hw->addr, st.reg->int_pin_cfg, 1, &tmp))
		return 1;
	st.chip_cfg.latched_int = enable;
	return 0;
}

// Assembly:
pushq %rbx
subq $0x10, %rsp
movl %edi, %ebx
xorl %eax, %eax
cmpb %bl, 0x7d1d(%rip)       # 0xa24b
je 0x2592
testb %bl, %bl
movl $0x30, %ecx
cmovel %eax, %ecx
movb %cl, 0xf(%rsp)
cmpb $0x0, 0x7cf5(%rip)      # 0xa23a
je 0x254e
orb $0x2, %cl
movb %cl, 0xf(%rsp)
cmpb $0x0, 0x7cf5(%rip)      # 0xa24a
je 0x255e
orb $-0x80, %cl
movb %cl, 0xf(%rsp)
movq 0x7cbb(%rip), %rax      # 0xa220
movzbl (%rax), %edi
movq 0x7ca9(%rip), %rax      # 0xa218
movzbl 0x17(%rax), %esi
leaq 0xf(%rsp), %rcx
movl $0x1, %edx
callq 0x50a2
movl %eax, %ecx
movb $0x1, %al
testl %ecx, %ecx
jne 0x2592
movb %bl, 0x7cbb(%rip)       # 0xa24b
xorl %eax, %eax
addq $0x10, %rsp
popq %rbx
retq