// File: /workspace/github_c_makefile_star2_O0/Tarsnap[P]kivaloo/liball/../lib/logging/logging.c
// Function: logging_printf
ssize_t
logging_printf(struct logging_file * F, const char * format, ...)
{
	va_list ap;
	int len;
	size_t buflen;
	char * str;
	time_t now;

	/* Figure out how long the line we're writing is. */
	va_start(ap, format);
	len = vsnprintf(NULL, 0, format, ap);
	va_end(ap);

	/* Did we fail? */
	if (len < 0)
		goto err0;
	buflen = (size_t)(len) + 21; /* "YYYY-MM-DD hh:mm:ss\n\0" */

	/* Allocate memory. */
	if ((str = malloc(buflen)) == NULL)
		goto err0;

	/* Write date and time to start of buffer. */
	if (time(&now) == (time_t)(-1)) {
		warnp("time");
		goto err1;
	}
	if (strftime(str, 20, "%Y-%m-%d %H:%M:%S", gmtime(&now)) != 19) {
		warnp("strftime");
		goto err1;
	}

	/* Append the log message. */
	va_start(ap, format);
	len = vsnprintf(&str[19], buflen - 19, format, ap);
	va_end(ap);

	/* Did we fail? */
	if (len < 0)
		goto err1;

	/* Make sure vsnprintf is deterministic. */
	assert(buflen == (size_t)(len) + 21);

	/* Add EOL and re-NUL-terminate. */
	str[19 + len] = '\n';
	str[20 + len] = '\0';

	/* Write the final string (sans terminating NUL) to the file. */
	if (noeintr_write(F->fd, str, buflen - 1) != (ssize_t)(buflen - 1)) {
		warnp("Cannot write to log file: %s", F->path);
		goto err1;
	}

	/* Free our string buffer. */
	free(str);

	/* Success! */
	return (0);

err1:
	free(str);
err0:
	/* Failure! */
	return (-1);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x110, %rsp            # imm = 0x110
testb %al, %al
je 0x9fde
movaps %xmm0, -0xd0(%rbp)
movaps %xmm1, -0xc0(%rbp)
movaps %xmm2, -0xb0(%rbp)
movaps %xmm3, -0xa0(%rbp)
movaps %xmm4, -0x90(%rbp)
movaps %xmm5, -0x80(%rbp)
movaps %xmm6, -0x70(%rbp)
movaps %xmm7, -0x60(%rbp)
movq %r9, -0xd8(%rbp)
movq %r8, -0xe0(%rbp)
movq %rcx, -0xe8(%rbp)
movq %rdx, -0xf0(%rbp)
movq %rdi, -0x10(%rbp)
movq %rsi, -0x18(%rbp)
leaq -0x30(%rbp), %rax
leaq -0x100(%rbp), %rcx
movq %rcx, 0x10(%rax)
leaq 0x10(%rbp), %rcx
movq %rcx, 0x8(%rax)
movl $0x30, 0x4(%rax)
movl $0x10, (%rax)
movq -0x18(%rbp), %rdx
leaq -0x30(%rbp), %rcx
xorl %eax, %eax
movl %eax, %esi
movq %rsi, %rdi
callq 0x3230
movl %eax, -0x34(%rbp)
leaq -0x30(%rbp), %rax
cmpl $0x0, -0x34(%rbp)
jge 0xa04c
jmp 0xa25c
movslq -0x34(%rbp), %rax
addq $0x15, %rax
movq %rax, -0x40(%rbp)
movq -0x40(%rbp), %rdi
callq 0x34c0
movq %rax, -0x48(%rbp)
cmpq $0x0, %rax
jne 0xa070
jmp 0xa25c
leaq -0x50(%rbp), %rdi
callq 0x3360
cmpq $-0x1, %rax
jne 0xa0bb
jmp 0xa081
callq 0x3040
cmpl $0x0, (%rax)
je 0xa0a6
leaq 0x14a5b(%rip), %rdi     # 0x1eaed
movb $0x0, %al
callq 0x66e0
callq 0x3040
movl $0x0, (%rax)
jmp 0xa0b4
leaq 0x14a40(%rip), %rdi     # 0x1eaed
movb $0x0, %al
callq 0x6930
jmp 0xa0b6
jmp 0xa253
movq -0x48(%rbp), %rax
movq %rax, -0x108(%rbp)
leaq -0x50(%rbp), %rdi
callq 0x32f0
movq -0x108(%rbp), %rdi
movq %rax, %rcx
movl $0x14, %esi
leaq 0x149f2(%rip), %rdx     # 0x1ead7
callq 0x32b0
cmpq $0x13, %rax
je 0xa12c
jmp 0xa0f2
callq 0x3040
cmpl $0x0, (%rax)
je 0xa117
leaq 0x149e6(%rip), %rdi     # 0x1eae9
movb $0x0, %al
callq 0x66e0
callq 0x3040
movl $0x0, (%rax)
jmp 0xa125
leaq 0x149cb(%rip), %rdi     # 0x1eae9
movb $0x0, %al
callq 0x6930
jmp 0xa127
jmp 0xa253
leaq -0x30(%rbp), %rax
leaq -0x100(%rbp), %rcx
movq %rcx, 0x10(%rax)
leaq 0x10(%rbp), %rcx
movq %rcx, 0x8(%rax)
movl $0x30, 0x4(%rax)
movl $0x10, (%rax)
movq -0x48(%rbp), %rdi
addq $0x13, %rdi
movq -0x40(%rbp), %rsi
subq $0x13, %rsi
movq -0x18(%rbp), %rdx
leaq -0x30(%rbp), %rcx
callq 0x3230
movl %eax, -0x34(%rbp)
leaq -0x30(%rbp), %rax
cmpl $0x0, -0x34(%rbp)
jge 0xa17f
jmp 0xa253
movq -0x40(%rbp), %rax
movslq -0x34(%rbp), %rcx
addq $0x15, %rcx
cmpq %rcx, %rax
jne 0xa192
jmp 0xa1b1
leaq 0x14959(%rip), %rdi     # 0x1eaf2
leaq 0x1496f(%rip), %rsi     # 0x1eb0f
movl $0xf0, %edx
leaq 0x1497c(%rip), %rcx     # 0x1eb28
callq 0x3240
movq -0x48(%rbp), %rax
movl -0x34(%rbp), %ecx
addl $0x13, %ecx
movslq %ecx, %rcx
movb $0xa, (%rax,%rcx)
movq -0x48(%rbp), %rax
movl -0x34(%rbp), %ecx
addl $0x14, %ecx
movslq %ecx, %rcx
movb $0x0, (%rax,%rcx)
movq -0x10(%rbp), %rax
movl (%rax), %edi
movq -0x48(%rbp), %rsi
movq -0x40(%rbp), %rdx
subq $0x1, %rdx
callq 0x10d50
movq -0x40(%rbp), %rcx
subq $0x1, %rcx
cmpq %rcx, %rax
je 0xa240
jmp 0xa1f9
callq 0x3040
cmpl $0x0, (%rax)
je 0xa226
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rsi
leaq 0x14957(%rip), %rdi     # 0x1eb69
movb $0x0, %al
callq 0x66e0
callq 0x3040
movl $0x0, (%rax)
jmp 0xa23c
movq -0x10(%rbp), %rax
movq 0x8(%rax), %rsi
leaq 0x14934(%rip), %rdi     # 0x1eb69
movb $0x0, %al
callq 0x6930
jmp 0xa23e
jmp 0xa253
movq -0x48(%rbp), %rdi
callq 0x3460
movq $0x0, -0x8(%rbp)
jmp 0xa264
movq -0x48(%rbp), %rdi
callq 0x3460
movq $-0x1, -0x8(%rbp)
movq -0x8(%rbp), %rax
addq $0x110, %rsp            # imm = 0x110
popq %rbp
retq
nopw %cs:(%rax,%rax)