// File: /workspace/github_c_makefile_star2_O0/mruby-zest[P]osc-bridge/test/common.h
// Function: assert_hex_eq
int assert_hex_eq(const char *a, const char *b, size_t size_a, size_t size_b,
                  const char *testcase, int line)
{
    test_counter++;
    int err = (size_a != size_b) || memcmp(a, b, size_a);
    if(err) {
        printf("not ok %d - %s...\n", test_counter, testcase);
        printf("# Error on line %d\n", line);
        //printf("# Expected '%s', but observed '%s' instead (line %d)\n", a, b, line);

        //create difference mask
        const int longer  = size_a > size_b ? size_a : size_b;
        const int shorter = size_a < size_b ? size_a : size_b;
        char mask[longer];
        memset(mask, 0, longer);
        for(int i=0; i<shorter; ++i)
            if(a[i] != b[i])
                mask[i] = 1;

        printf("#\n");
        printf("# Expected:\n");
        hexdump(a, mask, size_a);
        printf("#\n");
        printf("# Observed:\n");
        hexdump(b, mask, size_b);

        global_err++;
    } else
        printf("ok %d - %s...\n", test_counter, testcase);
    return err;
}

// Assembly:
pushq %rbp
movq %rsp, %rbp
subq $0x70, %rsp
movq %rdi, -0x8(%rbp)
movq %rsi, -0x10(%rbp)
movq %rdx, -0x18(%rbp)
movq %rcx, -0x20(%rbp)
movq %r8, -0x28(%rbp)
movl %r9d, -0x2c(%rbp)
movl 0x539e(%rip), %eax      # 0x10824
addl $0x1, %eax
movl %eax, 0x5395(%rip)      # 0x10824
movq -0x18(%rbp), %rcx
movb $0x1, %al
cmpq -0x20(%rbp), %rcx
movb %al, -0x4d(%rbp)
jne 0xb4b8
movq -0x8(%rbp), %rdi
movq -0x10(%rbp), %rsi
movq -0x18(%rbp), %rdx
callq 0x2160
cmpl $0x0, %eax
setne %al
movb %al, -0x4d(%rbp)
movb -0x4d(%rbp), %al
andb $0x1, %al
movzbl %al, %eax
movl %eax, -0x30(%rbp)
cmpl $0x0, -0x30(%rbp)
je 0xb623
movl 0x5351(%rip), %esi      # 0x10824
movq -0x28(%rbp), %rdx
leaq 0x19c6(%rip), %rdi      # 0xcea4
movb $0x0, %al
callq 0x20e0
movl -0x2c(%rbp), %esi
leaq 0x1b09(%rip), %rdi      # 0xcff8
movb $0x0, %al
callq 0x20e0
movq -0x18(%rbp), %rax
cmpq -0x20(%rbp), %rax
jbe 0xb50a
movq -0x18(%rbp), %rax
movq %rax, -0x58(%rbp)
jmp 0xb512
movq -0x20(%rbp), %rax
movq %rax, -0x58(%rbp)
movq -0x58(%rbp), %rax
movl %eax, -0x34(%rbp)
movq -0x18(%rbp), %rax
cmpq -0x20(%rbp), %rax
jae 0xb52d
movq -0x18(%rbp), %rax
movq %rax, -0x60(%rbp)
jmp 0xb535
movq -0x20(%rbp), %rax
movq %rax, -0x60(%rbp)
movq -0x60(%rbp), %rax
movl %eax, -0x38(%rbp)
movl -0x34(%rbp), %eax
movq %rsp, %rcx
movq %rcx, -0x40(%rbp)
movq %rax, %rcx
addq $0xf, %rcx
andq $-0x10, %rcx
movq %rsp, %rdi
subq %rcx, %rdi
movq %rdi, -0x68(%rbp)
movq %rdi, %rsp
movq %rax, -0x48(%rbp)
movslq -0x34(%rbp), %rdx
xorl %esi, %esi
callq 0x2130
movl $0x0, -0x4c(%rbp)
movl -0x4c(%rbp), %eax
cmpl -0x38(%rbp), %eax
jge 0xb5b1
movq -0x8(%rbp), %rax
movslq -0x4c(%rbp), %rcx
movsbl (%rax,%rcx), %eax
movq -0x10(%rbp), %rcx
movslq -0x4c(%rbp), %rdx
movsbl (%rcx,%rdx), %ecx
cmpl %ecx, %eax
je 0xb5a4
movq -0x68(%rbp), %rax
movslq -0x4c(%rbp), %rcx
movb $0x1, (%rax,%rcx)
jmp 0xb5a6
movl -0x4c(%rbp), %eax
addl $0x1, %eax
movl %eax, -0x4c(%rbp)
jmp 0xb574
leaq 0x1a54(%rip), %rdi      # 0xd00c
movb $0x0, %al
callq 0x20e0
leaq 0x1a49(%rip), %rdi      # 0xd00f
movb $0x0, %al
callq 0x20e0
movq -0x68(%rbp), %rsi
movq -0x8(%rbp), %rdi
movq -0x18(%rbp), %rdx
callq 0xb250
leaq 0x1a27(%rip), %rdi      # 0xd00c
movb $0x0, %al
callq 0x20e0
leaq 0x1a29(%rip), %rdi      # 0xd01c
movb $0x0, %al
callq 0x20e0
movq -0x68(%rbp), %rsi
movq -0x10(%rbp), %rdi
movq -0x20(%rbp), %rdx
callq 0xb250
movl 0x520f(%rip), %eax      # 0x10820
addl $0x1, %eax
movl %eax, 0x5206(%rip)      # 0x10820
movq -0x40(%rbp), %rax
movq %rax, %rsp
jmp 0xb63b
movl 0x51fb(%rip), %esi      # 0x10824
movq -0x28(%rbp), %rdx
leaq 0x1874(%rip), %rdi      # 0xcea8
movb $0x0, %al
callq 0x20e0
movl -0x30(%rbp), %eax
movq %rbp, %rsp
popq %rbp
retq
nopw %cs:(%rax,%rax)