#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 */
typedef int /*<<< orphan*/ FILE;

/* Variables and functions */
int /*<<< orphan*/ fprintf(int /*<<< orphan*/ *, char *, char *, char *, long,
                           long, char *, char *, char const *, int);
int /*<<< orphan*/ *stderr;
int echeck_long_m(FILE *err, const char *func, const char *file, int line,
                  long actual, long expected, const char *msg) {
  if (expected == actual) {
    return 0;
  }
  if (err == NULL) {
    err = stderr;
  }
  fprintf(err, "FAIL: %s%sExpected %ld but was %ld [%s%s%s:%d]\n",
          (msg == NULL) ? "" : msg, (msg == NULL) ? "" : " ", expected, actual,
          (func == NULL) ? "" : func, (func == NULL) ? "" : " at ", file, line);
  return 1;
}


x86 assembly (clang, -O0):
<echeck_long_m>:
push   %rbp
mov    %rsp,%rbp
push   %rbx
sub    $0x98,%rsp
mov    0x10(%rbp),%rax
mov    %rdi,-0x18(%rbp)
mov    %rsi,-0x20(%rbp)
mov    %rdx,-0x28(%rbp)
mov    %ecx,-0x2c(%rbp)
mov    %r8,-0x38(%rbp)
mov    %r9,-0x40(%rbp)
mov    -0x40(%rbp),%rax
cmp    -0x38(%rbp),%rax
jne    1151 <echeck_long_m+0x41>
movl   $0x0,-0xc(%rbp)
jmp    124c <echeck_long_m+0x13c>
cmpq   $0x0,-0x18(%rbp)
jne    116a <echeck_long_m+0x5a>
mov    0x2e7d(%rip),%rax
mov    (%rax),%rax
mov    %rax,-0x18(%rbp)
mov    -0x18(%rbp),%rax
mov    %rax,-0x48(%rbp)
cmpq   $0x0,0x10(%rbp)
jne    118d <echeck_long_m+0x7d>
lea    0xeab(%rip),%rax
mov    %rax,-0x50(%rbp)
jmp    1195 <echeck_long_m+0x85>
mov    0x10(%rbp),%rax
mov    %rax,-0x50(%rbp)
mov    -0x50(%rbp),%rax
mov    %rax,-0x70(%rbp)
mov    0x10(%rbp),%rdx
lea    0xe8b(%rip),%rax
lea    0xe80(%rip),%rcx
cmp    $0x0,%rdx
cmove  %rcx,%rax
mov    %rax,-0x68(%rbp)
mov    -0x40(%rbp),%rax
mov    %rax,-0x60(%rbp)
mov    -0x38(%rbp),%rax
mov    %rax,-0x58(%rbp)
cmpq   $0x0,-0x20(%rbp)
jne    11e6 <echeck_long_m+0xd6>
lea    0xe52(%rip),%rax
mov    %rax,-0x78(%rbp)
jmp    11ee <echeck_long_m+0xde>
mov    -0x20(%rbp),%rax
mov    %rax,-0x78(%rbp)
mov    -0x58(%rbp),%r9
mov    -0x60(%rbp),%r8
mov    -0x68(%rbp),%rcx
mov    -0x70(%rbp),%rdx
mov    -0x48(%rbp),%rdi
mov    -0x78(%rbp),%rbx
mov    -0x20(%rbp),%rsi
lea    0xe1f(%rip),%r11
lea    0xe17(%rip),%rax
cmp    $0x0,%rsi
cmove  %rax,%r11
mov    -0x28(%rbp),%r10
mov    -0x2c(%rbp),%eax
lea    0xdd2(%rip),%rsi
mov    %rbx,(%rsp)
mov    %r11,0x8(%rsp)
mov    %r10,0x10(%rsp)
mov    %eax,0x18(%rsp)
call   1030 <fprintf@plt>
movl   $0x1,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x98,%rsp
pop    %rbx
pop    %rbp
ret

