// File: /workspace/github_c_makefile_star2_O0/sfeakes[P]unifi-motion/mongoose.c
// Function: mg_print_dir_entry
static void mg_print_dir_entry(struct mg_connection *nc, const char *file_name,
                               cs_stat_t *stp) {
  char size[64], mod[64], path[MG_MAX_PATH];
  int64_t fsize = stp->st_size;
  int is_dir = S_ISDIR(stp->st_mode);
  const char *slash = is_dir ? "/" : "";
  struct mg_str href;

  if (is_dir) {
    snprintf(size, sizeof(size), "%s", "[DIRECTORY]");
  } else {
    /*
     * We use (double) cast below because MSVC 6 compiler cannot
     * convert unsigned __int64 to double.
     */
    if (fsize < 1024) {
      snprintf(size, sizeof(size), "%d", (int) fsize);
    } else if (fsize < 0x100000) {
      snprintf(size, sizeof(size), "%.1fk", (double) fsize / 1024.0);
    } else if (fsize < 0x40000000) {
      snprintf(size, sizeof(size), "%.1fM", (double) fsize / 1048576);
    } else {
      snprintf(size, sizeof(size), "%.1fG", (double) fsize / 1073741824);
    }
  }
  strftime(mod, sizeof(mod), "%d-%b-%Y %H:%M", localtime(&stp->st_mtime));
  mg_escape(file_name, path, sizeof(path));
  href = mg_url_encode(mg_mk_str(file_name));
  mg_printf_http_chunk(nc,
                       "<tr><td><a href=\"%s%s\">%s%s</a></td>"
                       "<td>%s</td><td name=%" INT64_FMT ">%s</td></tr>\n",
                       href.p, slash, path, slash, mod, is_dir ? -1 : fsize,
                       size);
  free((void *) href.p);
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x1140, %rsp           # imm = 0x1140
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq -0x18(%rbp), %rax
movq 0x30(%rax), %rax
movq %rax, -0x10a8(%rbp)
movq -0x18(%rbp), %rax
movl 0x18(%rax), %eax
andl $0xf000, %eax           # imm = 0xF000
cmpl $0x4000, %eax           # imm = 0x4000
sete %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x10ac(%rbp)
movl -0x10ac(%rbp), %edx
leaq 0x5029(%rip), %rax      # 0x207ab
leaq 0x490f(%rip), %rcx      # 0x20098
cmpl $0x0, %edx
cmovneq %rcx, %rax
movq %rax, -0x10b8(%rbp)
cmpl $0x0, -0x10ac(%rbp)
je 0x1b7c3
leaq -0x60(%rbp), %rdi
movl $0x40, %esi
leaq 0x47e2(%rip), %rdx      # 0x1ff92
leaq 0x5870(%rip), %rcx      # 0x21027
movb $0x0, %al
callq 0x31f0
jmp 0x1b89d
cmpq $0x400, -0x10a8(%rbp) # imm = 0x400
jge 0x1b7f5
leaq -0x60(%rbp), %rdi
movq -0x10a8(%rbp), %rax
movl %eax, %ecx
movl $0x40, %esi
leaq 0x4b92(%rip), %rdx      # 0x2037b
movb $0x0, %al
callq 0x31f0
jmp 0x1b89b
cmpq $0x100000, -0x10a8(%rbp) # imm = 0x100000
jge 0x1b830
leaq -0x60(%rbp), %rdi
cvtsi2sdq -0x10a8(%rbp), %xmm0
movsd 0x3b19(%rip), %xmm1     # 0x1f330
divsd %xmm1, %xmm0
movl $0x40, %esi
leaq 0x580c(%rip), %rdx      # 0x21033
movb $0x1, %al
callq 0x31f0
jmp 0x1b899
cmpq $0x40000000, -0x10a8(%rbp) # imm = 0x40000000
jge 0x1b86b
leaq -0x60(%rbp), %rdi
cvtsi2sdq -0x10a8(%rbp), %xmm0
movsd 0x3ad6(%rip), %xmm1     # 0x1f328
divsd %xmm1, %xmm0
movl $0x40, %esi
leaq 0x57d7(%rip), %rdx      # 0x21039
movb $0x1, %al
callq 0x31f0
jmp 0x1b897
leaq -0x60(%rbp), %rdi
cvtsi2sdq -0x10a8(%rbp), %xmm0
movsd 0x3aa0(%rip), %xmm1     # 0x1f320
divsd %xmm1, %xmm0
movl $0x40, %esi
leaq 0x57af(%rip), %rdx      # 0x2103f
movb $0x1, %al
callq 0x31f0
jmp 0x1b899
jmp 0x1b89b
jmp 0x1b89d
leaq -0xa0(%rbp), %rax
movq %rax, -0x1120(%rbp)
movq -0x18(%rbp), %rdi
addq $0x58, %rdi
callq 0x3070
movq -0x1120(%rbp), %rdi
movq %rax, %rcx
movl $0x40, %esi
leaq 0x5777(%rip), %rdx      # 0x21045
callq 0x3520
movq -0x10(%rbp), %rdi
leaq -0x10a0(%rbp), %rsi
movl $0x1000, %edx           # imm = 0x1000
callq 0x1ba20
movq -0x10(%rbp), %rdi
callq 0x8a60
movq %rax, -0x10e8(%rbp)
movq %rdx, -0x10e0(%rbp)
movq -0x10e8(%rbp), %rdi
movq -0x10e0(%rbp), %rsi
callq 0x16f00
movq %rax, -0x10d8(%rbp)
movq %rdx, -0x10d0(%rbp)
movq -0x10d8(%rbp), %rax
movq %rax, -0x10c8(%rbp)
movq -0x10d0(%rbp), %rax
movq %rax, -0x10c0(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x1118(%rbp)
movq -0x10c8(%rbp), %rax
movq %rax, -0x1110(%rbp)
movq -0x10b8(%rbp), %rax
movq %rax, -0x1108(%rbp)
leaq -0x10a0(%rbp), %rax
movq %rax, -0x1100(%rbp)
movq -0x10b8(%rbp), %rax
movq %rax, -0x10f8(%rbp)
leaq -0xa0(%rbp), %rax
movq %rax, -0x10f0(%rbp)
cmpl $0x0, -0x10ac(%rbp)
je 0x1b9a6
movq $-0x1, %rax
movq %rax, -0x1128(%rbp)
jmp 0x1b9b4
movq -0x10a8(%rbp), %rax
movq %rax, -0x1128(%rbp)
movq -0x10f0(%rbp), %r11
movq -0x10f8(%rbp), %r9
movq -0x1100(%rbp), %r8
movq -0x1108(%rbp), %rcx
movq -0x1110(%rbp), %rdx
movq -0x1118(%rbp), %rdi
movq -0x1128(%rbp), %r10
leaq -0x60(%rbp), %rax
leaq 0x5664(%rip), %rsi      # 0x21054
movq %r11, (%rsp)
movq %r10, 0x8(%rsp)
movq %rax, 0x10(%rsp)
movb $0x0, %al
callq 0x128e0
movq -0x10c8(%rbp), %rdi
callq 0x3050
addq $0x1140, %rsp           # imm = 0x1140
popq %rbp
retq
nopw (%rax,%rax)