// File: /workspace/github_c_makefile_star2_O1/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 0xc9c8
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 0xc830
movq (%r15), %rbx
movq %rbx, %rdi
callq 0x2110
cmpb $0xa, -0x1(%rbx,%rax)
cmoveq %r12, %r14
movl 0x1446f(%rip), %eax     # 0x20eb0
decl %eax
cmpl $0x4, %eax
ja 0xcabd
leaq 0xaf01(%rip), %rcx      # 0x17950
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x13571(%rip), %r15     # 0x1ffd0
movq (%r15), %rdi
leaq 0xaf4b(%rip), %rsi      # 0x179b4
movq %rbx, %rdx
movq %r14, %rcx
xorl %eax, %eax
callq 0x2220
movq (%r15), %rdi
jmp 0xcab6
movl 0x14433(%rip), %edi     # 0x20eb4
leaq 0xb605(%rip), %rsi      # 0x1808d
movq %rbx, %rdx
xorl %eax, %eax
callq 0x22f0
jmp 0xcadb
movq 0x22a95(%rip), %rdi     # 0x2f530
leaq 0xaf12(%rip), %rsi      # 0x179b4
movq %rbx, %rdx
movq %r14, %rcx
xorl %eax, %eax
callq 0x2220
movq 0x22a7a(%rip), %rdi     # 0x2f530
callq 0x22d0
jmp 0xcadb
movq 0x1350c(%rip), %rax     # 0x1ffd0
movq (%rax), %rdi
leaq 0xaed6(%rip), %rsi      # 0x179a4
movq %rbx, %rdx
movq %r14, %rcx
xorl %eax, %eax
callq 0x2220
testq %rbx, %rbx
je 0xcae8
movq %rbx, %rdi
callq 0x2030
xorl %eax, %eax
addq $0x28e8, %rsp           # imm = 0x28E8
popq %rbx
popq %r12
popq %r14
popq %r15
retq
movq 0x134f8(%rip), %rax     # 0x1fff8
movq (%rax), %rdi
leaq 0xaeaa(%rip), %rsi      # 0x179b4
jmp 0xcace