x86 assembly (clang, -O2):
<echeck_long_m>:
xor    %eax,%eax
cmp    %r8,%r9
je     118e <echeck_long_m+0x7e>
push   %r14
push   %rbx
push   %rax
mov    %r8,%r14
mov    %ecx,%r11d
mov    %rdx,%r10
mov    %rsi,%rbx
mov    0x20(%rsp),%rdx
test   %rdi,%rdi
jne    113b <echeck_long_m+0x2b>
mov    0x2ea8(%rip),%rax
mov    (%rax),%rdi
test   %rdx,%rdx
lea    0xeea(%rip),%rsi
cmove  %rsi,%rdx
lea    0xee3(%rip),%rcx
cmove  %rsi,%rcx
test   %rbx,%rbx
cmove  %rsi,%rbx
lea    0xece(%rip),%rax
cmove  %rsi,%rax
lea    0xe93(%rip),%rsi
mov    %r9,%r8
mov    %r14,%r9
push   %r11
push   %r10
push   %rax
push   %rbx
call   1030 <fprintf@plt>
add    $0x20,%rsp
mov    $0x1,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
@stderr = global i32* null
@.str = [48 x i8] c"FAIL: %s%sExpected %ld but was %ld [%s%s%s:%d]\0A\00"
@.str.1 = [1 x i8] zeroinitializer
@.str.2 = [2 x i8] c" \00"
@.str.3 = [5 x i8] c" at \00"
define i32 @echeck_long_m(i32* %0, i8* %1, i8* %2, i32 %3, i64 %4, i64 %5, i8* %6) {
%8 = alloca i32
%9 = alloca i32*
%10 = alloca i8*
%11 = alloca i8*
%12 = alloca i32
%13 = alloca i64
%14 = alloca i64
%15 = alloca i8*
store i32* %0, i32** %9
store i8* %1, i8** %10
store i8* %2, i8** %11
store i32 %3, i32* %12
store i64 %4, i64* %13
store i64 %5, i64* %14
store i8* %6, i8** %15
%16 = load i64, i64* %14
%17 = load i64, i64* %13
%18 = icmp eq i64 %16, %17
br i1 %18, label %19, label %20
19: ; preds = %7
store i32 0, i32* %8
br label %54
20: ; preds = %7
%21 = load i32*, i32** %9
%22 = icmp eq i32* %21, null
br i1 %22, label %23, label %25
23: ; preds = %20
%24 = load i32*, i32** @stderr
store i32* %24, i32** %9
br label %25
25: ; preds = %23, %20
%26 = load i32*, i32** %9
%27 = load i8*, i8** %15
%28 = icmp eq i8* %27, null
br i1 %28, label %29, label %30
29: ; preds = %25
br label %32
30: ; preds = %25
%31 = load i8*, i8** %15
br label %32
32: ; preds = %30, %29
%33 = phi i8* [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), %29 ], [ %31, %30 ]
%34 = load i8*, i8** %15
%35 = icmp eq i8* %34, null
%36 = zext i1 %35 to i64
%37 = select i1 %35, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0)
%38 = load i64, i64* %14
%39 = load i64, i64* %13
%40 = load i8*, i8** %10
%41 = icmp eq i8* %40, null
br i1 %41, label %42, label %43
42: ; preds = %32
br label %45
43: ; preds = %32
%44 = load i8*, i8** %10
br label %45
45: ; preds = %43, %42
%46 = phi i8* [ getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), %42 ], [ %44, %43 ]
%47 = load i8*, i8** %10
%48 = icmp eq i8* %47, null
%49 = zext i1 %48 to i64
%50 = select i1 %48, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0)
%51 = load i8*, i8** %11
%52 = load i32, i32* %12
%53 = call i32 @fprintf(i32* %26, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i8* %33, i8* %37, i64 %38, i64 %39, i8* %46, i8* %50, i8* %51, i32 %52)
store i32 1, i32* %8
br label %54
54: ; preds = %45, %19
%55 = load i32, i32* %8
ret i32 %55
}

LLVM IR (-O2):
@stderr = global i32* null
@.str = [48 x i8] c"FAIL: %s%sExpected %ld but was %ld [%s%s%s:%d]\0A\00"
@.str.1 = [1 x i8] zeroinitializer
@.str.2 = [2 x i8] c" \00"
@.str.3 = [5 x i8] c" at \00"
define i32 @echeck_long_m(i32* %0, i8* %1, i8* %2, i32 %3, i64 %4, i64 %5, i8* %6) {
%8 = icmp eq i64 %5, %4
br i1 %8, label %20, label %9
9: ; preds = %7
%10 = icmp eq i32* %0, null
%11 = load i32*, i32** @stderr
%12 = select i1 %10, i32* %11, i32* %0
%13 = icmp eq i8* %6, null
%14 = select i1 %13, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8* %6
%15 = select i1 %13, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0)
%16 = icmp eq i8* %1, null
%17 = select i1 %16, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8* %1
%18 = select i1 %16, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.3, i64 0, i64 0)
%19 = tail call i32 @fprintf(i32* %12, i8* getelementptr inbounds ([48 x i8], [48 x i8]* @.str, i64 0, i64 0), i8* %14, i8* %15, i64 %5, i64 %4, i8* %17, i8* %18, i8* %2, i32 %3)
br label %20
20: ; preds = %7, %9
%21 = phi i32 [ 1, %9 ], [ 0, %7 ]
ret i32 %21
}