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

/* Variables and functions */
int /*<<< orphan*/ assert(int);
int ic_set_delete(struct ic_set *, char *);
int ic_set_destroy(struct ic_set *, int);
int ic_set_exists(struct ic_set *, char *);
int ic_set_insert(struct ic_set *, char *);
struct ic_set *ic_set_new();
int /*<<< orphan*/ puts(char *);
void normal(void) {
  struct ic_set *set = ic_set_new();
  puts("ignore any text output, testing error cases");
  assert(set);
  assert(0 == ic_set_exists(set, "hello"));
  assert(ic_set_insert(set, "hello"));
  assert(ic_set_exists(set, "hello"));
  assert(0 == ic_set_exists(set, "world"));
  assert(ic_set_delete(set, "hello"));
  assert(0 == ic_set_delete(set, "hello"));
  assert(0 == ic_set_delete(set, "world"));
  assert(ic_set_destroy(set, 1));
  puts("success");
}


x86 assembly (clang, -O0):
<normal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1080 <ic_set_new@plt>
mov    %rax,-0x8(%rbp)
lea    0xe76(%rip),%rdi
call   1030 <puts@plt>
mov    -0x8(%rbp),%rax
mov    %eax,%edi
call   1060 <assert@plt>
mov    -0x8(%rbp),%rdi
lea    0xe87(%rip),%rsi
call   1050 <ic_set_exists@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
mov    -0x8(%rbp),%rdi
lea    0xe64(%rip),%rsi
call   1090 <ic_set_insert@plt>
mov    %eax,%edi
call   1060 <assert@plt>
mov    -0x8(%rbp),%rdi
lea    0xe4d(%rip),%rsi
call   1050 <ic_set_exists@plt>
mov    %eax,%edi
call   1060 <assert@plt>
mov    -0x8(%rbp),%rdi
lea    0xe3c(%rip),%rsi
call   1050 <ic_set_exists@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
mov    -0x8(%rbp),%rdi
lea    0xe13(%rip),%rsi
call   1040 <ic_set_delete@plt>
mov    %eax,%edi
call   1060 <assert@plt>
mov    -0x8(%rbp),%rdi
lea    0xdfc(%rip),%rsi
call   1040 <ic_set_delete@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
mov    -0x8(%rbp),%rdi
lea    0xddf(%rip),%rsi
call   1040 <ic_set_delete@plt>
mov    %eax,%ecx
xor    %eax,%eax
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
mov    -0x8(%rbp),%rdi
mov    $0x1,%esi
call   1070 <ic_set_destroy@plt>
mov    %eax,%edi
call   1060 <assert@plt>
lea    0xdb1(%rip),%rdi
call   1030 <puts@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<normal>:
push   %r15
push   %r14
push   %rbx
xor    %eax,%eax
call   1080 <ic_set_new@plt>
mov    %rax,%rbx
lea    0xe7a(%rip),%rdi
call   1030 <puts@plt>
mov    %ebx,%edi
call   1060 <assert@plt>
lea    0xe93(%rip),%r14
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <ic_set_exists@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1060 <assert@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1090 <ic_set_insert@plt>
mov    %eax,%edi
call   1060 <assert@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <ic_set_exists@plt>
mov    %eax,%edi
call   1060 <assert@plt>
lea    0xe56(%rip),%r15
mov    %rbx,%rdi
mov    %r15,%rsi
call   1050 <ic_set_exists@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1060 <assert@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <ic_set_delete@plt>
mov    %eax,%edi
call   1060 <assert@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1040 <ic_set_delete@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1060 <assert@plt>
mov    %rbx,%rdi
mov    %r15,%rsi
call   1040 <ic_set_delete@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1060 <assert@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
call   1070 <ic_set_destroy@plt>
mov    %eax,%edi
call   1060 <assert@plt>
lea    0xde7(%rip),%rdi
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <puts@plt>

