#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*/ sprintf(char *, char *, ...);
int /*<<< orphan*/ stic_simple_test_result(int, char *, char const *,
                                           char const *, unsigned int);
scalar_t__ strcmp(char const *, char const *);
void stic_assert_string_equal(const char *expected, const char *actual,
                              const char *function, const char file[],
                              unsigned int line) {
  int comparison;
  char s[100000];
  if ((expected == (char *)0) && (actual == (char *)0)) {
    sprintf(s, "Expected <NULL> but was <NULL>");
    comparison = 1;
  } else if (expected == (char *)0) {
    sprintf(s, "Expected <NULL> but was \"%s\"", actual);
    comparison = 0;
  } else if (actual == (char *)0) {
    sprintf(s, "Expected \"%s\" but was <NULL>", expected);
    comparison = 0;
  } else {
    comparison = strcmp(expected, actual) == 0;
    sprintf(s, "Expected \"%s\" but was \"%s\"", expected, actual);
  }
  stic_simple_test_result(comparison, s, function, file, line);
}


x86 assembly (clang, -O0):
<stic_assert_string_equal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x186d0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1186 <stic_assert_string_equal+0x56>
cmpq   $0x0,-0x10(%rbp)
jne    1186 <stic_assert_string_equal+0x56>
lea    -0x186d0(%rbp),%rdi
lea    0xe8d(%rip),%rsi
mov    $0x0,%al
call   1050 <sprintf@plt>
movl   $0x1,-0x28(%rbp)
jmp    1229 <stic_assert_string_equal+0xf9>
cmpq   $0x0,-0x8(%rbp)
jne    11b6 <stic_assert_string_equal+0x86>
lea    -0x186d0(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xe7c(%rip),%rsi
mov    $0x0,%al
call   1050 <sprintf@plt>
movl   $0x0,-0x28(%rbp)
jmp    1224 <stic_assert_string_equal+0xf4>
cmpq   $0x0,-0x10(%rbp)
jne    11e6 <stic_assert_string_equal+0xb6>
lea    -0x186d0(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xe69(%rip),%rsi
mov    $0x0,%al
call   1050 <sprintf@plt>
movl   $0x0,-0x28(%rbp)
jmp    121f <stic_assert_string_equal+0xef>
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x28(%rbp)
lea    -0x186d0(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    0xe41(%rip),%rsi
mov    $0x0,%al
call   1050 <sprintf@plt>
jmp    1224 <stic_assert_string_equal+0xf4>
jmp    1229 <stic_assert_string_equal+0xf9>
mov    -0x28(%rbp),%edi
lea    -0x186d0(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x24(%rbp),%r8d
call   1040 <stic_simple_test_result@plt>
add    $0x186d0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stic_assert_string_equal>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x186a8,%rsp
mov    %r8d,%r14d
mov    %rcx,%r15
mov    %rdx,%r12
mov    %rdi,%rax
or     %rsi,%rax
jne    1171 <stic_assert_string_equal+0x41>
movups 0xeb6(%rip),%xmm0
movups %xmm0,0xf(%rsp)
movups 0xe9b(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    $0x1,%r13d
jmp    11d8 <stic_assert_string_equal+0xa8>
mov    %rsi,%rbp
mov    %rdi,%rbx
test   %rdi,%rdi
je     11af <stic_assert_string_equal+0x7f>
test   %rbp,%rbp
je     11c1 <stic_assert_string_equal+0x91>
mov    %rbx,%rdi
mov    %rbp,%rsi
call   1030 <strcmp@plt>
xor    %r13d,%r13d
test   %rax,%rax
sete   %r13b
lea    0xebc(%rip),%rsi
mov    %rsp,%rdi
mov    %rbx,%rdx
mov    %rbp,%rcx
xor    %eax,%eax
call   1050 <sprintf@plt>
jmp    11d8 <stic_assert_string_equal+0xa8>
lea    0xe69(%rip),%rsi
xor    %r13d,%r13d
mov    %rsp,%rdi
mov    %rbp,%rdx
jmp    11d1 <stic_assert_string_equal+0xa1>
lea    0xe74(%rip),%rsi
xor    %r13d,%r13d
mov    %rsp,%rdi
mov    %rbx,%rdx
xor    %eax,%eax
call   1050 <sprintf@plt>
mov    %rsp,%rsi
mov    %r13d,%edi
mov    %r12,%rdx
mov    %r15,%rcx
mov    %r14d,%r8d
call   1040 <stic_simple_test_result@plt>
add    $0x186a8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

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

LLVM IR (-O2):
@.str = [31 x i8] c"Expected <NULL> but was <NULL>\00"
@.str.1 = [29 x i8] c"Expected <NULL> but was \22%s\22\00"
@.str.2 = [29 x i8] c"Expected \22%s\22 but was <NULL>\00"
@.str.3 = [27 x i8] c"Expected \22%s\22 but was \22%s\22\00"
define void @stic_assert_string_equal(i8* %0, i8* %1, i8* %2, i8* %3, i32 %4) {
%6 = alloca [100000 x i8]
%7 = getelementptr inbounds [100000 x i8], [100000 x i8]* %6, i64 0, i64 0
%8 = icmp eq i8* %0, null
%9 = icmp eq i8* %1, null
%10 = and i1 %8, %9
br i1 %10, label %11, label %12
11: ; preds = %5
br label %23
12: ; preds = %5
br i1 %8, label %13, label %15
13: ; preds = %12
%14 = call i32 (i8*, i8*, ...) @sprintf(i8* %7, i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), i8* %1)
br label %23
15: ; preds = %12
br i1 %9, label %16, label %18
16: ; preds = %15
%17 = call i32 (i8*, i8*, ...) @sprintf(i8* %7, i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0), i8* %0)
br label %23
18: ; preds = %15
%19 = tail call i64 @strcmp(i8* %0, i8* %1)
%20 = icmp eq i64 %19, 0
%21 = zext i1 %20 to i32
%22 = call i32 (i8*, i8*, ...) @sprintf(i8* %7, i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.3, i64 0, i64 0), i8* %0, i8* %1)
br label %23
23: ; preds = %13, %18, %16, %11
%24 = phi i32 [ 1, %11 ], [ 0, %13 ], [ 0, %16 ], [ %21, %18 ]
%25 = call i32 @stic_simple_test_result(i32 %24, i8* %7, i8* %2, i8* %3, i32 %4)
ret void
}