#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 */
char *decode_events(int);
int /*<<< orphan*/ fflush(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, ...);
int /*<<< orphan*/ stdout;
void report(int num, const char *state, int expected, int got) {
  if (expected == got)
    printf("ok %-2d    ", num);
  else
    printf("not ok %-2d", num);
  printf(" state %s: expected %s; got %s\n", state, decode_events(expected),
         decode_events(got));
  fflush(stdout);
}


x86 assembly (clang, -O0):
<report>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %edx,-0x14(%rbp)
mov    %ecx,-0x18(%rbp)
mov    -0x14(%rbp),%eax
cmp    -0x18(%rbp),%eax
jne    1167 <report+0x37>
mov    -0x4(%rbp),%esi
lea    0xea5(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
jmp    1178 <report+0x48>
mov    -0x4(%rbp),%esi
lea    0xe9b(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x10(%rbp),%rax
mov    %rax,-0x28(%rbp)
mov    -0x14(%rbp),%edi
call   1030 <decode_events@plt>
mov    %rax,-0x20(%rbp)
mov    -0x18(%rbp),%edi
call   1030 <decode_events@plt>
mov    -0x28(%rbp),%rsi
mov    -0x20(%rbp),%rdx
mov    %rax,%rcx
lea    0xe72(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
mov    0x2e2c(%rip),%rax
mov    (%rax),%edi
call   1050 <fflush@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<report>:
push   %rbp
push   %r14
push   %rbx
mov    %ecx,%ebx
mov    %edx,%ebp
mov    %rsi,%r14
mov    %edi,%esi
cmp    %ecx,%edx
lea    0xeba(%rip),%rax
lea    0xebf(%rip),%rdi
cmove  %rax,%rdi
xor    %eax,%eax
call   1040 <printf@plt>
mov    %ebp,%edi
call   1030 <decode_events@plt>
mov    %rax,%rbp
mov    %ebx,%edi
call   1030 <decode_events@plt>
lea    0xea8(%rip),%rdi
mov    %r14,%rsi
mov    %rbp,%rdx
mov    %rax,%rcx
xor    %eax,%eax
call   1040 <printf@plt>
mov    0x2e59(%rip),%rax
mov    (%rax),%edi
pop    %rbx
pop    %r14
pop    %rbp
jmp    1050 <fflush@plt>

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

LLVM IR (-O2):
@.str = [12 x i8] c"ok %-2d \00"
@.str.1 = [12 x i8] c"not ok %-2d\00"
@.str.2 = [32 x i8] c" state %s: expected %s; got %s\0A\00"
@stdout = global i32 0
define void @report(i32 %0, i8* %1, i32 %2, i32 %3) {
%5 = icmp eq i32 %2, %3
%6 = select i1 %5, i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([12 x i8], [12 x i8]* @.str.1, i64 0, i64 0)
%7 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) %6, i32 %0)
%8 = tail call i8* @decode_events(i32 %2)
%9 = tail call i8* @decode_events(i32 %3)
%10 = tail call i32 (i8*, ...) @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.2, i64 0, i64 0), i8* %1, i8* %8, i8* %9)
%11 = load i32, i32* @stdout
%12 = tail call i32 @fflush(i32 %11)
ret void
}