#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*/ assert(int);
int cbl_freebloc(void *);
int /*<<< orphan*/ cbl_init();
void *cbl_newbloc();
int /*<<< orphan*/ printf(char *, void *, ...);
int main(void) {
  int status;
  cbl_init();
  void *s1 = cbl_newbloc();
  void *s2 = cbl_newbloc();
  void *s3 = cbl_newbloc();
  status = cbl_freebloc(s3);
  assert(status == 1);
  void *s4 = cbl_newbloc();
  void *s5 = cbl_newbloc();
  void *s6 = cbl_newbloc();
  void *s7 = cbl_newbloc();
  status = cbl_freebloc(s7);
  assert(status == 0);
  printf("%p\n%p\n%p\n%p\n%p\n%p\n", s1, s2, s3, s4, s5, s6);
  printf("%p\n", s7);
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x50,%rsp
mov    $0x0,%al
call   1060 <cbl_init@plt>
mov    $0x0,%al
call   1030 <cbl_newbloc@plt>
mov    %rax,-0x10(%rbp)
mov    $0x0,%al
call   1030 <cbl_newbloc@plt>
mov    %rax,-0x18(%rbp)
mov    $0x0,%al
call   1030 <cbl_newbloc@plt>
mov    %rax,-0x20(%rbp)
mov    -0x20(%rbp),%rdi
call   1070 <cbl_freebloc@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x1,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    $0x0,%al
call   1030 <cbl_newbloc@plt>
mov    %rax,-0x28(%rbp)
mov    $0x0,%al
call   1030 <cbl_newbloc@plt>
mov    %rax,-0x30(%rbp)
mov    $0x0,%al
call   1030 <cbl_newbloc@plt>
mov    %rax,-0x38(%rbp)
mov    $0x0,%al
call   1030 <cbl_newbloc@plt>
mov    %rax,-0x40(%rbp)
mov    -0x40(%rbp),%rdi
call   1070 <cbl_freebloc@plt>
mov    %eax,-0x4(%rbp)
cmpl   $0x0,-0x4(%rbp)
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    -0x10(%rbp),%rsi
mov    -0x18(%rbp),%rdx
mov    -0x20(%rbp),%rcx
mov    -0x28(%rbp),%r8
mov    -0x30(%rbp),%r9
mov    -0x38(%rbp),%rax
lea    0xdfb(%rip),%rdi
mov    %rax,(%rsp)
mov    $0x0,%al
call   1040 <printf@plt>
mov    -0x40(%rbp),%rsi
lea    0xdf4(%rip),%rdi
mov    $0x0,%al
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x50,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x18,%rsp
xor    %eax,%eax
call   1060 <cbl_init@plt>
xor    %eax,%eax
call   1030 <cbl_newbloc@plt>
mov    %rax,0x10(%rsp)
xor    %eax,%eax
call   1030 <cbl_newbloc@plt>
mov    %rax,%r15
xor    %eax,%eax
call   1030 <cbl_newbloc@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1070 <cbl_freebloc@plt>
xor    %edi,%edi
cmp    $0x1,%eax
sete   %dil
call   1050 <assert@plt>
xor    %eax,%eax
call   1030 <cbl_newbloc@plt>
mov    %rax,%r12
xor    %eax,%eax
call   1030 <cbl_newbloc@plt>
mov    %rax,%r13
xor    %eax,%eax
call   1030 <cbl_newbloc@plt>
mov    %rax,%r14
xor    %eax,%eax
call   1030 <cbl_newbloc@plt>
mov    %rax,%rbp
mov    %rax,%rdi
call   1070 <cbl_freebloc@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1050 <assert@plt>
mov    %r14,(%rsp)
lea    0xe1d(%rip),%rdi
mov    0x10(%rsp),%rsi
mov    %r15,%rdx
mov    %rbx,%rcx
mov    %r12,%r8
mov    %r13,%r9
xor    %eax,%eax
call   1040 <printf@plt>
lea    0xe0d(%rip),%rdi
mov    %rbp,%rsi
xor    %eax,%eax
call   1040 <printf@plt>
xor    %eax,%eax
add    $0x18,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@.str = [19 x i8] c"%p\0A%p\0A%p\0A%p\0A%p\0A%p\0A\00"
@.str.1 = [4 x i8] c"%p\0A\00"
define i32 @main() {
%1 = alloca i32
%2 = alloca i8*
%3 = alloca i8*
%4 = alloca i8*
%5 = alloca i8*
%6 = alloca i8*
%7 = alloca i8*
%8 = alloca i8*
%9 = call i32 (...) @cbl_init()
%10 = call i8* (...) @cbl_newbloc()
store i8* %10, i8** %2
%11 = call i8* (...) @cbl_newbloc()
store i8* %11, i8** %3
%12 = call i8* (...) @cbl_newbloc()
store i8* %12, i8** %4
%13 = load i8*, i8** %4
%14 = call i32 @cbl_freebloc(i8* %13)
store i32 %14, i32* %1
%15 = load i32, i32* %1
%16 = icmp eq i32 %15, 1
%17 = zext i1 %16 to i32
%18 = call i32 @assert(i32 %17)
%19 = call i8* (...) @cbl_newbloc()
store i8* %19, i8** %5
%20 = call i8* (...) @cbl_newbloc()
store i8* %20, i8** %6
%21 = call i8* (...) @cbl_newbloc()
store i8* %21, i8** %7
%22 = call i8* (...) @cbl_newbloc()
store i8* %22, i8** %8
%23 = load i8*, i8** %8
%24 = call i32 @cbl_freebloc(i8* %23)
store i32 %24, i32* %1
%25 = load i32, i32* %1
%26 = icmp eq i32 %25, 0
%27 = zext i1 %26 to i32
%28 = call i32 @assert(i32 %27)
%29 = load i8*, i8** %2
%30 = load i8*, i8** %3
%31 = load i8*, i8** %4
%32 = load i8*, i8** %5
%33 = load i8*, i8** %6
%34 = load i8*, i8** %7
%35 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %29, i8* %30, i8* %31, i8* %32, i8* %33, i8* %34)
%36 = load i8*, i8** %8
%37 = call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %36)
ret i32 0
}

LLVM IR (-O2):
@.str = [19 x i8] c"%p\0A%p\0A%p\0A%p\0A%p\0A%p\0A\00"
@.str.1 = [4 x i8] c"%p\0A\00"
define i32 @main() {
%1 = tail call i32 (...) @cbl_init()
%2 = tail call i8* (...) @cbl_newbloc()
%3 = tail call i8* (...) @cbl_newbloc()
%4 = tail call i8* (...) @cbl_newbloc()
%5 = tail call i32 @cbl_freebloc(i8* %4)
%6 = icmp eq i32 %5, 1
%7 = zext i1 %6 to i32
%8 = tail call i32 @assert(i32 %7)
%9 = tail call i8* (...) @cbl_newbloc()
%10 = tail call i8* (...) @cbl_newbloc()
%11 = tail call i8* (...) @cbl_newbloc()
%12 = tail call i8* (...) @cbl_newbloc()
%13 = tail call i32 @cbl_freebloc(i8* %12)
%14 = icmp eq i32 %13, 0
%15 = zext i1 %14 to i32
%16 = tail call i32 @assert(i32 %15)
%17 = tail call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([19 x i8], [19 x i8]* @.str, i64 0, i64 0), i8* %2, i8* %3, i8* %4, i8* %9, i8* %10, i8* %11)
%18 = tail call i32 (i8*, i8*, ...) @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0), i8* %12)
ret i32 0
}