#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*/ printf(char *, char *, int, char *, ...);
scalar_t__ strcmp(char *, char *);
void _assertEqualsS(char *actual, char *expected, char *file, int line) {
  if (strcmp(actual, expected) == 0) {
    printf("%s:%d:\033[0;32m '%s' OK\033[0m\n", file, line, actual);
  } else {
    printf("%s:%d:\033[0;31m expected '%s' but got '%s'\033[0m\n", file, line,
           expected, actual);
  }
}


x86 assembly (clang, -O0):
<_assertEqualsS>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %rdi,-0x8(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %ecx,-0x1c(%rbp)
mov    -0x8(%rbp),%rdi
mov    -0x10(%rbp),%rsi
call   1040 <strcmp@plt>
cmp    $0x0,%rax
jne    116c <_assertEqualsS+0x4c>
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
mov    -0x8(%rbp),%rcx
lea    0xea0(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    1189 <_assertEqualsS+0x69>
mov    -0x18(%rbp),%rsi
mov    -0x1c(%rbp),%edx
mov    -0x10(%rbp),%rcx
mov    -0x8(%rbp),%r8
lea    0xe99(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_assertEqualsS>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %ecx,%r14d
mov    %rdx,%r15
mov    %rsi,%rbp
mov    %rdi,%rbx
call   1040 <strcmp@plt>
test   %rax,%rax
je     1161 <_assertEqualsS+0x41>
lea    0xed7(%rip),%rdi
mov    %r15,%rsi
mov    %r14d,%edx
mov    %rbp,%rcx
mov    %rbx,%r8
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <printf@plt>
lea    0xe98(%rip),%rdi
mov    %r15,%rsi
mov    %r14d,%edx
mov    %rbx,%rcx
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [27 x i8] c"%s:%d:\1B[0;32m '%s' OK\1B[0m\0A\00"
@.str.1 = [46 x i8] c"%s:%d:\1B[0;31m expected '%s' but got '%s'\1B[0m\0A\00"
define void @_assertEqualsS(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 = load i8*, i8** %6
%11 = call i64 @strcmp(i8* %9, i8* %10)
%12 = icmp eq i64 %11, 0
br i1 %12, label %13, label %18
13: ; preds = %4
%14 = load i8*, i8** %7
%15 = load i32, i32* %8
%16 = load i8*, i8** %5
%17 = call i32 (i8*, i8*, i32, i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %14, i32 %15, i8* %16)
br label %24
18: ; preds = %4
%19 = load i8*, i8** %7
%20 = load i32, i32* %8
%21 = load i8*, i8** %6
%22 = load i8*, i8** %5
%23 = call i32 (i8*, i8*, i32, i8*, ...) @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.1, i64 0, i64 0), i8* %19, i32 %20, i8* %21, i8* %22)
br label %24
24: ; preds = %18, %13
ret void
}

LLVM IR (-O2):
@.str = [27 x i8] c"%s:%d:\1B[0;32m '%s' OK\1B[0m\0A\00"
@.str.1 = [46 x i8] c"%s:%d:\1B[0;31m expected '%s' but got '%s'\1B[0m\0A\00"
define void @_assertEqualsS(i8* %0, i8* %1, i8* %2, i32 %3) {
%5 = tail call i64 @strcmp(i8* %0, i8* %1)
%6 = icmp eq i64 %5, 0
br i1 %6, label %7, label %9
7: ; preds = %4
%8 = tail call i32 (i8*, i8*, i32, i8*, ...) @printf(i8* getelementptr inbounds ([27 x i8], [27 x i8]* @.str, i64 0, i64 0), i8* %2, i32 %3, i8* %0)
br label %11
9: ; preds = %4
%10 = tail call i32 (i8*, i8*, i32, i8*, ...) @printf(i8* getelementptr inbounds ([46 x i8], [46 x i8]* @.str.1, i64 0, i64 0), i8* %2, i32 %3, i8* %1, i8* %0)
br label %11
11: ; preds = %9, %7
ret void
}