#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 ShoppingCart {
  int dummy;
};
struct CartItem {
  int dummy;
};

/* Variables and functions */
int /*<<< orphan*/ addItemToCart(struct ShoppingCart *, struct CartItem *);
int containsItem(struct ShoppingCart *, struct CartItem *);
struct ShoppingCart *createCart(int);
struct CartItem *createItem(char *, double);
int /*<<< orphan*/ freeCart(struct ShoppingCart *);
int getNumItems(struct ShoppingCart *);
double getTotalPrice(struct ShoppingCart *);
int /*<<< orphan*/ printf(char *);
int /*<<< orphan*/ removeItemFromCart(struct ShoppingCart *, struct CartItem *);
int main() {
  printf("Creating a shopping cart...\n");
  struct ShoppingCart *cart = createCart(2);
  printf("Shopping cart should be empty: ");
  if (getNumItems(cart) == 0)
    printf("success.\n");
  else
    printf("FAIL.\n");
  printf("Total Price should be 0: ");
  if (getTotalPrice(cart) == 0)
    printf("success.\n");
  else
    printf("FAIL.\n");
  struct CartItem *milk = createItem("milk", 3.00);
  struct CartItem *coffee = createItem("coffee", 10.00);
  addItemToCart(cart, milk);
  addItemToCart(cart, coffee);
  printf("Shopping cart should contain 'milk': ");
  if (containsItem(cart, milk) > -1)
    printf("success.\n");
  else
    printf("FAIL.\n");
  printf("Shopping cart should contain 'coffee': ");
  if (containsItem(cart, coffee) > -1)
    printf("success.\n");
  else
    printf("FAIL.\n");
  printf("After adding items, shopping cart should contain 2 items: ");
  if (getNumItems(cart) == 2)
    printf("success.\n");
  else
    printf("FAIL.\n");
  printf("After adding items, total Price should be $13.00: ");
  if (getTotalPrice(cart) == 13.00)
    printf("success.\n");
  else
    printf("FAIL.\n");
  removeItemFromCart(cart, milk);
  printf("After removing 'milk', shopping cart should not contain 'milk': ");
  if (containsItem(cart, milk) == -1)
    printf("success.\n");
  else
    printf("FAIL.\n");
  printf(
      "After removing 'milk', shopping cart should still contain 'coffee': ");
  if (containsItem(cart, coffee) > -1)
    printf("success.\n");
  else
    printf("FAIL.\n");
  printf("After removing 'milk', shopping cart should contain 1 item: ");
  if (getNumItems(cart) == 1)
    printf("success.\n");
  else
    printf("FAIL.\n");
  printf("After removing 'milk', total Price should be $10.00: ");
  if (getTotalPrice(cart) == 10.00)
    printf("success.\n");
  else
    printf("FAIL.\n");
  addItemToCart(cart, milk);
  struct CartItem *avacado = createItem("avacado", 2.00);
  addItemToCart(cart, avacado);
  printf(
      "After adding 'avacado', shopping cart should not contain 'avacado': ");
  if (containsItem(cart, avacado) == -1)
    printf("success.\n");
  else
    printf("FAIL.\n");
  printf(
      "After adding 'avacado', shopping cart should still contain 2 items: ");
  if (getNumItems(cart) == 2)
    printf("success.\n");
  else
    printf("FAIL.\n");
  printf("After adding 'avacado', total Price should still be $13.00: ");
  if (getTotalPrice(cart) == 13.00)
    printf("success.\n");
  else
    printf("FAIL.\n");
  freeCart(cart);
  return 0;
}


