#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 *, ...);
int /*<<< orphan*/ puts(char *);
int expect(char *desc, int expected, int recieved) {
  if (expected != recieved) {
    printf("\033[1;41m");
  }
  printf("%s = %d", desc, recieved);
  if (expected != recieved) {
    printf("\033[0m");
  }
  puts("");
  return expected == recieved;
}


x86 assembly (clang, -O0):
<expect>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %edx,-0x10(%rbp)
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
je     114c <expect+0x2c>
lea    0xebb(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x8(%rbp),%rsi
mov    -0x10(%rbp),%edx
lea    0xeae(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
je     117b <expect+0x5b>
lea    0xe9c(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
lea    0xe8d(%rip),%rdi
call   1030 <puts@plt>
mov    -0xc(%rbp),%eax
cmp    -0x10(%rbp),%eax
sete   %al
and    $0x1,%al
movzbl %al,%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<expect>:
push   %rbp
push   %r15
push   %r14
push   %rbx
push   %rax
mov    %edx,%r15d
mov    %esi,%ebp
mov    %rdi,%r14
cmp    %edx,%esi
jne    1148 <expect+0x28>
lea    0xece(%rip),%rdi
mov    %r14,%rsi
mov    %ebp,%edx
xor    %eax,%eax
call   1040 <printf@plt>
jmp    1178 <expect+0x58>
lea    0xeb1(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xeab(%rip),%rdi
mov    %r14,%rsi
mov    %r15d,%edx
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe9f(%rip),%rdi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %ebx,%ebx
cmp    %r15d,%ebp
sete   %bl
mov    $0xa,%edi
call   1030 <putchar@plt>
mov    %ebx,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [8 x i8] c"\1B[1;41m\00"
@.str.1 = [8 x i8] c"%s = %d\00"
@.str.2 = [5 x i8] c"\1B[0m\00"
@.str.3 = [1 x i8] zeroinitializer
define i32 @expect(i8* %0, i32 %1, i32 %2) {
%4 = alloca i8*
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %4
store i32 %1, i32* %5
store i32 %2, i32* %6
%7 = load i32, i32* %5
%8 = load i32, i32* %6
%9 = icmp ne i32 %7, %8
br i1 %9, label %10, label %12
10: ; preds = %3
%11 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
br label %12
12: ; preds = %10, %3
%13 = load i8*, i8** %4
%14 = load i32, i32* %6
%15 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* %13, i32 %14)
%16 = load i32, i32* %5
%17 = load i32, i32* %6
%18 = icmp ne i32 %16, %17
br i1 %18, label %19, label %21
19: ; preds = %12
%20 = call i32 (i8*, ...) @printf(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
br label %21
21: ; preds = %19, %12
%22 = call i32 @puts(i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.3, i64 0, i64 0))
%23 = load i32, i32* %5
%24 = load i32, i32* %6
%25 = icmp eq i32 %23, %24
%26 = zext i1 %25 to i32
ret i32 %26
}

LLVM IR (-O2):
@.str = [8 x i8] c"\1B[1;41m\00"
@.str.1 = [8 x i8] c"%s = %d\00"
@.str.2 = [5 x i8] c"\1B[0m\00"
define i32 @expect(i8* %0, i32 %1, i32 %2) {
%4 = icmp eq i32 %1, %2
br i1 %4, label %9, label %5
5: ; preds = %3
%6 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str, i64 0, i64 0))
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* %0, i32 %2)
%8 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([5 x i8], [5 x i8]* @.str.2, i64 0, i64 0))
br label %11
9: ; preds = %3
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.1, i64 0, i64 0), i8* %0, i32 %1)
br label %11
11: ; preds = %9, %5
%12 = tail call i32 @putchar(i32 10)
%13 = zext i1 %4 to i32
ret i32 %13
}