#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 *,
                                           unsigned int);
scalar_t__ strcmp(char const *, char const *);
void stic_assert_string_equal(const char *expected, const char *actual,
                              const char *function, 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, line);
}


x86 assembly (clang, -O0):
<stic_assert_string_equal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x186c0,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
cmpq   $0x0,-0x8(%rbp)
jne    1181 <stic_assert_string_equal+0x51>
cmpq   $0x0,-0x10(%rbp)
jne    1181 <stic_assert_string_equal+0x51>
lea    -0x186c0(%rbp),%rdi
lea    0xe92(%rip),%rsi
mov    $0x0,%al
call   1050 <sprintf@plt>
movl   $0x1,-0x20(%rbp)
jmp    1224 <stic_assert_string_equal+0xf4>
cmpq   $0x0,-0x8(%rbp)
jne    11b1 <stic_assert_string_equal+0x81>
lea    -0x186c0(%rbp),%rdi
mov    -0x10(%rbp),%rdx
lea    0xe81(%rip),%rsi
mov    $0x0,%al
call   1050 <sprintf@plt>
movl   $0x0,-0x20(%rbp)
jmp    121f <stic_assert_string_equal+0xef>
cmpq   $0x0,-0x10(%rbp)
jne    11e1 <stic_assert_string_equal+0xb1>
lea    -0x186c0(%rbp),%rdi
mov    -0x8(%rbp),%rdx
lea    0xe6e(%rip),%rsi
mov    $0x0,%al
call   1050 <sprintf@plt>
movl   $0x0,-0x20(%rbp)
jmp    121a <stic_assert_string_equal+0xea>
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,-0x20(%rbp)
lea    -0x186c0(%rbp),%rdi
mov    -0x8(%rbp),%rdx
mov    -0x10(%rbp),%rcx
lea    0xe46(%rip),%rsi
mov    $0x0,%al
call   1050 <sprintf@plt>
jmp    121f <stic_assert_string_equal+0xef>
jmp    1224 <stic_assert_string_equal+0xf4>
mov    -0x20(%rbp),%edi
lea    -0x186c0(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
call   1040 <stic_simple_test_result@plt>
add    $0x186c0,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<stic_assert_string_equal>:
push   %rbp
push   %r15
push   %r14
push   %r12
push   %rbx
sub    $0x186a0,%rsp
mov    %ecx,%r14d
mov    %rdx,%r15
mov    %rdi,%rax
or     %rsi,%rax
jne    116c <stic_assert_string_equal+0x3c>
movups 0xebb(%rip),%xmm0
movups %xmm0,0xf(%rsp)
movups 0xea0(%rip),%xmm0
movaps %xmm0,(%rsp)
mov    $0x1,%r12d
jmp    11d3 <stic_assert_string_equal+0xa3>
mov    %rsi,%rbx
mov    %rdi,%rbp
test   %rdi,%rdi
je     11aa <stic_assert_string_equal+0x7a>
test   %rbx,%rbx
je     11bc <stic_assert_string_equal+0x8c>
mov    %rbp,%rdi
mov    %rbx,%rsi
call   1030 <strcmp@plt>
xor    %r12d,%r12d
test   %rax,%rax
sete   %r12b
lea    0xec1(%rip),%rsi
mov    %rsp,%rdi
mov    %rbp,%rdx
mov    %rbx,%rcx
xor    %eax,%eax
call   1050 <sprintf@plt>
jmp    11d3 <stic_assert_string_equal+0xa3>
lea    0xe6e(%rip),%rsi
xor    %r12d,%r12d
mov    %rsp,%rdi
mov    %rbx,%rdx
jmp    11cc <stic_assert_string_equal+0x9c>
lea    0xe79(%rip),%rsi
xor    %r12d,%r12d
mov    %rsp,%rdi
mov    %rbp,%rdx
xor    %eax,%eax
call   1050 <sprintf@plt>
mov    %rsp,%rsi
mov    %r12d,%edi
mov    %r15,%rdx
mov    %r14d,%ecx
call   1040 <stic_simple_test_result@plt>
add    $0x186a0,%rsp
pop    %rbx
pop    %r12
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, i32 %3) {
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i32
%9 = alloca i32
%10 = alloca [100000 x i8]
store i8* %0, i8** %5
store i8* %1, i8** %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%11 = load i8*, i8** %5
%12 = icmp eq i8* %11, null
br i1 %12, label %13, label %19
13: ; preds = %4
%14 = load i8*, i8** %6
%15 = icmp eq i8* %14, null
br i1 %15, label %16, label %19
16: ; preds = %13
%17 = getelementptr inbounds [100000 x i8], [100000 x i8]* %10, i64 0, i64 0
%18 = call i32 (i8*, i8*, ...) @sprintf(i8* %17, i8* getelementptr inbounds ([31 x i8], [31 x i8]* @.str, i64 0, i64 0))
store i32 1, i32* %9
br label %45
19: ; preds = %13, %4
%20 = load i8*, i8** %5
%21 = icmp eq i8* %20, null
br i1 %21, label %22, label %26
22: ; preds = %19
%23 = getelementptr inbounds [100000 x i8], [100000 x i8]* %10, i64 0, i64 0
%24 = load i8*, i8** %6
%25 = call i32 (i8*, i8*, ...) @sprintf(i8* %23, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), i8* %24)
store i32 0, i32* %9
br label %44
26: ; preds = %19
%27 = load i8*, i8** %6
%28 = icmp eq i8* %27, null
br i1 %28, label %29, label %33
29: ; preds = %26
%30 = getelementptr inbounds [100000 x i8], [100000 x i8]* %10, i64 0, i64 0
%31 = load i8*, i8** %5
%32 = call i32 (i8*, i8*, ...) @sprintf(i8* %30, i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0), i8* %31)
store i32 0, i32* %9
br label %43
33: ; preds = %26
%34 = load i8*, i8** %5
%35 = load i8*, i8** %6
%36 = call i64 @strcmp(i8* %34, i8* %35)
%37 = icmp eq i64 %36, 0
%38 = zext i1 %37 to i32
store i32 %38, i32* %9
%39 = getelementptr inbounds [100000 x i8], [100000 x i8]* %10, i64 0, i64 0
%40 = load i8*, i8** %5
%41 = load i8*, i8** %6
%42 = call i32 (i8*, i8*, ...) @sprintf(i8* %39, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str.3, i64 0, i64 0), i8* %40, i8* %41)
br label %43
43: ; preds = %33, %29
br label %44
44: ; preds = %43, %22
br label %45
45: ; preds = %44, %16
%46 = load i32, i32* %9
%47 = getelementptr inbounds [100000 x i8], [100000 x i8]* %10, i64 0, i64 0
%48 = load i8*, i8** %7
%49 = load i32, i32* %8
%50 = call i32 @stic_simple_test_result(i32 %46, i8* %47, i8* %48, i32 %49)
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, i32 %3) {
%5 = alloca [100000 x i8]
%6 = getelementptr inbounds [100000 x i8], [100000 x i8]* %5, i64 0, i64 0
%7 = icmp eq i8* %0, null
%8 = icmp eq i8* %1, null
%9 = and i1 %7, %8
br i1 %9, label %10, label %11
10: ; preds = %4
br label %22
11: ; preds = %4
br i1 %7, label %12, label %14
12: ; preds = %11
%13 = call i32 (i8*, i8*, ...) @sprintf(i8* %6, i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.1, i64 0, i64 0), i8* %1)
br label %22
14: ; preds = %11
br i1 %8, label %15, label %17
15: ; preds = %14
%16 = call i32 (i8*, i8*, ...) @sprintf(i8* %6, i8* dereferenceable(1) getelementptr inbounds ([29 x i8], [29 x i8]* @.str.2, i64 0, i64 0), i8* %0)
br label %22
17: ; preds = %14
%18 = tail call i64 @strcmp(i8* %0, i8* %1)
%19 = icmp eq i64 %18, 0
%20 = zext i1 %19 to i32
%21 = call i32 (i8*, i8*, ...) @sprintf(i8* %6, i8* dereferenceable(1) getelementptr inbounds ([27 x i8], [27 x i8]* @.str.3, i64 0, i64 0), i8* %0, i8* %1)
br label %22
22: ; preds = %12, %17, %15, %10
%23 = phi i32 [ 1, %10 ], [ 0, %12 ], [ 0, %15 ], [ %20, %17 ]
%24 = call i32 @stic_simple_test_result(i32 %23, i8* %6, i8* %2, i32 %3)
ret void
}