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

/* Variables and functions */
int /*<<< orphan*/ assert(int);
struct slist *slist_append(struct slist *, char *);
int /*<<< orphan*/ *slist_find_custom(int /*<<< orphan*/ *,
                                      int /*<<< orphan*/ *,
                                      int /*<<< orphan*/ *);
int /*<<< orphan*/ slist_foreach(int /*<<< orphan*/ *, int /*<<< orphan*/ *,
                                 int /*<<< orphan*/ *);
int /*<<< orphan*/ slist_free(struct slist *, int /*<<< orphan*/ *);
int slist_index(int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ *slist_nth_data(int /*<<< orphan*/ *, int /*<<< orphan*/);
int /*<<< orphan*/ *slist_nth_node(int /*<<< orphan*/ *, int /*<<< orphan*/);
int slist_position(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
int /*<<< orphan*/ *slist_remove(int /*<<< orphan*/ *, int /*<<< orphan*/ *);
struct slist *slist_reverse(struct slist *);
void test_nolist(void) {
  assert(slist_index(NULL, 0) == -1);
  assert(slist_position(NULL, NULL) == -1);
  assert(slist_nth_node(NULL, 0) == NULL);
  assert(slist_nth_data(NULL, 0) == NULL);
  assert(slist_remove(NULL, NULL) == NULL);
  assert(slist_reverse(NULL) == NULL);
  slist_foreach(NULL, NULL, NULL);
  assert(slist_find_custom(NULL, NULL, NULL) == NULL);
  struct slist *sl = NULL;
  sl = slist_append(sl, NULL);
  slist_free(sl, NULL);
  sl = NULL;
  sl = slist_append(sl, "one");
  sl = slist_reverse(sl);
  slist_free(sl, NULL);
}


x86 assembly (clang, -O0):
<test_nolist>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
xor    %eax,%eax
mov    %eax,%edi
xor    %esi,%esi
call   10b0 <slist_index@plt>
cmp    $0xffffffff,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1090 <assert@plt>
xor    %eax,%eax
mov    %eax,%esi
mov    %rsi,%rdi
call   10a0 <slist_position@plt>
cmp    $0xffffffff,%eax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1090 <assert@plt>
xor    %eax,%eax
mov    %eax,%edi
xor    %esi,%esi
call   1060 <slist_nth_node@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1090 <assert@plt>
xor    %eax,%eax
mov    %eax,%edi
xor    %esi,%esi
call   1030 <slist_nth_data@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1090 <assert@plt>
xor    %eax,%eax
mov    %eax,%esi
mov    %rsi,%rdi
call   10d0 <slist_remove@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1090 <assert@plt>
xor    %eax,%eax
mov    %eax,%edi
call   1050 <slist_reverse@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1090 <assert@plt>
xor    %eax,%eax
mov    %eax,%edx
mov    %rdx,%rdi
mov    %rdx,%rsi
call   1080 <slist_foreach@plt>
xor    %eax,%eax
mov    %eax,%edx
mov    %rdx,%rdi
mov    %rdx,%rsi
call   1070 <slist_find_custom@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1090 <assert@plt>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   10c0 <slist_append@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1040 <slist_free@plt>
movq   $0x0,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xd3a(%rip),%rsi
call   10c0 <slist_append@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
call   1050 <slist_reverse@plt>
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1040 <slist_free@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_nolist>:
push   %rax
xor    %edi,%edi
xor    %esi,%esi
call   10b0 <slist_index@plt>
xor    %edi,%edi
cmp    $0xffffffff,%eax
sete   %dil
call   1090 <assert@plt>
xor    %edi,%edi
xor    %esi,%esi
call   10a0 <slist_position@plt>
xor    %edi,%edi
cmp    $0xffffffff,%eax
sete   %dil
call   1090 <assert@plt>
xor    %edi,%edi
xor    %esi,%esi
call   1060 <slist_nth_node@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1090 <assert@plt>
xor    %edi,%edi
xor    %esi,%esi
call   1030 <slist_nth_data@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1090 <assert@plt>
xor    %edi,%edi
xor    %esi,%esi
call   10d0 <slist_remove@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1090 <assert@plt>
xor    %edi,%edi
call   1050 <slist_reverse@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1090 <assert@plt>
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
call   1080 <slist_foreach@plt>
xor    %edi,%edi
xor    %esi,%esi
xor    %edx,%edx
call   1070 <slist_find_custom@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1090 <assert@plt>
xor    %edi,%edi
xor    %esi,%esi
call   10c0 <slist_append@plt>
mov    %rax,%rdi
xor    %esi,%esi
call   1040 <slist_free@plt>
lea    0xd89(%rip),%rsi
xor    %edi,%edi
call   10c0 <slist_append@plt>
mov    %rax,%rdi
call   1050 <slist_reverse@plt>
mov    %rax,%rdi
xor    %esi,%esi
pop    %rax
jmp    1040 <slist_free@plt>

LLVM IR (-O0):
%struct.slist = type { i32 }
@.str = [4 x i8] c"one\00"
define void @test_nolist() {
%1 = alloca %struct.slist*
%2 = call i32 @slist_index(i32* null, i32 0)
%3 = icmp eq i32 %2, -1
%4 = zext i1 %3 to i32
%5 = call i32 @assert(i32 %4)
%6 = call i32 @slist_position(i32* null, i32* null)
%7 = icmp eq i32 %6, -1
%8 = zext i1 %7 to i32
%9 = call i32 @assert(i32 %8)
%10 = call i32* @slist_nth_node(i32* null, i32 0)
%11 = icmp eq i32* %10, null
%12 = zext i1 %11 to i32
%13 = call i32 @assert(i32 %12)
%14 = call i32* @slist_nth_data(i32* null, i32 0)
%15 = icmp eq i32* %14, null
%16 = zext i1 %15 to i32
%17 = call i32 @assert(i32 %16)
%18 = call i32* @slist_remove(i32* null, i32* null)
%19 = icmp eq i32* %18, null
%20 = zext i1 %19 to i32
%21 = call i32 @assert(i32 %20)
%22 = call %struct.slist* @slist_reverse(%struct.slist* null)
%23 = icmp eq %struct.slist* %22, null
%24 = zext i1 %23 to i32
%25 = call i32 @assert(i32 %24)
%26 = call i32 @slist_foreach(i32* null, i32* null, i32* null)
%27 = call i32* @slist_find_custom(i32* null, i32* null, i32* null)
%28 = icmp eq i32* %27, null
%29 = zext i1 %28 to i32
%30 = call i32 @assert(i32 %29)
store %struct.slist* null, %struct.slist** %1
%31 = load %struct.slist*, %struct.slist** %1
%32 = call %struct.slist* @slist_append(%struct.slist* %31, i8* null)
store %struct.slist* %32, %struct.slist** %1
%33 = load %struct.slist*, %struct.slist** %1
%34 = call i32 @slist_free(%struct.slist* %33, i32* null)
store %struct.slist* null, %struct.slist** %1
%35 = load %struct.slist*, %struct.slist** %1
%36 = call %struct.slist* @slist_append(%struct.slist* %35, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
store %struct.slist* %36, %struct.slist** %1
%37 = load %struct.slist*, %struct.slist** %1
%38 = call %struct.slist* @slist_reverse(%struct.slist* %37)
store %struct.slist* %38, %struct.slist** %1
%39 = load %struct.slist*, %struct.slist** %1
%40 = call i32 @slist_free(%struct.slist* %39, i32* null)
ret void
}

LLVM IR (-O2):
%struct.slist = type { i32 }
@.str = [4 x i8] c"one\00"
define void @test_nolist() {
%1 = tail call i32 @slist_index(i32* null, i32 0)
%2 = icmp eq i32 %1, -1
%3 = zext i1 %2 to i32
%4 = tail call i32 @assert(i32 %3)
%5 = tail call i32 @slist_position(i32* null, i32* null)
%6 = icmp eq i32 %5, -1
%7 = zext i1 %6 to i32
%8 = tail call i32 @assert(i32 %7)
%9 = tail call i32* @slist_nth_node(i32* null, i32 0)
%10 = icmp eq i32* %9, null
%11 = zext i1 %10 to i32
%12 = tail call i32 @assert(i32 %11)
%13 = tail call i32* @slist_nth_data(i32* null, i32 0)
%14 = icmp eq i32* %13, null
%15 = zext i1 %14 to i32
%16 = tail call i32 @assert(i32 %15)
%17 = tail call i32* @slist_remove(i32* null, i32* null)
%18 = icmp eq i32* %17, null
%19 = zext i1 %18 to i32
%20 = tail call i32 @assert(i32 %19)
%21 = tail call %struct.slist* @slist_reverse(%struct.slist* null)
%22 = icmp eq %struct.slist* %21, null
%23 = zext i1 %22 to i32
%24 = tail call i32 @assert(i32 %23)
%25 = tail call i32 @slist_foreach(i32* null, i32* null, i32* null)
%26 = tail call i32* @slist_find_custom(i32* null, i32* null, i32* null)
%27 = icmp eq i32* %26, null
%28 = zext i1 %27 to i32
%29 = tail call i32 @assert(i32 %28)
%30 = tail call %struct.slist* @slist_append(%struct.slist* null, i8* null)
%31 = tail call i32 @slist_free(%struct.slist* %30, i32* null)
%32 = tail call %struct.slist* @slist_append(%struct.slist* null, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%33 = tail call %struct.slist* @slist_reverse(%struct.slist* %32)
%34 = tail call i32 @slist_free(%struct.slist* %33, i32* null)
ret void
}