user: Please show me the C implementation that matches the assembly code listed below:

```asm
<test_fail_memory_common>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x150,%rsp
  mov    %r8,%rbx
  mov    %r9,%rbp
  mov    0x190(%rsp),%r15
  mov    0x198(%rsp),%r13
  mov    0x1a0(%rsp),%r14
  mov    0x1a8(%rsp),%r12
  mov    %fs:0x28,%rax
  mov    %rax,0x140(%rsp)
  xor    %eax,%eax
  push   0x188(%rsp)
  call   <test_fail_message_prefix@plt>
  add    $0x10,%rsp
  test   %r15,%r15
  je     L271
  test   %r14,%r14
  je     L98
  mov    %r13,%rax
  or     %r12,%rax
  je     L287
L289:
  cmp    %r13,%r12
  jne    L318
  cmp    %r14,%r15
  je     L188
  mov    %r13,%rdx
  mov    %r14,%rsi
  mov    %r15,%rdi
  call   <memcmp@plt>
  test   %rax,%rax
  je     L23
L318:
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  call   <test_diff_header@plt>
L23:
  movl   $0x0,0x18(%rsp)
  jmp    L193
L287:
  mov    $0x20,%esi
  mov    %r15,%rdi
  call   <test_memory_null_empty@plt>
L331:
  mov    $0x0,%eax
  call   <test_flush_stderr@plt>
  mov    0x138(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L99
  add    $0x148,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L188:
  mov    %r14,%r15
  jmp    L23
L36:
  mov    $0x20,%ebx
  cmp    %rbx,%r13
  cmovbe %r13,%rbx
  lea    0x20(%rsp),%rdx
  mov    $0x8,%ecx
  mov    %rbx,%rsi
  mov    %r15,%rdi
  call   <hex_convert_memory@plt>
  test   %r12,%r12
  je     L274
  mov    $0x20,%eax
  cmp    %rax,%r12
  cmovbe %r12,%rax
  mov    %rax,%rbp
  mov    %rax,0x10(%rsp)
  lea    0x80(%rsp),%rdx
  mov    $0x8,%ecx
  mov    %rax,%rsi
  mov    %r14,%rdi
  call   <hex_convert_memory@plt>
  cmp    %rbp,%rbx
  cmovbe %rbx,%rbp
  movl   $0x0,0xc(%rsp)
  mov    $0x0,%eax
  lea    0xe0(%rsp),%rdx
  mov    $0x1,%edi
  mov    $0x20,%r9d
  lea    -0x1(%rbp),%r8
  jmp    L246
L128:
  mov    $0x20,%eax
  cmp    %rax,%r12
  cmovbe %r12,%rax
  mov    %rax,0x10(%rsp)
  lea    0x80(%rsp),%rdx
  mov    $0x8,%ecx
  mov    %rax,%rsi
  mov    %r14,%rdi
  call   <hex_convert_memory@plt>
  mov    %r13,%rbp
  mov    %r13,%rbx
  movb   $0x1,0x1f(%rsp)
  movl   $0x0,0xc(%rsp)
  mov    $0x0,%eax
L407:
  cmpl   $0x0,0x18(%rsp)
  jne    L63
  test   %r15,%r15
  je     L87
  test   %r13,%r13
  je     L87
  test   %al,%al
  jne    L218
L10:
  test   %r14,%r14
  je     L2
  test   %r12,%r12
  je     L2
L118:
  cmpb   $0x0,0x1f(%rsp)
  jne    L358
L40:
  cmpl   $0x0,0xc(%rsp)
  je     L235
  test   %rbp,%rbp
  jne    L43
L235:
  add    %rbx,%r15
  mov    0x10(%rsp),%rax
  add    %rax,%r14
  sub    %rbx,%r13
  sub    %rax,%r12
  addl   $0x20,0x18(%rsp)
  mov    %r13,%rax
  or     %r12,%rax
  je     L331
L193:
  test   %r13,%r13
  jne    L36
  mov    %r12,%rbx
  test   %r12,%r12
  jne    L128
L274:
  test   %rbx,%rbx
  setne  %al
  movq   $0x0,0x10(%rsp)
  movb   $0x0,0x1f(%rsp)
  movl   $0x0,0xc(%rsp)
  mov    $0x0,%ebp
L280:
  cmp    %rbx,0x10(%rsp)
  jne    L407
  cmpl   $0x0,0xc(%rsp)
  jne    L407
  lea    0x20(%rsp),%rdx
  mov    0x18(%rsp),%esi
  lea    D4(%rip),%rdi
  mov    $0x0,%eax
  call   <test_printf_stderr@plt>
  jmp    L235
L243:
  lea    0x2(%rdx),%rsi
  mov    %r9d,%ecx
  jmp    L335
L285:
  add    $0x1,%rax
  cmp    %rax,%rbp
  je     L7
L246:
  movzbl (%r14,%rax,1),%esi
  cmp    %sil,(%r15,%rax,1)
  je     L243
  lea    0x2(%rdx),%rsi
  mov    $0x5e,%ecx
  mov    %edi,0xc(%rsp)
L335:
  mov    %cl,(%rdx)
  mov    %cl,0x1(%rdx)
  mov    %rax,%rcx
  and    $0x7,%ecx
  mov    %rsi,%rdx
  cmp    $0x7,%rcx
  jne    L285
  cmp    %rax,%r8
  je     L285
  lea    0x1(%rsi),%rdx
  movb   $0x20,(%rsi)
  jmp    L285
L7:
  movb   $0x0,(%rdx)
  movb   $0x1,0x1f(%rsp)
  mov    $0x1,%eax
  jmp    L280
L87:
  mov    $0x2d,%esi
  mov    %r15,%rdi
  call   <test_memory_null_empty@plt>
  jmp    L10
L2:
  mov    $0x2b,%esi
  mov    %r14,%rdi
  call   <test_memory_null_empty@plt>
  jmp    L40
L358:
  lea    0x80(%rsp),%rdx
  mov    0x18(%rsp),%esi
  lea    D0(%rip),%rdi
  mov    $0x0,%eax
  call   <test_printf_stderr@plt>
  jmp    L40
L43:
  lea    0xe0(%rsp),%rdx
  lea    D59(%rip),%rsi
  lea    D32(%rip),%rdi
  mov    $0x0,%eax
  call   <test_printf_stderr@plt>
  jmp    L235
L63:
  test   %al,%al
  je     L118
  lea    0x20(%rsp),%rdx
  mov    0x18(%rsp),%esi
  lea    D30(%rip),%rdi
  mov    $0x0,%eax
  call   <test_printf_stderr@plt>
  jmp    L118
L271:
  mov    $0x0,%r13d
  test   %r14,%r14
  je     L287
L28:
  mov    %r12,%rax
  or     %r13,%rax
  jne    L289
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  call   <test_diff_header@plt>
  mov    $0x2d,%esi
  mov    %r15,%rdi
  call   <test_memory_null_empty@plt>
  mov    $0x2b,%esi
  mov    %r14,%rdi
  call   <test_memory_null_empty@plt>
  jmp    L331
L218:
  lea    0x20(%rsp),%rdx
  mov    0x18(%rsp),%esi
  lea    D30(%rip),%rdi
  mov    $0x0,%eax
  call   <test_printf_stderr@plt>
  jmp    L10
L98:
  mov    $0x0,%r12d
  jmp    L28
L99:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: extract_symbolic_data
arguments: data_tag: D4
data_type: string
name: extract_symbolic_data
arguments: data_tag: D0
data_type: string
name: extract_symbolic_data
arguments: data_tag: D59
data_type: string
name: extract_symbolic_data
arguments: data_tag: D32
data_type: string
name: extract_symbolic_data
arguments: data_tag: D30
data_type: string

tool: D4: %04x: %s


tool: D0: %04x:+%s


tool: 

tool: D32: % 4s  %s


tool: D30: %04x:-%s


assistant: ```c
void test_fail_memory_common(const char *prefix, const char *file, int line, const char *type, const char *left, const char *right, const char *op, const unsigned char *m1, size_t l1, const unsigned char *m2, size_t l2) {
  const size_t bytes = ((80) - 9) / 17 * 8;
  char b1[(80) + 1], b2[(80) + 1];
  char *p, bdiff[(80) + 1];
  size_t n1, n2, i;
  unsigned int cnt = 0, diff;
  test_fail_message_prefix(prefix, file, line, type, left, right, op);
  if (m1 == NULL)
    l1 = 0;
  if (m2 == NULL)
    l2 = 0;
  if (l1 == 0 && l2 == 0) {
    if ((m1 == NULL) == (m2 == NULL)) {
      test_memory_null_empty(m1, ' ');
    } else {
      test_diff_header(left, right);
      test_memory_null_empty(m1, '-');
      test_memory_null_empty(m2, '+');
    }
    goto fin;
  }
  if (l1 != l2 || (m1 != m2 && memcmp(m1, m2, l1) != 0))
    test_diff_header(left, right);
  while (l1 > 0 || l2 > 0) {
    n1 = n2 = 0;
    if (l1 > 0) {
      n1 = l1 > bytes ? bytes : l1;
      hex_convert_memory(m1, n1, b1, 8);
    }
    if (l2 > 0) {
      n2 = l2 > bytes ? bytes : l2;
      hex_convert_memory(m2, n2, b2, 8);
    }
    diff = 0;
    i = 0;
    p = bdiff;
    if (n1 > 0 && n2 > 0) {
      const size_t j = n1 < n2 ? n1 : n2;
      for (; i < j; i++) {
        if (m1[i] == m2[i]) {
          *p++ = ' ';
          *p++ = ' ';
        } else {
          *p++ = '^';
          *p++ = '^';
          diff = 1;
        }
        if (i % 8 == 7 && i != j - 1)
          *p++ = ' ';
      }
      *p++ = '\0';
    }
    if (n1 == n2 && !diff) {
      test_printf_stderr("%04x: %s\n", cnt, b1);
    } else {
      if (cnt == 0 && (m1 == NULL || l1 == 0))
        test_memory_null_empty(m1, '-');
      else if (n1 > 0)
        test_printf_stderr("%04x:-%s\n", cnt, b1);
      if (cnt == 0 && (m2 == NULL || l2 == 0))
        test_memory_null_empty(m2, '+');
      else if (n2 > 0)
        test_printf_stderr("%04x:+%s\n", cnt, b2);
      if (diff && i > 0)
        test_printf_stderr("% 4s  %s\n", "", bdiff);
    }
    m1 += n1;
    m2 += n2;
    l1 -= n1;
    l2 -= n2;
    cnt += bytes;
  }
fin:
  test_flush_stderr();
}
```