// File: /workspace/github_c_makefile_star2_O2/alexgirao[P]aimant/debug0.c
// Function: debug0
void debug0(char *file, int line, char *format, ...)
{
	/* TODO: put timezone or use UTC
	 */

	time_t t;
	struct tm tm[1];
	struct timeval tv[1];
	va_list valist1;
	char buf[0x7fff];
	int n;
	long usec;

	va_start(valist1, format);

	get_current_timeval(tv);

	t = tv->tv_sec;
	usec = tv->tv_usec;

	assert(localtime_r(&t, tm) == tm);

	/* the time resolution (1/100 of millisecond) below is the
	 * same used by svlogd with -ttt option
	 */

	n = 0;
	n = snprintf(buf+n, SOZ(sizeof(buf),n),
		     "%u-%.2u-%.2uT%.2u:%.2u:%.2u.%.5u: %s:%i: ",
		     tm->tm_year + 1900, tm->tm_mon + 1, tm->tm_mday,
		     tm->tm_hour, tm->tm_min, tm->tm_sec,
		     (unsigned int)(usec/10),
		     file, line
		);
	n += vsnprintf(buf+n, SOZ(sizeof(buf),n), format, valist1);
	n += snprintf(buf+n, SOZ(sizeof(buf),n), "\n");

	write_exact(STDERR_FILENO, buf, n);

	va_end(valist1);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x8148, %rsp           # imm = 0x8148
movq %rdx, %rbx
movq %rsi, -0x38(%rbp)
movq %rdi, %r15
leaq -0x170(%rbp), %rdx
movq %rcx, 0x18(%rdx)
movq %r8, 0x20(%rdx)
movq %r9, 0x28(%rdx)
testb %al, %al
je 0x409d
movaps %xmm0, -0x140(%rbp)
movaps %xmm1, -0x130(%rbp)
movaps %xmm2, -0x120(%rbp)
movaps %xmm3, -0x110(%rbp)
movaps %xmm4, -0x100(%rbp)
movaps %xmm5, -0xf0(%rbp)
movaps %xmm6, -0xe0(%rbp)
movaps %xmm7, -0xd0(%rbp)
movabsq $0x3000000018, %rax     # imm = 0x3000000018
movq %rax, -0x70(%rbp)
leaq 0x10(%rbp), %rax
movq %rax, -0x68(%rbp)
movq %rdx, -0x60(%rbp)
leaq -0x50(%rbp), %rdi
xorl %esi, %esi
callq 0x1130
testl %eax, %eax
jne 0x4209
movq %rbx, -0x30(%rbp)
movq -0x50(%rbp), %rax
movq -0x48(%rbp), %r12
leaq -0xb8(%rbp), %rdi
movq %rax, (%rdi)
leaq -0xb0(%rbp), %r13
movq %r13, %rsi
callq 0x1090
cmpq %r13, %rax
jne 0x4222
movl $0x76c, %ecx            # imm = 0x76C
addl -0x9c(%rbp), %ecx
movl -0xa0(%rbp), %r8d
incl %r8d
movl -0xa4(%rbp), %r9d
movl -0xa8(%rbp), %r11d
movl -0xb0(%rbp), %r14d
movl -0xac(%rbp), %ebx
pushq $0xa
popq %rsi
movq %r12, %rax
cqto
idivq %rsi
movq %rax, %r10
leaq 0x1ef9(%rip), %rdx      # 0x6036
xorl %r13d, %r13d
leaq -0x8170(%rbp), %rdi
movl $0x7fff, %r12d          # imm = 0x7FFF
movl $0x7fff, %esi           # imm = 0x7FFF
xorl %eax, %eax
pushq -0x38(%rbp)
pushq %r15
pushq %r10
pushq %r14
pushq %rbx
pushq %r11
callq 0x1110
addq $0x30, %rsp
movslq %eax, %rbx
leaq (%rbx,%rbp), %rdi
addq $-0x8170, %rdi          # imm = 0xFFFF7E90
movl $0x7fff, %esi           # imm = 0x7FFF
subq %rbx, %rsi
movl $0x7fff, %r14d          # imm = 0x7FFF
cmpl %r14d, %ebx
cmovaeq %r13, %rsi
leaq -0x70(%rbp), %rcx
movq -0x30(%rbp), %rdx
callq 0x10b0
addl %ebx, %eax
movslq %eax, %r15
leaq (%r15,%rbp), %rdi
addq $-0x8170, %rdi          # imm = 0xFFFF7E90
subq %r15, %r12
cmpl %r14d, %r15d
cmovaeq %r13, %r12
leaq 0x13b6(%rip), %rdx      # 0x5570
movq %r12, %rsi
xorl %eax, %eax
callq 0x1110
movl %eax, %ebx
addl %r15d, %ebx
pushq $0x2
popq %r14
movl %r13d, %eax
leaq (%rax,%rbp), %rsi
addq $-0x8170, %rsi          # imm = 0xFFFF7E90
movl %ebx, %eax
subl %r13d, %eax
movslq %eax, %rdx
movl %r14d, %edi
callq 0x10c0
testl %eax, %eax
jle 0x41f7
addl %eax, %r13d
cmpl %ebx, %r13d
jl 0x41cd
addq $0x8148, %rsp           # imm = 0x8148
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1e50(%rip), %rdi      # 0x6060
leaq 0x1df0(%rip), %rsi      # 0x6007
leaq 0x1e5e(%rip), %rcx      # 0x607c
pushq $0x33
jmp 0x4239
leaq 0x1dc4(%rip), %rdi      # 0x5fed
leaq 0x1dd7(%rip), %rsi      # 0x6007
leaq 0x1dd9(%rip), %rcx      # 0x6010
pushq $0x5a
popq %rdx
callq 0x1140