void test_strings(void) {
  char *s = "hello";
  do {
    seatest_assert_string_equal("hello", s, __FUNCTION__, 32);
  } while (0);
  do {
    seatest_assert_string_contains("blah", "why say blah?", __FUNCTION__, 33);
  } while (0);
  do {
    seatest_assert_string_doesnt_contain("blah", "why say hello?", __FUNCTION__,
                                         34);
  } while (0);
  do {
    seatest_assert_string_ends_with("h?", "why say blah?", __FUNCTION__, 35);
  } while (0);
  do {
    seatest_assert_string_starts_with("why", "why say blah?", __FUNCTION__, 36);
  } while (0);
}


x86 assembly (clang, -O0):
<test_strings>:
push   %rbp
mov    %rsp,%rbp
sub    $0x10,%rsp
lea    0xea1(%rip),%rax
mov    %rax,-0x8(%rbp)
mov    -0x8(%rbp),%rsi
lea    0xe92(%rip),%rdi
lea    0xe91(%rip),%rdx
mov    $0x20,%ecx
mov    $0x0,%al
call   1050 <seatest_assert_string_equal@plt>
jmp    1186 <test_strings+0x36>
lea    0xe86(%rip),%rdi
lea    0xe84(%rip),%rsi
lea    0xe6b(%rip),%rdx
mov    $0x21,%ecx
mov    $0x0,%al
call   1040 <seatest_assert_string_contains@plt>
jmp    11ac <test_strings+0x5c>
lea    0xe60(%rip),%rdi
lea    0xe6c(%rip),%rsi
lea    0xe45(%rip),%rdx
mov    $0x22,%ecx
mov    $0x0,%al
call   1060 <seatest_assert_string_doesnt_contain@plt>
jmp    11d2 <test_strings+0x82>
lea    0xe4a(%rip),%rdi
lea    0xe38(%rip),%rsi
lea    0xe1f(%rip),%rdx
mov    $0x23,%ecx
mov    $0x0,%al
call   1070 <seatest_assert_string_ends_with@plt>
jmp    11f8 <test_strings+0xa8>
lea    0xe36(%rip),%rdi
lea    0xe12(%rip),%rsi
lea    0xdf9(%rip),%rdx
mov    $0x24,%ecx
mov    $0x0,%al
call   1030 <seatest_assert_string_starts_with@plt>
add    $0x10,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_strings>:
push   %r15
push   %r14
push   %rbx
lea    0xea4(%rip),%rdi
lea    0xea3(%rip),%rbx
mov    %rdi,%rsi
mov    %rbx,%rdx
mov    $0x20,%ecx
xor    %eax,%eax
call   1050 <seatest_assert_string_equal@plt>
lea    0xe97(%rip),%r15
lea    0xe95(%rip),%r14
mov    %r15,%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
mov    $0x21,%ecx
xor    %eax,%eax
call   1040 <seatest_assert_string_contains@plt>
lea    0xe87(%rip),%rsi
mov    %r15,%rdi
mov    %rbx,%rdx
mov    $0x22,%ecx
xor    %eax,%eax
call   1060 <seatest_assert_string_doesnt_contain@plt>
lea    0xe6b(%rip),%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
mov    $0x23,%ecx
xor    %eax,%eax
call   1070 <seatest_assert_string_ends_with@plt>
lea    0xe64(%rip),%rdi
mov    %r14,%rsi
mov    %rbx,%rdx
mov    $0x24,%ecx
xor    %eax,%eax
pop    %rbx
pop    %r14
pop    %r15
jmp    1030 <seatest_assert_string_starts_with@plt>

