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

/* Variables and functions */
int /*<<< orphan*/ assert(int);
int *ic_dict_delete(struct ic_dict *, char *);
int ic_dict_destroy(struct ic_dict *, int, int /*<<< orphan*/);
int ic_dict_exists(struct ic_dict *, char *);
int *ic_dict_get(struct ic_dict *, char *);
int ic_dict_insert(struct ic_dict *, char *, int *);
struct ic_dict *ic_dict_new();
int ic_dict_set(struct ic_dict *, char *, int *);
int *ic_dict_update(struct ic_dict *, char *, int *);
int /*<<< orphan*/ puts(char *);
void normal(void) {
  struct ic_dict *dict = ic_dict_new();
  int data_1 = 1;
  int data_2 = 2;
  puts("ignore any text output, testing error cases");
  assert(dict);
  assert(0 == ic_dict_get(dict, "hello"));
  assert(0 == ic_dict_update(dict, "hello", &data_1));
  assert(ic_dict_insert(dict, "hello", &data_1));
  assert(ic_dict_exists(dict, "hello"));
  assert(0 == ic_dict_exists(dict, "world"));
  assert(&data_1 == ic_dict_get(dict, "hello"));
  assert(&data_1 == ic_dict_update(dict, "hello", &data_2));
  assert(&data_2 == ic_dict_get(dict, "hello"));
  assert(1 == ic_dict_set(dict, "hello", &data_1));
  assert(&data_1 == ic_dict_get(dict, "hello"));
  assert(0 == ic_dict_get(dict, "world"));
  assert(&data_1 == ic_dict_delete(dict, "hello"));
  assert(0 == ic_dict_delete(dict, "hello"));
  assert(0 == ic_dict_delete(dict, "world"));
  assert(ic_dict_destroy(dict, 1, 0));
  puts("success");
}


