// File: /workspace/github_c_makefile_star2_O0/coyove[P]chann/./lib/mongoose/mongoose.c
// Function: ns_hexdump
int ns_hexdump(const void *buf, int len, char *dst, int dst_len) {
  const unsigned char *p = (const unsigned char *) buf;
  char ascii[17] = "";
  int i, idx, n = 0;

  for (i = 0; i < len; i++) {
    idx = i % 16;
    if (idx == 0) {
      if (i > 0) n += snprintf(dst + n, dst_len - n, "  %s\n", ascii);
      n += snprintf(dst + n, dst_len - n, "%04x ", i);
    }
    n += snprintf(dst + n, dst_len - n, " %02x", p[i]);
    ascii[idx] = p[i] < 0x20 || p[i] > 0x7e ? '.' : p[i];
    ascii[idx + 1] = '\0';
  }

  while (i++ % 16) n += snprintf(dst + n, dst_len - n, "%s", "   ");
  n += snprintf(dst + n, dst_len - n, "  %s\n\n", ascii);

  return n;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movl %esi, -0xc(%rbp)
movq %rdx, -0x18(%rbp)
movl %ecx, -0x1c(%rbp)
movq -0x8(%rbp), %rax
movq %rax, -0x28(%rbp)
leaq -0x40(%rbp), %rdi
xorl %esi, %esi
movl $0x11, %edx
callq 0xd430
movl $0x0, -0x4c(%rbp)
movl $0x0, -0x44(%rbp)
movl -0x44(%rbp), %eax
cmpl -0xc(%rbp), %eax
jge 0xafc60
movl -0x44(%rbp), %eax
movl $0x10, %ecx
cltd
idivl %ecx
movl %edx, -0x48(%rbp)
cmpl $0x0, -0x48(%rbp)
jne 0xafbc9
cmpl $0x0, -0x44(%rbp)
jle 0xafb9e
movq -0x18(%rbp), %rdi
movslq -0x4c(%rbp), %rax
addq %rax, %rdi
movl -0x1c(%rbp), %eax
subl -0x4c(%rbp), %eax
movslq %eax, %rsi
leaq -0x40(%rbp), %rcx
leaq 0xf4e3(%rip), %rdx      # 0xbf074
movb $0x0, %al
callq 0xd6e0
addl -0x4c(%rbp), %eax
movl %eax, -0x4c(%rbp)
movq -0x18(%rbp), %rdi
movslq -0x4c(%rbp), %rax
addq %rax, %rdi
movl -0x1c(%rbp), %eax
subl -0x4c(%rbp), %eax
movslq %eax, %rsi
movl -0x44(%rbp), %ecx
leaq 0x1700c(%rip), %rdx     # 0xc6bc8
movb $0x0, %al
callq 0xd6e0
addl -0x4c(%rbp), %eax
movl %eax, -0x4c(%rbp)
movq -0x18(%rbp), %rdi
movslq -0x4c(%rbp), %rax
addq %rax, %rdi
movl -0x1c(%rbp), %eax
subl -0x4c(%rbp), %eax
movslq %eax, %rsi
movq -0x28(%rbp), %rax
movslq -0x44(%rbp), %rcx
movzbl (%rax,%rcx), %ecx
leaq 0x16fde(%rip), %rdx     # 0xc6bce
movb $0x0, %al
callq 0xd6e0
addl -0x4c(%rbp), %eax
movl %eax, -0x4c(%rbp)
movq -0x28(%rbp), %rax
movslq -0x44(%rbp), %rcx
movzbl (%rax,%rcx), %eax
cmpl $0x20, %eax
jl 0xafc1f
movq -0x28(%rbp), %rax
movslq -0x44(%rbp), %rcx
movzbl (%rax,%rcx), %eax
cmpl $0x7e, %eax
jle 0xafc29
movl $0x2e, %eax
movl %eax, -0x50(%rbp)
jmp 0xafc38
movq -0x28(%rbp), %rax
movslq -0x44(%rbp), %rcx
movzbl (%rax,%rcx), %eax
movl %eax, -0x50(%rbp)
movl -0x50(%rbp), %eax
movb %al, %cl
movslq -0x48(%rbp), %rax
movb %cl, -0x40(%rbp,%rax)
movl -0x48(%rbp), %eax
addl $0x1, %eax
cltq
movb $0x0, -0x40(%rbp,%rax)
movl -0x44(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x44(%rbp)
jmp 0xafb4c
jmp 0xafc62
movl -0x44(%rbp), %eax
movl %eax, %ecx
addl $0x1, %ecx
movl %ecx, -0x44(%rbp)
movl $0x10, %ecx
cltd
idivl %ecx
cmpl $0x0, %edx
je 0xafcab
movq -0x18(%rbp), %rdi
movslq -0x4c(%rbp), %rax
addq %rax, %rdi
movl -0x1c(%rbp), %eax
subl -0x4c(%rbp), %eax
movslq %eax, %rsi
leaq 0x14b9b(%rip), %rdx     # 0xc4830
leaq 0x1635c(%rip), %rcx     # 0xc5ff8
movb $0x0, %al
callq 0xd6e0
addl -0x4c(%rbp), %eax
movl %eax, -0x4c(%rbp)
jmp 0xafc62
movq -0x18(%rbp), %rdi
movslq -0x4c(%rbp), %rax
addq %rax, %rdi
movl -0x1c(%rbp), %eax
subl -0x4c(%rbp), %eax
movslq %eax, %rsi
leaq -0x40(%rbp), %rcx
leaq 0x16f0a(%rip), %rdx     # 0xc6bd4
movb $0x0, %al
callq 0xd6e0
addl -0x4c(%rbp), %eax
movl %eax, -0x4c(%rbp)
movl -0x4c(%rbp), %eax
addq $0x50, %rsp
popq %rbp
retq