#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*/ exit(int);
int /*<<< orphan*/ fprintf(int /*<<< orphan*/, char *, char const *, int,
                           char const *, char const *, char const *,
                           char const *, char const *);
int /*<<< orphan*/ stderr;
void test_fail_str(const char *xstr, const char *x, const char *ystr,
                   const char *y, const char *message, const char *file,
                   int line) {
  if (x == NULL)
    x = "(null)";
  if (y == NULL)
    y = "(null)";
  fprintf(stderr, "%s:%d: FAILED %s\n  got: \"%s\" = %s\n  exp: \"%s\" = %s\n",
          file, line, message, x, xstr, y, ystr);
  exit(1);
}


x86 assembly (clang, -O0):
<test_fail_str>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    0x10(%rbp),%eax
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8,-0x28(%rbp)
mov    %r9,-0x30(%rbp)
cmpq   $0x0,-0x10(%rbp)
jne    1159 <test_fail_str+0x39>
lea    0xeab(%rip),%rax
mov    %rax,-0x10(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    116f <test_fail_str+0x4f>
lea    0xe95(%rip),%rax
mov    %rax,-0x20(%rbp)
mov    0x2e6a(%rip),%rax
mov    (%rax),%edi
mov    -0x30(%rbp),%rdx
mov    0x10(%rbp),%ecx
mov    -0x28(%rbp),%r8
mov    -0x10(%rbp),%r9
mov    -0x8(%rbp),%r11
mov    -0x20(%rbp),%r10
mov    -0x18(%rbp),%rax
lea    0xe6d(%rip),%rsi
mov    %r11,(%rsp)
mov    %r10,0x8(%rsp)
mov    %rax,0x10(%rsp)
call   1030 <fprintf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

x86 assembly (clang, -O2):
<test_fail_str>:
push   %rbx
mov    %rcx,%r11
mov    %rdx,%r10
mov    %rsi,%rax
mov    %rdi,%rbx
mov    0x10(%rsp),%ecx
test   %rsi,%rsi
lea    0xec5(%rip),%rdx
cmove  %rdx,%rax
test   %r11,%r11
cmove  %rdx,%r11
mov    0x2e93(%rip),%rdx
mov    (%rdx),%edi
sub    $0x8,%rsp
lea    0xead(%rip),%rsi
mov    %r9,%rdx
mov    %rax,%r9
push   %r10
push   %r11
push   %rbx
call   1030 <fprintf@plt>
add    $0x20,%rsp
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [7 x i8] c"(null)\00"
@stderr = global i32 0
@.str.1 = [52 x i8] c"%s:%d: FAILED %s\0A got: \22%s\22 = %s\0A exp: \22%s\22 = %s\0A\00"
define void @test_fail_str(i8* %0, i8* %1, i8* %2, i8* %3, i8* %4, i8* %5, i32 %6) {
%8 = alloca i8*
%9 = alloca i8*
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca i8*
%13 = alloca i8*
%14 = alloca i32
store i8* %0, i8** %8
store i8* %1, i8** %9
store i8* %2, i8** %10
store i8* %3, i8** %11
store i8* %4, i8** %12
store i8* %5, i8** %13
store i32 %6, i32* %14
%15 = load i8*, i8** %9
%16 = icmp eq i8* %15, null
br i1 %16, label %17, label %18
17: ; preds = %7
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8** %9
br label %18
18: ; preds = %17, %7
%19 = load i8*, i8** %11
%20 = icmp eq i8* %19, null
br i1 %20, label %21, label %22
21: ; preds = %18
store i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8** %11
br label %22
22: ; preds = %21, %18
%23 = load i32, i32* @stderr
%24 = load i8*, i8** %13
%25 = load i32, i32* %14
%26 = load i8*, i8** %12
%27 = load i8*, i8** %9
%28 = load i8*, i8** %8
%29 = load i8*, i8** %11
%30 = load i8*, i8** %10
%31 = call i32 @fprintf(i32 %23, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.1, i64 0, i64 0), i8* %24, i32 %25, i8* %26, i8* %27, i8* %28, i8* %29, i8* %30)
%32 = call i32 @exit(i32 1)
unreachable
}

LLVM IR (-O2):
@.str = [7 x i8] c"(null)\00"
@stderr = global i32 0
@.str.1 = [52 x i8] c"%s:%d: FAILED %s\0A got: \22%s\22 = %s\0A exp: \22%s\22 = %s\0A\00"
define void @test_fail_str(i8* %0, i8* %1, i8* %2, i8* %3, i8* %4, i8* %5, i32 %6) {
%8 = icmp eq i8* %1, null
%9 = select i1 %8, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %1
%10 = icmp eq i8* %3, null
%11 = select i1 %10, i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str, i64 0, i64 0), i8* %3
%12 = load i32, i32* @stderr
%13 = tail call i32 @fprintf(i32 %12, i8* getelementptr inbounds ([52 x i8], [52 x i8]* @.str.1, i64 0, i64 0), i8* %5, i32 %6, i8* %4, i8* %9, i8* %0, i8* %11, i8* %2)
%14 = tail call i32 @exit(i32 1)
unreachable
}