// File: /workspace/github_c_makefile_star2_O0/DReichLab[P]adna/hts.c
// Function: hts_open
htsFile *hts_open(const char *fn, const char *mode, const char *fn_aux)
{
	htsFile *fp;
	fp = (htsFile*)calloc(1, sizeof(htsFile));
	fp->fn = strdup(fn);
	fp->is_be = ed_is_big();
	if (strchr(mode, 'w')) fp->is_write = 1;
	if (strchr(mode, 'b')) fp->is_bin = 1;
	if (fp->is_bin) {
		if (fp->is_write) fp->fp = strcmp(fn, "-")? bgzf_open(fn, mode) : bgzf_dopen(fileno(stdout), mode);
		else fp->fp = strcmp(fn, "-")? bgzf_open(fn, "r") : bgzf_dopen(fileno(stdin), "r");
	} else {
		if (!fp->is_write) {
			gzFile gzfp;
			gzfp = strcmp(fn, "-")? gzopen(fn, "rb") : gzdopen(fileno(stdin), "rb");
			if (gzfp) fp->fp = ks_init(gzfp);
			if (fn_aux) fp->fn_aux = strdup(fn_aux);
		} else fp->fp = strcmp(fn, "-")? fopen(fn, "rb") : stdout;
	}
	if (fp->fp == 0) {
		if (hts_verbose >= 2)
			fprintf(stderr, "[E::%s] fail to open file '%s'\n", __func__, fn);
		free(fp->fn_aux); free(fp);
		return 0;
	}
	return fp;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
movq %rdx, -0x20(%rbp)
movl $0x1, %edi
movl $0x40, %esi
callq 0x2200
movq %rax, -0x28(%rbp)
movq -0x10(%rbp), %rdi
callq 0x23f0
movq %rax, %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x28(%rax)
callq 0xbc50
movl %eax, %edx
movq -0x28(%rbp), %rax
movl (%rax), %ecx
andl $0x1, %edx
shll $0x2, %edx
andl $-0x5, %ecx
orl %edx, %ecx
movl %ecx, (%rax)
movq -0x18(%rbp), %rdi
movl $0x77, %esi
callq 0x2160
cmpq $0x0, %rax
je 0x7827
movq -0x28(%rbp), %rax
movl (%rax), %ecx
andl $-0x3, %ecx
orl $0x2, %ecx
movl %ecx, (%rax)
movq -0x18(%rbp), %rdi
movl $0x62, %esi
callq 0x2160
cmpq $0x0, %rax
je 0x7849
movq -0x28(%rbp), %rax
movl (%rax), %ecx
andl $-0x2, %ecx
orl $0x1, %ecx
movl %ecx, (%rax)
movq -0x28(%rbp), %rax
movl (%rax), %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x791c
movq -0x28(%rbp), %rax
movl (%rax), %eax
shrl %eax
andl $0x1, %eax
cmpl $0x0, %eax
je 0x78bf
movq -0x10(%rbp), %rdi
leaq 0xb895(%rip), %rsi      # 0x1310b
callq 0x2210
cmpl $0x0, %eax
je 0x7893
movq -0x10(%rbp), %rdi
movq -0x18(%rbp), %rsi
callq 0x4790
movq %rax, -0x38(%rbp)
jmp 0x78b1
movq 0xf726(%rip), %rax      # 0x16fc0
movq (%rax), %rdi
callq 0x2270
movl %eax, %edi
movq -0x18(%rbp), %rsi
callq 0x4a40
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x38(%rax)
jmp 0x7917
movq -0x10(%rbp), %rdi
leaq 0xb841(%rip), %rsi      # 0x1310b
callq 0x2210
cmpl $0x0, %eax
je 0x78ea
movq -0x10(%rbp), %rdi
leaq 0xbf7f(%rip), %rsi      # 0x1385e
callq 0x4790
movq %rax, -0x40(%rbp)
jmp 0x790b
movq 0xf6d7(%rip), %rax      # 0x16fc8
movq (%rax), %rdi
callq 0x2270
movl %eax, %edi
leaq 0xbf5c(%rip), %rsi      # 0x1385e
callq 0x4a40
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x38(%rax)
jmp 0x7a03
movq -0x28(%rbp), %rax
movl (%rax), %eax
shrl %eax
andl $0x1, %eax
cmpl $0x0, %eax
jne 0x79bc
movq -0x10(%rbp), %rdi
leaq 0xb7d0(%rip), %rsi      # 0x1310b
callq 0x2210
cmpl $0x0, %eax
je 0x795b
movq -0x10(%rbp), %rdi
leaq 0xb9d0(%rip), %rsi      # 0x13320
callq 0x2330
movq %rax, -0x48(%rbp)
jmp 0x797c
movq 0xf666(%rip), %rax      # 0x16fc8
movq (%rax), %rdi
callq 0x2270
movl %eax, %edi
leaq 0xb9ad(%rip), %rsi      # 0x13320
callq 0x2120
movq %rax, -0x48(%rbp)
movq -0x48(%rbp), %rax
movq %rax, -0x30(%rbp)
cmpq $0x0, -0x30(%rbp)
je 0x799f
movq -0x30(%rbp), %rdi
callq 0x67c0
movq %rax, %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x38(%rax)
cmpq $0x0, -0x20(%rbp)
je 0x79ba
movq -0x20(%rbp), %rdi
callq 0x23f0
movq %rax, %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x30(%rax)
jmp 0x7a01
movq -0x10(%rbp), %rdi
leaq 0xb744(%rip), %rsi      # 0x1310b
callq 0x2210
cmpl $0x0, %eax
je 0x79e7
movq -0x10(%rbp), %rdi
leaq 0xb944(%rip), %rsi      # 0x13320
callq 0x2360
movq %rax, -0x50(%rbp)
jmp 0x79f5
movq 0xf5d2(%rip), %rax      # 0x16fc0
movq (%rax), %rax
movq %rax, -0x50(%rbp)
movq -0x50(%rbp), %rcx
movq -0x28(%rbp), %rax
movq %rcx, 0x38(%rax)
jmp 0x7a03
movq -0x28(%rbp), %rax
cmpq $0x0, 0x38(%rax)
jne 0x7a5a
cmpl $0x2, 0xf81b(%rip)      # 0x17230
jl 0x7a3a
movq 0xf5da(%rip), %rax      # 0x16ff8
movq (%rax), %rdi
movq -0x10(%rbp), %rcx
leaq 0xb8f7(%rip), %rsi      # 0x13323
leaq 0xb910(%rip), %rdx      # 0x13343
movb $0x0, %al
callq 0x2230
movq -0x28(%rbp), %rax
movq 0x30(%rax), %rdi
callq 0x2040
movq -0x28(%rbp), %rdi
callq 0x2040
movq $0x0, -0x8(%rbp)
jmp 0x7a62
movq -0x28(%rbp), %rax
movq %rax, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax)