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

/* Variables and functions */
int /*<<< orphan*/ assert(int /*<<< orphan*/);
int /*<<< orphan*/ *st_lookup_string(struct st_root *, char *);
int /*<<< orphan*/ *st_rm_string(struct st_root *, char *);
int do_tests_on_empty_root(struct st_root *root) {
  unsigned int tests = 0;
  assert(st_lookup_string(root, "foo") == NULL);
  assert(st_rm_string(root, "foo") == NULL);
  tests += 2;
  assert(st_lookup_string(root, NULL) == NULL);
  assert(st_rm_string(root, NULL) == NULL);
  tests += 2;
  assert(st_lookup_string(root, "") == NULL);
  assert(st_rm_string(root, "") == NULL);
  tests += 2;
  assert(st_lookup_string(root, "\n") == NULL);
  assert(st_rm_string(root, "\n") == NULL);
  tests += 2;
  return tests;
}


x86 assembly (clang, -O0):
<do_tests_on_empty_root>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
mov    %rdi,-0x8(%rbp)
movl   $0x0,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xeb2(%rip),%rsi
call   1050 <st_lookup_string@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x8(%rbp),%rdi
lea    0xe91(%rip),%rsi
call   1030 <st_rm_string@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0xc(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1050 <st_lookup_string@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x8(%rbp),%rdi
xor    %eax,%eax
mov    %eax,%esi
call   1030 <st_rm_string@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0xc(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xe27(%rip),%rsi
call   1050 <st_lookup_string@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x8(%rbp),%rdi
lea    0xe06(%rip),%rsi
call   1030 <st_rm_string@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0xc(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0xc(%rbp)
mov    -0x8(%rbp),%rdi
lea    0xddb(%rip),%rsi
call   1050 <st_lookup_string@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0x8(%rbp),%rdi
lea    0xdba(%rip),%rsi
call   1030 <st_rm_string@plt>
cmp    $0x0,%rax
sete   %al
and    $0x1,%al
movzbl %al,%edi
call   1040 <assert@plt>
mov    -0xc(%rbp),%eax
add    $0x2,%eax
mov    %eax,-0xc(%rbp)
mov    -0xc(%rbp),%eax
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<do_tests_on_empty_root>:
push   %r14
push   %rbx
push   %rax
mov    %rdi,%rbx
lea    0xec2(%rip),%r14
mov    %r14,%rsi
call   1050 <st_lookup_string@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1040 <assert@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <st_rm_string@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1040 <assert@plt>
mov    %rbx,%rdi
xor    %esi,%esi
call   1050 <st_lookup_string@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1040 <assert@plt>
mov    %rbx,%rdi
xor    %esi,%esi
call   1030 <st_rm_string@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1040 <assert@plt>
lea    0xe61(%rip),%r14
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <st_lookup_string@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1040 <assert@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <st_rm_string@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1040 <assert@plt>
lea    0xe27(%rip),%r14
mov    %rbx,%rdi
mov    %r14,%rsi
call   1050 <st_lookup_string@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1040 <assert@plt>
mov    %rbx,%rdi
mov    %r14,%rsi
call   1030 <st_rm_string@plt>
xor    %edi,%edi
test   %rax,%rax
sete   %dil
call   1040 <assert@plt>
mov    $0x8,%eax
add    $0x8,%rsp
pop    %rbx
pop    %r14
ret

LLVM IR (-O0):
%struct.st_root = type { i32 }
@.str = [4 x i8] c"foo\00"
@.str.1 = [1 x i8] zeroinitializer
@.str.2 = [2 x i8] c"\0A\00"
define i32 @do_tests_on_empty_root(%struct.st_root* %0) {
%2 = alloca %struct.st_root*
%3 = alloca i32
store %struct.st_root* %0, %struct.st_root** %2
store i32 0, i32* %3
%4 = load %struct.st_root*, %struct.st_root** %2
%5 = call i32* @st_lookup_string(%struct.st_root* %4, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%6 = icmp eq i32* %5, null
%7 = zext i1 %6 to i32
%8 = call i32 @assert(i32 %7)
%9 = load %struct.st_root*, %struct.st_root** %2
%10 = call i32* @st_rm_string(%struct.st_root* %9, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%11 = icmp eq i32* %10, null
%12 = zext i1 %11 to i32
%13 = call i32 @assert(i32 %12)
%14 = load i32, i32* %3
%15 = add i32 %14, 2
store i32 %15, i32* %3
%16 = load %struct.st_root*, %struct.st_root** %2
%17 = call i32* @st_lookup_string(%struct.st_root* %16, i8* null)
%18 = icmp eq i32* %17, null
%19 = zext i1 %18 to i32
%20 = call i32 @assert(i32 %19)
%21 = load %struct.st_root*, %struct.st_root** %2
%22 = call i32* @st_rm_string(%struct.st_root* %21, i8* null)
%23 = icmp eq i32* %22, null
%24 = zext i1 %23 to i32
%25 = call i32 @assert(i32 %24)
%26 = load i32, i32* %3
%27 = add i32 %26, 2
store i32 %27, i32* %3
%28 = load %struct.st_root*, %struct.st_root** %2
%29 = call i32* @st_lookup_string(%struct.st_root* %28, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
%30 = icmp eq i32* %29, null
%31 = zext i1 %30 to i32
%32 = call i32 @assert(i32 %31)
%33 = load %struct.st_root*, %struct.st_root** %2
%34 = call i32* @st_rm_string(%struct.st_root* %33, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
%35 = icmp eq i32* %34, null
%36 = zext i1 %35 to i32
%37 = call i32 @assert(i32 %36)
%38 = load i32, i32* %3
%39 = add i32 %38, 2
store i32 %39, i32* %3
%40 = load %struct.st_root*, %struct.st_root** %2
%41 = call i32* @st_lookup_string(%struct.st_root* %40, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%42 = icmp eq i32* %41, null
%43 = zext i1 %42 to i32
%44 = call i32 @assert(i32 %43)
%45 = load %struct.st_root*, %struct.st_root** %2
%46 = call i32* @st_rm_string(%struct.st_root* %45, i8* getelementptr inbounds ([2 x i8], [2 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 = load i32, i32* %3
%51 = add i32 %50, 2
store i32 %51, i32* %3
%52 = load i32, i32* %3
ret i32 %52
}

LLVM IR (-O2):
%struct.st_root = type { i32 }
@.str = [4 x i8] c"foo\00"
@.str.1 = [1 x i8] zeroinitializer
@.str.2 = [2 x i8] c"\0A\00"
define i32 @do_tests_on_empty_root(%struct.st_root* %0) {
%2 = tail call i32* @st_lookup_string(%struct.st_root* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%3 = icmp eq i32* %2, null
%4 = zext i1 %3 to i32
%5 = tail call i32 @assert(i32 %4)
%6 = tail call i32* @st_rm_string(%struct.st_root* %0, i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str, i64 0, i64 0))
%7 = icmp eq i32* %6, null
%8 = zext i1 %7 to i32
%9 = tail call i32 @assert(i32 %8)
%10 = tail call i32* @st_lookup_string(%struct.st_root* %0, i8* null)
%11 = icmp eq i32* %10, null
%12 = zext i1 %11 to i32
%13 = tail call i32 @assert(i32 %12)
%14 = tail call i32* @st_rm_string(%struct.st_root* %0, i8* null)
%15 = icmp eq i32* %14, null
%16 = zext i1 %15 to i32
%17 = tail call i32 @assert(i32 %16)
%18 = tail call i32* @st_lookup_string(%struct.st_root* %0, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
%19 = icmp eq i32* %18, null
%20 = zext i1 %19 to i32
%21 = tail call i32 @assert(i32 %20)
%22 = tail call i32* @st_rm_string(%struct.st_root* %0, i8* getelementptr inbounds ([1 x i8], [1 x i8]* @.str.1, i64 0, i64 0))
%23 = icmp eq i32* %22, null
%24 = zext i1 %23 to i32
%25 = tail call i32 @assert(i32 %24)
%26 = tail call i32* @st_lookup_string(%struct.st_root* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%27 = icmp eq i32* %26, null
%28 = zext i1 %27 to i32
%29 = tail call i32 @assert(i32 %28)
%30 = tail call i32* @st_rm_string(%struct.st_root* %0, i8* getelementptr inbounds ([2 x i8], [2 x i8]* @.str.2, i64 0, i64 0))
%31 = icmp eq i32* %30, null
%32 = zext i1 %31 to i32
%33 = tail call i32 @assert(i32 %32)
ret i32 8
}