#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);
scalar_t__ pool_take(int /*<<< orphan*/);
int /*<<< orphan*/ printf(char *, char *, int, char *);
void _ensure_pool_take_gracefully_handles_null_pool(void) {
  if (!(pool_take(0) == 0)) {
    printf("%s:%d - test '%s' failed\n",
           "/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/"
           "2022-01-22/02-19-57/repos/jbrd/libmem/refs/heads/master/src/tests/"
           "pool_tests.c",
           134, "pool_take( 0 ) == 0");
    exit(1);
  };
}


x86 assembly (clang, -O0):
<_ensure_pool_take_gracefully_handles_null_pool>:
push   %rbp
mov    %rsp,%rbp
xor    %edi,%edi
call   1050 <pool_take@plt>
cmp    $0x0,%rax
je     116e <_ensure_pool_take_gracefully_handles_null_pool+0x3e>
lea    0xeb4(%rip),%rdi
lea    0xec7(%rip),%rsi
mov    $0x86,%edx
lea    0xf4a(%rip),%rcx
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>
pop    %rbp
ret

x86 assembly (clang, -O2):
<_ensure_pool_take_gracefully_handles_null_pool>:
push   %rax
xor    %edi,%edi
call   1050 <pool_take@plt>
test   %rax,%rax
jne    113f <_ensure_pool_take_gracefully_handles_null_pool+0xf>
pop    %rax
ret
lea    0xeba(%rip),%rdi
lea    0xecd(%rip),%rsi
lea    0xf55(%rip),%rcx
mov    $0x86,%edx
call   1030 <printf@plt>
mov    $0x1,%edi
call   1040 <exit@plt>

LLVM IR (-O0):
@.str = [26 x i8] c"%s:%d - test '%s' failed\0A\00"
@.str.1 = [143 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/jbrd/libmem/refs/heads/master/src/tests/pool_tests.c\00"
@.str.2 = [20 x i8] c"pool_take( 0 ) == 0\00"
define void @_ensure_pool_take_gracefully_handles_null_pool() {
%1 = call i64 @pool_take(i32 0)
%2 = icmp eq i64 %1, 0
br i1 %2, label %6, label %3
3: ; preds = %0
%4 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([143 x i8], [143 x i8]* @.str.1, i64 0, i64 0), i32 134, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0))
%5 = call i32 @exit(i32 1)
unreachable
6: ; preds = %0
ret void
}

LLVM IR (-O2):
@.str = [26 x i8] c"%s:%d - test '%s' failed\0A\00"
@.str.1 = [143 x i8] c"/scratch/repos/new/home/jordi_armengol_estape/c-scraper/outputs/2022-01-22/02-19-57/repos/jbrd/libmem/refs/heads/master/src/tests/pool_tests.c\00"
@.str.2 = [20 x i8] c"pool_take( 0 ) == 0\00"
define void @_ensure_pool_take_gracefully_handles_null_pool() {
%1 = tail call i64 @pool_take(i32 0)
%2 = icmp eq i64 %1, 0
br i1 %2, label %6, label %3
3: ; preds = %0
%4 = tail call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([143 x i8], [143 x i8]* @.str.1, i64 0, i64 0), i32 134, i8* getelementptr inbounds ([20 x i8], [20 x i8]* @.str.2, i64 0, i64 0))
%5 = tail call i32 @exit(i32 1)
unreachable
6: ; preds = %0
ret void
}