#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*/ TESTError_Fail(char *, char const *, int, char const *,
                                  char const *, char const *, char const *);
scalar_t__ strcmp(char const *, char const *);
int AssertEqualStr(const char *a, const char *b, int line, const char *file,
                   const char *function, const char *exp) {
  if (strcmp(a, b) != 0) {
    TESTError_Fail("%s:%d> %s() FAILED: %s was '%s' but should be '%s'\n", file,
                   line, function, exp, a, b);
    return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<AssertEqualStr>:
push   %rbp
mov    %rsp,%rbp
sub    $0x40,%rsp
mov    %rdi,-0x10(%rbp)
mov    %rsi,-0x18(%rbp)
mov    %edx,-0x1c(%rbp)
mov    %rcx,-0x28(%rbp)
mov    %r8,-0x30(%rbp)
mov    %r9,-0x38(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
je     1189 <AssertEqualStr+0x69>
mov    -0x28(%rbp),%rsi
mov    -0x1c(%rbp),%edx
mov    -0x30(%rbp),%rcx
mov    -0x38(%rbp),%r8
mov    -0x10(%rbp),%r9
mov    -0x18(%rbp),%rax
lea    0xe8c(%rip),%rdi
mov    %rax,(%rsp)
call   1040 <TESTError_Fail@plt>
movl   $0x0,-0x4(%rbp)
jmp    1190 <AssertEqualStr+0x70>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x40,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<AssertEqualStr>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
mov    %r9,%r14
mov    %r8,%r15
mov    %rcx,%r12
mov    %edx,%r13d
mov    %rsi,%rbp
mov    %rdi,%rbx
call   1030 <strcmp@plt>
test   %rax,%rax
je     116a <AssertEqualStr+0x4a>
mov    %rbp,(%rsp)
lea    0xeae(%rip),%rdi
mov    %r12,%rsi
mov    %r13d,%edx
mov    %r15,%rcx
mov    %r14,%r8
mov    %rbx,%r9
call   1040 <TESTError_Fail@plt>
xor    %eax,%eax
jmp    116f <AssertEqualStr+0x4f>
mov    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [52 x i8] c"%s:%d> %s() FAILED: %s was '%s' but should be '%s'\0A\00"
define i32 @AssertEqualStr(i8* %0, i8* %1, i32 %2, i8* %3, i8* %4, i8* %5) {
%7 = alloca i32
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i32
%11 = alloca i8*
%12 = alloca i8*
%13 = alloca i8*
store i8* %0, i8** %8
store i8* %1, i8** %9
store i32 %2, i32* %10
store i8* %3, i8** %11
store i8* %4, i8** %12
store i8* %5, i8** %13
%14 = load i8*, i8** %8
%15 = load i8*, i8** %9
%16 = call i64 @strcmp(i8* %14, i8* %15)
%17 = icmp ne i64 %16, 0
br i1 %17, label %18, label %26
18: ; preds = %6
%19 = load i8*, i8** %11
%20 = load i32, i32* %10
%21 = load i8*, i8** %12
%22 = load i8*, i8** %13
%23 = load i8*, i8** %8
%24 = load i8*, i8** %9
%25 = call i32 @TESTError_Fail(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0), i8* %19, i32 %20, i8* %21, i8* %22, i8* %23, i8* %24)
store i32 0, i32* %7
br label %27
26: ; preds = %6
store i32 1, i32* %7
br label %27
27: ; preds = %26, %18
%28 = load i32, i32* %7
ret i32 %28
}

LLVM IR (-O2):
@.str = [52 x i8] c"%s:%d> %s() FAILED: %s was '%s' but should be '%s'\0A\00"
define i32 @AssertEqualStr(i8* %0, i8* %1, i32 %2, i8* %3, i8* %4, i8* %5) {
%7 = tail call i64 @strcmp(i8* %0, i8* %1)
%8 = icmp eq i64 %7, 0
br i1 %8, label %11, label %9
9: ; preds = %6
%10 = tail call i32 @TESTError_Fail(i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str, i64 0, i64 0), i8* %3, i32 %2, i8* %4, i8* %5, i8* %0, i8* %1)
br label %11
11: ; preds = %6, %9
%12 = phi i32 [ 0, %9 ], [ 1, %6 ]
ret i32 %12
}