#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*/ fprintf(int /*<<< orphan*/, char *, char const *);
int /*<<< orphan*/ stderr;
int assert_log(int ok, int verbose, const char *info, int *ret) {
  if (!ok) {
    if (verbose && info != NULL) {
      fprintf(stderr, "%s\n", info);
    }
    (*ret) = 0;
    return 0;
  }
  return 1;
}


x86 assembly (clang, -O0):
<assert_log>:
push   %rbp
mov    %rsp,%rbp
sub    $0x20,%rsp
mov    %edi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
mov    %rdx,-0x18(%rbp)
mov    %rcx,-0x20(%rbp)
cmpl   $0x0,-0x8(%rbp)
jne    1174 <assert_log+0x64>
cmpl   $0x0,-0xc(%rbp)
je     115e <assert_log+0x4e>
cmpq   $0x0,-0x18(%rbp)
je     115e <assert_log+0x4e>
mov    0x2e94(%rip),%rax
mov    (%rax),%edi
mov    -0x18(%rbp),%rdx
lea    0xea7(%rip),%rsi
call   1030 <fprintf@plt>
mov    -0x20(%rbp),%rax
movl   $0x0,(%rax)
movl   $0x0,-0x4(%rbp)
jmp    117b <assert_log+0x6b>
movl   $0x1,-0x4(%rbp)
mov    -0x4(%rbp),%eax
add    $0x20,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<assert_log>:
mov    $0x1,%eax
test   %edi,%edi
je     111a <assert_log+0xa>
ret
push   %rbx
mov    %rcx,%rbx
test   %esi,%esi
je     113c <assert_log+0x2c>
test   %rdx,%rdx
je     113c <assert_log+0x2c>
mov    0x2eb2(%rip),%rax
mov    (%rax),%edi
lea    0xec9(%rip),%rsi
call   1030 <fprintf@plt>
movl   $0x0,(%rbx)
xor    %eax,%eax
pop    %rbx
ret

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

LLVM IR (-O2):
@stderr = global i32 0
@.str = [4 x i8] c"%s\0A\00"
define i32 @assert_log(i32 %0, i32 %1, i8* %2, i32* nocapture writeonly %3) {
%5 = icmp eq i32 %0, 0
br i1 %5, label %6, label %14
6: ; preds = %4
%7 = icmp ne i32 %1, 0
%8 = icmp ne i8* %2, null
%9 = and i1 %7, %8
br i1 %9, label %10, label %13
10: ; preds = %6
%11 = load i32, i32* @stderr
%12 = tail call i32 @fprintf(i32 %11, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0), i8* %2)
br label %13
13: ; preds = %10, %6
store i32 0, i32* %3
br label %14
14: ; preds = %4, %13
%15 = phi i32 [ 0, %13 ], [ 1, %4 ]
ret i32 %15
}