#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 */
struct heap {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ DESCRIBE(char *);
int /*<<< orphan*/ IF(char *);
int /*<<< orphan*/ THEN(char *);
int /*<<< orphan*/ WHEN(char *);
struct heap *heap_create(int);
int /*<<< orphan*/ heap_destroy(struct heap *);
int /*<<< orphan*/ heap_isempty(struct heap *);
int /*<<< orphan*/ isEqual(int /*<<< orphan*/, int);
int /*<<< orphan*/ isNotNull(struct heap *);
void test_create() {
  DESCRIBE("CRIA HEAP");
  WHEN("Eu crio uma HEAP");
  IF("Sem parâmetros");
  THEN("Resultado deve ser ponteiro");
  struct heap *p = heap_create(128);
  isNotNull(p);
  THEN("Deve ser vazia");
  isEqual(heap_isempty(p), 1);
  heap_destroy(p);
}


x86 assembly (clang, -O0):
<test_create>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xe61(%rip),%rdi
call   1070 <DESCRIBE@plt>
lea    0xe5f(%rip),%rdi
call   10b0 <WHEN@plt>
lea    0xe64(%rip),%rdi
call   10a0 <IF@plt>
lea    0xe68(%rip),%rdi
call   1030 <THEN@plt>
mov    $0x80,%edi
call   1060 <heap_create@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1040 <isNotNull@plt>
lea    0xe61(%rip),%rdi
call   1030 <THEN@plt>
mov    -0x8(%rbp),%rdi
call   1050 <heap_isempty@plt>
mov    %eax,%edi
mov    $0x1,%esi
call   1090 <isEqual@plt>
mov    -0x8(%rbp),%rdi
call   1080 <heap_destroy@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_create>:
push   %rbx
lea    0xe68(%rip),%rdi
call   1070 <DESCRIBE@plt>
lea    0xe66(%rip),%rdi
call   10b0 <WHEN@plt>
lea    0xe6b(%rip),%rdi
call   10a0 <IF@plt>
lea    0xe6f(%rip),%rdi
call   1030 <THEN@plt>
mov    $0x80,%edi
call   1060 <heap_create@plt>
mov    %rax,%rbx
mov    %rax,%rdi
call   1040 <isNotNull@plt>
lea    0xe6a(%rip),%rdi
call   1030 <THEN@plt>
mov    %rbx,%rdi
call   1050 <heap_isempty@plt>
mov    %eax,%edi
mov    $0x1,%esi
call   1090 <isEqual@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1080 <heap_destroy@plt>

LLVM IR (-O0):
%struct.heap = type { i32 }
@.str = [10 x i8] c"CRIA HEAP\00"
@.str.1 = [17 x i8] c"Eu crio uma HEAP\00"
@.str.2 = [16 x i8] c"Sem par\C3\A2metros\00"
@.str.3 = [28 x i8] c"Resultado deve ser ponteiro\00"
@.str.4 = [15 x i8] c"Deve ser vazia\00"
define void @test_create() {
%1 = alloca %struct.heap*
%2 = call i32 @DESCRIBE(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%3 = call i32 @WHEN(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
%4 = call i32 @IF(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0))
%5 = call i32 @THEN(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i64 0, i64 0))
%6 = call %struct.heap* @heap_create(i32 128)
store %struct.heap* %6, %struct.heap** %1
%7 = load %struct.heap*, %struct.heap** %1
%8 = call i32 @isNotNull(%struct.heap* %7)
%9 = call i32 @THEN(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0))
%10 = load %struct.heap*, %struct.heap** %1
%11 = call i32 @heap_isempty(%struct.heap* %10)
%12 = call i32 @isEqual(i32 %11, i32 1)
%13 = load %struct.heap*, %struct.heap** %1
%14 = call i32 @heap_destroy(%struct.heap* %13)
ret void
}

LLVM IR (-O2):
%struct.heap = type { i32 }
@.str = [10 x i8] c"CRIA HEAP\00"
@.str.1 = [17 x i8] c"Eu crio uma HEAP\00"
@.str.2 = [16 x i8] c"Sem par\C3\A2metros\00"
@.str.3 = [28 x i8] c"Resultado deve ser ponteiro\00"
@.str.4 = [15 x i8] c"Deve ser vazia\00"
define void @test_create() {
%1 = tail call i32 @DESCRIBE(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str, i64 0, i64 0))
%2 = tail call i32 @WHEN(i8* getelementptr inbounds ([17 x i8], [17 x i8]* @.str.1, i64 0, i64 0))
%3 = tail call i32 @IF(i8* getelementptr inbounds ([16 x i8], [16 x i8]* @.str.2, i64 0, i64 0))
%4 = tail call i32 @THEN(i8* getelementptr inbounds ([28 x i8], [28 x i8]* @.str.3, i64 0, i64 0))
%5 = tail call %struct.heap* @heap_create(i32 128)
%6 = tail call i32 @isNotNull(%struct.heap* %5)
%7 = tail call i32 @THEN(i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.4, i64 0, i64 0))
%8 = tail call i32 @heap_isempty(%struct.heap* %5)
%9 = tail call i32 @isEqual(i32 %8, i32 1)
%10 = tail call i32 @heap_destroy(%struct.heap* %5)
ret void
}