// File: /workspace/github_c_makefile_star2_O3/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 0xc8b7
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 0xc71e
movq (%r15), %rbx
movq %rbx, %rdi
callq 0x2110
cmpb $0xa, -0x1(%rbx,%rax)
cmoveq %r12, %r14
movl 0x14580(%rip), %eax     # 0x20eb0
decl %eax
cmpl $0x4, %eax
ja 0xc9ac
leaq 0xb042(%rip), %rcx      # 0x17980
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
movq 0x13682(%rip), %r15     # 0x1ffd0
movq (%r15), %rdi
leaq 0xb08c(%rip), %rsi      # 0x179e4
movq %rbx, %rdx
movq %r14, %rcx
xorl %eax, %eax
callq 0x2210
movq (%r15), %rdi
jmp 0xc9a5
movl 0x14544(%rip), %edi     # 0x20eb4
leaq 0xb6e9(%rip), %rsi      # 0x18060
movq %rbx, %rdx
xorl %eax, %eax
callq 0x22e0
jmp 0xc9ca
movq 0x22ba6(%rip), %rdi     # 0x2f530
leaq 0xb053(%rip), %rsi      # 0x179e4
movq %rbx, %rdx
movq %r14, %rcx
xorl %eax, %eax
callq 0x2210
movq 0x22b8b(%rip), %rdi     # 0x2f530
callq 0x22c0
jmp 0xc9ca
movq 0x1361d(%rip), %rax     # 0x1ffd0
movq (%rax), %rdi
leaq 0xb017(%rip), %rsi      # 0x179d4
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 0x1360e(%rip), %rax     # 0x1fff8
movq (%rax), %rdi
leaq 0xaff0(%rip), %rsi      # 0x179e4
jmp 0xc9bd
nop