// File: /workspace/github_c_makefile_star2_O1/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 %rdx, %rbx
movq %rsi, %r14
movq %rdi, %r12
movq %rsi, 0x10(%rsp)
movq %rdx, %rdi
testq %rdx, %rdx
jne 0xce89
leaq (,%r12,8), %rdi
leaq 0x1b113(%rip), %rsi     # 0x27f88
leaq 0x1b136(%rip), %rcx     # 0x27fb2
movl $0x2f, %edx
callq 0x22d2b
movq %rax, %rdi
movq %rdi, 0x18(%rsp)
cmpq $0x2, %r12
jb 0xd04c
movq %rdi, 0x28(%rsp)
movq %r14, 0x30(%rsp)
movq %rbx, 0x38(%rsp)
leaq -0x8(,%r12,8), %rax
movq %rax, 0x40(%rsp)
xorl %ecx, %ecx
movl $0x1, %r11d
xorl %eax, %eax
movl %eax, %edx
movl %eax, %eax
movq 0x10(%rsp,%rax,8), %r8
movl $0x1, %eax
movl %edx, 0x4(%rsp)
subl %edx, %eax
movq %rax, 0x50(%rsp)
movq 0x10(%rsp,%rax,8), %r10
leaq (%r8,%r12,8), %rax
movq %rax, 0x8(%rsp)
testq %rcx, %rcx
movq %rcx, 0x48(%rsp)
je 0xcfa5
movl $0x2, %eax
shlq %cl, %rax
movq %rax, %rcx
xorl %r13d, %r13d
movq %r13, %rdx
leaq (%r11,%r13), %rbx
leaq (%r8,%r13,8), %rax
addq %rcx, %r13
cmpq %r12, %r13
movq %r12, %r15
cmovbq %r13, %r15
cmpq %r12, %rbx
leaq (%rax,%r11,8), %rbp
movq %rbp, %r14
cmovaq 0x8(%rsp), %r14
movl $0x0, %edi
cmovbeq %r15, %rdi
leaq (%r10,%rdx,8), %rbx
leaq (%r8,%rdi,8), %rdx
cmpq %r14, %rax
jae 0xcf7f
cmpq %rdx, %rbp
jae 0xcf7f
movq (%rbp), %rdi
movq (%rax), %r15
xorl %r9d, %r9d
xorl %esi, %esi
cmpq %r15, %rdi
setae %r9b
setb %sil
cmovbq %rdi, %r15
leaq (%rax,%r9,8), %rax
leaq (%rbp,%rsi,8), %rbp
movq %r15, (%rbx)
addq $0x8, %rbx
jmp 0xcf3a
movq (%rax), %rsi
addq $0x8, %rax
movq %rsi, (%rbx)
addq $0x8, %rbx
cmpq %r14, %rax
jb 0xcf71
jmp 0xcf95
movq (%rbp), %rax
addq $0x8, %rbp
movq %rax, (%rbx)
addq $0x8, %rbx
cmpq %rdx, %rbp
jb 0xcf86
cmpq %r12, %r13
jb 0xcf01
jmp 0xcff8
testq %r12, %r12
jle 0xcff8
movq 0x40(%rsp), %rax
testq %rax, %rax
je 0xcfcc
movq (%r8), %r11
movq 0x8(%r8), %rbx
leaq 0x10(%r10), %rdx
cmpq %r11, %rbx
jae 0xcfdb
movq %rbx, (%r10)
movq (%r8), %r11
jmp 0xcfe2
movq (%r8), %rdx
movq %rdx, (%r10)
addq $0x8, %r10
movq %r10, %rdx
jmp 0xcfe6
movq %r11, (%r10)
movq 0x8(%r8), %r11
movq %r11, 0x8(%r10)
addq $0x10, %r8
addq $-0x10, %rax
movq %rdx, %r10
cmpq 0x8(%rsp), %r8
jb 0xcfaf
movl $0x2, %r11d
movq 0x48(%rsp), %rcx
shlq %cl, %r11
incq %rcx
cmpq %r12, %r11
movq 0x50(%rsp), %rax
jb 0xcebe
cmpl $0x1, 0x4(%rsp)
movq 0x38(%rsp), %rbx
movq 0x30(%rsp), %rsi
movq 0x28(%rsp), %rdi
je 0xd04c
testq %r12, %r12
jle 0xd04c
leaq (%rsi,%r12,8), %rax
movq %rdi, %rcx
movq (%rcx), %rdx
movq %rdx, (%rsi)
addq $0x8, %rsi
addq $0x8, %rcx
cmpq %rax, %rsi
jb 0xd039
addq $0x58, %rsp
testq %rbx, %rbx
je 0xd060
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
jmp 0x3390