// File: /workspace/github_c_makefile_star2_O0/orempel[P]multiboot_tool/filedata.c
// Function: dbuf_dump
static void dbuf_dump(struct databuf *dbuf)
{
    uint32_t pos = 0;
    int oldskip = 0;

    while (pos < dbuf->length)
    {
        char buf[128];
        int j, i = 0;

        int skip = 1;
        for (j = 0; j < 16; j++)
        {
            if (pos + j < dbuf->length)
            {
                i += sprintf(buf + i, "%02X", dbuf->data[pos + j]);
            } else {
                i += sprintf(buf + i, "  ");
            }

            if (j % 2)
            {
                buf[i++] = ' ';
            }
        }

        for (j = 0; j < 16; j++)
        {
            if (pos + j < dbuf->length)
            {
                unsigned char val = dbuf->data[pos + j];

                if (val >= 0x20 && val < 0x7F)
                {
                    buf[i++] = val;
                } else {
                    buf[i++] = '.';
                }

                if (val != 0xFF)
                {
                    skip = 0;
                }
            }
            else
            {
                buf[i++] = ' ';
            }
        }

        if ((pos == 0) ||
            ((pos + 16) >= dbuf->length) ||
            (skip == 0)
           )
        {
            buf[i++] = '\0';
            printf("%04X: %s\r\n", pos, buf);
            oldskip = 0;

        }
        else if ((skip == 1) &&
                 (oldskip == 0)
                )
        {
            printf("****\n");
            oldskip = 1;
        }

        pos += 16;
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0xa0, %rsp
movq %rdi, -0x8(%rbp)
movl $0x0, -0xc(%rbp)
movl $0x0, -0x10(%rbp)
movl -0xc(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0x4(%rcx), %eax
jae 0x54be
movl $0x0, -0x98(%rbp)
movl $0x1, -0x9c(%rbp)
movl $0x0, -0x94(%rbp)
cmpl $0x10, -0x94(%rbp)
jge 0x534a
movl -0xc(%rbp), %eax
addl -0x94(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0x4(%rcx), %eax
jae 0x52db
leaq -0x90(%rbp), %rdi
movslq -0x98(%rbp), %rax
addq %rax, %rdi
movq -0x8(%rbp), %rax
movl -0xc(%rbp), %ecx
addl -0x94(%rbp), %ecx
movl %ecx, %ecx
movzbl 0x8(%rax,%rcx), %edx
leaq 0x6848(%rip), %rsi      # 0xbb0e
movb $0x0, %al
callq 0x2240
addl -0x98(%rbp), %eax
movl %eax, -0x98(%rbp)
jmp 0x5306
leaq -0x90(%rbp), %rdi
movslq -0x98(%rbp), %rax
addq %rax, %rdi
leaq 0x6820(%rip), %rsi      # 0xbb13
movb $0x0, %al
callq 0x2240
addl -0x98(%rbp), %eax
movl %eax, -0x98(%rbp)
movl -0x94(%rbp), %eax
movl $0x2, %ecx
cltd
idivl %ecx
cmpl $0x0, %edx
je 0x5334
movl -0x98(%rbp), %eax
movl %eax, %ecx
addl $0x1, %ecx
movl %ecx, -0x98(%rbp)
cltq
movb $0x20, -0x90(%rbp,%rax)
jmp 0x5336
movl -0x94(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x94(%rbp)
jmp 0x527b
movl $0x0, -0x94(%rbp)
cmpl $0x10, -0x94(%rbp)
jge 0x5430
movl -0xc(%rbp), %eax
addl -0x94(%rbp), %eax
movq -0x8(%rbp), %rcx
cmpl 0x4(%rcx), %eax
jae 0x53ff
movq -0x8(%rbp), %rax
movl -0xc(%rbp), %ecx
addl -0x94(%rbp), %ecx
movl %ecx, %ecx
movb 0x8(%rax,%rcx), %al
movb %al, -0x9d(%rbp)
movzbl -0x9d(%rbp), %eax
cmpl $0x20, %eax
jl 0x53ca
movzbl -0x9d(%rbp), %eax
cmpl $0x7f, %eax
jge 0x53ca
movb -0x9d(%rbp), %cl
movl -0x98(%rbp), %eax
movl %eax, %edx
addl $0x1, %edx
movl %edx, -0x98(%rbp)
cltq
movb %cl, -0x90(%rbp,%rax)
jmp 0x53e5
movl -0x98(%rbp), %eax
movl %eax, %ecx
addl $0x1, %ecx
movl %ecx, -0x98(%rbp)
cltq
movb $0x2e, -0x90(%rbp,%rax)
movzbl -0x9d(%rbp), %eax
cmpl $0xff, %eax
je 0x53fd
movl $0x0, -0x9c(%rbp)
jmp 0x541a
movl -0x98(%rbp), %eax
movl %eax, %ecx
addl $0x1, %ecx
movl %ecx, -0x98(%rbp)
cltq
movb $0x20, -0x90(%rbp,%rax)
jmp 0x541c
movl -0x94(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x94(%rbp)
jmp 0x5354
cmpl $0x0, -0xc(%rbp)
je 0x544e
movl -0xc(%rbp), %eax
addl $0x10, %eax
movq -0x8(%rbp), %rcx
cmpl 0x4(%rcx), %eax
jae 0x544e
cmpl $0x0, -0x9c(%rbp)
jne 0x548a
movl -0x98(%rbp), %eax
movl %eax, %ecx
addl $0x1, %ecx
movl %ecx, -0x98(%rbp)
cltq
movb $0x0, -0x90(%rbp,%rax)
movl -0xc(%rbp), %esi
leaq -0x90(%rbp), %rdx
leaq 0x669c(%rip), %rdi      # 0xbb16
movb $0x0, %al
callq 0x20d0
movl $0x0, -0x10(%rbp)
jmp 0x54b0
cmpl $0x1, -0x9c(%rbp)
jne 0x54ae
cmpl $0x0, -0x10(%rbp)
jne 0x54ae
leaq 0x6681(%rip), %rdi      # 0xbb21
movb $0x0, %al
callq 0x20d0
movl $0x1, -0x10(%rbp)
jmp 0x54b0
movl -0xc(%rbp), %eax
addl $0x10, %eax
movl %eax, -0xc(%rbp)
jmp 0x524d
addq $0xa0, %rsp
popq %rbp
retq
nopw (%rax,%rax)