// File: nilnilnil[P]autocomplete/deps/mongoose/mongoose.c
// Function: print_dir_entry
static void print_dir_entry(struct de *de) {
  char size[64], mod[64], href[PATH_MAX];

  if (de->st.is_directory) {
    (void) mg_snprintf(de->conn, size, sizeof(size), "%s", "[DIRECTORY]");
  } else {
     // We use (signed) cast below because MSVC 6 compiler cannot
     // convert unsigned __int64 to double. Sigh.
    if (de->st.size < 1024) {
      (void) mg_snprintf(de->conn, size, sizeof(size),
          "%lu", (unsigned long) de->st.size);
    } else if (de->st.size < 1024 * 1024) {
      (void) mg_snprintf(de->conn, size, sizeof(size),
          "%.1fk", (double) de->st.size / 1024.0);
    } else if (de->st.size < 1024 * 1024 * 1024) {
      (void) mg_snprintf(de->conn, size, sizeof(size),
          "%.1fM", (double) de->st.size / 1048576);
    } else {
      (void) mg_snprintf(de->conn, size, sizeof(size),
          "%.1fG", (double) de->st.size / 1073741824);
    }
  }
  (void) strftime(mod, sizeof(mod), "%d-%b-%Y %H:%M", localtime(&de->st.mtime));
  url_encode(de->file_name, href, sizeof(href));
  de->conn->num_bytes_sent += mg_printf(de->conn,
      "<tr><td><a href=\"%s%s%s\">%s%s</a></td>"
      "<td>&nbsp;%s</td><td>&nbsp;&nbsp;%s</td></tr>\n",
      de->conn->request_info.uri, href, de->st.is_directory ? "/" : "",
      de->file_name, de->st.is_directory ? "/" : "", mod, size);
}

// Assembly:
subq $0x10a8, %rsp           # imm = 0x10A8
movq %rdi, 0x10a0(%rsp)
movq 0x10a0(%rsp), %rax
cmpl $0x0, 0x10(%rax)
je 0x1fb7f
movq 0x10a0(%rsp), %rax
movq (%rax), %rdi
leaq 0x1060(%rsp), %rsi
movl $0x40, %edx
leaq 0x3c0c(%rip), %rcx      # 0x23778
leaq 0x394c(%rip), %r8       # 0x234bf
movb $0x0, %al
callq 0x1cc90
jmp 0x1fcb9
movq 0x10a0(%rsp), %rax
cmpq $0x400, 0x18(%rax)      # imm = 0x400
jge 0x1fbc8
movq 0x10a0(%rsp), %rax
movq (%rax), %rdi
leaq 0x1060(%rsp), %rsi
movq 0x10a0(%rsp), %rax
movq 0x18(%rax), %r8
movl $0x40, %edx
leaq 0x390f(%rip), %rcx      # 0x234cb
movb $0x0, %al
callq 0x1cc90
jmp 0x1fcb7
movq 0x10a0(%rsp), %rax
cmpq $0x100000, 0x18(%rax)   # imm = 0x100000
jge 0x1fc1f
movq 0x10a0(%rsp), %rax
movq (%rax), %rdi
leaq 0x1060(%rsp), %rsi
movq 0x10a0(%rsp), %rax
cvtsi2sdq 0x18(%rax), %xmm0
movsd 0x2b65(%rip), %xmm1     # 0x22768
divsd %xmm1, %xmm0
movl $0x40, %edx
leaq 0x38bc(%rip), %rcx      # 0x234cf
movb $0x1, %al
callq 0x1cc90
jmp 0x1fcb5
movq 0x10a0(%rsp), %rax
cmpq $0x40000000, 0x18(%rax) # imm = 0x40000000
jge 0x1fc73
movq 0x10a0(%rsp), %rax
movq (%rax), %rdi
leaq 0x1060(%rsp), %rsi
movq 0x10a0(%rsp), %rax
cvtsi2sdq 0x18(%rax), %xmm0
movsd 0x2b06(%rip), %xmm1     # 0x22760
divsd %xmm1, %xmm0
movl $0x40, %edx
leaq 0x386b(%rip), %rcx      # 0x234d5
movb $0x1, %al
callq 0x1cc90
jmp 0x1fcb3
movq 0x10a0(%rsp), %rax
movq (%rax), %rdi
leaq 0x1060(%rsp), %rsi
movq 0x10a0(%rsp), %rax
cvtsi2sdq 0x18(%rax), %xmm0
movsd 0x2abc(%rip), %xmm1     # 0x22758
divsd %xmm1, %xmm0
movl $0x40, %edx
leaq 0x382f(%rip), %rcx      # 0x234db
movb $0x1, %al
callq 0x1cc90
jmp 0x1fcb5
jmp 0x1fcb7
jmp 0x1fcb9
leaq 0x1020(%rsp), %rax
movq %rax, 0x18(%rsp)
movq 0x10a0(%rsp), %rdi
addq $0x10, %rdi
addq $0x10, %rdi
callq 0x53c0
movq 0x18(%rsp), %rdi
movq %rax, %rcx
movl $0x40, %esi
leaq 0x37f2(%rip), %rdx      # 0x234e1
callq 0x5440
movq 0x10a0(%rsp), %rax
movq 0x8(%rax), %rdi
leaq 0x20(%rsp), %rsi
movl $0x1000, %edx           # imm = 0x1000
callq 0x1fdd0
movq 0x10a0(%rsp), %rax
movq (%rax), %rdi
movq 0x10a0(%rsp), %rax
movq (%rax), %rax
movq 0x18(%rax), %rdx
leaq 0x20(%rsp), %rcx
movq 0x10a0(%rsp), %rax
movl 0x10(%rax), %esi
leaq 0x25b0(%rip), %r8       # 0x222f0
leaq 0x31ce(%rip), %rax      # 0x22f15
cmpl $0x0, %esi
cmovneq %rax, %r8
movq 0x10a0(%rsp), %rax
movq 0x8(%rax), %r9
movq 0x10a0(%rsp), %rax
movl 0x10(%rax), %esi
leaq 0x2584(%rip), %r11      # 0x222f0
leaq 0x31a2(%rip), %rax      # 0x22f15
cmpl $0x0, %esi
cmovneq %rax, %r11
leaq 0x1020(%rsp), %r10
leaq 0x1060(%rsp), %rax
leaq 0x375f(%rip), %rsi      # 0x234f0
movq %r11, (%rsp)
movq %r10, 0x8(%rsp)
movq %rax, 0x10(%rsp)
movb $0x0, %al
callq 0x17030
movslq %eax, %rcx
movq 0x10a0(%rsp), %rax
movq (%rax), %rax
addq 0x4b0(%rax), %rcx
movq %rcx, 0x4b0(%rax)
addq $0x10a8, %rsp           # imm = 0x10A8
retq
nopw (%rax,%rax)