#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 */
scalar_t__ memcmp(void const *, void const *, size_t);
int /*<<< orphan*/ test_fail_memory_message(int /*<<< orphan*/ *, char const *,
                                            int, char *, char const *,
                                            char const *, char *, void const *,
                                            size_t, void const *, size_t);
int test_mem_ne(const char *file, int line, const char *st1, const char *st2,
                const void *s1, size_t n1, const void *s2, size_t n2) {
  if ((s1 == NULL) ^ (s2 == NULL))
    return 1;
  if (n1 != n2)
    return 1;
  if (s1 == NULL || memcmp(s1, s2, n1) == 0) {
    test_fail_memory_message(NULL, file, line, "memory", st1, st2, "!=", s1, n1,
                             s2, n2);
    return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<test_mem_ne>:
push   %rbp
mov    %rsp,%rbp
push   %r14
push   %rbx
sub    $0x60,%rsp
mov    0x18(%rbp),%rax
mov    0x10(%rbp),%rax
mov    %rdi,-0x20(%rbp)
mov    %esi,-0x24(%rbp)
mov    %rdx,-0x30(%rbp)
mov    %rcx,-0x38(%rbp)
mov    %r8,-0x40(%rbp)
mov    %r9,-0x48(%rbp)
cmpq   $0x0,-0x40(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%eax
cmpq   $0x0,0x10(%rbp)
sete   %cl
and    $0x1,%cl
movzbl %cl,%ecx
xor    %ecx,%eax
cmp    $0x0,%eax
je     117c <test_mem_ne+0x5c>
movl   $0x1,-0x14(%rbp)
jmp    121d <test_mem_ne+0xfd>
mov    -0x48(%rbp),%rax
cmp    0x18(%rbp),%rax
je     1196 <test_mem_ne+0x76>
movl   $0x1,-0x14(%rbp)
jmp    121d <test_mem_ne+0xfd>
cmpq   $0x0,-0x40(%rbp)
je     11bc <test_mem_ne+0x9c>
mov    -0x40(%rbp),%rdi
mov    0x10(%rbp),%rsi
mov    -0x48(%rbp),%rdx
call   1040 <memcmp@plt>
cmp    $0x0,%rax
jne    1216 <test_mem_ne+0xf6>
mov    -0x20(%rbp),%rsi
mov    -0x24(%rbp),%edx
mov    -0x30(%rbp),%r8
mov    -0x38(%rbp),%r9
mov    -0x40(%rbp),%rbx
mov    -0x48(%rbp),%r11
mov    0x10(%rbp),%r10
mov    0x18(%rbp),%rax
xor    %ecx,%ecx
mov    %ecx,%edi
lea    0xe1a(%rip),%rcx
lea    0xe1a(%rip),%r14
mov    %r14,(%rsp)
mov    %rbx,0x8(%rsp)
mov    %r11,0x10(%rsp)
mov    %r10,0x18(%rsp)
mov    %rax,0x20(%rsp)
call   1030 <test_fail_memory_message@plt>
movl   $0x0,-0x14(%rbp)
jmp    121d <test_mem_ne+0xfd>
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0x60,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_mem_ne>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %rcx,%r12
mov    0x50(%rsp),%rbp
test   %r8,%r8
sete   %al
test   %rbp,%rbp
setne  %cl
mov    $0x1,%r14d
cmp    %cl,%al
je     11b8 <test_mem_ne+0x98>
mov    %r9,%r15
cmp    0x58(%rsp),%r9
jne    11b8 <test_mem_ne+0x98>
mov    %r8,%rbx
mov    %rdx,%r13
mov    %esi,%edx
mov    %rdi,%rsi
test   %r8,%r8
je     118b <test_mem_ne+0x6b>
mov    %rbx,%rdi
mov    %rsi,0x10(%rsp)
mov    %rbp,%rsi
mov    %edx,0xc(%rsp)
mov    %r15,%rdx
call   1040 <memcmp@plt>
mov    0x10(%rsp),%rsi
mov    0xc(%rsp),%edx
test   %rax,%rax
jne    11b8 <test_mem_ne+0x98>
sub    $0x8,%rsp
lea    0xe71(%rip),%rax
lea    0xe63(%rip),%rcx
xor    %r14d,%r14d
xor    %edi,%edi
mov    %r13,%r8
mov    %r12,%r9
push   %r15
push   %rbp
push   %r15
push   %rbx
push   %rax
call   1030 <test_fail_memory_message@plt>
add    $0x30,%rsp
mov    %r14d,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [7 x i8] c"memory\00"
@.str.1 = [3 x i8] c"!=\00"
define i32 @test_mem_ne(i8* %0, i32 %1, i8* %2, i8* %3, i8* %4, i64 %5, i8* %6, i64 %7) {
%9 = alloca i32
%10 = alloca i8*
%11 = alloca i32
%12 = alloca i8*
%13 = alloca i8*
%14 = alloca i8*
%15 = alloca i64
%16 = alloca i8*
%17 = alloca i64
store i8* %0, i8** %10
store i32 %1, i32* %11
store i8* %2, i8** %12
store i8* %3, i8** %13
store i8* %4, i8** %14
store i64 %5, i64* %15
store i8* %6, i8** %16
store i64 %7, i64* %17
%18 = load i8*, i8** %14
%19 = icmp eq i8* %18, null
%20 = zext i1 %19 to i32
%21 = load i8*, i8** %16
%22 = icmp eq i8* %21, null
%23 = zext i1 %22 to i32
%24 = xor i32 %20, %23
%25 = icmp ne i32 %24, 0
br i1 %25, label %26, label %27
26: ; preds = %8
store i32 1, i32* %9
br label %52
27: ; preds = %8
%28 = load i64, i64* %15
%29 = load i64, i64* %17
%30 = icmp ne i64 %28, %29
br i1 %30, label %31, label %32
31: ; preds = %27
store i32 1, i32* %9
br label %52
32: ; preds = %27
%33 = load i8*, i8** %14
%34 = icmp eq i8* %33, null
br i1 %34, label %41, label %35
35: ; preds = %32
%36 = load i8*, i8** %14
%37 = load i8*, i8** %16
%38 = load i64, i64* %15
%39 = call i64 @memcmp(i8* %36, i8* %37, i64 %38)
%40 = icmp eq i64 %39, 0
br i1 %40, label %41, label %51
41: ; preds = %35, %32
%42 = load i8*, i8** %10
%43 = load i32, i32* %11
%44 = load i8*, i8** %12
%45 = load i8*, i8** %13
%46 = load i8*, i8** %14
%47 = load i64, i64* %15
%48 = load i8*, i8** %16
%49 = load i64, i64* %17
%50 = call i32 @test_fail_memory_message(i32* null, i8* %42, i32 %43, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %44, i8* %45, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %46, i64 %47, i8* %48, i64 %49)
store i32 0, i32* %9
br label %52
51: ; preds = %35
store i32 1, i32* %9
br label %52
52: ; preds = %51, %41, %31, %26
%53 = load i32, i32* %9
ret i32 %53
}

LLVM IR (-O2):
@.str = [7 x i8] c"memory\00"
@.str.1 = [3 x i8] c"!=\00"
define i32 @test_mem_ne(i8* %0, i32 %1, i8* %2, i8* %3, i8* %4, i64 %5, i8* %6, i64 %7) {
%9 = icmp eq i8* %4, null
%10 = icmp ne i8* %6, null
%11 = xor i1 %9, %10
%12 = icmp eq i64 %5, %7
%13 = and i1 %11, %12
br i1 %13, label %14, label %20
14: ; preds = %8
br i1 %9, label %18, label %15
15: ; preds = %14
%16 = tail call i64 @memcmp(i8* %4, i8* %6, i64 %5)
%17 = icmp eq i64 %16, 0
br i1 %17, label %18, label %20
18: ; preds = %15, %14
%19 = tail call i32 @test_fail_memory_message(i32* null, i8* %0, i32 %1, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %2, i8* %3, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %4, i64 %5, i8* %6, i64 %5)
br label %20
20: ; preds = %15, %8, %18
%21 = phi i32 [ 0, %18 ], [ 1, %8 ], [ 1, %15 ]
ret i32 %21
}