#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*/ OPENSSL_strnlen(char const *, size_t);
scalar_t__ strncmp(char const *, char const *, size_t);
int /*<<< orphan*/ test_fail_string_message(int /*<<< orphan*/ *, char const *,
                                            int, char *, char const *,
                                            char const *, char *, char const *,
                                            int /*<<< orphan*/, char const *,
                                            int /*<<< orphan*/);
int test_strn_ne(const char *file, int line, const char *st1, const char *st2,
                 const char *s1, const char *s2, size_t len) {
  if ((s1 == NULL) ^ (s2 == NULL))
    return 1;
  if (s1 == NULL || strncmp(s1, s2, len) == 0) {
    test_fail_string_message(NULL, file, line, "string", st1, st2, "!=", s1,
                             s1 == NULL ? 0 : OPENSSL_strnlen(s1, len), s2,
                             s2 == NULL ? 0 : OPENSSL_strnlen(s2, len));
    return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<test_strn_ne>:
push   %rbp
mov    %rsp,%rbp
push   %r14
push   %rbx
sub    $0xa0,%rsp
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,-0x48(%rbp)
sete   %cl
and    $0x1,%cl
movzbl %cl,%ecx
xor    %ecx,%eax
cmp    $0x0,%eax
je     118b <test_strn_ne+0x5b>
movl   $0x1,-0x14(%rbp)
jmp    129d <test_strn_ne+0x16d>
cmpq   $0x0,-0x40(%rbp)
je     11b1 <test_strn_ne+0x81>
mov    -0x40(%rbp),%rdi
mov    -0x48(%rbp),%rsi
mov    0x10(%rbp),%rdx
call   1030 <strncmp@plt>
cmp    $0x0,%rax
jne    1296 <test_strn_ne+0x166>
mov    -0x20(%rbp),%rax
mov    %rax,-0x70(%rbp)
mov    -0x24(%rbp),%eax
mov    %eax,-0x64(%rbp)
mov    -0x30(%rbp),%rax
mov    %rax,-0x60(%rbp)
mov    -0x38(%rbp),%rax
mov    %rax,-0x58(%rbp)
mov    -0x40(%rbp),%rax
mov    %rax,-0x50(%rbp)
cmpq   $0x0,-0x40(%rbp)
jne    11ec <test_strn_ne+0xbc>
xor    %eax,%eax
mov    %eax,-0x74(%rbp)
jmp    11fc <test_strn_ne+0xcc>
mov    -0x40(%rbp),%rdi
mov    0x10(%rbp),%rsi
call   1040 <OPENSSL_strnlen@plt>
mov    %eax,-0x74(%rbp)
mov    -0x74(%rbp),%eax
mov    %eax,-0x84(%rbp)
mov    -0x48(%rbp),%rax
mov    %rax,-0x80(%rbp)
cmpq   $0x0,-0x48(%rbp)
jne    1225 <test_strn_ne+0xf5>
xor    %eax,%eax
mov    %eax,-0x88(%rbp)
jmp    1238 <test_strn_ne+0x108>
mov    -0x48(%rbp),%rdi
mov    0x10(%rbp),%rsi
call   1040 <OPENSSL_strnlen@plt>
mov    %eax,-0x88(%rbp)
mov    -0x80(%rbp),%r10
mov    -0x84(%rbp),%r11d
mov    -0x50(%rbp),%rbx
mov    -0x58(%rbp),%r9
mov    -0x60(%rbp),%r8
mov    -0x64(%rbp),%edx
mov    -0x70(%rbp),%rsi
mov    -0x88(%rbp),%eax
xor    %ecx,%ecx
mov    %ecx,%edi
lea    0xd99(%rip),%rcx
lea    0xd99(%rip),%r14
mov    %r14,(%rsp)
mov    %rbx,0x8(%rsp)
mov    %r11d,0x10(%rsp)
mov    %r10,0x18(%rsp)
mov    %eax,0x20(%rsp)
call   1050 <test_fail_string_message@plt>
movl   $0x0,-0x14(%rbp)
jmp    129d <test_strn_ne+0x16d>
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0xa0,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_strn_ne>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
mov    %r9,%r14
mov    %rcx,%r9
test   %r8,%r8
sete   %al
test   %r14,%r14
sete   %cl
xor    %al,%cl
mov    $0x1,%r15d
jne    11f7 <test_strn_ne+0xc7>
mov    %r8,%rbx
mov    %esi,%r13d
mov    %rdi,%r12
mov    %rdx,0x10(%rsp)
mov    0x50(%rsp),%rcx
xor    %eax,%eax
mov    $0x0,%ebp
test   %r8,%r8
je     11af <test_strn_ne+0x7f>
mov    %r9,0x8(%rsp)
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %rcx,%rbp
mov    %rcx,%rdx
call   1030 <strncmp@plt>
test   %rax,%rax
jne    11f7 <test_strn_ne+0xc7>
mov    %rbx,%rdi
mov    %rbp,%rsi
call   1040 <OPENSSL_strnlen@plt>
mov    %rbp,%rcx
mov    %eax,%ebp
mov    0x8(%rsp),%r9
xor    %eax,%eax
test   %r14,%r14
je     11c5 <test_strn_ne+0x95>
mov    %r14,%rdi
mov    %rcx,%rsi
mov    %r9,%r15
call   1040 <OPENSSL_strnlen@plt>
mov    %r15,%r9
sub    $0x8,%rsp
lea    0xe37(%rip),%r10
lea    0xe29(%rip),%rcx
xor    %r15d,%r15d
xor    %edi,%edi
mov    %r12,%rsi
mov    %r13d,%edx
mov    0x18(%rsp),%r8
push   %rax
push   %r14
push   %rbp
push   %rbx
push   %r10
call   1050 <test_fail_string_message@plt>
add    $0x30,%rsp
mov    %r15d,%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"string\00"
@.str.1 = [3 x i8] c"!=\00"
define i32 @test_strn_ne(i8* %0, i32 %1, i8* %2, i8* %3, i8* %4, i8* %5, i64 %6) {
%8 = alloca i32
%9 = alloca i8*
%10 = alloca i32
%11 = alloca i8*
%12 = alloca i8*
%13 = alloca i8*
%14 = alloca i8*
%15 = alloca i64
store i8* %0, i8** %9
store i32 %1, i32* %10
store i8* %2, i8** %11
store i8* %3, i8** %12
store i8* %4, i8** %13
store i8* %5, i8** %14
store i64 %6, i64* %15
%16 = load i8*, i8** %13
%17 = icmp eq i8* %16, null
%18 = zext i1 %17 to i32
%19 = load i8*, i8** %14
%20 = icmp eq i8* %19, null
%21 = zext i1 %20 to i32
%22 = xor i32 %18, %21
%23 = icmp ne i32 %22, 0
br i1 %23, label %24, label %25
24: ; preds = %7
store i32 1, i32* %8
br label %61
25: ; preds = %7
%26 = load i8*, i8** %13
%27 = icmp eq i8* %26, null
br i1 %27, label %34, label %28
28: ; preds = %25
%29 = load i8*, i8** %13
%30 = load i8*, i8** %14
%31 = load i64, i64* %15
%32 = call i64 @strncmp(i8* %29, i8* %30, i64 %31)
%33 = icmp eq i64 %32, 0
br i1 %33, label %34, label %60
34: ; preds = %28, %25
%35 = load i8*, i8** %9
%36 = load i32, i32* %10
%37 = load i8*, i8** %11
%38 = load i8*, i8** %12
%39 = load i8*, i8** %13
%40 = load i8*, i8** %13
%41 = icmp eq i8* %40, null
br i1 %41, label %42, label %43
42: ; preds = %34
br label %47
43: ; preds = %34
%44 = load i8*, i8** %13
%45 = load i64, i64* %15
%46 = call i32 @OPENSSL_strnlen(i8* %44, i64 %45)
br label %47
47: ; preds = %43, %42
%48 = phi i32 [ 0, %42 ], [ %46, %43 ]
%49 = load i8*, i8** %14
%50 = load i8*, i8** %14
%51 = icmp eq i8* %50, null
br i1 %51, label %52, label %53
52: ; preds = %47
br label %57
53: ; preds = %47
%54 = load i8*, i8** %14
%55 = load i64, i64* %15
%56 = call i32 @OPENSSL_strnlen(i8* %54, i64 %55)
br label %57
57: ; preds = %53, %52
%58 = phi i32 [ 0, %52 ], [ %56, %53 ]
%59 = call i32 @test_fail_string_message(i32* null, i8* %35, i32 %36, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %37, i8* %38, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %39, i32 %48, i8* %49, i32 %58)
store i32 0, i32* %8
br label %61
60: ; preds = %28
store i32 1, i32* %8
br label %61
61: ; preds = %60, %57, %24
%62 = load i32, i32* %8
ret i32 %62
}

LLVM IR (-O2):
@.str = [7 x i8] c"string\00"
@.str.1 = [3 x i8] c"!=\00"
define i32 @test_strn_ne(i8* %0, i32 %1, i8* %2, i8* %3, i8* %4, i8* %5, i64 %6) {
%8 = icmp eq i8* %4, null
%9 = icmp eq i8* %5, null
%10 = xor i1 %8, %9
br i1 %10, label %24, label %11
11: ; preds = %7
br i1 %8, label %17, label %12
12: ; preds = %11
%13 = tail call i64 @strncmp(i8* %4, i8* %5, i64 %6)
%14 = icmp eq i64 %13, 0
br i1 %14, label %15, label %24
15: ; preds = %12
%16 = tail call i32 @OPENSSL_strnlen(i8* %4, i64 %6)
br label %17
17: ; preds = %11, %15
%18 = phi i32 [ %16, %15 ], [ 0, %11 ]
br i1 %9, label %21, label %19
19: ; preds = %17
%20 = tail call i32 @OPENSSL_strnlen(i8* %5, i64 %6)
br label %21
21: ; preds = %17, %19
%22 = phi i32 [ %20, %19 ], [ 0, %17 ]
%23 = tail call i32 @test_fail_string_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, i32 %18, i8* %5, i32 %22)
br label %24
24: ; preds = %12, %7, %21
%25 = phi i32 [ 0, %21 ], [ 1, %7 ], [ 1, %12 ]
ret i32 %25
}