// File: /workspace/github_cpp_makefile_star2_O1/nilnilnil[P]autocomplete/deps/mongoose/mongoose.c
// Function: cry
static void cry(struct mg_connection *conn, const char *fmt, ...) {
  char buf[BUFSIZ];
  va_list ap;
  FILE *fp;
  time_t timestamp;

  va_start(ap, fmt);
  (void) vsnprintf(buf, sizeof(buf), fmt, ap);
  va_end(ap);

  // Do not lock when getting the callback value, here and below.
  // I suppose this is fine, since function cannot disappear in the
  // same way string option can.
  conn->request_info.log_message = buf;
  if (call_user(conn, MG_EVENT_LOG) == NULL) {
    fp = conn->ctx->config[ERROR_LOG_FILE] == NULL ? NULL :
      mg_fopen(conn->ctx->config[ERROR_LOG_FILE], "a+");

    if (fp != NULL) {
      flockfile(fp);
      timestamp = time(NULL);

      (void) fprintf(fp,
          "[%010lu] [error] [client %s] ",
          (unsigned long) timestamp,
          inet_ntoa(conn->client.rsa.u.sin.sin_addr));

      if (conn->request_info.request_method != NULL) {
        (void) fprintf(fp, "%s %s: ",
            conn->request_info.request_method,
            conn->request_info.uri);
      }

      (void) fprintf(fp, "%s", buf);
      fputc('\n', fp);
      funlockfile(fp);
      if (fp != stderr) {
        fclose(fp);
      }
    }
  }
  conn->request_info.log_message = NULL;
}

// Assembly:
pushq %r15
pushq %r14
pushq %rbx
subq $0x20d0, %rsp           # imm = 0x20D0
movq %rsi, %r10
movq %rdi, %rbx
leaq 0x20(%rsp), %rsi
movq %rdx, 0x10(%rsi)
movq %rcx, 0x18(%rsi)
movq %r8, 0x20(%rsi)
movq %r9, 0x28(%rsi)
testb %al, %al
je 0xfcdb
movaps %xmm0, 0x50(%rsp)
movaps %xmm1, 0x60(%rsp)
movaps %xmm2, 0x70(%rsp)
movaps %xmm3, 0x80(%rsp)
movaps %xmm4, 0x90(%rsp)
movaps %xmm5, 0xa0(%rsp)
movaps %xmm6, 0xb0(%rsp)
movaps %xmm7, 0xc0(%rsp)
movq %rsp, %rcx
movq %rsi, 0x10(%rcx)
leaq 0x20f0(%rsp), %rax
movq %rax, 0x8(%rcx)
movabsq $0x3000000010, %rax     # imm = 0x3000000010
movq %rax, (%rcx)
leaq 0xd0(%rsp), %r14
movl $0x2000, %esi           # imm = 0x2000
movq %r14, %rdi
movq %r10, %rdx
callq 0x52c0
movq %r14, 0x38(%rbx)
movq 0x458(%rbx), %rax
movq 0xc8(%rax), %rcx
movq %rcx, 0x8(%rbx)
movq 0xc0(%rax), %rax
testq %rax, %rax
je 0xfd4c
leaq 0x8(%rbx), %rdx
movl $0x2, %edi
movq %rbx, %rsi
callq *%rax
testq %rax, %rax
jne 0xfe04
movq 0x458(%rbx), %rax
movq 0x60(%rax), %rdi
testq %rdi, %rdi
je 0xfd6d
leaq 0x5a17(%rip), %rsi      # 0x1577a
callq 0x55c0
movq %rax, %r14
jmp 0xfd70
xorl %r14d, %r14d
testq %r14, %r14
je 0xfe04
movq %r14, %rdi
callq 0x51b0
xorl %edi, %edi
callq 0x5430
movq %rax, %r15
movl 0x490(%rbx), %edi
callq 0x5220
leaq 0x5d7f(%rip), %rsi      # 0x15b1c
movq %r14, %rdi
movq %r15, %rdx
movq %rax, %rcx
xorl %eax, %eax
callq 0x56f0
movq 0x10(%rbx), %rdx
testq %rdx, %rdx
je 0xfdcb
movq 0x18(%rbx), %rcx
leaq 0x5d79(%rip), %rsi      # 0x15b3a
movq %r14, %rdi
xorl %eax, %eax
callq 0x56f0
leaq 0xd0(%rsp), %rdi
movq %r14, %rsi
callq 0x5550
movl $0xa, %edi
movq %r14, %rsi
callq 0x5630
movq %r14, %rdi
callq 0x53c0
movq 0xc1d9(%rip), %rax      # 0x1bfd0
cmpq (%rax), %r14
je 0xfe04
movq %r14, %rdi
callq 0x54a0
movq $0x0, 0x38(%rbx)
addq $0x20d0, %rsp           # imm = 0x20D0
popq %rbx
popq %r14
popq %r15
retq