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

/* Variables and functions */
int /*<<< orphan*/ assert(int);
scalar_t__ ic_string_append(struct ic_string *, int /*<<< orphan*/);
scalar_t__ ic_string_append_char(struct ic_string *, int /*<<< orphan*/,
                                 int /*<<< orphan*/);
scalar_t__ ic_string_append_symbol(struct ic_string *, int /*<<< orphan*/);
scalar_t__ ic_string_contents(int /*<<< orphan*/);
int ic_string_destroy(struct ic_string *, int);
scalar_t__ ic_string_get(int /*<<< orphan*/, int /*<<< orphan*/);
scalar_t__ ic_string_init(int /*<<< orphan*/, int /*<<< orphan*/,
                          int /*<<< orphan*/);
scalar_t__ ic_string_init_empty(int /*<<< orphan*/);
int ic_string_length(int /*<<< orphan*/);
struct ic_string *ic_string_new(char *, int);
scalar_t__ ic_string_set(struct ic_string *, int, char);
void abnormal(void) {
  struct ic_string *str = ic_string_new("hello", 5);
  assert(0 == ic_string_init(0, 0, 0));
  assert(0 == ic_string_init_empty(0));
  assert(0 == ic_string_contents(0));
  assert(0 == ic_string_get(0, 0));
  assert(0 == ic_string_set(0, 0, 0));
  assert(-1 == ic_string_length(0));
  assert(0 == ic_string_append(0, 0));
  assert(0 == ic_string_append_char(0, 0, 0));
  assert(0 == ic_string_append_symbol(0, 0));
  assert(0 == ic_string_destroy(0, 0));
  assert(0 == ic_string_append(str, 0));
  assert(0 == ic_string_append_char(str, 0, 0));
  assert(0 == ic_string_append_symbol(str, 0));
  assert(0 == ic_string_set(str, 5, 'c'));
  assert(0 == ic_string_set(str, 0, '\0'));
  assert(1 == ic_string_destroy(str, 1));
}


x86 assembly (clang, -O0):
<abnormal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xe31(%rip),%rdi
mov    $0x5,%esi
call   10e0 <ic_string_new@plt>
mov    %rax,-0x8(%rbp)
xor    %edx,%edx
mov    %edx,%edi
mov    %edx,%esi
call   1050 <ic_string_init@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1080 <assert@plt>
xor    %edi,%edi
call   10a0 <ic_string_init_empty@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1080 <assert@plt>
xor    %edi,%edi
call   1070 <ic_string_contents@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1080 <assert@plt>
xor    %esi,%esi
mov    %esi,%edi
call   1060 <ic_string_get@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1080 <assert@plt>
xor    %eax,%eax
mov    %eax,%edi
xor    %edx,%edx
mov    %edx,%esi
call   10c0 <ic_string_set@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1080 <assert@plt>
xor    %edi,%edi
call   10d0 <ic_string_length@plt>
mov    %eax,%ecx
mov    $0xffffffff,%eax
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1080 <assert@plt>
xor    %eax,%eax
mov    %eax,%edi
xor    %esi,%esi
call   1090 <ic_string_append@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1080 <assert@plt>
xor    %eax,%eax
mov    %eax,%edi
xor    %edx,%edx
mov    %edx,%esi
call   1040 <ic_string_append_char@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1080 <assert@plt>
xor    %eax,%eax
mov    %eax,%edi
xor    %esi,%esi
call   10b0 <ic_string_append_symbol@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1080 <assert@plt>
xor    %eax,%eax
mov    %eax,%edi
xor    %esi,%esi
call   1030 <ic_string_destroy@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1080 <assert@plt>
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
call   1090 <ic_string_append@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1080 <assert@plt>
mov    -0x8(%rbp),%rdi
xor    %edx,%edx
mov    %edx,%esi
call   1040 <ic_string_append_char@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1080 <assert@plt>
mov    -0x8(%rbp),%rdi
xor    %esi,%esi
call   10b0 <ic_string_append_symbol@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1080 <assert@plt>
mov    -0x8(%rbp),%rdi
mov    $0x5,%esi
mov    $0x63,%edx
call   10c0 <ic_string_set@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1080 <assert@plt>
mov    -0x8(%rbp),%rdi
xor    %edx,%edx
mov    %edx,%esi
call   10c0 <ic_string_set@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1080 <assert@plt>
mov    -0x8(%rbp),%rdi
mov    $0x1,%esi
call   1030 <ic_string_destroy@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1080 <assert@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<abnormal>:
push   %rbx
lea    0xe38(%rip),%rdi
mov    $0x5,%esi
call   10e0 <ic_string_new@plt>
mov    %rax,%rbx
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
call   1050 <ic_string_init@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1080 <assert@plt>
xor    %edi,%edi
call   10a0 <ic_string_init_empty@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1080 <assert@plt>
xor    %edi,%edi
call   1070 <ic_string_contents@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1080 <assert@plt>
xor    %edi,%edi
xor    %esi,%esi
call   1060 <ic_string_get@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1080 <assert@plt>
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
call   10c0 <ic_string_set@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1080 <assert@plt>
xor    %edi,%edi
call   10d0 <ic_string_length@plt>
xor    %edi,%edi
cmp    $0xffffffff,%eax
sete   %dil
call   1080 <assert@plt>
xor    %edi,%edi
xor    %esi,%esi
call   1090 <ic_string_append@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1080 <assert@plt>
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
call   1040 <ic_string_append_char@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1080 <assert@plt>
xor    %edi,%edi
xor    %esi,%esi
call   10b0 <ic_string_append_symbol@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1080 <assert@plt>
xor    %edi,%edi
xor    %esi,%esi
call   1030 <ic_string_destroy@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1080 <assert@plt>
mov    %rbx,%rdi
xor    %esi,%esi
call   1090 <ic_string_append@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1080 <assert@plt>
mov    %rbx,%rdi
xor    %esi,%esi
xor    %edx,%edx
call   1040 <ic_string_append_char@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1080 <assert@plt>
mov    %rbx,%rdi
xor    %esi,%esi
call   10b0 <ic_string_append_symbol@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1080 <assert@plt>
mov    %rbx,%rdi
mov    $0x5,%esi
mov    $0x63,%edx
call   10c0 <ic_string_set@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1080 <assert@plt>
mov    %rbx,%rdi
xor    %esi,%esi
xor    %edx,%edx
call   10c0 <ic_string_set@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1080 <assert@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
call   1030 <ic_string_destroy@plt>
xor    %edi,%edi
cmp    $0x1,%eax
sete   %dil
pop    %rbx
jmp    1080 <assert@plt>