x86 assembly (clang, -O0):
<normal>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    $0x0,%al
call   1040 <ic_dict_new@plt>
mov    %rax,-0x8(%rbp)
movl   $0x1,-0xc(%rbp)
movl   $0x2,-0x10(%rbp)
lea    0xe38(%rip),%rdi
call   1030 <puts@plt>
mov    -0x8(%rbp),%rax
mov    %eax,%edi
call   1060 <assert@plt>
mov    -0x8(%rbp),%rdi
lea    0xe49(%rip),%rsi
call   1070 <ic_dict_get@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
mov    -0x8(%rbp),%rdi
lea    0xe24(%rip),%rsi
lea    -0xc(%rbp),%rdx
call   10c0 <ic_dict_update@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
mov    -0x8(%rbp),%rdi
lea    0xdfb(%rip),%rsi
lea    -0xc(%rbp),%rdx
call   1080 <ic_dict_insert@plt>
mov    %eax,%edi
call   1060 <assert@plt>
mov    -0x8(%rbp),%rdi
lea    0xde0(%rip),%rsi
call   1090 <ic_dict_exists@plt>
mov    %eax,%edi
call   1060 <assert@plt>
mov    -0x8(%rbp),%rdi
lea    0xdcf(%rip),%rsi
call   1090 <ic_dict_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    0xda6(%rip),%rsi
call   1070 <ic_dict_get@plt>
mov    %rax,%rcx
lea    -0xc(%rbp),%rax
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
mov    -0x8(%rbp),%rdi
lea    0xd7f(%rip),%rsi
lea    -0x10(%rbp),%rdx
call   10c0 <ic_dict_update@plt>
mov    %rax,%rcx
lea    -0xc(%rbp),%rax
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
mov    -0x8(%rbp),%rdi
lea    0xd54(%rip),%rsi
call   1070 <ic_dict_get@plt>
mov    %rax,%rcx
lea    -0x10(%rbp),%rax
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
mov    -0x8(%rbp),%rdi
lea    0xd2d(%rip),%rsi
lea    -0xc(%rbp),%rdx
call   10b0 <ic_dict_set@plt>
mov    %eax,%ecx
mov    $0x1,%eax
cmp    %ecx,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
mov    -0x8(%rbp),%rdi
lea    0xd03(%rip),%rsi
call   1070 <ic_dict_get@plt>
mov    %rax,%rcx
lea    -0xc(%rbp),%rax
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
mov    -0x8(%rbp),%rdi
lea    0xce2(%rip),%rsi
call   1070 <ic_dict_get@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
mov    -0x8(%rbp),%rdi
lea    0xcb7(%rip),%rsi
call   10a0 <ic_dict_delete@plt>
mov    %rax,%rcx
lea    -0xc(%rbp),%rax
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
mov    -0x8(%rbp),%rdi
lea    0xc90(%rip),%rsi
call   10a0 <ic_dict_delete@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
mov    -0x8(%rbp),%rdi
lea    0xc71(%rip),%rsi
call   10a0 <ic_dict_delete@plt>
mov    %rax,%rcx
xor    %eax,%eax
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
mov    -0x8(%rbp),%rdi
mov    $0x1,%esi
xor    %edx,%edx
call   1050 <ic_dict_destroy@plt>
mov    %eax,%edi
call   1060 <assert@plt>
lea    0xc3f(%rip),%rdi
call   1030 <puts@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<normal>:
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
sub    $0x10,%rsp
xor    %eax,%eax
call   1040 <ic_dict_new@plt>
mov    %rax,%rbx
movl   $0x1,0xc(%rsp)
movl   $0x2,0x8(%rsp)
lea    0xe32(%rip),%rdi
call   1030 <puts@plt>
mov    %ebx,%edi
call   1060 <assert@plt>
lea    0xe4b(%rip),%r14
mov    %rbx,%rdi
mov    %r14,%rsi
call   1070 <ic_dict_get@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1060 <assert@plt>
lea    0xc(%rsp),%r15
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   10c0 <ic_dict_update@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1060 <assert@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   1080 <ic_dict_insert@plt>
mov    %eax,%edi
call   1060 <assert@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1090 <ic_dict_exists@plt>
mov    %eax,%edi
call   1060 <assert@plt>
lea    0xde9(%rip),%r12
mov    %rbx,%rdi
mov    %r12,%rsi
call   1090 <ic_dict_exists@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1060 <assert@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1070 <ic_dict_get@plt>
xor    %edi,%edi
cmp    %rax,%r15
sete   %dil
call   1060 <assert@plt>
lea    0x8(%rsp),%r13
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r13,%rdx
call   10c0 <ic_dict_update@plt>
xor    %edi,%edi
cmp    %rax,%r15
sete   %dil
call   1060 <assert@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1070 <ic_dict_get@plt>
xor    %edi,%edi
cmp    %rax,%r13
sete   %dil
call   1060 <assert@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
mov    %r15,%rdx
call   10b0 <ic_dict_set@plt>
xor    %edi,%edi
cmp    $0x1,%eax
sete   %dil
call   1060 <assert@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1070 <ic_dict_get@plt>
xor    %edi,%edi
cmp    %rax,%r15
sete   %dil
call   1060 <assert@plt>
mov    %rbx,%rdi
mov    %r12,%rsi
call   1070 <ic_dict_get@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1060 <assert@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   10a0 <ic_dict_delete@plt>
xor    %edi,%edi
cmp    %rax,%r15
sete   %dil
call   1060 <assert@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   10a0 <ic_dict_delete@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1060 <assert@plt>
mov    %rbx,%rdi
mov    %r12,%rsi
call   10a0 <ic_dict_delete@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1060 <assert@plt>
mov    %rbx,%rdi
mov    $0x1,%esi
xor    %edx,%edx
call   1050 <ic_dict_destroy@plt>
mov    %eax,%edi
call   1060 <assert@plt>
lea    0xcce(%rip),%rdi
call   1030 <puts@plt>
add    $0x10,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
ret

