#define NULL ((void *)0)
typedef unsigned long size_t; // Customize by platform.
typedef long intptr_t;
typedef unsigned long uintptr_t;
typedef long scalar_t__; // Either arithmetic or pointer type.
/* By default, we understand bool (as a convenience). */
typedef int bool;
#define false 0
#define true 1

/* Forward declarations */

/* Type definitions */

/* Variables and functions */
int /*<<< orphan*/ hex_convert_memory(unsigned char const *, size_t, char *,
                                      int);
scalar_t__ memcmp(unsigned char const *, unsigned char const *, size_t);
int /*<<< orphan*/ test_diff_header(char const *, char const *);
int /*<<< orphan*/ test_fail_message_prefix(char const *, char const *, int,
                                            char const *, char const *,
                                            char const *, char const *);
int /*<<< orphan*/ test_flush_stderr();
int /*<<< orphan*/ test_memory_null_empty(unsigned char const *, char);
int /*<<< orphan*/ test_printf_stderr(char *, ...);
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();
}


x86 assembly (clang, -O0):
<test_fail_memory_common>:
push   %rbp
mov    %rsp,%rbp
sub    $0x1a0,%rsp
mov    0x30(%rbp),%rax
mov    0x28(%rbp),%rax
mov    0x20(%rbp),%rax
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
movq   $0x20,-0x38(%rbp)
movl   $0x0,-0x16c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    -0x30(%rbp),%r9
mov    0x10(%rbp),%rax
mov    %rax,(%rsp)
call   1030 <test_fail_message_prefix@plt>
cmpq   $0x0,0x18(%rbp)
jne    11ef <test_fail_memory_common+0x7f>
movq   $0x0,0x20(%rbp)
cmpq   $0x0,0x28(%rbp)
jne    1202 <test_fail_memory_common+0x92>
movq   $0x0,0x30(%rbp)
cmpq   $0x0,0x20(%rbp)
jne    127c <test_fail_memory_common+0x10c>
cmpq   $0x0,0x30(%rbp)
jne    127c <test_fail_memory_common+0x10c>
cmpq   $0x0,0x18(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
cmpq   $0x0,0x28(%rbp)
sete   %cl
and    $0x1,%cl
movzbl %cl,%ecx
cmp    %ecx,%eax
jne    124e <test_fail_memory_common+0xde>
mov    0x18(%rbp),%rdi
mov    $0x20,%esi
call   1090 <test_memory_null_empty@plt>
jmp    1277 <test_fail_memory_common+0x107>
mov    -0x28(%rbp),%rdi
mov    -0x30(%rbp),%rsi
call   1050 <test_diff_header@plt>
mov    0x18(%rbp),%rdi
mov    $0x2d,%esi
call   1090 <test_memory_null_empty@plt>
mov    0x28(%rbp),%rdi
mov    $0x2b,%esi
call   1090 <test_memory_null_empty@plt>
jmp    170f <test_fail_memory_common+0x59f>
mov    0x20(%rbp),%rax
cmp    0x30(%rbp),%rax
jne    12b3 <test_fail_memory_common+0x143>
mov    0x18(%rbp),%rax
cmp    0x28(%rbp),%rax
je     12c0 <test_fail_memory_common+0x150>
mov    0x18(%rbp),%rdi
mov    0x28(%rbp),%rsi
mov    0x20(%rbp),%rdx
call   1070 <memcmp@plt>
cmp    $0x0,%rax
je     12c0 <test_fail_memory_common+0x150>
mov    -0x28(%rbp),%rdi
mov    -0x30(%rbp),%rsi
call   1050 <test_diff_header@plt>
jmp    12c5 <test_fail_memory_common+0x155>
mov    $0x1,%al
cmpq   $0x0,0x20(%rbp)
mov    %al,-0x179(%rbp)
ja     12e6 <test_fail_memory_common+0x176>
cmpq   $0x0,0x30(%rbp)
seta   %al
mov    %al,-0x179(%rbp)
mov    -0x179(%rbp),%al
test   $0x1,%al
jne    12f9 <test_fail_memory_common+0x189>
jmp    170a <test_fail_memory_common+0x59a>
movq   $0x0,-0x160(%rbp)
movq   $0x0,-0x158(%rbp)
cmpq   $0x0,0x20(%rbp)
jbe    136b <test_fail_memory_common+0x1fb>
cmpq   $0x20,0x20(%rbp)
jbe    1336 <test_fail_memory_common+0x1c6>
mov    $0x20,%eax
mov    %rax,-0x188(%rbp)
jmp    1341 <test_fail_memory_common+0x1d1>
mov    0x20(%rbp),%rax
mov    %rax,-0x188(%rbp)
mov    -0x188(%rbp),%rax
mov    %rax,-0x158(%rbp)
mov    0x18(%rbp),%rdi
mov    -0x158(%rbp),%rsi
lea    -0x90(%rbp),%rdx
mov    $0x8,%ecx
call   1080 <hex_convert_memory@plt>
cmpq   $0x0,0x30(%rbp)
jbe    13c7 <test_fail_memory_common+0x257>
cmpq   $0x20,0x30(%rbp)
jbe    1392 <test_fail_memory_common+0x222>
mov    $0x20,%eax
mov    %rax,-0x190(%rbp)
jmp    139d <test_fail_memory_common+0x22d>
mov    0x30(%rbp),%rax
mov    %rax,-0x190(%rbp)
mov    -0x190(%rbp),%rax
mov    %rax,-0x160(%rbp)
mov    0x28(%rbp),%rdi
mov    -0x160(%rbp),%rsi
lea    -0xf0(%rbp),%rdx
mov    $0x8,%ecx
call   1080 <hex_convert_memory@plt>
movl   $0x0,-0x170(%rbp)
movq   $0x0,-0x168(%rbp)
lea    -0x150(%rbp),%rax
mov    %rax,-0xf8(%rbp)
cmpq   $0x0,-0x158(%rbp)
jbe    156e <test_fail_memory_common+0x3fe>
cmpq   $0x0,-0x160(%rbp)
jbe    156e <test_fail_memory_common+0x3fe>
mov    -0x158(%rbp),%rax
cmp    -0x160(%rbp),%rax
jae    142d <test_fail_memory_common+0x2bd>
mov    -0x158(%rbp),%rax
mov    %rax,-0x198(%rbp)
jmp    143b <test_fail_memory_common+0x2cb>
mov    -0x160(%rbp),%rax
mov    %rax,-0x198(%rbp)
mov    -0x198(%rbp),%rax
mov    %rax,-0x178(%rbp)
mov    -0x168(%rbp),%rax
cmp    -0x178(%rbp),%rax
jae    1556 <test_fail_memory_common+0x3e6>
mov    0x18(%rbp),%rax
mov    -0x168(%rbp),%rcx
movzbl (%rax,%rcx,1),%eax
mov    0x28(%rbp),%rcx
mov    -0x168(%rbp),%rdx
movzbl (%rcx,%rdx,1),%ecx
cmp    %ecx,%eax
jne    14b8 <test_fail_memory_common+0x348>
mov    -0xf8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0xf8(%rbp)
movb   $0x20,(%rax)
mov    -0xf8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0xf8(%rbp)
movb   $0x20,(%rax)
jmp    14f2 <test_fail_memory_common+0x382>
mov    -0xf8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0xf8(%rbp)
movb   $0x5e,(%rax)
mov    -0xf8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0xf8(%rbp)
movb   $0x5e,(%rax)
movl   $0x1,-0x170(%rbp)
mov    -0x168(%rbp),%rax
and    $0x7,%rax
cmp    $0x7,%rax
jne    153a <test_fail_memory_common+0x3ca>
mov    -0x168(%rbp),%rax
mov    -0x178(%rbp),%rcx
sub    $0x1,%rcx
cmp    %rcx,%rax
je     153a <test_fail_memory_common+0x3ca>
mov    -0xf8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0xf8(%rbp)
movb   $0x20,(%rax)
jmp    153f <test_fail_memory_common+0x3cf>
mov    -0x168(%rbp),%rax
add    $0x1,%rax
mov    %rax,-0x168(%rbp)
jmp    1449 <test_fail_memory_common+0x2d9>
mov    -0xf8(%rbp),%rax
mov    %rax,%rcx
add    $0x1,%rcx
mov    %rcx,-0xf8(%rbp)
movb   $0x0,(%rax)
mov    -0x158(%rbp),%rax
cmp    -0x160(%rbp),%rax
jne    15af <test_fail_memory_common+0x43f>
cmpl   $0x0,-0x170(%rbp)
jne    15af <test_fail_memory_common+0x43f>
mov    -0x16c(%rbp),%esi
lea    -0x90(%rbp),%rdx
lea    0xa5d(%rip),%rdi
mov    $0x0,%al
call   1060 <test_printf_stderr@plt>
jmp    16b3 <test_fail_memory_common+0x543>
cmpl   $0x0,-0x16c(%rbp)
jne    15e5 <test_fail_memory_common+0x475>
cmpq   $0x0,0x18(%rbp)
je     15d2 <test_fail_memory_common+0x462>
cmpq   $0x0,0x20(%rbp)
jne    15e5 <test_fail_memory_common+0x475>
mov    0x18(%rbp),%rdi
mov    $0x2d,%esi
call   1090 <test_memory_null_empty@plt>
jmp    1613 <test_fail_memory_common+0x4a3>
cmpq   $0x0,-0x158(%rbp)
jbe    160e <test_fail_memory_common+0x49e>
mov    -0x16c(%rbp),%esi
lea    -0x90(%rbp),%rdx
lea    0xa03(%rip),%rdi
mov    $0x0,%al
call   1060 <test_printf_stderr@plt>
jmp    1613 <test_fail_memory_common+0x4a3>
cmpl   $0x0,-0x16c(%rbp)
jne    1649 <test_fail_memory_common+0x4d9>
cmpq   $0x0,0x28(%rbp)
je     1636 <test_fail_memory_common+0x4c6>
cmpq   $0x0,0x30(%rbp)
jne    1649 <test_fail_memory_common+0x4d9>
mov    0x28(%rbp),%rdi
mov    $0x2b,%esi
call   1090 <test_memory_null_empty@plt>
jmp    1677 <test_fail_memory_common+0x507>
cmpq   $0x0,-0x160(%rbp)
jbe    1672 <test_fail_memory_common+0x502>
mov    -0x16c(%rbp),%esi
lea    -0xf0(%rbp),%rdx
lea    0x9a9(%rip),%rdi
mov    $0x0,%al
call   1060 <test_printf_stderr@plt>
jmp    1677 <test_fail_memory_common+0x507>
cmpl   $0x0,-0x170(%rbp)
je     16ae <test_fail_memory_common+0x53e>
cmpq   $0x0,-0x168(%rbp)
jbe    16ae <test_fail_memory_common+0x53e>
lea    -0x150(%rbp),%rdx
lea    0x97e(%rip),%rdi
lea    0x980(%rip),%rsi
mov    $0x0,%al
call   1060 <test_printf_stderr@plt>
jmp    16b3 <test_fail_memory_common+0x543>
mov    -0x158(%rbp),%rax
add    0x18(%rbp),%rax
mov    %rax,0x18(%rbp)
mov    -0x160(%rbp),%rax
add    0x28(%rbp),%rax
mov    %rax,0x28(%rbp)
mov    -0x158(%rbp),%rcx
mov    0x20(%rbp),%rax
sub    %rcx,%rax
mov    %rax,0x20(%rbp)
mov    -0x160(%rbp),%rcx
mov    0x30(%rbp),%rax
sub    %rcx,%rax
mov    %rax,0x30(%rbp)
mov    -0x16c(%rbp),%eax
add    $0x20,%rax
mov    %eax,-0x16c(%rbp)
jmp    12c5 <test_fail_memory_common+0x155>
jmp    170f <test_fail_memory_common+0x59f>
mov    $0x0,%al
call   1040 <test_flush_stderr@plt>
add    $0x1a0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_fail_memory_common>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x148,%rsp
mov    %r9,%r12
mov    %r8,%r15
mov    0x198(%rsp),%r13
mov    0x188(%rsp),%rbx
mov    0x180(%rsp),%rax
mov    %rax,(%rsp)
call   1030 <test_fail_message_prefix@plt>
mov    %rbx,%rbp
mov    %rbx,0x18(%rsp)
test   %rbx,%rbx
je     11bd <test_fail_memory_common+0x4d>
mov    0x190(%rsp),%rbp
mov    %r13,%r10
mov    %r13,%r14
test   %r13,%r13
je     11d0 <test_fail_memory_common+0x60>
mov    0x1a0(%rsp),%r14
mov    %r14,%rax
or     %rbp,%rax
je     14bc <test_fail_memory_common+0x34c>
cmp    %r14,%rbp
jne    1206 <test_fail_memory_common+0x96>
cmp    %r10,0x188(%rsp)
je     1214 <test_fail_memory_common+0xa4>
mov    0x188(%rsp),%rdi
mov    %r10,%rsi
mov    %rbp,%rdx
call   1070 <memcmp@plt>
mov    %r13,%r10
test   %rax,%rax
je     1214 <test_fail_memory_common+0xa4>
mov    %r15,%rdi
mov    %r12,%rsi
call   1050 <test_diff_header@plt>
mov    %r13,%r10
test   %r14,%r14
setne  %r15b
test   %rbp,%rbp
setne  %al
movl   $0x0,0xc(%rsp)
jmp    1282 <test_fail_memory_common+0x112>
nopl   0x0(%rax,%rax,1)
lea    0xdc9(%rip),%rdi
mov    0xc(%rsp),%esi
lea    0x30(%rsp),%rdx
xor    %eax,%eax
call   1060 <test_printf_stderr@plt>
mov    0x20(%rsp),%r14
mov    0x28(%rsp),%rax
add    %rax,0x18(%rsp)
mov    0x10(%rsp),%r10
add    %r12,%r10
sub    %rax,%rbp
sub    %r12,%r14
addl   $0x20,0xc(%rsp)
test   %rbp,%rbp
setne  %al
test   %r14,%r14
setne  %r15b
mov    %rbp,%rcx
or     %r14,%rcx
je     1506 <test_fail_memory_common+0x396>
test   $0x1,%al
mov    %r10,0x10(%rsp)
je     12c0 <test_fail_memory_common+0x150>
cmp    $0x20,%rbp
mov    $0x20,%ebx
cmovb  %rbp,%rbx
mov    0x18(%rsp),%rdi
mov    %rbx,%rsi
lea    0x30(%rsp),%rdx
mov    $0x8,%ecx
call   1080 <hex_convert_memory@plt>
mov    0x10(%rsp),%r10
jmp    12c2 <test_fail_memory_common+0x152>
cs nopw 0x0(%rax,%rax,1)
xor    %ebx,%ebx
test   $0x1,%r15b
mov    %rbx,0x28(%rsp)
mov    %r14,0x20(%rsp)
je     13a0 <test_fail_memory_common+0x230>
cmp    $0x20,%r14
mov    $0x20,%r12d
cmovb  %r14,%r12
mov    %r10,%rdi
mov    %r12,%rsi
lea    0xf0(%rsp),%rdx
mov    $0x8,%ecx
call   1080 <hex_convert_memory@plt>
test   %rbx,%rbx
je     13d7 <test_fail_memory_common+0x267>
cmp    %r12,%rbx
mov    %r12,%r11
mov    %r12,%r13
cmovb  %rbx,%r13
lea    -0x1(%r13),%rax
cmp    $0x2,%r13
mov    $0x1,%ecx
cmovb  %rcx,%r13
xor    %r15d,%r15d
xor    %ecx,%ecx
lea    0x90(%rsp),%rdx
mov    $0x20,%r8d
mov    $0x1,%r9d
mov    0x10(%rsp),%r10
mov    0x18(%rsp),%rdi
jmp    1359 <test_fail_memory_common+0x1e9>
nopl   0x0(%rax,%rax,1)
add    $0x1,%rcx
cmp    %rcx,%r13
je     13c0 <test_fail_memory_common+0x250>
movzbl (%rdi,%rcx,1),%ebx
cmp    (%r10,%rcx,1),%bl
mov    $0x5e,%ebx
cmove  %r8d,%ebx
mov    %rdx,%rsi
cmovne %r9d,%r15d
mov    %bl,(%rdx)
mov    %bl,0x1(%rdx)
add    $0x2,%rdx
mov    %ecx,%ebx
not    %ebx
test   $0x7,%bl
jne    1350 <test_fail_memory_common+0x1e0>
cmp    %rcx,%rax
je     1350 <test_fail_memory_common+0x1e0>
movb   $0x20,0x2(%rsi)
add    $0x3,%rsi
mov    %rsi,%rdx
jmp    1350 <test_fail_memory_common+0x1e0>
cs nopw 0x0(%rax,%rax,1)
nop
test   %rbx,%rbx
setne  %al
xor    %r14d,%r14d
xor    %r12d,%r12d
xor    %r13d,%r13d
xor    %r15d,%r15d
jmp    13e7 <test_fail_memory_common+0x277>
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movb   $0x0,(%rdx)
mov    $0x1,%r14b
mov    $0x1,%al
mov    0x28(%rsp),%rbx
mov    %r11,%r12
cmp    %r12,%rbx
je     13f1 <test_fail_memory_common+0x281>
jmp    13fa <test_fail_memory_common+0x28a>
xor    %eax,%eax
mov    $0x1,%r14b
xor    %r13d,%r13d
xor    %r15d,%r15d
mov    0x10(%rsp),%r10
mov    0x18(%rsp),%rdi
cmp    %r12,%rbx
jne    13fa <test_fail_memory_common+0x28a>
test   %r15d,%r15d
je     1230 <test_fail_memory_common+0xc0>
cmpl   $0x0,0xc(%rsp)
jne    140b <test_fail_memory_common+0x29b>
test   %rdi,%rdi
je     1439 <test_fail_memory_common+0x2c9>
test   %rbp,%rbp
je     1439 <test_fail_memory_common+0x2c9>
test   %al,%al
je     142b <test_fail_memory_common+0x2bb>
lea    0xbf4(%rip),%rdi
mov    0xc(%rsp),%esi
lea    0x30(%rsp),%rdx
xor    %eax,%eax
call   1060 <test_printf_stderr@plt>
mov    0x10(%rsp),%r10
cmpl   $0x0,0xc(%rsp)
jne    1455 <test_fail_memory_common+0x2e5>
test   %r10,%r10
jne    144d <test_fail_memory_common+0x2dd>
jmp    1476 <test_fail_memory_common+0x306>
mov    $0x2d,%esi
call   1090 <test_memory_null_empty@plt>
mov    0x10(%rsp),%r10
test   %r10,%r10
je     1476 <test_fail_memory_common+0x306>
cmpq   $0x0,0x20(%rsp)
je     1476 <test_fail_memory_common+0x306>
test   %r14b,%r14b
je     1483 <test_fail_memory_common+0x313>
lea    0xbb3(%rip),%rdi
mov    0xc(%rsp),%esi
lea    0xf0(%rsp),%rdx
xor    %eax,%eax
call   1060 <test_printf_stderr@plt>
jmp    1483 <test_fail_memory_common+0x313>
mov    %r10,%rdi
mov    $0x2b,%esi
call   1090 <test_memory_null_empty@plt>
test   %r15d,%r15d
mov    0x20(%rsp),%r14
je     124c <test_fail_memory_common+0xdc>
test   %r13,%r13
je     124c <test_fail_memory_common+0xdc>
lea    0xb7d(%rip),%rdi
lea    0xb7f(%rip),%rsi
lea    0x90(%rsp),%rdx
xor    %eax,%eax
call   1060 <test_printf_stderr@plt>
jmp    124c <test_fail_memory_common+0xdc>
test   %r10,%r10
sete   %al
mov    0x188(%rsp),%rbp
test   %rbp,%rbp
sete   %cl
xor    %al,%cl
je     14f9 <test_fail_memory_common+0x389>
mov    %r15,%rdi
mov    %r12,%rsi
mov    %r10,%rbx
call   1050 <test_diff_header@plt>
mov    %rbp,%rdi
mov    $0x2d,%esi
call   1090 <test_memory_null_empty@plt>
mov    %rbx,%rdi
mov    $0x2b,%esi
jmp    1501 <test_fail_memory_common+0x391>
mov    %rbp,%rdi
mov    $0x20,%esi
call   1090 <test_memory_null_empty@plt>
xor    %eax,%eax
call   1040 <test_flush_stderr@plt>
add    $0x148,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [10 x i8] c"%04x: %s\0A\00"
@.str.1 = [10 x i8] c"%04x:-%s\0A\00"
@.str.2 = [10 x i8] c"%04x:+%s\0A\00"
@.str.3 = [10 x i8] c"% 4s %s\0A\00"
@.str.4 = [1 x i8] zeroinitializer
define void @test_fail_memory_common(i8* %0, i8* %1, i32 %2, i8* %3, i8* %4, i8* %5, i8* %6, i8* %7, i64 %8, i8* %9, i64 %10) {
%12 = alloca i8*
%13 = alloca i8*
%14 = alloca i32
%15 = alloca i8*
%16 = alloca i8*
%17 = alloca i8*
%18 = alloca i8*
%19 = alloca i8*
%20 = alloca i64
%21 = alloca i8*
%22 = alloca i64
%23 = alloca i64
%24 = alloca [81 x i8]
%25 = alloca [81 x i8]
%26 = alloca i8*
%27 = alloca [81 x i8]
%28 = alloca i64
%29 = alloca i64
%30 = alloca i64
%31 = alloca i32
%32 = alloca i32
%33 = alloca i64
store i8* %0, i8** %12
store i8* %1, i8** %13
store i32 %2, i32* %14
store i8* %3, i8** %15
store i8* %4, i8** %16
store i8* %5, i8** %17
store i8* %6, i8** %18
store i8* %7, i8** %19
store i64 %8, i64* %20
store i8* %9, i8** %21
store i64 %10, i64* %22
store i64 32, i64* %23
store i32 0, i32* %31
%34 = load i8*, i8** %12
%35 = load i8*, i8** %13
%36 = load i32, i32* %14
%37 = load i8*, i8** %15
%38 = load i8*, i8** %16
%39 = load i8*, i8** %17
%40 = load i8*, i8** %18
%41 = call i32 @test_fail_message_prefix(i8* %34, i8* %35, i32 %36, i8* %37, i8* %38, i8* %39, i8* %40)
%42 = load i8*, i8** %19
%43 = icmp eq i8* %42, null
br i1 %43, label %44, label %45
44: ; preds = %11
store i64 0, i64* %20
br label %45
45: ; preds = %44, %11
%46 = load i8*, i8** %21
%47 = icmp eq i8* %46, null
br i1 %47, label %48, label %49
48: ; preds = %45
store i64 0, i64* %22
br label %49
49: ; preds = %48, %45
%50 = load i64, i64* %20
%51 = icmp eq i64 %50, 0
br i1 %51, label %52, label %75
52: ; preds = %49
%53 = load i64, i64* %22
%54 = icmp eq i64 %53, 0
br i1 %54, label %55, label %75
55: ; preds = %52
%56 = load i8*, i8** %19
%57 = icmp eq i8* %56, null
%58 = zext i1 %57 to i32
%59 = load i8*, i8** %21
%60 = icmp eq i8* %59, null
%61 = zext i1 %60 to i32
%62 = icmp eq i32 %58, %61
br i1 %62, label %63, label %66
63: ; preds = %55
%64 = load i8*, i8** %19
%65 = call i32 @test_memory_null_empty(i8* %64, i8 signext 32)
br label %74
66: ; preds = %55
%67 = load i8*, i8** %16
%68 = load i8*, i8** %17
%69 = call i32 @test_diff_header(i8* %67, i8* %68)
%70 = load i8*, i8** %19
%71 = call i32 @test_memory_null_empty(i8* %70, i8 signext 45)
%72 = load i8*, i8** %21
%73 = call i32 @test_memory_null_empty(i8* %72, i8 signext 43)
br label %74
74: ; preds = %66, %63
br label %273
75: ; preds = %52, %49
%76 = load i64, i64* %20
%77 = load i64, i64* %22
%78 = icmp ne i64 %76, %77
br i1 %78, label %89, label %79
79: ; preds = %75
%80 = load i8*, i8** %19
%81 = load i8*, i8** %21
%82 = icmp ne i8* %80, %81
br i1 %82, label %83, label %93
83: ; preds = %79
%84 = load i8*, i8** %19
%85 = load i8*, i8** %21
%86 = load i64, i64* %20
%87 = call i64 @memcmp(i8* %84, i8* %85, i64 %86)
%88 = icmp ne i64 %87, 0
br i1 %88, label %89, label %93
89: ; preds = %83, %75
%90 = load i8*, i8** %16
%91 = load i8*, i8** %17
%92 = call i32 @test_diff_header(i8* %90, i8* %91)
br label %93
93: ; preds = %89, %83, %79
br label %94
94: ; preds = %255, %93
%95 = load i64, i64* %20
%96 = icmp ugt i64 %95, 0
br i1 %96, label %100, label %97
97: ; preds = %94
%98 = load i64, i64* %22
%99 = icmp ugt i64 %98, 0
br label %100
100: ; preds = %97, %94
%101 = phi i1 [ true, %94 ], [ %99, %97 ]
br i1 %101, label %102, label %272
102: ; preds = %100
store i64 0, i64* %29
store i64 0, i64* %28
%103 = load i64, i64* %20
%104 = icmp ugt i64 %103, 0
br i1 %104, label %105, label %117
105: ; preds = %102
%106 = load i64, i64* %20
%107 = icmp ugt i64 %106, 32
br i1 %107, label %108, label %109
108: ; preds = %105
br label %111
109: ; preds = %105
%110 = load i64, i64* %20
br label %111
111: ; preds = %109, %108
%112 = phi i64 [ 32, %108 ], [ %110, %109 ]
store i64 %112, i64* %28
%113 = load i8*, i8** %19
%114 = load i64, i64* %28
%115 = getelementptr inbounds [81 x i8], [81 x i8]* %24, i64 0, i64 0
%116 = call i32 @hex_convert_memory(i8* %113, i64 %114, i8* %115, i32 8)
br label %117
117: ; preds = %111, %102
%118 = load i64, i64* %22
%119 = icmp ugt i64 %118, 0
br i1 %119, label %120, label %132
120: ; preds = %117
%121 = load i64, i64* %22
%122 = icmp ugt i64 %121, 32
br i1 %122, label %123, label %124
123: ; preds = %120
br label %126
124: ; preds = %120
%125 = load i64, i64* %22
br label %126
126: ; preds = %124, %123
%127 = phi i64 [ 32, %123 ], [ %125, %124 ]
store i64 %127, i64* %29
%128 = load i8*, i8** %21
%129 = load i64, i64* %29
%130 = getelementptr inbounds [81 x i8], [81 x i8]* %25, i64 0, i64 0
%131 = call i32 @hex_convert_memory(i8* %128, i64 %129, i8* %130, i32 8)
br label %132
132: ; preds = %126, %117
store i32 0, i32* %32
store i64 0, i64* %30
%133 = getelementptr inbounds [81 x i8], [81 x i8]* %27, i64 0, i64 0
store i8* %133, i8** %26
%134 = load i64, i64* %28
%135 = icmp ugt i64 %134, 0
br i1 %135, label %136, label %194
136: ; preds = %132
%137 = load i64, i64* %29
%138 = icmp ugt i64 %137, 0
br i1 %138, label %139, label %194
139: ; preds = %136
%140 = load i64, i64* %28
%141 = load i64, i64* %29
%142 = icmp ult i64 %140, %141
br i1 %142, label %143, label %145
143: ; preds = %139
%144 = load i64, i64* %28
br label %147
145: ; preds = %139
%146 = load i64, i64* %29
br label %147
147: ; preds = %145, %143
%148 = phi i64 [ %144, %143 ], [ %146, %145 ]
store i64 %148, i64* %33
br label %149
149: ; preds = %188, %147
%150 = load i64, i64* %30
%151 = load i64, i64* %33
%152 = icmp ult i64 %150, %151
br i1 %152, label %153, label %191
153: ; preds = %149
%154 = load i8*, i8** %19
%155 = load i64, i64* %30
%156 = getelementptr inbounds i8, i8* %154, i64 %155
%157 = load i8, i8* %156
%158 = zext i8 %157 to i32
%159 = load i8*, i8** %21
%160 = load i64, i64* %30
%161 = getelementptr inbounds i8, i8* %159, i64 %160
%162 = load i8, i8* %161
%163 = zext i8 %162 to i32
%164 = icmp eq i32 %158, %163
br i1 %164, label %165, label %170
165: ; preds = %153
%166 = load i8*, i8** %26
%167 = getelementptr inbounds i8, i8* %166, i32 1
store i8* %167, i8** %26
store i8 32, i8* %166
%168 = load i8*, i8** %26
%169 = getelementptr inbounds i8, i8* %168, i32 1
store i8* %169, i8** %26
store i8 32, i8* %168
br label %175
170: ; preds = %153
%171 = load i8*, i8** %26
%172 = getelementptr inbounds i8, i8* %171, i32 1
store i8* %172, i8** %26
store i8 94, i8* %171
%173 = load i8*, i8** %26
%174 = getelementptr inbounds i8, i8* %173, i32 1
store i8* %174, i8** %26
store i8 94, i8* %173
store i32 1, i32* %32
br label %175
175: ; preds = %170, %165
%176 = load i64, i64* %30
%177 = urem i64 %176, 8
%178 = icmp eq i64 %177, 7
br i1 %178, label %179, label %187
179: ; preds = %175
%180 = load i64, i64* %30
%181 = load i64, i64* %33
%182 = sub i64 %181, 1
%183 = icmp ne i64 %180, %182
br i1 %183, label %184, label %187
184: ; preds = %179
%185 = load i8*, i8** %26
%186 = getelementptr inbounds i8, i8* %185, i32 1
store i8* %186, i8** %26
store i8 32, i8* %185
br label %187
187: ; preds = %184, %179, %175
br label %188
188: ; preds = %187
%189 = load i64, i64* %30
%190 = add i64 %189, 1
store i64 %190, i64* %30
br label %149
191: ; preds = %149
%192 = load i8*, i8** %26
%193 = getelementptr inbounds i8, i8* %192, i32 1
store i8* %193, i8** %26
store i8 0, i8* %192
br label %194
194: ; preds = %191, %136, %132
%195 = load i64, i64* %28
%196 = load i64, i64* %29
%197 = icmp eq i64 %195, %196
br i1 %197, label %198, label %205
198: ; preds = %194
%199 = load i32, i32* %32
%200 = icmp ne i32 %199, 0
br i1 %200, label %205, label %201
201: ; preds = %198
%202 = load i32, i32* %31
%203 = getelementptr inbounds [81 x i8], [81 x i8]* %24, i64 0, i64 0
%204 = call i32 (i8*, ...) @test_printf_stderr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %202, i8* %203)
br label %255
205: ; preds = %198, %194
%206 = load i32, i32* %31
%207 = icmp eq i32 %206, 0
br i1 %207, label %208, label %217
208: ; preds = %205
%209 = load i8*, i8** %19
%210 = icmp eq i8* %209, null
br i1 %210, label %214, label %211
211: ; preds = %208
%212 = load i64, i64* %20
%213 = icmp eq i64 %212, 0
br i1 %213, label %214, label %217
214: ; preds = %211, %208
%215 = load i8*, i8** %19
%216 = call i32 @test_memory_null_empty(i8* %215, i8 signext 45)
br label %225
217: ; preds = %211, %205
%218 = load i64, i64* %28
%219 = icmp ugt i64 %218, 0
br i1 %219, label %220, label %224
220: ; preds = %217
%221 = load i32, i32* %31
%222 = getelementptr inbounds [81 x i8], [81 x i8]* %24, i64 0, i64 0
%223 = call i32 (i8*, ...) @test_printf_stderr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %221, i8* %222)
br label %224
224: ; preds = %220, %217
br label %225
225: ; preds = %224, %214
%226 = load i32, i32* %31
%227 = icmp eq i32 %226, 0
br i1 %227, label %228, label %237
228: ; preds = %225
%229 = load i8*, i8** %21
%230 = icmp eq i8* %229, null
br i1 %230, label %234, label %231
231: ; preds = %228
%232 = load i64, i64* %22
%233 = icmp eq i64 %232, 0
br i1 %233, label %234, label %237
234: ; preds = %231, %228
%235 = load i8*, i8** %21
%236 = call i32 @test_memory_null_empty(i8* %235, i8 signext 43)
br label %245
237: ; preds = %231, %225
%238 = load i64, i64* %29
%239 = icmp ugt i64 %238, 0
br i1 %239, label %240, label %244
240: ; preds = %237
%241 = load i32, i32* %31
%242 = getelementptr inbounds [81 x i8], [81 x i8]* %25, i64 0, i64 0
%243 = call i32 (i8*, ...) @test_printf_stderr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i32 %241, i8* %242)
br label %244
244: ; preds = %240, %237
br label %245
245: ; preds = %244, %234
%246 = load i32, i32* %32
%247 = icmp ne i32 %246, 0
br i1 %247, label %248, label %254
248: ; preds = %245
%249 = load i64, i64* %30
%250 = icmp ugt i64 %249, 0
br i1 %250, label %251, label %254
251: ; preds = %248
%252 = getelementptr inbounds [81 x i8], [81 x i8]* %27, i64 0, i64 0
%253 = call i32 (i8*, ...) @test_printf_stderr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.4, i64 0, i64 0), i8* %252)
br label %254
254: ; preds = %251, %248, %245
br label %255
255: ; preds = %254, %201
%256 = load i64, i64* %28
%257 = load i8*, i8** %19
%258 = getelementptr inbounds i8, i8* %257, i64 %256
store i8* %258, i8** %19
%259 = load i64, i64* %29
%260 = load i8*, i8** %21
%261 = getelementptr inbounds i8, i8* %260, i64 %259
store i8* %261, i8** %21
%262 = load i64, i64* %28
%263 = load i64, i64* %20
%264 = sub i64 %263, %262
store i64 %264, i64* %20
%265 = load i64, i64* %29
%266 = load i64, i64* %22
%267 = sub i64 %266, %265
store i64 %267, i64* %22
%268 = load i32, i32* %31
%269 = zext i32 %268 to i64
%270 = add i64 %269, 32
%271 = trunc i64 %270 to i32
store i32 %271, i32* %31
br label %94
272: ; preds = %100
br label %273
273: ; preds = %272, %74
%274 = call i32 (...) @test_flush_stderr()
ret void
}

