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


x86 assembly (clang, -O0):
<test_str_ne>:
push   %rbp
mov    %rsp,%rbp
push   %r14
push   %rbx
sub    $0xa0,%rsp
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     1187 <test_str_ne+0x57>
movl   $0x1,-0x14(%rbp)
jmp    128d <test_str_ne+0x15d>
cmpq   $0x0,-0x40(%rbp)
je     11a9 <test_str_ne+0x79>
mov    -0x40(%rbp),%rdi
mov    -0x48(%rbp),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    1286 <test_str_ne+0x156>
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    11e4 <test_str_ne+0xb4>
xor    %eax,%eax
mov    %eax,-0x74(%rbp)
jmp    11f0 <test_str_ne+0xc0>
mov    -0x40(%rbp),%rdi
call   1030 <strlen@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    1219 <test_str_ne+0xe9>
xor    %eax,%eax
mov    %eax,-0x88(%rbp)
jmp    1228 <test_str_ne+0xf8>
mov    -0x48(%rbp),%rdi
call   1030 <strlen@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    0xda9(%rip),%rcx
lea    0xda9(%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    128d <test_str_ne+0x15d>
movl   $0x1,-0x14(%rbp)
mov    -0x14(%rbp),%eax
add    $0xa0,%rsp
pop    %rbx
pop    %r14
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_str_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    11e3 <test_str_ne+0xb3>
mov    %r8,%rbx
mov    %esi,%r13d
mov    %rdi,%r12
mov    %rdx,0x10(%rsp)
xor    %eax,%eax
mov    $0x0,%ebp
test   %r8,%r8
je     119e <test_str_ne+0x6e>
mov    %r9,0x8(%rsp)
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <strcmp@plt>
test   %rax,%rax
jne    11e3 <test_str_ne+0xb3>
mov    %rbx,%rdi
call   1030 <strlen@plt>
mov    %eax,%ebp
mov    0x8(%rsp),%r9
xor    %eax,%eax
test   %r14,%r14
je     11b1 <test_str_ne+0x81>
mov    %r14,%rdi
mov    %r9,%r15
call   1030 <strlen@plt>
mov    %r15,%r9
sub    $0x8,%rsp
lea    0xe4b(%rip),%r10
lea    0xe3d(%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_str_ne(i8* %0, i32 %1, i8* %2, i8* %3, i8* %4, i8* %5) {
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i32
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca i8*
%13 = alloca i8*
store i8* %0, i8** %8
store i32 %1, i32* %9
store i8* %2, i8** %10
store i8* %3, i8** %11
store i8* %4, i8** %12
store i8* %5, i8** %13
%14 = load i8*, i8** %12
%15 = icmp eq i8* %14, null
%16 = zext i1 %15 to i32
%17 = load i8*, i8** %13
%18 = icmp eq i8* %17, null
%19 = zext i1 %18 to i32
%20 = xor i32 %16, %19
%21 = icmp ne i32 %20, 0
br i1 %21, label %22, label %23
22: ; preds = %6
store i32 1, i32* %7
br label %56
23: ; preds = %6
%24 = load i8*, i8** %12
%25 = icmp eq i8* %24, null
br i1 %25, label %31, label %26
26: ; preds = %23
%27 = load i8*, i8** %12
%28 = load i8*, i8** %13
%29 = call i64 @strcmp(i8* %27, i8* %28)
%30 = icmp eq i64 %29, 0
br i1 %30, label %31, label %55
31: ; preds = %26, %23
%32 = load i8*, i8** %8
%33 = load i32, i32* %9
%34 = load i8*, i8** %10
%35 = load i8*, i8** %11
%36 = load i8*, i8** %12
%37 = load i8*, i8** %12
%38 = icmp eq i8* %37, null
br i1 %38, label %39, label %40
39: ; preds = %31
br label %43
40: ; preds = %31
%41 = load i8*, i8** %12
%42 = call i32 @strlen(i8* %41)
br label %43
43: ; preds = %40, %39
%44 = phi i32 [ 0, %39 ], [ %42, %40 ]
%45 = load i8*, i8** %13
%46 = load i8*, i8** %13
%47 = icmp eq i8* %46, null
br i1 %47, label %48, label %49
48: ; preds = %43
br label %52
49: ; preds = %43
%50 = load i8*, i8** %13
%51 = call i32 @strlen(i8* %50)
br label %52
52: ; preds = %49, %48
%53 = phi i32 [ 0, %48 ], [ %51, %49 ]
%54 = call i32 @test_fail_string_message(i32* null, i8* %32, i32 %33, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %34, i8* %35, i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.1, i64 0, i64 0), i8* %36, i32 %44, i8* %45, i32 %53)
store i32 0, i32* %7
br label %56
55: ; preds = %26
store i32 1, i32* %7
br label %56
56: ; preds = %55, %52, %22
%57 = load i32, i32* %7
ret i32 %57
}

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