#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 ic_pvector {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ free(struct ic_pvector *);
int ic_pvector_append(int /*<<< orphan*/, int /*<<< orphan*/);
scalar_t__ ic_pvector_destroy(int /*<<< orphan*/, int /*<<< orphan*/,
                              int /*<<< orphan*/);
scalar_t__ ic_pvector_ensure(int /*<<< orphan*/, int /*<<< orphan*/);
scalar_t__ ic_pvector_get(int /*<<< orphan*/, int /*<<< orphan*/);
scalar_t__ ic_pvector_init(int /*<<< orphan*/, int /*<<< orphan*/);
scalar_t__ ic_pvector_length(int /*<<< orphan*/);
struct ic_pvector *ic_pvector_new(int /*<<< orphan*/);
void abnormal(void) {
  struct ic_pvector *vec = ic_pvector_new(0);
  assert(0 == ic_pvector_init(0, 0));
  assert(0 == ic_pvector_get(0, 0));
  assert(-1 == ic_pvector_append(0, 0));
  assert(0 == ic_pvector_ensure(0, 0));
  assert(0 == ic_pvector_length(0));
  assert(0 == ic_pvector_destroy(0, 0, 0));
  free(vec);
}


x86 assembly (clang, -O0):
<abnormal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %edi,%edi
call   1070 <ic_pvector_new@plt>
mov    %rax,-0x8(%rbp)
xor    %esi,%esi
mov    %esi,%edi
call   1040 <ic_pvector_init@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
xor    %esi,%esi
mov    %esi,%edi
call   1080 <ic_pvector_get@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
xor    %esi,%esi
mov    %esi,%edi
call   10b0 <ic_pvector_append@plt>
mov    %eax,%ecx
mov    $0xffffffff,%eax
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
xor    %esi,%esi
mov    %esi,%edi
call   1060 <ic_pvector_ensure@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
xor    %edi,%edi
call   10a0 <ic_pvector_length@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
xor    %edx,%edx
mov    %edx,%edi
mov    %edx,%esi
call   1090 <ic_pvector_destroy@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1050 <assert@plt>
mov    -0x8(%rbp),%rdi
call   1030 <free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<abnormal>:
push   %rbx
xor    %edi,%edi
call   1070 <ic_pvector_new@plt>
mov    %rax,%rbx
xor    %edi,%edi
xor    %esi,%esi
call   1040 <ic_pvector_init@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1050 <assert@plt>
xor    %edi,%edi
xor    %esi,%esi
call   1080 <ic_pvector_get@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1050 <assert@plt>
xor    %edi,%edi
xor    %esi,%esi
call   10b0 <ic_pvector_append@plt>
xor    %edi,%edi
cmp    $0xffffffff,%eax
sete   %dil
call   1050 <assert@plt>
xor    %edi,%edi
xor    %esi,%esi
call   1060 <ic_pvector_ensure@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1050 <assert@plt>
xor    %edi,%edi
call   10a0 <ic_pvector_length@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1050 <assert@plt>
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
call   1090 <ic_pvector_destroy@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1050 <assert@plt>
mov    %rbx,%rdi
pop    %rbx
jmp    1030 <free@plt>

LLVM IR (-O0):
%struct.ic_pvector = type { i32 }
define void @abnormal() {
%1 = alloca %struct.ic_pvector*
%2 = call %struct.ic_pvector* @ic_pvector_new(i32 0)
store %struct.ic_pvector* %2, %struct.ic_pvector** %1
%3 = call i64 @ic_pvector_init(i32 0, i32 0)
%4 = icmp eq i64 0, %3
%5 = zext i1 %4 to i32
%6 = call i32 @assert(i32 %5)
%7 = call i64 @ic_pvector_get(i32 0, i32 0)
%8 = icmp eq i64 0, %7
%9 = zext i1 %8 to i32
%10 = call i32 @assert(i32 %9)
%11 = call i32 @ic_pvector_append(i32 0, i32 0)
%12 = icmp eq i32 -1, %11
%13 = zext i1 %12 to i32
%14 = call i32 @assert(i32 %13)
%15 = call i64 @ic_pvector_ensure(i32 0, i32 0)
%16 = icmp eq i64 0, %15
%17 = zext i1 %16 to i32
%18 = call i32 @assert(i32 %17)
%19 = call i64 @ic_pvector_length(i32 0)
%20 = icmp eq i64 0, %19
%21 = zext i1 %20 to i32
%22 = call i32 @assert(i32 %21)
%23 = call i64 @ic_pvector_destroy(i32 0, i32 0, i32 0)
%24 = icmp eq i64 0, %23
%25 = zext i1 %24 to i32
%26 = call i32 @assert(i32 %25)
%27 = load %struct.ic_pvector*, %struct.ic_pvector** %1
%28 = call i32 @free(%struct.ic_pvector* %27)
ret void
}

LLVM IR (-O2):
%struct.ic_pvector = type { i32 }
define void @abnormal() {
%1 = tail call %struct.ic_pvector* @ic_pvector_new(i32 0)
%2 = tail call i64 @ic_pvector_init(i32 0, i32 0)
%3 = icmp eq i64 %2, 0
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = tail call i64 @ic_pvector_get(i32 0, i32 0)
%7 = icmp eq i64 %6, 0
%8 = zext i1 %7 to i32
%9 = tail call i32 @assert(i32 %8)
%10 = tail call i32 @ic_pvector_append(i32 0, i32 0)
%11 = icmp eq i32 %10, -1
%12 = zext i1 %11 to i32
%13 = tail call i32 @assert(i32 %12)
%14 = tail call i64 @ic_pvector_ensure(i32 0, i32 0)
%15 = icmp eq i64 %14, 0
%16 = zext i1 %15 to i32
%17 = tail call i32 @assert(i32 %16)
%18 = tail call i64 @ic_pvector_length(i32 0)
%19 = icmp eq i64 %18, 0
%20 = zext i1 %19 to i32
%21 = tail call i32 @assert(i32 %20)
%22 = tail call i64 @ic_pvector_destroy(i32 0, i32 0, i32 0)
%23 = icmp eq i64 %22, 0
%24 = zext i1 %23 to i32
%25 = tail call i32 @assert(i32 %24)
%26 = tail call i32 @free(%struct.ic_pvector* %1)
ret void
}