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


x86 assembly (clang, -O0):
<_assertEqualsI>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x4(%rbp)
mov    %esi,-0x8(%rbp)
mov    %rdx,-0x10(%rbp)
mov    %ecx,-0x14(%rbp)
mov    -0x4(%rbp),%eax
cmp    -0x8(%rbp),%eax
jne    114e <_assertEqualsI+0x3e>
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x4(%rbp),%ecx
lea    0xebe(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
jmp    116a <_assertEqualsI+0x5a>
mov    -0x10(%rbp),%rsi
mov    -0x14(%rbp),%edx
mov    -0x8(%rbp),%ecx
mov    -0x4(%rbp),%r8d
lea    0xeb6(%rip),%rdi
mov    $0x0,%al
call   1030 <printf@plt>
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<_assertEqualsI>:
mov    %edi,%r8d
cmp    %esi,%edi
jne    112d <_assertEqualsI+0x1d>
lea    0xee2(%rip),%rdi
mov    %rdx,%rsi
mov    %ecx,%edx
mov    %r8d,%ecx
xor    %eax,%eax
jmp    1030 <printf@plt>
mov    %esi,%eax
lea    0xee3(%rip),%rdi
mov    %rdx,%rsi
mov    %ecx,%edx
mov    %eax,%ecx
xor    %eax,%eax
jmp    1030 <printf@plt>

LLVM IR (-O0):
@.str = [25 x i8] c"%s:%d:\1B[0;32m %d OK\1B[0m\0A\00"
@.str.1 = [42 x i8] c"%s:%d:\1B[0;31m expected %d but got %d\1B[0m\0A\00"
define void @_assertEqualsI(i32 %0, i32 %1, i8* %2, i32 %3) {
%5 = alloca i32
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i32
store i32 %0, i32* %5
store i32 %1, i32* %6
store i8* %2, i8** %7
store i32 %3, i32* %8
%9 = load i32, i32* %5
%10 = load i32, i32* %6
%11 = icmp eq i32 %9, %10
br i1 %11, label %12, label %17
12: ; preds = %4
%13 = load i8*, i8** %7
%14 = load i32, i32* %8
%15 = load i32, i32* %5
%16 = call i32 (i8*, i8*, i32, i32, ...) @printf(i8* getelementptr inbounds ([25 x i8], [25 x i8]* @.str, i64 0, i64 0), i8* %13, i32 %14, i32 %15)
br label %23
17: ; preds = %4
%18 = load i8*, i8** %7
%19 = load i32, i32* %8
%20 = load i32, i32* %6
%21 = load i32, i32* %5
%22 = call i32 (i8*, i8*, i32, i32, ...) @printf(i8* getelementptr inbounds ([42 x i8], [42 x i8]* @.str.1, i64 0, i64 0), i8* %18, i32 %19, i32 %20, i32 %21)
br label %23
23: ; preds = %17, %12
ret void
}

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