LLVM IR (-O2):
@.str = [10 x i8] c"%04x: %s\0A\00"
@.str.1 = [10 x i8] c"%04x:-%s\0A\00"
@.str.2 = [10 x i8] c"%04x:+%s\0A\00"
@.str.3 = [10 x i8] c"% 4s %s\0A\00"
@.str.4 = [1 x i8] zeroinitializer
define void @test_fail_memory_common(i8* %0, i8* %1, i32 %2, i8* %3, i8* %4, i8* %5, i8* %6, i8* %7, i64 %8, i8* %9, i64 %10) {
%12 = alloca [81 x i8]
%13 = alloca [81 x i8]
%14 = alloca [81 x i8]
%15 = getelementptr inbounds [81 x i8], [81 x i8]* %12, i64 0, i64 0
%16 = getelementptr inbounds [81 x i8], [81 x i8]* %13, i64 0, i64 0
%17 = getelementptr inbounds [81 x i8], [81 x i8]* %14, i64 0, i64 0
%18 = tail call i32 @test_fail_message_prefix(i8* %0, i8* %1, i32 %2, i8* %3, i8* %4, i8* %5, i8* %6)
%19 = icmp eq i8* %7, null
%20 = select i1 %19, i64 0, i64 %8
%21 = icmp eq i8* %9, null
%22 = select i1 %21, i64 0, i64 %10
%23 = or i64 %22, %20
%24 = icmp eq i64 %23, 0
br i1 %24, label %25, label %33
25: ; preds = %11
%26 = xor i1 %19, %21
br i1 %26, label %29, label %27
27: ; preds = %25
%28 = tail call i32 @test_memory_null_empty(i8* %7, i8 signext 32)
br label %141
29: ; preds = %25
%30 = tail call i32 @test_diff_header(i8* %4, i8* %5)
%31 = tail call i32 @test_memory_null_empty(i8* %7, i8 signext 45)
%32 = tail call i32 @test_memory_null_empty(i8* %9, i8 signext 43)
br label %141
33: ; preds = %11
%34 = icmp eq i64 %20, %22
br i1 %34, label %35, label %40
35: ; preds = %33
%36 = icmp eq i8* %7, %9
br i1 %36, label %42, label %37
37: ; preds = %35
%38 = tail call i64 @memcmp(i8* %7, i8* %9, i64 %20)
%39 = icmp eq i64 %38, 0
br i1 %39, label %42, label %40
40: ; preds = %37, %33
%41 = tail call i32 @test_diff_header(i8* %4, i8* %5)
br label %42
42: ; preds = %35, %37, %40
%43 = icmp ne i64 %22, 0
%44 = icmp ne i64 %20, 0
br label %45
45: ; preds = %42, %132
%46 = phi i1 [ %139, %132 ], [ %43, %42 ]
%47 = phi i1 [ %138, %132 ], [ %44, %42 ]
%48 = phi i8* [ %133, %132 ], [ %7, %42 ]
%49 = phi i32 [ %137, %132 ], [ 0, %42 ]
%50 = phi i64 [ %135, %132 ], [ %20, %42 ]
%51 = phi i64 [ %136, %132 ], [ %22, %42 ]
%52 = phi i8* [ %134, %132 ], [ %9, %42 ]
br i1 %47, label %53, label %57
53: ; preds = %45
%54 = icmp ult i64 %50, 32
%55 = select i1 %54, i64 %50, i64 32
%56 = call i32 @hex_convert_memory(i8* %48, i64 %55, i8* %15, i32 8)
br label %57
57: ; preds = %53, %45
%58 = phi i64 [ %55, %53 ], [ 0, %45 ]
br i1 %46, label %61, label %59
59: ; preds = %57
%60 = icmp ne i64 %58, 0
br label %95
61: ; preds = %57
%62 = icmp ult i64 %51, 32
%63 = select i1 %62, i64 %51, i64 32
%64 = call i32 @hex_convert_memory(i8* %52, i64 %63, i8* %16, i32 8)
%65 = icmp eq i64 %58, 0
br i1 %65, label %95, label %66
66: ; preds = %61
%67 = icmp ult i64 %58, %63
%68 = select i1 %67, i64 %58, i64 %63
%69 = add nsw i64 %68, -1
%70 = call i64 @llvm.umax.i64(i64 %68, i64 1)
br label %71
71: ; preds = %66, %90
%72 = phi i32 [ 0, %66 ], [ %81, %90 ]
%73 = phi i64 [ 0, %66 ], [ %92, %90 ]
%74 = phi i8* [ %17, %66 ], [ %91, %90 ]
%75 = getelementptr inbounds i8, i8* %48, i64 %73
%76 = load i8, i8* %75
%77 = getelementptr inbounds i8, i8* %52, i64 %73
%78 = load i8, i8* %77
%79 = icmp eq i8 %76, %78
%80 = select i1 %79, i8 32, i8 94
%81 = select i1 %79, i32 %72, i32 1
store i8 %80, i8* %74
%82 = getelementptr inbounds i8, i8* %74, i64 1
store i8 %80, i8* %82
%83 = getelementptr inbounds i8, i8* %74, i64 2
%84 = and i64 %73, 7
%85 = icmp ne i64 %84, 7
%86 = icmp eq i64 %73, %69
%87 = select i1 %85, i1 true, i1 %86
br i1 %87, label %90, label %88
88: ; preds = %71
%89 = getelementptr inbounds i8, i8* %74, i64 3
store i8 32, i8* %83
br label %90
90: ; preds = %71, %88
%91 = phi i8* [ %89, %88 ], [ %83, %71 ]
%92 = add nuw nsw i64 %73, 1
%93 = icmp eq i64 %92, %70
br i1 %93, label %94, label %71
94: ; preds = %90
store i8 0, i8* %91
br label %95
95: ; preds = %59, %94, %61
%96 = phi i1 [ true, %94 ], [ true, %61 ], [ false, %59 ]
%97 = phi i1 [ true, %94 ], [ false, %61 ], [ %60, %59 ]
%98 = phi i64 [ %63, %94 ], [ %63, %61 ], [ 0, %59 ]
%99 = phi i64 [ %70, %94 ], [ 0, %61 ], [ 0, %59 ]
%100 = phi i32 [ %81, %94 ], [ 0, %61 ], [ 0, %59 ]
%101 = icmp ne i64 %58, %98
%102 = icmp ne i32 %100, 0
%103 = select i1 %101, i1 true, i1 %102
br i1 %103, label %106, label %104
104: ; preds = %95
%105 = call i32 (i8*, ...) @test_printf_stderr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0), i32 %49, i8* %15)
br label %132
106: ; preds = %95
%107 = icmp eq i32 %49, 0
br i1 %107, label %108, label %114
108: ; preds = %106
%109 = icmp eq i8* %48, null
%110 = icmp eq i64 %50, 0
%111 = select i1 %109, i1 true, i1 %110
br i1 %111, label %112, label %114
112: ; preds = %108
%113 = call i32 @test_memory_null_empty(i8* %48, i8 signext 45)
br label %118
114: ; preds = %108, %106
br i1 %97, label %115, label %117
115: ; preds = %114
%116 = call i32 (i8*, ...) @test_printf_stderr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.1, i64 0, i64 0), i32 %49, i8* %15)
br label %117
117: ; preds = %114, %115
br i1 %107, label %118, label %124
118: ; preds = %112, %117
%119 = icmp eq i8* %52, null
%120 = icmp eq i64 %51, 0
%121 = select i1 %119, i1 true, i1 %120
br i1 %121, label %122, label %124
122: ; preds = %118
%123 = call i32 @test_memory_null_empty(i8* %52, i8 signext 43)
br label %127
124: ; preds = %118, %117
br i1 %96, label %125, label %127
125: ; preds = %124
%126 = call i32 (i8*, ...) @test_printf_stderr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0), i32 %49, i8* %16)
br label %127
127: ; preds = %124, %125, %122
%128 = icmp ne i64 %99, 0
%129 = select i1 %102, i1 %128, i1 false
br i1 %129, label %130, label %132
130: ; preds = %127
%131 = call i32 (i8*, ...) @test_printf_stderr(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.4, i64 0, i64 0), i8* %17)
br label %132
132: ; preds = %127, %130, %104
%133 = getelementptr inbounds i8, i8* %48, i64 %58
%134 = getelementptr inbounds i8, i8* %52, i64 %98
%135 = sub i64 %50, %58
%136 = sub i64 %51, %98
%137 = add i32 %49, 32
%138 = icmp ne i64 %135, 0
%139 = icmp ne i64 %136, 0
%140 = select i1 %138, i1 true, i1 %139
br i1 %140, label %45, label %141
141: ; preds = %132, %27, %29
%142 = call i32 (...) @test_flush_stderr()
ret void
}