// File: /workspace/github_c_makefile_star2_O2/ToniWestbrook[P]paladin/utils.c
// Function: ks_mergesort_64
KSEQ_INIT2(, gzFile, err_gzread)

/*************
 * Reporting *
 *************/

void logMessage(const char * passFunction, int passLevel, char * passFormat, ...) {
	va_list argList;
	char message[2048];
	char prefix;

	// Exit if lesser verbosity requested
	if (passLevel > bwa_verbose) return;

	// Prepare message
	va_start(argList, passFormat);
	vsnprintf(message, 2048, passFormat, argList);
	va_end(argList);

	switch (passLevel) {
		case LOG_LEVEL_ERROR: prefix = 'E'; break;
		case LOG_LEVEL_WARNING: prefix = 'W'; break;
		case LOG_LEVEL_MESSAGE: prefix = 'M'; break;
		case LOG_LEVEL_DEBUG: prefix = 'D'; break;
		default: prefix = 'U'; break;
	}

	fprintf(stderr, "[%c::%s] %s", prefix, passFunction, message);
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x58, %rsp
movq %rsi, %rbx
movq %rdi, %r15
movq %rsi, 0x40(%rsp)
movq %rdx, %rax
movq %rdx, 0x20(%rsp)
testq %rdx, %rdx
jne 0xbb5d
leaq (,%r15,8), %rdi
leaq 0x1746a(%rip), %rsi     # 0x22fb8
leaq 0x1748d(%rip), %rcx     # 0x22fe2
pushq $0x2f
popq %rdx
callq 0x1e045
movq %rax, 0x10(%rsp)
movq %rax, 0x48(%rsp)
leaq -0x8(,%r15,8), %rax
movq %rax, 0x28(%rsp)
xorl %ecx, %ecx
movq %rbx, 0x18(%rsp)
movq %rbx, %r9
xorl %eax, %eax
pushq $0x1
popq %r13
shlq %cl, %r13
cmpq %r15, %r13
jae 0xbcd2
pushq $0x1
popq %rdx
subl %eax, %edx
movq %rdx, 0x38(%rsp)
movq 0x40(%rsp,%rdx,8), %rdx
leaq (%r9,%r15,8), %r12
testq %rcx, %rcx
movq %rdx, 0x8(%rsp)
movq %rcx, 0x30(%rsp)
je 0xbc6d
pushq $0x2
popq %rax
shlq %cl, %rax
movq %rax, %rcx
xorl %edx, %edx
cmpq %r15, %rdx
jae 0xbcbb
leaq (%rdx,%rcx), %rbx
cmpq %r15, %rbx
movq %r15, %rax
cmovbq %rbx, %rax
leaq (%rdx,%r13), %rsi
cmpq %r15, %rsi
leaq (%r9,%rdx,8), %rdi
leaq (%rdi,%r13,8), %r8
movq %r8, %rsi
cmovaq %r12, %rsi
movl $0x0, %r14d
cmovbeq %rax, %r14
leaq (%r9,%r14,8), %rax
movq 0x8(%rsp), %r10
leaq (%r10,%rdx,8), %rdx
cmpq %rsi, %rdi
jae 0xbc48
cmpq %rax, %r8
jae 0xbc48
movq (%r8), %r14
movq (%rdi), %r10
xorl %r11d, %r11d
xorl %ebp, %ebp
cmpq %r10, %r14
setae %r11b
setb %bpl
cmovbq %r14, %r10
leaq (%rdi,%r11,8), %rdi
leaq (%r8,%rbp,8), %r8
movq %r10, (%rdx)
addq $0x8, %rdx
jmp 0xbc05
movq (%rdi), %r10
addq $0x8, %rdi
movq %r10, (%rdx)
addq $0x8, %rdx
cmpq %rsi, %rdi
jb 0xbc3a
xorl %esi, %esi
leaq (%r8,%rsi), %rdi
cmpq %rax, %rdi
jae 0xbc65
movq (%rdi), %rdi
movq %rdi, (%rdx,%rsi)
addq $0x8, %rsi
jmp 0xbc4f
movq %rbx, %rdx
jmp 0xbbc1
movq 0x28(%rsp), %rax
cmpq %r12, %r9
jae 0xbcbb
testq %rax, %rax
je 0xbc94
movq (%r9), %rdi
movq 0x8(%r9), %r8
leaq 0x10(%rdx), %rsi
cmpq %rdi, %r8
jae 0xbca3
movq %r8, (%rdx)
movq (%r9), %rdi
jmp 0xbcaa
movq (%r9), %rsi
movq %rsi, (%rdx)
addq $0x8, %rdx
movq %rdx, %rsi
jmp 0xbcae
movq %rdi, (%rdx)
movq 0x8(%r9), %rdi
movq %rdi, 0x8(%rdx)
addq $0x10, %r9
addq $-0x10, %rax
movq %rsi, %rdx
jmp 0xbc72
movq 0x30(%rsp), %rcx
incq %rcx
movq 0x8(%rsp), %r9
movq 0x38(%rsp), %rax
jmp 0xbb80
cmpl $0x1, %eax
movq 0x18(%rsp), %rsi
movq 0x10(%rsp), %rdi
jne 0xbcfd
leaq (%rsi,%r15,8), %rax
movq %rdi, %rcx
cmpq %rax, %rsi
jae 0xbcfd
movq (%rcx), %rdx
movq %rdx, (%rsi)
addq $0x8, %rsi
addq $0x8, %rcx
jmp 0xbce8
cmpq $0x0, 0x20(%rsp)
je 0xbd14
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
addq $0x58, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x3390