x86 assembly (clang, -O0):
<main>:
push   %rbp
mov    %rsp,%rbp
sub    $0x30,%rsp
movl   $0x0,-0x4(%rbp)
lea    0xe7a(%rip),%rdi
call   1050 <printf@plt>
mov    $0x2,%edi
call   1060 <createCart@plt>
mov    %rax,-0x10(%rbp)
lea    0xe7d(%rip),%rdi
call   1050 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1070 <getNumItems@plt>
cmp    $0x0,%eax
jne    11e8 <main+0x58>
lea    0xe7f(%rip),%rdi
call   1050 <printf@plt>
jmp    11f4 <main+0x64>
lea    0xe78(%rip),%rdi
call   1050 <printf@plt>
lea    0xe73(%rip),%rdi
call   1050 <printf@plt>
mov    -0x10(%rbp),%rdi
call   10b0 <getTotalPrice@plt>
xorps  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
jne    122d <main+0x9d>
jp     122d <main+0x9d>
lea    0xe3a(%rip),%rdi
call   1050 <printf@plt>
jmp    1239 <main+0xa9>
lea    0xe33(%rip),%rdi
call   1050 <printf@plt>
lea    0xe48(%rip),%rdi
movsd  0xdc0(%rip),%xmm0
call   1030 <createItem@plt>
mov    %rax,-0x18(%rbp)
lea    0xe35(%rip),%rdi
movsd  0xda0(%rip),%xmm0
call   1030 <createItem@plt>
mov    %rax,-0x20(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1090 <addItemToCart@plt>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   1090 <addItemToCart@plt>
lea    0xe0a(%rip),%rdi
call   1050 <printf@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   10a0 <containsItem@plt>
cmp    $0xffffffff,%eax
jle    12b6 <main+0x126>
lea    0xdb1(%rip),%rdi
call   1050 <printf@plt>
jmp    12c2 <main+0x132>
lea    0xdaa(%rip),%rdi
call   1050 <printf@plt>
lea    0xdf1(%rip),%rdi
call   1050 <printf@plt>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   10a0 <containsItem@plt>
cmp    $0xffffffff,%eax
jle    12f5 <main+0x165>
lea    0xd72(%rip),%rdi
call   1050 <printf@plt>
jmp    1301 <main+0x171>
lea    0xd6b(%rip),%rdi
call   1050 <printf@plt>
lea    0xdda(%rip),%rdi
call   1050 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1070 <getNumItems@plt>
cmp    $0x2,%eax
jne    1330 <main+0x1a0>
lea    0xd37(%rip),%rdi
call   1050 <printf@plt>
jmp    133c <main+0x1ac>
lea    0xd30(%rip),%rdi
call   1050 <printf@plt>
lea    0xdda(%rip),%rdi
call   1050 <printf@plt>
mov    -0x10(%rbp),%rdi
call   10b0 <getTotalPrice@plt>
movsd  0xcb7(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    137a <main+0x1ea>
jp     137a <main+0x1ea>
lea    0xced(%rip),%rdi
call   1050 <printf@plt>
jmp    1386 <main+0x1f6>
lea    0xce6(%rip),%rdi
call   1050 <printf@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1040 <removeItemFromCart@plt>
lea    0xdb6(%rip),%rdi
call   1050 <printf@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   10a0 <containsItem@plt>
cmp    $0xffffffff,%eax
jne    13c6 <main+0x236>
lea    0xca1(%rip),%rdi
call   1050 <printf@plt>
jmp    13d2 <main+0x242>
lea    0xc9a(%rip),%rdi
call   1050 <printf@plt>
lea    0xdb8(%rip),%rdi
call   1050 <printf@plt>
mov    -0x10(%rbp),%rdi
mov    -0x20(%rbp),%rsi
call   10a0 <containsItem@plt>
cmp    $0xffffffff,%eax
jle    1405 <main+0x275>
lea    0xc62(%rip),%rdi
call   1050 <printf@plt>
jmp    1411 <main+0x281>
lea    0xc5b(%rip),%rdi
call   1050 <printf@plt>
lea    0xdbe(%rip),%rdi
call   1050 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1070 <getNumItems@plt>
cmp    $0x1,%eax
jne    1440 <main+0x2b0>
lea    0xc27(%rip),%rdi
call   1050 <printf@plt>
jmp    144c <main+0x2bc>
lea    0xc20(%rip),%rdi
call   1050 <printf@plt>
lea    0xdc0(%rip),%rdi
call   1050 <printf@plt>
mov    -0x10(%rbp),%rdi
call   10b0 <getTotalPrice@plt>
movsd  0xb97(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    148a <main+0x2fa>
jp     148a <main+0x2fa>
lea    0xbdd(%rip),%rdi
call   1050 <printf@plt>
jmp    1496 <main+0x306>
lea    0xbd6(%rip),%rdi
call   1050 <printf@plt>
mov    -0x10(%rbp),%rdi
mov    -0x18(%rbp),%rsi
call   1090 <addItemToCart@plt>
lea    0xd9f(%rip),%rdi
movsd  0xb66(%rip),%xmm0
call   1030 <createItem@plt>
mov    %rax,-0x28(%rbp)
mov    -0x10(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   1090 <addItemToCart@plt>
lea    0xd82(%rip),%rdi
call   1050 <printf@plt>
mov    -0x10(%rbp),%rdi
mov    -0x28(%rbp),%rsi
call   10a0 <containsItem@plt>
cmp    $0xffffffff,%eax
jne    14fb <main+0x36b>
lea    0xb6c(%rip),%rdi
call   1050 <printf@plt>
jmp    1507 <main+0x377>
lea    0xb65(%rip),%rdi
call   1050 <printf@plt>
lea    0xd88(%rip),%rdi
call   1050 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1070 <getNumItems@plt>
cmp    $0x2,%eax
jne    1536 <main+0x3a6>
lea    0xb31(%rip),%rdi
call   1050 <printf@plt>
jmp    1542 <main+0x3b2>
lea    0xb2a(%rip),%rdi
call   1050 <printf@plt>
lea    0xd92(%rip),%rdi
call   1050 <printf@plt>
mov    -0x10(%rbp),%rdi
call   10b0 <getTotalPrice@plt>
movsd  0xab1(%rip),%xmm1
ucomisd %xmm1,%xmm0
jne    1580 <main+0x3f0>
jp     1580 <main+0x3f0>
lea    0xae7(%rip),%rdi
call   1050 <printf@plt>
jmp    158c <main+0x3fc>
lea    0xae0(%rip),%rdi
call   1050 <printf@plt>
mov    -0x10(%rbp),%rdi
call   1080 <freeCart@plt>
xor    %eax,%eax
add    $0x30,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<main>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
push   %rax
lea    0x1138(%rip),%rdi
call   1040 <puts@plt>
mov    $0x2,%edi
call   1070 <createCart@plt>
mov    %rax,%r13
lea    0xe55(%rip),%rdi
call   1060 <printf@plt>
mov    %r13,%rdi
call   1080 <getNumItems@plt>
test   %eax,%eax
lea    0x112b(%rip),%r14
lea    0x111e(%rip),%rbp
mov    %rbp,%rdi
cmove  %r14,%rdi
call   1040 <puts@plt>
lea    0xe45(%rip),%rdi
call   1060 <printf@plt>
mov    %r13,%rdi
call   10c0 <getTotalPrice@plt>
xorpd  %xmm1,%xmm1
ucomisd %xmm1,%xmm0
mov    %rbp,%rdi
cmove  %r14,%rdi
cmovp  %rbp,%rdi
call   1040 <puts@plt>
lea    0xe33(%rip),%rdi
movsd  0xdd1(%rip),%xmm0
call   1030 <createItem@plt>
mov    %rax,%r15
lea    0xe21(%rip),%rdi
movsd  0xdc2(%rip),%xmm0
call   1030 <createItem@plt>
mov    %rax,%r12
mov    %r13,%rdi
mov    %r15,%rsi
call   10a0 <addItemToCart@plt>
mov    %r13,%rdi
mov    %r12,%rsi
call   10a0 <addItemToCart@plt>
lea    0xdfb(%rip),%rdi
call   1060 <printf@plt>
mov    %r13,%rdi
mov    %r15,%rsi
call   10b0 <containsItem@plt>
test   %eax,%eax
mov    %rbp,%rdi
cmovns %r14,%rdi
call   1040 <puts@plt>
lea    0xdfc(%rip),%rdi
call   1060 <printf@plt>
mov    %r13,%rdi
mov    %r12,%rsi
call   10b0 <containsItem@plt>
test   %eax,%eax
mov    %rbp,%rdi
cmovns %r14,%rdi
call   1040 <puts@plt>
lea    0xdff(%rip),%rdi
call   1060 <printf@plt>
mov    %r13,%rdi
call   1080 <getNumItems@plt>
cmp    $0x2,%eax
mov    %rbp,%rdi
cmove  %r14,%rdi
call   1040 <puts@plt>
lea    0xe17(%rip),%rdi
call   1060 <printf@plt>
mov    %r13,%rdi
call   10c0 <getTotalPrice@plt>
ucomisd 0xd23(%rip),%xmm0
mov    %rbp,%rdi
cmove  %r14,%rdi
cmovp  %rbp,%rdi
call   1040 <puts@plt>
mov    %r13,%rdi
mov    %r15,%rsi
call   1050 <removeItemFromCart@plt>
lea    0xe13(%rip),%rdi
call   1060 <printf@plt>
mov    %r13,%rdi
mov    %r15,%rsi
call   10b0 <containsItem@plt>
cmp    $0xffffffff,%eax
mov    %rbp,%rdi
cmove  %r14,%rdi
call   1040 <puts@plt>
lea    0xe2e(%rip),%rdi
call   1060 <printf@plt>
mov    %r13,%rdi
mov    %r12,%rsi
call   10b0 <containsItem@plt>
test   %eax,%eax
mov    %rbp,%rdi
cmovns %r14,%rdi
call   1040 <puts@plt>
lea    0xe4e(%rip),%rdi
call   1060 <printf@plt>
mov    %r13,%rdi
call   1080 <getNumItems@plt>
cmp    $0x1,%eax
mov    %rbp,%rdi
cmove  %r14,%rdi
call   1040 <puts@plt>
lea    0xe68(%rip),%rdi
call   1060 <printf@plt>
mov    %r13,%rdi
call   10c0 <getTotalPrice@plt>
ucomisd 0xc76(%rip),%xmm0
mov    %rbp,%rdi
cmove  %r14,%rdi
cmovp  %rbp,%rdi
call   1040 <puts@plt>
mov    %r13,%rdi
mov    %r15,%rsi
call   10a0 <addItemToCart@plt>
lea    0xe67(%rip),%rdi
movsd  0xc5c(%rip),%xmm0
call   1030 <createItem@plt>
mov    %rax,%rbx
mov    %r13,%rdi
mov    %rax,%rsi
call   10a0 <addItemToCart@plt>
lea    0xe4d(%rip),%rdi
call   1060 <printf@plt>
mov    %r13,%rdi
mov    %rbx,%rsi
call   10b0 <containsItem@plt>
cmp    $0xffffffff,%eax
mov    %rbp,%rdi
cmove  %r14,%rdi
call   1040 <puts@plt>
lea    0xe6c(%rip),%rdi
call   1060 <printf@plt>
mov    %r13,%rdi
call   1080 <getNumItems@plt>
cmp    $0x2,%eax
mov    %rbp,%rdi
cmove  %r14,%rdi
call   1040 <puts@plt>
lea    0xe8e(%rip),%rdi
call   1060 <printf@plt>
mov    %r13,%rdi
call   10c0 <getTotalPrice@plt>
ucomisd 0xbdc(%rip),%xmm0
cmovne %rbp,%r14
cmovp  %rbp,%r14
mov    %r14,%rdi
call   1040 <puts@plt>
mov    %r13,%rdi
call   1090 <freeCart@plt>
xor    %eax,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
%struct.ShoppingCart = type { i32 }
%struct.CartItem = type { i32 }
@.str = [29 x i8] c"Creating a shopping cart...\0A\00"
@.str.1 = [32 x i8] c"Shopping cart should be empty: \00"
@.str.2 = [10 x i8] c"success.\0A\00"
@.str.3 = [7 x i8] c"FAIL.\0A\00"
@.str.4 = [26 x i8] c"Total Price should be 0: \00"
@.str.5 = [5 x i8] c"milk\00"
@.str.6 = [7 x i8] c"coffee\00"
@.str.7 = [38 x i8] c"Shopping cart should contain 'milk': \00"
@.str.8 = [40 x i8] c"Shopping cart should contain 'coffee': \00"
@.str.9 = [59 x i8] c"After adding items, shopping cart should contain 2 items: \00"
@.str.10 = [51 x i8] c"After adding items, total Price should be $13.00: \00"
@.str.11 = [65 x i8] c"After removing 'milk', shopping cart should not contain 'milk': \00"
@.str.12 = [69 x i8] c"After removing 'milk', shopping cart should still contain 'coffee': \00"
@.str.13 = [61 x i8] c"After removing 'milk', shopping cart should contain 1 item: \00"
@.str.14 = [54 x i8] c"After removing 'milk', total Price should be $10.00: \00"
@.str.15 = [8 x i8] c"avacado\00"
@.str.16 = [69 x i8] c"After adding 'avacado', shopping cart should not contain 'avacado': \00"
@.str.17 = [69 x i8] c"After adding 'avacado', shopping cart should still contain 2 items: \00"
@.str.18 = [61 x i8] c"After adding 'avacado', total Price should still be $13.00: \00"
define i32 @main() {
%1 = alloca i32
%2 = alloca %struct.ShoppingCart*
%3 = alloca %struct.CartItem*
%4 = alloca %struct.CartItem*
%5 = alloca %struct.CartItem*
store i32 0, i32* %1
%6 = call i32 @printf(i8* getelementptr inbounds ([29 x i8], [29 x i8]* @.str, i64 0, i64 0))
%7 = call %struct.ShoppingCart* @createCart(i32 2)
store %struct.ShoppingCart* %7, %struct.ShoppingCart** %2
%8 = call i32 @printf(i8* getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0))
%9 = load %struct.ShoppingCart*, %struct.ShoppingCart** %2
%10 = call i32 @getNumItems(%struct.ShoppingCart* %9)
%11 = icmp eq i32 %10, 0
br i1 %11, label %12, label %14
12: ; preds = %0
%13 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
br label %16
14: ; preds = %0
%15 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
br label %16
16: ; preds = %14, %12
%17 = call i32 @printf(i8* getelementptr inbounds ([26 x i8], [26 x i8]* @.str.4, i64 0, i64 0))
%18 = load %struct.ShoppingCart*, %struct.ShoppingCart** %2
%19 = call double @getTotalPrice(%struct.ShoppingCart* %18)
%20 = fcmp oeq double %19, 0.000000e+00
br i1 %20, label %21, label %23
21: ; preds = %16
%22 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
br label %25
23: ; preds = %16
%24 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
br label %25
25: ; preds = %23, %21
%26 = call %struct.CartItem* @createItem(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0), double 3.000000e+00)
store %struct.CartItem* %26, %struct.CartItem** %3
%27 = call %struct.CartItem* @createItem(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0), double 1.000000e+01)
store %struct.CartItem* %27, %struct.CartItem** %4
%28 = load %struct.ShoppingCart*, %struct.ShoppingCart** %2
%29 = load %struct.CartItem*, %struct.CartItem** %3
%30 = call i32 @addItemToCart(%struct.ShoppingCart* %28, %struct.CartItem* %29)
%31 = load %struct.ShoppingCart*, %struct.ShoppingCart** %2
%32 = load %struct.CartItem*, %struct.CartItem** %4
%33 = call i32 @addItemToCart(%struct.ShoppingCart* %31, %struct.CartItem* %32)
%34 = call i32 @printf(i8* getelementptr inbounds ([38 x i8], [38 x i8]* @.str.7, i64 0, i64 0))
%35 = load %struct.ShoppingCart*, %struct.ShoppingCart** %2
%36 = load %struct.CartItem*, %struct.CartItem** %3
%37 = call i32 @containsItem(%struct.ShoppingCart* %35, %struct.CartItem* %36)
%38 = icmp sgt i32 %37, -1
br i1 %38, label %39, label %41
39: ; preds = %25
%40 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
br label %43
41: ; preds = %25
%42 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
br label %43
43: ; preds = %41, %39
%44 = call i32 @printf(i8* getelementptr inbounds ([40 x i8], [40 x i8]* @.str.8, i64 0, i64 0))
%45 = load %struct.ShoppingCart*, %struct.ShoppingCart** %2
%46 = load %struct.CartItem*, %struct.CartItem** %4
%47 = call i32 @containsItem(%struct.ShoppingCart* %45, %struct.CartItem* %46)
%48 = icmp sgt i32 %47, -1
br i1 %48, label %49, label %51
49: ; preds = %43
%50 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
br label %53
51: ; preds = %43
%52 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
br label %53
53: ; preds = %51, %49
%54 = call i32 @printf(i8* getelementptr inbounds ([59 x i8], [59 x i8]* @.str.9, i64 0, i64 0))
%55 = load %struct.ShoppingCart*, %struct.ShoppingCart** %2
%56 = call i32 @getNumItems(%struct.ShoppingCart* %55)
%57 = icmp eq i32 %56, 2
br i1 %57, label %58, label %60
58: ; preds = %53
%59 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
br label %62
60: ; preds = %53
%61 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
br label %62
62: ; preds = %60, %58
%63 = call i32 @printf(i8* getelementptr inbounds ([51 x i8], [51 x i8]* @.str.10, i64 0, i64 0))
%64 = load %struct.ShoppingCart*, %struct.ShoppingCart** %2
%65 = call double @getTotalPrice(%struct.ShoppingCart* %64)
%66 = fcmp oeq double %65, 1.300000e+01
br i1 %66, label %67, label %69
67: ; preds = %62
%68 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
br label %71
69: ; preds = %62
%70 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
br label %71
71: ; preds = %69, %67
%72 = load %struct.ShoppingCart*, %struct.ShoppingCart** %2
%73 = load %struct.CartItem*, %struct.CartItem** %3
%74 = call i32 @removeItemFromCart(%struct.ShoppingCart* %72, %struct.CartItem* %73)
%75 = call i32 @printf(i8* getelementptr inbounds ([65 x i8], [65 x i8]* @.str.11, i64 0, i64 0))
%76 = load %struct.ShoppingCart*, %struct.ShoppingCart** %2
%77 = load %struct.CartItem*, %struct.CartItem** %3
%78 = call i32 @containsItem(%struct.ShoppingCart* %76, %struct.CartItem* %77)
%79 = icmp eq i32 %78, -1
br i1 %79, label %80, label %82
80: ; preds = %71
%81 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
br label %84
82: ; preds = %71
%83 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
br label %84
84: ; preds = %82, %80
%85 = call i32 @printf(i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str.12, i64 0, i64 0))
%86 = load %struct.ShoppingCart*, %struct.ShoppingCart** %2
%87 = load %struct.CartItem*, %struct.CartItem** %4
%88 = call i32 @containsItem(%struct.ShoppingCart* %86, %struct.CartItem* %87)
%89 = icmp sgt i32 %88, -1
br i1 %89, label %90, label %92
90: ; preds = %84
%91 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
br label %94
92: ; preds = %84
%93 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
br label %94
94: ; preds = %92, %90
%95 = call i32 @printf(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.13, i64 0, i64 0))
%96 = load %struct.ShoppingCart*, %struct.ShoppingCart** %2
%97 = call i32 @getNumItems(%struct.ShoppingCart* %96)
%98 = icmp eq i32 %97, 1
br i1 %98, label %99, label %101
99: ; preds = %94
%100 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
br label %103
101: ; preds = %94
%102 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
br label %103
103: ; preds = %101, %99
%104 = call i32 @printf(i8* getelementptr inbounds ([54 x i8], [54 x i8]* @.str.14, i64 0, i64 0))
%105 = load %struct.ShoppingCart*, %struct.ShoppingCart** %2
%106 = call double @getTotalPrice(%struct.ShoppingCart* %105)
%107 = fcmp oeq double %106, 1.000000e+01
br i1 %107, label %108, label %110
108: ; preds = %103
%109 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
br label %112
110: ; preds = %103
%111 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
br label %112
112: ; preds = %110, %108
%113 = load %struct.ShoppingCart*, %struct.ShoppingCart** %2
%114 = load %struct.CartItem*, %struct.CartItem** %3
%115 = call i32 @addItemToCart(%struct.ShoppingCart* %113, %struct.CartItem* %114)
%116 = call %struct.CartItem* @createItem(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.15, i64 0, i64 0), double 2.000000e+00)
store %struct.CartItem* %116, %struct.CartItem** %5
%117 = load %struct.ShoppingCart*, %struct.ShoppingCart** %2
%118 = load %struct.CartItem*, %struct.CartItem** %5
%119 = call i32 @addItemToCart(%struct.ShoppingCart* %117, %struct.CartItem* %118)
%120 = call i32 @printf(i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str.16, i64 0, i64 0))
%121 = load %struct.ShoppingCart*, %struct.ShoppingCart** %2
%122 = load %struct.CartItem*, %struct.CartItem** %5
%123 = call i32 @containsItem(%struct.ShoppingCart* %121, %struct.CartItem* %122)
%124 = icmp eq i32 %123, -1
br i1 %124, label %125, label %127
125: ; preds = %112
%126 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
br label %129
127: ; preds = %112
%128 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
br label %129
129: ; preds = %127, %125
%130 = call i32 @printf(i8* getelementptr inbounds ([69 x i8], [69 x i8]* @.str.17, i64 0, i64 0))
%131 = load %struct.ShoppingCart*, %struct.ShoppingCart** %2
%132 = call i32 @getNumItems(%struct.ShoppingCart* %131)
%133 = icmp eq i32 %132, 2
br i1 %133, label %134, label %136
134: ; preds = %129
%135 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
br label %138
136: ; preds = %129
%137 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
br label %138
138: ; preds = %136, %134
%139 = call i32 @printf(i8* getelementptr inbounds ([61 x i8], [61 x i8]* @.str.18, i64 0, i64 0))
%140 = load %struct.ShoppingCart*, %struct.ShoppingCart** %2
%141 = call double @getTotalPrice(%struct.ShoppingCart* %140)
%142 = fcmp oeq double %141, 1.300000e+01
br i1 %142, label %143, label %145
143: ; preds = %138
%144 = call i32 @printf(i8* getelementptr inbounds ([10 x i8], [10 x i8]* @.str.2, i64 0, i64 0))
br label %147
145: ; preds = %138
%146 = call i32 @printf(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.3, i64 0, i64 0))
br label %147
147: ; preds = %145, %143
%148 = load %struct.ShoppingCart*, %struct.ShoppingCart** %2
%149 = call i32 @freeCart(%struct.ShoppingCart* %148)
ret i32 0
}