LLVM IR (-O0):
%struct.ic_dict = 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_dict*
%2 = alloca i32
%3 = alloca i32
%4 = call %struct.ic_dict* (...) @ic_dict_new()
store %struct.ic_dict* %4, %struct.ic_dict** %1
store i32 1, i32* %2
store i32 2, i32* %3
%5 = call i32 @puts(i8* getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
%6 = load %struct.ic_dict*, %struct.ic_dict** %1
%7 = ptrtoint %struct.ic_dict* %6 to i32
%8 = call i32 @assert(i32 %7)
%9 = load %struct.ic_dict*, %struct.ic_dict** %1
%10 = call i32* @ic_dict_get(%struct.ic_dict* %9, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%11 = icmp eq i32* null, %10
%12 = zext i1 %11 to i32
%13 = call i32 @assert(i32 %12)
%14 = load %struct.ic_dict*, %struct.ic_dict** %1
%15 = call i32* @ic_dict_update(%struct.ic_dict* %14, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%16 = icmp eq i32* null, %15
%17 = zext i1 %16 to i32
%18 = call i32 @assert(i32 %17)
%19 = load %struct.ic_dict*, %struct.ic_dict** %1
%20 = call i32 @ic_dict_insert(%struct.ic_dict* %19, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%21 = call i32 @assert(i32 %20)
%22 = load %struct.ic_dict*, %struct.ic_dict** %1
%23 = call i32 @ic_dict_exists(%struct.ic_dict* %22, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%24 = call i32 @assert(i32 %23)
%25 = load %struct.ic_dict*, %struct.ic_dict** %1
%26 = call i32 @ic_dict_exists(%struct.ic_dict* %25, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%27 = icmp eq i32 0, %26
%28 = zext i1 %27 to i32
%29 = call i32 @assert(i32 %28)
%30 = load %struct.ic_dict*, %struct.ic_dict** %1
%31 = call i32* @ic_dict_get(%struct.ic_dict* %30, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%32 = icmp eq i32* %2, %31
%33 = zext i1 %32 to i32
%34 = call i32 @assert(i32 %33)
%35 = load %struct.ic_dict*, %struct.ic_dict** %1
%36 = call i32* @ic_dict_update(%struct.ic_dict* %35, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32* %3)
%37 = icmp eq i32* %2, %36
%38 = zext i1 %37 to i32
%39 = call i32 @assert(i32 %38)
%40 = load %struct.ic_dict*, %struct.ic_dict** %1
%41 = call i32* @ic_dict_get(%struct.ic_dict* %40, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%42 = icmp eq i32* %3, %41
%43 = zext i1 %42 to i32
%44 = call i32 @assert(i32 %43)
%45 = load %struct.ic_dict*, %struct.ic_dict** %1
%46 = call i32 @ic_dict_set(%struct.ic_dict* %45, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%47 = icmp eq i32 1, %46
%48 = zext i1 %47 to i32
%49 = call i32 @assert(i32 %48)
%50 = load %struct.ic_dict*, %struct.ic_dict** %1
%51 = call i32* @ic_dict_get(%struct.ic_dict* %50, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%52 = icmp eq i32* %2, %51
%53 = zext i1 %52 to i32
%54 = call i32 @assert(i32 %53)
%55 = load %struct.ic_dict*, %struct.ic_dict** %1
%56 = call i32* @ic_dict_get(%struct.ic_dict* %55, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%57 = icmp eq i32* null, %56
%58 = zext i1 %57 to i32
%59 = call i32 @assert(i32 %58)
%60 = load %struct.ic_dict*, %struct.ic_dict** %1
%61 = call i32* @ic_dict_delete(%struct.ic_dict* %60, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%62 = icmp eq i32* %2, %61
%63 = zext i1 %62 to i32
%64 = call i32 @assert(i32 %63)
%65 = load %struct.ic_dict*, %struct.ic_dict** %1
%66 = call i32* @ic_dict_delete(%struct.ic_dict* %65, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%67 = icmp eq i32* null, %66
%68 = zext i1 %67 to i32
%69 = call i32 @assert(i32 %68)
%70 = load %struct.ic_dict*, %struct.ic_dict** %1
%71 = call i32* @ic_dict_delete(%struct.ic_dict* %70, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%72 = icmp eq i32* null, %71
%73 = zext i1 %72 to i32
%74 = call i32 @assert(i32 %73)
%75 = load %struct.ic_dict*, %struct.ic_dict** %1
%76 = call i32 @ic_dict_destroy(%struct.ic_dict* %75, i32 1, i32 0)
%77 = call i32 @assert(i32 %76)
%78 = 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_dict = 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 i32
%2 = alloca i32
%3 = tail call %struct.ic_dict* (...) @ic_dict_new()
%4 = bitcast i32* %1 to i8*
store i32 1, i32* %1
%5 = bitcast i32* %2 to i8*
store i32 2, i32* %2
%6 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([44 x i8], [44 x i8]* @.str, i64 0, i64 0))
%7 = ptrtoint %struct.ic_dict* %3 to i64
%8 = trunc i64 %7 to i32
%9 = tail call i32 @assert(i32 %8)
%10 = tail call i32* @ic_dict_get(%struct.ic_dict* %3, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%11 = icmp eq i32* %10, null
%12 = zext i1 %11 to i32
%13 = tail call i32 @assert(i32 %12)
%14 = call i32* @ic_dict_update(%struct.ic_dict* %3, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%15 = icmp eq i32* %14, null
%16 = zext i1 %15 to i32
%17 = call i32 @assert(i32 %16)
%18 = call i32 @ic_dict_insert(%struct.ic_dict* %3, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%19 = call i32 @assert(i32 %18)
%20 = call i32 @ic_dict_exists(%struct.ic_dict* %3, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%21 = call i32 @assert(i32 %20)
%22 = call i32 @ic_dict_exists(%struct.ic_dict* %3, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%23 = icmp eq i32 %22, 0
%24 = zext i1 %23 to i32
%25 = call i32 @assert(i32 %24)
%26 = call i32* @ic_dict_get(%struct.ic_dict* %3, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%27 = icmp eq i32* %1, %26
%28 = zext i1 %27 to i32
%29 = call i32 @assert(i32 %28)
%30 = call i32* @ic_dict_update(%struct.ic_dict* %3, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32* %2)
%31 = icmp eq i32* %1, %30
%32 = zext i1 %31 to i32
%33 = call i32 @assert(i32 %32)
%34 = call i32* @ic_dict_get(%struct.ic_dict* %3, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%35 = icmp eq i32* %2, %34
%36 = zext i1 %35 to i32
%37 = call i32 @assert(i32 %36)
%38 = call i32 @ic_dict_set(%struct.ic_dict* %3, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0), i32* %1)
%39 = icmp eq i32 %38, 1
%40 = zext i1 %39 to i32
%41 = call i32 @assert(i32 %40)
%42 = call i32* @ic_dict_get(%struct.ic_dict* %3, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%43 = icmp eq i32* %1, %42
%44 = zext i1 %43 to i32
%45 = call i32 @assert(i32 %44)
%46 = call i32* @ic_dict_get(%struct.ic_dict* %3, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%47 = icmp eq i32* %46, null
%48 = zext i1 %47 to i32
%49 = call i32 @assert(i32 %48)
%50 = call i32* @ic_dict_delete(%struct.ic_dict* %3, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%51 = icmp eq i32* %1, %50
%52 = zext i1 %51 to i32
%53 = call i32 @assert(i32 %52)
%54 = call i32* @ic_dict_delete(%struct.ic_dict* %3, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.1, i64 0, i64 0))
%55 = icmp eq i32* %54, null
%56 = zext i1 %55 to i32
%57 = call i32 @assert(i32 %56)
%58 = call i32* @ic_dict_delete(%struct.ic_dict* %3, i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str.2, i64 0, i64 0))
%59 = icmp eq i32* %58, null
%60 = zext i1 %59 to i32
%61 = call i32 @assert(i32 %60)
%62 = call i32 @ic_dict_destroy(%struct.ic_dict* %3, i32 1, i32 0)
%63 = call i32 @assert(i32 %62)
%64 = call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([8 x i8], [8 x i8]* @.str.3, i64 0, i64 0))
ret void
}