// File: /workspace/github_c_makefile_star2_O3/ToniWestbrook[P]paladin/utils.c
// Function: ks_introsort_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:
testq %rdi, %rdi
je 0xd4fe
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %rsi, %rbx
movq %rdi, %r15
cmpq $0x2, %rdi
jne 0xd4ff
movq (%rbx), %rax
movq 0x8(%rbx), %rcx
cmpq %rax, %rcx
jae 0xd4f0
movq %rcx, (%rbx)
movq %rax, 0x8(%rbx)
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movl $0x2, %ecx
movl $0x2, %ebp
movl $0xf0, %edi
movl $0x1, %eax
shlq %cl, %rax
incq %rcx
addl $0x2, %ebp
addq $0xc0, %rdi
cmpq %r15, %rax
jb 0xd50e
leaq 0x1aad9(%rip), %rsi     # 0x28008
leaq 0x1ab0c(%rip), %rcx     # 0x28042
movl $0x2f, %edx
callq 0x23213
movq %rax, %r14
leaq (%rbx,%r15,8), %rax
movq %rax, (%rsp)
leaq (%rbx,%r15,8), %r12
addq $-0x8, %r12
movq %r14, %r15
movq %rbx, %rsi
leaq 0x8(%rsi), %rax
movq %rsi, %rcx
negq %rcx
cmpq %r12, %rsi
jae 0xd661
decl %ebp
je 0xd64f
movq %r12, %r9
subq %rsi, %r9
sarq $0x4, %r9
movq 0x8(%rsi,%r9,8), %r8
movq (%rsi), %r10
movq (%r12), %rdx
cmpq %r10, %r8
jae 0xd5a0
cmpq %rdx, %r8
cmovbeq %rdx, %r8
leaq (%rax,%r9,8), %r9
cmovbq %r12, %r9
jmp 0xd5b1
cmpq %r10, %rdx
cmovaq %rdx, %r10
movq %r12, %r9
cmovbq %rsi, %r9
movq %r10, %r8
cmpq %r12, %r9
je 0xd5bd
movq %rdx, (%r9)
movq %r8, (%r12)
movq %rsi, %rdx
movq %r12, %rdi
movq %r12, %r9
subq %rdx, %r9
leaq (%rcx,%rdx), %r10
movq 0x8(%rdx), %r13
addq $0x8, %rdx
addq $-0x8, %r9
addq $0x8, %r10
cmpq %r8, %r13
jb 0xd5cd
addq $-0x8, %rdi
movq %rdi, %r11
movq %r11, %rdi
cmpq %r11, %rdx
ja 0xd5fa
leaq -0x8(%rdi), %r11
cmpq (%rdi), %r8
jb 0xd5e9
cmpq %rdx, %rdi
jbe 0xd60a
movq (%rdi), %r9
movq %r9, (%rdx)
movq %r13, (%rdi)
jmp 0xd5c3
movq (%r12), %rdi
movq %rdi, (%rdx)
movq %r13, (%r12)
sarq $0x3, %r10
sarq $0x3, %r9
leaq -0x8(%rdx), %r8
cmpq %r9, %r10
jg 0xd67b
cmpq $0x11, %r9
jl 0xd63f
addq $0x8, %rdx
movq %rdx, (%r15)
movq %r12, 0x8(%r15)
movl %ebp, 0x10(%r15)
addq $0x18, %r15
cmpq $0x11, %r10
cmovlq %rsi, %r8
movq %r8, %r12
jmp 0xd563
subq %rsi, %r12
sarq $0x3, %r12
incq %r12
movq %r12, %rdi
callq 0xd3b5
cmpq %r14, %r15
je 0xd6a4
movq -0x18(%r15), %rsi
movq -0x10(%r15), %r12
movl -0x8(%r15), %ebp
addq $-0x18, %r15
jmp 0xd559
cmpq $0x11, %r10
jl 0xd690
movq %rsi, (%r15)
movq %r8, 0x8(%r15)
movl %ebp, 0x10(%r15)
addq $0x18, %r15
addq $0x8, %rdx
cmpq $0x11, %r9
cmovlq %r12, %rdx
movq %rdx, %rsi
jmp 0xd559
movq %r14, %rdi
callq 0x3390
leaq 0x8(%rbx), %rax
movq (%rsp), %rdi
cmpq %rdi, %rax
jae 0xd4f0
cmpq %rbx, %rax
jbe 0xd6e4
movq (%rax), %rcx
movq %rax, %rdx
movq -0x8(%rdx), %rsi
cmpq %rsi, %rcx
jae 0xd6e4
movq %rsi, (%rdx)
movq %rcx, -0x8(%rdx)
leaq -0x8(%rdx), %rsi
movq %rsi, %rdx
cmpq %rbx, %rsi
ja 0xd6c8
addq $0x8, %rax
jmp 0xd6b4