// File: /workspace/github_c_makefile_star2_O0/sfeakes[P]unifi-motion/mongoose.c
// Function: mg_hexdump_n
static int mg_hexdump_n(const void *buf, int len, char *dst, int dst_len,
                        int offset) {
  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, MAX(dst_len - n, 0), "  %s\n", ascii);
      n += snprintf(dst + n, MAX(dst_len - n, 0), "%04x ", i + offset);
    }
    if (dst_len - n < 0) {
      return n;
    }
    n += snprintf(dst + n, MAX(dst_len - n, 0), " %02x", p[i]);
    ascii[idx] = p[i] < 0x20 || p[i] > 0x7e ? '.' : p[i];
    ascii[idx + 1] = '\0';
  }

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

  return n;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xb0, %rsp
movq %rdi, -0x10(%rbp)
movl %esi, -0x14(%rbp)
movq %rdx, -0x20(%rbp)
movl %ecx, -0x24(%rbp)
movl %r8d, -0x28(%rbp)
movq -0x10(%rbp), %rax
movq %rax, -0x30(%rbp)
leaq -0x50(%rbp), %rdi
xorl %esi, %esi
movl $0x11, %edx
callq 0x3260
movl $0x0, -0x5c(%rbp)
movl $0x0, -0x54(%rbp)
movl -0x54(%rbp), %eax
cmpl -0x14(%rbp), %eax
jge 0x16cd2
movl -0x54(%rbp), %eax
movl $0x10, %ecx
cltd
idivl %ecx
movl %edx, -0x58(%rbp)
cmpl $0x0, -0x58(%rbp)
jne 0x16beb
cmpl $0x0, -0x54(%rbp)
jle 0x16b9b
movq -0x20(%rbp), %rax
movslq -0x5c(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x68(%rbp)
movl -0x24(%rbp), %eax
subl -0x5c(%rbp), %eax
cmpl $0x0, %eax
jle 0x16b72
movl -0x24(%rbp), %eax
subl -0x5c(%rbp), %eax
movl %eax, -0x6c(%rbp)
jmp 0x16b79
xorl %eax, %eax
movl %eax, -0x6c(%rbp)
jmp 0x16b79
movq -0x68(%rbp), %rdi
movl -0x6c(%rbp), %eax
movslq %eax, %rsi
leaq -0x50(%rbp), %rcx
leaq 0xaa52(%rip), %rdx      # 0x215e0
movb $0x0, %al
callq 0x31f0
addl -0x5c(%rbp), %eax
movl %eax, -0x5c(%rbp)
movq -0x20(%rbp), %rax
movslq -0x5c(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x78(%rbp)
movl -0x24(%rbp), %eax
subl -0x5c(%rbp), %eax
cmpl $0x0, %eax
jle 0x16bc0
movl -0x24(%rbp), %eax
subl -0x5c(%rbp), %eax
movl %eax, -0x7c(%rbp)
jmp 0x16bc7
xorl %eax, %eax
movl %eax, -0x7c(%rbp)
jmp 0x16bc7
movq -0x78(%rbp), %rdi
movl -0x7c(%rbp), %eax
movslq %eax, %rsi
movl -0x54(%rbp), %ecx
addl -0x28(%rbp), %ecx
leaq 0xaa08(%rip), %rdx      # 0x215e6
movb $0x0, %al
callq 0x31f0
addl -0x5c(%rbp), %eax
movl %eax, -0x5c(%rbp)
movl -0x24(%rbp), %eax
subl -0x5c(%rbp), %eax
cmpl $0x0, %eax
jge 0x16c01
movl -0x5c(%rbp), %eax
movl %eax, -0x4(%rbp)
jmp 0x16db1
movq -0x20(%rbp), %rax
movslq -0x5c(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x88(%rbp)
movl -0x24(%rbp), %eax
subl -0x5c(%rbp), %eax
cmpl $0x0, %eax
jle 0x16c2c
movl -0x24(%rbp), %eax
subl -0x5c(%rbp), %eax
movl %eax, -0x8c(%rbp)
jmp 0x16c36
xorl %eax, %eax
movl %eax, -0x8c(%rbp)
jmp 0x16c36
movq -0x88(%rbp), %rdi
movl -0x8c(%rbp), %eax
movslq %eax, %rsi
movq -0x30(%rbp), %rax
movslq -0x54(%rbp), %rcx
movzbl (%rax,%rcx), %ecx
leaq 0xa993(%rip), %rdx      # 0x215ec
movb $0x0, %al
callq 0x31f0
addl -0x5c(%rbp), %eax
movl %eax, -0x5c(%rbp)
movq -0x30(%rbp), %rax
movslq -0x54(%rbp), %rcx
movzbl (%rax,%rcx), %eax
cmpl $0x20, %eax
jl 0x16c88
movq -0x30(%rbp), %rax
movslq -0x54(%rbp), %rcx
movzbl (%rax,%rcx), %eax
cmpl $0x7e, %eax
jle 0x16c95
movl $0x2e, %eax
movl %eax, -0x90(%rbp)
jmp 0x16ca7
movq -0x30(%rbp), %rax
movslq -0x54(%rbp), %rcx
movzbl (%rax,%rcx), %eax
movl %eax, -0x90(%rbp)
movl -0x90(%rbp), %eax
movb %al, %cl
movslq -0x58(%rbp), %rax
movb %cl, -0x50(%rbp,%rax)
movl -0x58(%rbp), %eax
addl $0x1, %eax
cltq
movb $0x0, -0x50(%rbp,%rax)
movl -0x54(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x54(%rbp)
jmp 0x16b23
jmp 0x16cd4
movl -0x54(%rbp), %eax
movl %eax, %ecx
addl $0x1, %ecx
movl %ecx, -0x54(%rbp)
movl $0x10, %ecx
cltd
idivl %ecx
cmpl $0x0, %edx
je 0x16d4e
movq -0x20(%rbp), %rax
movslq -0x5c(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0x98(%rbp)
movl -0x24(%rbp), %eax
subl -0x5c(%rbp), %eax
cmpl $0x0, %eax
jle 0x16d17
movl -0x24(%rbp), %eax
subl -0x5c(%rbp), %eax
movl %eax, -0x9c(%rbp)
jmp 0x16d21
xorl %eax, %eax
movl %eax, -0x9c(%rbp)
jmp 0x16d21
movq -0x98(%rbp), %rdi
movl -0x9c(%rbp), %eax
movslq %eax, %rsi
leaq 0x925a(%rip), %rdx      # 0x1ff92
leaq 0xa8b3(%rip), %rcx      # 0x215f2
movb $0x0, %al
callq 0x31f0
addl -0x5c(%rbp), %eax
movl %eax, -0x5c(%rbp)
jmp 0x16cd4
movq -0x20(%rbp), %rax
movslq -0x5c(%rbp), %rcx
addq %rcx, %rax
movq %rax, -0xa8(%rbp)
movl -0x24(%rbp), %eax
subl -0x5c(%rbp), %eax
cmpl $0x0, %eax
jle 0x16d79
movl -0x24(%rbp), %eax
subl -0x5c(%rbp), %eax
movl %eax, -0xac(%rbp)
jmp 0x16d83
xorl %eax, %eax
movl %eax, -0xac(%rbp)
jmp 0x16d83
movq -0xa8(%rbp), %rdi
movl -0xac(%rbp), %eax
movslq %eax, %rsi
leaq -0x50(%rbp), %rcx
leaq 0xa842(%rip), %rdx      # 0x215e0
movb $0x0, %al
callq 0x31f0
addl -0x5c(%rbp), %eax
movl %eax, -0x5c(%rbp)
movl -0x5c(%rbp), %eax
movl %eax, -0x4(%rbp)
movl -0x4(%rbp), %eax
addq $0xb0, %rsp
popq %rbp
retq
nopl (%rax)