#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*/ exit(int);
int /*<<< orphan*/ printf(char *, int, char const *, long, char *, long);
void my_assert_(int line, const char *name, long v, long expect, int is_eq) {
  int ok;
  if (is_eq)
    ok = (v == expect);
  else
    ok = (v != expect);
  if (!ok) {
    printf("%d: '%s' is %lx, need %s%lx\n", line, name, v, is_eq ? "" : "!",
           expect);
    exit(1);
  }
}


x86 assembly (clang, -O0):
<my_assert_>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
mov    %edi,-0x4(%rbp)
mov    %rsi,-0x10(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
mov    %r8d,-0x24(%rbp)
cmpl   $0x0,-0x24(%rbp)
je     115d <my_assert_+0x3d>
mov    -0x18(%rbp),%rax
cmp    -0x20(%rbp),%rax
sete   %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x28(%rbp)
jmp    1170 <my_assert_+0x50>
mov    -0x18(%rbp),%rax
cmp    -0x20(%rbp),%rax
setne  %al
and    $0x1,%al
movzbl %al,%eax
mov    %eax,-0x28(%rbp)
cmpl   $0x0,-0x28(%rbp)
jne    11b7 <my_assert_+0x97>
mov    -0x4(%rbp),%esi
mov    -0x10(%rbp),%rdx
mov    -0x18(%rbp),%rcx
mov    -0x24(%rbp),%edi
lea    0xe8e(%rip),%r8
lea    0xe86(%rip),%rax
cmp    $0x0,%edi
cmovne %rax,%r8
mov    -0x20(%rbp),%r9
lea    0xe58(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<my_assert_>:
mov    %rcx,%r9
mov    %rdx,%rcx
mov    %rsi,%rdx
mov    %edi,%esi
xor    %eax,%eax
xor    %edi,%edi
cmp    %r9,%rcx
sete   %al
setne  %dil
test   %r8d,%r8d
cmove  %edi,%eax
test   %al,%al
je     1144 <my_assert_+0x24>
ret
push   %rax
test   %r8d,%r8d
lea    0xece(%rip),%rax
lea    0xec6(%rip),%r8
cmove  %rax,%r8
lea    0xe9f(%rip),%rdi
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [29 x i8] c"%d: '%s' is %lx, need %s%lx\0A\00"
@.str.1 = [1 x i8] zeroinitializer
@.str.2 = [2 x i8] c"!\00"
define void @my_assert_(i32 %0, i8* %1, i64 %2, i64 %3, i32 %4) {
%6 = alloca i32
%7 = alloca i8*
%8 = alloca i64
%9 = alloca i64
%10 = alloca i32
%11 = alloca i32
store i32 %0, i32* %6
store i8* %1, i8** %7
store i64 %2, i64* %8
store i64 %3, i64* %9
store i32 %4, i32* %10
%12 = load i32, i32* %10
%13 = icmp ne i32 %12, 0
br i1 %13, label %14, label %19
14: ; preds = %5
%15 = load i64, i64* %8
%16 = load i64, i64* %9
%17 = icmp eq i64 %15, %16
%18 = zext i1 %17 to i32
store i32 %18, i32* %11
br label %24
19: ; preds = %5
%20 = load i64, i64* %8
%21 = load i64, i64* %9
%22 = icmp ne i64 %20, %21
%23 = zext i1 %22 to i32
store i32 %23, i32* %11
br label %24
24: ; preds = %19, %14
%25 = load i32, i32* %11
%26 = icmp ne i32 %25, 0
br i1 %26, label %38, label %27
27: ; preds = %24
%28 = load i32, i32* %6
%29 = load i8*, i8** %7
%30 = load i64, i64* %8
%31 = load i32, i32* %10
%32 = icmp ne i32 %31, 0
%33 = zext i1 %32 to i64
%34 = select i1 %32, 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)
%35 = load i64, i64* %9
%36 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %28, i8* %29, i64 %30, i8* %34, i64 %35)
%37 = call i32 @exit(i32 1)
unreachable
38: ; preds = %24
ret void
}

LLVM IR (-O2):
@.str = [29 x i8] c"%d: '%s' is %lx, need %s%lx\0A\00"
@.str.1 = [1 x i8] zeroinitializer
@.str.2 = [2 x i8] c"!\00"
define void @my_assert_(i32 %0, i8* %1, i64 %2, i64 %3, i32 %4) {
%6 = icmp eq i32 %4, 0
%7 = icmp eq i64 %2, %3
%8 = icmp ne i64 %2, %3
%9 = select i1 %6, i1 %8, i1 %7
br i1 %9, label %14, label %10
10: ; preds = %5
%11 = select i1 %6, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0)
%12 = tail call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0), i32 %0, i8* %1, i64 %2, i8* %11, i64 %3)
%13 = tail call i32 @exit(i32 1)
unreachable
14: ; preds = %5
ret void
}