LLVM IR (-O0):
%struct.ic_set = type { i32 }
@.str = [44 x i8] c"ignore any text output, testing error cases\00"
@.str.1 = [6 x i8] c"hello\00"
@.str.2 = [6 x i8] c"world\00"
@.str.3 = [8 x i8] c"success\00"
define void @normal() {
%1 = alloca %struct.ic_set*
%2 = call %struct.ic_set* (...) @ic_set_new()
store %struct.ic_set* %2, %struct.ic_set** %1
%3 = call i32 @puts(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
%4 = load %struct.ic_set*, %struct.ic_set** %1
%5 = ptrtoint %struct.ic_set* %4 to i32
%6 = call i32 @assert(i32 %5)
%7 = load %struct.ic_set*, %struct.ic_set** %1
%8 = call i32 @ic_set_exists(%struct.ic_set* %7, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%9 = icmp eq i32 0, %8
%10 = zext i1 %9 to i32
%11 = call i32 @assert(i32 %10)
%12 = load %struct.ic_set*, %struct.ic_set** %1
%13 = call i32 @ic_set_insert(%struct.ic_set* %12, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%14 = call i32 @assert(i32 %13)
%15 = load %struct.ic_set*, %struct.ic_set** %1
%16 = call i32 @ic_set_exists(%struct.ic_set* %15, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%17 = call i32 @assert(i32 %16)
%18 = load %struct.ic_set*, %struct.ic_set** %1
%19 = call i32 @ic_set_exists(%struct.ic_set* %18, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%20 = icmp eq i32 0, %19
%21 = zext i1 %20 to i32
%22 = call i32 @assert(i32 %21)
%23 = load %struct.ic_set*, %struct.ic_set** %1
%24 = call i32 @ic_set_delete(%struct.ic_set* %23, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%25 = call i32 @assert(i32 %24)
%26 = load %struct.ic_set*, %struct.ic_set** %1
%27 = call i32 @ic_set_delete(%struct.ic_set* %26, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%28 = icmp eq i32 0, %27
%29 = zext i1 %28 to i32
%30 = call i32 @assert(i32 %29)
%31 = load %struct.ic_set*, %struct.ic_set** %1
%32 = call i32 @ic_set_delete(%struct.ic_set* %31, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%33 = icmp eq i32 0, %32
%34 = zext i1 %33 to i32
%35 = call i32 @assert(i32 %34)
%36 = load %struct.ic_set*, %struct.ic_set** %1
%37 = call i32 @ic_set_destroy(%struct.ic_set* %36, i32 1)
%38 = call i32 @assert(i32 %37)
%39 = call i32 @puts(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
%struct.ic_set = type { i32 }
@.str = [44 x i8] c"ignore any text output, testing error cases\00"
@.str.1 = [6 x i8] c"hello\00"
@.str.2 = [6 x i8] c"world\00"
@.str.3 = [8 x i8] c"success\00"
define void @normal() {
%1 = tail call %struct.ic_set* (...) @ic_set_new()
%2 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
%3 = ptrtoint %struct.ic_set* %1 to i64
%4 = trunc i64 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = tail call i32 @ic_set_exists(%struct.ic_set* %1, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%7 = icmp eq i32 %6, 0
%8 = zext i1 %7 to i32
%9 = tail call i32 @assert(i32 %8)
%10 = tail call i32 @ic_set_insert(%struct.ic_set* %1, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%11 = tail call i32 @assert(i32 %10)
%12 = tail call i32 @ic_set_exists(%struct.ic_set* %1, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%13 = tail call i32 @assert(i32 %12)
%14 = tail call i32 @ic_set_exists(%struct.ic_set* %1, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%15 = icmp eq i32 %14, 0
%16 = zext i1 %15 to i32
%17 = tail call i32 @assert(i32 %16)
%18 = tail call i32 @ic_set_delete(%struct.ic_set* %1, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%19 = tail call i32 @assert(i32 %18)
%20 = tail call i32 @ic_set_delete(%struct.ic_set* %1, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%21 = icmp eq i32 %20, 0
%22 = zext i1 %21 to i32
%23 = tail call i32 @assert(i32 %22)
%24 = tail call i32 @ic_set_delete(%struct.ic_set* %1, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%25 = icmp eq i32 %24, 0
%26 = zext i1 %25 to i32
%27 = tail call i32 @assert(i32 %26)
%28 = tail call i32 @ic_set_destroy(%struct.ic_set* %1, i32 1)
%29 = tail call i32 @assert(i32 %28)
%30 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
ret void
}