// File: /workspace/github_c_makefile_star2_O2/inflex[P]ripMIME/logger.c
// Function: LOGGER_log
int LOGGER_log( char *format, ...)
{
	va_list ptr;
	char tmpoutput[10240];
	char linebreak[]="\n";
	char nolinebreak[]="";
	char *lineend;
	char *output;


	// get our variable arguments
	va_start(ptr,format);

	// produce output, and spit to the log file
#ifdef NO_SNPRINTF
	vsprintf(tmpoutput, format, ptr);
#else
	vsnprintf(tmpoutput,sizeof(tmpoutput),format,ptr);
#endif

	LOGGER_clean_output( tmpoutput, &output );

	if ( output[strlen(output)-1] == '\n' ) {
		lineend = nolinebreak;
	}
	else {
		lineend = linebreak;
	}

	if ( output[strlen(output)-1] == '\n' ) { lineend = nolinebreak; } else { lineend = linebreak; }

	// Send the output to the appropriate output destination
	switch (_LOGGER_mode) {
		case _LOGGER_STDERR:
			fprintf(stderr,"%s%s",output, lineend );
			break;
		case _LOGGER_SYSLOG:
			syslog(_LOGGER_syslog_mode,"%s",output);
			break;
		case _LOGGER_STDOUT:
			fprintf(stdout,"%s%s",output, lineend);
			fflush(stdout);
			break;
		case _LOGGER_FILE:
			fprintf(_LOGGER_outf,"%s%s",output,lineend);
			fflush(_LOGGER_outf);
			break;
		case _LOGGER_NULL: // 20080303-2214:PLD: Added to allow us to direct all logging to NULL.
			break;
		default:
			fprintf(stdout,"LOGGER-Default: %s%s",output,lineend);
	}


	if (output) free(output);

	return 0;
}

// Assembly:
pushq %r15
pushq %r14
pushq %r12
pushq %rbx
subq $0x28e8, %rsp           # imm = 0x28E8
movq %rdi, %r10
leaq 0x30(%rsp), %rdi
movq %rsi, 0x8(%rdi)
movq %rdx, 0x10(%rdi)
movq %rcx, 0x18(%rdi)
movq %r8, 0x20(%rdi)
movq %r9, 0x28(%rdi)
testb %al, %al
je 0xc309
movaps %xmm0, 0x60(%rsp)
movaps %xmm1, 0x70(%rsp)
movaps %xmm2, 0x80(%rsp)
movaps %xmm3, 0x90(%rsp)
movaps %xmm4, 0xa0(%rsp)
movaps %xmm5, 0xb0(%rsp)
movaps %xmm6, 0xc0(%rsp)
movaps %xmm7, 0xd0(%rsp)
leaq 0x6(%rsp), %r14
movw $0xa, (%r14)
leaq 0x5(%rsp), %r12
movb $0x0, (%r12)
movabsq $0x3000000008, %rax     # imm = 0x3000000008
leaq 0x10(%rsp), %rcx
movq %rax, (%rcx)
leaq 0x2910(%rsp), %rax
movq %rax, 0x8(%rcx)
movq %rdi, 0x10(%rcx)
leaq 0xe0(%rsp), %rbx
movl $0x2800, %esi           # imm = 0x2800
movq %rbx, %rdi
movq %r10, %rdx
callq 0x20d0
leaq 0x8(%rsp), %r15
movq %rbx, %rdi
movq %r15, %rsi
callq 0xc172
movq (%r15), %rbx
movq %rbx, %rdi
callq 0x2110
cmpb $0xa, -0x1(%rbx,%rax)
cmoveq %r12, %r14
movl 0x13b2e(%rip), %eax     # 0x1feb0
decl %eax
cmpl $0x4, %eax
ja 0xc3fe
leaq 0xa5f0(%rip), %rcx      # 0x16980
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x12c30(%rip), %r15     # 0x1efd0
movq (%r15), %rdi
leaq 0xa63a(%rip), %rsi      # 0x169e4
movq %rbx, %rdx
movq %r14, %rcx
xorl %eax, %eax
callq 0x2210
movq (%r15), %rdi
jmp 0xc3f7
movl 0x13af2(%rip), %edi     # 0x1feb4
leaq 0xac97(%rip), %rsi      # 0x17060
movq %rbx, %rdx
xorl %eax, %eax
callq 0x22e0
jmp 0xc41c
movq 0x22154(%rip), %rdi     # 0x2e530
leaq 0xa601(%rip), %rsi      # 0x169e4
movq %rbx, %rdx
movq %r14, %rcx
xorl %eax, %eax
callq 0x2210
movq 0x22139(%rip), %rdi     # 0x2e530
callq 0x22c0
jmp 0xc41c
movq 0x12bcb(%rip), %rax     # 0x1efd0
movq (%rax), %rdi
leaq 0xa5c5(%rip), %rsi      # 0x169d4
movq %rbx, %rdx
movq %r14, %rcx
xorl %eax, %eax
callq 0x2210
movq %rbx, %rdi
callq 0x2030
xorl %eax, %eax
addq $0x28e8, %rsp           # imm = 0x28E8
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq 0x12bbc(%rip), %rax     # 0x1eff8
movq (%rax), %rdi
leaq 0xa59e(%rip), %rsi      # 0x169e4
jmp 0xc40f