#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 *);
int /*<<< orphan*/ stderr;
scalar_t__ strcmp(char const *, char const *);
void assert_strcmp(const char *actual, const char *expected, const char *file,
                   int line) {
  if (!actual || strcmp(expected, actual)) {
    fprintf(stderr, "%s:%d expected %s, got %s\n", file, line, expected,
            actual);
    exit(1);
  }
}


x86 assembly (clang, -O0):
<assert_strcmp>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
cmpq   $0x0,-0x8(%rbp)
je     1169 <assert_strcmp+0x39>
mov    -0x10(%rbp),%rdi
mov    -0x8(%rbp),%rsi
call   1030 <strcmp@plt>
cmp    $0x0,%rax
je     1197 <assert_strcmp+0x67>
mov    0x2e70(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%rdx
mov    -0x1c(%rbp),%ecx
mov    -0x10(%rbp),%r8
mov    -0x8(%rbp),%r9
lea    0xe78(%rip),%rsi
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<assert_strcmp>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %ecx,%r14d
mov    %rdx,%r15
mov    %rsi,%rbp
mov    %rdi,%rbx
test   %rdi,%rdi
je     1163 <assert_strcmp+0x33>
mov    %rbp,%rdi
mov    %rbx,%rsi
call   1030 <strcmp@plt>
test   %rax,%rax
jne    1163 <assert_strcmp+0x33>
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret
mov    0x2e76(%rip),%rax
mov    (%rax),%edi
lea    0xe8d(%rip),%rsi
mov    %r15,%rdx
mov    %r14d,%ecx
mov    %rbp,%r8
mov    %rbx,%r9
call   1040 <fprintf@plt>
mov    $0x1,%edi
call   1050 <exit@plt>

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [27 x i8] c"%s:%d expected %s, got %s\0A\00"
define void @assert_strcmp(i8* %0, i8* %1, i8* %2, i32 %3) {
%5 = icmp eq i8* %0, null
br i1 %5, label %9, label %6
6: ; preds = %4
%7 = tail call i64 @strcmp(i8* %1, i8* %0)
%8 = icmp eq i64 %7, 0
br i1 %8, label %13, label %9
9: ; preds = %6, %4
%10 = load i32, i32* @stderr
%11 = tail call i32 @fprintf(i32 %10, i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %2, i32 %3, i8* %1, i8* %0)
%12 = tail call i32 @exit(i32 1)
unreachable
13: ; preds = %6
ret void
}