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

/* Variables and functions */
int /*<<< orphan*/ assert(int);
int /*<<< orphan*/ ll_clear(struct ll *, int /*<<< orphan*/ *);
int /*<<< orphan*/ *ll_first_peek(struct ll *);
int ll_get_size(struct ll *);
int /*<<< orphan*/ *ll_last_peek(struct ll *);
int /*<<< orphan*/ printf(char *);
void assertClear(struct ll *list) {
  assert(list);
  printf("Making sure we can clear the list...");
  assert(ll_get_size(list) == 1);
  ll_clear(list, NULL);
  assert(list);
  assert(ll_first_peek(list) == ll_last_peek(list));
  assert(ll_first_peek(list) == NULL);
  assert(ll_get_size(list) == 0);
  printf("OK\n");
}


x86 assembly (clang, -O0):
<assertClear>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
mov    -0x8(%rbp),%rax
mov    %eax,%edi
call   1060 <assert@plt>
lea    0xe82(%rip),%rdi
call   1040 <printf@plt>
mov    -0x8(%rbp),%rdi
call   1070 <ll_get_size@plt>
cmp    $0x1,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
mov    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1050 <ll_clear@plt>
mov    -0x8(%rbp),%rax
mov    %eax,%edi
call   1060 <assert@plt>
mov    -0x8(%rbp),%rdi
call   1080 <ll_first_peek@plt>
mov    %rax,-0x10(%rbp)
mov    -0x8(%rbp),%rdi
call   1030 <ll_last_peek@plt>
mov    %rax,%rcx
mov    -0x10(%rbp),%rax
cmp    %rcx,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
mov    -0x8(%rbp),%rdi
call   1080 <ll_first_peek@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
mov    -0x8(%rbp),%rdi
call   1070 <ll_get_size@plt>
cmp    $0x0,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1060 <assert@plt>
lea    0xe0a(%rip),%rdi
call   1040 <printf@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<assertClear>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
call   1070 <assert@plt>
lea    0xe7d(%rip),%rdi
call   1050 <printf@plt>
mov    %rbx,%rdi
call   1080 <ll_get_size@plt>
xor    %edi,%edi
cmp    $0x1,%eax
sete   %dil
call   1070 <assert@plt>
mov    %rbx,%rdi
xor    %esi,%esi
call   1060 <ll_clear@plt>
mov    %ebx,%edi
call   1070 <assert@plt>
mov    %rbx,%rdi
call   1090 <ll_first_peek@plt>
mov    %rax,%r14
mov    %rbx,%rdi
call   1030 <ll_last_peek@plt>
xor    %edi,%edi
cmp    %rax,%r14
sete   %dil
call   1070 <assert@plt>
mov    %rbx,%rdi
call   1090 <ll_first_peek@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1070 <assert@plt>
mov    %rbx,%rdi
call   1080 <ll_get_size@plt>
xor    %edi,%edi
test   %eax,%eax
sete   %dil
call   1070 <assert@plt>
lea    0xe23(%rip),%rdi
add    $0x8,%rsp
pop    %rbx
pop    %r14
jmp    1040 <puts@plt>

LLVM IR (-O0):
%struct.ll = type { i32 }
@.str = [37 x i8] c"Making sure we can clear the list...\00"
@.str.1 = [4 x i8] c"OK\0A\00"
define void @assertClear(%struct.ll* %0) {
%2 = alloca %struct.ll*
store %struct.ll* %0, %struct.ll** %2
%3 = load %struct.ll*, %struct.ll** %2
%4 = ptrtoint %struct.ll* %3 to i32
%5 = call i32 @assert(i32 %4)
%6 = call i32 @printf(i8* getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%7 = load %struct.ll*, %struct.ll** %2
%8 = call i32 @ll_get_size(%struct.ll* %7)
%9 = icmp eq i32 %8, 1
%10 = zext i1 %9 to i32
%11 = call i32 @assert(i32 %10)
%12 = load %struct.ll*, %struct.ll** %2
%13 = call i32 @ll_clear(%struct.ll* %12, i32* null)
%14 = load %struct.ll*, %struct.ll** %2
%15 = ptrtoint %struct.ll* %14 to i32
%16 = call i32 @assert(i32 %15)
%17 = load %struct.ll*, %struct.ll** %2
%18 = call i32* @ll_first_peek(%struct.ll* %17)
%19 = load %struct.ll*, %struct.ll** %2
%20 = call i32* @ll_last_peek(%struct.ll* %19)
%21 = icmp eq i32* %18, %20
%22 = zext i1 %21 to i32
%23 = call i32 @assert(i32 %22)
%24 = load %struct.ll*, %struct.ll** %2
%25 = call i32* @ll_first_peek(%struct.ll* %24)
%26 = icmp eq i32* %25, null
%27 = zext i1 %26 to i32
%28 = call i32 @assert(i32 %27)
%29 = load %struct.ll*, %struct.ll** %2
%30 = call i32 @ll_get_size(%struct.ll* %29)
%31 = icmp eq i32 %30, 0
%32 = zext i1 %31 to i32
%33 = call i32 @assert(i32 %32)
%34 = call i32 @printf(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.1, i64 0, i64 0))
ret void
}

LLVM IR (-O2):
%struct.ll = type { i32 }
@.str = [37 x i8] c"Making sure we can clear the list...\00"
@str = [3 x i8] c"OK\00"
define void @assertClear(%struct.ll* %0) {
%2 = ptrtoint %struct.ll* %0 to i64
%3 = trunc i64 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = tail call i32 @printf(i8* dereferenceable(1) getelementptr inbounds ([37 x i8], [37 x i8]* @.str, i64 0, i64 0))
%6 = tail call i32 @ll_get_size(%struct.ll* %0)
%7 = icmp eq i32 %6, 1
%8 = zext i1 %7 to i32
%9 = tail call i32 @assert(i32 %8)
%10 = tail call i32 @ll_clear(%struct.ll* %0, i32* null)
%11 = tail call i32 @assert(i32 %3)
%12 = tail call i32* @ll_first_peek(%struct.ll* %0)
%13 = tail call i32* @ll_last_peek(%struct.ll* %0)
%14 = icmp eq i32* %12, %13
%15 = zext i1 %14 to i32
%16 = tail call i32 @assert(i32 %15)
%17 = tail call i32* @ll_first_peek(%struct.ll* %0)
%18 = icmp eq i32* %17, null
%19 = zext i1 %18 to i32
%20 = tail call i32 @assert(i32 %19)
%21 = tail call i32 @ll_get_size(%struct.ll* %0)
%22 = icmp eq i32 %21, 0
%23 = zext i1 %22 to i32
%24 = tail call i32 @assert(i32 %23)
%25 = tail call i32 @puts(i8* dereferenceable(1) getelementptr inbounds ([3 x i8], [3 x i8]* @str, i64 0, i64 0))
ret void
}