LLM4Binary/decompile-bench-makefile huggingface dataset:
// File: /workspace/github_c_makefile_star2_O0/lh3[P]minigraph/ggen.c
// Function: mg_free_maprst
static void mg_free_maprst(maprst_t *r)
{
	int i;
	for (i = 0; i < r->n_seq; ++i) {
		mg_gchain_free(r->gcs[i]);
		free(r->seq[i].seq); free(r->seq[i].name);
	}
	free(r->gcs); free(r->seq);
	free(r);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
movl $0x0, -0xc(%rbp)
movl -0xc(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl (%rcx), %eax
jge 0x38226
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0xc(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x28de0
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0xc(%rbp), %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq 0x10(%rax), %rdi
callq 0x2040
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0xc(%rbp), %rcx
imulq $0x28, %rcx, %rcx
addq %rcx, %rax
movq 0x8(%rax), %rdi
callq 0x2040
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x381c3
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x2040
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x2040
movq -0x8(%rbp), %rdi
callq 0x2040
addq $0x10, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/lh3[P]minigraph/ggen.c
// Function: mg_ggen_call
int mg_ggen_call(gfa_t *g, const char *fn, const mg_idxopt_t *ipt, const mg_mapopt_t *opt0, const mg_ggopt_t *go, int n_threads)
{
	mg_mapopt_t opt = *opt0;
	mg_idx_t *gi;
	maprst_t *r;
	if ((gi = mg_index(g, ipt, n_threads, &opt)) == 0) return -1;
	r = ggen_map(gi, &opt, fn, n_threads);
	mg_call_asm(g, r->n_seq, r->seq, r->gcs, go->min_mapq, go->min_map_len);
	mg_free_maprst(r);
	mg_idx_destroy(gi);
	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xf0, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movq %rcx, -0x28(%rbp)
movq %r8, -0x30(%rbp)
movl %r9d, -0x34(%rbp)
movq -0x28(%rbp), %rsi
leaq -0xe0(%rbp), %rdi
movl $0xa8, %edx
callq 0x2230
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rsi
movl -0x34(%rbp), %edx
leaq -0xe0(%rbp), %rcx
callq 0x21110
movq %rax, -0xe8(%rbp)
cmpq $0x0, %rax
jne 0x384f5
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x3856d
movq -0xe8(%rbp), %rdi
movq -0x18(%rbp), %rdx
movl -0x34(%rbp), %ecx
leaq -0xe0(%rbp), %rsi
callq 0x37ee0
movq %rax, -0xf0(%rbp)
movq -0x10(%rbp), %rdi
movq -0xf0(%rbp), %rax
movl (%rax), %esi
movq -0xf0(%rbp), %rax
movq 0x8(%rax), %rdx
movq -0xf0(%rbp), %rax
movq 0x10(%rax), %rcx
movq -0x30(%rbp), %rax
movl 0xc(%rax), %r8d
movq -0x30(%rbp), %rax
movl 0x10(%rax), %r9d
callq 0x38b40
movq -0xf0(%rbp), %rdi
callq 0x381b0
movq -0xe8(%rbp), %rdi
callq 0x203d0
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0xf0, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/lh3[P]minigraph/ggen.c
// Function: worker_for
static void worker_for(void *_data, long i, int tid) // kt_for() callback
{
    step_t *s = (step_t*)_data;
	if (mg_dbg_flag & MG_DBG_QNAME)
		fprintf(stderr, "QR\t%s\t%d\t%d\n", s->r->seq[i].name, tid, s->r->seq[i].l_seq);
	if ((s->opt->flag & MG_M_SKIP_GCHECK) == 0 && mg_verbose >= 2) {
		if (gfa_sseq_get(s->gi->g, s->r->seq[i].name) >= 0)
			fprintf(stderr, "[W::%s] stable sequence \"%s\" already present in the graph. This will lead to inconsistent rGFA.\n",
					__func__, s->r->seq[i].name);
	}
	s->r->gcs[i] = mg_map(s->gi, s->r->seq[i].l_seq, s->r->seq[i].seq, s->buf[tid], s->opt, s->r->seq[i].name);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x20(%rbp)
leaq 0xccb6(%rip), %rax      # 0x45688
movl (%rax), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x38a26
movq 0xc615(%rip), %rax      # 0x44ff8
movq (%rax), %rdi
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x8(%rax), %rax
imulq $0x28, -0x10(%rbp), %rcx
addq %rcx, %rax
movq 0x8(%rax), %rdx
movl -0x14(%rbp), %ecx
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x8(%rax), %rax
imulq $0x28, -0x10(%rbp), %rsi
addq %rsi, %rax
movl (%rax), %r8d
leaq 0x5560(%rip), %rsi      # 0x3df7f
movb $0x0, %al
callq 0x2210
movq -0x20(%rbp), %rax
movq (%rax), %rax
movq (%rax), %rax
andq $0x2000000, %rax        # imm = 0x2000000
cmpq $0x0, %rax
jne 0x38aae
leaq 0xc9ad(%rip), %rax      # 0x453f0
cmpl $0x2, (%rax)
jl 0x38aae
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rax
movq (%rax), %rdi
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x8(%rax), %rax
imulq $0x28, -0x10(%rbp), %rcx
addq %rcx, %rax
movq 0x8(%rax), %rsi
callq 0x5ad0
cmpl $0x0, %eax
jl 0x38aac
movq 0xc57c(%rip), %rax      # 0x44ff8
movq (%rax), %rdi
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x8(%rax), %rax
imulq $0x28, -0x10(%rbp), %rcx
addq %rcx, %rax
movq 0x8(%rax), %rcx
leaq 0x5b6d(%rip), %rsi      # 0x3e60b
leaq 0x5bc7(%rip), %rdx      # 0x3e66c
movb $0x0, %al
callq 0x2210
jmp 0x38aae
movq -0x20(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x8(%rax), %rax
imulq $0x28, -0x10(%rbp), %rcx
addq %rcx, %rax
movl (%rax), %esi
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x8(%rax), %rax
imulq $0x28, -0x10(%rbp), %rcx
addq %rcx, %rax
movq 0x10(%rax), %rdx
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rcx
movq -0x20(%rbp), %rax
movq (%rax), %r8
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x8(%rax), %rax
imulq $0x28, -0x10(%rbp), %r9
addq %r9, %rax
movq 0x8(%rax), %r9
callq 0x2f230
movq %rax, %rdx
movq -0x20(%rbp), %rax
movq 0x18(%rax), %rax
movq 0x10(%rax), %rax
movq -0x10(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
nop
// File: /workspace/github_c_makefile_star2_O0/lh3[P]minigraph/main.c
// Function: mm_parse_num2
static inline int64_t mm_parse_num2(const char *str, char **q)
{
	double x;
	char *p;
	x = strtod(str, &p);
	if (*p == 'G' || *p == 'g') x *= 1e9, ++p;
	else if (*p == 'M' || *p == 'm') x *= 1e6, ++p;
	else if (*p == 'K' || *p == 'k') x *= 1e3, ++p;
	if (q) *q = p;
	return (int64_t)(x + .499);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x8(%rbp), %rdi
leaq -0x20(%rbp), %rsi
callq 0x20c0
movsd %xmm0, -0x18(%rbp)
movq -0x20(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x47, %eax
je 0x3b5ca
movq -0x20(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x67, %eax
jne 0x3b5ea
movsd 0x324e(%rip), %xmm0     # 0x3e820
mulsd -0x18(%rbp), %xmm0
movsd %xmm0, -0x18(%rbp)
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0x3b65c
movq -0x20(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x4d, %eax
je 0x3b602
movq -0x20(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x6d, %eax
jne 0x3b622
movsd 0x320e(%rip), %xmm0     # 0x3e818
mulsd -0x18(%rbp), %xmm0
movsd %xmm0, -0x18(%rbp)
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0x3b65a
movq -0x20(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x4b, %eax
je 0x3b63a
movq -0x20(%rbp), %rax
movsbl (%rax), %eax
cmpl $0x6b, %eax
jne 0x3b658
movsd 0x31ce(%rip), %xmm0     # 0x3e810
mulsd -0x18(%rbp), %xmm0
movsd %xmm0, -0x18(%rbp)
movq -0x20(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0x3b65a
jmp 0x3b65c
cmpq $0x0, -0x10(%rbp)
je 0x3b66e
movq -0x20(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
movsd 0x1d32(%rip), %xmm0     # 0x3d3a8
addsd -0x18(%rbp), %xmm0
cvttsd2si %xmm0, %rax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/lh3[P]minigraph/main.c
// Function: yes_or_no
static inline void yes_or_no(uint64_t *flag_, uint64_t f, int long_idx, const char *arg, int yes_to_set)
{
	uint64_t flag = *flag_;
	if (yes_to_set) {
		if (strcmp(arg, "yes") == 0 || strcmp(arg, "y") == 0) flag |= f;
		else if (strcmp(arg, "no") == 0 || strcmp(arg, "n") == 0) flag &= ~f;
		else fprintf(stderr, "[WARNING]\033[1;31m option '--%s' only accepts 'yes' or 'no'.\033[0m\n", long_options[long_idx].name);
	} else {
		if (strcmp(arg, "yes") == 0 || strcmp(arg, "y") == 0) flag &= ~f;
		else if (strcmp(arg, "no") == 0 || strcmp(arg, "n") == 0) flag |= f;
		else fprintf(stderr, "[WARNING]\033[1;31m option '--%s' only accepts 'yes' or 'no'.\033[0m\n", long_options[long_idx].name);
	}
	*flag_ = flag;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq %rcx, -0x20(%rbp)
movl %r8d, -0x24(%rbp)
movq -0x8(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x30(%rbp)
cmpl $0x0, -0x24(%rbp)
je 0x3b768
movq -0x20(%rbp), %rdi
leaq 0x3c3c(%rip), %rsi      # 0x3f307
callq 0x21f0
cmpl $0x0, %eax
je 0x3b6ea
movq -0x20(%rbp), %rdi
leaq 0x1b75(%rip), %rsi      # 0x3d255
callq 0x21f0
cmpl $0x0, %eax
jne 0x3b6f8
movq -0x10(%rbp), %rax
orq -0x30(%rbp), %rax
movq %rax, -0x30(%rbp)
jmp 0x3b763
movq -0x20(%rbp), %rdi
leaq 0x3c08(%rip), %rsi      # 0x3f30b
callq 0x21f0
cmpl $0x0, %eax
je 0x3b722
movq -0x20(%rbp), %rdi
leaq 0x1951(%rip), %rsi      # 0x3d069
callq 0x21f0
cmpl $0x0, %eax
jne 0x3b734
movq -0x10(%rbp), %rax
xorq $-0x1, %rax
andq -0x30(%rbp), %rax
movq %rax, -0x30(%rbp)
jmp 0x3b761
movq 0x98bd(%rip), %rax      # 0x44ff8
movq (%rax), %rdi
movslq -0x14(%rbp), %rcx
leaq 0x9cd7(%rip), %rax      # 0x45420
shlq $0x4, %rcx
addq %rcx, %rax
movq (%rax), %rdx
leaq 0x3bb4(%rip), %rsi      # 0x3f30e
movb $0x0, %al
callq 0x2210
jmp 0x3b763
jmp 0x3b80d
movq -0x20(%rbp), %rdi
leaq 0x3b94(%rip), %rsi      # 0x3f307
callq 0x21f0
cmpl $0x0, %eax
je 0x3b792
movq -0x20(%rbp), %rdi
leaq 0x1acd(%rip), %rsi      # 0x3d255
callq 0x21f0
cmpl $0x0, %eax
jne 0x3b7a4
movq -0x10(%rbp), %rax
xorq $-0x1, %rax
andq -0x30(%rbp), %rax
movq %rax, -0x30(%rbp)
jmp 0x3b80b
movq -0x20(%rbp), %rdi
leaq 0x3b5c(%rip), %rsi      # 0x3f30b
callq 0x21f0
cmpl $0x0, %eax
je 0x3b7ce
movq -0x20(%rbp), %rdi
leaq 0x18a5(%rip), %rsi      # 0x3d069
callq 0x21f0
cmpl $0x0, %eax
jne 0x3b7dc
movq -0x10(%rbp), %rax
orq -0x30(%rbp), %rax
movq %rax, -0x30(%rbp)
jmp 0x3b809
movq 0x9815(%rip), %rax      # 0x44ff8
movq (%rax), %rdi
movslq -0x14(%rbp), %rcx
leaq 0x9c2f(%rip), %rax      # 0x45420
shlq $0x4, %rcx
addq %rcx, %rax
movq (%rax), %rdx
leaq 0x3b0c(%rip), %rsi      # 0x3f30e
movb $0x0, %al
callq 0x2210
jmp 0x3b80b
jmp 0x3b80d
movq -0x30(%rbp), %rcx
movq -0x8(%rbp), %rax
movq %rcx, (%rax)
addq $0x30, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/lh3[P]minigraph/./ketopt.h
// Function: ketopt_permute
static void ketopt_permute(char *argv[], int j, int n) /* move argv[j] over n elements to the left */
{
	int k;
	char *p = argv[j];
	for (k = 0; k < n; ++k)
		argv[j - k] = argv[j - k - 1];
	argv[j - k] = p;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movl %edx, -0x10(%rbp)
movq -0x8(%rbp), %rax
movslq -0xc(%rbp), %rcx
movq (%rax,%rcx,8), %rax
movq %rax, -0x20(%rbp)
movl $0x0, -0x14(%rbp)
movl -0x14(%rbp), %eax
cmpl -0x10(%rbp), %eax
jge 0x3b87d
movq -0x8(%rbp), %rax
movl -0xc(%rbp), %ecx
subl -0x14(%rbp), %ecx
subl $0x1, %ecx
movslq %ecx, %rcx
movq (%rax,%rcx,8), %rdx
movq -0x8(%rbp), %rax
movl -0xc(%rbp), %ecx
subl -0x14(%rbp), %ecx
movslq %ecx, %rcx
movq %rdx, (%rax,%rcx,8)
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x3b845
movq -0x20(%rbp), %rdx
movq -0x8(%rbp), %rax
movl -0xc(%rbp), %ecx
subl -0x14(%rbp), %ecx
movslq %ecx, %rcx
movq %rdx, (%rax,%rcx,8)
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/kopytjuk[P]wasm-image-converter/src/converter.cpp
// Function: resolveImageType(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
ImageType resolveImageType(const string ext){
  if (ext == ".jpg" | ext==".jpeg"){
    return JpegImage;
  } else if (ext == ".png"){
    return PngImage;
  } else {
    return UnknownImage;
  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x20(%rbp)
movq %rdi, -0x10(%rbp)
leaq 0x1b9a5(%rip), %rsi     # 0x2218c
callq 0x6df0
movq -0x20(%rbp), %rdi
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x14(%rbp)
leaq 0x1b992(%rip), %rsi     # 0x22191
callq 0x6df0
movb %al, %cl
movl -0x14(%rbp), %eax
andb $0x1, %cl
movzbl %cl, %ecx
orl %ecx, %eax
cmpl $0x0, %eax
je 0x681f
movl $0x1, -0x4(%rbp)
jmp 0x6845
movq -0x20(%rbp), %rdi
leaq 0x1b96d(%rip), %rsi     # 0x22197
callq 0x6df0
testb $0x1, %al
jne 0x6835
jmp 0x683e
movl $0x0, -0x4(%rbp)
jmp 0x6845
movl $0x2, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/kopytjuk[P]wasm-image-converter/src/converter.cpp
// Function: convert_image(char**, int&, ImageType, char**, int&, ImageType)
void convert_image(char** inp, int& insize, ImageType intype, char** outp, 
  int& outsize, ImageType outtype){

  cout << "Decoding image..." << endl;

  cout << "First 10 bytes: ";
  utils::print_first_bytes(*inp, 10);

  rgb8_image_t imageData;

  char_array_to_image(inp, insize, imageData, intype);

  cout << "Image decoded! Encoding..." << endl;
  
  image_to_char_array(imageData, outtype, outp, outsize);

  cout << "Image encoded to desired format!" << endl;

}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xb0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movl %r9d, -0x2c(%rbp)
movq 0x2d757(%rip), %rdi     # 0x33fd0
movq %rdi, -0x98(%rbp)
leaq 0x1b915(%rip), %rsi     # 0x2219c
callq 0x5570
movq %rax, %rdi
movq 0x2d71a(%rip), %rsi     # 0x33fb0
callq 0x55d0
movq -0x98(%rbp), %rdi
leaq 0x1b905(%rip), %rsi     # 0x221ae
callq 0x5570
movq -0x8(%rbp), %rax
movq (%rax), %rdi
movl $0xa, %esi
callq 0x20f60
leaq -0x71(%rbp), %rdi
movq %rdi, -0x90(%rbp)
callq 0x6e20
movq -0x90(%rbp), %rdx
xorl %eax, %eax
movl %eax, %esi
leaq -0x70(%rbp), %rdi
callq 0x6e40
jmp 0x68e5
leaq -0x71(%rbp), %rdi
callq 0x6ea0
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movl (%rax), %esi
movl -0x14(%rbp), %ecx
leaq -0x70(%rbp), %rdx
callq 0x69d0
jmp 0x6906
movq 0x2d6c3(%rip), %rdi     # 0x33fd0
leaq 0x1b8ab(%rip), %rsi     # 0x221bf
callq 0x5570
movq %rax, -0xa0(%rbp)
jmp 0x6922
movq -0xa0(%rbp), %rdi
movq 0x2d680(%rip), %rsi     # 0x33fb0
callq 0x55d0
jmp 0x6937
movl -0x2c(%rbp), %esi
movq -0x20(%rbp), %rdx
movq -0x28(%rbp), %rcx
leaq -0x70(%rbp), %rdi
callq 0x6b30
jmp 0x694d
movq 0x2d67c(%rip), %rdi     # 0x33fd0
leaq 0x1b87f(%rip), %rsi     # 0x221da
callq 0x5570
movq %rax, -0xa8(%rbp)
jmp 0x6969
movq -0xa8(%rbp), %rdi
movq 0x2d639(%rip), %rsi     # 0x33fb0
callq 0x55d0
jmp 0x697e
leaq -0x70(%rbp), %rdi
callq 0x6ec0
addq $0xb0, %rsp
popq %rbp
retq
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
leaq -0x71(%rbp), %rdi
callq 0x6ea0
jmp 0x69c2
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x80(%rbp)
movl %eax, -0x84(%rbp)
leaq -0x70(%rbp), %rdi
callq 0x6ec0
movq -0x80(%rbp), %rdi
callq 0x59b0
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/kopytjuk[P]wasm-image-converter/src/converter.cpp
// Function: char_array_to_image(char**, int, boost::gil::image<boost::gil::pixel<unsigned char, boost::gil::layout<boost::mp11::mp_list<boost::gil::red_t, boost::gil::green_t, boost::gil::blue_t>, boost::mp11::mp_list<std::integral_constant<int, 0>, std::integral_constant<int, 1>, std::integral_constant<int, 2>>>>, false, std::allocator<unsigned char>>&, ImageType)
void char_array_to_image(char **arr, int arr_size, rgb8_image_t &img, ImageType type) {
  
  stringstream arr_stream(ios_base::in | ios_base::out | ios_base::binary);
  arr_stream.write(*arr, arr_size);
  arr_stream.seekg(0);

  switch (type) {
    case JpegImage:
      read_image( arr_stream, img, jpeg_tag() );
      break;
    case PngImage:
      read_image( arr_stream, img, png_tag() );
      break;
    default:
      cout << "Cannot convert input image type! Exiting." << endl;
      break;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1e0, %rsp            # imm = 0x1E0
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movl $0x8, %edi
movl $0x10, %esi
callq 0x70a0
movl %eax, %edi
movl $0x4, %esi
callq 0x70a0
movl %eax, %esi
leaq -0x1a8(%rbp), %rdi
callq 0x5430
leaq -0x198(%rbp), %rdi
movq -0x8(%rbp), %rax
movq (%rax), %rsi
movslq -0xc(%rbp), %rdx
callq 0x56d0
jmp 0x6a2b
xorl %eax, %eax
movl %eax, %esi
leaq -0x1c8(%rbp), %rdi
callq 0x70c0
jmp 0x6a3d
movq -0x1c8(%rbp), %rsi
movq -0x1c0(%rbp), %rdx
leaq -0x1a8(%rbp), %rdi
callq 0x56c0
jmp 0x6a59
movl -0x1c(%rbp), %eax
movl %eax, -0x1d0(%rbp)
testl %eax, %eax
je 0x6ab7
jmp 0x6a68
movl -0x1d0(%rbp), %eax
subl $0x1, %eax
je 0x6a98
jmp 0x6ad6
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x1b0(%rbp)
movl %eax, -0x1b4(%rbp)
leaq -0x1a8(%rbp), %rdi
callq 0x5420
jmp 0x6b1e
movq -0x18(%rbp), %rsi
xorl %eax, %eax
movl %eax, %ecx
leaq -0x1a8(%rbp), %rdi
leaq -0x1c9(%rbp), %rdx
callq 0x7100
jmp 0x6ab5
jmp 0x6b09
movq -0x18(%rbp), %rsi
xorl %eax, %eax
movl %eax, %ecx
leaq -0x1a8(%rbp), %rdi
leaq -0x1ca(%rbp), %rdx
callq 0x71e0
jmp 0x6ad4
jmp 0x6b09
movq 0x2d4f3(%rip), %rdi     # 0x33fd0
leaq 0x1b717(%rip), %rsi     # 0x221fb
callq 0x5570
movq %rax, -0x1d8(%rbp)
jmp 0x6af2
movq -0x1d8(%rbp), %rdi
movq 0x2d4b0(%rip), %rsi     # 0x33fb0
callq 0x55d0
jmp 0x6b07
jmp 0x6b09
leaq -0x1a8(%rbp), %rdi
callq 0x5420
addq $0x1e0, %rsp            # imm = 0x1E0
popq %rbp
retq
movq -0x1b0(%rbp), %rdi
callq 0x59b0
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/kopytjuk[P]wasm-image-converter/src/utils.cpp
// Function: utils::read_file_to_char_array(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, char*, int)
void utils::read_file_to_char_array(std::string fn, char *arr, int size){

  std::ifstream file (fn, std::ios::in | std::ios::binary);

  if (file.is_open())
  {
      file.seekg (0, std::ios::beg);
      file.read(arr, size);
      file.close();

  }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x240, %rsp            # imm = 0x240
movq %rdi, -0x240(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movl $0x8, %edi
movl $0x4, %esi
callq 0x70a0
movq -0x240(%rbp), %rsi
movl %eax, %edx
leaq -0x220(%rbp), %rdi
movq %rdi, -0x238(%rbp)
callq 0x58a0
movq -0x238(%rbp), %rdi
callq 0x5890
movb %al, -0x22d(%rbp)
jmp 0x20ecc
movb -0x22d(%rbp), %al
testb $0x1, %al
jne 0x20ed8
jmp 0x20f30
xorl %edx, %edx
movl %edx, %esi
leaq -0x220(%rbp), %rdi
callq 0x56f0
jmp 0x20eea
movq -0x10(%rbp), %rsi
movslq -0x14(%rbp), %rdx
leaq -0x220(%rbp), %rdi
callq 0x56b0
jmp 0x20f00
leaq -0x220(%rbp), %rdi
callq 0x5120
jmp 0x20f0e
jmp 0x20f30
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x228(%rbp)
movl %eax, -0x22c(%rbp)
leaq -0x220(%rbp), %rdi
callq 0x5160
jmp 0x20f45
leaq -0x220(%rbp), %rdi
callq 0x5160
addq $0x240, %rsp            # imm = 0x240
popq %rbp
retq
movq -0x228(%rbp), %rdi
callq 0x59b0
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/kopytjuk[P]wasm-image-converter/src/utils.cpp
// Function: utils::write_char_array_to_file(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>, char*, int)
void utils::write_char_array_to_file(const std::string fn, char *arr, int size){
    
    std::ofstream file (fn, std::ios::out | std::ios::binary);

    if (file.is_open())
    {
        file.write(arr, size);
        file.close();

    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x240, %rsp            # imm = 0x240
movq %rdi, -0x238(%rbp)
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movl $0x10, %edi
movl $0x4, %esi
callq 0x70a0
movq -0x238(%rbp), %rsi
movl %eax, %edx
leaq -0x218(%rbp), %rdi
movq %rdi, -0x230(%rbp)
callq 0x5a30
movq -0x230(%rbp), %rdi
callq 0x5470
movb %al, -0x225(%rbp)
jmp 0x2107c
movb -0x225(%rbp), %al
testb $0x1, %al
jne 0x21088
jmp 0x210ce
movq -0x10(%rbp), %rsi
movslq -0x14(%rbp), %rdx
leaq -0x218(%rbp), %rdi
callq 0x56d0
jmp 0x2109e
leaq -0x218(%rbp), %rdi
callq 0x5750
jmp 0x210ac
jmp 0x210ce
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x220(%rbp)
movl %eax, -0x224(%rbp)
leaq -0x218(%rbp), %rdi
callq 0x57b0
jmp 0x210e3
leaq -0x218(%rbp), %rdi
callq 0x57b0
addq $0x240, %rsp            # imm = 0x240
popq %rbp
retq
movq -0x220(%rbp), %rdi
callq 0x59b0
nop
// File: /workspace/github_c_makefile_star2_O0/kopytjuk[P]wasm-image-converter/src/utils.cpp
// Function: utils::filesize(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>>)
int utils::filesize(std::string fn){
    
    int size;

    std::ifstream file (fn, std::ios::in | std::ios::binary | std::ios::ate);

    if (file.is_open())
    {
        file.seekg(0, std::ios::end);
        size = file.tellg();
        file.close();
        return size;

    } else{
        return -1;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x270, %rsp            # imm = 0x270
movq %rdi, -0x258(%rbp)
movq %rdi, -0x10(%rbp)
movl $0x8, %edi
movl $0x4, %esi
callq 0x70a0
movl %eax, %edi
movl $0x2, %esi
callq 0x70a0
movq -0x258(%rbp), %rsi
movl %eax, %edx
leaq -0x220(%rbp), %rdi
movq %rdi, -0x250(%rbp)
callq 0x58a0
movq -0x250(%rbp), %rdi
callq 0x5890
movb %al, -0x245(%rbp)
jmp 0x21151
movb -0x245(%rbp), %al
testb $0x1, %al
jne 0x21160
jmp 0x2120e
xorl %eax, %eax
movl %eax, %esi
leaq -0x220(%rbp), %rdi
movl $0x2, %edx
callq 0x56f0
jmp 0x21177
leaq -0x220(%rbp), %rdi
callq 0x5970
movq %rdx, -0x268(%rbp)
movq %rax, -0x260(%rbp)
jmp 0x21193
movq -0x268(%rbp), %rax
movq -0x260(%rbp), %rcx
movq %rcx, -0x240(%rbp)
movq %rax, -0x238(%rbp)
leaq -0x240(%rbp), %rdi
callq 0x7410
movq %rax, -0x270(%rbp)
jmp 0x211c4
movq -0x270(%rbp), %rax
movl %eax, -0x14(%rbp)
leaq -0x220(%rbp), %rdi
callq 0x5120
jmp 0x211dc
movl -0x14(%rbp), %eax
movl %eax, -0x4(%rbp)
movl $0x1, -0x244(%rbp)
jmp 0x2121f
movq %rax, %rcx
movl %edx, %eax
movq %rcx, -0x228(%rbp)
movl %eax, -0x22c(%rbp)
leaq -0x220(%rbp), %rdi
callq 0x5160
jmp 0x21237
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
movl $0x1, -0x244(%rbp)
leaq -0x220(%rbp), %rdi
callq 0x5160
movl -0x4(%rbp), %eax
addq $0x270, %rsp            # imm = 0x270
popq %rbp
retq
movq -0x228(%rbp), %rdi
callq 0x59b0
// File: /workspace/github_c_makefile_star2_O0/giometti[P]mastering_UNIX_programming/chapter_01/group.c
// Function: main
int main(void) {
	struct group *grp;

	setgrent();
	while((grp = getgrent()) != NULL)
		printf("gid=%d name=%s\n",
			grp->gr_gid, grp->gr_name);
	endgrent();

	return 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movl $0x0, -0x4(%rbp)
callq 0x1060
callq 0x1040
movq %rax, -0x10(%rbp)
cmpq $0x0, %rax
je 0x11b1
movq -0x10(%rbp), %rax
movl 0x10(%rax), %esi
movq -0x10(%rbp), %rax
movq (%rax), %rdx
leaq 0xe5c(%rip), %rdi       # 0x2004
movb $0x0, %al
callq 0x1050
jmp 0x1184
callq 0x1030
xorl %eax, %eax
addq $0x10, %rsp
popq %rbp
retq
// File: /workspace/github_c_makefile_star2_O0/craigbarnes[P]lua-gumbo/gumbo/util.c
// Function: trim
static int trim(lua_State *L)
{
    size_t len;
    const char *str = luaL_checklstring(L, 1, &len);
    const char *trimmed = do_trim(str, &len);
    lua_pushlstring(L, trimmed, len);
    return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movl $0x1, %esi
leaq -0x10(%rbp), %rdx
callq 0x1070
movq %rax, -0x18(%rbp)
movq -0x18(%rbp), %rdi
leaq -0x10(%rbp), %rsi
callq 0x1460
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rdi
movq -0x20(%rbp), %rsi
movq -0x10(%rbp), %rdx
callq 0x10a0
movl $0x1, %eax
addq $0x20, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/craigbarnes[P]lua-gumbo/gumbo/util.c
// Function: trim_and_collapse
static int trim_and_collapse(lua_State *L)
{
    luaL_Buffer b;
    size_t len;
    const char *str = luaL_checklstring(L, 1, &len);
    str = do_trim(str, &len);

    #if LUA_VERSION_NUM >= 502
        char *out = luaL_buffinitsize(L, &b, len);
        size_t pos = 0;
    #else
        luaL_buffinit(L, &b);
    #endif

    for (size_t i = 0; i < len; ) {
        char ch = str[i++];
        if (ascii_isspace(ch)) {
            while (i < len && ascii_isspace(str[i])) {
                i++;
            }
            ch = ' ';
        }
        #if LUA_VERSION_NUM >= 502
            out[pos++] = ch;
        #else
            luaL_addchar(&b, ch);
        #endif
    }

    #if LUA_VERSION_NUM >= 502
        luaL_addsize(&b, pos);
    #endif

    luaL_pushresult(&b);
    return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x2060, %rsp           # imm = 0x2060
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movl $0x1, %esi
leaq -0x2030(%rbp), %rdx
callq 0x1070
movq %rax, -0x2038(%rbp)
movq -0x2038(%rbp), %rdi
leaq -0x2030(%rbp), %rsi
callq 0x1460
movq %rax, -0x2038(%rbp)
movq -0x8(%rbp), %rdi
movq -0x2030(%rbp), %rdx
leaq -0x2028(%rbp), %rsi
callq 0x1090
movq %rax, -0x2040(%rbp)
movq $0x0, -0x2048(%rbp)
movq $0x0, -0x2050(%rbp)
movq -0x2050(%rbp), %rax
cmpq -0x2030(%rbp), %rax
jae 0x1386
movq -0x2038(%rbp), %rax
movq -0x2050(%rbp), %rcx
movq %rcx, %rdx
addq $0x1, %rdx
movq %rdx, -0x2050(%rbp)
movb (%rax,%rcx), %al
movb %al, -0x2051(%rbp)
movl $0x1, %esi
movzbl -0x2051(%rbp), %edi
callq 0x1530
testb $0x1, %al
jne 0x12f9
jmp 0x135c
jmp 0x12fb
movq -0x2050(%rbp), %rcx
xorl %eax, %eax
cmpq -0x2030(%rbp), %rcx
movb %al, -0x2052(%rbp)
jae 0x1335
movq -0x2038(%rbp), %rax
movq -0x2050(%rbp), %rcx
movl $0x1, %esi
movzbl (%rax,%rcx), %edi
callq 0x1530
movb %al, -0x2052(%rbp)
movb -0x2052(%rbp), %al
testb $0x1, %al
jne 0x1341
jmp 0x1355
movq -0x2050(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x2050(%rbp)
jmp 0x12fb
movb $0x20, -0x2051(%rbp)
movb -0x2051(%rbp), %dl
movq -0x2040(%rbp), %rax
movq -0x2048(%rbp), %rcx
movq %rcx, %rsi
addq $0x1, %rsi
movq %rsi, -0x2048(%rbp)
movb %dl, (%rax,%rcx)
jmp 0x12a9
movq -0x2048(%rbp), %rax
addq -0x2018(%rbp), %rax
movq %rax, -0x2018(%rbp)
leaq -0x2028(%rbp), %rdi
callq 0x1060
movl $0x1, %eax
addq $0x2060, %rsp           # imm = 0x2060
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/craigbarnes[P]lua-gumbo/gumbo/util.c
// Function: createtable
static int createtable(lua_State *L)
{
    lua_Integer narr = luaL_checkinteger(L, 1);
    lua_Integer nrec = luaL_checkinteger(L, 2);
    if (unlikely(narr < 0 || narr > INT_MAX)) {
        luaL_argerror(L, 1, "value outside valid range");
    }
    if (unlikely(nrec < 0 || nrec > INT_MAX)) {
        luaL_argerror(L, 2, "value outside valid range");
    }
    lua_createtable(L, (int)narr, (int)nrec);
    return 1;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rdi
movl $0x1, %esi
callq 0x1080
movq %rax, -0x10(%rbp)
movq -0x8(%rbp), %rdi
movl $0x2, %esi
callq 0x1080
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x10(%rbp)
jl 0x1401
cmpq $0x7fffffff, -0x10(%rbp) # imm = 0x7FFFFFFF
jle 0x1416
movq -0x8(%rbp), %rdi
movl $0x1, %esi
leaq 0xc22(%rip), %rdx       # 0x2033
callq 0x1040
cmpq $0x0, -0x18(%rbp)
jl 0x1427
cmpq $0x7fffffff, -0x18(%rbp) # imm = 0x7FFFFFFF
jle 0x143c
movq -0x8(%rbp), %rdi
movl $0x2, %esi
leaq 0xbfc(%rip), %rdx       # 0x2033
callq 0x1040
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rax
movl %eax, %esi
movq -0x18(%rbp), %rax
movl %eax, %edx
callq 0x1050
movl $0x1, %eax
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/craigbarnes[P]lua-gumbo/gumbo/util.c
// Function: do_trim
static const char *do_trim(const char *str, size_t *n)
{
    size_t len = *n;
    while (len && ascii_isspace(*str)) {
        len--;
        str++;
    }

    const char *end = str + len - 1;
    while (len && ascii_isspace(*end)) {
        len--;
        end--;
    }

    *n = len;
    return str;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq (%rax), %rax
movq %rax, -0x18(%rbp)
xorl %eax, %eax
cmpq $0x0, -0x18(%rbp)
movb %al, -0x21(%rbp)
je 0x149b
movq -0x8(%rbp), %rax
movl $0x1, %esi
movzbl (%rax), %edi
callq 0x1530
movb %al, -0x21(%rbp)
movb -0x21(%rbp), %al
testb $0x1, %al
jne 0x14a4
jmp 0x14be
movq -0x18(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x8(%rbp)
jmp 0x147b
movq -0x8(%rbp), %rax
addq -0x18(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x20(%rbp)
xorl %eax, %eax
cmpq $0x0, -0x18(%rbp)
movb %al, -0x22(%rbp)
je 0x14ee
movq -0x20(%rbp), %rax
movl $0x1, %esi
movzbl (%rax), %edi
callq 0x1530
movb %al, -0x22(%rbp)
movb -0x22(%rbp), %al
testb $0x1, %al
jne 0x14f7
jmp 0x1511
movq -0x18(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x18(%rbp)
movq -0x20(%rbp), %rax
addq $-0x1, %rax
movq %rax, -0x20(%rbp)
jmp 0x14ce
movq -0x18(%rbp), %rcx
movq -0x10(%rbp), %rax
movq %rcx, (%rax)
movq -0x8(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/skoren[P]bacValidation/bamcat.c
// Function: bam_header_dup
bam_header_t *bam_header_dup(const bam_header_t *h0)
{
	bam_header_t *h;
	int i;
	h = bam_header_init();
	*h = *h0;
	h->hash = h->dict = h->rg2lib = 0;
	h->text = (char*)calloc(h->l_text + 1, 1);
	memcpy(h->text, h0->text, h->l_text);
	h->target_len = (uint32_t*)calloc(h->n_targets, 4);
	h->target_name = (char**)calloc(h->n_targets, sizeof(void*));
	for (i = 0; i < h->n_targets; ++i) {
		h->target_len[i] = h0->target_len[i];
		h->target_name[i] = strdup(h0->target_name[i]);
	}
	return h;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
callq 0x6630
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rdi
movq -0x8(%rbp), %rsi
movl $0x40, %edx
callq 0x32d0
movq -0x10(%rbp), %rax
movq $0x0, 0x28(%rax)
movq -0x10(%rbp), %rax
movq $0x0, 0x18(%rax)
movq -0x10(%rbp), %rax
movq $0x0, 0x20(%rax)
movq -0x10(%rbp), %rax
movl 0x30(%rax), %eax
addl $0x1, %eax
movl %eax, %eax
movl %eax, %edi
movl $0x1, %esi
callq 0x3210
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x38(%rax)
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rdi
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rsi
movq -0x10(%rbp), %rax
movl 0x30(%rax), %eax
movl %eax, %edx
callq 0x32d0
movq -0x10(%rbp), %rax
movslq (%rax), %rdi
movl $0x4, %esi
callq 0x3210
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x10(%rbp), %rax
movslq (%rax), %rdi
movl $0x8, %esi
callq 0x3210
movq %rax, %rcx
movq -0x10(%rbp), %rax
movq %rcx, 0x8(%rax)
movl $0x0, -0x14(%rbp)
movl -0x14(%rbp), %eax
movq -0x10(%rbp), %rcx
cmpl (%rcx), %eax
jge 0x39b7
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x14(%rbp), %rcx
movl (%rax,%rcx,4), %edx
movq -0x10(%rbp), %rax
movq 0x10(%rax), %rax
movslq -0x14(%rbp), %rcx
movl %edx, (%rax,%rcx,4)
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0x14(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x36d0
movq %rax, %rdx
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0x14(%rbp), %rcx
movq %rdx, (%rax,%rcx,8)
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x395b
movq -0x10(%rbp), %rax
addq $0x20, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/skoren[P]bacValidation/bamcat.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 %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq $0x0, -0x20(%rbp)
movl $0xff00, %edi           # imm = 0xFF00
callq 0x3620
cmpq $0x10000, %rax          # imm = 0x10000
jae 0x3c5c
jmp 0x3c7b
leaq 0xe821(%rip), %rdi      # 0x12484
leaq 0xe505(%rip), %rsi      # 0x1216f
movl $0x4db, %edx            # imm = 0x4DB
leaq 0xe843(%rip), %rcx      # 0x124b9
callq 0x3200
movq -0x18(%rbp), %rdi
movl $0x72, %esi
callq 0x3110
cmpq $0x0, %rax
jne 0x3ca3
movq -0x18(%rbp), %rdi
movl $0x52, %esi
callq 0x3110
cmpq $0x0, %rax
je 0x3ce1
movq -0x10(%rbp), %rdi
leaq 0xe609(%rip), %rsi      # 0x122b7
callq 0x3480
movq %rax, -0x28(%rbp)
cmpq $0x0, %rax
jne 0x3cca
movq $0x0, -0x8(%rbp)
jmp 0x3d57
callq 0xd600
movq %rax, -0x20(%rbp)
movq -0x28(%rbp), %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x30(%rax)
jmp 0x3d4f
movq -0x18(%rbp), %rdi
movl $0x77, %esi
callq 0x3110
cmpq $0x0, %rax
jne 0x3d09
movq -0x18(%rbp), %rdi
movl $0x57, %esi
callq 0x3110
cmpq $0x0, %rax
je 0x3d4d
movq -0x10(%rbp), %rdi
leaq 0xe7d1(%rip), %rsi      # 0x124e5
callq 0x3480
movq %rax, -0x30(%rbp)
cmpq $0x0, %rax
jne 0x3d2d
movq $0x0, -0x8(%rbp)
jmp 0x3d57
movq -0x18(%rbp), %rdi
callq 0x95e0
movl %eax, %edi
callq 0x9520
movq %rax, -0x20(%rbp)
movq -0x30(%rbp), %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x30(%rax)
jmp 0x3d4f
movq -0x20(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/skoren[P]bacValidation/bamcat.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
movq %rsp, %rbp
subq $0x30, %rsp
movl %edi, -0xc(%rbp)
movq %rsi, -0x18(%rbp)
movq $0x0, -0x20(%rbp)
movl $0xff00, %edi           # imm = 0xFF00
callq 0x3620
cmpq $0x10000, %rax          # imm = 0x10000
jae 0x3d9b
jmp 0x3dba
leaq 0xe6e2(%rip), %rdi      # 0x12484
leaq 0xe3c6(%rip), %rsi      # 0x1216f
movl $0x4ed, %edx            # imm = 0x4ED
leaq 0xe732(%rip), %rcx      # 0x124e7
callq 0x3200
movq -0x18(%rbp), %rdi
movl $0x72, %esi
callq 0x3110
cmpq $0x0, %rax
jne 0x3de2
movq -0x18(%rbp), %rdi
movl $0x52, %esi
callq 0x3110
cmpq $0x0, %rax
je 0x3e1f
movl -0xc(%rbp), %edi
leaq 0xe4cb(%rip), %rsi      # 0x122b7
callq 0x3410
movq %rax, -0x28(%rbp)
cmpq $0x0, %rax
jne 0x3e08
movq $0x0, -0x8(%rbp)
jmp 0x3e94
callq 0xd600
movq %rax, -0x20(%rbp)
movq -0x28(%rbp), %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x30(%rax)
jmp 0x3e8c
movq -0x18(%rbp), %rdi
movl $0x77, %esi
callq 0x3110
cmpq $0x0, %rax
jne 0x3e47
movq -0x18(%rbp), %rdi
movl $0x57, %esi
callq 0x3110
cmpq $0x0, %rax
je 0x3e8a
movl -0xc(%rbp), %edi
leaq 0xe694(%rip), %rsi      # 0x124e5
callq 0x3410
movq %rax, -0x30(%rbp)
cmpq $0x0, %rax
jne 0x3e6a
movq $0x0, -0x8(%rbp)
jmp 0x3e94
movq -0x18(%rbp), %rdi
callq 0x95e0
movl %eax, %edi
callq 0x9520
movq %rax, -0x20(%rbp)
movq -0x30(%rbp), %rcx
movq -0x20(%rbp), %rax
movq %rcx, 0x30(%rax)
jmp 0x3e8c
movq -0x20(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/skoren[P]bacValidation/bamcat.c
// Function: sam_open
tamFile sam_open(const char *fn)
{
	tamFile fp;
	gzFile gzfp = (strcmp(fn, "-") == 0)? gzdopen(fileno(stdin), "rb") : gzopen(fn, "rb");
	if (gzfp == 0) return 0;
	fp = (tamFile)calloc(1, sizeof(struct __tamFile_t));
	fp->str = (kstring_t*)calloc(1, sizeof(kstring_t));
	fp->fp = gzfp;
	fp->ks = ks_init(fp->fp);
	return fp;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x10(%rbp)
movq -0x10(%rbp), %rdi
leaq 0xdf09(%rip), %rsi      # 0x12030
callq 0x3570
cmpl $0x0, %eax
jne 0x4154
movq 0x12e88(%rip), %rax     # 0x16fc0
movq (%rax), %rdi
callq 0x3400
movl %eax, %edi
leaq 0xe338(%rip), %rsi      # 0x12481
callq 0x36b0
movq %rax, -0x28(%rbp)
jmp 0x4168
movq -0x10(%rbp), %rdi
leaq 0xe322(%rip), %rsi      # 0x12481
callq 0x35c0
movq %rax, -0x28(%rbp)
movq -0x28(%rbp), %rax
movq %rax, -0x20(%rbp)
cmpq $0x0, -0x20(%rbp)
jne 0x4181
movq $0x0, -0x8(%rbp)
jmp 0x41d8
movl $0x1, %edi
movl $0x28, %esi
callq 0x3210
movq %rax, -0x18(%rbp)
movl $0x1, %edi
movl $0x18, %esi
callq 0x3210
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x10(%rax)
movq -0x20(%rbp), %rcx
movq -0x18(%rbp), %rax
movq %rcx, (%rax)
movq -0x18(%rbp), %rax
movq (%rax), %rdi
callq 0x86e0
movq %rax, %rcx
movq -0x18(%rbp), %rax
movq %rcx, 0x8(%rax)
movq -0x18(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/skoren[P]bacValidation/bamcat.c
// Function: sam_header_read
bam_header_t *sam_header_read(tamFile fp)
{
	int ret, dret;
	bam_header_t *header = bam_header_init();
	kstring_t *str = fp->str;
	while ((ret = ks_getuntil(fp->ks, KS_SEP_TAB, str, &dret)) >= 0 && str->s[0] == '@') { // skip header
		str->s[str->l] = dret; // note that str->s is NOT null terminated!!
		append_text(header, str);
		if (dret != '\n') {
			ret = ks_getuntil(fp->ks, '\n', str, &dret);
			str->s[str->l] = '\n'; // NOT null terminated!!
			append_text(header, str);
		}
		++fp->n_lines;
	}
	sam_header_parse(header);
	bam_init_header_hash(header);
	fp->is_first = 1;
	return header;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x30, %rsp
movq %rdi, -0x8(%rbp)
callq 0x6630
movq %rax, -0x18(%rbp)
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq %rax, -0x20(%rbp)
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x20(%rbp), %rdx
movl $0x1, %esi
leaq -0x10(%rbp), %rcx
callq 0x8730
movl %eax, %ecx
movl %ecx, -0xc(%rbp)
xorl %eax, %eax
cmpl $0x0, %ecx
movb %al, -0x21(%rbp)
jl 0x424e
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
movsbl (%rax), %eax
cmpl $0x40, %eax
sete %al
movb %al, -0x21(%rbp)
movb -0x21(%rbp), %al
testb $0x1, %al
jne 0x4257
jmp 0x42d3
movl -0x10(%rbp), %eax
movb %al, %dl
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x20(%rbp), %rcx
movq (%rcx), %rcx
movb %dl, (%rax,%rcx)
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x9120
cmpl $0xa, -0x10(%rbp)
je 0x42be
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rdi
movq -0x20(%rbp), %rdx
movl $0xa, %esi
leaq -0x10(%rbp), %rcx
callq 0x8730
movl %eax, -0xc(%rbp)
movq -0x20(%rbp), %rax
movq 0x10(%rax), %rax
movq -0x20(%rbp), %rcx
movq (%rcx), %rcx
movb $0xa, (%rax,%rcx)
movq -0x18(%rbp), %rdi
movq -0x20(%rbp), %rsi
callq 0x9120
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rcx
addq $0x1, %rcx
movq %rcx, 0x18(%rax)
jmp 0x4211
movq -0x18(%rbp), %rdi
callq 0x8d20
movq -0x18(%rbp), %rdi
callq 0x7920
movq -0x8(%rbp), %rax
movl $0x1, 0x20(%rax)
movq -0x18(%rbp), %rax
addq $0x30, %rsp
popq %rbp
retq
nopw (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/skoren[P]bacValidation/bamcat.c
// Function: append_header_text
static void append_header_text(bam_header_t *header, char* text, int len)
{
	int x = header->l_text + 1;
	int y = header->l_text + len + 1; // 1 byte null
	if (text == 0) return;
	kroundup32(x); 
	kroundup32(y);
	if (x < y) header->text = (char*)realloc(header->text, y);
	strncpy(header->text + header->l_text, text, len); // we cannot use strcpy() here.
	header->l_text += len;
	header->text[header->l_text] = 0;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl %edx, -0x14(%rbp)
movq -0x8(%rbp), %rax
movl 0x30(%rax), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
movq -0x8(%rbp), %rax
movl 0x30(%rax), %eax
addl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0x456c
jmp 0x4669
movl -0x18(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x18(%rbp)
movl -0x18(%rbp), %eax
sarl %eax
orl -0x18(%rbp), %eax
movl %eax, -0x18(%rbp)
movl -0x18(%rbp), %eax
sarl $0x2, %eax
orl -0x18(%rbp), %eax
movl %eax, -0x18(%rbp)
movl -0x18(%rbp), %eax
sarl $0x4, %eax
orl -0x18(%rbp), %eax
movl %eax, -0x18(%rbp)
movl -0x18(%rbp), %eax
sarl $0x8, %eax
orl -0x18(%rbp), %eax
movl %eax, -0x18(%rbp)
movl -0x18(%rbp), %eax
sarl $0x10, %eax
orl -0x18(%rbp), %eax
movl %eax, -0x18(%rbp)
movl -0x18(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x18(%rbp)
movl -0x1c(%rbp), %eax
addl $-0x1, %eax
movl %eax, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
sarl %eax
orl -0x1c(%rbp), %eax
movl %eax, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
sarl $0x2, %eax
orl -0x1c(%rbp), %eax
movl %eax, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
sarl $0x4, %eax
orl -0x1c(%rbp), %eax
movl %eax, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
sarl $0x8, %eax
orl -0x1c(%rbp), %eax
movl %eax, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
sarl $0x10, %eax
orl -0x1c(%rbp), %eax
movl %eax, -0x1c(%rbp)
movl -0x1c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x1c(%rbp)
movl -0x18(%rbp), %eax
cmpl -0x1c(%rbp), %eax
jge 0x462a
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rdi
movslq -0x1c(%rbp), %rsi
callq 0x3650
movq %rax, %rcx
movq -0x8(%rbp), %rax
movq %rcx, 0x38(%rax)
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rdi
movq -0x8(%rbp), %rax
movl 0x30(%rax), %eax
addq %rax, %rdi
movq -0x10(%rbp), %rsi
movslq -0x14(%rbp), %rdx
callq 0x3190
movl -0x14(%rbp), %ecx
movq -0x8(%rbp), %rax
addl 0x30(%rax), %ecx
movl %ecx, 0x30(%rax)
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rax
movq -0x8(%rbp), %rcx
movl 0x30(%rcx), %ecx
movb $0x0, (%rax,%rcx)
addq $0x20, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/skoren[P]bacValidation/bamcat.c
// Function: bam_header_destroy
void bam_header_destroy(bam_header_t *header)
{
	int32_t i;
	//extern void bam_destroy_header_hash(bam_header_t *header);
	if (header == 0) return;
	if (header->target_name) {
		for (i = 0; i < header->n_targets; ++i)
			free(header->target_name[i]);
		free(header->target_name);
		free(header->target_len);
	}
	free(header->text);
	if (header->dict) sam_header_free(header->dict);
	if (header->rg2lib) sam_tbl_destroy(header->rg2lib);
	//bam_destroy_header_hash(header);
	free(header);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
cmpq $0x0, -0x8(%rbp)
jne 0x4688
jmp 0x4725
movq -0x8(%rbp), %rax
cmpq $0x0, 0x8(%rax)
je 0x46df
movl $0x0, -0xc(%rbp)
movl -0xc(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl (%rcx), %eax
jge 0x46c5
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rax
movslq -0xc(%rbp), %rcx
movq (%rax,%rcx,8), %rdi
callq 0x3490
movl -0xc(%rbp), %eax
addl $0x1, %eax
movl %eax, -0xc(%rbp)
jmp 0x469a
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x3490
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x3490
movq -0x8(%rbp), %rax
movq 0x38(%rax), %rdi
callq 0x3490
movq -0x8(%rbp), %rax
cmpq $0x0, 0x18(%rax)
je 0x4704
movq -0x8(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0x6650
movq -0x8(%rbp), %rax
cmpq $0x0, 0x28(%rax)
je 0x471c
movq -0x8(%rbp), %rax
movq 0x28(%rax), %rdi
callq 0x66a0
movq -0x8(%rbp), %rdi
callq 0x3490
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/skoren[P]bacValidation/bamcat.c
// Function: samclose
void samclose(samfile_t *fp)
{
	if (fp == 0) return;
	if (fp->header) bam_header_destroy(fp->header);
	if (fp->type & TYPE_BAM) bam_close(fp->x.bam);
	else if (fp->type & TYPE_READ) sam_close(fp->x.tamr);
	else fclose(fp->x.tamw);
	free(fp);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
cmpq $0x0, -0x8(%rbp)
jne 0x4745
jmp 0x47af
movq -0x8(%rbp), %rax
cmpq $0x0, 0x10(%rax)
je 0x475d
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x4670
movq -0x8(%rbp), %rax
movl (%rax), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x477a
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x47c0
jmp 0x47a6
movq -0x8(%rbp), %rax
movl (%rax), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x4797
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x4930
jmp 0x47a4
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x3380
jmp 0x47a6
movq -0x8(%rbp), %rdi
callq 0x3490
addq $0x10, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)
// File: /workspace/github_c_makefile_star2_O0/skoren[P]bacValidation/bamcat.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
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x10(%rbp)
cmpq $0x0, -0x10(%rbp)
jne 0x47df
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x4925
movq -0x10(%rbp), %rax
movl (%rax), %eax
shll $0xe, %eax
sarl $0x1e, %eax
cmpl $0x0, %eax
je 0x48aa
movq -0x10(%rbp), %rdi
callq 0x9d30
cmpl $0x0, %eax
je 0x480e
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x4925
movq -0x10(%rbp), %rax
movl (%rax), %ecx
andl $0x3ffff, %ecx          # imm = 0x3FFFF
orl $0xfffc0000, %ecx       # imm = 0xFFFC0000
movl %ecx, (%rax)
movq -0x10(%rbp), %rdi
xorl %esi, %esi
callq 0x9fd0
movl %eax, -0x1c(%rbp)
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rdi
movslq -0x1c(%rbp), %rdx
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rcx
movl $0x1, %esi
callq 0x3730
movl %eax, -0x18(%rbp)
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rdi
callq 0x3470
cmpl $0x0, %eax
je 0x4890
movq -0x10(%rbp), %rax
movl (%rax), %edx
shll $0x10, %edx
sarl $0x10, %edx
orl $0x4, %edx
movl (%rax), %ecx
andl $0xffff, %edx           # imm = 0xFFFF
andl $0xffff0000, %ecx       # imm = 0xFFFF0000
orl %edx, %ecx
movl %ecx, (%rax)
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x4925
movq -0x10(%rbp), %rax
cmpq $0x0, 0x38(%rax)
je 0x48a8
movq -0x10(%rbp), %rax
movq 0x38(%rax), %rdi
callq 0xa360
jmp 0x48aa
movq -0x10(%rbp), %rax
movl (%rax), %eax
shll $0xe, %eax
sarl $0x1e, %eax
cmpl $0x0, %eax
je 0x48cd
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rdi
callq 0x3380
movl %eax, -0x20(%rbp)
jmp 0x48dd
movq -0x10(%rbp), %rax
movq 0x30(%rax), %rdi
callq 0x3380
movl %eax, -0x20(%rbp)
movl -0x20(%rbp), %eax
movl %eax, -0x14(%rbp)
cmpl $0x0, -0x14(%rbp)
je 0x48f2
movl $0xffffffff, -0x4(%rbp) # imm = 0xFFFFFFFF
jmp 0x4925
movq -0x10(%rbp), %rax
movq 0x18(%rax), %rdi
callq 0x3490
movq -0x10(%rbp), %rax
movq 0x20(%rax), %rdi
callq 0x3490
movq -0x10(%rbp), %rdi
callq 0xa4b0
movq -0x10(%rbp), %rdi
callq 0x3490
movl $0x0, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0x20, %rsp
popq %rbp
retq
nop
// File: /workspace/github_c_makefile_star2_O0/skoren[P]bacValidation/bamcat.c
// Function: sam_close
void sam_close(tamFile fp)
{
	if (fp) {
		ks_destroy(fp->ks);
		gzclose(fp->fp);
		free(fp->str->s); free(fp->str);
		free(fp);
	}
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x10, %rsp
movq %rdi, -0x8(%rbp)
cmpq $0x0, -0x8(%rbp)
je 0x4983
movq -0x8(%rbp), %rax
movq 0x8(%rax), %rdi
callq 0x8770
movq -0x8(%rbp), %rax
movq (%rax), %rdi
callq 0x3660
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rax
movq 0x10(%rax), %rdi
callq 0x3490
movq -0x8(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0x3490
movq -0x8(%rbp), %rdi
callq 0x3490
addq $0x10, %rsp
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/skoren[P]bacValidation/bamcat.c
// Function: bam_cigar2qlen
int32_t bam_cigar2qlen(const bam1_core_t *c, const uint32_t *cigar)
{
	uint32_t k;
	int32_t l = 0;
	for (k = 0; k < c->n_cigar; ++k)
		if (bam_cigar_type(bam_cigar_op(cigar[k]))&1)
			l += bam_cigar_oplen(cigar[k]);
	return l;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movl $0x0, -0x18(%rbp)
movl $0x0, -0x14(%rbp)
movl -0x14(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0x10(%rcx), %eax
jae 0x6627
movq -0x10(%rbp), %rax
movl -0x14(%rbp), %ecx
movl (%rax,%rcx,4), %ecx
andl $0xf, %ecx
shll %ecx
movl $0x3c1a7, %eax          # imm = 0x3C1A7
sarl %cl, %eax
andl $0x3, %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x661a
movq -0x10(%rbp), %rax
movl -0x14(%rbp), %ecx
movl (%rax,%rcx,4), %eax
shrl $0x4, %eax
addl -0x18(%rbp), %eax
movl %eax, -0x18(%rbp)
jmp 0x661c
movl -0x14(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x14(%rbp)
jmp 0x65da
movl -0x18(%rbp), %eax
popq %rbp
retq
nopl (%rax)
// File: /workspace/github_c_makefile_star2_O0/skoren[P]bacValidation/bamcat.c
// Function: sam_header_free
void sam_header_free(void *_header)
{
	HeaderDict *header = (HeaderDict*)_header;
    list_t *hlines = header;
    while (hlines)
    {
        sam_header_line_free(hlines->data);
        hlines = hlines->next;
    }
    list_free(header);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x20, %rsp
movq %rdi, -0x8(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x10(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x18(%rbp)
cmpq $0x0, -0x18(%rbp)
je 0x668e
movq -0x18(%rbp), %rax
movq 0x10(%rax), %rdi
callq 0xa9d0
movq -0x18(%rbp), %rax
movq 0x8(%rax), %rax
movq %rax, -0x18(%rbp)
jmp 0x666c
movq -0x10(%rbp), %rdi
callq 0xaa40
addq $0x20, %rsp
popq %rbp
retq
nopl (%rax)