// File: /workspace/github_c_makefile_star2_O0/sfeakes[P]unifi-motion/mongoose.c
// Function: mg_hexdump_connection
void mg_hexdump_connection(struct mg_connection *nc, const char *path,
                           const void *buf, int num_bytes, int ev) {
  FILE *fp = NULL;
  char src[60], dst[60];
  const char *tag = NULL;
  switch (ev) {
    case MG_EV_RECV:
      tag = "<-";
      break;
    case MG_EV_SEND:
      tag = "->";
      break;
    case MG_EV_ACCEPT:
      tag = "<A";
      break;
    case MG_EV_CONNECT:
      tag = "C>";
      break;
    case MG_EV_CLOSE:
      tag = "XX";
      break;
  }
  if (tag == NULL) return; /* Don't log MG_EV_TIMER, etc */

  if (strcmp(path, "-") == 0) {
    fp = stdout;
  } else if (strcmp(path, "--") == 0) {
    fp = stderr;
#if MG_ENABLE_FILESYSTEM
  } else {
    fp = mg_fopen(path, "a");
#endif
  }
  if (fp == NULL) return;

  mg_conn_addr_to_str(nc, src, sizeof(src),
                      MG_SOCK_STRINGIFY_IP | MG_SOCK_STRINGIFY_PORT);
  mg_conn_addr_to_str(nc, dst, sizeof(dst), MG_SOCK_STRINGIFY_IP |
                                                MG_SOCK_STRINGIFY_PORT |
                                                MG_SOCK_STRINGIFY_REMOTE);
  fprintf(fp, "%lu %p %s %s %s %d\n", (unsigned long) mg_time(), (void *) nc,
          src, tag, dst, (int) num_bytes);
  if (num_bytes > 0) {
    mg_hexdumpf(fp, buf, num_bytes);
  }
  if (fp != stdout && fp != stderr) fclose(fp);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xe0, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movl %r8d, -0x20(%rbp)
movq $0x0, -0x28(%rbp)
movq $0x0, -0xb8(%rbp)
movl -0x20(%rbp), %eax
decl %eax
movl %eax, %ecx
movq %rcx, -0xc0(%rbp)
subl $0x4, %eax
ja 0xb899
movq -0xc0(%rbp), %rax
leaq 0x13b1e(%rip), %rcx     # 0x1f360
movslq (%rcx,%rax,4), %rax
addq %rcx, %rax
jmpq *%rax
leaq 0x14801(%rip), %rax     # 0x20053
movq %rax, -0xb8(%rbp)
jmp 0xb899
leaq 0x147f4(%rip), %rax     # 0x20056
movq %rax, -0xb8(%rbp)
jmp 0xb899
leaq 0x147e7(%rip), %rax     # 0x20059
movq %rax, -0xb8(%rbp)
jmp 0xb899
leaq 0x147da(%rip), %rax     # 0x2005c
movq %rax, -0xb8(%rbp)
jmp 0xb899
leaq 0x147cd(%rip), %rax     # 0x2005f
movq %rax, -0xb8(%rbp)
cmpq $0x0, -0xb8(%rbp)
jne 0xb8a8
jmp 0xb9f9
movq -0x10(%rbp), %rdi
leaq 0x147b0(%rip), %rsi     # 0x20063
callq 0x3340
cmpl $0x0, %eax
jne 0xb8cd
movq 0x1b70c(%rip), %rax     # 0x26fd0
movq (%rax), %rax
movq %rax, -0x28(%rbp)
jmp 0xb908
movq -0x10(%rbp), %rdi
leaq 0x1478a(%rip), %rsi     # 0x20062
callq 0x3340
cmpl $0x0, %eax
jne 0xb8f2
movq 0x1b707(%rip), %rax     # 0x26ff0
movq (%rax), %rax
movq %rax, -0x28(%rbp)
jmp 0xb906
movq -0x10(%rbp), %rdi
leaq 0x15a87(%rip), %rsi     # 0x21384
callq 0x12360
movq %rax, -0x28(%rbp)
jmp 0xb908
cmpq $0x0, -0x28(%rbp)
jne 0xb914
jmp 0xb9f9
movq -0x8(%rbp), %rdi
leaq -0x70(%rbp), %rsi
movl $0x3c, %edx
movq %rdx, -0xd0(%rbp)
movl $0x3, %ecx
callq 0x16a80
movq -0xd0(%rbp), %rdx
movq -0x8(%rbp), %rdi
leaq -0xb0(%rbp), %rsi
movl $0x7, %ecx
callq 0x16a80
movq -0x28(%rbp), %rax
movq %rax, -0xc8(%rbp)
callq 0xb6e0
movq -0xc8(%rbp), %rdi
movsd 0x1399b(%rip), %xmm2    # 0x1f308
movaps %xmm0, %xmm1
subsd %xmm2, %xmm1
cvttsd2si %xmm1, %rax
cvttsd2si %xmm0, %rdx
movq %rdx, %rcx
sarq $0x3f, %rcx
andq %rcx, %rax
orq %rax, %rdx
movq -0x8(%rbp), %rcx
leaq -0x70(%rbp), %r8
movq -0xb8(%rbp), %r9
leaq -0xb0(%rbp), %r10
movl -0x1c(%rbp), %eax
leaq 0x146ba(%rip), %rsi     # 0x20065
movq %r10, (%rsp)
movl %eax, 0x8(%rsp)
movb $0x0, %al
callq 0x3370
cmpl $0x0, -0x1c(%rbp)
jle 0xb9d0
movq -0x28(%rbp), %rdi
movq -0x18(%rbp), %rsi
movl -0x1c(%rbp), %edx
callq 0x16dc0
movq -0x28(%rbp), %rax
movq 0x1b5f5(%rip), %rcx     # 0x26fd0
cmpq (%rcx), %rax
je 0xb9f9
movq -0x28(%rbp), %rax
movq 0x1b605(%rip), %rcx     # 0x26ff0
cmpq (%rcx), %rax
je 0xb9f9
movq -0x28(%rbp), %rdi
callq 0x3160
addq $0xe0, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)