// File: AndreRenaud[P]simple_uart/./acutest.h
// Function: acutest_dump_
void
acutest_dump_(const char* title, const void* addr, size_t size)
{
    static const size_t BYTES_PER_LINE = 16;
    size_t line_beg;
    size_t truncate = 0;

    if(acutest_verbose_level_ < 2)
        return;

    /* We allow extra message only when something is already wrong in the
     * current test. */
    if(acutest_current_test_ == NULL  ||  !acutest_cond_failed_)
        return;

    if(size > TEST_DUMP_MAXSIZE) {
        truncate = size - TEST_DUMP_MAXSIZE;
        size = TEST_DUMP_MAXSIZE;
    }

    acutest_line_indent_(acutest_case_name_[0] ? 3 : 2);
    printf((title[strlen(title)-1] == ':') ? "%s\n" : "%s:\n", title);

    for(line_beg = 0; line_beg < size; line_beg += BYTES_PER_LINE) {
        size_t line_end = line_beg + BYTES_PER_LINE;
        size_t off;

        acutest_line_indent_(acutest_case_name_[0] ? 4 : 3);
        printf("%08lx: ", (unsigned long)line_beg);
        for(off = line_beg; off < line_end; off++) {
            if(off < size)
                printf(" %02x", ((const unsigned char*)addr)[off]);
            else
                printf("   ");
        }

        printf("  ");
        for(off = line_beg; off < line_end; off++) {
            unsigned char byte = ((const unsigned char*)addr)[off];
            if(off < size)
                printf("%c", (iscntrl(byte) ? '.' : byte));
            else
                break;
        }

        printf("\n");
    }

    if(truncate > 0) {
        acutest_line_indent_(acutest_case_name_[0] ? 4 : 3);
        printf("           ... (and more %u bytes)\n", (unsigned) truncate);
    }
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x50, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq $0x0, -0x28(%rbp)
cmpl $0x2, 0xa1a5(%rip)      # 0xd208
jge 0x306a
jmp 0x3283
cmpq $0x0, 0xa2b6(%rip)      # 0xd328
je 0x307d
cmpl $0x0, 0xa305(%rip)      # 0xd380
jne 0x3082
jmp 0x3283
cmpq $0x400, -0x18(%rbp)     # imm = 0x400
jbe 0x30a2
movq -0x18(%rbp), %rax
subq $0x400, %rax            # imm = 0x400
movq %rax, -0x28(%rbp)
movq $0x400, -0x18(%rbp)     # imm = 0x400
movsbl 0xa297(%rip), %ecx      # 0xd340
movl $0x2, %edi
movl $0x3, %eax
cmpl $0x0, %ecx
cmovnel %eax, %edi
callq 0x2aa0
movq -0x8(%rbp), %rax
movq %rax, -0x48(%rbp)
movq -0x8(%rbp), %rdi
callq 0x2130
movq %rax, %rcx
movq -0x48(%rbp), %rax
subq $0x1, %rcx
movsbl (%rax,%rcx), %ecx
leaq 0x603a(%rip), %rdi      # 0x911f
leaq 0x6212(%rip), %rax      # 0x92fe
cmpl $0x3a, %ecx
cmoveq %rax, %rdi
movq -0x8(%rbp), %rsi
movb $0x0, %al
callq 0x2160
movq $0x0, -0x20(%rbp)
movq -0x20(%rbp), %rax
cmpq -0x18(%rbp), %rax
jae 0x324c
movq -0x20(%rbp), %rax
addq $0x10, %rax
movq %rax, -0x30(%rbp)
movsbl 0xa219(%rip), %ecx      # 0xd340
movl $0x3, %edi
movl $0x4, %eax
cmpl $0x0, %ecx
cmovnel %eax, %edi
callq 0x2aa0
movq -0x20(%rbp), %rsi
leaq 0x5fe3(%rip), %rdi      # 0x912a
movb $0x0, %al
callq 0x2160
movq -0x20(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
cmpq -0x30(%rbp), %rax
jae 0x31a4
movq -0x38(%rbp), %rax
cmpq -0x18(%rbp), %rax
jae 0x3186
movq -0x10(%rbp), %rax
movq -0x38(%rbp), %rcx
movzbl (%rax,%rcx), %esi
leaq 0x5fb5(%rip), %rdi      # 0x9132
movb $0x0, %al
callq 0x2160
jmp 0x3194
leaq 0x5fab(%rip), %rdi      # 0x9138
movb $0x0, %al
callq 0x2160
jmp 0x3196
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0x3156
leaq 0x5f8e(%rip), %rdi      # 0x9139
movb $0x0, %al
callq 0x2160
movq -0x20(%rbp), %rax
movq %rax, -0x38(%rbp)
movq -0x38(%rbp), %rax
cmpq -0x30(%rbp), %rax
jae 0x322d
movq -0x10(%rbp), %rax
movq -0x38(%rbp), %rcx
movb (%rax,%rcx), %al
movb %al, -0x39(%rbp)
movq -0x38(%rbp), %rax
cmpq -0x18(%rbp), %rax
jae 0x321b
callq 0x23d0
movq (%rax), %rax
movzbl -0x39(%rbp), %ecx
movslq %ecx, %rcx
movzwl (%rax,%rcx,2), %eax
andl $0x2, %eax
cmpl $0x0, %eax
je 0x3201
movl $0x2e, %eax
movl %eax, -0x4c(%rbp)
jmp 0x3208
movzbl -0x39(%rbp), %eax
movl %eax, -0x4c(%rbp)
movl -0x4c(%rbp), %esi
leaq 0x5f2a(%rip), %rdi      # 0x913c
movb $0x0, %al
callq 0x2160
jmp 0x321d
jmp 0x322d
jmp 0x321f
movq -0x38(%rbp), %rax
addq $0x1, %rax
movq %rax, -0x38(%rbp)
jmp 0x31ba
leaq 0x684b(%rip), %rdi      # 0x9a7f
movb $0x0, %al
callq 0x2160
movq -0x20(%rbp), %rax
addq $0x10, %rax
movq %rax, -0x20(%rbp)
jmp 0x3106
cmpq $0x0, -0x28(%rbp)
jbe 0x3283
movsbl 0xa0e6(%rip), %ecx      # 0xd340
movl $0x3, %edi
movl $0x4, %eax
cmpl $0x0, %ecx
cmovnel %eax, %edi
callq 0x2aa0
movq -0x28(%rbp), %rax
movl %eax, %esi
leaq 0x5ec3(%rip), %rdi      # 0x913f
movb $0x0, %al
callq 0x2160
addq $0x50, %rsp
popq %rbp
retq
nopl (%rax)