// File: /workspace/github_c_makefile_star2_O1/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 0x5291
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 0x2130
testl %eax, %eax
jne 0x540e
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 0x2090
cmpq %r13, %rax
jne 0x542d
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
movabsq $0x6666666666666667, %rdx # imm = 0x6666666666666667
movq %r12, %rax
imulq %rdx
movq %rdx, %r10
movq %rdx, %rax
shrq $0x3f, %rax
shrq $0x2, %r10
addl %eax, %r10d
leaq 0x1cf5(%rip), %rdx      # 0x7039
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 0x2110
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 0x20b0
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 0x11af(%rip), %rdx      # 0x6570
movq %r12, %rsi
xorl %eax, %eax
callq 0x2110
movl %eax, %ebx
addl %r15d, %ebx
movl %r13d, %eax
leaq (%rax,%rbp), %rsi
addq $-0x8170, %rsi          # imm = 0xFFFF7E90
movl %ebx, %eax
subl %r13d, %eax
movslq %eax, %rdx
movl $0x2, %edi
callq 0x20c0
testl %eax, %eax
jle 0x53fc
addl %eax, %r13d
cmpl %ebx, %r13d
jl 0x53d0
addq $0x8148, %rsp           # imm = 0x8148
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
leaq 0x1c4e(%rip), %rdi      # 0x7063
leaq 0x1bee(%rip), %rsi      # 0x700a
leaq 0x1c5c(%rip), %rcx      # 0x707f
movl $0x33, %edx
callq 0x2140
leaq 0x1bbc(%rip), %rdi      # 0x6ff0
leaq 0x1bcf(%rip), %rsi      # 0x700a
leaq 0x1bd1(%rip), %rcx      # 0x7013
movl $0x5a, %edx
callq 0x2140