LLVM IR (-O0):
%struct.ic_string = type { i32 }
@.str = [6 x i8] c"hello\00"
define void @abnormal() {
%1 = alloca %struct.ic_string*
%2 = call %struct.ic_string* @ic_string_new(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 5)
store %struct.ic_string* %2, %struct.ic_string** %1
%3 = call i64 @ic_string_init(i32 0, 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_string_init_empty(i32 0)
%8 = icmp eq i64 0, %7
%9 = zext i1 %8 to i32
%10 = call i32 @assert(i32 %9)
%11 = call i64 @ic_string_contents(i32 0)
%12 = icmp eq i64 0, %11
%13 = zext i1 %12 to i32
%14 = call i32 @assert(i32 %13)
%15 = call i64 @ic_string_get(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_string_set(%struct.ic_string* null, i32 0, i8 signext 0)
%20 = icmp eq i64 0, %19
%21 = zext i1 %20 to i32
%22 = call i32 @assert(i32 %21)
%23 = call i32 @ic_string_length(i32 0)
%24 = icmp eq i32 -1, %23
%25 = zext i1 %24 to i32
%26 = call i32 @assert(i32 %25)
%27 = call i64 @ic_string_append(%struct.ic_string* null, i32 0)
%28 = icmp eq i64 0, %27
%29 = zext i1 %28 to i32
%30 = call i32 @assert(i32 %29)
%31 = call i64 @ic_string_append_char(%struct.ic_string* null, i32 0, i32 0)
%32 = icmp eq i64 0, %31
%33 = zext i1 %32 to i32
%34 = call i32 @assert(i32 %33)
%35 = call i64 @ic_string_append_symbol(%struct.ic_string* null, i32 0)
%36 = icmp eq i64 0, %35
%37 = zext i1 %36 to i32
%38 = call i32 @assert(i32 %37)
%39 = call i32 @ic_string_destroy(%struct.ic_string* null, i32 0)
%40 = icmp eq i32 0, %39
%41 = zext i1 %40 to i32
%42 = call i32 @assert(i32 %41)
%43 = load %struct.ic_string*, %struct.ic_string** %1
%44 = call i64 @ic_string_append(%struct.ic_string* %43, i32 0)
%45 = icmp eq i64 0, %44
%46 = zext i1 %45 to i32
%47 = call i32 @assert(i32 %46)
%48 = load %struct.ic_string*, %struct.ic_string** %1
%49 = call i64 @ic_string_append_char(%struct.ic_string* %48, i32 0, i32 0)
%50 = icmp eq i64 0, %49
%51 = zext i1 %50 to i32
%52 = call i32 @assert(i32 %51)
%53 = load %struct.ic_string*, %struct.ic_string** %1
%54 = call i64 @ic_string_append_symbol(%struct.ic_string* %53, i32 0)
%55 = icmp eq i64 0, %54
%56 = zext i1 %55 to i32
%57 = call i32 @assert(i32 %56)
%58 = load %struct.ic_string*, %struct.ic_string** %1
%59 = call i64 @ic_string_set(%struct.ic_string* %58, i32 5, i8 signext 99)
%60 = icmp eq i64 0, %59
%61 = zext i1 %60 to i32
%62 = call i32 @assert(i32 %61)
%63 = load %struct.ic_string*, %struct.ic_string** %1
%64 = call i64 @ic_string_set(%struct.ic_string* %63, i32 0, i8 signext 0)
%65 = icmp eq i64 0, %64
%66 = zext i1 %65 to i32
%67 = call i32 @assert(i32 %66)
%68 = load %struct.ic_string*, %struct.ic_string** %1
%69 = call i32 @ic_string_destroy(%struct.ic_string* %68, i32 1)
%70 = icmp eq i32 1, %69
%71 = zext i1 %70 to i32
%72 = call i32 @assert(i32 %71)
ret void
}

LLVM IR (-O2):
%struct.ic_string = type { i32 }
@.str = [6 x i8] c"hello\00"
define void @abnormal() {
%1 = tail call %struct.ic_string* @ic_string_new(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i32 5)
%2 = tail call i64 @ic_string_init(i32 0, 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_string_init_empty(i32 0)
%7 = icmp eq i64 %6, 0
%8 = zext i1 %7 to i32
%9 = tail call i32 @assert(i32 %8)
%10 = tail call i64 @ic_string_contents(i32 0)
%11 = icmp eq i64 %10, 0
%12 = zext i1 %11 to i32
%13 = tail call i32 @assert(i32 %12)
%14 = tail call i64 @ic_string_get(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_string_set(%struct.ic_string* null, i32 0, i8 signext 0)
%19 = icmp eq i64 %18, 0
%20 = zext i1 %19 to i32
%21 = tail call i32 @assert(i32 %20)
%22 = tail call i32 @ic_string_length(i32 0)
%23 = icmp eq i32 %22, -1
%24 = zext i1 %23 to i32
%25 = tail call i32 @assert(i32 %24)
%26 = tail call i64 @ic_string_append(%struct.ic_string* null, i32 0)
%27 = icmp eq i64 %26, 0
%28 = zext i1 %27 to i32
%29 = tail call i32 @assert(i32 %28)
%30 = tail call i64 @ic_string_append_char(%struct.ic_string* null, i32 0, i32 0)
%31 = icmp eq i64 %30, 0
%32 = zext i1 %31 to i32
%33 = tail call i32 @assert(i32 %32)
%34 = tail call i64 @ic_string_append_symbol(%struct.ic_string* null, i32 0)
%35 = icmp eq i64 %34, 0
%36 = zext i1 %35 to i32
%37 = tail call i32 @assert(i32 %36)
%38 = tail call i32 @ic_string_destroy(%struct.ic_string* null, i32 0)
%39 = icmp eq i32 %38, 0
%40 = zext i1 %39 to i32
%41 = tail call i32 @assert(i32 %40)
%42 = tail call i64 @ic_string_append(%struct.ic_string* %1, i32 0)
%43 = icmp eq i64 %42, 0
%44 = zext i1 %43 to i32
%45 = tail call i32 @assert(i32 %44)
%46 = tail call i64 @ic_string_append_char(%struct.ic_string* %1, i32 0, i32 0)
%47 = icmp eq i64 %46, 0
%48 = zext i1 %47 to i32
%49 = tail call i32 @assert(i32 %48)
%50 = tail call i64 @ic_string_append_symbol(%struct.ic_string* %1, i32 0)
%51 = icmp eq i64 %50, 0
%52 = zext i1 %51 to i32
%53 = tail call i32 @assert(i32 %52)
%54 = tail call i64 @ic_string_set(%struct.ic_string* %1, i32 5, i8 signext 99)
%55 = icmp eq i64 %54, 0
%56 = zext i1 %55 to i32
%57 = tail call i32 @assert(i32 %56)
%58 = tail call i64 @ic_string_set(%struct.ic_string* %1, i32 0, i8 signext 0)
%59 = icmp eq i64 %58, 0
%60 = zext i1 %59 to i32
%61 = tail call i32 @assert(i32 %60)
%62 = tail call i32 @ic_string_destroy(%struct.ic_string* %1, i32 1)
%63 = icmp eq i32 %62, 1
%64 = zext i1 %63 to i32
%65 = tail call i32 @assert(i32 %64)
ret void
}