LLVM IR (-O2):
%struct.ShoppingCart = type { i32 }
%struct.CartItem = type { i32 }
@.str.1 = [32 x i8] c"Shopping cart should be empty: \00"
@.str.4 = [26 x i8] c"Total Price should be 0: \00"
@.str.5 = [5 x i8] c"milk\00"
@.str.6 = [7 x i8] c"coffee\00"
@.str.7 = [38 x i8] c"Shopping cart should contain 'milk': \00"
@.str.8 = [40 x i8] c"Shopping cart should contain 'coffee': \00"
@.str.9 = [59 x i8] c"After adding items, shopping cart should contain 2 items: \00"
@.str.10 = [51 x i8] c"After adding items, total Price should be $13.00: \00"
@.str.11 = [65 x i8] c"After removing 'milk', shopping cart should not contain 'milk': \00"
@.str.12 = [69 x i8] c"After removing 'milk', shopping cart should still contain 'coffee': \00"
@.str.13 = [61 x i8] c"After removing 'milk', shopping cart should contain 1 item: \00"
@.str.14 = [54 x i8] c"After removing 'milk', total Price should be $10.00: \00"
@.str.15 = [8 x i8] c"avacado\00"
@.str.16 = [69 x i8] c"After adding 'avacado', shopping cart should not contain 'avacado': \00"
@.str.17 = [69 x i8] c"After adding 'avacado', shopping cart should still contain 2 items: \00"
@.str.18 = [61 x i8] c"After adding 'avacado', total Price should still be $13.00: \00"
@str = [28 x i8] c"Creating a shopping cart...\00"
@str.31 = [6 x i8] c"FAIL.\00"
@str.44 = [9 x i8] c"success.\00"
define i32 @main() {
%1 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([28 x i8], [28 x i8]* @str, i64 0, i64 0))
%2 = tail call %struct.ShoppingCart* @createCart(i32 2)
%3 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([32 x i8], [32 x i8]* @.str.1, i64 0, i64 0))
%4 = tail call i32 @getNumItems(%struct.ShoppingCart* %2)
%5 = icmp eq i32 %4, 0
%6 = select i1 %5, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @str.44, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @str.31, i64 0, i64 0)
%7 = tail call i32 @puts(i8* dereferenceable(1) %6)
%8 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([26 x i8], [26 x i8]* @.str.4, i64 0, i64 0))
%9 = tail call double @getTotalPrice(%struct.ShoppingCart* %2)
%10 = fcmp oeq double %9, 0.000000e+00
%11 = select i1 %10, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @str.44, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @str.31, i64 0, i64 0)
%12 = tail call i32 @puts(i8* dereferenceable(1) %11)
%13 = tail call %struct.CartItem* @createItem(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.5, i64 0, i64 0), double 3.000000e+00)
%14 = tail call %struct.CartItem* @createItem(i8* getelementptr inbounds ([7 x i8], [7 x i8]* @.str.6, i64 0, i64 0), double 1.000000e+01)
%15 = tail call i32 @addItemToCart(%struct.ShoppingCart* %2, %struct.CartItem* %13)
%16 = tail call i32 @addItemToCart(%struct.ShoppingCart* %2, %struct.CartItem* %14)
%17 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([38 x i8], [38 x i8]* @.str.7, i64 0, i64 0))
%18 = tail call i32 @containsItem(%struct.ShoppingCart* %2, %struct.CartItem* %13)
%19 = icmp sgt i32 %18, -1
%20 = select i1 %19, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @str.44, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @str.31, i64 0, i64 0)
%21 = tail call i32 @puts(i8* dereferenceable(1) %20)
%22 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([40 x i8], [40 x i8]* @.str.8, i64 0, i64 0))
%23 = tail call i32 @containsItem(%struct.ShoppingCart* %2, %struct.CartItem* %14)
%24 = icmp sgt i32 %23, -1
%25 = select i1 %24, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @str.44, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @str.31, i64 0, i64 0)
%26 = tail call i32 @puts(i8* dereferenceable(1) %25)
%27 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([59 x i8], [59 x i8]* @.str.9, i64 0, i64 0))
%28 = tail call i32 @getNumItems(%struct.ShoppingCart* %2)
%29 = icmp eq i32 %28, 2
%30 = select i1 %29, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @str.44, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @str.31, i64 0, i64 0)
%31 = tail call i32 @puts(i8* dereferenceable(1) %30)
%32 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([51 x i8], [51 x i8]* @.str.10, i64 0, i64 0))
%33 = tail call double @getTotalPrice(%struct.ShoppingCart* %2)
%34 = fcmp oeq double %33, 1.300000e+01
%35 = select i1 %34, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @str.44, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @str.31, i64 0, i64 0)
%36 = tail call i32 @puts(i8* dereferenceable(1) %35)
%37 = tail call i32 @removeItemFromCart(%struct.ShoppingCart* %2, %struct.CartItem* %13)
%38 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([65 x i8], [65 x i8]* @.str.11, i64 0, i64 0))
%39 = tail call i32 @containsItem(%struct.ShoppingCart* %2, %struct.CartItem* %13)
%40 = icmp eq i32 %39, -1
%41 = select i1 %40, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @str.44, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @str.31, i64 0, i64 0)
%42 = tail call i32 @puts(i8* dereferenceable(1) %41)
%43 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([69 x i8], [69 x i8]* @.str.12, i64 0, i64 0))
%44 = tail call i32 @containsItem(%struct.ShoppingCart* %2, %struct.CartItem* %14)
%45 = icmp sgt i32 %44, -1
%46 = select i1 %45, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @str.44, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @str.31, i64 0, i64 0)
%47 = tail call i32 @puts(i8* dereferenceable(1) %46)
%48 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([61 x i8], [61 x i8]* @.str.13, i64 0, i64 0))
%49 = tail call i32 @getNumItems(%struct.ShoppingCart* %2)
%50 = icmp eq i32 %49, 1
%51 = select i1 %50, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @str.44, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @str.31, i64 0, i64 0)
%52 = tail call i32 @puts(i8* dereferenceable(1) %51)
%53 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([54 x i8], [54 x i8]* @.str.14, i64 0, i64 0))
%54 = tail call double @getTotalPrice(%struct.ShoppingCart* %2)
%55 = fcmp oeq double %54, 1.000000e+01
%56 = select i1 %55, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @str.44, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @str.31, i64 0, i64 0)
%57 = tail call i32 @puts(i8* dereferenceable(1) %56)
%58 = tail call i32 @addItemToCart(%struct.ShoppingCart* %2, %struct.CartItem* %13)
%59 = tail call %struct.CartItem* @createItem(i8* getelementptr inbounds ([8 x i8], [8 x i8]* @.str.15, i64 0, i64 0), double 2.000000e+00)
%60 = tail call i32 @addItemToCart(%struct.ShoppingCart* %2, %struct.CartItem* %59)
%61 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([69 x i8], [69 x i8]* @.str.16, i64 0, i64 0))
%62 = tail call i32 @containsItem(%struct.ShoppingCart* %2, %struct.CartItem* %59)
%63 = icmp eq i32 %62, -1
%64 = select i1 %63, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @str.44, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @str.31, i64 0, i64 0)
%65 = tail call i32 @puts(i8* dereferenceable(1) %64)
%66 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([69 x i8], [69 x i8]* @.str.17, i64 0, i64 0))
%67 = tail call i32 @getNumItems(%struct.ShoppingCart* %2)
%68 = icmp eq i32 %67, 2
%69 = select i1 %68, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @str.44, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @str.31, i64 0, i64 0)
%70 = tail call i32 @puts(i8* dereferenceable(1) %69)
%71 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([61 x i8], [61 x i8]* @.str.18, i64 0, i64 0))
%72 = tail call double @getTotalPrice(%struct.ShoppingCart* %2)
%73 = fcmp oeq double %72, 1.300000e+01
%74 = select i1 %73, i8* getelementptr inbounds ([9 x i8], [9 x i8]* @str.44, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @str.31, i64 0, i64 0)
%75 = tail call i32 @puts(i8* dereferenceable(1) %74)
%76 = tail call i32 @freeCart(%struct.ShoppingCart* %2)
ret i32 0
}