LLVM IR (-O0):
@.str = [6 x i8] c"hello\00"
@__FUNCTION__.test_strings = [13 x i8] c"test_strings\00"
@.str.1 = [5 x i8] c"blah\00"
@.str.2 = [14 x i8] c"why say blah?\00"
@.str.3 = [15 x i8] c"why say hello?\00"
@.str.4 = [3 x i8] c"h?\00"
@.str.5 = [4 x i8] c"why\00"
define void @test_strings() {
%1 = alloca i8*
store i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8** %1
br label %2
2: ; preds = %0
%3 = load i8*, i8** %1
%4 = call i32 (i8*, i8*, i8*, i32, ...) bitcast (i32 (...)* @seatest_assert_string_equal to i32 (i8*, i8*, i8*, i32, ...)*)(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* %3, i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__FUNCTION__.test_strings, i64 0, i64 0), i32 32)
br label %5
5: ; preds = %2
br label %6
6: ; preds = %5
%7 = call i32 (i8*, i8*, i8*, i32, ...) bitcast (i32 (...)* @seatest_assert_string_contains to i32 (i8*, i8*, i8*, i32, ...)*)(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__FUNCTION__.test_strings, i64 0, i64 0), i32 33)
br label %8
8: ; preds = %6
br label %9
9: ; preds = %8
%10 = call i32 (i8*, i8*, i8*, i32, ...) bitcast (i32 (...)* @seatest_assert_string_doesnt_contain to i32 (i8*, i8*, i8*, i32, ...)*)(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__FUNCTION__.test_strings, i64 0, i64 0), i32 34)
br label %11
11: ; preds = %9
br label %12
12: ; preds = %11
%13 = call i32 (i8*, i8*, i8*, i32, ...) bitcast (i32 (...)* @seatest_assert_string_ends_with to i32 (i8*, i8*, i8*, i32, ...)*)(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__FUNCTION__.test_strings, i64 0, i64 0), i32 35)
br label %14
14: ; preds = %12
br label %15
15: ; preds = %14
%16 = call i32 (i8*, i8*, i8*, i32, ...) bitcast (i32 (...)* @seatest_assert_string_starts_with to i32 (i8*, i8*, i8*, i32, ...)*)(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__FUNCTION__.test_strings, i64 0, i64 0), i32 36)
br label %17
17: ; preds = %15
ret void
}

LLVM IR (-O2):
@.str = [6 x i8] c"hello\00"
@__FUNCTION__.test_strings = [13 x i8] c"test_strings\00"
@.str.1 = [5 x i8] c"blah\00"
@.str.2 = [14 x i8] c"why say blah?\00"
@.str.3 = [15 x i8] c"why say hello?\00"
@.str.4 = [3 x i8] c"h?\00"
@.str.5 = [4 x i8] c"why\00"
define void @test_strings() {
%1 = tail call i32 (i8*, i8*, i8*, i32, ...) bitcast (i32 (...)* @seatest_assert_string_equal to i32 (i8*, i8*, i8*, i32, ...)*)(i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([6 x i8], [6 x i8]* @.str, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__FUNCTION__.test_strings, i64 0, i64 0), i32 32)
%2 = tail call i32 (i8*, i8*, i8*, i32, ...) bitcast (i32 (...)* @seatest_assert_string_contains to i32 (i8*, i8*, i8*, i32, ...)*)(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__FUNCTION__.test_strings, i64 0, i64 0), i32 33)
%3 = tail call i32 (i8*, i8*, i8*, i32, ...) bitcast (i32 (...)* @seatest_assert_string_doesnt_contain to i32 (i8*, i8*, i8*, i32, ...)*)(i8* getelementptr inbounds ([5 x i8], [5 x i8]* @.str.1, i64 0, i64 0), i8* getelementptr inbounds ([15 x i8], [15 x i8]* @.str.3, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__FUNCTION__.test_strings, i64 0, i64 0), i32 34)
%4 = tail call i32 (i8*, i8*, i8*, i32, ...) bitcast (i32 (...)* @seatest_assert_string_ends_with to i32 (i8*, i8*, i8*, i32, ...)*)(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @.str.4, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__FUNCTION__.test_strings, i64 0, i64 0), i32 35)
%5 = tail call i32 (i8*, i8*, i8*, i32, ...) bitcast (i32 (...)* @seatest_assert_string_starts_with to i32 (i8*, i8*, i8*, i32, ...)*)(i8* getelementptr inbounds ([4 x i8], [4 x i8]* @.str.5, i64 0, i64 0), i8* getelementptr inbounds ([14 x i8], [14 x i8]* @.str.2, i64 0, i64 0), i8* getelementptr inbounds ([13 x i8], [13 x i8]* @__FUNCTION__.test_strings, i64 0, i64 0), i32 36)
ret void
}